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 |
|---|---|---|---|---|---|---|---|---|---|
ce096b8206ec721b75aa8a2c5c07476db1d7abdad035f84e51727ff30e7a931e | def rotate_logs(self):
'\n Force log rotation on all clients\n '
def _force_log_rotation_on_client(client):
logger.info('Forcing log rotation on client {}'.format(client.name))
client.force_log_rotation()
funcs = list()
args = list()
for client in self.clients:
... | Force log rotation on all clients | qalib/preflight.py | rotate_logs | Datera/datera-automation-toolkit | 0 | python | def rotate_logs(self):
'\n \n '
def _force_log_rotation_on_client(client):
logger.info('Forcing log rotation on client {}'.format(client.name))
client.force_log_rotation()
funcs = list()
args = list()
for client in self.clients:
funcs.append(_force_log_rotation... | def rotate_logs(self):
'\n \n '
def _force_log_rotation_on_client(client):
logger.info('Forcing log rotation on client {}'.format(client.name))
client.force_log_rotation()
funcs = list()
args = list()
for client in self.clients:
funcs.append(_force_log_rotation... |
b293e135663d6e9e158ddfb3bb5a3bacc1b2ba1ffa7a5253e69461a9a270cc10 | def ensure_cluster_ready(self):
'\n Run cluster health-checks required before beginning testing\n '
logger.info('Waiting for all nodes to be online')
self.cluster_util.health.wait_for_all_nodes_online()
logger.info('Running network diagnostics')
checks = ['interfaces', 'ntp']
for c... | Run cluster health-checks required before beginning testing | qalib/preflight.py | ensure_cluster_ready | Datera/datera-automation-toolkit | 0 | python | def ensure_cluster_ready(self):
'\n \n '
logger.info('Waiting for all nodes to be online')
self.cluster_util.health.wait_for_all_nodes_online()
logger.info('Running network diagnostics')
checks = ['interfaces', 'ntp']
for check in checks:
if (not check_cluster_config_passes... | def ensure_cluster_ready(self):
'\n \n '
logger.info('Waiting for all nodes to be online')
self.cluster_util.health.wait_for_all_nodes_online()
logger.info('Running network diagnostics')
checks = ['interfaces', 'ntp']
for check in checks:
if (not check_cluster_config_passes... |
58b9f6922e35d7a26e057d01c2dfcaa17fe09384fb89812a5f6c1614ef82f538 | @signal_base.function
def linear_interp_basis_chromatic(toas, freqs, dt=(30 * 86400), idx=4):
'Linear interpolation basis in time with nu^-4 scaling'
(U, avetoas) = utils.linear_interp_basis(toas, dt=dt)
Dm = ((1400 / freqs) ** idx)
return ((U * Dm[(:, None)]), avetoas) | Linear interpolation basis in time with nu^-4 scaling | enterprise_extensions/gp_kernels.py | linear_interp_basis_chromatic | achalumeau/enterprise_extensions | 16 | python | @signal_base.function
def linear_interp_basis_chromatic(toas, freqs, dt=(30 * 86400), idx=4):
(U, avetoas) = utils.linear_interp_basis(toas, dt=dt)
Dm = ((1400 / freqs) ** idx)
return ((U * Dm[(:, None)]), avetoas) | @signal_base.function
def linear_interp_basis_chromatic(toas, freqs, dt=(30 * 86400), idx=4):
(U, avetoas) = utils.linear_interp_basis(toas, dt=dt)
Dm = ((1400 / freqs) ** idx)
return ((U * Dm[(:, None)]), avetoas)<|docstring|>Linear interpolation basis in time with nu^-4 scaling<|endoftext|> |
3428aa1f8a59518b79f53e8937577c3c665c310a956c26fa8a0c3e0bbeebceca | @signal_base.function
def linear_interp_basis_freq(freqs, df=64):
'Linear interpolation in radio frequency'
return utils.linear_interp_basis(freqs, dt=df) | Linear interpolation in radio frequency | enterprise_extensions/gp_kernels.py | linear_interp_basis_freq | achalumeau/enterprise_extensions | 16 | python | @signal_base.function
def linear_interp_basis_freq(freqs, df=64):
return utils.linear_interp_basis(freqs, dt=df) | @signal_base.function
def linear_interp_basis_freq(freqs, df=64):
return utils.linear_interp_basis(freqs, dt=df)<|docstring|>Linear interpolation in radio frequency<|endoftext|> |
16a74ddfd178e11a2dd2eef0f54525f05fec40189847cf2757c4641819f5bae8 | @signal_base.function
def dmx_ridge_prior(avetoas, log10_sigma=(- 7)):
'DMX-like signal with Gaussian prior'
sigma = (10 ** log10_sigma)
return ((sigma ** 2) * np.ones_like(avetoas)) | DMX-like signal with Gaussian prior | enterprise_extensions/gp_kernels.py | dmx_ridge_prior | achalumeau/enterprise_extensions | 16 | python | @signal_base.function
def dmx_ridge_prior(avetoas, log10_sigma=(- 7)):
sigma = (10 ** log10_sigma)
return ((sigma ** 2) * np.ones_like(avetoas)) | @signal_base.function
def dmx_ridge_prior(avetoas, log10_sigma=(- 7)):
sigma = (10 ** log10_sigma)
return ((sigma ** 2) * np.ones_like(avetoas))<|docstring|>DMX-like signal with Gaussian prior<|endoftext|> |
c8e86aa36237006e2f39cdaddd6eb8b8b8287b97a30eddf87205ed3c345e1956 | @signal_base.function
def periodic_kernel(avetoas, log10_sigma=(- 7), log10_ell=2, log10_gam_p=0, log10_p=0):
'Quasi-periodic kernel for DM'
r = np.abs((avetoas[(None, :)] - avetoas[(:, None)]))
sigma = (10 ** log10_sigma)
l = ((10 ** log10_ell) * 86400)
p = ((10 ** log10_p) * 31600000.0)
gam_p ... | Quasi-periodic kernel for DM | enterprise_extensions/gp_kernels.py | periodic_kernel | achalumeau/enterprise_extensions | 16 | python | @signal_base.function
def periodic_kernel(avetoas, log10_sigma=(- 7), log10_ell=2, log10_gam_p=0, log10_p=0):
r = np.abs((avetoas[(None, :)] - avetoas[(:, None)]))
sigma = (10 ** log10_sigma)
l = ((10 ** log10_ell) * 86400)
p = ((10 ** log10_p) * 31600000.0)
gam_p = (10 ** log10_gam_p)
d = ... | @signal_base.function
def periodic_kernel(avetoas, log10_sigma=(- 7), log10_ell=2, log10_gam_p=0, log10_p=0):
r = np.abs((avetoas[(None, :)] - avetoas[(:, None)]))
sigma = (10 ** log10_sigma)
l = ((10 ** log10_ell) * 86400)
p = ((10 ** log10_p) * 31600000.0)
gam_p = (10 ** log10_gam_p)
d = ... |
e8b9e43e9804e35d007f33494975fc9f57bf602ecb1c0c2480d3c7bb51decc15 | @signal_base.function
def se_kernel(avefreqs, log10_sigma=(- 7), log10_lam=3):
'Squared-exponential kernel for FD'
tm = np.abs((avefreqs[(None, :)] - avefreqs[(:, None)]))
lam = (10 ** log10_lam)
sigma = (10 ** log10_sigma)
d = (np.eye(tm.shape[0]) * ((sigma / 500) ** 2))
return (((sigma ** 2) *... | Squared-exponential kernel for FD | enterprise_extensions/gp_kernels.py | se_kernel | achalumeau/enterprise_extensions | 16 | python | @signal_base.function
def se_kernel(avefreqs, log10_sigma=(- 7), log10_lam=3):
tm = np.abs((avefreqs[(None, :)] - avefreqs[(:, None)]))
lam = (10 ** log10_lam)
sigma = (10 ** log10_sigma)
d = (np.eye(tm.shape[0]) * ((sigma / 500) ** 2))
return (((sigma ** 2) * np.exp((((- (tm ** 2)) / 2) / lam)... | @signal_base.function
def se_kernel(avefreqs, log10_sigma=(- 7), log10_lam=3):
tm = np.abs((avefreqs[(None, :)] - avefreqs[(:, None)]))
lam = (10 ** log10_lam)
sigma = (10 ** log10_sigma)
d = (np.eye(tm.shape[0]) * ((sigma / 500) ** 2))
return (((sigma ** 2) * np.exp((((- (tm ** 2)) / 2) / lam)... |
db0970c133d7050e078fb23e427ffb43a294635f253bdcf70143831bf193d5fc | @signal_base.function
def se_dm_kernel(avetoas, log10_sigma=(- 7), log10_ell=2):
'Squared-exponential kernel for DM'
r = np.abs((avetoas[(None, :)] - avetoas[(:, None)]))
l = ((10 ** log10_ell) * 86400)
sigma = (10 ** log10_sigma)
d = (np.eye(r.shape[0]) * ((sigma / 500) ** 2))
K = (((sigma ** 2... | Squared-exponential kernel for DM | enterprise_extensions/gp_kernels.py | se_dm_kernel | achalumeau/enterprise_extensions | 16 | python | @signal_base.function
def se_dm_kernel(avetoas, log10_sigma=(- 7), log10_ell=2):
r = np.abs((avetoas[(None, :)] - avetoas[(:, None)]))
l = ((10 ** log10_ell) * 86400)
sigma = (10 ** log10_sigma)
d = (np.eye(r.shape[0]) * ((sigma / 500) ** 2))
K = (((sigma ** 2) * np.exp((((- (r ** 2)) / 2) / (l... | @signal_base.function
def se_dm_kernel(avetoas, log10_sigma=(- 7), log10_ell=2):
r = np.abs((avetoas[(None, :)] - avetoas[(:, None)]))
l = ((10 ** log10_ell) * 86400)
sigma = (10 ** log10_sigma)
d = (np.eye(r.shape[0]) * ((sigma / 500) ** 2))
K = (((sigma ** 2) * np.exp((((- (r ** 2)) / 2) / (l... |
1224f6bc11d78ee5ef1718462bda8fa44d44979786c29a5cca7309263439b0f4 | @signal_base.function
def get_tf_quantization_matrix(toas, freqs, dt=(30 * 86400), df=None, dm=False, dm_idx=2):
'\n Quantization matrix in time and radio frequency to cut down on the kernel\n size.\n '
if (df is None):
dfs = [(600, 1000), (1000, 1900), (1900, 3000), (3000, 5000)]
else:
... | Quantization matrix in time and radio frequency to cut down on the kernel
size. | enterprise_extensions/gp_kernels.py | get_tf_quantization_matrix | achalumeau/enterprise_extensions | 16 | python | @signal_base.function
def get_tf_quantization_matrix(toas, freqs, dt=(30 * 86400), df=None, dm=False, dm_idx=2):
'\n Quantization matrix in time and radio frequency to cut down on the kernel\n size.\n '
if (df is None):
dfs = [(600, 1000), (1000, 1900), (1900, 3000), (3000, 5000)]
else:
... | @signal_base.function
def get_tf_quantization_matrix(toas, freqs, dt=(30 * 86400), df=None, dm=False, dm_idx=2):
'\n Quantization matrix in time and radio frequency to cut down on the kernel\n size.\n '
if (df is None):
dfs = [(600, 1000), (1000, 1900), (1900, 3000), (3000, 5000)]
else:
... |
7215373439eeb6d7e388830b7d0037fa018060cad6ddef17e765797ca263b9d6 | @signal_base.function
def tf_kernel(labels, log10_sigma=(- 7), log10_ell=2, log10_gam_p=0, log10_p=0, log10_ell2=4, log10_alpha_wgt=0):
'\n The product of a quasi-periodic time kernel and\n a rational-quadratic frequency kernel.\n '
avetoas = labels['avetoas']
avefreqs = labels['avefreqs']
r = ... | The product of a quasi-periodic time kernel and
a rational-quadratic frequency kernel. | enterprise_extensions/gp_kernels.py | tf_kernel | achalumeau/enterprise_extensions | 16 | python | @signal_base.function
def tf_kernel(labels, log10_sigma=(- 7), log10_ell=2, log10_gam_p=0, log10_p=0, log10_ell2=4, log10_alpha_wgt=0):
'\n The product of a quasi-periodic time kernel and\n a rational-quadratic frequency kernel.\n '
avetoas = labels['avetoas']
avefreqs = labels['avefreqs']
r = ... | @signal_base.function
def tf_kernel(labels, log10_sigma=(- 7), log10_ell=2, log10_gam_p=0, log10_p=0, log10_ell2=4, log10_alpha_wgt=0):
'\n The product of a quasi-periodic time kernel and\n a rational-quadratic frequency kernel.\n '
avetoas = labels['avetoas']
avefreqs = labels['avefreqs']
r = ... |
0aabcac41c173400d346ad2d7d392428c740faacf79c34b91b74e921c2056af1 | @signal_base.function
def sf_kernel(labels, log10_sigma=(- 7), log10_ell=2, log10_ell2=4, log10_alpha_wgt=0):
'\n The product of a squared-exponential time kernel and\n a rational-quadratic frequency kernel.\n '
avetoas = labels['avetoas']
avefreqs = labels['avefreqs']
r = np.abs((avetoas[(None... | The product of a squared-exponential time kernel and
a rational-quadratic frequency kernel. | enterprise_extensions/gp_kernels.py | sf_kernel | achalumeau/enterprise_extensions | 16 | python | @signal_base.function
def sf_kernel(labels, log10_sigma=(- 7), log10_ell=2, log10_ell2=4, log10_alpha_wgt=0):
'\n The product of a squared-exponential time kernel and\n a rational-quadratic frequency kernel.\n '
avetoas = labels['avetoas']
avefreqs = labels['avefreqs']
r = np.abs((avetoas[(None... | @signal_base.function
def sf_kernel(labels, log10_sigma=(- 7), log10_ell=2, log10_ell2=4, log10_alpha_wgt=0):
'\n The product of a squared-exponential time kernel and\n a rational-quadratic frequency kernel.\n '
avetoas = labels['avetoas']
avefreqs = labels['avefreqs']
r = np.abs((avetoas[(None... |
cffd3f3b15acb54c836c1029b332b3429f6bb28b419f95a8644dc22c58dedb78 | def test_default_setting(self):
'Tests the logics of the text data.\n '
self._run_and_test(self._hparams) | Tests the logics of the text data. | tests/data/data/multi_aligned_data_test.py | test_default_setting | ZeyaWang/texar-pytorch | 746 | python | def test_default_setting(self):
'\n '
self._run_and_test(self._hparams) | def test_default_setting(self):
'\n '
self._run_and_test(self._hparams)<|docstring|>Tests the logics of the text data.<|endoftext|> |
58dbddd1daa53203bed0ace6b141a67daa159bf127f841a92ef9216fe481023c | def test_length_filter(self):
'Tests filtering by length.\n '
hparams = copy.copy(self._hparams)
hparams['datasets'][0].update({'max_seq_length': 4, 'length_filter_mode': 'discard'})
hparams['datasets'][1].update({'max_seq_length': 2, 'length_filter_mode': 'truncate'})
self._run_and_test(hpar... | Tests filtering by length. | tests/data/data/multi_aligned_data_test.py | test_length_filter | ZeyaWang/texar-pytorch | 746 | python | def test_length_filter(self):
'\n '
hparams = copy.copy(self._hparams)
hparams['datasets'][0].update({'max_seq_length': 4, 'length_filter_mode': 'discard'})
hparams['datasets'][1].update({'max_seq_length': 2, 'length_filter_mode': 'truncate'})
self._run_and_test(hparams, discard_index=0) | def test_length_filter(self):
'\n '
hparams = copy.copy(self._hparams)
hparams['datasets'][0].update({'max_seq_length': 4, 'length_filter_mode': 'discard'})
hparams['datasets'][1].update({'max_seq_length': 2, 'length_filter_mode': 'truncate'})
self._run_and_test(hparams, discard_index=0)<|doc... |
4d99d05accfd389ac836166923be776e0e1cd2437c8d9881697858959b4bb846 | def test_supported_scalar_types(self):
'Tests scalar types supported in MultiAlignedData.'
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'int64'})
self._run_and_test(hparams)
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'float'})... | Tests scalar types supported in MultiAlignedData. | tests/data/data/multi_aligned_data_test.py | test_supported_scalar_types | ZeyaWang/texar-pytorch | 746 | python | def test_supported_scalar_types(self):
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'int64'})
self._run_and_test(hparams)
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'float'})
self._run_and_test(hparams)
hparams = copy... | def test_supported_scalar_types(self):
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'int64'})
self._run_and_test(hparams)
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'float'})
self._run_and_test(hparams)
hparams = copy... |
6b8c97b01067f1f22664b71de7c7275e9afaab4c10d0fec5aa9db6e1e73d25be | def test_unsupported_scalar_types(self):
'Tests if exception is thrown for unsupported types.'
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'XYZ'})
with self.assertRaises(ValueError):
self._run_and_test(hparams)
hparams = copy.copy(self._hparams)
hparams... | Tests if exception is thrown for unsupported types. | tests/data/data/multi_aligned_data_test.py | test_unsupported_scalar_types | ZeyaWang/texar-pytorch | 746 | python | def test_unsupported_scalar_types(self):
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'XYZ'})
with self.assertRaises(ValueError):
self._run_and_test(hparams)
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'str'})
with... | def test_unsupported_scalar_types(self):
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'XYZ'})
with self.assertRaises(ValueError):
self._run_and_test(hparams)
hparams = copy.copy(self._hparams)
hparams['datasets'][3].update({'data_type': 'str'})
with... |
585c810a326936e6cc8a64a74af5cdd2ebc3c69c6ae7a10a3880e35a72c9a6e3 | def write_statset_to_s3(stat_set: OpennemDataSet, file_path: str, exclude: set=None, exclude_unset: bool=False) -> int:
'\n Write an Opennem data set to an s3 bucket using boto\n '
s3_save_path = urljoin(f'https://{settings.s3_bucket_path}', file_path)
if file_path.startswith('/'):
file_path =... | Write an Opennem data set to an s3 bucket using boto | opennem/exporter/aws.py | write_statset_to_s3 | bje-/opennem | 22 | python | def write_statset_to_s3(stat_set: OpennemDataSet, file_path: str, exclude: set=None, exclude_unset: bool=False) -> int:
'\n \n '
s3_save_path = urljoin(f'https://{settings.s3_bucket_path}', file_path)
if file_path.startswith('/'):
file_path = file_path[1:]
if (not settings.s3_bucket_path):... | def write_statset_to_s3(stat_set: OpennemDataSet, file_path: str, exclude: set=None, exclude_unset: bool=False) -> int:
'\n \n '
s3_save_path = urljoin(f'https://{settings.s3_bucket_path}', file_path)
if file_path.startswith('/'):
file_path = file_path[1:]
if (not settings.s3_bucket_path):... |
68d505c051c7bc93f997712aa74977fdaf0f3d2ba1f92d689acc47db643ccee0 | def write_to_s3(content: str, file_path: str, content_type: str='application/json') -> int:
'\n Write a string to s3\n '
s3_save_path = urljoin(f'https://{settings.s3_bucket_path}', file_path)
if file_path.startswith('/'):
file_path = file_path[1:]
if (not settings.s3_bucket_path):
... | Write a string to s3 | opennem/exporter/aws.py | write_to_s3 | bje-/opennem | 22 | python | def write_to_s3(content: str, file_path: str, content_type: str='application/json') -> int:
'\n \n '
s3_save_path = urljoin(f'https://{settings.s3_bucket_path}', file_path)
if file_path.startswith('/'):
file_path = file_path[1:]
if (not settings.s3_bucket_path):
raise Exception('Re... | def write_to_s3(content: str, file_path: str, content_type: str='application/json') -> int:
'\n \n '
s3_save_path = urljoin(f'https://{settings.s3_bucket_path}', file_path)
if file_path.startswith('/'):
file_path = file_path[1:]
if (not settings.s3_bucket_path):
raise Exception('Re... |
021df862609d05475d78bc368fdb569b3fc3ad9c320a0b0844c85baeb6034127 | def __init__(self, options={}):
'\n Initialize OpenGraphIO instance with required app_id.\n '
if ('app_id' not in options):
raise KeyError('app_id must be supplied when making requests to the API. Get a free app_id by signing up here: https://www.opengraph.io/')
self.app_id = options['... | Initialize OpenGraphIO instance with required app_id. | opengraphio/opengraphio.py | __init__ | wbdana/opengraph-io-python | 1 | python | def __init__(self, options={}):
'\n \n '
if ('app_id' not in options):
raise KeyError('app_id must be supplied when making requests to the API. Get a free app_id by signing up here: https://www.opengraph.io/')
self.app_id = options['app_id']
self.cache_ok = (options['cache_ok'] if ... | def __init__(self, options={}):
'\n \n '
if ('app_id' not in options):
raise KeyError('app_id must be supplied when making requests to the API. Get a free app_id by signing up here: https://www.opengraph.io/')
self.app_id = options['app_id']
self.cache_ok = (options['cache_ok'] if ... |
28133f732a0be22de479de1c4ca804c4270fd49d3f81730943326801a86e735b | def get_site_info_url(self, url, options={}):
'\n Build the request URL.\n '
version = (options['version'] if ('version' in options) else self.version)
return ((('https://opengraph.io/api/' + version) + '/site/') + quote_plus(url)) | Build the request URL. | opengraphio/opengraphio.py | get_site_info_url | wbdana/opengraph-io-python | 1 | python | def get_site_info_url(self, url, options={}):
'\n \n '
version = (options['version'] if ('version' in options) else self.version)
return ((('https://opengraph.io/api/' + version) + '/site/') + quote_plus(url)) | def get_site_info_url(self, url, options={}):
'\n \n '
version = (options['version'] if ('version' in options) else self.version)
return ((('https://opengraph.io/api/' + version) + '/site/') + quote_plus(url))<|docstring|>Build the request URL.<|endoftext|> |
c3d784889647fa0189e614c6c7421bd9681dd9cc7d9f914a76fb28df1ac1b5f0 | def get_site_info_query_params(self, options={}):
'\n Set params for a particular request called with get_site_info.\n '
query_string_values = {}
query_string_values['app_id'] = (options['app_id'] if ('app_id' in options) else self.app_id)
query_string_values['cache_ok'] = (options['cache_... | Set params for a particular request called with get_site_info. | opengraphio/opengraphio.py | get_site_info_query_params | wbdana/opengraph-io-python | 1 | python | def get_site_info_query_params(self, options={}):
'\n \n '
query_string_values = {}
query_string_values['app_id'] = (options['app_id'] if ('app_id' in options) else self.app_id)
query_string_values['cache_ok'] = (options['cache_ok'] if ('cache_ok' in options) else self.cache_ok)
query_... | def get_site_info_query_params(self, options={}):
'\n \n '
query_string_values = {}
query_string_values['app_id'] = (options['app_id'] if ('app_id' in options) else self.app_id)
query_string_values['cache_ok'] = (options['cache_ok'] if ('cache_ok' in options) else self.cache_ok)
query_... |
d40d1ef7b2cf18f48d3ced441bdae0eb4b5dd2bc33c4ef136e6e3d3cdc2bba43 | def get_site_info(self, passed_url, options={}):
'\n Request OpenGraph tags and return JSON.\n '
uri = self.get_site_info_url(passed_url)
params = self.get_site_info_query_params(options)
response = requests.get(uri, params)
return response.json() | Request OpenGraph tags and return JSON. | opengraphio/opengraphio.py | get_site_info | wbdana/opengraph-io-python | 1 | python | def get_site_info(self, passed_url, options={}):
'\n \n '
uri = self.get_site_info_url(passed_url)
params = self.get_site_info_query_params(options)
response = requests.get(uri, params)
return response.json() | def get_site_info(self, passed_url, options={}):
'\n \n '
uri = self.get_site_info_url(passed_url)
params = self.get_site_info_query_params(options)
response = requests.get(uri, params)
return response.json()<|docstring|>Request OpenGraph tags and return JSON.<|endoftext|> |
1e631818c89bf11a1385df43d2370a0fa4bb32b5a6bdafee6b243f4374c33f73 | def unique(whole_df, bigram_col, dep_rel_col):
'This function takes Dataframe columns of bigram and dependency relations\n into list and then both of these lists are consolidated into distinct values\n or set'
dataframe = whole_df
u_list = list()
u_set = ''
for i in range(len(dataframe)):
... | This function takes Dataframe columns of bigram and dependency relations
into list and then both of these lists are consolidated into distinct values
or set | extractUnique.py | unique | 1MT3J45/ML-RestaurantReviewAnalysis-NLP | 0 | python | def unique(whole_df, bigram_col, dep_rel_col):
'This function takes Dataframe columns of bigram and dependency relations\n into list and then both of these lists are consolidated into distinct values\n or set'
dataframe = whole_df
u_list = list()
u_set =
for i in range(len(dataframe)):
... | def unique(whole_df, bigram_col, dep_rel_col):
'This function takes Dataframe columns of bigram and dependency relations\n into list and then both of these lists are consolidated into distinct values\n or set'
dataframe = whole_df
u_list = list()
u_set =
for i in range(len(dataframe)):
... |
5ca7464f9dbd51423ee3f89ef7ceace7ec11ed70e074ab5682028c522cd590a6 | def combiner(Feature_df, lemma_col, uniqueFeat_col, use_ast):
"Combines the Lemma and Unique features into a single\n sentence. Later to be used for Synonym words using SWordNet\n Dictionary. The Flag use_ast Parameter will decide whether to use\n ast's literal evaluation or not. Literal eval helps to extr... | Combines the Lemma and Unique features into a single
sentence. Later to be used for Synonym words using SWordNet
Dictionary. The Flag use_ast Parameter will decide whether to use
ast's literal evaluation or not. Literal eval helps to extract
List from a string data | extractUnique.py | combiner | 1MT3J45/ML-RestaurantReviewAnalysis-NLP | 0 | python | def combiner(Feature_df, lemma_col, uniqueFeat_col, use_ast):
"Combines the Lemma and Unique features into a single\n sentence. Later to be used for Synonym words using SWordNet\n Dictionary. The Flag use_ast Parameter will decide whether to use\n ast's literal evaluation or not. Literal eval helps to extr... | def combiner(Feature_df, lemma_col, uniqueFeat_col, use_ast):
"Combines the Lemma and Unique features into a single\n sentence. Later to be used for Synonym words using SWordNet\n Dictionary. The Flag use_ast Parameter will decide whether to use\n ast's literal evaluation or not. Literal eval helps to extr... |
285a72f0503f7d0d8cfc4cfdf3f8f5f7902e0f5e4b3eb9be7eed394c23d3a303 | def __init__(self, urls):
'Initialize the reference to the Url factory.\n\n Parameters\n ----------\n urls: benchengine.api.route.UrlFactory\n Factory for resource urls\n '
super(UserSerializer, self).__init__(urls) | Initialize the reference to the Url factory.
Parameters
----------
urls: benchengine.api.route.UrlFactory
Factory for resource urls | benchengine/api/serialize/user.py | __init__ | scailfin/benchmark-engine | 0 | python | def __init__(self, urls):
'Initialize the reference to the Url factory.\n\n Parameters\n ----------\n urls: benchengine.api.route.UrlFactory\n Factory for resource urls\n '
super(UserSerializer, self).__init__(urls) | def __init__(self, urls):
'Initialize the reference to the Url factory.\n\n Parameters\n ----------\n urls: benchengine.api.route.UrlFactory\n Factory for resource urls\n '
super(UserSerializer, self).__init__(urls)<|docstring|>Initialize the reference to the Url factory.
... |
5294f2d0cb7232134e71135544d0b4025b7f5af98b86f5dff96f2bf99bd4573e | def login(self, access_token):
'Serialization for successful login. Contains tha access token and a\n list of HATEOAS references.\n\n Parameters\n ----------\n access_token: string\n User access token\n\n Returns\n -------\n dict\n '
return {lab... | Serialization for successful login. Contains tha access token and a
list of HATEOAS references.
Parameters
----------
access_token: string
User access token
Returns
-------
dict | benchengine/api/serialize/user.py | login | scailfin/benchmark-engine | 0 | python | def login(self, access_token):
'Serialization for successful login. Contains tha access token and a\n list of HATEOAS references.\n\n Parameters\n ----------\n access_token: string\n User access token\n\n Returns\n -------\n dict\n '
return {lab... | def login(self, access_token):
'Serialization for successful login. Contains tha access token and a\n list of HATEOAS references.\n\n Parameters\n ----------\n access_token: string\n User access token\n\n Returns\n -------\n dict\n '
return {lab... |
596b5adf24cebfd85d1891bb7fdeb3ebd9b87079f66cf8eff3f2407b9ace7320 | def user(self, user):
'Get serialization for a given registered user.\n\n Parameters\n ----------\n user: benchengine.user.base.RegisteredUser\n User object\n\n Returns\n -------\n dict\n '
return {labels.ID: user.identifier, labels.USERNAME: user.user... | Get serialization for a given registered user.
Parameters
----------
user: benchengine.user.base.RegisteredUser
User object
Returns
-------
dict | benchengine/api/serialize/user.py | user | scailfin/benchmark-engine | 0 | python | def user(self, user):
'Get serialization for a given registered user.\n\n Parameters\n ----------\n user: benchengine.user.base.RegisteredUser\n User object\n\n Returns\n -------\n dict\n '
return {labels.ID: user.identifier, labels.USERNAME: user.user... | def user(self, user):
'Get serialization for a given registered user.\n\n Parameters\n ----------\n user: benchengine.user.base.RegisteredUser\n User object\n\n Returns\n -------\n dict\n '
return {labels.ID: user.identifier, labels.USERNAME: user.user... |
899c53c5e4ba66f95f4ebb0db5e8e6c92abdac393c8d7c64712aec2a8a27e4ac | def create_new_calculator(operations=None):
"\n Creates a configuration dict for a new calculator. Optionally pre loads an\n initial set of operations. By default a calculator with no operations\n is created.\n\n :param operations: Dict with initial operations.\n ie: {'sum': sum_fu... | Creates a configuration dict for a new calculator. Optionally pre loads an
initial set of operations. By default a calculator with no operations
is created.
:param operations: Dict with initial operations.
ie: {'sum': sum_function, ...} | calculator/main.py | create_new_calculator | gaurang1703/pyp-w1-gw-extensible-calculator | 0 | python | def create_new_calculator(operations=None):
"\n Creates a configuration dict for a new calculator. Optionally pre loads an\n initial set of operations. By default a calculator with no operations\n is created.\n\n :param operations: Dict with initial operations.\n ie: {'sum': sum_fu... | def create_new_calculator(operations=None):
"\n Creates a configuration dict for a new calculator. Optionally pre loads an\n initial set of operations. By default a calculator with no operations\n is created.\n\n :param operations: Dict with initial operations.\n ie: {'sum': sum_fu... |
d6523df133f5b43e89e84bff01e1a55028637c95b0d074a0e6007fa5bc92f677 | def perform_operation(calc, operation, params):
"\n Executes given operation with given params. It returns the result of the\n operation execution.\n\n :param calc: A calculator.\n :param operation: String with the operation name. ie: 'add'\n :param params: Tuple containing the list of nums to operat... | Executes given operation with given params. It returns the result of the
operation execution.
:param calc: A calculator.
:param operation: String with the operation name. ie: 'add'
:param params: Tuple containing the list of nums to operate with.
ie: (1, 2, 3, 4.5, -2) | calculator/main.py | perform_operation | gaurang1703/pyp-w1-gw-extensible-calculator | 0 | python | def perform_operation(calc, operation, params):
"\n Executes given operation with given params. It returns the result of the\n operation execution.\n\n :param calc: A calculator.\n :param operation: String with the operation name. ie: 'add'\n :param params: Tuple containing the list of nums to operat... | def perform_operation(calc, operation, params):
"\n Executes given operation with given params. It returns the result of the\n operation execution.\n\n :param calc: A calculator.\n :param operation: String with the operation name. ie: 'add'\n :param params: Tuple containing the list of nums to operat... |
baf6ee4c3bb9551a1003ca658c4fb47cb2cec7a4e01211191b8a84c61b815c24 | def add_new_operation(calc, operation):
"\n Adds given operation to the list of supported operations for given calculator.\n\n :param calc: A calculator.\n :param operation: Dict with the single operation to be added.\n ie: {'add': add_function}\n "
if (not isinstance(operation,... | Adds given operation to the list of supported operations for given calculator.
:param calc: A calculator.
:param operation: Dict with the single operation to be added.
ie: {'add': add_function} | calculator/main.py | add_new_operation | gaurang1703/pyp-w1-gw-extensible-calculator | 0 | python | def add_new_operation(calc, operation):
"\n Adds given operation to the list of supported operations for given calculator.\n\n :param calc: A calculator.\n :param operation: Dict with the single operation to be added.\n ie: {'add': add_function}\n "
if (not isinstance(operation,... | def add_new_operation(calc, operation):
"\n Adds given operation to the list of supported operations for given calculator.\n\n :param calc: A calculator.\n :param operation: Dict with the single operation to be added.\n ie: {'add': add_function}\n "
if (not isinstance(operation,... |
3959a87a87ab0adad86f7f4ce677427c8510e73148ce079c07dfd7343c10a38b | def get_operations(calc):
'\n Returns the list of operation names supported by given calculator.\n '
return list(calc['operations'].keys()) | Returns the list of operation names supported by given calculator. | calculator/main.py | get_operations | gaurang1703/pyp-w1-gw-extensible-calculator | 0 | python | def get_operations(calc):
'\n \n '
return list(calc['operations'].keys()) | def get_operations(calc):
'\n \n '
return list(calc['operations'].keys())<|docstring|>Returns the list of operation names supported by given calculator.<|endoftext|> |
09777da28101a30d1ca425643b5fd2ecf55d284d72f8630eb3a783b11446fa88 | def get_history(calc):
"\n Returns the history of the executed operations since the last reset or\n since the calculator creation.\n\n History items must have the following format:\n (:execution_time, :operation_name, :params, :result)\n\n ie:\n ('2016-05-20 12:00:00', 'add', (1, 2), 3... | Returns the history of the executed operations since the last reset or
since the calculator creation.
History items must have the following format:
(:execution_time, :operation_name, :params, :result)
ie:
('2016-05-20 12:00:00', 'add', (1, 2), 3), | calculator/main.py | get_history | gaurang1703/pyp-w1-gw-extensible-calculator | 0 | python | def get_history(calc):
"\n Returns the history of the executed operations since the last reset or\n since the calculator creation.\n\n History items must have the following format:\n (:execution_time, :operation_name, :params, :result)\n\n ie:\n ('2016-05-20 12:00:00', 'add', (1, 2), 3... | def get_history(calc):
"\n Returns the history of the executed operations since the last reset or\n since the calculator creation.\n\n History items must have the following format:\n (:execution_time, :operation_name, :params, :result)\n\n ie:\n ('2016-05-20 12:00:00', 'add', (1, 2), 3... |
6f6cc956e71a047ea824edbe17df64d615ff261ff63107156f6cee9c553cee42 | def reset_history(calc):
'\n Resets the calculator history back to an empty list.\n '
calc['history'] = [] | Resets the calculator history back to an empty list. | calculator/main.py | reset_history | gaurang1703/pyp-w1-gw-extensible-calculator | 0 | python | def reset_history(calc):
'\n \n '
calc['history'] = [] | def reset_history(calc):
'\n \n '
calc['history'] = []<|docstring|>Resets the calculator history back to an empty list.<|endoftext|> |
a703eb5f21f2ee89e5e0c70dbb0d4b9adb92f00de7b81d810f7decd3ed35d5c1 | def repeat_last_operation(calc):
'\n Returns the result of the last operation executed in the history.\n '
if calc['history']:
return calc['history'][(- 1)][3] | Returns the result of the last operation executed in the history. | calculator/main.py | repeat_last_operation | gaurang1703/pyp-w1-gw-extensible-calculator | 0 | python | def repeat_last_operation(calc):
'\n \n '
if calc['history']:
return calc['history'][(- 1)][3] | def repeat_last_operation(calc):
'\n \n '
if calc['history']:
return calc['history'][(- 1)][3]<|docstring|>Returns the result of the last operation executed in the history.<|endoftext|> |
9a831b34eef3830d26a89ac1663399d83bb712f9078ca3d5d5e3fb6aefeee9dc | @overrides
def forward(self, **inputs: Dict[(str, Dict[(str, Any)])]) -> Dict[(str, torch.Tensor)]:
'\n Make forward pass with decoder logic for producing the entire target sequence.\n The fields corresponding to arguments `source_field` and `target_field`\n are used as source and target.\n ... | Make forward pass with decoder logic for producing the entire target sequence.
The fields corresponding to arguments `source_field` and `target_field`
are used as source and target.
In the inference mode targets are used for computing metrics. | amr_seq2seq/model.py | forward | YerevaNN/amr_seq2seq | 3 | python | @overrides
def forward(self, **inputs: Dict[(str, Dict[(str, Any)])]) -> Dict[(str, torch.Tensor)]:
'\n Make forward pass with decoder logic for producing the entire target sequence.\n The fields corresponding to arguments `source_field` and `target_field`\n are used as source and target.\n ... | @overrides
def forward(self, **inputs: Dict[(str, Dict[(str, Any)])]) -> Dict[(str, torch.Tensor)]:
'\n Make forward pass with decoder logic for producing the entire target sequence.\n The fields corresponding to arguments `source_field` and `target_field`\n are used as source and target.\n ... |
717fbe03a6999bc6d92fd4b1d77e35d5be674f4dc99431f64ac59754e78a634a | def postprocess_predicted_text(self, batch_text: List[str]):
'\n For finalizing predictions, postprocessing similar to\n Noord and Bos (2017) is done.\n '
batch_amrs = []
for text in batch_text:
amr = postprocess_AMRs.process_item(text)
batch_amrs.append(amr)
return ... | For finalizing predictions, postprocessing similar to
Noord and Bos (2017) is done. | amr_seq2seq/model.py | postprocess_predicted_text | YerevaNN/amr_seq2seq | 3 | python | def postprocess_predicted_text(self, batch_text: List[str]):
'\n For finalizing predictions, postprocessing similar to\n Noord and Bos (2017) is done.\n '
batch_amrs = []
for text in batch_text:
amr = postprocess_AMRs.process_item(text)
batch_amrs.append(amr)
return ... | def postprocess_predicted_text(self, batch_text: List[str]):
'\n For finalizing predictions, postprocessing similar to\n Noord and Bos (2017) is done.\n '
batch_amrs = []
for text in batch_text:
amr = postprocess_AMRs.process_item(text)
batch_amrs.append(amr)
return ... |
8e8c1803aaafaa702c31d1d5ea644310c8f895bcc0a15ef99cec0db11aec607c | @overrides
def decode(self, output_dict: Dict[(str, torch.Tensor)]) -> Dict[(str, torch.Tensor)]:
'\n Finalize predictions. Tensors are converted back into tokens using\n the vocabulary. Tokens are then concatenated to get a linearized amrs.\n Finally, postprocessing is done to get valid amr re... | Finalize predictions. Tensors are converted back into tokens using
the vocabulary. Tokens are then concatenated to get a linearized amrs.
Finally, postprocessing is done to get valid amr representations. | amr_seq2seq/model.py | decode | YerevaNN/amr_seq2seq | 3 | python | @overrides
def decode(self, output_dict: Dict[(str, torch.Tensor)]) -> Dict[(str, torch.Tensor)]:
'\n Finalize predictions. Tensors are converted back into tokens using\n the vocabulary. Tokens are then concatenated to get a linearized amrs.\n Finally, postprocessing is done to get valid amr re... | @overrides
def decode(self, output_dict: Dict[(str, torch.Tensor)]) -> Dict[(str, torch.Tensor)]:
'\n Finalize predictions. Tensors are converted back into tokens using\n the vocabulary. Tokens are then concatenated to get a linearized amrs.\n Finally, postprocessing is done to get valid amr re... |
c3d1da413e99651dbb7c39437cf1f708268462b9501fe8d387fa5892c16a85ff | def detokenize(self, tokens: List[str]) -> str:
'\n Detokenize given lists of tokens. If the does not provide detokenization\n procedure, use the default one instead\n '
if hasattr(self.vocab, 'detokenize'):
return self.vocab.detokenize(tokens, namespace=self._target_namespace)
... | Detokenize given lists of tokens. If the does not provide detokenization
procedure, use the default one instead | amr_seq2seq/model.py | detokenize | YerevaNN/amr_seq2seq | 3 | python | def detokenize(self, tokens: List[str]) -> str:
'\n Detokenize given lists of tokens. If the does not provide detokenization\n procedure, use the default one instead\n '
if hasattr(self.vocab, 'detokenize'):
return self.vocab.detokenize(tokens, namespace=self._target_namespace)
... | def detokenize(self, tokens: List[str]) -> str:
'\n Detokenize given lists of tokens. If the does not provide detokenization\n procedure, use the default one instead\n '
if hasattr(self.vocab, 'detokenize'):
return self.vocab.detokenize(tokens, namespace=self._target_namespace)
... |
e2143ff9624c93b44b3097454c240a3808474b618659eb834d762541458aa823 | @overrides
def get_metrics(self, reset: bool=False) -> Dict[(str, float)]:
'\n Get metrics for current state.\n '
all_metrics: Dict[(str, float)] = super().get_metrics(reset=reset)
if (self._smatch and (not self.training)):
all_metrics.update(self._smatch.get_metric(reset=reset))
r... | Get metrics for current state. | amr_seq2seq/model.py | get_metrics | YerevaNN/amr_seq2seq | 3 | python | @overrides
def get_metrics(self, reset: bool=False) -> Dict[(str, float)]:
'\n \n '
all_metrics: Dict[(str, float)] = super().get_metrics(reset=reset)
if (self._smatch and (not self.training)):
all_metrics.update(self._smatch.get_metric(reset=reset))
return all_metrics | @overrides
def get_metrics(self, reset: bool=False) -> Dict[(str, float)]:
'\n \n '
all_metrics: Dict[(str, float)] = super().get_metrics(reset=reset)
if (self._smatch and (not self.training)):
all_metrics.update(self._smatch.get_metric(reset=reset))
return all_metrics<|docstring|>... |
42c333704dbcede673cece1f03d785d106aef1809e0df3919f2b8ad444c857c0 | def check_binary(can_words, ref_words, word_bits, verbose=False):
'\n Return exact_match, score 0-1\n '
checks = 0
matches = 0
for (wordi, (expect, mask)) in ref_words.items():
got = can_words[wordi]
(verbose and print(('word %u want 0x%04X got 0x%04X' % (wordi, expect, got))))
... | Return exact_match, score 0-1 | zorrom/solver.py | check_binary | ryancor/zorrom | 21 | python | def check_binary(can_words, ref_words, word_bits, verbose=False):
'\n \n '
checks = 0
matches = 0
for (wordi, (expect, mask)) in ref_words.items():
got = can_words[wordi]
(verbose and print(('word %u want 0x%04X got 0x%04X' % (wordi, expect, got))))
for maski in range(word_... | def check_binary(can_words, ref_words, word_bits, verbose=False):
'\n \n '
checks = 0
matches = 0
for (wordi, (expect, mask)) in ref_words.items():
got = can_words[wordi]
(verbose and print(('word %u want 0x%04X got 0x%04X' % (wordi, expect, got))))
for maski in range(word_... |
16f3f2adeb56bd4dee0934798475c1dec9d539c2c36fe94aa05f7ead3bf515b6 | def guess_layout_cols_lr(mr, buf, alg_prefix, layout_alg_force=None, verbose=False):
'\n Assume bits are contiguous in columns\n wrapping around at the next line\n Least significant bit at left\n\n Can either start in very upper left of bit colum and go right\n Or can start in upper right of bit colu... | Assume bits are contiguous in columns
wrapping around at the next line
Least significant bit at left
Can either start in very upper left of bit colum and go right
Or can start in upper right of bit colum and go left
Related permutations are handled by flipx, rotate, etc | zorrom/solver.py | guess_layout_cols_lr | ryancor/zorrom | 21 | python | def guess_layout_cols_lr(mr, buf, alg_prefix, layout_alg_force=None, verbose=False):
'\n Assume bits are contiguous in columns\n wrapping around at the next line\n Least significant bit at left\n\n Can either start in very upper left of bit colum and go right\n Or can start in upper right of bit colu... | def guess_layout_cols_lr(mr, buf, alg_prefix, layout_alg_force=None, verbose=False):
'\n Assume bits are contiguous in columns\n wrapping around at the next line\n Least significant bit at left\n\n Can either start in very upper left of bit colum and go right\n Or can start in upper right of bit colu... |
ef6873a9a6bea4ca279b8b253b699afa7522874d4b7c18ca6b022873ae5db9c9 | def td_interleave_hor(txtdict, txtw, txth, interleaves, interleave_dir, word_bits=8, verbose=0):
'\n Interleave left/right\n interleaves must be 1, 2, 4, 8, etc\n\n Example, given:\n W0A W1A W2A W3A W0B W1B W2B W3B\n interleaves=2, wordsz=4 interleave_dir=r becomes:\n W0A W0B W1A W1B W2A W2B W3A W... | Interleave left/right
interleaves must be 1, 2, 4, 8, etc
Example, given:
W0A W1A W2A W3A W0B W1B W2B W3B
interleaves=2, wordsz=4 interleave_dir=r becomes:
W0A W0B W1A W1B W2A W2B W3A W3B
interleaves=2, wordsz=4 interleave_dir=l like:
W0B W0A W1B W1A W2B W2A W3B W3A
...
That is the first row has word and left and ano... | zorrom/solver.py | td_interleave_hor | ryancor/zorrom | 21 | python | def td_interleave_hor(txtdict, txtw, txth, interleaves, interleave_dir, word_bits=8, verbose=0):
'\n Interleave left/right\n interleaves must be 1, 2, 4, 8, etc\n\n Example, given:\n W0A W1A W2A W3A W0B W1B W2B W3B\n interleaves=2, wordsz=4 interleave_dir=r becomes:\n W0A W0B W1A W1B W2A W2B W3A W... | def td_interleave_hor(txtdict, txtw, txth, interleaves, interleave_dir, word_bits=8, verbose=0):
'\n Interleave left/right\n interleaves must be 1, 2, 4, 8, etc\n\n Example, given:\n W0A W1A W2A W3A W0B W1B W2B W3B\n interleaves=2, wordsz=4 interleave_dir=r becomes:\n W0A W0B W1A W1B W2A W2B W3A W... |
7e7c3c300bb7072043fe7b43f8ef383ab15b51bdffa1d46711cece287238d29e | def parse_ref_words(argstr):
'\n All three of thse are equivilent:\n ./solver.py --bytes 0x31,0xfe,0xff dmg-cpu/rom.txt\n ./solver.py --bytes 0x00:0x31,0x01:0xfe,0x02:0xff dmg-cpu/rom.txt\n ./solver.py --bytes 0x00:0x31:0xFF,0x01:0xfe:0xFF,0x02:0xff:0xFF dmg-cpu/rom.txt\n\n Which maps to:\n ref_wo... | All three of thse are equivilent:
./solver.py --bytes 0x31,0xfe,0xff dmg-cpu/rom.txt
./solver.py --bytes 0x00:0x31,0x01:0xfe,0x02:0xff dmg-cpu/rom.txt
./solver.py --bytes 0x00:0x31:0xFF,0x01:0xfe:0xFF,0x02:0xff:0xFF dmg-cpu/rom.txt
Which maps to:
ref_words = {
0x00: (0x31, 0xFF),
0x01: (0xfe, 0xFF),
0x02: ... | zorrom/solver.py | parse_ref_words | ryancor/zorrom | 21 | python | def parse_ref_words(argstr):
'\n All three of thse are equivilent:\n ./solver.py --bytes 0x31,0xfe,0xff dmg-cpu/rom.txt\n ./solver.py --bytes 0x00:0x31,0x01:0xfe,0x02:0xff dmg-cpu/rom.txt\n ./solver.py --bytes 0x00:0x31:0xFF,0x01:0xfe:0xFF,0x02:0xff:0xFF dmg-cpu/rom.txt\n\n Which maps to:\n ref_wo... | def parse_ref_words(argstr):
'\n All three of thse are equivilent:\n ./solver.py --bytes 0x31,0xfe,0xff dmg-cpu/rom.txt\n ./solver.py --bytes 0x00:0x31,0x01:0xfe,0x02:0xff dmg-cpu/rom.txt\n ./solver.py --bytes 0x00:0x31:0xFF,0x01:0xfe:0xFF,0x02:0xff:0xFF dmg-cpu/rom.txt\n\n Which maps to:\n ref_wo... |
e2da36e094af5c6b24e30c08279ed20363b53c3c0c136a677f43f8fceb36094b | def seed_reindex(self):
'\n Form a basic layout that algorithms can then munge for varients\n '
calc_oi2cr = None
for alg_check in (self.seed_reindex_lr, self.seed_reindex_ud):
calc_oi2cr = alg_check()
if (calc_oi2cr is not None):
break
assert calc_oi2cr, self.l... | Form a basic layout that algorithms can then munge for varients | zorrom/solver.py | seed_reindex | ryancor/zorrom | 21 | python | def seed_reindex(self):
'\n \n '
calc_oi2cr = None
for alg_check in (self.seed_reindex_lr, self.seed_reindex_ud):
calc_oi2cr = alg_check()
if (calc_oi2cr is not None):
break
assert calc_oi2cr, self.layout_alg()
self.reindex_calc_oi2cr(calc_oi2cr=calc_oi2cr)
... | def seed_reindex(self):
'\n \n '
calc_oi2cr = None
for alg_check in (self.seed_reindex_lr, self.seed_reindex_ud):
calc_oi2cr = alg_check()
if (calc_oi2cr is not None):
break
assert calc_oi2cr, self.layout_alg()
self.reindex_calc_oi2cr(calc_oi2cr=calc_oi2cr)
... |
9ac7722c938e29965031bc74682569bbd9f460be75cb8f17107046b838a45323 | def test_Sensor__init__return_sensor_object(mocker):
' test if Sensor().__init__() creates a valid Sensor object '
mocker.patch.object(mqtt_publish, 'single')
sensor = Test_Sensor()
assert (sensor.sensor_id == 'test_sensor_id')
assert (sensor.name == 'test_sensor_name')
assert (sensor.interval =... | test if Sensor().__init__() creates a valid Sensor object | test_sensor.py | test_Sensor__init__return_sensor_object | tentacle-project/tentacle | 0 | python | def test_Sensor__init__return_sensor_object(mocker):
' '
mocker.patch.object(mqtt_publish, 'single')
sensor = Test_Sensor()
assert (sensor.sensor_id == 'test_sensor_id')
assert (sensor.name == 'test_sensor_name')
assert (sensor.interval == 1)
assert (sensor.capabilities == {'pressure': {'ra... | def test_Sensor__init__return_sensor_object(mocker):
' '
mocker.patch.object(mqtt_publish, 'single')
sensor = Test_Sensor()
assert (sensor.sensor_id == 'test_sensor_id')
assert (sensor.name == 'test_sensor_name')
assert (sensor.interval == 1)
assert (sensor.capabilities == {'pressure': {'ra... |
2d680333fd2755f9fd735ea73fba4c9e77d3d7c0e63d0d1d6e5171009baeea32 | def test_Sensor_read_data_abstractmethod():
' test if Sensor().read_data() is an abstract method '
class Test_Sensor(Sensor):
' tentacle.sensor test object without abstract methods '
def __init__(self):
super().__init__('test_sensor_id', 'test_sensor_name')
with pytest.raises(T... | test if Sensor().read_data() is an abstract method | test_sensor.py | test_Sensor_read_data_abstractmethod | tentacle-project/tentacle | 0 | python | def test_Sensor_read_data_abstractmethod():
' '
class Test_Sensor(Sensor):
' tentacle.sensor test object without abstract methods '
def __init__(self):
super().__init__('test_sensor_id', 'test_sensor_name')
with pytest.raises(TypeError):
Test_Sensor() | def test_Sensor_read_data_abstractmethod():
' '
class Test_Sensor(Sensor):
' tentacle.sensor test object without abstract methods '
def __init__(self):
super().__init__('test_sensor_id', 'test_sensor_name')
with pytest.raises(TypeError):
Test_Sensor()<|docstring|>test ... |
811ff43b621a1049b8a5ceb5592f438ba16ec33c92cd0ed08a4ae974dbc7c05b | def test_Sensor_measuring_loop_no_measurement(monkeypatch, mocker):
' test if Sensor.measuring_loop() does nothing if there are no\n measurements from Sensor.read_data() '
mocker.patch.object(mqtt_publish, 'single')
sensor = Test_Sensor()
monkeypatch.setattr(sensor, 'testing', True)
spy_publi... | test if Sensor.measuring_loop() does nothing if there are no
measurements from Sensor.read_data() | test_sensor.py | test_Sensor_measuring_loop_no_measurement | tentacle-project/tentacle | 0 | python | def test_Sensor_measuring_loop_no_measurement(monkeypatch, mocker):
' test if Sensor.measuring_loop() does nothing if there are no\n measurements from Sensor.read_data() '
mocker.patch.object(mqtt_publish, 'single')
sensor = Test_Sensor()
monkeypatch.setattr(sensor, 'testing', True)
spy_publi... | def test_Sensor_measuring_loop_no_measurement(monkeypatch, mocker):
' test if Sensor.measuring_loop() does nothing if there are no\n measurements from Sensor.read_data() '
mocker.patch.object(mqtt_publish, 'single')
sensor = Test_Sensor()
monkeypatch.setattr(sensor, 'testing', True)
spy_publi... |
710877eb00478fa5225f10bd9e7068be14f4aa49b58892e43ed8a045954a071e | def test_Sensor_measuring_loop(monkeypatch, mocker):
' test if Sensor.measuring_loop() fulfills one while loop correctly '
def mock_read_data():
measurement = Measurement([[Temperature(), 10.8], [Relative_Humidity(), 86], [Pressure(unit='hPa'), 1034.28]])
measurement.timestamp = 1604842762
... | test if Sensor.measuring_loop() fulfills one while loop correctly | test_sensor.py | test_Sensor_measuring_loop | tentacle-project/tentacle | 0 | python | def test_Sensor_measuring_loop(monkeypatch, mocker):
' '
def mock_read_data():
measurement = Measurement([[Temperature(), 10.8], [Relative_Humidity(), 86], [Pressure(unit='hPa'), 1034.28]])
measurement.timestamp = 1604842762
return measurement
mocker.patch.object(mqtt_publish, 'sin... | def test_Sensor_measuring_loop(monkeypatch, mocker):
' '
def mock_read_data():
measurement = Measurement([[Temperature(), 10.8], [Relative_Humidity(), 86], [Pressure(unit='hPa'), 1034.28]])
measurement.timestamp = 1604842762
return measurement
mocker.patch.object(mqtt_publish, 'sin... |
4cbf10f182288515dbd9c44c9aa4b3532e38cac5fe0c947c5e47ad36e0981122 | def __init__(self):
'\n Initializes a keys object.\n '
self.keylist = []
self.keysort = None
self.mask = (Keys.MINSIZE - 1) | Initializes a keys object. | src/python/py27hash/key.py | __init__ | silo-oevans/py27hash | 9 | python | def __init__(self):
'\n \n '
self.keylist = []
self.keysort = None
self.mask = (Keys.MINSIZE - 1) | def __init__(self):
'\n \n '
self.keylist = []
self.keysort = None
self.mask = (Keys.MINSIZE - 1)<|docstring|>Initializes a keys object.<|endoftext|> |
81c3980d51e3d59db7f0e9edb0da0155b5a5bd05260e4565dcb58c396a4048ef | def __setstate__(self, state):
'\n Overrides default pickling object to force re-adding all keys and match Python 2.7 deserialization logic.\n\n Args:\n state: input state\n '
self.__dict__ = state
keys = self.keys()
self.__init__()
for k in keys:
self.add(k) | Overrides default pickling object to force re-adding all keys and match Python 2.7 deserialization logic.
Args:
state: input state | src/python/py27hash/key.py | __setstate__ | silo-oevans/py27hash | 9 | python | def __setstate__(self, state):
'\n Overrides default pickling object to force re-adding all keys and match Python 2.7 deserialization logic.\n\n Args:\n state: input state\n '
self.__dict__ = state
keys = self.keys()
self.__init__()
for k in keys:
self.add(k) | def __setstate__(self, state):
'\n Overrides default pickling object to force re-adding all keys and match Python 2.7 deserialization logic.\n\n Args:\n state: input state\n '
self.__dict__ = state
keys = self.keys()
self.__init__()
for k in keys:
self.add(k)<... |
e02d5a2dbf2ba1204a4ac64bb2d66598da8dce3462d1e92e49be4f63f692bc09 | def __iter__(self):
'\n Default iterator.\n\n Returns:\n iterator\n '
return iter(self.keys()) | Default iterator.
Returns:
iterator | src/python/py27hash/key.py | __iter__ | silo-oevans/py27hash | 9 | python | def __iter__(self):
'\n Default iterator.\n\n Returns:\n iterator\n '
return iter(self.keys()) | def __iter__(self):
'\n Default iterator.\n\n Returns:\n iterator\n '
return iter(self.keys())<|docstring|>Default iterator.
Returns:
iterator<|endoftext|> |
a90b0fd018a3992a422b9808842b8a6755e82958a2f5f9c62d4531e81f29a1a9 | def keys(self):
"\n Returns keys ordered using Python 2.7's iteration algorithm.\n\n Method: static PyDictEntry *lookdict(PyDictObject *mp, PyObject *key, register long hash)\n\n Returns:\n list of keys\n "
if (not self.keysort):
keys = []
hids = set()
... | Returns keys ordered using Python 2.7's iteration algorithm.
Method: static PyDictEntry *lookdict(PyDictObject *mp, PyObject *key, register long hash)
Returns:
list of keys | src/python/py27hash/key.py | keys | silo-oevans/py27hash | 9 | python | def keys(self):
"\n Returns keys ordered using Python 2.7's iteration algorithm.\n\n Method: static PyDictEntry *lookdict(PyDictObject *mp, PyObject *key, register long hash)\n\n Returns:\n list of keys\n "
if (not self.keysort):
keys = []
hids = set()
... | def keys(self):
"\n Returns keys ordered using Python 2.7's iteration algorithm.\n\n Method: static PyDictEntry *lookdict(PyDictObject *mp, PyObject *key, register long hash)\n\n Returns:\n list of keys\n "
if (not self.keysort):
keys = []
hids = set()
... |
3e22831ef71dc9837c2e7f18a3084e11585b39ac81e7d920a0ef8f227da43487 | def add(self, key):
'\n Called each time a new item is inserted. Tracks via insertion order and will maintain the same order\n as a dict in Python 2.7.\n\n Method: static int dict_set_item_by_hash_or_entry(register PyObject *op, PyObject *key, long hash,\n ... | Called each time a new item is inserted. Tracks via insertion order and will maintain the same order
as a dict in Python 2.7.
Method: static int dict_set_item_by_hash_or_entry(register PyObject *op, PyObject *key, long hash,
PyDictEntry *ep, PyObject *value)
Args:
k... | src/python/py27hash/key.py | add | silo-oevans/py27hash | 9 | python | def add(self, key):
'\n Called each time a new item is inserted. Tracks via insertion order and will maintain the same order\n as a dict in Python 2.7.\n\n Method: static int dict_set_item_by_hash_or_entry(register PyObject *op, PyObject *key, long hash,\n ... | def add(self, key):
'\n Called each time a new item is inserted. Tracks via insertion order and will maintain the same order\n as a dict in Python 2.7.\n\n Method: static int dict_set_item_by_hash_or_entry(register PyObject *op, PyObject *key, long hash,\n ... |
333851c7f37c42eb32a2faf5c26ed728c005903134f00bb6f9b7f6bd2ceec6d1 | def remove(self, key):
'\n Remove a key from the backing list.\n\n Args:\n key: key to remove\n '
if (key in self.keylist):
self.keylist.remove(key)
self.keysort = None | Remove a key from the backing list.
Args:
key: key to remove | src/python/py27hash/key.py | remove | silo-oevans/py27hash | 9 | python | def remove(self, key):
'\n Remove a key from the backing list.\n\n Args:\n key: key to remove\n '
if (key in self.keylist):
self.keylist.remove(key)
self.keysort = None | def remove(self, key):
'\n Remove a key from the backing list.\n\n Args:\n key: key to remove\n '
if (key in self.keylist):
self.keylist.remove(key)
self.keysort = None<|docstring|>Remove a key from the backing list.
Args:
key: key to remove<|endoftext|> |
f44676b7b4095d4e2895d66da2e839b5049899e4bfd3a97f5faeb0ba1ae85e33 | def merge(self, d):
'\n Merges keys from an existing iterable into this key list.\n\n Method: int PyDict_Merge(PyObject *a, PyObject *b, int override)\n\n Args:\n d: input dict\n '
self.setMask(((len(self.keylist) + len(d)) * 2))
for k in d:
self.add(k) | Merges keys from an existing iterable into this key list.
Method: int PyDict_Merge(PyObject *a, PyObject *b, int override)
Args:
d: input dict | src/python/py27hash/key.py | merge | silo-oevans/py27hash | 9 | python | def merge(self, d):
'\n Merges keys from an existing iterable into this key list.\n\n Method: int PyDict_Merge(PyObject *a, PyObject *b, int override)\n\n Args:\n d: input dict\n '
self.setMask(((len(self.keylist) + len(d)) * 2))
for k in d:
self.add(k) | def merge(self, d):
'\n Merges keys from an existing iterable into this key list.\n\n Method: int PyDict_Merge(PyObject *a, PyObject *b, int override)\n\n Args:\n d: input dict\n '
self.setMask(((len(self.keylist) + len(d)) * 2))
for k in d:
self.add(k)<|docstr... |
d2b222a2d560068ed84b8dbf7da502e5abb8e4e3ce01628050ad17ea9eba4adf | def copy(self):
'\n Makes a copy of self.\n\n Method: PyObject *PyDict_Copy(PyObject *o)\n\n Returns:\n copy of self\n '
new = Keys()
new.merge(self.keys())
return new | Makes a copy of self.
Method: PyObject *PyDict_Copy(PyObject *o)
Returns:
copy of self | src/python/py27hash/key.py | copy | silo-oevans/py27hash | 9 | python | def copy(self):
'\n Makes a copy of self.\n\n Method: PyObject *PyDict_Copy(PyObject *o)\n\n Returns:\n copy of self\n '
new = Keys()
new.merge(self.keys())
return new | def copy(self):
'\n Makes a copy of self.\n\n Method: PyObject *PyDict_Copy(PyObject *o)\n\n Returns:\n copy of self\n '
new = Keys()
new.merge(self.keys())
return new<|docstring|>Makes a copy of self.
Method: PyObject *PyDict_Copy(PyObject *o)
Returns:
copy ... |
ff73227ed12912e40897ceea2d5a451f7a10e86c5f900d0f7ff26c4a33fb9a84 | def pop(self):
'\n Pops the top element from the sorted keys if it exists. Returns None otherwise.\n\n Method: static PyObject *dict_popitem(PyDictObject *mp)\n\n Return:\n top element or None if Keys is empty\n '
if self.keylist:
value = self.keys()[0]
sel... | Pops the top element from the sorted keys if it exists. Returns None otherwise.
Method: static PyObject *dict_popitem(PyDictObject *mp)
Return:
top element or None if Keys is empty | src/python/py27hash/key.py | pop | silo-oevans/py27hash | 9 | python | def pop(self):
'\n Pops the top element from the sorted keys if it exists. Returns None otherwise.\n\n Method: static PyObject *dict_popitem(PyDictObject *mp)\n\n Return:\n top element or None if Keys is empty\n '
if self.keylist:
value = self.keys()[0]
sel... | def pop(self):
'\n Pops the top element from the sorted keys if it exists. Returns None otherwise.\n\n Method: static PyObject *dict_popitem(PyDictObject *mp)\n\n Return:\n top element or None if Keys is empty\n '
if self.keylist:
value = self.keys()[0]
sel... |
17e547af4a915d163ed0b2f08f5f30e0237bdc47fb012f0051aa262028ca8bf0 | def setMask(self, request=None):
"\n Key based on the total size of this dict. Matches ma_mask in Python 2.7's dict.\n\n Method: static int dictresize(PyDictObject *mp, Py_ssize_t minused)\n "
if (not request):
length = len(self.keylist)
request = (length * (2 if (length > 5... | Key based on the total size of this dict. Matches ma_mask in Python 2.7's dict.
Method: static int dictresize(PyDictObject *mp, Py_ssize_t minused) | src/python/py27hash/key.py | setMask | silo-oevans/py27hash | 9 | python | def setMask(self, request=None):
"\n Key based on the total size of this dict. Matches ma_mask in Python 2.7's dict.\n\n Method: static int dictresize(PyDictObject *mp, Py_ssize_t minused)\n "
if (not request):
length = len(self.keylist)
request = (length * (2 if (length > 5... | def setMask(self, request=None):
"\n Key based on the total size of this dict. Matches ma_mask in Python 2.7's dict.\n\n Method: static int dictresize(PyDictObject *mp, Py_ssize_t minused)\n "
if (not request):
length = len(self.keylist)
request = (length * (2 if (length > 5... |
1a23b1116bbe783abd08323d2167bff458d944eb3d23409cee4e9d4f2de36e0a | def nrmse_similarity(image_1, image_2, norm_mode='Min max'):
'\n Normalized root mean squared error (NRMSE).\n\n :param image_1: The image 1 for comparison\n :type image_1: numpy.ndarray\n :param image_2: The image 2 for comparison\n :type image_2: numpy.ndarray\n :param norm_mode: The mode for th... | Normalized root mean squared error (NRMSE).
:param image_1: The image 1 for comparison
:type image_1: numpy.ndarray
:param image_2: The image 2 for comparison
:type image_2: numpy.ndarray
:param norm_mode: The mode for the normalization, average mode use the max (||image_1||, ||image_2||) Min max use ... | kalmus/utils/measure_utils.py | nrmse_similarity | yc015/KALMUS | 7 | python | def nrmse_similarity(image_1, image_2, norm_mode='Min max'):
'\n Normalized root mean squared error (NRMSE).\n\n :param image_1: The image 1 for comparison\n :type image_1: numpy.ndarray\n :param image_2: The image 2 for comparison\n :type image_2: numpy.ndarray\n :param norm_mode: The mode for th... | def nrmse_similarity(image_1, image_2, norm_mode='Min max'):
'\n Normalized root mean squared error (NRMSE).\n\n :param image_1: The image 1 for comparison\n :type image_1: numpy.ndarray\n :param image_2: The image 2 for comparison\n :type image_2: numpy.ndarray\n :param norm_mode: The mode for th... |
10a79ef387d0971c9a94f30a3b068d1b73dd704101bd92fc73de97781020f240 | def ssim_similarity(image_1, image_2, window_size=None):
'\n Structural similarity index measure (ssim)\n\n :param image_1: The image 1 for comparison\n :type image_1: numpy.ndarray\n :param image_2: The image 2 for comparison\n :type image_2: numpy.ndarray\n :param window_size: The size of the lo... | Structural similarity index measure (ssim)
:param image_1: The image 1 for comparison
:type image_1: numpy.ndarray
:param image_2: The image 2 for comparison
:type image_2: numpy.ndarray
:param window_size: The size of the local window, integer
:type window_size: int
:return: The Structural similarity index score in r... | kalmus/utils/measure_utils.py | ssim_similarity | yc015/KALMUS | 7 | python | def ssim_similarity(image_1, image_2, window_size=None):
'\n Structural similarity index measure (ssim)\n\n :param image_1: The image 1 for comparison\n :type image_1: numpy.ndarray\n :param image_2: The image 2 for comparison\n :type image_2: numpy.ndarray\n :param window_size: The size of the lo... | def ssim_similarity(image_1, image_2, window_size=None):
'\n Structural similarity index measure (ssim)\n\n :param image_1: The image 1 for comparison\n :type image_1: numpy.ndarray\n :param image_2: The image 2 for comparison\n :type image_2: numpy.ndarray\n :param window_size: The size of the lo... |
1b354fc5a54d3d249a2dfd257b14b922cbee1a1c9193e6c9df1b0a3e833b4f9d | def get_resample_index(num_frames, sample_amount=10):
'\n Helper function\n Get the resample indexes based on the number of frames in sequences and the amount of samples we want to\n extract. The indexes are equally spaced. (linear interpolation)\n\n :param num_frames: The total number of frames\n :t... | Helper function
Get the resample indexes based on the number of frames in sequences and the amount of samples we want to
extract. The indexes are equally spaced. (linear interpolation)
:param num_frames: The total number of frames
:type num_frames: int
:param sample_amount: How many frames that you want to sample from... | kalmus/utils/measure_utils.py | get_resample_index | yc015/KALMUS | 7 | python | def get_resample_index(num_frames, sample_amount=10):
'\n Helper function\n Get the resample indexes based on the number of frames in sequences and the amount of samples we want to\n extract. The indexes are equally spaced. (linear interpolation)\n\n :param num_frames: The total number of frames\n :t... | def get_resample_index(num_frames, sample_amount=10):
'\n Helper function\n Get the resample indexes based on the number of frames in sequences and the amount of samples we want to\n extract. The indexes are equally spaced. (linear interpolation)\n\n :param num_frames: The total number of frames\n :t... |
c413934c1511106dfee0ad6e2fc0cf5d4b29b0d8e19c503790121b73dd84156e | def cross_correlation(signal_template, signal_source):
'\n Signal matching. Cross correlation of two input signals. Signals need to be in the same shape\n\n :param signal_template: The template signal\n :type signal_template: numpy.ndarray\n :param signal_source: The source signal\n :type signal_sour... | Signal matching. Cross correlation of two input signals. Signals need to be in the same shape
:param signal_template: The template signal
:type signal_template: numpy.ndarray
:param signal_source: The source signal
:type signal_source: numpy.ndarray
:return: The cross correlation between two input signals. High cross ... | kalmus/utils/measure_utils.py | cross_correlation | yc015/KALMUS | 7 | python | def cross_correlation(signal_template, signal_source):
'\n Signal matching. Cross correlation of two input signals. Signals need to be in the same shape\n\n :param signal_template: The template signal\n :type signal_template: numpy.ndarray\n :param signal_source: The source signal\n :type signal_sour... | def cross_correlation(signal_template, signal_source):
'\n Signal matching. Cross correlation of two input signals. Signals need to be in the same shape\n\n :param signal_template: The template signal\n :type signal_template: numpy.ndarray\n :param signal_source: The source signal\n :type signal_sour... |
7a451034cb29f8dfcb69e4fa3dbf312fdff3d75e30b010ac26d0ffcb1f7e5863 | def local_cross_correlation(signal_template, signal_source, horizontal_interval=40, vertical_interval=40):
'\n Local cross correlation between two input signals. The input signals need to be 2 dimensional for local windowing\n\n :param signal_template: The template signal\n :type signal_template: numpy.nda... | Local cross correlation between two input signals. The input signals need to be 2 dimensional for local windowing
:param signal_template: The template signal
:type signal_template: numpy.ndarray
:param signal_source: The source signal
:type signal_source: numpy.ndarray
:param horizontal_interval: Number of horizontal ... | kalmus/utils/measure_utils.py | local_cross_correlation | yc015/KALMUS | 7 | python | def local_cross_correlation(signal_template, signal_source, horizontal_interval=40, vertical_interval=40):
'\n Local cross correlation between two input signals. The input signals need to be 2 dimensional for local windowing\n\n :param signal_template: The template signal\n :type signal_template: numpy.nda... | def local_cross_correlation(signal_template, signal_source, horizontal_interval=40, vertical_interval=40):
'\n Local cross correlation between two input signals. The input signals need to be 2 dimensional for local windowing\n\n :param signal_template: The template signal\n :type signal_template: numpy.nda... |
27f58b5249316e185f047525f10bf05cdc06fda3186c6a5e12810bd9a65d121c | def generate_hue_strings_from_color_barcode(color_barcode, num_interval=12):
'\n Helper function\n Generate the characters strings that represent the hue values of the input RGB color barcode (3 channel in range\n [0, 255]).\n\n :param color_barcode: Input color barcode, the input barcode must be a 1 di... | Helper function
Generate the characters strings that represent the hue values of the input RGB color barcode (3 channel in range
[0, 255]).
:param color_barcode: Input color barcode, the input barcode must be a 1 dimensional color barcode with ``kalmus.barcodes.ColorBarcode.colors``
... | kalmus/utils/measure_utils.py | generate_hue_strings_from_color_barcode | yc015/KALMUS | 7 | python | def generate_hue_strings_from_color_barcode(color_barcode, num_interval=12):
'\n Helper function\n Generate the characters strings that represent the hue values of the input RGB color barcode (3 channel in range\n [0, 255]).\n\n :param color_barcode: Input color barcode, the input barcode must be a 1 di... | def generate_hue_strings_from_color_barcode(color_barcode, num_interval=12):
'\n Helper function\n Generate the characters strings that represent the hue values of the input RGB color barcode (3 channel in range\n [0, 255]).\n\n :param color_barcode: Input color barcode, the input barcode must be a 1 di... |
22eb329715b1a99ca65d150f82f7f6359f5c519af93188c90f141f949eb7eb24 | def generate_brightness_string_from_brightness_barcode(brightness_barcode, num_interval=15):
'\n Helper function\n Generate the string where each character represents the brightness interval of the brightness in the input\n brightness barcode.\n\n :param brightness_barcode: Input 1 dimensional brightnes... | Helper function
Generate the string where each character represents the brightness interval of the brightness in the input
brightness barcode.
:param brightness_barcode: Input 1 dimensional brightness barcode with 1 channel. ``kalmus.barcodes.Barcode.BrightnessBarcode.brightness`` ... | kalmus/utils/measure_utils.py | generate_brightness_string_from_brightness_barcode | yc015/KALMUS | 7 | python | def generate_brightness_string_from_brightness_barcode(brightness_barcode, num_interval=15):
'\n Helper function\n Generate the string where each character represents the brightness interval of the brightness in the input\n brightness barcode.\n\n :param brightness_barcode: Input 1 dimensional brightnes... | def generate_brightness_string_from_brightness_barcode(brightness_barcode, num_interval=15):
'\n Helper function\n Generate the string where each character represents the brightness interval of the brightness in the input\n brightness barcode.\n\n :param brightness_barcode: Input 1 dimensional brightnes... |
8d1ce9e7984aa22a6ab5a29566f4ca69fd98cd55f13784e33a3cc3cba5118f98 | def compare_needleman_wunsch(str_barcode_1, str_barcode_2, local_sequence_size=2000, match_score=2, mismatch_penal=(- 1), gap_penal=(- 0.5), extending_gap_penal=(- 0.1), normalized=False):
"\n Compare two input character arrays/strings (barcode)'s matching score using the Needleman Wunsch method.\n Needleman ... | Compare two input character arrays/strings (barcode)'s matching score using the Needleman Wunsch method.
Needleman Wunsch: https://www.sciencedirect.com/science/article/abs/pii/0022283670900574?via%3Dihub
:param str_barcode_1: The input string representation of barcode 1
:type str_barcode_1: str
:param str_barcode_2: ... | kalmus/utils/measure_utils.py | compare_needleman_wunsch | yc015/KALMUS | 7 | python | def compare_needleman_wunsch(str_barcode_1, str_barcode_2, local_sequence_size=2000, match_score=2, mismatch_penal=(- 1), gap_penal=(- 0.5), extending_gap_penal=(- 0.1), normalized=False):
"\n Compare two input character arrays/strings (barcode)'s matching score using the Needleman Wunsch method.\n Needleman ... | def compare_needleman_wunsch(str_barcode_1, str_barcode_2, local_sequence_size=2000, match_score=2, mismatch_penal=(- 1), gap_penal=(- 0.5), extending_gap_penal=(- 0.1), normalized=False):
"\n Compare two input character arrays/strings (barcode)'s matching score using the Needleman Wunsch method.\n Needleman ... |
d5c97637e936b3a48920e64e432f0eb7d1a19acd9e913095701ea74371b3b4ab | def compare_smith_waterman(str_barcode_1, str_barcode_2, local_sequence_size=2000, match_score=2, mismatch_penal=(- 1), gap_penal=(- 0.5), extending_gap_penal=(- 0.1), normalized=False):
"\n Compare two input character arrays/strings (barcode)'s matching score using the Smith Waterman method.\n Smith Waterman... | Compare two input character arrays/strings (barcode)'s matching score using the Smith Waterman method.
Smith Waterman: https://www.sciencedirect.com/science/article/abs/pii/0022283681900875?via%3Dihub
:param str_barcode_1: The input string representation of barcode 1
:type str_barcode_1: str
:param str_barcode_2: The ... | kalmus/utils/measure_utils.py | compare_smith_waterman | yc015/KALMUS | 7 | python | def compare_smith_waterman(str_barcode_1, str_barcode_2, local_sequence_size=2000, match_score=2, mismatch_penal=(- 1), gap_penal=(- 0.5), extending_gap_penal=(- 0.1), normalized=False):
"\n Compare two input character arrays/strings (barcode)'s matching score using the Smith Waterman method.\n Smith Waterman... | def compare_smith_waterman(str_barcode_1, str_barcode_2, local_sequence_size=2000, match_score=2, mismatch_penal=(- 1), gap_penal=(- 0.5), extending_gap_penal=(- 0.1), normalized=False):
"\n Compare two input character arrays/strings (barcode)'s matching score using the Smith Waterman method.\n Smith Waterman... |
1337b352b2c9c8b214ed784c5c3c3690860845e326c78f8d315da62b72f06c11 | def successes(self, parsed):
'\n return: all entity names that are or are not in `parsed` as expected\n '
return {name for c in self if c.verify(parsed) for name in c.member_names} | return: all entity names that are or are not in `parsed` as expected | joffrey/clumps.py | successes | supposedly/jeffrey | 8 | python | def successes(self, parsed):
'\n \n '
return {name for c in self if c.verify(parsed) for name in c.member_names} | def successes(self, parsed):
'\n \n '
return {name for c in self if c.verify(parsed) for name in c.member_names}<|docstring|>return: all entity names that are or are not in `parsed` as expected<|endoftext|> |
e369e86d4ec3ebcd4a262688f7881fa722f2b0ba7f58b1cb82e98c53f7a0a77e | def failures(self, parsed):
'\n return: generator of (expected, the_only_successes) from all clumps that\n `parsed` does not satisfy\n '
return ((c.member_names, c.to_eliminate(parsed)) for c in self if (not c.verify(parsed))) | return: generator of (expected, the_only_successes) from all clumps that
`parsed` does not satisfy | joffrey/clumps.py | failures | supposedly/jeffrey | 8 | python | def failures(self, parsed):
'\n return: generator of (expected, the_only_successes) from all clumps that\n `parsed` does not satisfy\n '
return ((c.member_names, c.to_eliminate(parsed)) for c in self if (not c.verify(parsed))) | def failures(self, parsed):
'\n return: generator of (expected, the_only_successes) from all clumps that\n `parsed` does not satisfy\n '
return ((c.member_names, c.to_eliminate(parsed)) for c in self if (not c.verify(parsed)))<|docstring|>return: generator of (expected, the_only_successes) ... |
3f06ff38e0b2aa4d37ae10320045d9609389a5688ff6dbf578044de2c564d063 | def __init__(self, key, host):
'\n key: Unique string with which to group other ANDs\n host: Handler creating this clump; only used for multiton\n instance-checking\n '
self.key = key
self.host = host
self.members = set() | key: Unique string with which to group other ANDs
host: Handler creating this clump; only used for multiton
instance-checking | joffrey/clumps.py | __init__ | supposedly/jeffrey | 8 | python | def __init__(self, key, host):
'\n key: Unique string with which to group other ANDs\n host: Handler creating this clump; only used for multiton\n instance-checking\n '
self.key = key
self.host = host
self.members = set() | def __init__(self, key, host):
'\n key: Unique string with which to group other ANDs\n host: Handler creating this clump; only used for multiton\n instance-checking\n '
self.key = key
self.host = host
self.members = set()<|docstring|>key: Unique string with which to group o... |
b6e5c5a8ab0069efc658e80cde5551da9aa7199a17c1daf81fd236cb99a39072 | def to_eliminate(self, parsed):
'\n return: entities in `parsed` that were expected to be present.\n (that is, all these methods return successes)\n '
return frozenset(self.member_names.intersection(parsed)) | return: entities in `parsed` that were expected to be present.
(that is, all these methods return successes) | joffrey/clumps.py | to_eliminate | supposedly/jeffrey | 8 | python | def to_eliminate(self, parsed):
'\n return: entities in `parsed` that were expected to be present.\n (that is, all these methods return successes)\n '
return frozenset(self.member_names.intersection(parsed)) | def to_eliminate(self, parsed):
'\n return: entities in `parsed` that were expected to be present.\n (that is, all these methods return successes)\n '
return frozenset(self.member_names.intersection(parsed))<|docstring|>return: entities in `parsed` that were expected to be present.
(that is... |
11f8a1f5a0dfc65cf5a4e880de25c82b760130aa7ff5ece03ff2cfb532dedea7 | def to_eliminate(self, parsed):
'\n return: entities in `parsed` that were expected to be present.\n '
return frozenset(self.member_names.intersection(parsed)) | return: entities in `parsed` that were expected to be present. | joffrey/clumps.py | to_eliminate | supposedly/jeffrey | 8 | python | def to_eliminate(self, parsed):
'\n \n '
return frozenset(self.member_names.intersection(parsed)) | def to_eliminate(self, parsed):
'\n \n '
return frozenset(self.member_names.intersection(parsed))<|docstring|>return: entities in `parsed` that were expected to be present.<|endoftext|> |
f224aba6a1ba8d9d6441b5ab9470f19266933fe38203cc2c32f794ad33c855cb | def to_eliminate(self, parsed):
'\n return: entities not in `parsed` that were not expected to be present.\n '
return frozenset(self.member_names.difference(parsed)) | return: entities not in `parsed` that were not expected to be present. | joffrey/clumps.py | to_eliminate | supposedly/jeffrey | 8 | python | def to_eliminate(self, parsed):
'\n \n '
return frozenset(self.member_names.difference(parsed)) | def to_eliminate(self, parsed):
'\n \n '
return frozenset(self.member_names.difference(parsed))<|docstring|>return: entities not in `parsed` that were not expected to be present.<|endoftext|> |
356a4c62240d7c12b2b321d6343b1858150f1ecbb1dead0f96a4011f193ce008 | def quickpickle_load(picklepath):
'Very time-efficient way to load pickle-formatted objects into Python.\n Uses C-based pickle (cPickle) and gc workarounds to facilitate speed. \n Input: Filepath to pickled (*.pkl) object.\n Output: Python object (probably a list of sentences or something similar).'
wi... | Very time-efficient way to load pickle-formatted objects into Python.
Uses C-based pickle (cPickle) and gc workarounds to facilitate speed.
Input: Filepath to pickled (*.pkl) object.
Output: Python object (probably a list of sentences or something similar). | quickpickle.py | quickpickle_load | jhaber-zz/data_tools | 0 | python | def quickpickle_load(picklepath):
'Very time-efficient way to load pickle-formatted objects into Python.\n Uses C-based pickle (cPickle) and gc workarounds to facilitate speed. \n Input: Filepath to pickled (*.pkl) object.\n Output: Python object (probably a list of sentences or something similar).'
wi... | def quickpickle_load(picklepath):
'Very time-efficient way to load pickle-formatted objects into Python.\n Uses C-based pickle (cPickle) and gc workarounds to facilitate speed. \n Input: Filepath to pickled (*.pkl) object.\n Output: Python object (probably a list of sentences or something similar).'
wi... |
b4729908fa650d6446b74734b7b258b5e1b35bb294589bc37ee6d1b0c00b23cb | def quickpickle_dump(dumpvar, picklepath):
'Very time-efficient way to dump pickle-formatted objects from Python.\n Uses C-based pickle (cPickle) and gc workarounds to facilitate speed. \n Input: Python object (probably a list of sentences or something similar).\n Output: Filepath to pickled (*.pkl) object... | Very time-efficient way to dump pickle-formatted objects from Python.
Uses C-based pickle (cPickle) and gc workarounds to facilitate speed.
Input: Python object (probably a list of sentences or something similar).
Output: Filepath to pickled (*.pkl) object. | quickpickle.py | quickpickle_dump | jhaber-zz/data_tools | 0 | python | def quickpickle_dump(dumpvar, picklepath):
'Very time-efficient way to dump pickle-formatted objects from Python.\n Uses C-based pickle (cPickle) and gc workarounds to facilitate speed. \n Input: Python object (probably a list of sentences or something similar).\n Output: Filepath to pickled (*.pkl) object... | def quickpickle_dump(dumpvar, picklepath):
'Very time-efficient way to dump pickle-formatted objects from Python.\n Uses C-based pickle (cPickle) and gc workarounds to facilitate speed. \n Input: Python object (probably a list of sentences or something similar).\n Output: Filepath to pickled (*.pkl) object... |
953a680f7cdb111dcfc0fcad7b739f62c04f7324dc2662bef0d59d2849e46036 | def menu():
'Degiro Menu'
degiro_controller = DegiroController()
degiro_controller.help(None)
while True:
if (session and gtff.USE_PROMPT_TOOLKIT):
completer = NestedCompleter.from_nested_dict({c: None for c in degiro_controller.CHOICES})
an_input = session.prompt(f'{get_... | Degiro Menu | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | menu | nav1s/GamestonkTerminal | 3 | python | def menu():
degiro_controller = DegiroController()
degiro_controller.help(None)
while True:
if (session and gtff.USE_PROMPT_TOOLKIT):
completer = NestedCompleter.from_nested_dict({c: None for c in degiro_controller.CHOICES})
an_input = session.prompt(f'{get_flair()} (bro... | def menu():
degiro_controller = DegiroController()
degiro_controller.help(None)
while True:
if (session and gtff.USE_PROMPT_TOOLKIT):
completer = NestedCompleter.from_nested_dict({c: None for c in degiro_controller.CHOICES})
an_input = session.prompt(f'{get_flair()} (bro... |
94103927e356249f69df6a1f3bff794c94ab57a39e103cbf415836405088603f | def cancel(self, l_args):
'Cancel an order using the `id`.'
parser = argparse.ArgumentParser(add_help=False, prog='companynews')
parser.add_argument('id', help="Order's id.", type=str)
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.cancel(ns_parser=ns_parser) | Cancel an order using the `id`. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | cancel | nav1s/GamestonkTerminal | 3 | python | def cancel(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='companynews')
parser.add_argument('id', help="Order's id.", type=str)
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.cancel(ns_parser=ns_parser) | def cancel(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='companynews')
parser.add_argument('id', help="Order's id.", type=str)
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.cancel(ns_parser=ns_parser)<|docstring|>Cancel an order using the `id`.<|en... |
04f4bfd9bd4d2a72c9e5ab519f167fe687874a4cb3107bd7403ea201e36b6ea7 | def companynews(self, l_args):
'Display news related to a company using its ISIN.'
parser = argparse.ArgumentParser(add_help=False, prog='companynews')
parser.add_argument('isin', type=str, help='ISIN code of the company.')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.com... | Display news related to a company using its ISIN. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | companynews | nav1s/GamestonkTerminal | 3 | python | def companynews(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='companynews')
parser.add_argument('isin', type=str, help='ISIN code of the company.')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.companynews(ns_parser=ns_parser) | def companynews(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='companynews')
parser.add_argument('isin', type=str, help='ISIN code of the company.')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.companynews(ns_parser=ns_parser)<|docstring|>Display n... |
0d62de4948c917167932ad9b17dee8b4a41b2cf48bb1d06a7b648e824c75272a | def create(self, l_args):
'Create an order.'
parser = argparse.ArgumentParser(add_help=False, prog='create')
parser.add_argument('-a', '--action', choices=DegiroView.ORDER_ACTION.keys(), default='buy', help='Action wanted.', required=False, type=str)
product_group = parser.add_mutually_exclusive_group(r... | Create an order. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | create | nav1s/GamestonkTerminal | 3 | python | def create(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='create')
parser.add_argument('-a', '--action', choices=DegiroView.ORDER_ACTION.keys(), default='buy', help='Action wanted.', required=False, type=str)
product_group = parser.add_mutually_exclusive_group(required=True)
... | def create(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='create')
parser.add_argument('-a', '--action', choices=DegiroView.ORDER_ACTION.keys(), default='buy', help='Action wanted.', required=False, type=str)
product_group = parser.add_mutually_exclusive_group(required=True)
... |
7a0a9bb9f5db6f94e661763b8b8f022c2cbf273eb8eb7222181a31edf9b927ce | def help(self, _):
'Show the help menu.'
DegiroView.help_display() | Show the help menu. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | help | nav1s/GamestonkTerminal | 3 | python | def help(self, _):
DegiroView.help_display() | def help(self, _):
DegiroView.help_display()<|docstring|>Show the help menu.<|endoftext|> |
eaa469054c9cd933ac384b238d7bcdf7d68466caeb6558fdc23597524c7d69d5 | def hold(self, l_args):
'Display held products.'
parser = argparse.ArgumentParser(add_help=False, prog='hold')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.hold(ns_parser=ns_parser) | Display held products. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | hold | nav1s/GamestonkTerminal | 3 | python | def hold(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='hold')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.hold(ns_parser=ns_parser) | def hold(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='hold')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.hold(ns_parser=ns_parser)<|docstring|>Display held products.<|endoftext|> |
6434db02e72d8c5109b10097b5b7617ac1d9ed670207efd9fafb7f07fee1486c | def lastnews(self, l_args):
'Display latest news.'
parser = argparse.ArgumentParser(add_help=False, prog='lastnews')
parser.add_argument('-l', '--limit', default=10, type=int, help='Number of news to display.', required=False)
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.... | Display latest news. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | lastnews | nav1s/GamestonkTerminal | 3 | python | def lastnews(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='lastnews')
parser.add_argument('-l', '--limit', default=10, type=int, help='Number of news to display.', required=False)
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.lastnews(ns_parser=ns_... | def lastnews(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='lastnews')
parser.add_argument('-l', '--limit', default=10, type=int, help='Number of news to display.', required=False)
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.lastnews(ns_parser=ns_... |
d61ff1e745fa8b4bc9fc857fc12961455d948b076571bcd18eb6116ade7e4f59 | def login(self, l_args):
"Connect to Degiro's API."
parser = argparse.ArgumentParser(add_help=False, prog='login')
parser.add_argument('-u', '--username', type=str, default=config.DG_USERNAME, help="Username in Degiro's account.")
parser.add_argument('-p', '--password', type=str, default=config.DG_PASSW... | Connect to Degiro's API. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | login | nav1s/GamestonkTerminal | 3 | python | def login(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='login')
parser.add_argument('-u', '--username', type=str, default=config.DG_USERNAME, help="Username in Degiro's account.")
parser.add_argument('-p', '--password', type=str, default=config.DG_PASSWORD, help="Password in Deg... | def login(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='login')
parser.add_argument('-u', '--username', type=str, default=config.DG_USERNAME, help="Username in Degiro's account.")
parser.add_argument('-p', '--password', type=str, default=config.DG_PASSWORD, help="Password in Deg... |
6e2e1283e76e0cdef9bb9afc0c146dc1b32d7338cd9ab63eb39a5c95ff01a9fb | def logout(self, l_args):
"Log out from Degiro's API."
parser = argparse.ArgumentParser(add_help=False, prog='logout')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.logout(ns_parser=ns_parser) | Log out from Degiro's API. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | logout | nav1s/GamestonkTerminal | 3 | python | def logout(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='logout')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.logout(ns_parser=ns_parser) | def logout(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='logout')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.logout(ns_parser=ns_parser)<|docstring|>Log out from Degiro's API.<|endoftext|> |
847634f8dd6be9054df06924325a67d3f4326d6bf9de2318490d294743dab886 | def lookup(self, l_args):
'Search for products by their name.'
parser = argparse.ArgumentParser(add_help=False, prog='lookup')
parser.add_argument('search_text', type=str, help='Name of the company or a text.')
parser.add_argument('-l', '--limit', type=int, default=10, help='Number of result expected (0... | Search for products by their name. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | lookup | nav1s/GamestonkTerminal | 3 | python | def lookup(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='lookup')
parser.add_argument('search_text', type=str, help='Name of the company or a text.')
parser.add_argument('-l', '--limit', type=int, default=10, help='Number of result expected (0 for unlimited).')
parser.add_ar... | def lookup(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='lookup')
parser.add_argument('search_text', type=str, help='Name of the company or a text.')
parser.add_argument('-l', '--limit', type=int, default=10, help='Number of result expected (0 for unlimited).')
parser.add_ar... |
bd9e37077acfd014f0a0e77f0362d762edde0445eeb48347c9a8459fe049082f | def pending(self, l_args):
'Display pending orders.'
parser = argparse.ArgumentParser(add_help=False, prog='pending')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.pending(ns_parser=ns_parser) | Display pending orders. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | pending | nav1s/GamestonkTerminal | 3 | python | def pending(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='pending')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.pending(ns_parser=ns_parser) | def pending(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='pending')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.pending(ns_parser=ns_parser)<|docstring|>Display pending orders.<|endoftext|> |
bc6c8025ea08d0bf0aa4f1c963d595d53fbbe9f9f8bbc446f3db7a33ff1dfc7d | def q(self, _):
'Process Q command - quit the menu.'
return False | Process Q command - quit the menu. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | q | nav1s/GamestonkTerminal | 3 | python | def q(self, _):
return False | def q(self, _):
return False<|docstring|>Process Q command - quit the menu.<|endoftext|> |
812477024177d3fbcf71a975be02c082c1225eb4a8880f9f359ca64691fca25b | def quit(self, _):
'Process Quit command - quit the program.'
return True | Process Quit command - quit the program. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | quit | nav1s/GamestonkTerminal | 3 | python | def quit(self, _):
return True | def quit(self, _):
return True<|docstring|>Process Quit command - quit the program.<|endoftext|> |
440504a9363aa87973c9fc83eb0abb13dfd3696c4e932287022396db31a3a8dd | def topnews(self, l_args):
'Display top news.'
parser = argparse.ArgumentParser(add_help=False, prog='topnews')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.topnews(ns_parser=ns_parser) | Display top news. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | topnews | nav1s/GamestonkTerminal | 3 | python | def topnews(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='topnews')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.topnews(ns_parser=ns_parser) | def topnews(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='topnews')
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__degiro_view.topnews(ns_parser=ns_parser)<|docstring|>Display top news.<|endoftext|> |
0e5744cd5593063d59048f8543d53764c1dd914104ccc697d4aad53de6d6ced7 | def update(self, l_args):
'Update an order.'
parser = argparse.ArgumentParser(add_help=False, prog='update')
parser.add_argument('id', help="Order's id.", type=str)
parser.add_argument('-p', '--price', help='Price wanted.', required=True, type=float)
ns_parser = parse_known_args_and_warn(parser, l_a... | Update an order. | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | update | nav1s/GamestonkTerminal | 3 | python | def update(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='update')
parser.add_argument('id', help="Order's id.", type=str)
parser.add_argument('-p', '--price', help='Price wanted.', required=True, type=float)
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__de... | def update(self, l_args):
parser = argparse.ArgumentParser(add_help=False, prog='update')
parser.add_argument('id', help="Order's id.", type=str)
parser.add_argument('-p', '--price', help='Price wanted.', required=True, type=float)
ns_parser = parse_known_args_and_warn(parser, l_args)
self.__de... |
75556dffa0350b959c8d90d1d4185d2e614d39336b6d15a49d0475cbc74dd7ea | def switch(self, an_input: str):
'Process and dispatch input\n\n Returns\n -------\n True, False or None\n False - quit the menu\n True - quit the program\n None - continue in the menu\n '
try:
degiro_parser = self.__degiro_parser
if (... | Process and dispatch input
Returns
-------
True, False or None
False - quit the menu
True - quit the program
None - continue in the menu | gamestonk_terminal/portfolio/brokers/degiro/degiro_controller.py | switch | nav1s/GamestonkTerminal | 3 | python | def switch(self, an_input: str):
'Process and dispatch input\n\n Returns\n -------\n True, False or None\n False - quit the menu\n True - quit the program\n None - continue in the menu\n '
try:
degiro_parser = self.__degiro_parser
if (... | def switch(self, an_input: str):
'Process and dispatch input\n\n Returns\n -------\n True, False or None\n False - quit the menu\n True - quit the program\n None - continue in the menu\n '
try:
degiro_parser = self.__degiro_parser
if (... |
00b177968b9225ae6536ce1ac13809a05ccf58873db8fcddf008119c9d361651 | def testSyntheticsCITest(self):
'Test SyntheticsCITest'
pass | Test SyntheticsCITest | tests/v1/test_synthetics_ci_test.py | testSyntheticsCITest | MichaelTROEHLER/datadog-api-client-python | 0 | python | def testSyntheticsCITest(self):
pass | def testSyntheticsCITest(self):
pass<|docstring|>Test SyntheticsCITest<|endoftext|> |
0242068b56fea47bf95db0076ac5643b107eb85b0d4e0e9a2c3802311a8109bf | def __init__(self, file_stubbing_params=None, hyperv_backup_params=None, nas_backup_params=None, o_365_backup_params=None, outlook_backup_params=None, physical_backup_params=None, snapshot_manager_params=None, sql_backup_job_params=None, vmware_backup_params=None):
'Constructor for the EnvBackupParams class'
se... | Constructor for the EnvBackupParams class | cohesity_management_sdk/models/env_backup_params.py | __init__ | pyashish/management-sdk-python | 1 | python | def __init__(self, file_stubbing_params=None, hyperv_backup_params=None, nas_backup_params=None, o_365_backup_params=None, outlook_backup_params=None, physical_backup_params=None, snapshot_manager_params=None, sql_backup_job_params=None, vmware_backup_params=None):
self.file_stubbing_params = file_stubbing_par... | def __init__(self, file_stubbing_params=None, hyperv_backup_params=None, nas_backup_params=None, o_365_backup_params=None, outlook_backup_params=None, physical_backup_params=None, snapshot_manager_params=None, sql_backup_job_params=None, vmware_backup_params=None):
self.file_stubbing_params = file_stubbing_par... |
d36e39d65dc3c6a8e62ff17bdb1c43735d66e9a16f99673fbf8bb1669493626c | @classmethod
def from_dictionary(cls, dictionary):
"Creates an instance of this model from a dictionary\n\n Args:\n dictionary (dictionary): A dictionary representation of the object as\n obtained from the deserialization of the server's response. The keys\n MUST match proper... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object as
obtained from the deserialization of the server's response. The keys
MUST match property names in the API description.
Returns:
object: An instance of this structure class. | cohesity_management_sdk/models/env_backup_params.py | from_dictionary | pyashish/management-sdk-python | 1 | python | @classmethod
def from_dictionary(cls, dictionary):
"Creates an instance of this model from a dictionary\n\n Args:\n dictionary (dictionary): A dictionary representation of the object as\n obtained from the deserialization of the server's response. The keys\n MUST match proper... | @classmethod
def from_dictionary(cls, dictionary):
"Creates an instance of this model from a dictionary\n\n Args:\n dictionary (dictionary): A dictionary representation of the object as\n obtained from the deserialization of the server's response. The keys\n MUST match proper... |
d3ea3b3f8b3ee62e554421ce8ee38105a3fdc55a1f47cd3dacbb1df308ca0086 | def __init__(self, initTable: tuple, type: SymbolicConstant=VCCT, mixedModeBehavior: SymbolicConstant=BK, temperatureDependency: Boolean=OFF, dependencies: int=0, tolerance: float=0, specifyUnstableCrackProp: SymbolicConstant=OFF, unstableTolerance: typing.Union[(SymbolicConstant, float)]=DEFAULT):
'This method cre... | This method creates a FractureCriterion object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].interactionProperties[name].FractureCriterion
Parameters
----------
initTable
A sequence of sequences of Floats specifying the value defining the fracture criterion.
The... | src/abaqus/Interaction/FractureCriterion.py | __init__ | Haiiliin/PyAbaqusBase | 7 | python | def __init__(self, initTable: tuple, type: SymbolicConstant=VCCT, mixedModeBehavior: SymbolicConstant=BK, temperatureDependency: Boolean=OFF, dependencies: int=0, tolerance: float=0, specifyUnstableCrackProp: SymbolicConstant=OFF, unstableTolerance: typing.Union[(SymbolicConstant, float)]=DEFAULT):
'This method cre... | def __init__(self, initTable: tuple, type: SymbolicConstant=VCCT, mixedModeBehavior: SymbolicConstant=BK, temperatureDependency: Boolean=OFF, dependencies: int=0, tolerance: float=0, specifyUnstableCrackProp: SymbolicConstant=OFF, unstableTolerance: typing.Union[(SymbolicConstant, float)]=DEFAULT):
'This method cre... |
6eaa7e6cc099bf1156be61d0409069f022d029661094d9810b1d0a5831e3b3b1 | def setValues(self):
'This method modifies the FractureCriterion object.\n '
pass | This method modifies the FractureCriterion object. | src/abaqus/Interaction/FractureCriterion.py | setValues | Haiiliin/PyAbaqusBase | 7 | python | def setValues(self):
'\n '
pass | def setValues(self):
'\n '
pass<|docstring|>This method modifies the FractureCriterion object.<|endoftext|> |
646a1936209e245bdb95b5fb10293af0ca0081e3b586506de497b78ba6ee6b94 | def fig_images(field=None, outfil=None):
' Spectral images\n '
if (outfil is None):
outfil = 'fig_spec_images.png'
(set_path, images) = setup_image_set()
plt.figure(figsize=(5, 5))
plt.clf()
gs = gridspec.GridSpec(len(images), 1)
cm = plt.get_cmap('Greys')
for (tt, image) in e... | Spectral images | papers/First/Figures/py/spectype_figs.py | fig_images | PYPIT/spit | 2 | python | def fig_images(field=None, outfil=None):
' \n '
if (outfil is None):
outfil = 'fig_spec_images.png'
(set_path, images) = setup_image_set()
plt.figure(figsize=(5, 5))
plt.clf()
gs = gridspec.GridSpec(len(images), 1)
cm = plt.get_cmap('Greys')
for (tt, image) in enumerate(images... | def fig_images(field=None, outfil=None):
' \n '
if (outfil is None):
outfil = 'fig_spec_images.png'
(set_path, images) = setup_image_set()
plt.figure(figsize=(5, 5))
plt.clf()
gs = gridspec.GridSpec(len(images), 1)
cm = plt.get_cmap('Greys')
for (tt, image) in enumerate(images... |
c6ec2b109e164d2e2f1de03b3f02f1ed6581dc223527b595b6e52aa6375aefab | def fig_zscale(outfil=None):
' Compare two views of the same image.\n With and without ZSCALE\n '
if (outfil is None):
outfil = 'fig_zscale.png'
(set_path, images) = setup_image_set(set=['Bias'])
img_path = (set_path + '/{:s}/'.format(images[0]['type'].lower()))
hdu = fits.open(((img_p... | Compare two views of the same image.
With and without ZSCALE | papers/First/Figures/py/spectype_figs.py | fig_zscale | PYPIT/spit | 2 | python | def fig_zscale(outfil=None):
' Compare two views of the same image.\n With and without ZSCALE\n '
if (outfil is None):
outfil = 'fig_zscale.png'
(set_path, images) = setup_image_set(set=['Bias'])
img_path = (set_path + '/{:s}/'.format(images[0]['type'].lower()))
hdu = fits.open(((img_p... | def fig_zscale(outfil=None):
' Compare two views of the same image.\n With and without ZSCALE\n '
if (outfil is None):
outfil = 'fig_zscale.png'
(set_path, images) = setup_image_set(set=['Bias'])
img_path = (set_path + '/{:s}/'.format(images[0]['type'].lower()))
hdu = fits.open(((img_p... |
173a6e8ba6fd0a13b8cb31555ba6f9d80b915f318f64d4e7a1e6785d6b93bb1c | def fig_find_trimsec(outfile=None):
' DEIMOS completeness figure\n Using the MAG_MAX in the YAML files\n '
if (outfile is None):
outfile = 'fig_find_trimsec.pdf'
arc_file = resource_filename('spit', 'tests/files/r6.fits')
hdulist = fits.open(arc_file)
img = hdulist[0].data
(tim... | DEIMOS completeness figure
Using the MAG_MAX in the YAML files | papers/First/Figures/py/spectype_figs.py | fig_find_trimsec | PYPIT/spit | 2 | python | def fig_find_trimsec(outfile=None):
' DEIMOS completeness figure\n Using the MAG_MAX in the YAML files\n '
if (outfile is None):
outfile = 'fig_find_trimsec.pdf'
arc_file = resource_filename('spit', 'tests/files/r6.fits')
hdulist = fits.open(arc_file)
img = hdulist[0].data
(tim... | def fig_find_trimsec(outfile=None):
' DEIMOS completeness figure\n Using the MAG_MAX in the YAML files\n '
if (outfile is None):
outfile = 'fig_find_trimsec.pdf'
arc_file = resource_filename('spit', 'tests/files/r6.fits')
hdulist = fits.open(arc_file)
img = hdulist[0].data
(tim... |
744024c6145e3d8264a51663e1672a9dc5387167b45b1b7052c3b767cb42f530 | def fig_trim(field=None, outfil=None):
' Compare two views of the same image.\n With and without ZSCALE\n '
if (outfil is None):
outfil = 'fig_trim.png'
arc_file = resource_filename('spit', 'tests/files/r6.fits')
hdulist = fits.open(arc_file)
img = hdulist[0].data
plt.figure(figsiz... | Compare two views of the same image.
With and without ZSCALE | papers/First/Figures/py/spectype_figs.py | fig_trim | PYPIT/spit | 2 | python | def fig_trim(field=None, outfil=None):
' Compare two views of the same image.\n With and without ZSCALE\n '
if (outfil is None):
outfil = 'fig_trim.png'
arc_file = resource_filename('spit', 'tests/files/r6.fits')
hdulist = fits.open(arc_file)
img = hdulist[0].data
plt.figure(figsiz... | def fig_trim(field=None, outfil=None):
' Compare two views of the same image.\n With and without ZSCALE\n '
if (outfil is None):
outfil = 'fig_trim.png'
arc_file = resource_filename('spit', 'tests/files/r6.fits')
hdulist = fits.open(arc_file)
img = hdulist[0].data
plt.figure(figsiz... |
64f5bbfa92cef149f6f3a59768ad5eeb2812ad9e0fe50ad1a463889694e24ea4 | def fig_sngl_test_accuracy(outfile='fig_sngl_test.png', cm=None, return_cm=False):
' Test accuracy figure for one copy of each test frame\n Includes heuristics\n '
label_dict = spit_lbl.kast_label_dict()
pdict = ltu.loadjson('../Analysis/chk_test_images.json')
ytrue = np.array(pdict['true'])
y... | Test accuracy figure for one copy of each test frame
Includes heuristics | papers/First/Figures/py/spectype_figs.py | fig_sngl_test_accuracy | PYPIT/spit | 2 | python | def fig_sngl_test_accuracy(outfile='fig_sngl_test.png', cm=None, return_cm=False):
' Test accuracy figure for one copy of each test frame\n Includes heuristics\n '
label_dict = spit_lbl.kast_label_dict()
pdict = ltu.loadjson('../Analysis/chk_test_images.json')
ytrue = np.array(pdict['true'])
y... | def fig_sngl_test_accuracy(outfile='fig_sngl_test.png', cm=None, return_cm=False):
' Test accuracy figure for one copy of each test frame\n Includes heuristics\n '
label_dict = spit_lbl.kast_label_dict()
pdict = ltu.loadjson('../Analysis/chk_test_images.json')
ytrue = np.array(pdict['true'])
y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.