repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
rstoneback/pysat
pysat/_instrument.py
Instrument._get_data_info
def _get_data_info(self, data, file_format): """Support file writing by determiniing data type and other options Parameters ---------- data : pandas object Data to be written file_format : basestring String indicating netCDF3 or netCDF4 Returns ...
python
def _get_data_info(self, data, file_format): """Support file writing by determiniing data type and other options Parameters ---------- data : pandas object Data to be written file_format : basestring String indicating netCDF3 or netCDF4 Returns ...
[ "def", "_get_data_info", "(", "self", ",", "data", ",", "file_format", ")", ":", "# get type of data", "data_type", "=", "data", ".", "dtype", "# check if older file_format", "# if file_format[:7] == 'NETCDF3':", "if", "file_format", "!=", "'NETCDF4'", ":", "old_format"...
Support file writing by determiniing data type and other options Parameters ---------- data : pandas object Data to be written file_format : basestring String indicating netCDF3 or netCDF4 Returns ------- data_flag, datetime_flag, old_for...
[ "Support", "file", "writing", "by", "determiniing", "data", "type", "and", "other", "options" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_instrument.py#L1252-L1303
rstoneback/pysat
pysat/_instrument.py
Instrument._filter_netcdf4_metadata
def _filter_netcdf4_metadata(self, mdata_dict, coltype, remove=False): """Filter metadata properties to be consistent with netCDF4. Notes ----- removed forced to True if coltype consistent with a string type Parameters ---------- mdata_dict : dic...
python
def _filter_netcdf4_metadata(self, mdata_dict, coltype, remove=False): """Filter metadata properties to be consistent with netCDF4. Notes ----- removed forced to True if coltype consistent with a string type Parameters ---------- mdata_dict : dic...
[ "def", "_filter_netcdf4_metadata", "(", "self", ",", "mdata_dict", ",", "coltype", ",", "remove", "=", "False", ")", ":", "# Coerce boolean types to integers", "for", "key", "in", "mdata_dict", ":", "if", "type", "(", "mdata_dict", "[", "key", "]", ")", "==", ...
Filter metadata properties to be consistent with netCDF4. Notes ----- removed forced to True if coltype consistent with a string type Parameters ---------- mdata_dict : dict Dictionary equivalent to Meta object info coltype : type ...
[ "Filter", "metadata", "properties", "to", "be", "consistent", "with", "netCDF4", ".", "Notes", "-----", "removed", "forced", "to", "True", "if", "coltype", "consistent", "with", "a", "string", "type", "Parameters", "----------", "mdata_dict", ":", "dict", "Dicti...
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_instrument.py#L1305-L1346
rstoneback/pysat
pysat/_instrument.py
Instrument.generic_meta_translator
def generic_meta_translator(self, meta_to_translate): '''Translates the metadate contained in an object into a dictionary suitable for export. Parameters ---------- meta_to_translate : Meta The metadata object to translate Returns ------- dic...
python
def generic_meta_translator(self, meta_to_translate): '''Translates the metadate contained in an object into a dictionary suitable for export. Parameters ---------- meta_to_translate : Meta The metadata object to translate Returns ------- dic...
[ "def", "generic_meta_translator", "(", "self", ",", "meta_to_translate", ")", ":", "export_dict", "=", "{", "}", "if", "self", ".", "_meta_translation_table", "is", "not", "None", ":", "# Create a translation table for the actual values of the meta labels.", "# The instrume...
Translates the metadate contained in an object into a dictionary suitable for export. Parameters ---------- meta_to_translate : Meta The metadata object to translate Returns ------- dict A dictionary of the metadata for each variable of a...
[ "Translates", "the", "metadate", "contained", "in", "an", "object", "into", "a", "dictionary", "suitable", "for", "export", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_instrument.py#L1348-L1406
rstoneback/pysat
pysat/_instrument.py
Instrument.to_netcdf4
def to_netcdf4(self, fname=None, base_instrument=None, epoch_name='Epoch', zlib=False, complevel=4, shuffle=True): """Stores loaded data into a netCDF4 file. Parameters ---------- fname : string full path to save instrument object to base_i...
python
def to_netcdf4(self, fname=None, base_instrument=None, epoch_name='Epoch', zlib=False, complevel=4, shuffle=True): """Stores loaded data into a netCDF4 file. Parameters ---------- fname : string full path to save instrument object to base_i...
[ "def", "to_netcdf4", "(", "self", ",", "fname", "=", "None", ",", "base_instrument", "=", "None", ",", "epoch_name", "=", "'Epoch'", ",", "zlib", "=", "False", ",", "complevel", "=", "4", ",", "shuffle", "=", "True", ")", ":", "import", "netCDF4", "imp...
Stores loaded data into a netCDF4 file. Parameters ---------- fname : string full path to save instrument object to base_instrument : pysat.Instrument used as a comparison, only attributes that are present with self and not on base_instrument ...
[ "Stores", "loaded", "data", "into", "a", "netCDF4", "file", ".", "Parameters", "----------", "fname", ":", "string", "full", "path", "to", "save", "instrument", "object", "to", "base_instrument", ":", "pysat", ".", "Instrument", "used", "as", "a", "comparison"...
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_instrument.py#L1409-L1823
emc-openstack/storops
storops/lib/converter.py
to_alu_hlu_map
def to_alu_hlu_map(input_str): """Converter for alu hlu map Convert following input into a alu -> hlu map: Sample input: ``` HLU Number ALU Number ---------- ---------- 0 12 1 23 ``` ALU stands for array LUN number hlu stands...
python
def to_alu_hlu_map(input_str): """Converter for alu hlu map Convert following input into a alu -> hlu map: Sample input: ``` HLU Number ALU Number ---------- ---------- 0 12 1 23 ``` ALU stands for array LUN number hlu stands...
[ "def", "to_alu_hlu_map", "(", "input_str", ")", ":", "ret", "=", "{", "}", "if", "input_str", "is", "not", "None", ":", "pattern", "=", "re", ".", "compile", "(", "r'(\\d+)\\s*(\\d+)'", ")", "for", "line", "in", "input_str", ".", "split", "(", "'\\n'", ...
Converter for alu hlu map Convert following input into a alu -> hlu map: Sample input: ``` HLU Number ALU Number ---------- ---------- 0 12 1 23 ``` ALU stands for array LUN number hlu stands for host LUN number :param input_...
[ "Converter", "for", "alu", "hlu", "map" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/converter.py#L126-L158
emc-openstack/storops
storops/lib/converter.py
to_disk_indices
def to_disk_indices(value): """Convert following input to disk indices Sample input: ``` Disks: Bus 0 Enclosure 0 Disk 9 Bus 1 Enclosure 0 Disk 12 Bus 1 Enclosure 0 Disk 9 Bus 0 Enclosure 0 Disk 4 Bus 0 Enclosure 0 Disk 7 ``` :param value: disk list :return: disk indic...
python
def to_disk_indices(value): """Convert following input to disk indices Sample input: ``` Disks: Bus 0 Enclosure 0 Disk 9 Bus 1 Enclosure 0 Disk 12 Bus 1 Enclosure 0 Disk 9 Bus 0 Enclosure 0 Disk 4 Bus 0 Enclosure 0 Disk 7 ``` :param value: disk list :return: disk indic...
[ "def", "to_disk_indices", "(", "value", ")", ":", "ret", "=", "[", "]", "p", "=", "re", ".", "compile", "(", "r'Bus\\s+(\\w+)\\s+Enclosure\\s+(\\w+)\\s+Disk\\s+(\\w+)'", ")", "if", "value", "is", "not", "None", ":", "for", "line", "in", "value", ".", "split"...
Convert following input to disk indices Sample input: ``` Disks: Bus 0 Enclosure 0 Disk 9 Bus 1 Enclosure 0 Disk 12 Bus 1 Enclosure 0 Disk 9 Bus 0 Enclosure 0 Disk 4 Bus 0 Enclosure 0 Disk 7 ``` :param value: disk list :return: disk indices in list
[ "Convert", "following", "input", "to", "disk", "indices" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/converter.py#L161-L190
emc-openstack/storops
storops/lib/converter.py
url_to_host
def url_to_host(url): """convert a url to a host (ip or domain) :param url: url string :returns: host: domain name or ipv4/v6 address :rtype: str :raises: ValueError: given an illegal url that without a ip or domain name """ regex_url = r"([a-z][a-z0-9+\-.]*://)?" + \ r"([a...
python
def url_to_host(url): """convert a url to a host (ip or domain) :param url: url string :returns: host: domain name or ipv4/v6 address :rtype: str :raises: ValueError: given an illegal url that without a ip or domain name """ regex_url = r"([a-z][a-z0-9+\-.]*://)?" + \ r"([a...
[ "def", "url_to_host", "(", "url", ")", ":", "regex_url", "=", "r\"([a-z][a-z0-9+\\-.]*://)?\"", "+", "r\"([a-z0-9\\-._~%!$&'()*+,;=]+@)?\"", "+", "r\"([a-z0-9\\-._~%]+\"", "+", "r\"|\\[[a-z0-9\\-._~%!$&'()*+,;=:]+\\])?\"", "+", "r\"(:(?P<port>[0-9]+))?\"", "m", "=", "re", "."...
convert a url to a host (ip or domain) :param url: url string :returns: host: domain name or ipv4/v6 address :rtype: str :raises: ValueError: given an illegal url that without a ip or domain name
[ "convert", "a", "url", "to", "a", "host", "(", "ip", "or", "domain", ")" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/converter.py#L235-L254
emc-openstack/storops
storops/lib/converter.py
parse_host_address
def parse_host_address(addr): """ parse host address to get domain name or ipv4/v6 address, cidr prefix and net mask code string if given a subnet address :param addr: :type addr: str :return: parsed domain name/ipv4 address/ipv6 address, cidr prefix if there is, net m...
python
def parse_host_address(addr): """ parse host address to get domain name or ipv4/v6 address, cidr prefix and net mask code string if given a subnet address :param addr: :type addr: str :return: parsed domain name/ipv4 address/ipv6 address, cidr prefix if there is, net m...
[ "def", "parse_host_address", "(", "addr", ")", ":", "if", "addr", ".", "startswith", "(", "'['", ")", "and", "addr", ".", "endswith", "(", "']'", ")", ":", "addr", "=", "addr", "[", "1", ":", "-", "1", "]", "parts", "=", "addr", ".", "split", "("...
parse host address to get domain name or ipv4/v6 address, cidr prefix and net mask code string if given a subnet address :param addr: :type addr: str :return: parsed domain name/ipv4 address/ipv6 address, cidr prefix if there is, net mask code string if there is :rtype: (s...
[ "parse", "host", "address", "to", "get", "domain", "name", "or", "ipv4", "/", "v6", "address", "cidr", "prefix", "and", "net", "mask", "code", "string", "if", "given", "a", "subnet", "address" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/converter.py#L257-L286
emc-openstack/storops
storops/lib/converter.py
ipv4_prefix_to_mask
def ipv4_prefix_to_mask(prefix): """ ipv4 cidr prefix to net mask :param prefix: cidr prefix , rang in (0, 32) :type prefix: int :return: dot separated ipv4 net mask code, eg: 255.255.255.0 :rtype: str """ if prefix > 32 or prefix < 0: raise ValueError("invalid cidr prefix for i...
python
def ipv4_prefix_to_mask(prefix): """ ipv4 cidr prefix to net mask :param prefix: cidr prefix , rang in (0, 32) :type prefix: int :return: dot separated ipv4 net mask code, eg: 255.255.255.0 :rtype: str """ if prefix > 32 or prefix < 0: raise ValueError("invalid cidr prefix for i...
[ "def", "ipv4_prefix_to_mask", "(", "prefix", ")", ":", "if", "prefix", ">", "32", "or", "prefix", "<", "0", ":", "raise", "ValueError", "(", "\"invalid cidr prefix for ipv4\"", ")", "else", ":", "mask", "=", "(", "(", "1", "<<", "32", ")", "-", "1", ")...
ipv4 cidr prefix to net mask :param prefix: cidr prefix , rang in (0, 32) :type prefix: int :return: dot separated ipv4 net mask code, eg: 255.255.255.0 :rtype: str
[ "ipv4", "cidr", "prefix", "to", "net", "mask" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/converter.py#L289-L309
emc-openstack/storops
storops/lib/converter.py
ipv6_prefix_to_mask
def ipv6_prefix_to_mask(prefix): """ ipv6 cidr prefix to net mask :param prefix: cidr prefix, rang in (0, 128) :type prefix: int :return: comma separated ipv6 net mask code, eg: ffff:ffff:ffff:ffff:0000:0000:0000:0000 :rtype: str """ if prefix > 128 or prefix < 0: r...
python
def ipv6_prefix_to_mask(prefix): """ ipv6 cidr prefix to net mask :param prefix: cidr prefix, rang in (0, 128) :type prefix: int :return: comma separated ipv6 net mask code, eg: ffff:ffff:ffff:ffff:0000:0000:0000:0000 :rtype: str """ if prefix > 128 or prefix < 0: r...
[ "def", "ipv6_prefix_to_mask", "(", "prefix", ")", ":", "if", "prefix", ">", "128", "or", "prefix", "<", "0", ":", "raise", "ValueError", "(", "\"invalid cidr prefix for ipv6\"", ")", "else", ":", "mask", "=", "(", "(", "1", "<<", "128", ")", "-", "1", ...
ipv6 cidr prefix to net mask :param prefix: cidr prefix, rang in (0, 128) :type prefix: int :return: comma separated ipv6 net mask code, eg: ffff:ffff:ffff:ffff:0000:0000:0000:0000 :rtype: str
[ "ipv6", "cidr", "prefix", "to", "net", "mask" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/converter.py#L312-L333
emc-openstack/storops
storops/unity/resource/lun.py
UnityLun.expand
def expand(self, new_size): """ expand the LUN to a new size :param new_size: new size in bytes. :return: the old size """ ret = self.size_total resp = self.modify(size=new_size) resp.raise_if_err() return ret
python
def expand(self, new_size): """ expand the LUN to a new size :param new_size: new size in bytes. :return: the old size """ ret = self.size_total resp = self.modify(size=new_size) resp.raise_if_err() return ret
[ "def", "expand", "(", "self", ",", "new_size", ")", ":", "ret", "=", "self", ".", "size_total", "resp", "=", "self", ".", "modify", "(", "size", "=", "new_size", ")", "resp", ".", "raise_if_err", "(", ")", "return", "ret" ]
expand the LUN to a new size :param new_size: new size in bytes. :return: the old size
[ "expand", "the", "LUN", "to", "a", "new", "size" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/lun.py#L195-L204
emc-openstack/storops
storops/unity/resource/lun.py
UnityLun.update_hosts
def update_hosts(self, host_names): """Primarily for puppet-unity use. Update the hosts for the lun if needed. :param host_names: specify the new hosts which access the LUN. """ if self.host_access: curr_hosts = [access.host.name for access in self.host_access] ...
python
def update_hosts(self, host_names): """Primarily for puppet-unity use. Update the hosts for the lun if needed. :param host_names: specify the new hosts which access the LUN. """ if self.host_access: curr_hosts = [access.host.name for access in self.host_access] ...
[ "def", "update_hosts", "(", "self", ",", "host_names", ")", ":", "if", "self", ".", "host_access", ":", "curr_hosts", "=", "[", "access", ".", "host", ".", "name", "for", "access", "in", "self", ".", "host_access", "]", "else", ":", "curr_hosts", "=", ...
Primarily for puppet-unity use. Update the hosts for the lun if needed. :param host_names: specify the new hosts which access the LUN.
[ "Primarily", "for", "puppet", "-", "unity", "use", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/lun.py#L314-L340
emc-openstack/storops
storops/unity/resource/lun.py
UnityLun.replicate
def replicate(self, dst_lun_id, max_time_out_of_sync, replication_name=None, replicate_existing_snaps=None, remote_system=None): """ Creates a replication session with a existing lun as destination. :param dst_lun_id: destination lun id. :param max_ti...
python
def replicate(self, dst_lun_id, max_time_out_of_sync, replication_name=None, replicate_existing_snaps=None, remote_system=None): """ Creates a replication session with a existing lun as destination. :param dst_lun_id: destination lun id. :param max_ti...
[ "def", "replicate", "(", "self", ",", "dst_lun_id", ",", "max_time_out_of_sync", ",", "replication_name", "=", "None", ",", "replicate_existing_snaps", "=", "None", ",", "remote_system", "=", "None", ")", ":", "return", "UnityReplicationSession", ".", "create", "(...
Creates a replication session with a existing lun as destination. :param dst_lun_id: destination lun id. :param max_time_out_of_sync: maximum time to wait before syncing the source and destination. Value `-1` means the automatic sync is not performed. `0` means it is a sync repl...
[ "Creates", "a", "replication", "session", "with", "a", "existing", "lun", "as", "destination", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/lun.py#L415-L437
emc-openstack/storops
storops/unity/resource/lun.py
UnityLun.replicate_with_dst_resource_provisioning
def replicate_with_dst_resource_provisioning(self, max_time_out_of_sync, dst_pool_id, dst_lun_name=None, remote_system=None, ...
python
def replicate_with_dst_resource_provisioning(self, max_time_out_of_sync, dst_pool_id, dst_lun_name=None, remote_system=None, ...
[ "def", "replicate_with_dst_resource_provisioning", "(", "self", ",", "max_time_out_of_sync", ",", "dst_pool_id", ",", "dst_lun_name", "=", "None", ",", "remote_system", "=", "None", ",", "replication_name", "=", "None", ",", "dst_size", "=", "None", ",", "dst_sp", ...
Creates a replication session with destination lun provisioning. :param max_time_out_of_sync: maximum time to wait before syncing the source and destination. Value `-1` means the automatic sync is not performed. `0` means it is a sync replication. :param dst_pool_id: id of pool ...
[ "Creates", "a", "replication", "session", "with", "destination", "lun", "provisioning", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/lun.py#L439-L480
emc-openstack/storops
storops/unity/resource/port.py
UnityIpPort.get_physical_port
def get_physical_port(self): """Returns the link aggregation object or the ethernet port object.""" obj = None if self.is_link_aggregation(): obj = UnityLinkAggregation.get(self._cli, self.get_id()) else: obj = UnityEthernetPort.get(self._cli, self.get_id()) ...
python
def get_physical_port(self): """Returns the link aggregation object or the ethernet port object.""" obj = None if self.is_link_aggregation(): obj = UnityLinkAggregation.get(self._cli, self.get_id()) else: obj = UnityEthernetPort.get(self._cli, self.get_id()) ...
[ "def", "get_physical_port", "(", "self", ")", ":", "obj", "=", "None", "if", "self", ".", "is_link_aggregation", "(", ")", ":", "obj", "=", "UnityLinkAggregation", ".", "get", "(", "self", ".", "_cli", ",", "self", ".", "get_id", "(", ")", ")", "else",...
Returns the link aggregation object or the ethernet port object.
[ "Returns", "the", "link", "aggregation", "object", "or", "the", "ethernet", "port", "object", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/port.py#L51-L58
emc-openstack/storops
storops/unity/resource/replication_session.py
UnityResourceConfig.to_embedded
def to_embedded(pool_id=None, is_thin_enabled=None, is_deduplication_enabled=None, is_compression_enabled=None, is_backup_only=None, size=None, tiering_policy=None, request_id=None, src_id=None, name=None, default_sp=None, replication_resou...
python
def to_embedded(pool_id=None, is_thin_enabled=None, is_deduplication_enabled=None, is_compression_enabled=None, is_backup_only=None, size=None, tiering_policy=None, request_id=None, src_id=None, name=None, default_sp=None, replication_resou...
[ "def", "to_embedded", "(", "pool_id", "=", "None", ",", "is_thin_enabled", "=", "None", ",", "is_deduplication_enabled", "=", "None", ",", "is_compression_enabled", "=", "None", ",", "is_backup_only", "=", "None", ",", "size", "=", "None", ",", "tiering_policy",...
Constructs an embeded object of `UnityResourceConfig`. :param pool_id: storage pool of the resource. :param is_thin_enabled: is thin type or not. :param is_deduplication_enabled: is deduplication enabled or not. :param is_compression_enabled: is in-line compression (ILC) enabled or ...
[ "Constructs", "an", "embeded", "object", "of", "UnityResourceConfig", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_session.py#L56-L88
emc-openstack/storops
storops/unity/resource/replication_session.py
UnityReplicationSession.create
def create(cls, cli, src_resource_id, dst_resource_id, max_time_out_of_sync, name=None, members=None, auto_initiate=None, hourly_snap_replication_policy=None, daily_snap_replication_policy=None, replicate_existing_snaps=None, remote_system=None, ...
python
def create(cls, cli, src_resource_id, dst_resource_id, max_time_out_of_sync, name=None, members=None, auto_initiate=None, hourly_snap_replication_policy=None, daily_snap_replication_policy=None, replicate_existing_snaps=None, remote_system=None, ...
[ "def", "create", "(", "cls", ",", "cli", ",", "src_resource_id", ",", "dst_resource_id", ",", "max_time_out_of_sync", ",", "name", "=", "None", ",", "members", "=", "None", ",", "auto_initiate", "=", "None", ",", "hourly_snap_replication_policy", "=", "None", ...
Creates a replication session. :param cli: the rest cli. :param src_resource_id: id of the replication source, could be lun/fs/cg. :param dst_resource_id: id of the replication destination. :param max_time_out_of_sync: maximum time to wait before syncing the sour...
[ "Creates", "a", "replication", "session", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_session.py#L94-L156
emc-openstack/storops
storops/unity/resource/replication_session.py
UnityReplicationSession.create_with_dst_resource_provisioning
def create_with_dst_resource_provisioning( cls, cli, src_resource_id, dst_resource_config, max_time_out_of_sync, name=None, remote_system=None, src_spa_interface=None, src_spb_interface=None, dst_spa_interface=None, dst_spb_interface=None, dst_resource_element...
python
def create_with_dst_resource_provisioning( cls, cli, src_resource_id, dst_resource_config, max_time_out_of_sync, name=None, remote_system=None, src_spa_interface=None, src_spb_interface=None, dst_spa_interface=None, dst_spb_interface=None, dst_resource_element...
[ "def", "create_with_dst_resource_provisioning", "(", "cls", ",", "cli", ",", "src_resource_id", ",", "dst_resource_config", ",", "max_time_out_of_sync", ",", "name", "=", "None", ",", "remote_system", "=", "None", ",", "src_spa_interface", "=", "None", ",", "src_spb...
Create a replication session along with destination resource provisioning. :param cli: the rest cli. :param src_resource_id: id of the replication source, could be lun/fs/cg. :param dst_resource_config: `UnityResourceConfig` object. The user chosen config for des...
[ "Create", "a", "replication", "session", "along", "with", "destination", "resource", "provisioning", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_session.py#L159-L236
emc-openstack/storops
storops/unity/resource/replication_session.py
UnityReplicationSession.modify
def modify(self, max_time_out_of_sync=None, name=None, hourly_snap_replication_policy=None, daily_snap_replication_policy=None, src_spa_interface=None, src_spb_interface=None, dst_spa_interface=None, dst_spb_interface=None): """ Modifies proper...
python
def modify(self, max_time_out_of_sync=None, name=None, hourly_snap_replication_policy=None, daily_snap_replication_policy=None, src_spa_interface=None, src_spb_interface=None, dst_spa_interface=None, dst_spb_interface=None): """ Modifies proper...
[ "def", "modify", "(", "self", ",", "max_time_out_of_sync", "=", "None", ",", "name", "=", "None", ",", "hourly_snap_replication_policy", "=", "None", ",", "daily_snap_replication_policy", "=", "None", ",", "src_spa_interface", "=", "None", ",", "src_spb_interface", ...
Modifies properties of a replication session. :param max_time_out_of_sync: same as the one in `create` method. :param name: same as the one in `create` method. :param hourly_snap_replication_policy: same as the one in `create` method. :param daily_snap_replication_policy: sa...
[ "Modifies", "properties", "of", "a", "replication", "session", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_session.py#L238-L268
emc-openstack/storops
storops/unity/resource/replication_session.py
UnityReplicationSession.resume
def resume(self, force_full_copy=None, src_spa_interface=None, src_spb_interface=None, dst_spa_interface=None, dst_spb_interface=None): """ Resumes a replication session. This can be applied on replication session when it's operational status is reported as...
python
def resume(self, force_full_copy=None, src_spa_interface=None, src_spb_interface=None, dst_spa_interface=None, dst_spb_interface=None): """ Resumes a replication session. This can be applied on replication session when it's operational status is reported as...
[ "def", "resume", "(", "self", ",", "force_full_copy", "=", "None", ",", "src_spa_interface", "=", "None", ",", "src_spb_interface", "=", "None", ",", "dst_spa_interface", "=", "None", ",", "dst_spb_interface", "=", "None", ")", ":", "req_body", "=", "self", ...
Resumes a replication session. This can be applied on replication session when it's operational status is reported as Failed over, or Paused. :param force_full_copy: needed when replication session goes out of sync due to a fault. True - replicate all data. ...
[ "Resumes", "a", "replication", "session", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_session.py#L270-L296
emc-openstack/storops
storops/unity/resource/replication_session.py
UnityReplicationSession.failover
def failover(self, sync=None, force=None): """ Fails over a replication session. :param sync: True - sync the source and destination resources before failing over the asynchronous replication session or keep them in sync after failing over the synchronous replication ses...
python
def failover(self, sync=None, force=None): """ Fails over a replication session. :param sync: True - sync the source and destination resources before failing over the asynchronous replication session or keep them in sync after failing over the synchronous replication ses...
[ "def", "failover", "(", "self", ",", "sync", "=", "None", ",", "force", "=", "None", ")", ":", "req_body", "=", "self", ".", "_cli", ".", "make_body", "(", "sync", "=", "sync", ",", "force", "=", "force", ")", "resp", "=", "self", ".", "action", ...
Fails over a replication session. :param sync: True - sync the source and destination resources before failing over the asynchronous replication session or keep them in sync after failing over the synchronous replication session. False - don't sync. :param force: Tru...
[ "Fails", "over", "a", "replication", "session", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_session.py#L319-L335
emc-openstack/storops
storops/unity/resource/replication_session.py
UnityReplicationSession.failback
def failback(self, force_full_copy=None): """ Fails back a replication session. This can be applied on a replication session that is failed over. Fail back will synchronize the changes done to original destination back to original source site and will restore the original direct...
python
def failback(self, force_full_copy=None): """ Fails back a replication session. This can be applied on a replication session that is failed over. Fail back will synchronize the changes done to original destination back to original source site and will restore the original direct...
[ "def", "failback", "(", "self", ",", "force_full_copy", "=", "None", ")", ":", "req_body", "=", "self", ".", "_cli", ".", "make_body", "(", "forceFullCopy", "=", "force_full_copy", ")", "resp", "=", "self", ".", "action", "(", "'failback'", ",", "*", "*"...
Fails back a replication session. This can be applied on a replication session that is failed over. Fail back will synchronize the changes done to original destination back to original source site and will restore the original direction of session. :param force_full_copy: indic...
[ "Fails", "back", "a", "replication", "session", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_session.py#L337-L354
rstoneback/pysat
pysat/_orbits.py
Orbits._calcOrbits
def _calcOrbits(self): """Prepares data structure for breaking data into orbits. Not intended for end user.""" # if the breaks between orbit have not been defined, define them # also, store the data so that grabbing different orbits does not # require reloads of whole dataset ...
python
def _calcOrbits(self): """Prepares data structure for breaking data into orbits. Not intended for end user.""" # if the breaks between orbit have not been defined, define them # also, store the data so that grabbing different orbits does not # require reloads of whole dataset ...
[ "def", "_calcOrbits", "(", "self", ")", ":", "# if the breaks between orbit have not been defined, define them", "# also, store the data so that grabbing different orbits does not", "# require reloads of whole dataset", "if", "len", "(", "self", ".", "_orbit_breaks", ")", "==", "0"...
Prepares data structure for breaking data into orbits. Not intended for end user.
[ "Prepares", "data", "structure", "for", "breaking", "data", "into", "orbits", ".", "Not", "intended", "for", "end", "user", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L157-L169
rstoneback/pysat
pysat/_orbits.py
Orbits._equaBreaks
def _equaBreaks(self, orbit_index_period=24.): """Determine where breaks in an equatorial satellite orbit occur. Looks for negative gradients in local time (or longitude) as well as breaks in UT. Parameters ---------- orbit_index_period : float The change in...
python
def _equaBreaks(self, orbit_index_period=24.): """Determine where breaks in an equatorial satellite orbit occur. Looks for negative gradients in local time (or longitude) as well as breaks in UT. Parameters ---------- orbit_index_period : float The change in...
[ "def", "_equaBreaks", "(", "self", ",", "orbit_index_period", "=", "24.", ")", ":", "if", "self", ".", "orbit_index", "is", "None", ":", "raise", "ValueError", "(", "'Orbit properties must be defined at '", "+", "'pysat.Instrument object instantiation.'", "+", "'See I...
Determine where breaks in an equatorial satellite orbit occur. Looks for negative gradients in local time (or longitude) as well as breaks in UT. Parameters ---------- orbit_index_period : float The change in value of supplied index parameter for a single orbit
[ "Determine", "where", "breaks", "in", "an", "equatorial", "satellite", "orbit", "occur", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L171-L300
rstoneback/pysat
pysat/_orbits.py
Orbits._polarBreaks
def _polarBreaks(self): """Determine where breaks in a polar orbiting satellite orbit occur. Looks for sign changes in latitude (magnetic or geographic) as well as breaks in UT. """ if self.orbit_index is None: raise ValueError('Orbit properties must be defined at ...
python
def _polarBreaks(self): """Determine where breaks in a polar orbiting satellite orbit occur. Looks for sign changes in latitude (magnetic or geographic) as well as breaks in UT. """ if self.orbit_index is None: raise ValueError('Orbit properties must be defined at ...
[ "def", "_polarBreaks", "(", "self", ")", ":", "if", "self", ".", "orbit_index", "is", "None", ":", "raise", "ValueError", "(", "'Orbit properties must be defined at '", "+", "'pysat.Instrument object instantiation.'", "+", "'See Instrument docs.'", ")", "else", ":", "...
Determine where breaks in a polar orbiting satellite orbit occur. Looks for sign changes in latitude (magnetic or geographic) as well as breaks in UT.
[ "Determine", "where", "breaks", "in", "a", "polar", "orbiting", "satellite", "orbit", "occur", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L302-L346
rstoneback/pysat
pysat/_orbits.py
Orbits._orbitNumberBreaks
def _orbitNumberBreaks(self): """Determine where orbital breaks in a dataset with orbit numbers occur. Looks for changes in unique values. """ if self.orbit_index is None: raise ValueError('Orbit properties must be defined at ' + 'pysat.Instrum...
python
def _orbitNumberBreaks(self): """Determine where orbital breaks in a dataset with orbit numbers occur. Looks for changes in unique values. """ if self.orbit_index is None: raise ValueError('Orbit properties must be defined at ' + 'pysat.Instrum...
[ "def", "_orbitNumberBreaks", "(", "self", ")", ":", "if", "self", ".", "orbit_index", "is", "None", ":", "raise", "ValueError", "(", "'Orbit properties must be defined at '", "+", "'pysat.Instrument object instantiation.'", "+", "'See Instrument docs.'", ")", "else", ":...
Determine where orbital breaks in a dataset with orbit numbers occur. Looks for changes in unique values.
[ "Determine", "where", "orbital", "breaks", "in", "a", "dataset", "with", "orbit", "numbers", "occur", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L348-L383
rstoneback/pysat
pysat/_orbits.py
Orbits._getBasicOrbit
def _getBasicOrbit(self, orbit=None): """Load a particular orbit into .data for loaded day. Parameters ---------- orbit : int orbit number, 1 indexed, negative indexes allowed, -1 last orbit Note ---- A day of data must be loaded before this routine ...
python
def _getBasicOrbit(self, orbit=None): """Load a particular orbit into .data for loaded day. Parameters ---------- orbit : int orbit number, 1 indexed, negative indexes allowed, -1 last orbit Note ---- A day of data must be loaded before this routine ...
[ "def", "_getBasicOrbit", "(", "self", ",", "orbit", "=", "None", ")", ":", "# ensure data exists", "if", "not", "self", ".", "sat", ".", "empty", ":", "# ensure proper orbit metadata present", "self", ".", "_calcOrbits", "(", ")", "# ensure user is requesting a part...
Load a particular orbit into .data for loaded day. Parameters ---------- orbit : int orbit number, 1 indexed, negative indexes allowed, -1 last orbit Note ---- A day of data must be loaded before this routine functions properly. If the last orbit of ...
[ "Load", "a", "particular", "orbit", "into", ".", "data", "for", "loaded", "day", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L385-L434
rstoneback/pysat
pysat/_orbits.py
Orbits.load
def load(self, orbit=None): """Load a particular orbit into .data for loaded day. Parameters ---------- orbit : int orbit number, 1 indexed Note ---- A day of data must be loaded before this routine functions properly. If the last orbit o...
python
def load(self, orbit=None): """Load a particular orbit into .data for loaded day. Parameters ---------- orbit : int orbit number, 1 indexed Note ---- A day of data must be loaded before this routine functions properly. If the last orbit o...
[ "def", "load", "(", "self", ",", "orbit", "=", "None", ")", ":", "if", "not", "self", ".", "sat", ".", "empty", ":", "# ensure data exists", "# set up orbit metadata", "self", ".", "_calcOrbits", "(", ")", "# ensure user supplied an orbit", "if", "orbit", "is"...
Load a particular orbit into .data for loaded day. Parameters ---------- orbit : int orbit number, 1 indexed Note ---- A day of data must be loaded before this routine functions properly. If the last orbit of the day is requested, it will automat...
[ "Load", "a", "particular", "orbit", "into", ".", "data", "for", "loaded", "day", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L436-L516
rstoneback/pysat
pysat/_orbits.py
Orbits.next
def next(self, *arg, **kwarg): """Load the next orbit into .data. Note ---- Forms complete orbits across day boundaries. If no data loaded then the first orbit from the first date of data is returned. """ # first, check if data exists if not self.sat.emp...
python
def next(self, *arg, **kwarg): """Load the next orbit into .data. Note ---- Forms complete orbits across day boundaries. If no data loaded then the first orbit from the first date of data is returned. """ # first, check if data exists if not self.sat.emp...
[ "def", "next", "(", "self", ",", "*", "arg", ",", "*", "*", "kwarg", ")", ":", "# first, check if data exists", "if", "not", "self", ".", "sat", ".", "empty", ":", "# set up orbit metadata", "self", ".", "_calcOrbits", "(", ")", "# if current orbit near the la...
Load the next orbit into .data. Note ---- Forms complete orbits across day boundaries. If no data loaded then the first orbit from the first date of data is returned.
[ "Load", "the", "next", "orbit", "into", ".", "data", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L518-L657
rstoneback/pysat
pysat/instruments/sw_dst.py
load
def load(fnames, tag=None, sat_id=None): """Load Kp index files Parameters ------------ fnames : (pandas.Series) Series of filenames tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) Returns -------...
python
def load(fnames, tag=None, sat_id=None): """Load Kp index files Parameters ------------ fnames : (pandas.Series) Series of filenames tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) Returns -------...
[ "def", "load", "(", "fnames", ",", "tag", "=", "None", ",", "sat_id", "=", "None", ")", ":", "data", "=", "pds", ".", "DataFrame", "(", ")", "for", "filename", "in", "fnames", ":", "# need to remove date appended to dst filename", "fname", "=", "filename", ...
Load Kp index files Parameters ------------ fnames : (pandas.Series) Series of filenames tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) Returns --------- data : (pandas.DataFrame) Object ...
[ "Load", "Kp", "index", "files" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_dst.py#L42-L118
rstoneback/pysat
pysat/instruments/sw_kp.py
_parse
def _parse(yr, mo, day): """ Basic parser to deal with date format of the Kp file. """ yr = '20'+yr yr = int(yr) mo = int(mo) day = int(day) return pds.datetime(yr, mo, day)
python
def _parse(yr, mo, day): """ Basic parser to deal with date format of the Kp file. """ yr = '20'+yr yr = int(yr) mo = int(mo) day = int(day) return pds.datetime(yr, mo, day)
[ "def", "_parse", "(", "yr", ",", "mo", ",", "day", ")", ":", "yr", "=", "'20'", "+", "yr", "yr", "=", "int", "(", "yr", ")", "mo", "=", "int", "(", "mo", ")", "day", "=", "int", "(", "day", ")", "return", "pds", ".", "datetime", "(", "yr", ...
Basic parser to deal with date format of the Kp file.
[ "Basic", "parser", "to", "deal", "with", "date", "format", "of", "the", "Kp", "file", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_kp.py#L45-L54
rstoneback/pysat
pysat/instruments/sw_kp.py
load
def load(fnames, tag=None, sat_id=None): """Load Kp index files Parameters ------------ fnames : (pandas.Series) Series of filenames tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) Returns -------...
python
def load(fnames, tag=None, sat_id=None): """Load Kp index files Parameters ------------ fnames : (pandas.Series) Series of filenames tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) Returns -------...
[ "def", "load", "(", "fnames", ",", "tag", "=", "None", ",", "sat_id", "=", "None", ")", ":", "# Kp data stored monthly, need to return data daily", "# the daily date is attached to filename", "# parse off the last date, load month of data, downselect to desired day", "data", "=",...
Load Kp index files Parameters ------------ fnames : (pandas.Series) Series of filenames tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) Returns --------- data : (pandas.DataFrame) Object ...
[ "Load", "Kp", "index", "files" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_kp.py#L57-L129
rstoneback/pysat
pysat/instruments/sw_kp.py
download
def download(date_array, tag, sat_id, data_path, user=None, password=None): """Routine to download Kp index data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are '1min' and '5min'. (default=None) sat_id : (string or NoneType) ...
python
def download(date_array, tag, sat_id, data_path, user=None, password=None): """Routine to download Kp index data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are '1min' and '5min'. (default=None) sat_id : (string or NoneType) ...
[ "def", "download", "(", "date_array", ",", "tag", ",", "sat_id", ",", "data_path", ",", "user", "=", "None", ",", "password", "=", "None", ")", ":", "import", "ftplib", "from", "ftplib", "import", "FTP", "import", "sys", "ftp", "=", "FTP", "(", "'ftp.g...
Routine to download Kp index data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are '1min' and '5min'. (default=None) sat_id : (string or NoneType) Specifies the satellite ID for a constellation. Not used. (default=None)...
[ "Routine", "to", "download", "Kp", "index", "data" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_kp.py#L183-L234
rstoneback/pysat
pysat/instruments/sw_kp.py
filter_geoquiet
def filter_geoquiet(sat, maxKp=None, filterTime=None, kpData=None, kp_inst=None): """Filters pysat.Instrument data for given time after Kp drops below gate. Loads Kp data for the same timeframe covered by sat and sets sat.data to NaN for times when Kp > maxKp and for filterTime after Kp drops below max...
python
def filter_geoquiet(sat, maxKp=None, filterTime=None, kpData=None, kp_inst=None): """Filters pysat.Instrument data for given time after Kp drops below gate. Loads Kp data for the same timeframe covered by sat and sets sat.data to NaN for times when Kp > maxKp and for filterTime after Kp drops below max...
[ "def", "filter_geoquiet", "(", "sat", ",", "maxKp", "=", "None", ",", "filterTime", "=", "None", ",", "kpData", "=", "None", ",", "kp_inst", "=", "None", ")", ":", "if", "kp_inst", "is", "not", "None", ":", "kp_inst", ".", "load", "(", "date", "=", ...
Filters pysat.Instrument data for given time after Kp drops below gate. Loads Kp data for the same timeframe covered by sat and sets sat.data to NaN for times when Kp > maxKp and for filterTime after Kp drops below maxKp. Parameters ---------- sat : pysat.Instrument Instrument to b...
[ "Filters", "pysat", ".", "Instrument", "data", "for", "given", "time", "after", "Kp", "drops", "below", "gate", ".", "Loads", "Kp", "data", "for", "the", "same", "timeframe", "covered", "by", "sat", "and", "sets", "sat", ".", "data", "to", "NaN", "for", ...
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_kp.py#L236-L286
emc-openstack/storops
storops/lib/parser.py
ParserConfigFactory._get_converter
def _get_converter(self, converter_str): """find converter function reference by name find converter by name, converter name follows this convention: Class.method or: method The first type of converter class/function must be available in current modul...
python
def _get_converter(self, converter_str): """find converter function reference by name find converter by name, converter name follows this convention: Class.method or: method The first type of converter class/function must be available in current modul...
[ "def", "_get_converter", "(", "self", ",", "converter_str", ")", ":", "ret", "=", "None", "if", "converter_str", "is", "not", "None", ":", "converter_desc_list", "=", "converter_str", ".", "split", "(", "'.'", ")", "if", "len", "(", "converter_desc_list", ")...
find converter function reference by name find converter by name, converter name follows this convention: Class.method or: method The first type of converter class/function must be available in current module. The second type of converter must be avai...
[ "find", "converter", "function", "reference", "by", "name" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/parser.py#L398-L443
emc-openstack/storops
storops/connection/connector.py
SSHConnector.copy_file_to_remote
def copy_file_to_remote(self, local_path, remote_path): """scp the local file to remote folder. :param local_path: local path :param remote_path: remote path """ sftp_client = self.transport.open_sftp_client() LOG.debug('Copy the local file to remote. ' ...
python
def copy_file_to_remote(self, local_path, remote_path): """scp the local file to remote folder. :param local_path: local path :param remote_path: remote path """ sftp_client = self.transport.open_sftp_client() LOG.debug('Copy the local file to remote. ' ...
[ "def", "copy_file_to_remote", "(", "self", ",", "local_path", ",", "remote_path", ")", ":", "sftp_client", "=", "self", ".", "transport", ".", "open_sftp_client", "(", ")", "LOG", ".", "debug", "(", "'Copy the local file to remote. '", "'Source=%(src)s. Target=%(targe...
scp the local file to remote folder. :param local_path: local path :param remote_path: remote path
[ "scp", "the", "local", "file", "to", "remote", "folder", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/connection/connector.py#L177-L192
emc-openstack/storops
storops/connection/connector.py
SSHConnector.get_remote_file
def get_remote_file(self, remote_path, local_path): """Fetch remote File. :param remote_path: remote path :param local_path: local path """ sftp_client = self.transport.open_sftp_client() LOG.debug('Get the remote file. ' 'Source=%(src)s. Target=%(targe...
python
def get_remote_file(self, remote_path, local_path): """Fetch remote File. :param remote_path: remote path :param local_path: local path """ sftp_client = self.transport.open_sftp_client() LOG.debug('Get the remote file. ' 'Source=%(src)s. Target=%(targe...
[ "def", "get_remote_file", "(", "self", ",", "remote_path", ",", "local_path", ")", ":", "sftp_client", "=", "self", ".", "transport", ".", "open_sftp_client", "(", ")", "LOG", ".", "debug", "(", "'Get the remote file. '", "'Source=%(src)s. Target=%(target)s.'", "%",...
Fetch remote File. :param remote_path: remote path :param local_path: local path
[ "Fetch", "remote", "File", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/connection/connector.py#L194-L209
emc-openstack/storops
storops/connection/connector.py
SSHConnector.close
def close(self): """Closes the ssh connection.""" if 'isLive' in self.__dict__ and self.isLive: self.transport.close() self.isLive = False
python
def close(self): """Closes the ssh connection.""" if 'isLive' in self.__dict__ and self.isLive: self.transport.close() self.isLive = False
[ "def", "close", "(", "self", ")", ":", "if", "'isLive'", "in", "self", ".", "__dict__", "and", "self", ".", "isLive", ":", "self", ".", "transport", ".", "close", "(", ")", "self", ".", "isLive", "=", "False" ]
Closes the ssh connection.
[ "Closes", "the", "ssh", "connection", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/connection/connector.py#L211-L215
emc-openstack/storops
storops/vnx/nas_client.py
xml_request
def xml_request(check_object=False, check_invalid_data_mover=False): """ indicate the return value is a xml api request :param check_invalid_data_mover: :param check_object: :return: the response of this request """ def decorator(f): @functools.wraps(f) def func_wrapper(self, *...
python
def xml_request(check_object=False, check_invalid_data_mover=False): """ indicate the return value is a xml api request :param check_invalid_data_mover: :param check_object: :return: the response of this request """ def decorator(f): @functools.wraps(f) def func_wrapper(self, *...
[ "def", "xml_request", "(", "check_object", "=", "False", ",", "check_invalid_data_mover", "=", "False", ")", ":", "def", "decorator", "(", "f", ")", ":", "@", "functools", ".", "wraps", "(", "f", ")", "def", "func_wrapper", "(", "self", ",", "*", "argv",...
indicate the return value is a xml api request :param check_invalid_data_mover: :param check_object: :return: the response of this request
[ "indicate", "the", "return", "value", "is", "a", "xml", "api", "request" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/nas_client.py#L127-L145
emc-openstack/storops
storops/vnx/nas_client.py
nas_command
def nas_command(f): """ indicate it's a command of nas command run with ssh :param f: function that returns the command in list :return: command execution result """ @functools.wraps(f) def func_wrapper(self, *argv, **kwargs): commands = f(self, *argv, **kwargs) return self.ssh...
python
def nas_command(f): """ indicate it's a command of nas command run with ssh :param f: function that returns the command in list :return: command execution result """ @functools.wraps(f) def func_wrapper(self, *argv, **kwargs): commands = f(self, *argv, **kwargs) return self.ssh...
[ "def", "nas_command", "(", "f", ")", ":", "@", "functools", ".", "wraps", "(", "f", ")", "def", "func_wrapper", "(", "self", ",", "*", "argv", ",", "*", "*", "kwargs", ")", ":", "commands", "=", "f", "(", "self", ",", "*", "argv", ",", "*", "*"...
indicate it's a command of nas command run with ssh :param f: function that returns the command in list :return: command execution result
[ "indicate", "it", "s", "a", "command", "of", "nas", "command", "run", "with", "ssh" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/nas_client.py#L152-L164
emc-openstack/storops
storops/unity/resource/snap.py
UnitySnap.restore
def restore(self, backup=None, delete_backup=False): """Restore the snapshot to the associated storage resource. :param backup: name of the backup snapshot :param delete_backup: Whether to delete the backup snap after a successful restore. """ resp ...
python
def restore(self, backup=None, delete_backup=False): """Restore the snapshot to the associated storage resource. :param backup: name of the backup snapshot :param delete_backup: Whether to delete the backup snap after a successful restore. """ resp ...
[ "def", "restore", "(", "self", ",", "backup", "=", "None", ",", "delete_backup", "=", "False", ")", ":", "resp", "=", "self", ".", "_cli", ".", "action", "(", "self", ".", "resource_class", ",", "self", ".", "get_id", "(", ")", ",", "'restore'", ",",...
Restore the snapshot to the associated storage resource. :param backup: name of the backup snapshot :param delete_backup: Whether to delete the backup snap after a successful restore.
[ "Restore", "the", "snapshot", "to", "the", "associated", "storage", "resource", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/snap.py#L154-L172
emc-openstack/storops
storops/unity/resource/snap.py
UnitySnap.thin_clone
def thin_clone(self, name, io_limit_policy=None, description=None): """Creates a new thin clone from this snapshot. .. note:: this snapshot should not enable Auto-Delete. """ if self.is_member_snap(): raise UnityCGMemberActionNotSupportError() if self.lun and not sel...
python
def thin_clone(self, name, io_limit_policy=None, description=None): """Creates a new thin clone from this snapshot. .. note:: this snapshot should not enable Auto-Delete. """ if self.is_member_snap(): raise UnityCGMemberActionNotSupportError() if self.lun and not sel...
[ "def", "thin_clone", "(", "self", ",", "name", ",", "io_limit_policy", "=", "None", ",", "description", "=", "None", ")", ":", "if", "self", ".", "is_member_snap", "(", ")", ":", "raise", "UnityCGMemberActionNotSupportError", "(", ")", "if", "self", ".", "...
Creates a new thin clone from this snapshot. .. note:: this snapshot should not enable Auto-Delete.
[ "Creates", "a", "new", "thin", "clone", "from", "this", "snapshot", ".", "..", "note", "::", "this", "snapshot", "should", "not", "enable", "Auto", "-", "Delete", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/snap.py#L184-L195
emc-openstack/storops
storops/unity/resource/snap.py
UnitySnap.delete
def delete(self, async_mode=False, even_attached=False): """Deletes the snapshot. :param async_mode: whether to delete the snapshot in async mode. :param even_attached: whether to delete the snapshot even it is attached to hosts. """ try: return super(Uni...
python
def delete(self, async_mode=False, even_attached=False): """Deletes the snapshot. :param async_mode: whether to delete the snapshot in async mode. :param even_attached: whether to delete the snapshot even it is attached to hosts. """ try: return super(Uni...
[ "def", "delete", "(", "self", ",", "async_mode", "=", "False", ",", "even_attached", "=", "False", ")", ":", "try", ":", "return", "super", "(", "UnitySnap", ",", "self", ")", ".", "delete", "(", "async_mode", "=", "async_mode", ")", "except", "UnityDele...
Deletes the snapshot. :param async_mode: whether to delete the snapshot in async mode. :param even_attached: whether to delete the snapshot even it is attached to hosts.
[ "Deletes", "the", "snapshot", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/snap.py#L201-L221
emc-openstack/storops
storops/unity/client.py
UnityClient.get_all
def get_all(self, type_name, base_fields=None, the_filter=None, nested_fields=None): """Get the resource by resource id. :param nested_fields: nested resource fields :param base_fields: fields of this resource :param the_filter: dictionary of filter like `{'name': 'abc'}...
python
def get_all(self, type_name, base_fields=None, the_filter=None, nested_fields=None): """Get the resource by resource id. :param nested_fields: nested resource fields :param base_fields: fields of this resource :param the_filter: dictionary of filter like `{'name': 'abc'}...
[ "def", "get_all", "(", "self", ",", "type_name", ",", "base_fields", "=", "None", ",", "the_filter", "=", "None", ",", "nested_fields", "=", "None", ")", ":", "fields", "=", "self", ".", "get_fields", "(", "type_name", ",", "base_fields", ",", "nested_fiel...
Get the resource by resource id. :param nested_fields: nested resource fields :param base_fields: fields of this resource :param the_filter: dictionary of filter like `{'name': 'abc'}` :param type_name: Resource type. For example, pool, lun, nasServer. :return: List of resource ...
[ "Get", "the", "resource", "by", "resource", "id", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/client.py#L63-L84
emc-openstack/storops
storops/unity/client.py
UnityClient.get
def get(self, type_name, obj_id, base_fields=None, nested_fields=None): """Get the resource by resource id. :param nested_fields: nested resource fields. :param type_name: Resource type. For example, pool, lun, nasServer. :param obj_id: Resource id :param base_fields: Resource f...
python
def get(self, type_name, obj_id, base_fields=None, nested_fields=None): """Get the resource by resource id. :param nested_fields: nested resource fields. :param type_name: Resource type. For example, pool, lun, nasServer. :param obj_id: Resource id :param base_fields: Resource f...
[ "def", "get", "(", "self", ",", "type_name", ",", "obj_id", ",", "base_fields", "=", "None", ",", "nested_fields", "=", "None", ")", ":", "base_fields", "=", "self", ".", "get_fields", "(", "type_name", ",", "base_fields", ",", "nested_fields", ")", "url",...
Get the resource by resource id. :param nested_fields: nested resource fields. :param type_name: Resource type. For example, pool, lun, nasServer. :param obj_id: Resource id :param base_fields: Resource fields to return :return: List of tuple [(name, res_inst)]
[ "Get", "the", "resource", "by", "resource", "id", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/client.py#L169-L180
emc-openstack/storops
storops/vnx/resource/port.py
VNXConnectionPortList._flat_vports
def _flat_vports(self, connection_port): """Flat the virtual ports.""" vports = [] for vport in connection_port.virtual_ports: self._set_child_props(connection_port, vport) vports.append(vport) return vports
python
def _flat_vports(self, connection_port): """Flat the virtual ports.""" vports = [] for vport in connection_port.virtual_ports: self._set_child_props(connection_port, vport) vports.append(vport) return vports
[ "def", "_flat_vports", "(", "self", ",", "connection_port", ")", ":", "vports", "=", "[", "]", "for", "vport", "in", "connection_port", ".", "virtual_ports", ":", "self", ".", "_set_child_props", "(", "connection_port", ",", "vport", ")", "vports", ".", "app...
Flat the virtual ports.
[ "Flat", "the", "virtual", "ports", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/port.py#L334-L340
emc-openstack/storops
storops/unity/resource/filesystem.py
UnityFileSystem.has_snap
def has_snap(self): """ This method won't count the snaps in "destroying" state! :return: false if no snaps or all snaps are destroying. """ return len(list(filter(lambda s: s.state != SnapStateEnum.DESTROYING, self.snapshots))) > 0
python
def has_snap(self): """ This method won't count the snaps in "destroying" state! :return: false if no snaps or all snaps are destroying. """ return len(list(filter(lambda s: s.state != SnapStateEnum.DESTROYING, self.snapshots))) > 0
[ "def", "has_snap", "(", "self", ")", ":", "return", "len", "(", "list", "(", "filter", "(", "lambda", "s", ":", "s", ".", "state", "!=", "SnapStateEnum", ".", "DESTROYING", ",", "self", ".", "snapshots", ")", ")", ")", ">", "0" ]
This method won't count the snaps in "destroying" state! :return: false if no snaps or all snaps are destroying.
[ "This", "method", "won", "t", "count", "the", "snaps", "in", "destroying", "state!" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/filesystem.py#L155-L161
rstoneback/pysat
pysat/ssnl/avg.py
median2D
def median2D(const, bin1, label1, bin2, label2, data_label, returnData=False): """Return a 2D average of data_label over a season and label1, label2. Parameters ---------- const: Constellation or Instrument bin#: [min, max, number of bins] label#: string i...
python
def median2D(const, bin1, label1, bin2, label2, data_label, returnData=False): """Return a 2D average of data_label over a season and label1, label2. Parameters ---------- const: Constellation or Instrument bin#: [min, max, number of bins] label#: string i...
[ "def", "median2D", "(", "const", ",", "bin1", ",", "label1", ",", "bin2", ",", "label2", ",", "data_label", ",", "returnData", "=", "False", ")", ":", "# const is either an Instrument or a Constellation, and we want to ", "# iterate over it. ", "# If it's a Constellation...
Return a 2D average of data_label over a season and label1, label2. Parameters ---------- const: Constellation or Instrument bin#: [min, max, number of bins] label#: string identifies data product for bin# data_label: list-like contains strings identify...
[ "Return", "a", "2D", "average", "of", "data_label", "over", "a", "season", "and", "label1", "label2", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/ssnl/avg.py#L14-L98
emc-openstack/storops
storops/vnx/resource/system.py
VNXSystem.get_rsc_list_2
def get_rsc_list_2(self, rsc_clz_list=None): """get the list of resource list to collect based on clz list :param rsc_clz_list: the list of classes to collect :return: filtered list of resource list, like [VNXLunList(), VNXDiskList()] """ rsc_list_2 = self._defa...
python
def get_rsc_list_2(self, rsc_clz_list=None): """get the list of resource list to collect based on clz list :param rsc_clz_list: the list of classes to collect :return: filtered list of resource list, like [VNXLunList(), VNXDiskList()] """ rsc_list_2 = self._defa...
[ "def", "get_rsc_list_2", "(", "self", ",", "rsc_clz_list", "=", "None", ")", ":", "rsc_list_2", "=", "self", ".", "_default_rsc_list_with_perf_stats", "(", ")", "if", "rsc_clz_list", "is", "None", ":", "rsc_clz_list", "=", "ResourceList", ".", "get_rsc_clz_list", ...
get the list of resource list to collect based on clz list :param rsc_clz_list: the list of classes to collect :return: filtered list of resource list, like [VNXLunList(), VNXDiskList()]
[ "get", "the", "list", "of", "resource", "list", "to", "collect", "based", "on", "clz", "list" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/system.py#L518-L531
rstoneback/pysat
pysat/instruments/cosmic_gps.py
load
def load(cosmicFiles, tag=None, sat_id=None): """ cosmic data load routine, called by pysat """ import netCDF4 num = len(cosmicFiles) # make sure there are files to read if num != 0: # call separate load_files routine, segemented for possible # multiprocessor load, not in...
python
def load(cosmicFiles, tag=None, sat_id=None): """ cosmic data load routine, called by pysat """ import netCDF4 num = len(cosmicFiles) # make sure there are files to read if num != 0: # call separate load_files routine, segemented for possible # multiprocessor load, not in...
[ "def", "load", "(", "cosmicFiles", ",", "tag", "=", "None", ",", "sat_id", "=", "None", ")", ":", "import", "netCDF4", "num", "=", "len", "(", "cosmicFiles", ")", "# make sure there are files to read", "if", "num", "!=", "0", ":", "# call separate load_files r...
cosmic data load routine, called by pysat
[ "cosmic", "data", "load", "routine", "called", "by", "pysat" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/cosmic_gps.py#L119-L158
rstoneback/pysat
pysat/instruments/cosmic_gps.py
load_files
def load_files(files, tag=None, sat_id=None): '''Loads a list of COSMIC data files, supplied by user. Returns a list of dicts, a dict for each file. ''' output = [None]*len(files) drop_idx = [] for (i,file) in enumerate(files): try: data = netCDF4.Dataset(file) ...
python
def load_files(files, tag=None, sat_id=None): '''Loads a list of COSMIC data files, supplied by user. Returns a list of dicts, a dict for each file. ''' output = [None]*len(files) drop_idx = [] for (i,file) in enumerate(files): try: data = netCDF4.Dataset(file) ...
[ "def", "load_files", "(", "files", ",", "tag", "=", "None", ",", "sat_id", "=", "None", ")", ":", "output", "=", "[", "None", "]", "*", "len", "(", "files", ")", "drop_idx", "=", "[", "]", "for", "(", "i", ",", "file", ")", "in", "enumerate", "...
Loads a list of COSMIC data files, supplied by user. Returns a list of dicts, a dict for each file.
[ "Loads", "a", "list", "of", "COSMIC", "data", "files", "supplied", "by", "user", ".", "Returns", "a", "list", "of", "dicts", "a", "dict", "for", "each", "file", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/cosmic_gps.py#L165-L202
rstoneback/pysat
pysat/instruments/dmsp_ivm.py
download
def download(date_array, tag, sat_id, data_path=None, user=None, password=None): """Downloads data from Madrigal. The user's names should be provided in field user. John Malkovich should be entered as John+Malkovich The password field should be the user's email address. These parameters ...
python
def download(date_array, tag, sat_id, data_path=None, user=None, password=None): """Downloads data from Madrigal. The user's names should be provided in field user. John Malkovich should be entered as John+Malkovich The password field should be the user's email address. These parameters ...
[ "def", "download", "(", "date_array", ",", "tag", ",", "sat_id", ",", "data_path", "=", "None", ",", "user", "=", "None", ",", "password", "=", "None", ")", ":", "import", "subprocess", "# currently passes things along if no user and password supplied", "# need to d...
Downloads data from Madrigal. The user's names should be provided in field user. John Malkovich should be entered as John+Malkovich The password field should be the user's email address. These parameters are passed to Madrigal when downloading. The affiliation field is set to pysat ...
[ "Downloads", "data", "from", "Madrigal", ".", "The", "user", "s", "names", "should", "be", "provided", "in", "field", "user", ".", "John", "Malkovich", "should", "be", "entered", "as", "John", "+", "Malkovich", "The", "password", "field", "should", "be", "...
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/dmsp_ivm.py#L135-L175
rstoneback/pysat
pysat/instruments/dmsp_ivm.py
clean
def clean(self): """Routine to return DMSP IVM data cleaned to the specified level 'Clean' enforces that both RPA and DM flags are <= 1 'Dusty' <= 2 'Dirty' <= 3 'None' None Routine is called by pysat, and not by the end user directly. Parameters ----------- inst : (pysat....
python
def clean(self): """Routine to return DMSP IVM data cleaned to the specified level 'Clean' enforces that both RPA and DM flags are <= 1 'Dusty' <= 2 'Dirty' <= 3 'None' None Routine is called by pysat, and not by the end user directly. Parameters ----------- inst : (pysat....
[ "def", "clean", "(", "self", ")", ":", "if", "self", ".", "clean_level", "==", "'clean'", ":", "idx", ",", "=", "np", ".", "where", "(", "(", "self", "[", "'rpa_flag_ut'", "]", "<=", "1", ")", "&", "(", "self", "[", "'idm_flag_ut'", "]", "<=", "1...
Routine to return DMSP IVM data cleaned to the specified level 'Clean' enforces that both RPA and DM flags are <= 1 'Dusty' <= 2 'Dirty' <= 3 'None' None Routine is called by pysat, and not by the end user directly. Parameters ----------- inst : (pysat.Instrument) Inst...
[ "Routine", "to", "return", "DMSP", "IVM", "data", "cleaned", "to", "the", "specified", "level" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/dmsp_ivm.py#L182-L221
emc-openstack/storops
storops/unity/resource/remote_system.py
UnityRemoteSystem.create
def create(cls, cli, management_address, local_username=None, local_password=None, remote_username=None, remote_password=None, connection_type=None): """ Configures a remote system for remote replication. :param cls: this class. :param cli: t...
python
def create(cls, cli, management_address, local_username=None, local_password=None, remote_username=None, remote_password=None, connection_type=None): """ Configures a remote system for remote replication. :param cls: this class. :param cli: t...
[ "def", "create", "(", "cls", ",", "cli", ",", "management_address", ",", "local_username", "=", "None", ",", "local_password", "=", "None", ",", "remote_username", "=", "None", ",", "remote_password", "=", "None", ",", "connection_type", "=", "None", ")", ":...
Configures a remote system for remote replication. :param cls: this class. :param cli: the rest client. :param management_address: the management IP address of the remote system. :param local_username: administrative username of local system. :param local_password: a...
[ "Configures", "a", "remote", "system", "for", "remote", "replication", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/remote_system.py#L30-L57
emc-openstack/storops
storops/unity/resource/remote_system.py
UnityRemoteSystem.modify
def modify(self, management_address=None, username=None, password=None, connection_type=None): """ Modifies a remote system for remote replication. :param management_address: same as the one in `create` method. :param username: username for accessing the remote system. ...
python
def modify(self, management_address=None, username=None, password=None, connection_type=None): """ Modifies a remote system for remote replication. :param management_address: same as the one in `create` method. :param username: username for accessing the remote system. ...
[ "def", "modify", "(", "self", ",", "management_address", "=", "None", ",", "username", "=", "None", ",", "password", "=", "None", ",", "connection_type", "=", "None", ")", ":", "req_body", "=", "self", ".", "_cli", ".", "make_body", "(", "managementAddress...
Modifies a remote system for remote replication. :param management_address: same as the one in `create` method. :param username: username for accessing the remote system. :param password: password for accessing the remote system. :param connection_type: same as the one in `create` metho...
[ "Modifies", "a", "remote", "system", "for", "remote", "replication", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/remote_system.py#L59-L75
emc-openstack/storops
storops/unity/resource/remote_system.py
UnityRemoteSystem.verify
def verify(self, connection_type=None): """ Verifies and update the remote system settings. :param connection_type: same as the one in `create` method. """ req_body = self._cli.make_body(connectionType=connection_type) resp = self.action('verify', **req_body) re...
python
def verify(self, connection_type=None): """ Verifies and update the remote system settings. :param connection_type: same as the one in `create` method. """ req_body = self._cli.make_body(connectionType=connection_type) resp = self.action('verify', **req_body) re...
[ "def", "verify", "(", "self", ",", "connection_type", "=", "None", ")", ":", "req_body", "=", "self", ".", "_cli", ".", "make_body", "(", "connectionType", "=", "connection_type", ")", "resp", "=", "self", ".", "action", "(", "'verify'", ",", "*", "*", ...
Verifies and update the remote system settings. :param connection_type: same as the one in `create` method.
[ "Verifies", "and", "update", "the", "remote", "system", "settings", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/remote_system.py#L77-L87
emc-openstack/storops
storops/unity/resource/replication_interface.py
UnityReplicationInterface.create
def create(cls, cli, sp, ip_port, ip_address, netmask=None, v6_prefix_length=None, gateway=None, vlan_id=None): """ Creates a replication interface. :param cls: this class. :param cli: the rest cli. :param sp: `UnityStorageProcessor` object. Storage processor on w...
python
def create(cls, cli, sp, ip_port, ip_address, netmask=None, v6_prefix_length=None, gateway=None, vlan_id=None): """ Creates a replication interface. :param cls: this class. :param cli: the rest cli. :param sp: `UnityStorageProcessor` object. Storage processor on w...
[ "def", "create", "(", "cls", ",", "cli", ",", "sp", ",", "ip_port", ",", "ip_address", ",", "netmask", "=", "None", ",", "v6_prefix_length", "=", "None", ",", "gateway", "=", "None", ",", "vlan_id", "=", "None", ")", ":", "req_body", "=", "cli", ".",...
Creates a replication interface. :param cls: this class. :param cli: the rest cli. :param sp: `UnityStorageProcessor` object. Storage processor on which the replication interface is running. :param ip_port: `UnityIpPort` object. Physical port or link aggregation ...
[ "Creates", "a", "replication", "interface", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_interface.py#L29-L57
emc-openstack/storops
storops/unity/resource/replication_interface.py
UnityReplicationInterface.modify
def modify(self, sp=None, ip_port=None, ip_address=None, netmask=None, v6_prefix_length=None, gateway=None, vlan_id=None): """ Modifies a replication interface. :param sp: same as the one in `create` method. :param ip_port: same as the one in `create` method. :par...
python
def modify(self, sp=None, ip_port=None, ip_address=None, netmask=None, v6_prefix_length=None, gateway=None, vlan_id=None): """ Modifies a replication interface. :param sp: same as the one in `create` method. :param ip_port: same as the one in `create` method. :par...
[ "def", "modify", "(", "self", ",", "sp", "=", "None", ",", "ip_port", "=", "None", ",", "ip_address", "=", "None", ",", "netmask", "=", "None", ",", "v6_prefix_length", "=", "None", ",", "gateway", "=", "None", ",", "vlan_id", "=", "None", ")", ":", ...
Modifies a replication interface. :param sp: same as the one in `create` method. :param ip_port: same as the one in `create` method. :param ip_address: same as the one in `create` method. :param netmask: same as the one in `create` method. :param v6_prefix_length: same as the on...
[ "Modifies", "a", "replication", "interface", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_interface.py#L59-L79
emc-openstack/storops
storops/unity/resource/metric.py
UnityMetricQueryResult.sp_sum_values
def sp_sum_values(self): """ return sp level values input: "values": { "spa": { "19": "385", "18": "0", "20": "0", "17": "0", "16": "0" }, "spb": { "19": "...
python
def sp_sum_values(self): """ return sp level values input: "values": { "spa": { "19": "385", "18": "0", "20": "0", "17": "0", "16": "0" }, "spb": { "19": "...
[ "def", "sp_sum_values", "(", "self", ")", ":", "if", "self", ".", "values", "is", "None", ":", "ret", "=", "IdValues", "(", ")", "else", ":", "ret", "=", "IdValues", "(", "{", "k", ":", "sum", "(", "int", "(", "x", ")", "for", "x", "in", "v", ...
return sp level values input: "values": { "spa": { "19": "385", "18": "0", "20": "0", "17": "0", "16": "0" }, "spb": { "19": "101", "18": "101", ...
[ "return", "sp", "level", "values" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L130-L163
emc-openstack/storops
storops/unity/resource/metric.py
UnityMetricQueryResult.sum_sp_values
def sum_sp_values(self): """ return system level values (spa + spb) input: "values": { "spa": 385, "spb": 505 }, return: "values": { "0": 890 }, """ if self.values is None: ret = IdValues() ...
python
def sum_sp_values(self): """ return system level values (spa + spb) input: "values": { "spa": 385, "spb": 505 }, return: "values": { "0": 890 }, """ if self.values is None: ret = IdValues() ...
[ "def", "sum_sp_values", "(", "self", ")", ":", "if", "self", ".", "values", "is", "None", ":", "ret", "=", "IdValues", "(", ")", "else", ":", "ret", "=", "IdValues", "(", "{", "'0'", ":", "sum", "(", "int", "(", "x", ")", "for", "x", "in", "sel...
return system level values (spa + spb) input: "values": { "spa": 385, "spb": 505 }, return: "values": { "0": 890 },
[ "return", "system", "level", "values", "(", "spa", "+", "spb", ")" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L166-L185
emc-openstack/storops
storops/unity/resource/metric.py
UnityMetricQueryResult.combine_numeric_values
def combine_numeric_values(self, other): """ numeric_values * sp_values """ if self.values is None: ret = IdValues() else: ret = sum([IdValues( {k: int(v) * int(other.values[key]) for k, v in value.items()}) for key, value i...
python
def combine_numeric_values(self, other): """ numeric_values * sp_values """ if self.values is None: ret = IdValues() else: ret = sum([IdValues( {k: int(v) * int(other.values[key]) for k, v in value.items()}) for key, value i...
[ "def", "combine_numeric_values", "(", "self", ",", "other", ")", ":", "if", "self", ".", "values", "is", "None", ":", "ret", "=", "IdValues", "(", ")", "else", ":", "ret", "=", "sum", "(", "[", "IdValues", "(", "{", "k", ":", "int", "(", "v", ")"...
numeric_values * sp_values
[ "numeric_values", "*", "sp_values" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L187-L197
emc-openstack/storops
storops/unity/resource/metric.py
UnityMetricQueryResult.combine_sp_values
def combine_sp_values(self, other): """ sp_values * sp_values """ if self.values is None: ret = IdValues() else: ret = IdValues({k: int(v) * int(other.values[k]) for k, v in self.values.items()}) return ret
python
def combine_sp_values(self, other): """ sp_values * sp_values """ if self.values is None: ret = IdValues() else: ret = IdValues({k: int(v) * int(other.values[k]) for k, v in self.values.items()}) return ret
[ "def", "combine_sp_values", "(", "self", ",", "other", ")", ":", "if", "self", ".", "values", "is", "None", ":", "ret", "=", "IdValues", "(", ")", "else", ":", "ret", "=", "IdValues", "(", "{", "k", ":", "int", "(", "v", ")", "*", "int", "(", "...
sp_values * sp_values
[ "sp_values", "*", "sp_values" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L199-L208
emc-openstack/storops
storops/unity/resource/metric.py
UnityMetricQueryResult.sum_combined_sp_values
def sum_combined_sp_values(self, other): """ sum(sp_values * sp_values) """ if self.values is None: ret = IdValues() else: ret = IdValues({'0': sum(int(x) for x in {k: int(v) * int(other.values[k]) for k, v ...
python
def sum_combined_sp_values(self, other): """ sum(sp_values * sp_values) """ if self.values is None: ret = IdValues() else: ret = IdValues({'0': sum(int(x) for x in {k: int(v) * int(other.values[k]) for k, v ...
[ "def", "sum_combined_sp_values", "(", "self", ",", "other", ")", ":", "if", "self", ".", "values", "is", "None", ":", "ret", "=", "IdValues", "(", ")", "else", ":", "ret", "=", "IdValues", "(", "{", "'0'", ":", "sum", "(", "int", "(", "x", ")", "...
sum(sp_values * sp_values)
[ "sum", "(", "sp_values", "*", "sp_values", ")" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L210-L220
rstoneback/pysat
pysat/_custom.py
Custom.add
def add(self, function, kind='add', at_pos='end',*args, **kwargs): """Add a function to custom processing queue. Custom functions are applied automatically to associated pysat instrument whenever instrument.load command called. Parameters ---------- functio...
python
def add(self, function, kind='add', at_pos='end',*args, **kwargs): """Add a function to custom processing queue. Custom functions are applied automatically to associated pysat instrument whenever instrument.load command called. Parameters ---------- functio...
[ "def", "add", "(", "self", ",", "function", ",", "kind", "=", "'add'", ",", "at_pos", "=", "'end'", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "function", ",", "str", ")", ":", "# convert string to function object", "...
Add a function to custom processing queue. Custom functions are applied automatically to associated pysat instrument whenever instrument.load command called. Parameters ---------- function : string or function object name of function or function obj...
[ "Add", "a", "function", "to", "custom", "processing", "queue", ".", "Custom", "functions", "are", "applied", "automatically", "to", "associated", "pysat", "instrument", "whenever", "instrument", ".", "load", "command", "called", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_custom.py#L51-L114
rstoneback/pysat
pysat/_custom.py
Custom._apply_all
def _apply_all(self, sat): """ Apply all of the custom functions to the satellite data object. """ if len(self._functions) > 0: for func, arg, kwarg, kind in zip(self._functions, self._args, self._kwargs, self._kind): ...
python
def _apply_all(self, sat): """ Apply all of the custom functions to the satellite data object. """ if len(self._functions) > 0: for func, arg, kwarg, kind in zip(self._functions, self._args, self._kwargs, self._kind): ...
[ "def", "_apply_all", "(", "self", ",", "sat", ")", ":", "if", "len", "(", "self", ".", "_functions", ")", ">", "0", ":", "for", "func", ",", "arg", ",", "kwarg", ",", "kind", "in", "zip", "(", "self", ".", "_functions", ",", "self", ".", "_args",...
Apply all of the custom functions to the satellite data object.
[ "Apply", "all", "of", "the", "custom", "functions", "to", "the", "satellite", "data", "object", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_custom.py#L116-L214
rstoneback/pysat
pysat/_custom.py
Custom.clear
def clear(self): """Clear custom function list.""" self._functions=[] self._args=[] self._kwargs=[] self._kind=[]
python
def clear(self): """Clear custom function list.""" self._functions=[] self._args=[] self._kwargs=[] self._kind=[]
[ "def", "clear", "(", "self", ")", ":", "self", ".", "_functions", "=", "[", "]", "self", ".", "_args", "=", "[", "]", "self", ".", "_kwargs", "=", "[", "]", "self", ".", "_kind", "=", "[", "]" ]
Clear custom function list.
[ "Clear", "custom", "function", "list", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_custom.py#L216-L221
rstoneback/pysat
pysat/instruments/superdarn_grdex.py
list_files
def list_files(tag='north', sat_id=None, data_path=None, format_str=None): """Return a Pandas Series of every file for chosen satellite data Parameters ----------- tag : (string) Denotes type of file to load. Accepted types are 'north' and 'south'. (default='north') sat_id : (strin...
python
def list_files(tag='north', sat_id=None, data_path=None, format_str=None): """Return a Pandas Series of every file for chosen satellite data Parameters ----------- tag : (string) Denotes type of file to load. Accepted types are 'north' and 'south'. (default='north') sat_id : (strin...
[ "def", "list_files", "(", "tag", "=", "'north'", ",", "sat_id", "=", "None", ",", "data_path", "=", "None", ",", "format_str", "=", "None", ")", ":", "if", "format_str", "is", "None", "and", "tag", "is", "not", "None", ":", "if", "tag", "==", "'north...
Return a Pandas Series of every file for chosen satellite data Parameters ----------- tag : (string) Denotes type of file to load. Accepted types are 'north' and 'south'. (default='north') sat_id : (string or NoneType) Specifies the satellite ID for a constellation. Not used. ...
[ "Return", "a", "Pandas", "Series", "of", "every", "file", "for", "chosen", "satellite", "data" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/superdarn_grdex.py#L53-L88
rstoneback/pysat
pysat/instruments/superdarn_grdex.py
download
def download(date_array, tag, sat_id, data_path, user=None, password=None): """ Download SuperDARN data from Virginia Tech organized for loading by pysat. """ import sys import os import pysftp import davitpy if user is None: user = os.environ['DBREADUSER'] if password...
python
def download(date_array, tag, sat_id, data_path, user=None, password=None): """ Download SuperDARN data from Virginia Tech organized for loading by pysat. """ import sys import os import pysftp import davitpy if user is None: user = os.environ['DBREADUSER'] if password...
[ "def", "download", "(", "date_array", ",", "tag", ",", "sat_id", ",", "data_path", ",", "user", "=", "None", ",", "password", "=", "None", ")", ":", "import", "sys", "import", "os", "import", "pysftp", "import", "davitpy", "if", "user", "is", "None", "...
Download SuperDARN data from Virginia Tech organized for loading by pysat.
[ "Download", "SuperDARN", "data", "from", "Virginia", "Tech", "organized", "for", "loading", "by", "pysat", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/superdarn_grdex.py#L178-L214
emc-openstack/storops
storops/vnx/resource/disk.py
VNXDiskList.same_disks
def same_disks(self, count=2): """ filter self to the required number of disks with same size and type Select the disks with the same type and same size. If not enough disks available, set self to empty. :param count: number of disks to retrieve :return: disk list """ ...
python
def same_disks(self, count=2): """ filter self to the required number of disks with same size and type Select the disks with the same type and same size. If not enough disks available, set self to empty. :param count: number of disks to retrieve :return: disk list """ ...
[ "def", "same_disks", "(", "self", ",", "count", "=", "2", ")", ":", "ret", "=", "self", "if", "len", "(", "self", ")", ">", "0", ":", "type_counter", "=", "Counter", "(", "self", ".", "drive_type", ")", "drive_type", ",", "counts", "=", "type_counter...
filter self to the required number of disks with same size and type Select the disks with the same type and same size. If not enough disks available, set self to empty. :param count: number of disks to retrieve :return: disk list
[ "filter", "self", "to", "the", "required", "number", "of", "disks", "with", "same", "size", "and", "type" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/disk.py#L141-L166
rstoneback/pysat
pysat/_constellation.py
Constellation.set_bounds
def set_bounds(self, start, stop): """ Sets boundaries for all instruments in constellation """ for instrument in self.instruments: instrument.bounds = (start, stop)
python
def set_bounds(self, start, stop): """ Sets boundaries for all instruments in constellation """ for instrument in self.instruments: instrument.bounds = (start, stop)
[ "def", "set_bounds", "(", "self", ",", "start", ",", "stop", ")", ":", "for", "instrument", "in", "self", ".", "instruments", ":", "instrument", ".", "bounds", "=", "(", "start", ",", "stop", ")" ]
Sets boundaries for all instruments in constellation
[ "Sets", "boundaries", "for", "all", "instruments", "in", "constellation" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L64-L69
rstoneback/pysat
pysat/_constellation.py
Constellation.data_mod
def data_mod(self, *args, **kwargs): """ Register a function to modify data of member Instruments. The function is not partially applied to modify member data. When the Constellation receives a function call to register a function for data modification, it passes the call to ea...
python
def data_mod(self, *args, **kwargs): """ Register a function to modify data of member Instruments. The function is not partially applied to modify member data. When the Constellation receives a function call to register a function for data modification, it passes the call to ea...
[ "def", "data_mod", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "for", "instrument", "in", "self", ".", "instruments", ":", "instrument", ".", "custom", ".", "add", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
Register a function to modify data of member Instruments. The function is not partially applied to modify member data. When the Constellation receives a function call to register a function for data modification, it passes the call to each instrument and registers it in the instrument's pysat....
[ "Register", "a", "function", "to", "modify", "data", "of", "member", "Instruments", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L71-L119
rstoneback/pysat
pysat/_constellation.py
Constellation.load
def load(self, *args, **kwargs): """ Load instrument data into instrument object.data (Wraps pysat.Instrument.load; documentation of that function is reproduced here.) Parameters --------- yr : integer Year for desired data doy : integer ...
python
def load(self, *args, **kwargs): """ Load instrument data into instrument object.data (Wraps pysat.Instrument.load; documentation of that function is reproduced here.) Parameters --------- yr : integer Year for desired data doy : integer ...
[ "def", "load", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "for", "instrument", "in", "self", ".", "instruments", ":", "instrument", ".", "load", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
Load instrument data into instrument object.data (Wraps pysat.Instrument.load; documentation of that function is reproduced here.) Parameters --------- yr : integer Year for desired data doy : integer day of year data : datetime object ...
[ "Load", "instrument", "data", "into", "instrument", "object", ".", "data" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L121-L143
rstoneback/pysat
pysat/_constellation.py
Constellation.add
def add(self, bounds1, label1, bounds2, label2, bin3, label3, data_label): """ Combines signals from multiple instruments within given bounds. Parameters ---------- bounds1 : (min, max) Bounds for selecting data on the axis of label1 D...
python
def add(self, bounds1, label1, bounds2, label2, bin3, label3, data_label): """ Combines signals from multiple instruments within given bounds. Parameters ---------- bounds1 : (min, max) Bounds for selecting data on the axis of label1 D...
[ "def", "add", "(", "self", ",", "bounds1", ",", "label1", ",", "bounds2", ",", "label2", ",", "bin3", ",", "label3", ",", "data_label", ")", ":", "# TODO Update for 2.7 compatability.", "if", "isinstance", "(", "data_label", ",", "str", ")", ":", "data_label...
Combines signals from multiple instruments within given bounds. Parameters ---------- bounds1 : (min, max) Bounds for selecting data on the axis of label1 Data points with label1 in [min, max) will be considered. label1 : string Data label for...
[ "Combines", "signals", "from", "multiple", "instruments", "within", "given", "bounds", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L145-L252
rstoneback/pysat
pysat/_constellation.py
Constellation.difference
def difference(self, instrument1, instrument2, bounds, data_labels, cost_function): """ Calculates the difference in signals from multiple instruments within the given bounds. Parameters ---------- instrument1 : Instrument Information must ...
python
def difference(self, instrument1, instrument2, bounds, data_labels, cost_function): """ Calculates the difference in signals from multiple instruments within the given bounds. Parameters ---------- instrument1 : Instrument Information must ...
[ "def", "difference", "(", "self", ",", "instrument1", ",", "instrument2", ",", "bounds", ",", "data_labels", ",", "cost_function", ")", ":", "\"\"\"\n Draft Pseudocode\n ----------------\n Check integrity of inputs.\n\n Let STD_LABELS be the constant tuple...
Calculates the difference in signals from multiple instruments within the given bounds. Parameters ---------- instrument1 : Instrument Information must already be loaded into the instrument. instrument2 : Instrument Information must already b...
[ "Calculates", "the", "difference", "in", "signals", "from", "multiple", "instruments", "within", "the", "given", "bounds", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L254-L451
rstoneback/pysat
pysat/ssnl/occur_prob.py
daily2D
def daily2D(inst, bin1, label1, bin2, label2, data_label, gate, returnBins=False): """2D Daily Occurrence Probability of data_label > gate over a season. If data_label is greater than gate at least once per day, then a 100% occurrence probability results.Season delineated by the bounds attached to...
python
def daily2D(inst, bin1, label1, bin2, label2, data_label, gate, returnBins=False): """2D Daily Occurrence Probability of data_label > gate over a season. If data_label is greater than gate at least once per day, then a 100% occurrence probability results.Season delineated by the bounds attached to...
[ "def", "daily2D", "(", "inst", ",", "bin1", ",", "label1", ",", "bin2", ",", "label2", ",", "data_label", ",", "gate", ",", "returnBins", "=", "False", ")", ":", "return", "_occurrence2D", "(", "inst", ",", "bin1", ",", "label1", ",", "bin2", ",", "l...
2D Daily Occurrence Probability of data_label > gate over a season. If data_label is greater than gate at least once per day, then a 100% occurrence probability results.Season delineated by the bounds attached to Instrument object. Prob = (# of times with at least one hit)/(# of times in bin) ...
[ "2D", "Daily", "Occurrence", "Probability", "of", "data_label", ">", "gate", "over", "a", "season", ".", "If", "data_label", "is", "greater", "than", "gate", "at", "least", "once", "per", "day", "then", "a", "100%", "occurrence", "probability", "results", "....
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/ssnl/occur_prob.py#L22-L61
rstoneback/pysat
pysat/ssnl/occur_prob.py
by_orbit2D
def by_orbit2D(inst, bin1, label1, bin2, label2, data_label, gate, returnBins=False): """2D Occurrence Probability of data_label orbit-by-orbit over a season. If data_label is greater than gate atleast once per orbit, then a 100% occurrence probability results. Season delineated by the bounds atta...
python
def by_orbit2D(inst, bin1, label1, bin2, label2, data_label, gate, returnBins=False): """2D Occurrence Probability of data_label orbit-by-orbit over a season. If data_label is greater than gate atleast once per orbit, then a 100% occurrence probability results. Season delineated by the bounds atta...
[ "def", "by_orbit2D", "(", "inst", ",", "bin1", ",", "label1", ",", "bin2", ",", "label2", ",", "data_label", ",", "gate", ",", "returnBins", "=", "False", ")", ":", "return", "_occurrence2D", "(", "inst", ",", "bin1", ",", "label1", ",", "bin2", ",", ...
2D Occurrence Probability of data_label orbit-by-orbit over a season. If data_label is greater than gate atleast once per orbit, then a 100% occurrence probability results. Season delineated by the bounds attached to Instrument object. Prob = (# of times with at least one hit)/(# of times in bin) ...
[ "2D", "Occurrence", "Probability", "of", "data_label", "orbit", "-", "by", "-", "orbit", "over", "a", "season", ".", "If", "data_label", "is", "greater", "than", "gate", "atleast", "once", "per", "orbit", "then", "a", "100%", "occurrence", "probability", "re...
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/ssnl/occur_prob.py#L64-L102
rstoneback/pysat
pysat/ssnl/occur_prob.py
daily3D
def daily3D(inst, bin1, label1, bin2, label2, bin3, label3, data_label, gate, returnBins=False): """3D Daily Occurrence Probability of data_label > gate over a season. If data_label is greater than gate atleast once per day, then a 100% occurrence probability results. Season delineated by...
python
def daily3D(inst, bin1, label1, bin2, label2, bin3, label3, data_label, gate, returnBins=False): """3D Daily Occurrence Probability of data_label > gate over a season. If data_label is greater than gate atleast once per day, then a 100% occurrence probability results. Season delineated by...
[ "def", "daily3D", "(", "inst", ",", "bin1", ",", "label1", ",", "bin2", ",", "label2", ",", "bin3", ",", "label3", ",", "data_label", ",", "gate", ",", "returnBins", "=", "False", ")", ":", "return", "_occurrence3D", "(", "inst", ",", "bin1", ",", "l...
3D Daily Occurrence Probability of data_label > gate over a season. If data_label is greater than gate atleast once per day, then a 100% occurrence probability results. Season delineated by the bounds attached to Instrument object. Prob = (# of times with at least one hit)/(# of times in bin) ...
[ "3D", "Daily", "Occurrence", "Probability", "of", "data_label", ">", "gate", "over", "a", "season", ".", "If", "data_label", "is", "greater", "than", "gate", "atleast", "once", "per", "day", "then", "a", "100%", "occurrence", "probability", "results", ".", "...
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/ssnl/occur_prob.py#L168-L207
rstoneback/pysat
pysat/utils.py
computational_form
def computational_form(data): """ Input Series of numbers, Series, or DataFrames repackaged for calculation. Parameters ---------- data : pandas.Series Series of numbers, Series, DataFrames Returns ------- pandas.Series, DataFrame, or Panel repacked data, aligned by...
python
def computational_form(data): """ Input Series of numbers, Series, or DataFrames repackaged for calculation. Parameters ---------- data : pandas.Series Series of numbers, Series, DataFrames Returns ------- pandas.Series, DataFrame, or Panel repacked data, aligned by...
[ "def", "computational_form", "(", "data", ")", ":", "if", "isinstance", "(", "data", ".", "iloc", "[", "0", "]", ",", "DataFrame", ")", ":", "dslice", "=", "Panel", ".", "from_dict", "(", "dict", "(", "[", "(", "i", ",", "data", ".", "iloc", "[", ...
Input Series of numbers, Series, or DataFrames repackaged for calculation. Parameters ---------- data : pandas.Series Series of numbers, Series, DataFrames Returns ------- pandas.Series, DataFrame, or Panel repacked data, aligned by indices, ready for calculation
[ "Input", "Series", "of", "numbers", "Series", "or", "DataFrames", "repackaged", "for", "calculation", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L16-L40
rstoneback/pysat
pysat/utils.py
set_data_dir
def set_data_dir(path=None, store=None): """ Set the top level directory pysat uses to look for data and reload. Parameters ---------- path : string valid path to directory pysat uses to look for data store : bool if True, store data directory for future runs """ import ...
python
def set_data_dir(path=None, store=None): """ Set the top level directory pysat uses to look for data and reload. Parameters ---------- path : string valid path to directory pysat uses to look for data store : bool if True, store data directory for future runs """ import ...
[ "def", "set_data_dir", "(", "path", "=", "None", ",", "store", "=", "None", ")", ":", "import", "sys", "import", "os", "import", "pysat", "if", "sys", ".", "version_info", "[", "0", "]", ">=", "3", ":", "if", "sys", ".", "version_info", "[", "1", "...
Set the top level directory pysat uses to look for data and reload. Parameters ---------- path : string valid path to directory pysat uses to look for data store : bool if True, store data directory for future runs
[ "Set", "the", "top", "level", "directory", "pysat", "uses", "to", "look", "for", "data", "and", "reload", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L42-L76
rstoneback/pysat
pysat/utils.py
load_netcdf4
def load_netcdf4(fnames=None, strict_meta=False, file_format=None, epoch_name='Epoch', units_label='units', name_label='long_name', notes_label='notes', desc_label='desc', plot_label='label', axis_label='axis', scale_label='scale', m...
python
def load_netcdf4(fnames=None, strict_meta=False, file_format=None, epoch_name='Epoch', units_label='units', name_label='long_name', notes_label='notes', desc_label='desc', plot_label='label', axis_label='axis', scale_label='scale', m...
[ "def", "load_netcdf4", "(", "fnames", "=", "None", ",", "strict_meta", "=", "False", ",", "file_format", "=", "None", ",", "epoch_name", "=", "'Epoch'", ",", "units_label", "=", "'units'", ",", "name_label", "=", "'long_name'", ",", "notes_label", "=", "'not...
Load netCDF-3/4 file produced by pysat. Parameters ---------- fnames : string or array_like of strings filenames to load strict_meta : boolean check if metadata across fnames is the same file_format : string file_format keyword passed to netCDF4 routine NETCDF3_CLASS...
[ "Load", "netCDF", "-", "3", "/", "4", "file", "produced", "by", "pysat", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L78-L362
rstoneback/pysat
pysat/utils.py
getyrdoy
def getyrdoy(date): """Return a tuple of year, day of year for a supplied datetime object.""" try: doy = date.toordinal()-datetime(date.year,1,1).toordinal()+1 except AttributeError: raise AttributeError("Must supply a pandas datetime object or " + "equivalent")...
python
def getyrdoy(date): """Return a tuple of year, day of year for a supplied datetime object.""" try: doy = date.toordinal()-datetime(date.year,1,1).toordinal()+1 except AttributeError: raise AttributeError("Must supply a pandas datetime object or " + "equivalent")...
[ "def", "getyrdoy", "(", "date", ")", ":", "try", ":", "doy", "=", "date", ".", "toordinal", "(", ")", "-", "datetime", "(", "date", ".", "year", ",", "1", ",", "1", ")", ".", "toordinal", "(", ")", "+", "1", "except", "AttributeError", ":", "rais...
Return a tuple of year, day of year for a supplied datetime object.
[ "Return", "a", "tuple", "of", "year", "day", "of", "year", "for", "a", "supplied", "datetime", "object", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L365-L374
rstoneback/pysat
pysat/utils.py
season_date_range
def season_date_range(start, stop, freq='D'): """ Return array of datetime objects using input frequency from start to stop Supports single datetime object or list, tuple, ndarray of start and stop dates. freq codes correspond to pandas date_range codes, D daily, M monthly, S secondly """...
python
def season_date_range(start, stop, freq='D'): """ Return array of datetime objects using input frequency from start to stop Supports single datetime object or list, tuple, ndarray of start and stop dates. freq codes correspond to pandas date_range codes, D daily, M monthly, S secondly """...
[ "def", "season_date_range", "(", "start", ",", "stop", ",", "freq", "=", "'D'", ")", ":", "if", "hasattr", "(", "start", ",", "'__iter__'", ")", ":", "# missing check for datetime", "season", "=", "pds", ".", "date_range", "(", "start", "[", "0", "]", ",...
Return array of datetime objects using input frequency from start to stop Supports single datetime object or list, tuple, ndarray of start and stop dates. freq codes correspond to pandas date_range codes, D daily, M monthly, S secondly
[ "Return", "array", "of", "datetime", "objects", "using", "input", "frequency", "from", "start", "to", "stop" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L377-L395
rstoneback/pysat
pysat/utils.py
create_datetime_index
def create_datetime_index(year=None, month=None, day=None, uts=None): """Create a timeseries index using supplied year, month, day, and ut in seconds. Parameters ---------- year : array_like of ints month : array_like of ints or None day : array_like of ints for day...
python
def create_datetime_index(year=None, month=None, day=None, uts=None): """Create a timeseries index using supplied year, month, day, and ut in seconds. Parameters ---------- year : array_like of ints month : array_like of ints or None day : array_like of ints for day...
[ "def", "create_datetime_index", "(", "year", "=", "None", ",", "month", "=", "None", ",", "day", "=", "None", ",", "uts", "=", "None", ")", ":", "# need a timeseries index for storing satellite data in pandas but", "# creating a datetime object for everything is too slow", ...
Create a timeseries index using supplied year, month, day, and ut in seconds. Parameters ---------- year : array_like of ints month : array_like of ints or None day : array_like of ints for day (default) or day of year (use month=None) uts : array_like of floats...
[ "Create", "a", "timeseries", "index", "using", "supplied", "year", "month", "day", "and", "ut", "in", "seconds", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L413-L475
rstoneback/pysat
pysat/utils.py
nan_circmean
def nan_circmean(samples, high=2.0*np.pi, low=0.0, axis=None): """NaN insensitive version of scipy's circular mean routine Parameters ----------- samples : array_like Input array low : float or int Lower boundary for circular standard deviation range (default=0) high: float or i...
python
def nan_circmean(samples, high=2.0*np.pi, low=0.0, axis=None): """NaN insensitive version of scipy's circular mean routine Parameters ----------- samples : array_like Input array low : float or int Lower boundary for circular standard deviation range (default=0) high: float or i...
[ "def", "nan_circmean", "(", "samples", ",", "high", "=", "2.0", "*", "np", ".", "pi", ",", "low", "=", "0.0", ",", "axis", "=", "None", ")", ":", "samples", "=", "np", ".", "asarray", "(", "samples", ")", "samples", "=", "samples", "[", "~", "np"...
NaN insensitive version of scipy's circular mean routine Parameters ----------- samples : array_like Input array low : float or int Lower boundary for circular standard deviation range (default=0) high: float or int Upper boundary for circular standard deviation range (defau...
[ "NaN", "insensitive", "version", "of", "scipy", "s", "circular", "mean", "routine" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L478-L523
rstoneback/pysat
pysat/utils.py
nan_circstd
def nan_circstd(samples, high=2.0*np.pi, low=0.0, axis=None): """NaN insensitive version of scipy's circular standard deviation routine Parameters ----------- samples : array_like Input array low : float or int Lower boundary for circular standard deviation range (default=0) hig...
python
def nan_circstd(samples, high=2.0*np.pi, low=0.0, axis=None): """NaN insensitive version of scipy's circular standard deviation routine Parameters ----------- samples : array_like Input array low : float or int Lower boundary for circular standard deviation range (default=0) hig...
[ "def", "nan_circstd", "(", "samples", ",", "high", "=", "2.0", "*", "np", ".", "pi", ",", "low", "=", "0.0", ",", "axis", "=", "None", ")", ":", "samples", "=", "np", ".", "asarray", "(", "samples", ")", "samples", "=", "samples", "[", "~", "np",...
NaN insensitive version of scipy's circular standard deviation routine Parameters ----------- samples : array_like Input array low : float or int Lower boundary for circular standard deviation range (default=0) high: float or int Upper boundary for circular standard deviatio...
[ "NaN", "insensitive", "version", "of", "scipy", "s", "circular", "standard", "deviation", "routine" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L526-L563
rstoneback/pysat
pysat/instruments/icon_euv.py
default
def default(inst): """Default routine to be applied when loading data. Removes redundant naming """ import pysat.instruments.icon_ivm as icivm inst.tag = 'level_2' icivm.remove_icon_names(inst, target='ICON_L2_EUV_Daytime_OP_')
python
def default(inst): """Default routine to be applied when loading data. Removes redundant naming """ import pysat.instruments.icon_ivm as icivm inst.tag = 'level_2' icivm.remove_icon_names(inst, target='ICON_L2_EUV_Daytime_OP_')
[ "def", "default", "(", "inst", ")", ":", "import", "pysat", ".", "instruments", ".", "icon_ivm", "as", "icivm", "inst", ".", "tag", "=", "'level_2'", "icivm", ".", "remove_icon_names", "(", "inst", ",", "target", "=", "'ICON_L2_EUV_Daytime_OP_'", ")" ]
Default routine to be applied when loading data. Removes redundant naming
[ "Default", "routine", "to", "be", "applied", "when", "loading", "data", ".", "Removes", "redundant", "naming" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/icon_euv.py#L53-L59
rstoneback/pysat
pysat/instruments/icon_euv.py
list_files
def list_files(tag=None, sat_id=None, data_path=None, format_str=None): """Produce a list of ICON EUV files. Notes ----- Currently fixed to level-2 """ desc = None level = tag if level == 'level_1': code = 'L1' desc = None elif level == 'level_2': code = 'L...
python
def list_files(tag=None, sat_id=None, data_path=None, format_str=None): """Produce a list of ICON EUV files. Notes ----- Currently fixed to level-2 """ desc = None level = tag if level == 'level_1': code = 'L1' desc = None elif level == 'level_2': code = 'L...
[ "def", "list_files", "(", "tag", "=", "None", ",", "sat_id", "=", "None", ",", "data_path", "=", "None", ",", "format_str", "=", "None", ")", ":", "desc", "=", "None", "level", "=", "tag", "if", "level", "==", "'level_1'", ":", "code", "=", "'L1'", ...
Produce a list of ICON EUV files. Notes ----- Currently fixed to level-2
[ "Produce", "a", "list", "of", "ICON", "EUV", "files", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/icon_euv.py#L76-L103
emc-openstack/storops
storops/lib/resource.py
Resource.shadow_copy
def shadow_copy(self): """ Return a copy of the resource with same raw data :return: copy of the resource """ ret = self.__class__() if not self._is_updated(): # before copy, make sure source is updated. self.update() ret._parsed_resource = self._...
python
def shadow_copy(self): """ Return a copy of the resource with same raw data :return: copy of the resource """ ret = self.__class__() if not self._is_updated(): # before copy, make sure source is updated. self.update() ret._parsed_resource = self._...
[ "def", "shadow_copy", "(", "self", ")", ":", "ret", "=", "self", ".", "__class__", "(", ")", "if", "not", "self", ".", "_is_updated", "(", ")", ":", "# before copy, make sure source is updated.", "self", ".", "update", "(", ")", "ret", ".", "_parsed_resource...
Return a copy of the resource with same raw data :return: copy of the resource
[ "Return", "a", "copy", "of", "the", "resource", "with", "same", "raw", "data" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/resource.py#L31-L41
rstoneback/pysat
pysat/instruments/netcdf_pandas.py
load
def load(fnames, tag=None, sat_id=None, **kwargs): """Loads data using pysat.utils.load_netcdf4 . This routine is called as needed by pysat. It is not intended for direct user interaction. Parameters ---------- fnames : array-like iterable of filename strings, full path, to data fi...
python
def load(fnames, tag=None, sat_id=None, **kwargs): """Loads data using pysat.utils.load_netcdf4 . This routine is called as needed by pysat. It is not intended for direct user interaction. Parameters ---------- fnames : array-like iterable of filename strings, full path, to data fi...
[ "def", "load", "(", "fnames", ",", "tag", "=", "None", ",", "sat_id", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "pysat", ".", "utils", ".", "load_netcdf4", "(", "fnames", ",", "*", "*", "kwargs", ")" ]
Loads data using pysat.utils.load_netcdf4 . This routine is called as needed by pysat. It is not intended for direct user interaction. Parameters ---------- fnames : array-like iterable of filename strings, full path, to data files to be loaded. This input is nominally provided...
[ "Loads", "data", "using", "pysat", ".", "utils", ".", "load_netcdf4", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/netcdf_pandas.py#L49-L104
rstoneback/pysat
pysat/instruments/netcdf_pandas.py
list_files
def list_files(tag=None, sat_id=None, data_path=None, format_str=None): """Produce a list of files corresponding to format_str located at data_path. This routine is invoked by pysat and is not intended for direct use by the end user. Multiple data levels may be supported via the 'tag' and 'sat_id' inp...
python
def list_files(tag=None, sat_id=None, data_path=None, format_str=None): """Produce a list of files corresponding to format_str located at data_path. This routine is invoked by pysat and is not intended for direct use by the end user. Multiple data levels may be supported via the 'tag' and 'sat_id' inp...
[ "def", "list_files", "(", "tag", "=", "None", ",", "sat_id", "=", "None", ",", "data_path", "=", "None", ",", "format_str", "=", "None", ")", ":", "return", "pysat", ".", "Files", ".", "from_os", "(", "data_path", "=", "data_path", ",", "format_str", "...
Produce a list of files corresponding to format_str located at data_path. This routine is invoked by pysat and is not intended for direct use by the end user. Multiple data levels may be supported via the 'tag' and 'sat_id' input strings. Parameters ---------- tag : string ('') tag na...
[ "Produce", "a", "list", "of", "files", "corresponding", "to", "format_str", "located", "at", "data_path", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/netcdf_pandas.py#L107-L164
emc-openstack/storops
storops/vnx/block_cli.py
command
def command(f): """ indicate it's a command of naviseccli :param f: function that returns the command in list :return: command execution result """ @functools.wraps(f) def func_wrapper(self, *argv, **kwargs): if 'ip' in kwargs: ip = kwargs['ip'] del kwargs['ip']...
python
def command(f): """ indicate it's a command of naviseccli :param f: function that returns the command in list :return: command execution result """ @functools.wraps(f) def func_wrapper(self, *argv, **kwargs): if 'ip' in kwargs: ip = kwargs['ip'] del kwargs['ip']...
[ "def", "command", "(", "f", ")", ":", "@", "functools", ".", "wraps", "(", "f", ")", "def", "func_wrapper", "(", "self", ",", "*", "argv", ",", "*", "*", "kwargs", ")", ":", "if", "'ip'", "in", "kwargs", ":", "ip", "=", "kwargs", "[", "'ip'", "...
indicate it's a command of naviseccli :param f: function that returns the command in list :return: command execution result
[ "indicate", "it", "s", "a", "command", "of", "naviseccli" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/block_cli.py#L57-L75
emc-openstack/storops
storops/vnx/block_cli.py
duel_command
def duel_command(f): """ indicate it's a command need to be called on both SP :param f: function that returns the command in list :return: command execution result on both sps (tuple of 2) """ @functools.wraps(f) def func_wrapper(self, *argv, **kwargs): commands = _get_commands(f, self...
python
def duel_command(f): """ indicate it's a command need to be called on both SP :param f: function that returns the command in list :return: command execution result on both sps (tuple of 2) """ @functools.wraps(f) def func_wrapper(self, *argv, **kwargs): commands = _get_commands(f, self...
[ "def", "duel_command", "(", "f", ")", ":", "@", "functools", ".", "wraps", "(", "f", ")", "def", "func_wrapper", "(", "self", ",", "*", "argv", ",", "*", "*", "kwargs", ")", ":", "commands", "=", "_get_commands", "(", "f", ",", "self", ",", "*", ...
indicate it's a command need to be called on both SP :param f: function that returns the command in list :return: command execution result on both sps (tuple of 2)
[ "indicate", "it", "s", "a", "command", "need", "to", "be", "called", "on", "both", "SP" ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/block_cli.py#L78-L90
emc-openstack/storops
storops/lib/common.py
supplement_filesystem
def supplement_filesystem(old_size, user_cap=False): """Return new size accounting for the metadata.""" new_size = old_size if user_cap: if old_size <= _GiB_to_Byte(1.5): new_size = _GiB_to_Byte(3) else: new_size += _GiB_to_Byte(1.5) return int(new_size)
python
def supplement_filesystem(old_size, user_cap=False): """Return new size accounting for the metadata.""" new_size = old_size if user_cap: if old_size <= _GiB_to_Byte(1.5): new_size = _GiB_to_Byte(3) else: new_size += _GiB_to_Byte(1.5) return int(new_size)
[ "def", "supplement_filesystem", "(", "old_size", ",", "user_cap", "=", "False", ")", ":", "new_size", "=", "old_size", "if", "user_cap", ":", "if", "old_size", "<=", "_GiB_to_Byte", "(", "1.5", ")", ":", "new_size", "=", "_GiB_to_Byte", "(", "3", ")", "els...
Return new size accounting for the metadata.
[ "Return", "new", "size", "accounting", "for", "the", "metadata", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/common.py#L551-L559
emc-openstack/storops
storops/lib/common.py
SynchronizedDecorator.synchronized
def synchronized(cls, obj=None): """ synchronize on obj if obj is supplied. :param obj: the obj to lock on. if none, lock to the function :return: return of the func. """ def get_key(f, o): if o is None: key = hash(f) else: ...
python
def synchronized(cls, obj=None): """ synchronize on obj if obj is supplied. :param obj: the obj to lock on. if none, lock to the function :return: return of the func. """ def get_key(f, o): if o is None: key = hash(f) else: ...
[ "def", "synchronized", "(", "cls", ",", "obj", "=", "None", ")", ":", "def", "get_key", "(", "f", ",", "o", ")", ":", "if", "o", "is", "None", ":", "key", "=", "hash", "(", "f", ")", "else", ":", "key", "=", "hash", "(", "o", ")", "return", ...
synchronize on obj if obj is supplied. :param obj: the obj to lock on. if none, lock to the function :return: return of the func.
[ "synchronize", "on", "obj", "if", "obj", "is", "supplied", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/common.py#L347-L377
emc-openstack/storops
storops/lib/tasks.py
PQueue.re_enqueue
def re_enqueue(self, item): """Re-enqueue till reach max retries.""" if 'retries' in item: retries = item['retries'] if retries >= self.MAX_RETRIES: log.warn("Failed to execute {} after {} retries, give it " " up.".format(item['method'], r...
python
def re_enqueue(self, item): """Re-enqueue till reach max retries.""" if 'retries' in item: retries = item['retries'] if retries >= self.MAX_RETRIES: log.warn("Failed to execute {} after {} retries, give it " " up.".format(item['method'], r...
[ "def", "re_enqueue", "(", "self", ",", "item", ")", ":", "if", "'retries'", "in", "item", ":", "retries", "=", "item", "[", "'retries'", "]", "if", "retries", ">=", "self", ".", "MAX_RETRIES", ":", "log", ".", "warn", "(", "\"Failed to execute {} after {} ...
Re-enqueue till reach max retries.
[ "Re", "-", "enqueue", "till", "reach", "max", "retries", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/tasks.py#L74-L87
emc-openstack/storops
storops/lib/version.py
Criteria._support_op
def _support_op(*args): """Internal decorator to define an criteria compare operations.""" def inner(func): for one_arg in args: _op_mapping_[one_arg] = func return func return inner
python
def _support_op(*args): """Internal decorator to define an criteria compare operations.""" def inner(func): for one_arg in args: _op_mapping_[one_arg] = func return func return inner
[ "def", "_support_op", "(", "*", "args", ")", ":", "def", "inner", "(", "func", ")", ":", "for", "one_arg", "in", "args", ":", "_op_mapping_", "[", "one_arg", "]", "=", "func", "return", "func", "return", "inner" ]
Internal decorator to define an criteria compare operations.
[ "Internal", "decorator", "to", "define", "an", "criteria", "compare", "operations", "." ]
train
https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/version.py#L37-L44
rstoneback/pysat
pysat/instruments/cnofs_vefi.py
clean
def clean(inst): """Routine to return VEFI data cleaned to the specified level Parameters ----------- inst : (pysat.Instrument) Instrument class object, whose attribute clean_level is used to return the desired level of data selectivity. Returns -------- Void : (NoneType) ...
python
def clean(inst): """Routine to return VEFI data cleaned to the specified level Parameters ----------- inst : (pysat.Instrument) Instrument class object, whose attribute clean_level is used to return the desired level of data selectivity. Returns -------- Void : (NoneType) ...
[ "def", "clean", "(", "inst", ")", ":", "if", "(", "inst", ".", "clean_level", "==", "'dusty'", ")", "|", "(", "inst", ".", "clean_level", "==", "'clean'", ")", ":", "idx", ",", "=", "np", ".", "where", "(", "inst", "[", "'B_flag'", "]", "==", "0"...
Routine to return VEFI data cleaned to the specified level Parameters ----------- inst : (pysat.Instrument) Instrument class object, whose attribute clean_level is used to return the desired level of data selectivity. Returns -------- Void : (NoneType) data in inst is m...
[ "Routine", "to", "return", "VEFI", "data", "cleaned", "to", "the", "specified", "level" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/cnofs_vefi.py#L63-L86
rstoneback/pysat
pysat/instruments/icon_ivm.py
remove_icon_names
def remove_icon_names(inst, target=None): """Removes leading text on ICON project variable names Parameters ---------- inst : pysat.Instrument ICON associated pysat.Instrument object target : str Leading string to remove. If none supplied, ICON project standards are used to ...
python
def remove_icon_names(inst, target=None): """Removes leading text on ICON project variable names Parameters ---------- inst : pysat.Instrument ICON associated pysat.Instrument object target : str Leading string to remove. If none supplied, ICON project standards are used to ...
[ "def", "remove_icon_names", "(", "inst", ",", "target", "=", "None", ")", ":", "if", "target", "is", "None", ":", "lev", "=", "inst", ".", "tag", "if", "lev", "==", "'level_2'", ":", "lev", "=", "'L2'", "elif", "lev", "==", "'level_0'", ":", "lev", ...
Removes leading text on ICON project variable names Parameters ---------- inst : pysat.Instrument ICON associated pysat.Instrument object target : str Leading string to remove. If none supplied, ICON project standards are used to identify and remove leading text Ret...
[ "Removes", "leading", "text", "on", "ICON", "project", "variable", "names" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/icon_ivm.py#L114-L170
rstoneback/pysat
pysat/instruments/omni_hro.py
list_files
def list_files(tag=None, sat_id=None, data_path=None, format_str=None): """Return a Pandas Series of every file for chosen satellite data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are '1min' and '5min'. (default=None) sat_id : (s...
python
def list_files(tag=None, sat_id=None, data_path=None, format_str=None): """Return a Pandas Series of every file for chosen satellite data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are '1min' and '5min'. (default=None) sat_id : (s...
[ "def", "list_files", "(", "tag", "=", "None", ",", "sat_id", "=", "None", ",", "data_path", "=", "None", ",", "format_str", "=", "None", ")", ":", "if", "format_str", "is", "None", "and", "data_path", "is", "not", "None", ":", "if", "(", "tag", "==",...
Return a Pandas Series of every file for chosen satellite data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are '1min' and '5min'. (default=None) sat_id : (string or NoneType) Specifies the satellite ID for a constellation. Not...
[ "Return", "a", "Pandas", "Series", "of", "every", "file", "for", "chosen", "satellite", "data" ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/omni_hro.py#L66-L110
rstoneback/pysat
pysat/instruments/omni_hro.py
time_shift_to_magnetic_poles
def time_shift_to_magnetic_poles(inst): """ OMNI data is time-shifted to bow shock. Time shifted again to intersections with magnetic pole. Parameters ----------- inst : Instrument class object Instrument with OMNI HRO data Notes --------- Time shift calculated using distance t...
python
def time_shift_to_magnetic_poles(inst): """ OMNI data is time-shifted to bow shock. Time shifted again to intersections with magnetic pole. Parameters ----------- inst : Instrument class object Instrument with OMNI HRO data Notes --------- Time shift calculated using distance t...
[ "def", "time_shift_to_magnetic_poles", "(", "inst", ")", ":", "# need to fill in Vx to get an estimate of what is going on", "inst", "[", "'Vx'", "]", "=", "inst", "[", "'Vx'", "]", ".", "interpolate", "(", "'nearest'", ")", "inst", "[", "'Vx'", "]", "=", "inst", ...
OMNI data is time-shifted to bow shock. Time shifted again to intersections with magnetic pole. Parameters ----------- inst : Instrument class object Instrument with OMNI HRO data Notes --------- Time shift calculated using distance to bow shock nose (BSN) and velocity of solar...
[ "OMNI", "data", "is", "time", "-", "shifted", "to", "bow", "shock", ".", "Time", "shifted", "again", "to", "intersections", "with", "magnetic", "pole", "." ]
train
https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/omni_hro.py#L141-L186