repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L157-L169 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L171-L300 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L302-L346 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L348-L383 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L385-L434 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L436-L516 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_orbits.py#L518-L657 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_dst.py#L42-L118 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_kp.py#L45-L54 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_kp.py#L57-L129 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_kp.py#L183-L234 | train |
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",
... | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/sw_kp.py#L236-L286 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/parser.py#L398-L443 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/connection/connector.py#L177-L192 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/connection/connector.py#L194-L209 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/connection/connector.py#L211-L215 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/nas_client.py#L127-L145 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/nas_client.py#L152-L164 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/snap.py#L154-L172 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/snap.py#L184-L195 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/snap.py#L201-L221 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/client.py#L63-L84 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/client.py#L169-L180 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/port.py#L334-L340 | train |
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!"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/filesystem.py#L155-L161 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/ssnl/avg.py#L14-L98 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/system.py#L518-L531 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/cosmic_gps.py#L119-L158 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/cosmic_gps.py#L165-L202 | train |
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",
"... | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/dmsp_ivm.py#L135-L175 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/dmsp_ivm.py#L182-L221 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/remote_system.py#L30-L57 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/remote_system.py#L59-L75 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/remote_system.py#L77-L87 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_interface.py#L29-L57 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/replication_interface.py#L59-L79 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L130-L163 | train |
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",
")"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L166-L185 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L187-L197 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L199-L208 | train |
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",
")"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/metric.py#L210-L220 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_custom.py#L51-L114 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_custom.py#L116-L214 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_custom.py#L216-L221 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/superdarn_grdex.py#L53-L88 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/superdarn_grdex.py#L178-L214 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/disk.py#L141-L166 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L64-L69 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L71-L119 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L121-L143 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L145-L252 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_constellation.py#L254-L451 | train |
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",
".... | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/ssnl/occur_prob.py#L22-L61 | train |
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... | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/ssnl/occur_prob.py#L64-L102 | train |
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",
".",
"... | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/ssnl/occur_prob.py#L168-L207 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L16-L40 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L42-L76 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L78-L362 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L365-L374 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L377-L395 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L413-L475 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L478-L523 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/utils.py#L526-L563 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/icon_euv.py#L53-L59 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/icon_euv.py#L76-L103 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/resource.py#L31-L41 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/netcdf_pandas.py#L49-L104 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/netcdf_pandas.py#L107-L164 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/block_cli.py#L57-L75 | train |
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"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/block_cli.py#L78-L90 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/common.py#L551-L559 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/common.py#L347-L377 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/tasks.py#L74-L87 | train |
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",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/lib/version.py#L37-L44 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/cnofs_vefi.py#L63-L86 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/icon_ivm.py#L114-L170 | train |
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"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/omni_hro.py#L66-L110 | train |
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",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/omni_hro.py#L141-L186 | train |
rstoneback/pysat | pysat/instruments/omni_hro.py | calculate_clock_angle | def calculate_clock_angle(inst):
""" Calculate IMF clock angle and magnitude of IMF in GSM Y-Z plane
Parameters
-----------
inst : pysat.Instrument
Instrument with OMNI HRO data
"""
# Calculate clock angle in degrees
clock_angle = np.degrees(np.arctan2(inst['BY_GSM'], inst['BZ_... | python | def calculate_clock_angle(inst):
""" Calculate IMF clock angle and magnitude of IMF in GSM Y-Z plane
Parameters
-----------
inst : pysat.Instrument
Instrument with OMNI HRO data
"""
# Calculate clock angle in degrees
clock_angle = np.degrees(np.arctan2(inst['BY_GSM'], inst['BZ_... | [
"def",
"calculate_clock_angle",
"(",
"inst",
")",
":",
"# Calculate clock angle in degrees",
"clock_angle",
"=",
"np",
".",
"degrees",
"(",
"np",
".",
"arctan2",
"(",
"inst",
"[",
"'BY_GSM'",
"]",
",",
"inst",
"[",
"'BZ_GSM'",
"]",
")",
")",
"clock_angle",
"... | Calculate IMF clock angle and magnitude of IMF in GSM Y-Z plane
Parameters
-----------
inst : pysat.Instrument
Instrument with OMNI HRO data | [
"Calculate",
"IMF",
"clock",
"angle",
"and",
"magnitude",
"of",
"IMF",
"in",
"GSM",
"Y",
"-",
"Z",
"plane"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/omni_hro.py#L240-L259 | train |
rstoneback/pysat | pysat/instruments/omni_hro.py | calculate_imf_steadiness | def calculate_imf_steadiness(inst, steady_window=15, min_window_frac=0.75,
max_clock_angle_std=90.0/np.pi, max_bmag_cv=0.5):
""" Calculate IMF steadiness using clock angle standard deviation and
the coefficient of variation of the IMF magnitude in the GSM Y-Z plane
Parameters
... | python | def calculate_imf_steadiness(inst, steady_window=15, min_window_frac=0.75,
max_clock_angle_std=90.0/np.pi, max_bmag_cv=0.5):
""" Calculate IMF steadiness using clock angle standard deviation and
the coefficient of variation of the IMF magnitude in the GSM Y-Z plane
Parameters
... | [
"def",
"calculate_imf_steadiness",
"(",
"inst",
",",
"steady_window",
"=",
"15",
",",
"min_window_frac",
"=",
"0.75",
",",
"max_clock_angle_std",
"=",
"90.0",
"/",
"np",
".",
"pi",
",",
"max_bmag_cv",
"=",
"0.5",
")",
":",
"# We are not going to interpolate throug... | Calculate IMF steadiness using clock angle standard deviation and
the coefficient of variation of the IMF magnitude in the GSM Y-Z plane
Parameters
-----------
inst : pysat.Instrument
Instrument with OMNI HRO data
steady_window : int
Window for calculating running statistical moment... | [
"Calculate",
"IMF",
"steadiness",
"using",
"clock",
"angle",
"standard",
"deviation",
"and",
"the",
"coefficient",
"of",
"variation",
"of",
"the",
"IMF",
"magnitude",
"in",
"the",
"GSM",
"Y",
"-",
"Z",
"plane"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/omni_hro.py#L261-L329 | train |
rstoneback/pysat | pysat/instruments/omni_hro.py | calculate_dayside_reconnection | def calculate_dayside_reconnection(inst):
""" Calculate the dayside reconnection rate (Milan et al. 2014)
Parameters
-----------
inst : pysat.Instrument
Instrument with OMNI HRO data, requires BYZ_GSM and clock_angle
Notes
--------
recon_day = 3.8 Re (Vx / 4e5 m/s)^1/3 Vx B_yz (sin... | python | def calculate_dayside_reconnection(inst):
""" Calculate the dayside reconnection rate (Milan et al. 2014)
Parameters
-----------
inst : pysat.Instrument
Instrument with OMNI HRO data, requires BYZ_GSM and clock_angle
Notes
--------
recon_day = 3.8 Re (Vx / 4e5 m/s)^1/3 Vx B_yz (sin... | [
"def",
"calculate_dayside_reconnection",
"(",
"inst",
")",
":",
"rearth",
"=",
"6371008.8",
"sin_htheta",
"=",
"np",
".",
"power",
"(",
"np",
".",
"sin",
"(",
"np",
".",
"radians",
"(",
"0.5",
"*",
"inst",
"[",
"'clock_angle'",
"]",
")",
")",
",",
"4.5... | Calculate the dayside reconnection rate (Milan et al. 2014)
Parameters
-----------
inst : pysat.Instrument
Instrument with OMNI HRO data, requires BYZ_GSM and clock_angle
Notes
--------
recon_day = 3.8 Re (Vx / 4e5 m/s)^1/3 Vx B_yz (sin(theta/2))^9/2 | [
"Calculate",
"the",
"dayside",
"reconnection",
"rate",
"(",
"Milan",
"et",
"al",
".",
"2014",
")"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/omni_hro.py#L331-L351 | train |
emc-openstack/storops | storops/unity/resource/cifs_share.py | UnityCifsShare.clear_access | def clear_access(self, white_list=None):
""" clear all ace entries of the share
:param white_list: list of username whose access entry won't be cleared
:return: sid list of ace entries removed successfully
"""
access_entries = self.get_ace_list()
sid_list = access_entrie... | python | def clear_access(self, white_list=None):
""" clear all ace entries of the share
:param white_list: list of username whose access entry won't be cleared
:return: sid list of ace entries removed successfully
"""
access_entries = self.get_ace_list()
sid_list = access_entrie... | [
"def",
"clear_access",
"(",
"self",
",",
"white_list",
"=",
"None",
")",
":",
"access_entries",
"=",
"self",
".",
"get_ace_list",
"(",
")",
"sid_list",
"=",
"access_entries",
".",
"sid_list",
"if",
"white_list",
":",
"sid_white_list",
"=",
"[",
"UnityAclUser",... | clear all ace entries of the share
:param white_list: list of username whose access entry won't be cleared
:return: sid list of ace entries removed successfully | [
"clear",
"all",
"ace",
"entries",
"of",
"the",
"share"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/cifs_share.py#L114-L132 | train |
emc-openstack/storops | storops/unity/resource/cifs_share.py | UnityCifsShare.delete_ace | def delete_ace(self, domain=None, user=None, sid=None):
""" delete ACE for the share
delete ACE for the share. User could either supply the domain and
username or the sid of the user.
:param domain: domain of the user
:param user: username
:param sid: sid of the user o... | python | def delete_ace(self, domain=None, user=None, sid=None):
""" delete ACE for the share
delete ACE for the share. User could either supply the domain and
username or the sid of the user.
:param domain: domain of the user
:param user: username
:param sid: sid of the user o... | [
"def",
"delete_ace",
"(",
"self",
",",
"domain",
"=",
"None",
",",
"user",
"=",
"None",
",",
"sid",
"=",
"None",
")",
":",
"if",
"sid",
"is",
"None",
":",
"if",
"domain",
"is",
"None",
":",
"domain",
"=",
"self",
".",
"cifs_server",
".",
"domain",
... | delete ACE for the share
delete ACE for the share. User could either supply the domain and
username or the sid of the user.
:param domain: domain of the user
:param user: username
:param sid: sid of the user or sid list of the user
:return: REST API response | [
"delete",
"ACE",
"for",
"the",
"share"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/cifs_share.py#L153-L175 | train |
emc-openstack/storops | storops/vnx/resource/nqm.py | VNXIOClass.luns | def luns(self):
"""Aggregator for ioclass_luns and ioclass_snapshots."""
lun_list, smp_list = [], []
if self.ioclass_luns:
lun_list = map(lambda l: VNXLun(lun_id=l.lun_id, name=l.name,
cli=self._cli), self.ioclass_luns)
if self.iocl... | python | def luns(self):
"""Aggregator for ioclass_luns and ioclass_snapshots."""
lun_list, smp_list = [], []
if self.ioclass_luns:
lun_list = map(lambda l: VNXLun(lun_id=l.lun_id, name=l.name,
cli=self._cli), self.ioclass_luns)
if self.iocl... | [
"def",
"luns",
"(",
"self",
")",
":",
"lun_list",
",",
"smp_list",
"=",
"[",
"]",
",",
"[",
"]",
"if",
"self",
".",
"ioclass_luns",
":",
"lun_list",
"=",
"map",
"(",
"lambda",
"l",
":",
"VNXLun",
"(",
"lun_id",
"=",
"l",
".",
"lun_id",
",",
"name... | Aggregator for ioclass_luns and ioclass_snapshots. | [
"Aggregator",
"for",
"ioclass_luns",
"and",
"ioclass_snapshots",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/nqm.py#L107-L116 | train |
emc-openstack/storops | storops/vnx/resource/nqm.py | VNXIOClass.policy | def policy(self):
"""Returns policy which contains this ioclass."""
policies = VNXIOPolicy.get(cli=self._cli)
ret = None
for policy in policies:
contained = policy.ioclasses.name
if self._get_name() in contained:
ret = VNXIOPolicy.get(name=policy.n... | python | def policy(self):
"""Returns policy which contains this ioclass."""
policies = VNXIOPolicy.get(cli=self._cli)
ret = None
for policy in policies:
contained = policy.ioclasses.name
if self._get_name() in contained:
ret = VNXIOPolicy.get(name=policy.n... | [
"def",
"policy",
"(",
"self",
")",
":",
"policies",
"=",
"VNXIOPolicy",
".",
"get",
"(",
"cli",
"=",
"self",
".",
"_cli",
")",
"ret",
"=",
"None",
"for",
"policy",
"in",
"policies",
":",
"contained",
"=",
"policy",
".",
"ioclasses",
".",
"name",
"if"... | Returns policy which contains this ioclass. | [
"Returns",
"policy",
"which",
"contains",
"this",
"ioclass",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/nqm.py#L119-L128 | train |
emc-openstack/storops | storops/vnx/resource/nqm.py | VNXIOClass.modify | def modify(self, new_name=None, iotype=None, lun_ids=None, smp_names=None,
ctrlmethod=None, minsize=None, maxsize=None):
"""Overwrite the current properties for a VNX ioclass.
:param new_name: new name for the ioclass
:param iotype: can be 'rw', 'r' or 'w'
:param lun_ids:... | python | def modify(self, new_name=None, iotype=None, lun_ids=None, smp_names=None,
ctrlmethod=None, minsize=None, maxsize=None):
"""Overwrite the current properties for a VNX ioclass.
:param new_name: new name for the ioclass
:param iotype: can be 'rw', 'r' or 'w'
:param lun_ids:... | [
"def",
"modify",
"(",
"self",
",",
"new_name",
"=",
"None",
",",
"iotype",
"=",
"None",
",",
"lun_ids",
"=",
"None",
",",
"smp_names",
"=",
"None",
",",
"ctrlmethod",
"=",
"None",
",",
"minsize",
"=",
"None",
",",
"maxsize",
"=",
"None",
")",
":",
... | Overwrite the current properties for a VNX ioclass.
:param new_name: new name for the ioclass
:param iotype: can be 'rw', 'r' or 'w'
:param lun_ids: list of LUN IDs
:param smp_names: list of Snapshot Mount Point names
:param ctrlmethod: the new CtrlMethod
:param minsize:... | [
"Overwrite",
"the",
"current",
"properties",
"for",
"a",
"VNX",
"ioclass",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/nqm.py#L143-L172 | train |
emc-openstack/storops | storops/vnx/resource/nqm.py | VNXIOClass.add_lun | def add_lun(self, luns):
"""A wrapper for modify method.
.. note:: This API only append luns to existing luns.
"""
curr_lun_ids, curr_smp_names = self._get_current_names()
luns = normalize_lun(luns, self._cli)
new_ids, new_smps = convert_lun(luns)
if new_ids:
... | python | def add_lun(self, luns):
"""A wrapper for modify method.
.. note:: This API only append luns to existing luns.
"""
curr_lun_ids, curr_smp_names = self._get_current_names()
luns = normalize_lun(luns, self._cli)
new_ids, new_smps = convert_lun(luns)
if new_ids:
... | [
"def",
"add_lun",
"(",
"self",
",",
"luns",
")",
":",
"curr_lun_ids",
",",
"curr_smp_names",
"=",
"self",
".",
"_get_current_names",
"(",
")",
"luns",
"=",
"normalize_lun",
"(",
"luns",
",",
"self",
".",
"_cli",
")",
"new_ids",
",",
"new_smps",
"=",
"con... | A wrapper for modify method.
.. note:: This API only append luns to existing luns. | [
"A",
"wrapper",
"for",
"modify",
"method",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/nqm.py#L174-L186 | train |
emc-openstack/storops | storops/vnx/resource/nqm.py | VNXIOPolicy.add_class | def add_class(self, ioclass):
"""Add one VNXIOClass instance to policy.
.. note: due to the limitation of VNX, need to stop the policy first.
"""
current_ioclasses = self.ioclasses
if ioclass.name in current_ioclasses.name:
return
current_ioclasses.append(ioc... | python | def add_class(self, ioclass):
"""Add one VNXIOClass instance to policy.
.. note: due to the limitation of VNX, need to stop the policy first.
"""
current_ioclasses = self.ioclasses
if ioclass.name in current_ioclasses.name:
return
current_ioclasses.append(ioc... | [
"def",
"add_class",
"(",
"self",
",",
"ioclass",
")",
":",
"current_ioclasses",
"=",
"self",
".",
"ioclasses",
"if",
"ioclass",
".",
"name",
"in",
"current_ioclasses",
".",
"name",
":",
"return",
"current_ioclasses",
".",
"append",
"(",
"ioclass",
")",
"self... | Add one VNXIOClass instance to policy.
.. note: due to the limitation of VNX, need to stop the policy first. | [
"Add",
"one",
"VNXIOClass",
"instance",
"to",
"policy",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/nqm.py#L280-L289 | train |
emc-openstack/storops | storops/vnx/resource/nqm.py | VNXIOPolicy.remove_class | def remove_class(self, ioclass):
"""Remove VNXIOClass instance from policy."""
current_ioclasses = self.ioclasses
new_ioclasses = filter(lambda x: x.name != ioclass.name,
current_ioclasses)
self.modify(new_ioclasses=new_ioclasses) | python | def remove_class(self, ioclass):
"""Remove VNXIOClass instance from policy."""
current_ioclasses = self.ioclasses
new_ioclasses = filter(lambda x: x.name != ioclass.name,
current_ioclasses)
self.modify(new_ioclasses=new_ioclasses) | [
"def",
"remove_class",
"(",
"self",
",",
"ioclass",
")",
":",
"current_ioclasses",
"=",
"self",
".",
"ioclasses",
"new_ioclasses",
"=",
"filter",
"(",
"lambda",
"x",
":",
"x",
".",
"name",
"!=",
"ioclass",
".",
"name",
",",
"current_ioclasses",
")",
"self"... | Remove VNXIOClass instance from policy. | [
"Remove",
"VNXIOClass",
"instance",
"from",
"policy",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/vnx/resource/nqm.py#L291-L296 | train |
emc-openstack/storops | storops/unity/resource/cg.py | UnityConsistencyGroup.replace_lun | def replace_lun(self, *lun_list):
"""Replaces the exiting LUNs to lun_list."""
lun_add = self._prepare_luns_add(lun_list)
lun_remove = self._prepare_luns_remove(lun_list, False)
return self.modify(lun_add=lun_add, lun_remove=lun_remove) | python | def replace_lun(self, *lun_list):
"""Replaces the exiting LUNs to lun_list."""
lun_add = self._prepare_luns_add(lun_list)
lun_remove = self._prepare_luns_remove(lun_list, False)
return self.modify(lun_add=lun_add, lun_remove=lun_remove) | [
"def",
"replace_lun",
"(",
"self",
",",
"*",
"lun_list",
")",
":",
"lun_add",
"=",
"self",
".",
"_prepare_luns_add",
"(",
"lun_list",
")",
"lun_remove",
"=",
"self",
".",
"_prepare_luns_remove",
"(",
"lun_list",
",",
"False",
")",
"return",
"self",
".",
"m... | Replaces the exiting LUNs to lun_list. | [
"Replaces",
"the",
"exiting",
"LUNs",
"to",
"lun_list",
"."
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/cg.py#L208-L212 | train |
emc-openstack/storops | storops/unity/resource/cg.py | UnityConsistencyGroup.update_lun | def update_lun(self, add_luns=None, remove_luns=None):
"""Updates the LUNs in CG, adding the ones in `add_luns` and removing
the ones in `remove_luns`"""
if not add_luns and not remove_luns:
log.debug("Empty add_luns and remove_luns passed in, "
"skip update_lun... | python | def update_lun(self, add_luns=None, remove_luns=None):
"""Updates the LUNs in CG, adding the ones in `add_luns` and removing
the ones in `remove_luns`"""
if not add_luns and not remove_luns:
log.debug("Empty add_luns and remove_luns passed in, "
"skip update_lun... | [
"def",
"update_lun",
"(",
"self",
",",
"add_luns",
"=",
"None",
",",
"remove_luns",
"=",
"None",
")",
":",
"if",
"not",
"add_luns",
"and",
"not",
"remove_luns",
":",
"log",
".",
"debug",
"(",
"\"Empty add_luns and remove_luns passed in, \"",
"\"skip update_lun.\""... | Updates the LUNs in CG, adding the ones in `add_luns` and removing
the ones in `remove_luns` | [
"Updates",
"the",
"LUNs",
"in",
"CG",
"adding",
"the",
"ones",
"in",
"add_luns",
"and",
"removing",
"the",
"ones",
"in",
"remove_luns"
] | 24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd | https://github.com/emc-openstack/storops/blob/24b4b13bf065c0ef0538dd0b5ebb8f25d24176bd/storops/unity/resource/cg.py#L214-L223 | train |
rstoneback/pysat | pysat/instruments/iss_fpmu.py | clean | def clean(inst):
"""Routine to return FPMU 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 FPMU 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",
")",
":",
"inst",
".",
"data",
".",
"replace",
"(",
"-",
"999.",
",",
"np",
".",
"nan",
",",
"inplace",
"=",
"True",
")",
"# Te",
"inst",
".",
"data",
".",
"replace",
"(",
"-",
"9.9999998e+30",
",",
"np",
".",
"nan",
... | Routine to return FPMU 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",
"FPMU",
"data",
"cleaned",
"to",
"the",
"specified",
"level"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/instruments/iss_fpmu.py#L59-L81 | train |
rstoneback/pysat | pysat/_files.py | Files._attach_files | def _attach_files(self, files_info):
"""Attaches info returned by instrument list_files routine to
Instrument object.
"""
if not files_info.empty:
if (len(files_info.index.unique()) != len(files_info)):
estr = 'WARNING! Duplicate datetimes in provided file '
... | python | def _attach_files(self, files_info):
"""Attaches info returned by instrument list_files routine to
Instrument object.
"""
if not files_info.empty:
if (len(files_info.index.unique()) != len(files_info)):
estr = 'WARNING! Duplicate datetimes in provided file '
... | [
"def",
"_attach_files",
"(",
"self",
",",
"files_info",
")",
":",
"if",
"not",
"files_info",
".",
"empty",
":",
"if",
"(",
"len",
"(",
"files_info",
".",
"index",
".",
"unique",
"(",
")",
")",
"!=",
"len",
"(",
"files_info",
")",
")",
":",
"estr",
... | Attaches info returned by instrument list_files routine to
Instrument object. | [
"Attaches",
"info",
"returned",
"by",
"instrument",
"list_files",
"routine",
"to",
"Instrument",
"object",
"."
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_files.py#L141-L168 | train |
rstoneback/pysat | pysat/_files.py | Files._store | def _store(self):
"""Store currently loaded filelist for instrument onto filesystem"""
name = self.stored_file_name
# check if current file data is different than stored file list
# if so, move file list to previous file list, store current to file
# if not, do nothing
s... | python | def _store(self):
"""Store currently loaded filelist for instrument onto filesystem"""
name = self.stored_file_name
# check if current file data is different than stored file list
# if so, move file list to previous file list, store current to file
# if not, do nothing
s... | [
"def",
"_store",
"(",
"self",
")",
":",
"name",
"=",
"self",
".",
"stored_file_name",
"# check if current file data is different than stored file list",
"# if so, move file list to previous file list, store current to file",
"# if not, do nothing",
"stored_files",
"=",
"self",
".",... | Store currently loaded filelist for instrument onto filesystem | [
"Store",
"currently",
"loaded",
"filelist",
"for",
"instrument",
"onto",
"filesystem"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_files.py#L170-L200 | train |
rstoneback/pysat | pysat/_files.py | Files._load | def _load(self, prev_version=False):
"""Load stored filelist and return as Pandas Series
Parameters
----------
prev_version : boolean
if True, will load previous version of file list
Returns
-------
pandas.Series
Full path file names are ... | python | def _load(self, prev_version=False):
"""Load stored filelist and return as Pandas Series
Parameters
----------
prev_version : boolean
if True, will load previous version of file list
Returns
-------
pandas.Series
Full path file names are ... | [
"def",
"_load",
"(",
"self",
",",
"prev_version",
"=",
"False",
")",
":",
"fname",
"=",
"self",
".",
"stored_file_name",
"if",
"prev_version",
":",
"fname",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"home_path",
",",
"'previous_'",
"+",
"f... | Load stored filelist and return as Pandas Series
Parameters
----------
prev_version : boolean
if True, will load previous version of file list
Returns
-------
pandas.Series
Full path file names are indexed by datetime
Series is empty ... | [
"Load",
"stored",
"filelist",
"and",
"return",
"as",
"Pandas",
"Series"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_files.py#L202-L234 | train |
rstoneback/pysat | pysat/_files.py | Files.refresh | def refresh(self):
"""Update list of files, if there are changes.
Calls underlying list_rtn for the particular science instrument.
Typically, these routines search in the pysat provided path,
pysat_data_dir/platform/name/tag/,
where pysat_data_dir is set by pysat.utils.s... | python | def refresh(self):
"""Update list of files, if there are changes.
Calls underlying list_rtn for the particular science instrument.
Typically, these routines search in the pysat provided path,
pysat_data_dir/platform/name/tag/,
where pysat_data_dir is set by pysat.utils.s... | [
"def",
"refresh",
"(",
"self",
")",
":",
"output_str",
"=",
"'{platform} {name} {tag} {sat_id}'",
"output_str",
"=",
"output_str",
".",
"format",
"(",
"platform",
"=",
"self",
".",
"_sat",
".",
"platform",
",",
"name",
"=",
"self",
".",
"_sat",
".",
"name",
... | Update list of files, if there are changes.
Calls underlying list_rtn for the particular science instrument.
Typically, these routines search in the pysat provided path,
pysat_data_dir/platform/name/tag/,
where pysat_data_dir is set by pysat.utils.set_data_dir(path=path). | [
"Update",
"list",
"of",
"files",
"if",
"there",
"are",
"changes",
".",
"Calls",
"underlying",
"list_rtn",
"for",
"the",
"particular",
"science",
"instrument",
".",
"Typically",
"these",
"routines",
"search",
"in",
"the",
"pysat",
"provided",
"path",
"pysat_data_... | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_files.py#L237-L269 | train |
rstoneback/pysat | pysat/_files.py | Files.get_new | def get_new(self):
"""List new files since last recorded file state.
pysat stores filenames in the user_home/.pysat directory. Returns
a list of all new fileanmes since the last known change to files.
Filenames are stored if there is a change and either update_files
is T... | python | def get_new(self):
"""List new files since last recorded file state.
pysat stores filenames in the user_home/.pysat directory. Returns
a list of all new fileanmes since the last known change to files.
Filenames are stored if there is a change and either update_files
is T... | [
"def",
"get_new",
"(",
"self",
")",
":",
"# refresh files",
"self",
".",
"refresh",
"(",
")",
"# current files",
"new_info",
"=",
"self",
".",
"_load",
"(",
")",
"# previous set of files",
"old_info",
"=",
"self",
".",
"_load",
"(",
"prev_version",
"=",
"Tru... | List new files since last recorded file state.
pysat stores filenames in the user_home/.pysat directory. Returns
a list of all new fileanmes since the last known change to files.
Filenames are stored if there is a change and either update_files
is True at instrument object level... | [
"List",
"new",
"files",
"since",
"last",
"recorded",
"file",
"state",
".",
"pysat",
"stores",
"filenames",
"in",
"the",
"user_home",
"/",
".",
"pysat",
"directory",
".",
"Returns",
"a",
"list",
"of",
"all",
"new",
"fileanmes",
"since",
"the",
"last",
"know... | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_files.py#L271-L293 | train |
rstoneback/pysat | pysat/_files.py | Files.get_index | def get_index(self, fname):
"""Return index for a given filename.
Parameters
----------
fname : string
filename
Note
----
If fname not found in the file information already attached
to the instrument.files instance, then a f... | python | def get_index(self, fname):
"""Return index for a given filename.
Parameters
----------
fname : string
filename
Note
----
If fname not found in the file information already attached
to the instrument.files instance, then a f... | [
"def",
"get_index",
"(",
"self",
",",
"fname",
")",
":",
"idx",
",",
"=",
"np",
".",
"where",
"(",
"fname",
"==",
"self",
".",
"files",
")",
"if",
"len",
"(",
"idx",
")",
"==",
"0",
":",
"# filename not in index, try reloading files from disk",
"self",
"... | Return index for a given filename.
Parameters
----------
fname : string
filename
Note
----
If fname not found in the file information already attached
to the instrument.files instance, then a files.refresh() call
is made. | [
"Return",
"index",
"for",
"a",
"given",
"filename",
".",
"Parameters",
"----------",
"fname",
":",
"string",
"filename",
"Note",
"----",
"If",
"fname",
"not",
"found",
"in",
"the",
"file",
"information",
"already",
"attached",
"to",
"the",
"instrument",
".",
... | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_files.py#L314-L343 | train |
rstoneback/pysat | pysat/_files.py | Files.get_file_array | def get_file_array(self, start, end):
"""Return a list of filenames between and including start and end.
Parameters
----------
start: array_like or single string
filenames for start of returned filelist
stop: array_like or single string
... | python | def get_file_array(self, start, end):
"""Return a list of filenames between and including start and end.
Parameters
----------
start: array_like or single string
filenames for start of returned filelist
stop: array_like or single string
... | [
"def",
"get_file_array",
"(",
"self",
",",
"start",
",",
"end",
")",
":",
"if",
"hasattr",
"(",
"start",
",",
"'__iter__'",
")",
"&",
"hasattr",
"(",
"end",
",",
"'__iter__'",
")",
":",
"files",
"=",
"[",
"]",
"for",
"(",
"sta",
",",
"stp",
")",
... | Return a list of filenames between and including start and end.
Parameters
----------
start: array_like or single string
filenames for start of returned filelist
stop: array_like or single string
filenames inclusive end of list
... | [
"Return",
"a",
"list",
"of",
"filenames",
"between",
"and",
"including",
"start",
"and",
"end",
".",
"Parameters",
"----------",
"start",
":",
"array_like",
"or",
"single",
"string",
"filenames",
"for",
"start",
"of",
"returned",
"filelist",
"stop",
":",
"arra... | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_files.py#L382-L411 | train |
rstoneback/pysat | pysat/_files.py | Files._remove_data_dir_path | def _remove_data_dir_path(self, inp=None):
# import string
"""Remove the data directory path from filenames"""
# need to add a check in here to make sure data_dir path is actually in
# the filename
if inp is not None:
split_str = os.path.join(self.data_path, '')
... | python | def _remove_data_dir_path(self, inp=None):
# import string
"""Remove the data directory path from filenames"""
# need to add a check in here to make sure data_dir path is actually in
# the filename
if inp is not None:
split_str = os.path.join(self.data_path, '')
... | [
"def",
"_remove_data_dir_path",
"(",
"self",
",",
"inp",
"=",
"None",
")",
":",
"# import string",
"# need to add a check in here to make sure data_dir path is actually in",
"# the filename",
"if",
"inp",
"is",
"not",
"None",
":",
"split_str",
"=",
"os",
".",
"path",
... | Remove the data directory path from filenames | [
"Remove",
"the",
"data",
"directory",
"path",
"from",
"filenames"
] | 4ae1afd80e15e4449397d39dce8c3e969c32c422 | https://github.com/rstoneback/pysat/blob/4ae1afd80e15e4449397d39dce8c3e969c32c422/pysat/_files.py#L413-L420 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.