body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
92d6350e992c38d4fd651c897653aae987a12c872857fd246ca91a723b522db1 | def hardness_ratio(base_dir, name, obsid_0, stn_target, num_bins, output_dir, color_map, wcs_fits, bin_file):
"\n Calculate hardness ratio and plot\n params:\n base_dir -- path to base directory\n name -- name of cluster\n obsid_0 -- first obsid (doesn't actually matter which)\n stn_target -- targ... | Calculate hardness ratio and plot
params:
base_dir -- path to base directory
name -- name of cluster
obsid_0 -- first obsid (doesn't actually matter which)
stn_target -- target signal-to-noise ratio
num_bins -- number of bins from WVT
output_dir -- name of folder which contains region files for bins | TemperatureMapPipeline/Hardness_Ratio.py | hardness_ratio | crhea93/AstronomyTools | 8 | python | def hardness_ratio(base_dir, name, obsid_0, stn_target, num_bins, output_dir, color_map, wcs_fits, bin_file):
"\n Calculate hardness ratio and plot\n params:\n base_dir -- path to base directory\n name -- name of cluster\n obsid_0 -- first obsid (doesn't actually matter which)\n stn_target -- targ... | def hardness_ratio(base_dir, name, obsid_0, stn_target, num_bins, output_dir, color_map, wcs_fits, bin_file):
"\n Calculate hardness ratio and plot\n params:\n base_dir -- path to base directory\n name -- name of cluster\n obsid_0 -- first obsid (doesn't actually matter which)\n stn_target -- targ... |
c8fb87f77ec3f3d97a067964ecc0e69a0fba3b39c01289ddc00a145a0874a090 | def __init__(self, predict_fn, feature_names=None, feature_types=None, **kwargs):
' Initializes class.\n\n Args:\n predict_fn: Function of blackbox that takes input, and returns prediction.\n feature_names: List of feature names.\n feature_types: List of feature types.\n ... | Initializes class.
Args:
predict_fn: Function of blackbox that takes input, and returns prediction.
feature_names: List of feature names.
feature_types: List of feature types.
**kwargs: Currently unused. Due for deprecation. | python/interpret-core/interpret/perf/curve.py | __init__ | eddy-geek/interpret | 2,674 | python | def __init__(self, predict_fn, feature_names=None, feature_types=None, **kwargs):
' Initializes class.\n\n Args:\n predict_fn: Function of blackbox that takes input, and returns prediction.\n feature_names: List of feature names.\n feature_types: List of feature types.\n ... | def __init__(self, predict_fn, feature_names=None, feature_types=None, **kwargs):
' Initializes class.\n\n Args:\n predict_fn: Function of blackbox that takes input, and returns prediction.\n feature_names: List of feature names.\n feature_types: List of feature types.\n ... |
1b0e1414e51ea27150705ae86553f31c1683f8a59ecee79a01ff516eae200dd1 | def explain_perf(self, X, y, name=None):
' Produce precision-recall curves.\n\n Args:\n X: Numpy array for X to compare predict function against.\n y: Numpy vector for y to compare predict function against.\n name: User-defined explanation name.\n\n Returns:\n ... | Produce precision-recall curves.
Args:
X: Numpy array for X to compare predict function against.
y: Numpy vector for y to compare predict function against.
name: User-defined explanation name.
Returns:
An explanation object. | python/interpret-core/interpret/perf/curve.py | explain_perf | eddy-geek/interpret | 2,674 | python | def explain_perf(self, X, y, name=None):
' Produce precision-recall curves.\n\n Args:\n X: Numpy array for X to compare predict function against.\n y: Numpy vector for y to compare predict function against.\n name: User-defined explanation name.\n\n Returns:\n ... | def explain_perf(self, X, y, name=None):
' Produce precision-recall curves.\n\n Args:\n X: Numpy array for X to compare predict function against.\n y: Numpy vector for y to compare predict function against.\n name: User-defined explanation name.\n\n Returns:\n ... |
c8fb87f77ec3f3d97a067964ecc0e69a0fba3b39c01289ddc00a145a0874a090 | def __init__(self, predict_fn, feature_names=None, feature_types=None, **kwargs):
' Initializes class.\n\n Args:\n predict_fn: Function of blackbox that takes input, and returns prediction.\n feature_names: List of feature names.\n feature_types: List of feature types.\n ... | Initializes class.
Args:
predict_fn: Function of blackbox that takes input, and returns prediction.
feature_names: List of feature names.
feature_types: List of feature types.
**kwargs: Currently unused. Due for deprecation. | python/interpret-core/interpret/perf/curve.py | __init__ | eddy-geek/interpret | 2,674 | python | def __init__(self, predict_fn, feature_names=None, feature_types=None, **kwargs):
' Initializes class.\n\n Args:\n predict_fn: Function of blackbox that takes input, and returns prediction.\n feature_names: List of feature names.\n feature_types: List of feature types.\n ... | def __init__(self, predict_fn, feature_names=None, feature_types=None, **kwargs):
' Initializes class.\n\n Args:\n predict_fn: Function of blackbox that takes input, and returns prediction.\n feature_names: List of feature names.\n feature_types: List of feature types.\n ... |
c7b67264e1e950cf5913008052ff3de618d145986c3a9775501a1e49cde3776a | def explain_perf(self, X, y, name=None):
' Produce ROC curves.\n\n Args:\n X: Numpy array for X to compare predict function against.\n y: Numpy vector for y to compare predict function against.\n name: User-defined explanation name.\n\n Returns:\n An explana... | Produce ROC curves.
Args:
X: Numpy array for X to compare predict function against.
y: Numpy vector for y to compare predict function against.
name: User-defined explanation name.
Returns:
An explanation object. | python/interpret-core/interpret/perf/curve.py | explain_perf | eddy-geek/interpret | 2,674 | python | def explain_perf(self, X, y, name=None):
' Produce ROC curves.\n\n Args:\n X: Numpy array for X to compare predict function against.\n y: Numpy vector for y to compare predict function against.\n name: User-defined explanation name.\n\n Returns:\n An explana... | def explain_perf(self, X, y, name=None):
' Produce ROC curves.\n\n Args:\n X: Numpy array for X to compare predict function against.\n y: Numpy vector for y to compare predict function against.\n name: User-defined explanation name.\n\n Returns:\n An explana... |
93bf0189516767d84dd81079ea99818b0b1093254deb76734819811bb82e8224 | def __init__(self, explanation_type, internal_obj, feature_names=None, feature_types=None, name=None, selector=None):
' Initializes class.\n\n Args:\n explanation_type: Type of explanation.\n internal_obj: A jsonable object that backs the explanation.\n feature_names: List o... | Initializes class.
Args:
explanation_type: Type of explanation.
internal_obj: A jsonable object that backs the explanation.
feature_names: List of feature names.
feature_types: List of feature types.
name: User-defined name of explanation.
selector: A dataframe whose indices correspond to expl... | python/interpret-core/interpret/perf/curve.py | __init__ | eddy-geek/interpret | 2,674 | python | def __init__(self, explanation_type, internal_obj, feature_names=None, feature_types=None, name=None, selector=None):
' Initializes class.\n\n Args:\n explanation_type: Type of explanation.\n internal_obj: A jsonable object that backs the explanation.\n feature_names: List o... | def __init__(self, explanation_type, internal_obj, feature_names=None, feature_types=None, name=None, selector=None):
' Initializes class.\n\n Args:\n explanation_type: Type of explanation.\n internal_obj: A jsonable object that backs the explanation.\n feature_names: List o... |
11c58d30219a8eac82141b1a8cdaaa4a18ad52a15f7aaa23bbe0df6e8c7ba5ac | def data(self, key=None):
' Provides specific explanation data.\n\n Args:\n key: A number/string that references a specific data item.\n\n Returns:\n A serializable dictionary.\n '
if (key is None):
return self._internal_obj['overall']
return None | Provides specific explanation data.
Args:
key: A number/string that references a specific data item.
Returns:
A serializable dictionary. | python/interpret-core/interpret/perf/curve.py | data | eddy-geek/interpret | 2,674 | python | def data(self, key=None):
' Provides specific explanation data.\n\n Args:\n key: A number/string that references a specific data item.\n\n Returns:\n A serializable dictionary.\n '
if (key is None):
return self._internal_obj['overall']
return None | def data(self, key=None):
' Provides specific explanation data.\n\n Args:\n key: A number/string that references a specific data item.\n\n Returns:\n A serializable dictionary.\n '
if (key is None):
return self._internal_obj['overall']
return None<|docstrin... |
2ae5b04764de64f389753e5b4cd98ac11d8783f9087e5f809f9d6776ee66d75f | def visualize(self, key=None):
' Provides interactive visualizations.\n\n Args:\n key: Either a scalar or list\n that indexes the internal object for sub-plotting.\n If an overall visualization is requested, pass None.\n\n Returns:\n A Plotly figure.... | Provides interactive visualizations.
Args:
key: Either a scalar or list
that indexes the internal object for sub-plotting.
If an overall visualization is requested, pass None.
Returns:
A Plotly figure. | python/interpret-core/interpret/perf/curve.py | visualize | eddy-geek/interpret | 2,674 | python | def visualize(self, key=None):
' Provides interactive visualizations.\n\n Args:\n key: Either a scalar or list\n that indexes the internal object for sub-plotting.\n If an overall visualization is requested, pass None.\n\n Returns:\n A Plotly figure.... | def visualize(self, key=None):
' Provides interactive visualizations.\n\n Args:\n key: Either a scalar or list\n that indexes the internal object for sub-plotting.\n If an overall visualization is requested, pass None.\n\n Returns:\n A Plotly figure.... |
93bf0189516767d84dd81079ea99818b0b1093254deb76734819811bb82e8224 | def __init__(self, explanation_type, internal_obj, feature_names=None, feature_types=None, name=None, selector=None):
' Initializes class.\n\n Args:\n explanation_type: Type of explanation.\n internal_obj: A jsonable object that backs the explanation.\n feature_names: List o... | Initializes class.
Args:
explanation_type: Type of explanation.
internal_obj: A jsonable object that backs the explanation.
feature_names: List of feature names.
feature_types: List of feature types.
name: User-defined name of explanation.
selector: A dataframe whose indices correspond to expl... | python/interpret-core/interpret/perf/curve.py | __init__ | eddy-geek/interpret | 2,674 | python | def __init__(self, explanation_type, internal_obj, feature_names=None, feature_types=None, name=None, selector=None):
' Initializes class.\n\n Args:\n explanation_type: Type of explanation.\n internal_obj: A jsonable object that backs the explanation.\n feature_names: List o... | def __init__(self, explanation_type, internal_obj, feature_names=None, feature_types=None, name=None, selector=None):
' Initializes class.\n\n Args:\n explanation_type: Type of explanation.\n internal_obj: A jsonable object that backs the explanation.\n feature_names: List o... |
11c58d30219a8eac82141b1a8cdaaa4a18ad52a15f7aaa23bbe0df6e8c7ba5ac | def data(self, key=None):
' Provides specific explanation data.\n\n Args:\n key: A number/string that references a specific data item.\n\n Returns:\n A serializable dictionary.\n '
if (key is None):
return self._internal_obj['overall']
return None | Provides specific explanation data.
Args:
key: A number/string that references a specific data item.
Returns:
A serializable dictionary. | python/interpret-core/interpret/perf/curve.py | data | eddy-geek/interpret | 2,674 | python | def data(self, key=None):
' Provides specific explanation data.\n\n Args:\n key: A number/string that references a specific data item.\n\n Returns:\n A serializable dictionary.\n '
if (key is None):
return self._internal_obj['overall']
return None | def data(self, key=None):
' Provides specific explanation data.\n\n Args:\n key: A number/string that references a specific data item.\n\n Returns:\n A serializable dictionary.\n '
if (key is None):
return self._internal_obj['overall']
return None<|docstrin... |
3a8924419b6f2cfb54f9f1dc2c5762156e77f491131f8801ad81dfccfda9c7f1 | def visualize(self, key=None):
' Provides interactive visualizations.\n\n Args:\n key: Either a scalar or list\n that indexes the internal object for sub-plotting.\n If an overall visualization is requested, pass None.\n\n Returns:\n A Plotly figure.... | Provides interactive visualizations.
Args:
key: Either a scalar or list
that indexes the internal object for sub-plotting.
If an overall visualization is requested, pass None.
Returns:
A Plotly figure. | python/interpret-core/interpret/perf/curve.py | visualize | eddy-geek/interpret | 2,674 | python | def visualize(self, key=None):
' Provides interactive visualizations.\n\n Args:\n key: Either a scalar or list\n that indexes the internal object for sub-plotting.\n If an overall visualization is requested, pass None.\n\n Returns:\n A Plotly figure.... | def visualize(self, key=None):
' Provides interactive visualizations.\n\n Args:\n key: Either a scalar or list\n that indexes the internal object for sub-plotting.\n If an overall visualization is requested, pass None.\n\n Returns:\n A Plotly figure.... |
1fe1785af4cc40b61a27d4c03137c9125961df6822aa85ff92b3038e1239a26e | def get_state(self, creds):
'\n Get the state that belongs to a particular account.\n\n @param creds: The credentials which identify a particular account.\n @type creds: L{AWSCredentials}\n\n @return: The state for the account, creating it if necessary. The\n state will be wh... | Get the state that belongs to a particular account.
@param creds: The credentials which identify a particular account.
@type creds: L{AWSCredentials}
@return: The state for the account, creating it if necessary. The
state will be whatever C{state_factory} returns. | txaws/testing/base.py | get_state | gmorell/txaws | 24 | python | def get_state(self, creds):
'\n Get the state that belongs to a particular account.\n\n @param creds: The credentials which identify a particular account.\n @type creds: L{AWSCredentials}\n\n @return: The state for the account, creating it if necessary. The\n state will be wh... | def get_state(self, creds):
'\n Get the state that belongs to a particular account.\n\n @param creds: The credentials which identify a particular account.\n @type creds: L{AWSCredentials}\n\n @return: The state for the account, creating it if necessary. The\n state will be wh... |
8533e71696129af0ee8156b9919985c907e8726a15e799a62a855821eb46e4fd | def client(self, creds, *a, **kw):
'\n Get an in-memory verified fake client for this service.\n\n @param creds: The credentials to associate with the account. No\n authentication is performed but this identifies the state the\n client will find.\n @type creds: L{AWSCrede... | Get an in-memory verified fake client for this service.
@param creds: The credentials to associate with the account. No
authentication is performed but this identifies the state the
client will find.
@type creds: L{AWSCredentials}
@return: A new client for this service along with the state object for
the... | txaws/testing/base.py | client | gmorell/txaws | 24 | python | def client(self, creds, *a, **kw):
'\n Get an in-memory verified fake client for this service.\n\n @param creds: The credentials to associate with the account. No\n authentication is performed but this identifies the state the\n client will find.\n @type creds: L{AWSCrede... | def client(self, creds, *a, **kw):
'\n Get an in-memory verified fake client for this service.\n\n @param creds: The credentials to associate with the account. No\n authentication is performed but this identifies the state the\n client will find.\n @type creds: L{AWSCrede... |
8b2dc35055cf381e7bbfb1771d14c31006b8e21a1815850c74a9362f8c8e3130 | def rgChromaticity(rgb):
'\n Converting an RGB image into normalized RGB removes the effect\n of any intensity variations.\n\n rg Chromaticity\n http://en.wikipedia.org/wiki/Rg_chromaticity\n\n Also know as normalised RGB as per paper:\n Color-based object recognition, Theo Gevers and Arnold W.M. ... | Converting an RGB image into normalized RGB removes the effect
of any intensity variations.
rg Chromaticity
http://en.wikipedia.org/wiki/Rg_chromaticity
Also know as normalised RGB as per paper:
Color-based object recognition, Theo Gevers and Arnold W.M. Smeulders,
Pattern Recognition,number 3, pages 453-464, volume ... | ipfe/colour.py | rgChromaticity | michaelborck/ipfe | 3 | python | def rgChromaticity(rgb):
'\n Converting an RGB image into normalized RGB removes the effect\n of any intensity variations.\n\n rg Chromaticity\n http://en.wikipedia.org/wiki/Rg_chromaticity\n\n Also know as normalised RGB as per paper:\n Color-based object recognition, Theo Gevers and Arnold W.M. ... | def rgChromaticity(rgb):
'\n Converting an RGB image into normalized RGB removes the effect\n of any intensity variations.\n\n rg Chromaticity\n http://en.wikipedia.org/wiki/Rg_chromaticity\n\n Also know as normalised RGB as per paper:\n Color-based object recognition, Theo Gevers and Arnold W.M. ... |
17cc7fc41267ca118b6d5fb61e779e278cee95599378edcb354faec5d634f296 | def normalisedRGB(rgb):
'\n Converting an RGB image into normalized RGB removes the effect\n of any intensity variations.\n\n L2 Norm (Euclidean norm)\n\n '
norm = img_as_float(rgb)
r = (rgb[(:, :, 0)] + 1e-11)
g = (rgb[(:, :, 1)] + 1e-11)
b = (rgb[(:, :, 2)] + 1e-11)
divisor = np.sq... | Converting an RGB image into normalized RGB removes the effect
of any intensity variations.
L2 Norm (Euclidean norm) | ipfe/colour.py | normalisedRGB | michaelborck/ipfe | 3 | python | def normalisedRGB(rgb):
'\n Converting an RGB image into normalized RGB removes the effect\n of any intensity variations.\n\n L2 Norm (Euclidean norm)\n\n '
norm = img_as_float(rgb)
r = (rgb[(:, :, 0)] + 1e-11)
g = (rgb[(:, :, 1)] + 1e-11)
b = (rgb[(:, :, 2)] + 1e-11)
divisor = np.sq... | def normalisedRGB(rgb):
'\n Converting an RGB image into normalized RGB removes the effect\n of any intensity variations.\n\n L2 Norm (Euclidean norm)\n\n '
norm = img_as_float(rgb)
r = (rgb[(:, :, 0)] + 1e-11)
g = (rgb[(:, :, 1)] + 1e-11)
b = (rgb[(:, :, 2)] + 1e-11)
divisor = np.sq... |
d816128e94cb3be15565941202f129c7fc6f56fc26e887cb870e15234143b560 | def linear_normalization(arr):
'\n Converting an RGB image into normalized RGB removes the effect\n of any intensity variations.\n\n Linear normalization\n http://en.wikipedia.org/wiki/Normalization_%28image_processing%29\n '
arr = arr.astype('float')
for i in range(3):
minval = arr[(... | Converting an RGB image into normalized RGB removes the effect
of any intensity variations.
Linear normalization
http://en.wikipedia.org/wiki/Normalization_%28image_processing%29 | ipfe/colour.py | linear_normalization | michaelborck/ipfe | 3 | python | def linear_normalization(arr):
'\n Converting an RGB image into normalized RGB removes the effect\n of any intensity variations.\n\n Linear normalization\n http://en.wikipedia.org/wiki/Normalization_%28image_processing%29\n '
arr = arr.astype('float')
for i in range(3):
minval = arr[(... | def linear_normalization(arr):
'\n Converting an RGB image into normalized RGB removes the effect\n of any intensity variations.\n\n Linear normalization\n http://en.wikipedia.org/wiki/Normalization_%28image_processing%29\n '
arr = arr.astype('float')
for i in range(3):
minval = arr[(... |
8d58395b0f936f57fe427f58d7b9362c0b79123fbc11bece84b36af7dbabea65 | def ilevenshtein(seq1, seqs, max_dist=(- 1)):
'Compute the Levenshtein distance between the sequence `seq1` and the series\n\tof\tsequences `seqs`.\n\t\n\t\t`seq1`: the reference sequence\n\t\t`seqs`: a series of sequences (can be a generator)\n\t\t`max_dist`: if provided and > 0, only the sequences which distance ... | Compute the Levenshtein distance between the sequence `seq1` and the series
of sequences `seqs`.
`seq1`: the reference sequence
`seqs`: a series of sequences (can be a generator)
`max_dist`: if provided and > 0, only the sequences which distance from
the reference sequence is lower... | Backend/venv/lib/python3.6/site-packages/distance/_iterators.py | ilevenshtein | Pencroff/ai-hackathon | 82 | python | def ilevenshtein(seq1, seqs, max_dist=(- 1)):
'Compute the Levenshtein distance between the sequence `seq1` and the series\n\tof\tsequences `seqs`.\n\t\n\t\t`seq1`: the reference sequence\n\t\t`seqs`: a series of sequences (can be a generator)\n\t\t`max_dist`: if provided and > 0, only the sequences which distance ... | def ilevenshtein(seq1, seqs, max_dist=(- 1)):
'Compute the Levenshtein distance between the sequence `seq1` and the series\n\tof\tsequences `seqs`.\n\t\n\t\t`seq1`: the reference sequence\n\t\t`seqs`: a series of sequences (can be a generator)\n\t\t`max_dist`: if provided and > 0, only the sequences which distance ... |
e78c93a29bee77167a966eb590b0ca6f436e0b1800749a169d4110b93a2ff85a | def ifast_comp(seq1, seqs, transpositions=False):
'Return an iterator over all the sequences in `seqs` which distance from\n\t`seq1` is lower or equal to 2. The sequences which distance from the\n\treference sequence is higher than that are dropped.\n\t\n\t\t`seq1`: the reference sequence.\n\t\t`seqs`: a series of ... | Return an iterator over all the sequences in `seqs` which distance from
`seq1` is lower or equal to 2. The sequences which distance from the
reference sequence is higher than that are dropped.
`seq1`: the reference sequence.
`seqs`: a series of sequences (can be a generator)
`transpositions` ha... | Backend/venv/lib/python3.6/site-packages/distance/_iterators.py | ifast_comp | Pencroff/ai-hackathon | 82 | python | def ifast_comp(seq1, seqs, transpositions=False):
'Return an iterator over all the sequences in `seqs` which distance from\n\t`seq1` is lower or equal to 2. The sequences which distance from the\n\treference sequence is higher than that are dropped.\n\t\n\t\t`seq1`: the reference sequence.\n\t\t`seqs`: a series of ... | def ifast_comp(seq1, seqs, transpositions=False):
'Return an iterator over all the sequences in `seqs` which distance from\n\t`seq1` is lower or equal to 2. The sequences which distance from the\n\treference sequence is higher than that are dropped.\n\t\n\t\t`seq1`: the reference sequence.\n\t\t`seqs`: a series of ... |
86e0ea376c2dc3cc84b4060d225b595bd9fe0a74892a930df03101a81811b807 | def addRecord(temp, press, humd, mois):
'Add a new record to the database'
conn = sqlite3.connect('/home/pi/sensors.db')
cur = conn.cursor()
cur.execute('insert into sensors (temperature, pressure, humidity, moisture) values (?, ?, ?, ?)', (temp, press, humd, mois))
conn.commit()
conn.close() | Add a new record to the database | scripts/record-sensors.py | addRecord | hairyspider/tomcam | 0 | python | def addRecord(temp, press, humd, mois):
conn = sqlite3.connect('/home/pi/sensors.db')
cur = conn.cursor()
cur.execute('insert into sensors (temperature, pressure, humidity, moisture) values (?, ?, ?, ?)', (temp, press, humd, mois))
conn.commit()
conn.close() | def addRecord(temp, press, humd, mois):
conn = sqlite3.connect('/home/pi/sensors.db')
cur = conn.cursor()
cur.execute('insert into sensors (temperature, pressure, humidity, moisture) values (?, ?, ?, ?)', (temp, press, humd, mois))
conn.commit()
conn.close()<|docstring|>Add a new record to the ... |
0c23a45926f2a20744d14b5080526a5ef1e2bf9fe5af76c515e84e04acdc6ebc | def nepmaster(version='2', param=''):
'\n Launch master in NEP_WS\n\n Parameters\n ----------\n version : string\n Python version, 0 for default, 2 for Python 2 and 3 for Python 3\n\n param : string\n Can be "local", or "network"\n '
if (os.environ.get... | Launch master in NEP_WS
Parameters
----------
version : string
Python version, 0 for default, 2 for Python 2 and 3 for Python 3
param : string
Can be "local", or "network" | nep/helpers.py | nepmaster | enriquecoronadozu/NEP | 5 | python | def nepmaster(version='2', param=):
'\n Launch master in NEP_WS\n\n Parameters\n ----------\n version : string\n Python version, 0 for default, 2 for Python 2 and 3 for Python 3\n\n param : string\n Can be "local", or "network"\n '
if (os.environ.get('... | def nepmaster(version='2', param=):
'\n Launch master in NEP_WS\n\n Parameters\n ----------\n version : string\n Python version, 0 for default, 2 for Python 2 and 3 for Python 3\n\n param : string\n Can be "local", or "network"\n '
if (os.environ.get('... |
7ebbd1edfd3b78684243e93d3df5d2106acc6cd9548a76432b648e4055bf555f | def neprun(module, script, parameters, version='2'):
'\n Launch a python script in NEP_WS\n\n Parameters\n ----------\n module : string\n Module name\n\n script : string\n Script name\n\n script : parameters\n Additional command line paramet... | Launch a python script in NEP_WS
Parameters
----------
module : string
Module name
script : string
Script name
script : parameters
Additional command line parameters
version : string
Python version, 0 for default, 2 for Python 2 and 3 for Python 3 | nep/helpers.py | neprun | enriquecoronadozu/NEP | 5 | python | def neprun(module, script, parameters, version='2'):
'\n Launch a python script in NEP_WS\n\n Parameters\n ----------\n module : string\n Module name\n\n script : string\n Script name\n\n script : parameters\n Additional command line paramet... | def neprun(module, script, parameters, version='2'):
'\n Launch a python script in NEP_WS\n\n Parameters\n ----------\n module : string\n Module name\n\n script : string\n Script name\n\n script : parameters\n Additional command line paramet... |
1178116a44f11ab4de7a6063292df7f230c4e2019bdced639601d9d8d5534bd0 | def masterRegister(node, topic, master_ip='127.0.0.1', master_port=7000, socket='subscriber', mode='many2many', pid='none', data_type='json'):
' Register topic in master node\n \n Parameters\n ----------\n\n node: string\n Node name\n\n topic : string\n Topic to register\n\n ... | Register topic in master node
Parameters
----------
node: string
Node name
topic : string
Topic to register
master_ip : string
IP of the master node service
master_port : int
Port of the master node service
socket: string
Socket type. Example "surveyor", "publisher", "subscriber", "re... | nep/helpers.py | masterRegister | enriquecoronadozu/NEP | 5 | python | def masterRegister(node, topic, master_ip='127.0.0.1', master_port=7000, socket='subscriber', mode='many2many', pid='none', data_type='json'):
' Register topic in master node\n \n Parameters\n ----------\n\n node: string\n Node name\n\n topic : string\n Topic to register\n\n ... | def masterRegister(node, topic, master_ip='127.0.0.1', master_port=7000, socket='subscriber', mode='many2many', pid='none', data_type='json'):
' Register topic in master node\n \n Parameters\n ----------\n\n node: string\n Node name\n\n topic : string\n Topic to register\n\n ... |
0c6798bcea0af1445e5ce6c162ae4cfac4818813da7543fbdb837542d0eacb73 | def getNEPpath():
' Get path to NEP Workspace\n\n Returns\n ----------\n\n path : string\n Current workspace path\n\n '
import os
return os.environ['NEP_WS'] | Get path to NEP Workspace
Returns
----------
path : string
Current workspace path | nep/helpers.py | getNEPpath | enriquecoronadozu/NEP | 5 | python | def getNEPpath():
' Get path to NEP Workspace\n\n Returns\n ----------\n\n path : string\n Current workspace path\n\n '
import os
return os.environ['NEP_WS'] | def getNEPpath():
' Get path to NEP Workspace\n\n Returns\n ----------\n\n path : string\n Current workspace path\n\n '
import os
return os.environ['NEP_WS']<|docstring|>Get path to NEP Workspace
Returns
----------
path : string
Current workspace path<|endoftext|> |
1de59a12b78b136ecafb0246d9a14b8c809bcd1409f23171e76f159f8bb3825e | def setNEPpath(new_path):
' Set path to NEP Workspace\n\n Parameters\n ----------\n\n new_path: string\n New path for NEP workspace\n\n '
import os
if (os.environ.get('OS', '') == 'Windows_NT'):
from subprocess import CREATE_NEW_CONSOLE
command = (('setx NEP_WS "' + new_pa... | Set path to NEP Workspace
Parameters
----------
new_path: string
New path for NEP workspace | nep/helpers.py | setNEPpath | enriquecoronadozu/NEP | 5 | python | def setNEPpath(new_path):
' Set path to NEP Workspace\n\n Parameters\n ----------\n\n new_path: string\n New path for NEP workspace\n\n '
import os
if (os.environ.get('OS', ) == 'Windows_NT'):
from subprocess import CREATE_NEW_CONSOLE
command = (('setx NEP_WS "' + new_path... | def setNEPpath(new_path):
' Set path to NEP Workspace\n\n Parameters\n ----------\n\n new_path: string\n New path for NEP workspace\n\n '
import os
if (os.environ.get('OS', ) == 'Windows_NT'):
from subprocess import CREATE_NEW_CONSOLE
command = (('setx NEP_WS "' + new_path... |
66f74da86cb4da1b15e5634c6e48d6070c87e9f9cbd9e70b5b0e0d71fc5d1a9c | def getMyIP():
' Get current IP address of the PC\n\n Returns\n ----------\n\n ip : string\n Current IP\n\n '
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 80))
cw_ip = s.getsockname()[0]
s.close()
return str(cw_ip) | Get current IP address of the PC
Returns
----------
ip : string
Current IP | nep/helpers.py | getMyIP | enriquecoronadozu/NEP | 5 | python | def getMyIP():
' Get current IP address of the PC\n\n Returns\n ----------\n\n ip : string\n Current IP\n\n '
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 80))
cw_ip = s.getsockname()[0]
s.close()
return str(cw_ip) | def getMyIP():
' Get current IP address of the PC\n\n Returns\n ----------\n\n ip : string\n Current IP\n\n '
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 80))
cw_ip = s.getsockname()[0]
s.close()
return str(cw_ip)<|docstring|>Ge... |
5b05e8dbb59c5cd9359bf54100c82cf60a677ef3d077e744a32337c8536b50fd | def json2dict(s, **kwargs):
'Convert JSON to python dictionary. See jsonapi.jsonmod.loads for details on kwargs.\n \n Parameters\n ----------\n s: string\n string with the content of the json data\n\n Returns:\n ----------\n dict: dictionary\n dict... | Convert JSON to python dictionary. See jsonapi.jsonmod.loads for details on kwargs.
Parameters
----------
s: string
string with the content of the json data
Returns:
----------
dict: dictionary
dictionary with the content of the json data | nep/helpers.py | json2dict | enriquecoronadozu/NEP | 5 | python | def json2dict(s, **kwargs):
'Convert JSON to python dictionary. See jsonapi.jsonmod.loads for details on kwargs.\n \n Parameters\n ----------\n s: string\n string with the content of the json data\n\n Returns:\n ----------\n dict: dictionary\n dict... | def json2dict(s, **kwargs):
'Convert JSON to python dictionary. See jsonapi.jsonmod.loads for details on kwargs.\n \n Parameters\n ----------\n s: string\n string with the content of the json data\n\n Returns:\n ----------\n dict: dictionary\n dict... |
4bf656201f500e26c5a39359cd8a2fc35f8a658543a93866e35e87ebc27cbd2e | def dict2json(o, **kwargs):
' Load object from JSON bytes (utf-8). See jsonapi.jsonmod.dumps for details on kwargs.\n \n Parameters\n ----------\n o: dictionary\n dictionary to convert\n \n\n Returns:\n ----------\n s: string\n string in... | Load object from JSON bytes (utf-8). See jsonapi.jsonmod.dumps for details on kwargs.
Parameters
----------
o: dictionary
dictionary to convert
Returns:
----------
s: string
string in json format | nep/helpers.py | dict2json | enriquecoronadozu/NEP | 5 | python | def dict2json(o, **kwargs):
' Load object from JSON bytes (utf-8). See jsonapi.jsonmod.dumps for details on kwargs.\n \n Parameters\n ----------\n o: dictionary\n dictionary to convert\n \n\n Returns:\n ----------\n s: string\n string in... | def dict2json(o, **kwargs):
' Load object from JSON bytes (utf-8). See jsonapi.jsonmod.dumps for details on kwargs.\n \n Parameters\n ----------\n o: dictionary\n dictionary to convert\n \n\n Returns:\n ----------\n s: string\n string in... |
b34144a7bad97228cff0548ec109f87978b2affb69eff2ccdbff58d101db3628 | def read_json(json_file):
' Read a json file and return a string \n \n Parameters\n ----------\n json file:string\n Path + name + extension of the json file\n\n Returns:\n ----------\n json_data: string\n string with the content of the json dat... | Read a json file and return a string
Parameters
----------
json file:string
Path + name + extension of the json file
Returns:
----------
json_data: string
string with the content of the json data | nep/helpers.py | read_json | enriquecoronadozu/NEP | 5 | python | def read_json(json_file):
' Read a json file and return a string \n \n Parameters\n ----------\n json file:string\n Path + name + extension of the json file\n\n Returns:\n ----------\n json_data: string\n string with the content of the json dat... | def read_json(json_file):
' Read a json file and return a string \n \n Parameters\n ----------\n json file:string\n Path + name + extension of the json file\n\n Returns:\n ----------\n json_data: string\n string with the content of the json dat... |
452b666f3d04b9822df40795b62a9544f73ed517beae520aa1131e3f43256e1a | def getFiles(path):
' Get a list of files that are inside a folder\n \n Parameters\n ----------\n path: string\n path of the folder\n\n Returns:\n ----------\n onlyfiles: list \n list of strings with the name of the files in the folder\n\n '
... | Get a list of files that are inside a folder
Parameters
----------
path: string
path of the folder
Returns:
----------
onlyfiles: list
list of strings with the name of the files in the folder | nep/helpers.py | getFiles | enriquecoronadozu/NEP | 5 | python | def getFiles(path):
' Get a list of files that are inside a folder\n \n Parameters\n ----------\n path: string\n path of the folder\n\n Returns:\n ----------\n onlyfiles: list \n list of strings with the name of the files in the folder\n\n '
... | def getFiles(path):
' Get a list of files that are inside a folder\n \n Parameters\n ----------\n path: string\n path of the folder\n\n Returns:\n ----------\n onlyfiles: list \n list of strings with the name of the files in the folder\n\n '
... |
db54f8d0c78dd4d8964bfa42bb27ba0199185c1046fee3b0654cf17557002b39 | def fetch_url(url, fname):
' save a url to a local file '
fin = req.urlopen(url)
data = fin.read()
with open(fname, mode='wb') as fout:
fout.write(data) | save a url to a local file | matt_file.py | fetch_url | decareano/boto3 | 0 | python | def fetch_url(url, fname):
' '
fin = req.urlopen(url)
data = fin.read()
with open(fname, mode='wb') as fout:
fout.write(data) | def fetch_url(url, fname):
' '
fin = req.urlopen(url)
data = fin.read()
with open(fname, mode='wb') as fout:
fout.write(data)<|docstring|>save a url to a local file<|endoftext|> |
24df0b9410f8a28f9ec41e6c38555a62d753962923cfe89ab29bb8a16bf0fc75 | def __init__(self, blob_data_payment_rate, db_dir=None, lbryid=None, peer_manager=None, dht_node_port=None, known_dht_nodes=None, peer_finder=None, hash_announcer=None, blob_dir=None, blob_manager=None, peer_port=None, use_upnp=True, rate_limiter=None, wallet=None, dht_node_class=node.Node, blob_tracker_class=None, pay... | @param blob_data_payment_rate: The default payment rate for blob data
@param db_dir: The directory in which levelDB files should be stored
@param lbryid: The unique ID of this node
@param peer_manager: An object which keeps track of all known
peers. If None, a PeerManager will be created
@param dht_node_port: T... | lbrynet/core/Session.py | __init__ | shyba/lbry | 1 | python | def __init__(self, blob_data_payment_rate, db_dir=None, lbryid=None, peer_manager=None, dht_node_port=None, known_dht_nodes=None, peer_finder=None, hash_announcer=None, blob_dir=None, blob_manager=None, peer_port=None, use_upnp=True, rate_limiter=None, wallet=None, dht_node_class=node.Node, blob_tracker_class=None, pay... | def __init__(self, blob_data_payment_rate, db_dir=None, lbryid=None, peer_manager=None, dht_node_port=None, known_dht_nodes=None, peer_finder=None, hash_announcer=None, blob_dir=None, blob_manager=None, peer_port=None, use_upnp=True, rate_limiter=None, wallet=None, dht_node_class=node.Node, blob_tracker_class=None, pay... |
80b0394c7811fadb7687b7e72477b90d990788434e70f924b8f7daad48ae2d68 | def setup(self):
'Create the blob directory and database if necessary, start all desired services'
log.debug('Setting up the lbry session')
if (self.lbryid is None):
self.lbryid = generate_id()
if (self.wallet is None):
from lbrynet.core.PTCWallet import PTCWallet
self.wallet = P... | Create the blob directory and database if necessary, start all desired services | lbrynet/core/Session.py | setup | shyba/lbry | 1 | python | def setup(self):
log.debug('Setting up the lbry session')
if (self.lbryid is None):
self.lbryid = generate_id()
if (self.wallet is None):
from lbrynet.core.PTCWallet import PTCWallet
self.wallet = PTCWallet(self.db_dir)
if (self.peer_manager is None):
self.peer_manag... | def setup(self):
log.debug('Setting up the lbry session')
if (self.lbryid is None):
self.lbryid = generate_id()
if (self.wallet is None):
from lbrynet.core.PTCWallet import PTCWallet
self.wallet = PTCWallet(self.db_dir)
if (self.peer_manager is None):
self.peer_manag... |
00475c5ff1721a839e12bcbcfc98f1f9103e52b8a40453959a2eea94403a021c | def shut_down(self):
'Stop all services'
log.info('Shutting down %s', self)
ds = []
if (self.blob_tracker is not None):
ds.append(defer.maybeDeferred(self.blob_tracker.stop))
if (self.dht_node is not None):
ds.append(defer.maybeDeferred(self.dht_node.stop))
if (self.rate_limiter ... | Stop all services | lbrynet/core/Session.py | shut_down | shyba/lbry | 1 | python | def shut_down(self):
log.info('Shutting down %s', self)
ds = []
if (self.blob_tracker is not None):
ds.append(defer.maybeDeferred(self.blob_tracker.stop))
if (self.dht_node is not None):
ds.append(defer.maybeDeferred(self.dht_node.stop))
if (self.rate_limiter is not None):
... | def shut_down(self):
log.info('Shutting down %s', self)
ds = []
if (self.blob_tracker is not None):
ds.append(defer.maybeDeferred(self.blob_tracker.stop))
if (self.dht_node is not None):
ds.append(defer.maybeDeferred(self.dht_node.stop))
if (self.rate_limiter is not None):
... |
3821980932ffbd3d0d37b8590daf69f8c6c9b0ea5424683ff2e10d6ce3561c42 | def markdown(text, **kwargs):
'Convert a markdown string to HTML and return HTML as a unicode string.\n\n This is a shortcut function for `Markdown` class to cover the most\n basic use case. It initializes an instance of Markdown, loads the\n necessary extensions and runs the parser on the given text.\n\n... | Convert a markdown string to HTML and return HTML as a unicode string.
This is a shortcut function for `Markdown` class to cover the most
basic use case. It initializes an instance of Markdown, loads the
necessary extensions and runs the parser on the given text.
Keyword arguments:
* text: Markdown formatted text a... | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | markdown | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def markdown(text, **kwargs):
'Convert a markdown string to HTML and return HTML as a unicode string.\n\n This is a shortcut function for `Markdown` class to cover the most\n basic use case. It initializes an instance of Markdown, loads the\n necessary extensions and runs the parser on the given text.\n\n... | def markdown(text, **kwargs):
'Convert a markdown string to HTML and return HTML as a unicode string.\n\n This is a shortcut function for `Markdown` class to cover the most\n basic use case. It initializes an instance of Markdown, loads the\n necessary extensions and runs the parser on the given text.\n\n... |
267d3a987965fe080fbcf6fae30813ad2453685078037c0c0195dbee100f157d | def markdownFromFile(**kwargs):
'Read markdown code from a file and write it to a file or a stream.\n\n This is a shortcut function which initializes an instance of Markdown,\n and calls the convertFile method rather than convert.\n\n Keyword arguments:\n\n * input: a file name or readable object.\n ... | Read markdown code from a file and write it to a file or a stream.
This is a shortcut function which initializes an instance of Markdown,
and calls the convertFile method rather than convert.
Keyword arguments:
* input: a file name or readable object.
* output: a file name or writable object.
* encoding: Encoding of... | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | markdownFromFile | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def markdownFromFile(**kwargs):
'Read markdown code from a file and write it to a file or a stream.\n\n This is a shortcut function which initializes an instance of Markdown,\n and calls the convertFile method rather than convert.\n\n Keyword arguments:\n\n * input: a file name or readable object.\n ... | def markdownFromFile(**kwargs):
'Read markdown code from a file and write it to a file or a stream.\n\n This is a shortcut function which initializes an instance of Markdown,\n and calls the convertFile method rather than convert.\n\n Keyword arguments:\n\n * input: a file name or readable object.\n ... |
db3070d5298143f6f22d0fc6d322878a1b4f4da95b6bcdf270534fab3f64c16e | def __init__(self, **kwargs):
'\n Creates a new Markdown instance.\n\n Keyword arguments:\n\n * extensions: A list of extensions.\n If an item is an instance of a subclass of `markdown.extension.Extension`, the instance will be used\n as-is. If an item is of type string, ... | Creates a new Markdown instance.
Keyword arguments:
* extensions: A list of extensions.
If an item is an instance of a subclass of `markdown.extension.Extension`, the instance will be used
as-is. If an item is of type string, first an entry point will be loaded. If that fails, the string is
assumed to us... | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | __init__ | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def __init__(self, **kwargs):
'\n Creates a new Markdown instance.\n\n Keyword arguments:\n\n * extensions: A list of extensions.\n If an item is an instance of a subclass of `markdown.extension.Extension`, the instance will be used\n as-is. If an item is of type string, ... | def __init__(self, **kwargs):
'\n Creates a new Markdown instance.\n\n Keyword arguments:\n\n * extensions: A list of extensions.\n If an item is an instance of a subclass of `markdown.extension.Extension`, the instance will be used\n as-is. If an item is of type string, ... |
2e31637ebb02999913e80f48a727fc926d0a603e39ea8ad932de81ad4f89d66f | def build_parser(self):
' Build the parser from the various parts. '
self.preprocessors = build_preprocessors(self)
self.parser = build_block_parser(self)
self.inlinePatterns = build_inlinepatterns(self)
self.treeprocessors = build_treeprocessors(self)
self.postprocessors = build_postprocessors(... | Build the parser from the various parts. | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | build_parser | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def build_parser(self):
' '
self.preprocessors = build_preprocessors(self)
self.parser = build_block_parser(self)
self.inlinePatterns = build_inlinepatterns(self)
self.treeprocessors = build_treeprocessors(self)
self.postprocessors = build_postprocessors(self)
return self | def build_parser(self):
' '
self.preprocessors = build_preprocessors(self)
self.parser = build_block_parser(self)
self.inlinePatterns = build_inlinepatterns(self)
self.treeprocessors = build_treeprocessors(self)
self.postprocessors = build_postprocessors(self)
return self<|docstring|>Build ... |
a040e840e8dadfff417f5029d104f215856d70bff712a3456d9ef832f1215e8f | def registerExtensions(self, extensions, configs):
'\n Register extensions with this instance of Markdown.\n\n Keyword arguments:\n\n * extensions: A list of extensions, which can either\n be strings or objects.\n * configs: A dictionary mapping extension names to config option... | Register extensions with this instance of Markdown.
Keyword arguments:
* extensions: A list of extensions, which can either
be strings or objects.
* configs: A dictionary mapping extension names to config options. | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | registerExtensions | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def registerExtensions(self, extensions, configs):
'\n Register extensions with this instance of Markdown.\n\n Keyword arguments:\n\n * extensions: A list of extensions, which can either\n be strings or objects.\n * configs: A dictionary mapping extension names to config option... | def registerExtensions(self, extensions, configs):
'\n Register extensions with this instance of Markdown.\n\n Keyword arguments:\n\n * extensions: A list of extensions, which can either\n be strings or objects.\n * configs: A dictionary mapping extension names to config option... |
01f8f9667625dfdfafcc8188d599e1c51a3bc762b4abd9aae523473bdc24a2bd | def build_extension(self, ext_name, configs):
'\n Build extension from a string name, then return an instance.\n\n First attempt to load an entry point. The string name must be registered as an entry point in the\n `markdown.extensions` group which points to a subclass of the `markdown.extensio... | Build extension from a string name, then return an instance.
First attempt to load an entry point. The string name must be registered as an entry point in the
`markdown.extensions` group which points to a subclass of the `markdown.extensions.Extension` class.
If multiple distributions have registered the same name, th... | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | build_extension | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def build_extension(self, ext_name, configs):
'\n Build extension from a string name, then return an instance.\n\n First attempt to load an entry point. The string name must be registered as an entry point in the\n `markdown.extensions` group which points to a subclass of the `markdown.extensio... | def build_extension(self, ext_name, configs):
'\n Build extension from a string name, then return an instance.\n\n First attempt to load an entry point. The string name must be registered as an entry point in the\n `markdown.extensions` group which points to a subclass of the `markdown.extensio... |
dbd1934600db4df9416490968535393c37ba4706f2e70c7796fb75ad3dd35144 | def registerExtension(self, extension):
' This gets called by the extension '
self.registeredExtensions.append(extension)
return self | This gets called by the extension | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | registerExtension | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def registerExtension(self, extension):
' '
self.registeredExtensions.append(extension)
return self | def registerExtension(self, extension):
' '
self.registeredExtensions.append(extension)
return self<|docstring|>This gets called by the extension<|endoftext|> |
53e720c5d1965c68f0577ded91e56a98556503005692ef583b9218e57c45f9e4 | def reset(self):
'\n Resets all state variables so that we can start with a new text.\n '
self.htmlStash.reset()
self.references.clear()
for extension in self.registeredExtensions:
if hasattr(extension, 'reset'):
extension.reset()
return self | Resets all state variables so that we can start with a new text. | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | reset | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def reset(self):
'\n \n '
self.htmlStash.reset()
self.references.clear()
for extension in self.registeredExtensions:
if hasattr(extension, 'reset'):
extension.reset()
return self | def reset(self):
'\n \n '
self.htmlStash.reset()
self.references.clear()
for extension in self.registeredExtensions:
if hasattr(extension, 'reset'):
extension.reset()
return self<|docstring|>Resets all state variables so that we can start with a new text.<|endoftext... |
feda5539b78e20517a104f3dd58d24b47635f6db0f208b427d0d9d6986329448 | def set_output_format(self, format):
' Set the output format for the class instance. '
self.output_format = format.lower().rstrip('145')
try:
self.serializer = self.output_formats[self.output_format]
except KeyError as e:
valid_formats = list(self.output_formats.keys())
valid_for... | Set the output format for the class instance. | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | set_output_format | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def set_output_format(self, format):
' '
self.output_format = format.lower().rstrip('145')
try:
self.serializer = self.output_formats[self.output_format]
except KeyError as e:
valid_formats = list(self.output_formats.keys())
valid_formats.sort()
message = ('Invalid Outpu... | def set_output_format(self, format):
' '
self.output_format = format.lower().rstrip('145')
try:
self.serializer = self.output_formats[self.output_format]
except KeyError as e:
valid_formats = list(self.output_formats.keys())
valid_formats.sort()
message = ('Invalid Outpu... |
9a6f59a369bda7ff2986389b067be3847b044868076ef4c47d1a46aa4bcae801 | def is_block_level(self, tag):
'Check if the tag is a block level HTML tag.'
if isinstance(tag, str):
return (tag.lower().rstrip('/') in self.block_level_elements)
return False | Check if the tag is a block level HTML tag. | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | is_block_level | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def is_block_level(self, tag):
if isinstance(tag, str):
return (tag.lower().rstrip('/') in self.block_level_elements)
return False | def is_block_level(self, tag):
if isinstance(tag, str):
return (tag.lower().rstrip('/') in self.block_level_elements)
return False<|docstring|>Check if the tag is a block level HTML tag.<|endoftext|> |
ad829f479243c7a863f28809720344ca2c66188f15f8b0268bdb4ca519c21772 | def convert(self, source):
'\n Convert markdown to serialized XHTML or HTML.\n\n Keyword arguments:\n\n * source: Source text as a Unicode string.\n\n Markdown processing takes place in five steps:\n\n 1. A bunch of "preprocessors" munge the input text.\n 2. BlockParser() p... | Convert markdown to serialized XHTML or HTML.
Keyword arguments:
* source: Source text as a Unicode string.
Markdown processing takes place in five steps:
1. A bunch of "preprocessors" munge the input text.
2. BlockParser() parses the high-level structural elements of the
pre-processed text into an ElementTree.
... | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | convert | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def convert(self, source):
'\n Convert markdown to serialized XHTML or HTML.\n\n Keyword arguments:\n\n * source: Source text as a Unicode string.\n\n Markdown processing takes place in five steps:\n\n 1. A bunch of "preprocessors" munge the input text.\n 2. BlockParser() p... | def convert(self, source):
'\n Convert markdown to serialized XHTML or HTML.\n\n Keyword arguments:\n\n * source: Source text as a Unicode string.\n\n Markdown processing takes place in five steps:\n\n 1. A bunch of "preprocessors" munge the input text.\n 2. BlockParser() p... |
d469e6da67c8e31bfe700cff011140db21cea3f7d96fc8e95ce76a77902ae46f | def convertFile(self, input=None, output=None, encoding=None):
"Converts a markdown file and returns the HTML as a unicode string.\n\n Decodes the file using the provided encoding (defaults to utf-8),\n passes the file content to markdown, and outputs the html to either\n the provided stream or... | Converts a markdown file and returns the HTML as a unicode string.
Decodes the file using the provided encoding (defaults to utf-8),
passes the file content to markdown, and outputs the html to either
the provided stream or the file with provided name, using the same
encoding as the source file. The 'xmlcharrefreplace... | pasta-django/venv/lib/python3.8/site-packages/markdown/core.py | convertFile | rabeloalcantaraigor/Curso-API-DRF | 14,668 | python | def convertFile(self, input=None, output=None, encoding=None):
"Converts a markdown file and returns the HTML as a unicode string.\n\n Decodes the file using the provided encoding (defaults to utf-8),\n passes the file content to markdown, and outputs the html to either\n the provided stream or... | def convertFile(self, input=None, output=None, encoding=None):
"Converts a markdown file and returns the HTML as a unicode string.\n\n Decodes the file using the provided encoding (defaults to utf-8),\n passes the file content to markdown, and outputs the html to either\n the provided stream or... |
c223d00b38f52040c69a15db75d553eb08b79493d25381c09b6690cbb6ef2497 | def sample(self, sample_file):
' Samples to a file. Useful for visualizing the learning process.\n\n Use with:\n\n ffmpeg -i samples/grid-%06d.png -vcodec libx264 -crf 22 -threads 0 grid1-7.mp4\n\n to create a video of the learning process.\n '
sample_list = self.sampler.sample... | Samples to a file. Useful for visualizing the learning process.
Use with:
ffmpeg -i samples/grid-%06d.png -vcodec libx264 -crf 22 -threads 0 grid1-7.mp4
to create a video of the learning process. | hypergan/cli.py | sample | SlipknotTN/HyperGAN | 0 | python | def sample(self, sample_file):
' Samples to a file. Useful for visualizing the learning process.\n\n Use with:\n\n ffmpeg -i samples/grid-%06d.png -vcodec libx264 -crf 22 -threads 0 grid1-7.mp4\n\n to create a video of the learning process.\n '
sample_list = self.sampler.sample... | def sample(self, sample_file):
' Samples to a file. Useful for visualizing the learning process.\n\n Use with:\n\n ffmpeg -i samples/grid-%06d.png -vcodec libx264 -crf 22 -threads 0 grid1-7.mp4\n\n to create a video of the learning process.\n '
sample_list = self.sampler.sample... |
7bd4e6fbb29c66ca383c21d1e5fd892a37fc5b5f3e5861fce22fdf8964a9c1df | def setup_platform(hass, config, add_devices, discovery_info=None):
'Set up the smart mi fan platform.'
import miio
host = config.get(CONF_HOST)
name = config.get(CONF_NAME)
token = config.get(CONF_TOKEN)
devices = config.get(CONF_SWITCHES, {})
persistent_notification = loader.get_component(... | Set up the smart mi fan platform. | custom_components/switch/mi_acpartner_ir.py | setup_platform | mac-zhou/homeassistant-mi-acpartner | 135 | python | def setup_platform(hass, config, add_devices, discovery_info=None):
import miio
host = config.get(CONF_HOST)
name = config.get(CONF_NAME)
token = config.get(CONF_TOKEN)
devices = config.get(CONF_SWITCHES, {})
persistent_notification = loader.get_component('persistent_notification')
@as... | def setup_platform(hass, config, add_devices, discovery_info=None):
import miio
host = config.get(CONF_HOST)
name = config.get(CONF_NAME)
token = config.get(CONF_TOKEN)
devices = config.get(CONF_SWITCHES, {})
persistent_notification = loader.get_component('persistent_notification')
@as... |
a236d6c37eea148c7561c61d1998bb050e8920f7de10f4d1f36fca2422e9af17 | def __init__(self, device, name, command_on, command_off, icon):
'Initialize the switch.'
self._name = name
self._state = False
self._command_on = (command_on or None)
self._command_off = (command_off or None)
self._device = device
self._icon = icon | Initialize the switch. | custom_components/switch/mi_acpartner_ir.py | __init__ | mac-zhou/homeassistant-mi-acpartner | 135 | python | def __init__(self, device, name, command_on, command_off, icon):
self._name = name
self._state = False
self._command_on = (command_on or None)
self._command_off = (command_off or None)
self._device = device
self._icon = icon | def __init__(self, device, name, command_on, command_off, icon):
self._name = name
self._state = False
self._command_on = (command_on or None)
self._command_off = (command_off or None)
self._device = device
self._icon = icon<|docstring|>Initialize the switch.<|endoftext|> |
b266a171d582c1290c045c84c1a435b8e5deb36d2a825bfb56ab6f4c44a7e41a | @property
def icon(self):
'Return the icon to use for device if any.'
return self._icon | Return the icon to use for device if any. | custom_components/switch/mi_acpartner_ir.py | icon | mac-zhou/homeassistant-mi-acpartner | 135 | python | @property
def icon(self):
return self._icon | @property
def icon(self):
return self._icon<|docstring|>Return the icon to use for device if any.<|endoftext|> |
db2111d58663d126541e4a6d9f51b1697d1b084e7340679be31742a3030c3ce1 | @property
def name(self):
'Return the name of the switch.'
return self._name | Return the name of the switch. | custom_components/switch/mi_acpartner_ir.py | name | mac-zhou/homeassistant-mi-acpartner | 135 | python | @property
def name(self):
return self._name | @property
def name(self):
return self._name<|docstring|>Return the name of the switch.<|endoftext|> |
454edd0c9bd544b7c99a905d438af854cb21d01f1f906d621c0bd328f39e3b17 | @property
def assumed_state(self):
'Return true if unable to access real state of entity.'
return True | Return true if unable to access real state of entity. | custom_components/switch/mi_acpartner_ir.py | assumed_state | mac-zhou/homeassistant-mi-acpartner | 135 | python | @property
def assumed_state(self):
return True | @property
def assumed_state(self):
return True<|docstring|>Return true if unable to access real state of entity.<|endoftext|> |
53669033a44cc2b7f0c0eb1c203b1e7a7c81e72e96769d5c38bc62208b72137f | @property
def should_poll(self):
'No polling needed.'
return False | No polling needed. | custom_components/switch/mi_acpartner_ir.py | should_poll | mac-zhou/homeassistant-mi-acpartner | 135 | python | @property
def should_poll(self):
return False | @property
def should_poll(self):
return False<|docstring|>No polling needed.<|endoftext|> |
627e3004244c927368bebd4854458a6563ba3db2cadfff4b4804f631ffe09428 | @property
def is_on(self):
'Return true if device is on.'
return self._state | Return true if device is on. | custom_components/switch/mi_acpartner_ir.py | is_on | mac-zhou/homeassistant-mi-acpartner | 135 | python | @property
def is_on(self):
return self._state | @property
def is_on(self):
return self._state<|docstring|>Return true if device is on.<|endoftext|> |
c93e1f1feb18de07875a1f1efa91525deefa7d92a297b6f9abfd0b698e2583ec | def turn_on(self, **kwargs):
'Turn the device on.'
if self._sendpacket(self._command_on):
self._state = True
self.schedule_update_ha_state() | Turn the device on. | custom_components/switch/mi_acpartner_ir.py | turn_on | mac-zhou/homeassistant-mi-acpartner | 135 | python | def turn_on(self, **kwargs):
if self._sendpacket(self._command_on):
self._state = True
self.schedule_update_ha_state() | def turn_on(self, **kwargs):
if self._sendpacket(self._command_on):
self._state = True
self.schedule_update_ha_state()<|docstring|>Turn the device on.<|endoftext|> |
e0b811e93f3e1eb66f3ea8e8e46400bab787304e47507c2d31f2a020e9eb9a4a | def turn_off(self, **kwargs):
'Turn the device off.'
if self._sendpacket(self._command_off):
self._state = False
self.schedule_update_ha_state() | Turn the device off. | custom_components/switch/mi_acpartner_ir.py | turn_off | mac-zhou/homeassistant-mi-acpartner | 135 | python | def turn_off(self, **kwargs):
if self._sendpacket(self._command_off):
self._state = False
self.schedule_update_ha_state() | def turn_off(self, **kwargs):
if self._sendpacket(self._command_off):
self._state = False
self.schedule_update_ha_state()<|docstring|>Turn the device off.<|endoftext|> |
fefcc9d224f155aefc3614e58e6bf13cc44383b97057d7380e6bd3af6f09143e | def _sendpacket(self, packet):
'Send packet to device.'
if (packet is None):
_LOGGER.debug('Empty packet.')
return True
try:
self._device.send('send_ir_code', [str(packet)])
_LOGGER.info(str(packet))
except ValueError as error:
_LOGGER.error(error)
return ... | Send packet to device. | custom_components/switch/mi_acpartner_ir.py | _sendpacket | mac-zhou/homeassistant-mi-acpartner | 135 | python | def _sendpacket(self, packet):
if (packet is None):
_LOGGER.debug('Empty packet.')
return True
try:
self._device.send('send_ir_code', [str(packet)])
_LOGGER.info(str(packet))
except ValueError as error:
_LOGGER.error(error)
return False
return True | def _sendpacket(self, packet):
if (packet is None):
_LOGGER.debug('Empty packet.')
return True
try:
self._device.send('send_ir_code', [str(packet)])
_LOGGER.info(str(packet))
except ValueError as error:
_LOGGER.error(error)
return False
return True<|d... |
b3270baa21b5bef766d37052e1fb9a69849b78fff8fc034f633ccdf1e663e16c | def is_guild_admin(member: discord.Member) -> bool:
'\n Shorthand for member.guild_permissions.administrator\n :param member: discord.Memeber to check if admin\n '
return member.guild_permissions.administrator | Shorthand for member.guild_permissions.administrator
:param member: discord.Memeber to check if admin | src/permission_management/admin.py | is_guild_admin | kesslermaximilian/JustOneBot | 1 | python | def is_guild_admin(member: discord.Member) -> bool:
'\n Shorthand for member.guild_permissions.administrator\n :param member: discord.Memeber to check if admin\n '
return member.guild_permissions.administrator | def is_guild_admin(member: discord.Member) -> bool:
'\n Shorthand for member.guild_permissions.administrator\n :param member: discord.Memeber to check if admin\n '
return member.guild_permissions.administrator<|docstring|>Shorthand for member.guild_permissions.administrator
:param member: discord.Memeb... |
23c26c297f22cfbb3e147c5a4b5d395b9c6acc48425c632dfb46611a722e5269 | def session_spaces(self, kernel_space):
' Generators unique _MM_SESSION_SPACE objects\n referenced by active processes. \n \n @param space: a kernel AS for process enumeration\n \n @yields _MM_SESSION_SPACE instantiated from the \n session space native_vm. \n '
seen = []... | Generators unique _MM_SESSION_SPACE objects
referenced by active processes.
@param space: a kernel AS for process enumeration
@yields _MM_SESSION_SPACE instantiated from the
session space native_vm. | volatility/volatility/plugins/gui/sessions.py | session_spaces | williamclot/MemoryVisualizer | 2 | python | def session_spaces(self, kernel_space):
' Generators unique _MM_SESSION_SPACE objects\n referenced by active processes. \n \n @param space: a kernel AS for process enumeration\n \n @yields _MM_SESSION_SPACE instantiated from the \n session space native_vm. \n '
seen = []... | def session_spaces(self, kernel_space):
' Generators unique _MM_SESSION_SPACE objects\n referenced by active processes. \n \n @param space: a kernel AS for process enumeration\n \n @yields _MM_SESSION_SPACE instantiated from the \n session space native_vm. \n '
seen = []... |
6518c3cfd1b825bea7322675bb87745581d8dd0d59e9a24258018cf11c81c228 | def find_session_space(self, kernel_space, session_id):
' Get a session address space by its ID. \n \n @param space: a kernel AS for process enumeration\n @param session_id: the session ID to find.\n \n @returns _MM_SESSION_SPACE instantiated from the \n session space native_vm. \n... | Get a session address space by its ID.
@param space: a kernel AS for process enumeration
@param session_id: the session ID to find.
@returns _MM_SESSION_SPACE instantiated from the
session space native_vm. | volatility/volatility/plugins/gui/sessions.py | find_session_space | williamclot/MemoryVisualizer | 2 | python | def find_session_space(self, kernel_space, session_id):
' Get a session address space by its ID. \n \n @param space: a kernel AS for process enumeration\n @param session_id: the session ID to find.\n \n @returns _MM_SESSION_SPACE instantiated from the \n session space native_vm. \n... | def find_session_space(self, kernel_space, session_id):
' Get a session address space by its ID. \n \n @param space: a kernel AS for process enumeration\n @param session_id: the session ID to find.\n \n @returns _MM_SESSION_SPACE instantiated from the \n session space native_vm. \n... |
a208e5e3a500767d57cfa6e54affc5cc4620d2e97248a80cb4d625c3cfc2bcd1 | def __init__(self, executor, job_id, qobj, backend_name, job_tags=None, job_name=None):
'Initialize a fake job.'
self._job_id = job_id
self._status = ApiJobStatus.CREATING
self.qobj = qobj
self._future = executor.submit(self._auto_progress)
self._result = None
self._backend_name = backend_na... | Initialize a fake job. | test/fake_account_client.py | __init__ | jwoehr/qiskit-ibmq-provider | 199 | python | def __init__(self, executor, job_id, qobj, backend_name, job_tags=None, job_name=None):
self._job_id = job_id
self._status = ApiJobStatus.CREATING
self.qobj = qobj
self._future = executor.submit(self._auto_progress)
self._result = None
self._backend_name = backend_name
self._job_tags = ... | def __init__(self, executor, job_id, qobj, backend_name, job_tags=None, job_name=None):
self._job_id = job_id
self._status = ApiJobStatus.CREATING
self.qobj = qobj
self._future = executor.submit(self._auto_progress)
self._result = None
self._backend_name = backend_name
self._job_tags = ... |
f4db3b497a1f73ada98b4eac6e4863904a4ead9df16e7eeb35bb9f0db86098c5 | def _auto_progress(self):
'Automatically update job status.'
for status in self._job_progress:
time.sleep(0.5)
self._status = status
if (self._status == ApiJobStatus.COMPLETED):
new_result = copy.deepcopy(VALID_RESULT_RESPONSE)
for _ in range(len(self.qobj['experiments'])):
... | Automatically update job status. | test/fake_account_client.py | _auto_progress | jwoehr/qiskit-ibmq-provider | 199 | python | def _auto_progress(self):
for status in self._job_progress:
time.sleep(0.5)
self._status = status
if (self._status == ApiJobStatus.COMPLETED):
new_result = copy.deepcopy(VALID_RESULT_RESPONSE)
for _ in range(len(self.qobj['experiments'])):
valid_result = copy.dee... | def _auto_progress(self):
for status in self._job_progress:
time.sleep(0.5)
self._status = status
if (self._status == ApiJobStatus.COMPLETED):
new_result = copy.deepcopy(VALID_RESULT_RESPONSE)
for _ in range(len(self.qobj['experiments'])):
valid_result = copy.dee... |
715395286d4ca3c3811a9232a886bc4f6e552955ecc81955161e65baa9030209 | def data(self):
'Return job data.'
data = {'job_id': self._job_id, 'kind': 'q-object', 'status': self._status.value, 'creation_date': '2019-01-01T13:15:58.425972', '_backend_info': {'name': self._backend_name}}
if self._job_tags:
data['tags'] = self._job_tags.copy()
if self._job_name:
da... | Return job data. | test/fake_account_client.py | data | jwoehr/qiskit-ibmq-provider | 199 | python | def data(self):
data = {'job_id': self._job_id, 'kind': 'q-object', 'status': self._status.value, 'creation_date': '2019-01-01T13:15:58.425972', '_backend_info': {'name': self._backend_name}}
if self._job_tags:
data['tags'] = self._job_tags.copy()
if self._job_name:
data['name'] = self.... | def data(self):
data = {'job_id': self._job_id, 'kind': 'q-object', 'status': self._status.value, 'creation_date': '2019-01-01T13:15:58.425972', '_backend_info': {'name': self._backend_name}}
if self._job_tags:
data['tags'] = self._job_tags.copy()
if self._job_name:
data['name'] = self.... |
18cef473718005bcd6593f8bd0ca81aafe67790fab8e2b18e23ad8edd716f211 | def cancel(self):
'Cancel the job.'
self._future.cancel()
wait([self._future])
self._status = ApiJobStatus.CANCELLED
self._result = None | Cancel the job. | test/fake_account_client.py | cancel | jwoehr/qiskit-ibmq-provider | 199 | python | def cancel(self):
self._future.cancel()
wait([self._future])
self._status = ApiJobStatus.CANCELLED
self._result = None | def cancel(self):
self._future.cancel()
wait([self._future])
self._status = ApiJobStatus.CANCELLED
self._result = None<|docstring|>Cancel the job.<|endoftext|> |
cae6c557197eff0f9ae4fdd4df6417d877d65ebe116b6d8efcbb4bbf147ac36f | def result(self):
'Return job result.'
if (not self._result):
raise RequestsApiError('Result is not available')
return self._result | Return job result. | test/fake_account_client.py | result | jwoehr/qiskit-ibmq-provider | 199 | python | def result(self):
if (not self._result):
raise RequestsApiError('Result is not available')
return self._result | def result(self):
if (not self._result):
raise RequestsApiError('Result is not available')
return self._result<|docstring|>Return job result.<|endoftext|> |
526d5537655214e1ae490cf7930084c7bde1c8dcbe547526d9978f8da3b4bec0 | def status(self):
'Return job status.'
return self._status | Return job status. | test/fake_account_client.py | status | jwoehr/qiskit-ibmq-provider | 199 | python | def status(self):
return self._status | def status(self):
return self._status<|docstring|>Return job status.<|endoftext|> |
4b5288aed731366923415a8a27666f9b92beeb21764bae63540bd11175284abd | def name(self):
'Return job name.'
return self._job_name | Return job name. | test/fake_account_client.py | name | jwoehr/qiskit-ibmq-provider | 199 | python | def name(self):
return self._job_name | def name(self):
return self._job_name<|docstring|>Return job name.<|endoftext|> |
8c5f5a4a2526b3fbe87838964ed228c99bf314186a7d1656a3beed09c7f3200a | def data(self):
'Return job data.'
data = super().data()
data['new_field'] = 'foo'
return data | Return job data. | test/fake_account_client.py | data | jwoehr/qiskit-ibmq-provider | 199 | python | def data(self):
data = super().data()
data['new_field'] = 'foo'
return data | def data(self):
data = super().data()
data['new_field'] = 'foo'
return data<|docstring|>Return job data.<|endoftext|> |
50706f5866d5a35f5f758962f10943b795b0b847f411a628232a2a91c7aa962e | def data(self):
'Return job data.'
data = super().data()
del data['job_id']
return data | Return job data. | test/fake_account_client.py | data | jwoehr/qiskit-ibmq-provider | 199 | python | def data(self):
data = super().data()
del data['job_id']
return data | def data(self):
data = super().data()
del data['job_id']
return data<|docstring|>Return job data.<|endoftext|> |
f33605549d84ac194c42b814f1a9c6126642e50c56c59bd48c456c61db9e4176 | def data(self):
'Return job data.'
data = super().data()
if (self.status() == ApiJobStatus.ERROR_RUNNING_JOB):
data['error'] = {'message': 'Job failed.', 'code': 1234}
return data | Return job data. | test/fake_account_client.py | data | jwoehr/qiskit-ibmq-provider | 199 | python | def data(self):
data = super().data()
if (self.status() == ApiJobStatus.ERROR_RUNNING_JOB):
data['error'] = {'message': 'Job failed.', 'code': 1234}
return data | def data(self):
data = super().data()
if (self.status() == ApiJobStatus.ERROR_RUNNING_JOB):
data['error'] = {'message': 'Job failed.', 'code': 1234}
return data<|docstring|>Return job data.<|endoftext|> |
d8e0a22c6f29f825be41b7726d5303806a717fb7ad793c3354eb6a89d171e158 | def __init__(self, job_limit=(- 1), job_class=BaseFakeJob):
'Initialize a fake account client.'
self._jobs = {}
self._results_retrieved = set()
self._job_limit = job_limit
self._executor = ThreadPoolExecutor()
self._job_class = job_class
if isinstance(self._job_class, list):
self._jo... | Initialize a fake account client. | test/fake_account_client.py | __init__ | jwoehr/qiskit-ibmq-provider | 199 | python | def __init__(self, job_limit=(- 1), job_class=BaseFakeJob):
self._jobs = {}
self._results_retrieved = set()
self._job_limit = job_limit
self._executor = ThreadPoolExecutor()
self._job_class = job_class
if isinstance(self._job_class, list):
self._job_class.reverse() | def __init__(self, job_limit=(- 1), job_class=BaseFakeJob):
self._jobs = {}
self._results_retrieved = set()
self._job_limit = job_limit
self._executor = ThreadPoolExecutor()
self._job_class = job_class
if isinstance(self._job_class, list):
self._job_class.reverse()<|docstring|>Initi... |
82398fac2189e16b9c10192f19ecf82d7e1a943ec16ae20b102a44a0b8a4833c | def list_jobs_statuses(self, limit, skip, descending=True, extra_filter=None):
'Return a list of statuses of jobs.'
job_data = []
for job in list(self._jobs.values())[skip:(skip + limit)]:
job_data.append(job.data())
if (not descending):
job_data.reverse()
return job_data | Return a list of statuses of jobs. | test/fake_account_client.py | list_jobs_statuses | jwoehr/qiskit-ibmq-provider | 199 | python | def list_jobs_statuses(self, limit, skip, descending=True, extra_filter=None):
job_data = []
for job in list(self._jobs.values())[skip:(skip + limit)]:
job_data.append(job.data())
if (not descending):
job_data.reverse()
return job_data | def list_jobs_statuses(self, limit, skip, descending=True, extra_filter=None):
job_data = []
for job in list(self._jobs.values())[skip:(skip + limit)]:
job_data.append(job.data())
if (not descending):
job_data.reverse()
return job_data<|docstring|>Return a list of statuses of jobs.<... |
6bdc6cdc5c3ff79547351cf3cac391e6cad98c09dc6a77d13857082353a7cb84 | def job_submit(self, backend_name, qobj_dict, job_name, job_tags, *_args, **_kwargs):
'Submit a Qobj to a device.'
if ((self._job_limit != (- 1)) and (self._unfinished_jobs() >= self._job_limit)):
raise RequestsApiError('400 Client Error: Bad Request for url: <url>. Reached maximum number of concurrent... | Submit a Qobj to a device. | test/fake_account_client.py | job_submit | jwoehr/qiskit-ibmq-provider | 199 | python | def job_submit(self, backend_name, qobj_dict, job_name, job_tags, *_args, **_kwargs):
if ((self._job_limit != (- 1)) and (self._unfinished_jobs() >= self._job_limit)):
raise RequestsApiError('400 Client Error: Bad Request for url: <url>. Reached maximum number of concurrent jobs, Error code: 3458.')
... | def job_submit(self, backend_name, qobj_dict, job_name, job_tags, *_args, **_kwargs):
if ((self._job_limit != (- 1)) and (self._unfinished_jobs() >= self._job_limit)):
raise RequestsApiError('400 Client Error: Bad Request for url: <url>. Reached maximum number of concurrent jobs, Error code: 3458.')
... |
9031da2602ab6df90989c1a06eb115890642013ccbc2131b5867be03b8e639c4 | def job_download_qobj(self, job_id, *_args, **_kwargs):
'Retrieve and return a Qobj.'
return copy.deepcopy(self._get_job(job_id).qobj) | Retrieve and return a Qobj. | test/fake_account_client.py | job_download_qobj | jwoehr/qiskit-ibmq-provider | 199 | python | def job_download_qobj(self, job_id, *_args, **_kwargs):
return copy.deepcopy(self._get_job(job_id).qobj) | def job_download_qobj(self, job_id, *_args, **_kwargs):
return copy.deepcopy(self._get_job(job_id).qobj)<|docstring|>Retrieve and return a Qobj.<|endoftext|> |
8aa2195dcd00ac266b56b183930da04a246b6e8d82b98b32a7661d2586d217d7 | def job_result(self, job_id, *_args, **_kwargs):
'Return a random job result.'
if (job_id in self._results_retrieved):
raise ValueError('Result already retrieved for job {}!'.format(job_id))
self._results_retrieved.add(job_id)
return self._get_job(job_id).result() | Return a random job result. | test/fake_account_client.py | job_result | jwoehr/qiskit-ibmq-provider | 199 | python | def job_result(self, job_id, *_args, **_kwargs):
if (job_id in self._results_retrieved):
raise ValueError('Result already retrieved for job {}!'.format(job_id))
self._results_retrieved.add(job_id)
return self._get_job(job_id).result() | def job_result(self, job_id, *_args, **_kwargs):
if (job_id in self._results_retrieved):
raise ValueError('Result already retrieved for job {}!'.format(job_id))
self._results_retrieved.add(job_id)
return self._get_job(job_id).result()<|docstring|>Return a random job result.<|endoftext|> |
d856f4c6950da0b2ddc6ff7cf19281c656c89ff05117721284f05ddbae863089 | def job_get(self, job_id, *_args, **_kwargs):
'Return information about a job.'
return self._get_job(job_id).data() | Return information about a job. | test/fake_account_client.py | job_get | jwoehr/qiskit-ibmq-provider | 199 | python | def job_get(self, job_id, *_args, **_kwargs):
return self._get_job(job_id).data() | def job_get(self, job_id, *_args, **_kwargs):
return self._get_job(job_id).data()<|docstring|>Return information about a job.<|endoftext|> |
c7585b62c276fb09a7e8df066a82ccc8d79718d3d297009887b071b7988a2011 | def job_status(self, job_id, *_args, **_kwargs):
'Return the status of a job.'
return {'status': self._get_job(job_id).status().value} | Return the status of a job. | test/fake_account_client.py | job_status | jwoehr/qiskit-ibmq-provider | 199 | python | def job_status(self, job_id, *_args, **_kwargs):
return {'status': self._get_job(job_id).status().value} | def job_status(self, job_id, *_args, **_kwargs):
return {'status': self._get_job(job_id).status().value}<|docstring|>Return the status of a job.<|endoftext|> |
f937be69afbbd276396a3b36d1825c4ad1ebd022ca81132885c1f31d765a8c68 | def job_final_status(self, job_id, *_args, **_kwargs):
'Wait until the job progress to a final state.'
job = self._get_job(job_id)
status = job.status()
while (status not in API_JOB_FINAL_STATES):
time.sleep(0.5)
status = job.status()
if _kwargs.get('status_queue', None):
... | Wait until the job progress to a final state. | test/fake_account_client.py | job_final_status | jwoehr/qiskit-ibmq-provider | 199 | python | def job_final_status(self, job_id, *_args, **_kwargs):
job = self._get_job(job_id)
status = job.status()
while (status not in API_JOB_FINAL_STATES):
time.sleep(0.5)
status = job.status()
if _kwargs.get('status_queue', None):
data = {'status': status.value}
... | def job_final_status(self, job_id, *_args, **_kwargs):
job = self._get_job(job_id)
status = job.status()
while (status not in API_JOB_FINAL_STATES):
time.sleep(0.5)
status = job.status()
if _kwargs.get('status_queue', None):
data = {'status': status.value}
... |
a185881baedff00626b4bba40ade263d2729a7146a34b99db7e89b2d98a97c29 | def job_properties(self, *_args, **_kwargs):
'Return the backend properties of a job.'
return FakePoughkeepsie().properties() | Return the backend properties of a job. | test/fake_account_client.py | job_properties | jwoehr/qiskit-ibmq-provider | 199 | python | def job_properties(self, *_args, **_kwargs):
return FakePoughkeepsie().properties() | def job_properties(self, *_args, **_kwargs):
return FakePoughkeepsie().properties()<|docstring|>Return the backend properties of a job.<|endoftext|> |
db0e811ad3b3e3220e281db1c15b99c9a7847bebea37fa06a6c6997744566dd8 | def job_cancel(self, job_id, *_args, **_kwargs):
'Submit a request for cancelling a job.'
self._get_job(job_id).cancel()
return {'cancelled': True} | Submit a request for cancelling a job. | test/fake_account_client.py | job_cancel | jwoehr/qiskit-ibmq-provider | 199 | python | def job_cancel(self, job_id, *_args, **_kwargs):
self._get_job(job_id).cancel()
return {'cancelled': True} | def job_cancel(self, job_id, *_args, **_kwargs):
self._get_job(job_id).cancel()
return {'cancelled': True}<|docstring|>Submit a request for cancelling a job.<|endoftext|> |
ac0fe8769945c650da40d16f774d350c7dd5940ac9cfce67ea93376547957582 | def backend_job_limit(self, *_args, **_kwargs):
'Return the job limit for the backend.'
return {'maximumJobs': self._job_limit, 'runningJobs': self._unfinished_jobs()} | Return the job limit for the backend. | test/fake_account_client.py | backend_job_limit | jwoehr/qiskit-ibmq-provider | 199 | python | def backend_job_limit(self, *_args, **_kwargs):
return {'maximumJobs': self._job_limit, 'runningJobs': self._unfinished_jobs()} | def backend_job_limit(self, *_args, **_kwargs):
return {'maximumJobs': self._job_limit, 'runningJobs': self._unfinished_jobs()}<|docstring|>Return the job limit for the backend.<|endoftext|> |
290ad6d2c10f6d8e9c0aa13ddea91798208a67a498b38086e101134047e9096a | def job_update_attribute(self, job_id, attr_name, attr_value, *_args, **_kwargs):
'Update the specified job attribute with the given value.'
job = self._get_job(job_id)
if (attr_name == 'name'):
job._job_name = attr_value
if (attr_name == 'tags'):
job._job_tags = attr_value.copy()
re... | Update the specified job attribute with the given value. | test/fake_account_client.py | job_update_attribute | jwoehr/qiskit-ibmq-provider | 199 | python | def job_update_attribute(self, job_id, attr_name, attr_value, *_args, **_kwargs):
job = self._get_job(job_id)
if (attr_name == 'name'):
job._job_name = attr_value
if (attr_name == 'tags'):
job._job_tags = attr_value.copy()
return {attr_name: attr_value} | def job_update_attribute(self, job_id, attr_name, attr_value, *_args, **_kwargs):
job = self._get_job(job_id)
if (attr_name == 'name'):
job._job_name = attr_value
if (attr_name == 'tags'):
job._job_tags = attr_value.copy()
return {attr_name: attr_value}<|docstring|>Update the specif... |
ef5cefbac515a4f7db2a52aef51ad469c53c2da2dd36226854e569e451ba3a50 | def tear_down(self):
'Clean up job threads.'
for job_id in list(self._jobs.keys()):
try:
self._jobs[job_id].cancel()
except KeyError:
pass | Clean up job threads. | test/fake_account_client.py | tear_down | jwoehr/qiskit-ibmq-provider | 199 | python | def tear_down(self):
for job_id in list(self._jobs.keys()):
try:
self._jobs[job_id].cancel()
except KeyError:
pass | def tear_down(self):
for job_id in list(self._jobs.keys()):
try:
self._jobs[job_id].cancel()
except KeyError:
pass<|docstring|>Clean up job threads.<|endoftext|> |
59252f40e16571e58e1b8673f9cfc54236b11f203cd013eb4ce7ede44d418e27 | def _unfinished_jobs(self):
'Return the number of unfinished jobs.'
return sum((1 for job in self._jobs.values() if (job.status() not in API_JOB_FINAL_STATES))) | Return the number of unfinished jobs. | test/fake_account_client.py | _unfinished_jobs | jwoehr/qiskit-ibmq-provider | 199 | python | def _unfinished_jobs(self):
return sum((1 for job in self._jobs.values() if (job.status() not in API_JOB_FINAL_STATES))) | def _unfinished_jobs(self):
return sum((1 for job in self._jobs.values() if (job.status() not in API_JOB_FINAL_STATES)))<|docstring|>Return the number of unfinished jobs.<|endoftext|> |
e7e6312c71d29353e63e277291e3dbb45892ccf0a8e3ce151127244f9f41e169 | def _get_job(self, job_id):
'Return job if found.'
if (job_id not in self._jobs):
raise RequestsApiError('Job not found. Error code: 3250.')
return self._jobs[job_id] | Return job if found. | test/fake_account_client.py | _get_job | jwoehr/qiskit-ibmq-provider | 199 | python | def _get_job(self, job_id):
if (job_id not in self._jobs):
raise RequestsApiError('Job not found. Error code: 3250.')
return self._jobs[job_id] | def _get_job(self, job_id):
if (job_id not in self._jobs):
raise RequestsApiError('Job not found. Error code: 3250.')
return self._jobs[job_id]<|docstring|>Return job if found.<|endoftext|> |
06c5b4d8e4283b6b7c457e2491433ef38eeabeb8021415c725518e169a8fe570 | def __init__(self, max_fail_count=(- 1)):
'JobSubmitFailClient constructor.'
self._fail_count = max_fail_count
super().__init__() | JobSubmitFailClient constructor. | test/fake_account_client.py | __init__ | jwoehr/qiskit-ibmq-provider | 199 | python | def __init__(self, max_fail_count=(- 1)):
self._fail_count = max_fail_count
super().__init__() | def __init__(self, max_fail_count=(- 1)):
self._fail_count = max_fail_count
super().__init__()<|docstring|>JobSubmitFailClient constructor.<|endoftext|> |
c27110a172142b3f26aed663070531ae767e10e414b9741f5c19d6c9bf99cf68 | def job_submit(self, *_args, **_kwargs):
'Failing job submit.'
if (self._fail_count != 0):
self._fail_count -= 1
raise RequestsApiError('Job submit failed!')
return super().job_submit(*_args, **_kwargs) | Failing job submit. | test/fake_account_client.py | job_submit | jwoehr/qiskit-ibmq-provider | 199 | python | def job_submit(self, *_args, **_kwargs):
if (self._fail_count != 0):
self._fail_count -= 1
raise RequestsApiError('Job submit failed!')
return super().job_submit(*_args, **_kwargs) | def job_submit(self, *_args, **_kwargs):
if (self._fail_count != 0):
self._fail_count -= 1
raise RequestsApiError('Job submit failed!')
return super().job_submit(*_args, **_kwargs)<|docstring|>Failing job submit.<|endoftext|> |
4a7dc3470947496bbcc219b8fa82af67fbb213e97bae13bff5b7102ece3aeef4 | def __init__(self, *args, max_fail_count=(- 1), **kwargs):
'JobTimeoutClient constructor.'
self._fail_count = max_fail_count
super().__init__(*args, **kwargs) | JobTimeoutClient constructor. | test/fake_account_client.py | __init__ | jwoehr/qiskit-ibmq-provider | 199 | python | def __init__(self, *args, max_fail_count=(- 1), **kwargs):
self._fail_count = max_fail_count
super().__init__(*args, **kwargs) | def __init__(self, *args, max_fail_count=(- 1), **kwargs):
self._fail_count = max_fail_count
super().__init__(*args, **kwargs)<|docstring|>JobTimeoutClient constructor.<|endoftext|> |
be725bbcdd80f862edabc14afc3f5fee5b945ede789f181ca59258536cebbb95 | def job_final_status(self, job_id, *_args, **_kwargs):
'Wait until the job progress to a final state.'
if (self._fail_count != 0):
self._fail_count -= 1
raise UserTimeoutExceededError('Job timed out!')
return super().job_final_status(job_id, *_args, **_kwargs) | Wait until the job progress to a final state. | test/fake_account_client.py | job_final_status | jwoehr/qiskit-ibmq-provider | 199 | python | def job_final_status(self, job_id, *_args, **_kwargs):
if (self._fail_count != 0):
self._fail_count -= 1
raise UserTimeoutExceededError('Job timed out!')
return super().job_final_status(job_id, *_args, **_kwargs) | def job_final_status(self, job_id, *_args, **_kwargs):
if (self._fail_count != 0):
self._fail_count -= 1
raise UserTimeoutExceededError('Job timed out!')
return super().job_final_status(job_id, *_args, **_kwargs)<|docstring|>Wait until the job progress to a final state.<|endoftext|> |
6ef4a166a0b64f8f408f5077ee1b958a0d7edc5bce3d3d9b693f43ac5347a37f | def get_quotes():
'\n function that gets the json response from the base url\n '
with urllib.request.urlopen(base_url) as url:
data = url.read()
response = json.loads(data)
results = process_quote(response)
return results | function that gets the json response from the base url | blog/request.py | get_quotes | petermirithu/blog_site | 0 | python | def get_quotes():
'\n \n '
with urllib.request.urlopen(base_url) as url:
data = url.read()
response = json.loads(data)
results = process_quote(response)
return results | def get_quotes():
'\n \n '
with urllib.request.urlopen(base_url) as url:
data = url.read()
response = json.loads(data)
results = process_quote(response)
return results<|docstring|>function that gets the json response from the base url<|endoftext|> |
41a4249abca8fbe5d53bf15727143b4c5668d8aabea31e071ce102986d22b925 | def process_quote(item):
'\n function that processes the response from json format\n '
results = []
author = item.get('author')
quote = item.get('quote')
quote_object = Quote(author, quote)
results.append(quote_object)
return results | function that processes the response from json format | blog/request.py | process_quote | petermirithu/blog_site | 0 | python | def process_quote(item):
'\n \n '
results = []
author = item.get('author')
quote = item.get('quote')
quote_object = Quote(author, quote)
results.append(quote_object)
return results | def process_quote(item):
'\n \n '
results = []
author = item.get('author')
quote = item.get('quote')
quote_object = Quote(author, quote)
results.append(quote_object)
return results<|docstring|>function that processes the response from json format<|endoftext|> |
e6ae353071262792e6edb2a6d24ed77fab70baa322ed67a364e689e044a94e44 | def kernel_zhao(s, s0=0.08333, theta=0.242):
'\n Calculates Zhao kernel for given value.\n\n :param s: time point to evaluate\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: value at time point s\n '
c0 = ((1.0 / s0) / (1 - (1.0 / (- theta))))
... | Calculates Zhao kernel for given value.
:param s: time point to evaluate
:param s0: initial reaction time
:param theta: empirically determined constant
:return: value at time point s | tideh/functions.py | kernel_zhao | sebaruehl/TiDeH | 0 | python | def kernel_zhao(s, s0=0.08333, theta=0.242):
'\n Calculates Zhao kernel for given value.\n\n :param s: time point to evaluate\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: value at time point s\n '
c0 = ((1.0 / s0) / (1 - (1.0 / (- theta))))
... | def kernel_zhao(s, s0=0.08333, theta=0.242):
'\n Calculates Zhao kernel for given value.\n\n :param s: time point to evaluate\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: value at time point s\n '
c0 = ((1.0 / s0) / (1 - (1.0 / (- theta))))
... |
56a686165733a9d1b52bbf74bfe0a280bda82cf45b5282f221235e12821c0288 | def kernel_zhao_vec(s, s0=0.08333, theta=0.242):
'\n Calculates Zhao kernel for given value.\n Optimized using nd-arrays and vectorization.\n\n :param s: time points to evaluate, should be a nd-array\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: valu... | Calculates Zhao kernel for given value.
Optimized using nd-arrays and vectorization.
:param s: time points to evaluate, should be a nd-array
:param s0: initial reaction time
:param theta: empirically determined constant
:return: values at given time points | tideh/functions.py | kernel_zhao_vec | sebaruehl/TiDeH | 0 | python | def kernel_zhao_vec(s, s0=0.08333, theta=0.242):
'\n Calculates Zhao kernel for given value.\n Optimized using nd-arrays and vectorization.\n\n :param s: time points to evaluate, should be a nd-array\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: valu... | def kernel_zhao_vec(s, s0=0.08333, theta=0.242):
'\n Calculates Zhao kernel for given value.\n Optimized using nd-arrays and vectorization.\n\n :param s: time points to evaluate, should be a nd-array\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: valu... |
66fe2176b748fabb50b0ba8d2d9d136c0bc6f325d7925b8074c37ec33da2bc95 | def kernel_primitive_zhao(x, s0=0.08333, theta=0.242):
'\n Calculates the primitive of the Zhao kernel for given values.\n\n :param x: point to evaluate\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: primitive evaluated at x\n '
c0 = ((1.0 / s0) /... | Calculates the primitive of the Zhao kernel for given values.
:param x: point to evaluate
:param s0: initial reaction time
:param theta: empirically determined constant
:return: primitive evaluated at x | tideh/functions.py | kernel_primitive_zhao | sebaruehl/TiDeH | 0 | python | def kernel_primitive_zhao(x, s0=0.08333, theta=0.242):
'\n Calculates the primitive of the Zhao kernel for given values.\n\n :param x: point to evaluate\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: primitive evaluated at x\n '
c0 = ((1.0 / s0) /... | def kernel_primitive_zhao(x, s0=0.08333, theta=0.242):
'\n Calculates the primitive of the Zhao kernel for given values.\n\n :param x: point to evaluate\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: primitive evaluated at x\n '
c0 = ((1.0 / s0) /... |
f453187073d70bb3c91c14634e0efe33605e0dba44ec3d2f839abc190f0a3d1c | def kernel_primitive_zhao_vec(x, s0=0.08333, theta=0.242):
'\n Calculates the primitive of the Zhao kernel for given values.\n Optimized using nd-arrays and vectorization.\n\n :param x: points to evaluate, should be a nd-array\n :param s0: initial reaction time\n :param theta: empirically determined ... | Calculates the primitive of the Zhao kernel for given values.
Optimized using nd-arrays and vectorization.
:param x: points to evaluate, should be a nd-array
:param s0: initial reaction time
:param theta: empirically determined constant
:param c0: normalization constant
:return: primitives evaluated at given points | tideh/functions.py | kernel_primitive_zhao_vec | sebaruehl/TiDeH | 0 | python | def kernel_primitive_zhao_vec(x, s0=0.08333, theta=0.242):
'\n Calculates the primitive of the Zhao kernel for given values.\n Optimized using nd-arrays and vectorization.\n\n :param x: points to evaluate, should be a nd-array\n :param s0: initial reaction time\n :param theta: empirically determined ... | def kernel_primitive_zhao_vec(x, s0=0.08333, theta=0.242):
'\n Calculates the primitive of the Zhao kernel for given values.\n Optimized using nd-arrays and vectorization.\n\n :param x: points to evaluate, should be a nd-array\n :param s0: initial reaction time\n :param theta: empirically determined ... |
1b4b73e6c79f17c42c85f14bbb31fbbb23196962e37b981d63f43ab903fca7c4 | def integral_zhao(x1, x2, s0=0.08333, theta=0.242):
'\n Calculates definite integral of Zhao function.\n\n :param x1: start\n :param x2: end\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: integral of Zhao function\n '
return (kernel_primitive_z... | Calculates definite integral of Zhao function.
:param x1: start
:param x2: end
:param s0: initial reaction time
:param theta: empirically determined constant
:return: integral of Zhao function | tideh/functions.py | integral_zhao | sebaruehl/TiDeH | 0 | python | def integral_zhao(x1, x2, s0=0.08333, theta=0.242):
'\n Calculates definite integral of Zhao function.\n\n :param x1: start\n :param x2: end\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: integral of Zhao function\n '
return (kernel_primitive_z... | def integral_zhao(x1, x2, s0=0.08333, theta=0.242):
'\n Calculates definite integral of Zhao function.\n\n :param x1: start\n :param x2: end\n :param s0: initial reaction time\n :param theta: empirically determined constant\n :return: integral of Zhao function\n '
return (kernel_primitive_z... |
45d4f18d893a4a471a7e89977963e0e251fc1298817773bf6cf00a9f034b76a0 | def integral_zhao_vec(x1, x2, s0=0.08333, theta=0.242):
'\n Calculates definite integral of Zhao function.\n Optimized using nd-arrays and vectorization.\n\n x1 and x2 should be nd-arrays of same size.\n\n :param x1: start values\n :param x2: end values\n :param s0: initial reaction time\n :par... | Calculates definite integral of Zhao function.
Optimized using nd-arrays and vectorization.
x1 and x2 should be nd-arrays of same size.
:param x1: start values
:param x2: end values
:param s0: initial reaction time
:param theta: empirically determined constant
:return: integrals of Zhao function | tideh/functions.py | integral_zhao_vec | sebaruehl/TiDeH | 0 | python | def integral_zhao_vec(x1, x2, s0=0.08333, theta=0.242):
'\n Calculates definite integral of Zhao function.\n Optimized using nd-arrays and vectorization.\n\n x1 and x2 should be nd-arrays of same size.\n\n :param x1: start values\n :param x2: end values\n :param s0: initial reaction time\n :par... | def integral_zhao_vec(x1, x2, s0=0.08333, theta=0.242):
'\n Calculates definite integral of Zhao function.\n Optimized using nd-arrays and vectorization.\n\n x1 and x2 should be nd-arrays of same size.\n\n :param x1: start values\n :param x2: end values\n :param s0: initial reaction time\n :par... |
8da6ba90113d86be0ceb56ae4ed72bc90a5a4046b019e071849117832e14c0ed | def infectious_rate_tweets(t, p0=0.001, r0=0.424, phi0=0.125, taum=2.0, t0=0, tm=24, bounds=None):
'\n Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bounds should be passed as an array\n in the form of [(lower r0, lower taum), (upper r0, upper taum)].\n Converted to hours... | Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bounds should be passed as an array
in the form of [(lower r0, lower taum), (upper r0, upper taum)].
Converted to hours.
:param t: point to evaluate function at (in hours)
:param p0: base rate
:param r0: amplitude
:param phi0: shift (in d... | tideh/functions.py | infectious_rate_tweets | sebaruehl/TiDeH | 0 | python | def infectious_rate_tweets(t, p0=0.001, r0=0.424, phi0=0.125, taum=2.0, t0=0, tm=24, bounds=None):
'\n Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bounds should be passed as an array\n in the form of [(lower r0, lower taum), (upper r0, upper taum)].\n Converted to hours... | def infectious_rate_tweets(t, p0=0.001, r0=0.424, phi0=0.125, taum=2.0, t0=0, tm=24, bounds=None):
'\n Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bounds should be passed as an array\n in the form of [(lower r0, lower taum), (upper r0, upper taum)].\n Converted to hours... |
cb51467bc9cd8c8401e8e8005c91db46ac03e376ef1ef12278ba3ab2489eedb3 | def infectious_rate_tweets_vec(t, p0=0.001, r0=0.424, phi0=0.125, taum=2.0, t0=0, tm=24.0, bounds=None):
'\n Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bound should be passed as an array\n in the form of [(lower r0, lower taum), (upper r0, upper taum)].\n Converted to ... | Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bound should be passed as an array
in the form of [(lower r0, lower taum), (upper r0, upper taum)].
Converted to hours.
Vectorized version.
:param t: points to evaluate function at, should be a nd-array (in hours)
:param p0: base rate
:pa... | tideh/functions.py | infectious_rate_tweets_vec | sebaruehl/TiDeH | 0 | python | def infectious_rate_tweets_vec(t, p0=0.001, r0=0.424, phi0=0.125, taum=2.0, t0=0, tm=24.0, bounds=None):
'\n Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bound should be passed as an array\n in the form of [(lower r0, lower taum), (upper r0, upper taum)].\n Converted to ... | def infectious_rate_tweets_vec(t, p0=0.001, r0=0.424, phi0=0.125, taum=2.0, t0=0, tm=24.0, bounds=None):
'\n Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bound should be passed as an array\n in the form of [(lower r0, lower taum), (upper r0, upper taum)].\n Converted to ... |
e099e83d297d7eff4cfa4a2ddb3441e3bf4c71ecbd4fffb2c10cf9fac909903b | def infectious_rate_dv_p0(t, r0=0.424, phi0=0.125, taum=2.0, t0=0, tm=24.0):
'\n Derivation of infectious rate after p0.\n\n Required for direct maximum likelihood estimation.\n\n :param t: points to evaluate function at, shoult be nd-arrays (in hours)\n :param r0: amplitude\n :param phi0: shift (i... | Derivation of infectious rate after p0.
Required for direct maximum likelihood estimation.
:param t: points to evaluate function at, shoult be nd-arrays (in hours)
:param r0: amplitude
:param phi0: shift (in days)
:param taum: decay/freshness (in days)
:param t0: start time of observation (in hours)
:param tm: cyc... | tideh/functions.py | infectious_rate_dv_p0 | sebaruehl/TiDeH | 0 | python | def infectious_rate_dv_p0(t, r0=0.424, phi0=0.125, taum=2.0, t0=0, tm=24.0):
'\n Derivation of infectious rate after p0.\n\n Required for direct maximum likelihood estimation.\n\n :param t: points to evaluate function at, shoult be nd-arrays (in hours)\n :param r0: amplitude\n :param phi0: shift (i... | def infectious_rate_dv_p0(t, r0=0.424, phi0=0.125, taum=2.0, t0=0, tm=24.0):
'\n Derivation of infectious rate after p0.\n\n Required for direct maximum likelihood estimation.\n\n :param t: points to evaluate function at, shoult be nd-arrays (in hours)\n :param r0: amplitude\n :param phi0: shift (i... |
c41601ec166ab822e27d8f57bd1ba57d74a9b7aa37d29cdd199a327085d59cbf | def sigmoid(x):
'\n Calculates sigmoid function for value x.\n '
return (1 / (1 + exp((- x)))) | Calculates sigmoid function for value x. | tideh/functions.py | sigmoid | sebaruehl/TiDeH | 0 | python | def sigmoid(x):
'\n \n '
return (1 / (1 + exp((- x)))) | def sigmoid(x):
'\n \n '
return (1 / (1 + exp((- x))))<|docstring|>Calculates sigmoid function for value x.<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.