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
e311d33e2ee6dab690e5d9ac8e9714d2c754e61cf5dc0f65cff1cf0d381a8f65
def main(): 'Send the RPC command to the server and print the result.' parser = argparse.ArgumentParser('Send electrumx an RPC command') parser.add_argument('-p', '--port', metavar='port_num', type=int, help='RPC port number') parser.add_argument('command', nargs=1, default=[], help='command to send') ...
Send the RPC command to the server and print the result.
electrumx_rpc.py
main
Skirmant/electrumx-trump
0
python
def main(): parser = argparse.ArgumentParser('Send electrumx an RPC command') parser.add_argument('-p', '--port', metavar='port_num', type=int, help='RPC port number') parser.add_argument('command', nargs=1, default=[], help='command to send') parser.add_argument('param', nargs='*', default=[], hel...
def main(): parser = argparse.ArgumentParser('Send electrumx an RPC command') parser.add_argument('-p', '--port', metavar='port_num', type=int, help='RPC port number') parser.add_argument('command', nargs=1, default=[], help='command to send') parser.add_argument('param', nargs='*', default=[], hel...
7acb56f3d1695444b6d99a7ba84782b730773d46e07d620b62c76bf248cf472a
def __init__(self, n_topics, vocab_size, doc_count, batch_size, batch_steps, num_collection_passes, num_documents_passes, device, dtype, phi_smooth_sparse_tau=0.0, theta_smooth_sparse_tau=0.0, vocab_stat=None, mode='v1', dump_phi_freq=None, dump_phi_path=None, log_perplexity=False, log_matrix_norms=False): '\n ...
:param n_topics: :param vocab_size: :param doc_count: :param context_size: :param batch_size: :param batch_steps: :param num_collection_passes: :param num_documents_passes: :param device: :param dtype: :param phi_smooth_sparse_tau: :param theta_smooth_sparse_tau: :param vocab_stat: TF for phi sparse/smooth reg. :param ...
model_fn.py
__init__
ilyakhov/pytorch-wntm
3
python
def __init__(self, n_topics, vocab_size, doc_count, batch_size, batch_steps, num_collection_passes, num_documents_passes, device, dtype, phi_smooth_sparse_tau=0.0, theta_smooth_sparse_tau=0.0, vocab_stat=None, mode='v1', dump_phi_freq=None, dump_phi_path=None, log_perplexity=False, log_matrix_norms=False): '\n ...
def __init__(self, n_topics, vocab_size, doc_count, batch_size, batch_steps, num_collection_passes, num_documents_passes, device, dtype, phi_smooth_sparse_tau=0.0, theta_smooth_sparse_tau=0.0, vocab_stat=None, mode='v1', dump_phi_freq=None, dump_phi_path=None, log_perplexity=False, log_matrix_norms=False): '\n ...
b5779dd61f7e11cfd0b5268f7a968eddaed9ed3de7d26b69dcad4cc43b563c5b
def perplexity(self): '\n Full:\n exp(-1/n_m * sum(n_dw * ln(mm(self.phi, self.theta))))\n :return:\n ' phi = self.phi.cpu() theta = self.theta.cpu() n_m = torch.sum(self.n_dw) one = torch.tensor(1, dtype=self.dtype, device='cpu:0') mm = torch.mm(phi, theta) mm = ...
Full: exp(-1/n_m * sum(n_dw * ln(mm(self.phi, self.theta)))) :return:
model_fn.py
perplexity
ilyakhov/pytorch-wntm
3
python
def perplexity(self): '\n Full:\n exp(-1/n_m * sum(n_dw * ln(mm(self.phi, self.theta))))\n :return:\n ' phi = self.phi.cpu() theta = self.theta.cpu() n_m = torch.sum(self.n_dw) one = torch.tensor(1, dtype=self.dtype, device='cpu:0') mm = torch.mm(phi, theta) mm = ...
def perplexity(self): '\n Full:\n exp(-1/n_m * sum(n_dw * ln(mm(self.phi, self.theta))))\n :return:\n ' phi = self.phi.cpu() theta = self.theta.cpu() n_m = torch.sum(self.n_dw) one = torch.tensor(1, dtype=self.dtype, device='cpu:0') mm = torch.mm(phi, theta) mm = ...
01da978c17506836ad21b2c7c41f4cc9a1e052a0263afe9d907841fc1af609bf
def e_step(self, n_dw, doc_inxs, context_batch, gather_ndw=False): "\n :param n_dw: freq of term 'w' occurrence in doc 'd'\n [[1, 1, 2, 1, 2] - for each word in a doc, ...] —\n [batch_size, context_size]\n :param doc_inxs: Tensor of doc inxs with shape [batch_si...
:param n_dw: freq of term 'w' occurrence in doc 'd' [[1, 1, 2, 1, 2] - for each word in a doc, ...] — [batch_size, context_size] :param doc_inxs: Tensor of doc inxs with shape [batch_size] :param context_batch: Tensor of word inxs with shape [batch_size, context_size] :return:
model_fn.py
e_step
ilyakhov/pytorch-wntm
3
python
def e_step(self, n_dw, doc_inxs, context_batch, gather_ndw=False): "\n :param n_dw: freq of term 'w' occurrence in doc 'd'\n [[1, 1, 2, 1, 2] - for each word in a doc, ...] —\n [batch_size, context_size]\n :param doc_inxs: Tensor of doc inxs with shape [batch_si...
def e_step(self, n_dw, doc_inxs, context_batch, gather_ndw=False): "\n :param n_dw: freq of term 'w' occurrence in doc 'd'\n [[1, 1, 2, 1, 2] - for each word in a doc, ...] —\n [batch_size, context_size]\n :param doc_inxs: Tensor of doc inxs with shape [batch_si...
f5c59aa64191544cc1bd3079d8736988394739525aacbd76217f49bc91b628cf
def _group_by_with_index_mapping(self, true_labels, samples): '\n TODO: implement stuff from "Notes of reproducibility"\n :param true_labels: indices for initial embedding matrix\n [100, 100, 200, 200, 0] =>\n [0, 100, 200], [1, 1, 2, 2, 0], [1, 2, 2]\n :param samples: 2D-...
TODO: implement stuff from "Notes of reproducibility" :param true_labels: indices for initial embedding matrix [100, 100, 200, 200, 0] => [0, 100, 200], [1, 1, 2, 2, 0], [1, 2, 2] :param samples: 2D-tensor with vectors to agg(sum) [[0.1, .0], [-0.1, 0.2], [...], [...], [...]] :return: agg(sum): [[...], [.0,...
model_fn.py
_group_by_with_index_mapping
ilyakhov/pytorch-wntm
3
python
def _group_by_with_index_mapping(self, true_labels, samples): '\n TODO: implement stuff from "Notes of reproducibility"\n :param true_labels: indices for initial embedding matrix\n [100, 100, 200, 200, 0] =>\n [0, 100, 200], [1, 1, 2, 2, 0], [1, 2, 2]\n :param samples: 2D-...
def _group_by_with_index_mapping(self, true_labels, samples): '\n TODO: implement stuff from "Notes of reproducibility"\n :param true_labels: indices for initial embedding matrix\n [100, 100, 200, 200, 0] =>\n [0, 100, 200], [1, 1, 2, 2, 0], [1, 2, 2]\n :param samples: 2D-...
e02a2c01f27168e013e450c577e34bf6c15f8694e152682bdd7fe34eb2b1fbca
def m_step(self): '\n Rational EM. The same is "smoothed/sparsed" with reg_tau=0.0\n :return:\n ' with torch.cuda.device(self.device): new_phi = (self.n_wt / self.n_t.view((- 1), self.n_topics)) phi_norm = ((torch.sum(((self.phi - new_phi) ** 2)) ** 1) / 2) self.phi_...
Rational EM. The same is "smoothed/sparsed" with reg_tau=0.0 :return:
model_fn.py
m_step
ilyakhov/pytorch-wntm
3
python
def m_step(self): '\n Rational EM. The same is "smoothed/sparsed" with reg_tau=0.0\n :return:\n ' with torch.cuda.device(self.device): new_phi = (self.n_wt / self.n_t.view((- 1), self.n_topics)) phi_norm = ((torch.sum(((self.phi - new_phi) ** 2)) ** 1) / 2) self.phi_...
def m_step(self): '\n Rational EM. The same is "smoothed/sparsed" with reg_tau=0.0\n :return:\n ' with torch.cuda.device(self.device): new_phi = (self.n_wt / self.n_t.view((- 1), self.n_topics)) phi_norm = ((torch.sum(((self.phi - new_phi) ** 2)) ** 1) / 2) self.phi_...
94c1725291d84daf6a5669344a0e8ea65e0acb603351766874b332a90a58860a
def run_v2(self, batch_generator): '\n M-step after each E-step. Not tested enough!\n :param batch_generator:\n :return:\n ' for _ in tqdm(range(self.num_collection_passes), total=self.num_collection_passes, desc='Passing through collection: '): old_phi = self.phi.cpu() ...
M-step after each E-step. Not tested enough! :param batch_generator: :return:
model_fn.py
run_v2
ilyakhov/pytorch-wntm
3
python
def run_v2(self, batch_generator): '\n M-step after each E-step. Not tested enough!\n :param batch_generator:\n :return:\n ' for _ in tqdm(range(self.num_collection_passes), total=self.num_collection_passes, desc='Passing through collection: '): old_phi = self.phi.cpu() ...
def run_v2(self, batch_generator): '\n M-step after each E-step. Not tested enough!\n :param batch_generator:\n :return:\n ' for _ in tqdm(range(self.num_collection_passes), total=self.num_collection_passes, desc='Passing through collection: '): old_phi = self.phi.cpu() ...
872522fff92ce50f350fb951e543f6f2a13faa14171af9037d1d807fe23dc516
def __rectify_v2(self, t): "\n Rectification on each step is expensive operation if\n data are being copied on cpu. For train_mode='v2' no data copy\n to 'cpu'(RAM) has being used.\n :param t:\n :return:\n " t = torch.where((t < self.zero), self.zero, t) t = torch.w...
Rectification on each step is expensive operation if data are being copied on cpu. For train_mode='v2' no data copy to 'cpu'(RAM) has being used. :param t: :return:
model_fn.py
__rectify_v2
ilyakhov/pytorch-wntm
3
python
def __rectify_v2(self, t): "\n Rectification on each step is expensive operation if\n data are being copied on cpu. For train_mode='v2' no data copy\n to 'cpu'(RAM) has being used.\n :param t:\n :return:\n " t = torch.where((t < self.zero), self.zero, t) t = torch.w...
def __rectify_v2(self, t): "\n Rectification on each step is expensive operation if\n data are being copied on cpu. For train_mode='v2' no data copy\n to 'cpu'(RAM) has being used.\n :param t:\n :return:\n " t = torch.where((t < self.zero), self.zero, t) t = torch.w...
f30fd7a798c581dfc36dd85174c3569d6a36a94825b6fff467acf153834dba2e
def __init__(self, n_topics, vocab_size, doc_count, batch_size, batch_steps, num_collection_passes, num_documents_passes, device, dtype, phi_smooth_sparse_tau=0.0, theta_smooth_sparse_tau=0.0, vocab_stat=None, mode='v1', dump_phi_freq=None, dump_phi_path=None, log_perplexity=False, log_matrix_norms=False): '\n ...
:param n_topics: :param vocab_size: :param doc_count: :param context_size: :param batch_size: :param batch_steps: :param num_collection_passes: :param num_documents_passes: :param device: :param dtype: :param phi_smooth_sparse_tau: :param theta_smooth_sparse_tau: :param vocab_stat: TF for phi sparse/smooth reg. :param ...
model_fn.py
__init__
ilyakhov/pytorch-wntm
3
python
def __init__(self, n_topics, vocab_size, doc_count, batch_size, batch_steps, num_collection_passes, num_documents_passes, device, dtype, phi_smooth_sparse_tau=0.0, theta_smooth_sparse_tau=0.0, vocab_stat=None, mode='v1', dump_phi_freq=None, dump_phi_path=None, log_perplexity=False, log_matrix_norms=False): '\n ...
def __init__(self, n_topics, vocab_size, doc_count, batch_size, batch_steps, num_collection_passes, num_documents_passes, device, dtype, phi_smooth_sparse_tau=0.0, theta_smooth_sparse_tau=0.0, vocab_stat=None, mode='v1', dump_phi_freq=None, dump_phi_path=None, log_perplexity=False, log_matrix_norms=False): '\n ...
6913eb75a0bbcd8aae093006ef21a9b0eccddc1433cf314193adea566edec713
def e_step(self, n_dw, doc_inxs, context_batch, gather_ndw=False): "\n :param n_dw: freq of term 'w' occurrence in doc 'd'\n [[1, 1, 2, 1, 2] - for each word in a doc, ...] —\n [batch_size, context_size]\n :param doc_inxs: Tensor of doc inxs with shape [batch_si...
:param n_dw: freq of term 'w' occurrence in doc 'd' [[1, 1, 2, 1, 2] - for each word in a doc, ...] — [batch_size, context_size] :param doc_inxs: Tensor of doc inxs with shape [batch_size] :param context_batch: Tensor of word inxs with shape [batch_size, context_size] :param first: 'first' ite...
model_fn.py
e_step
ilyakhov/pytorch-wntm
3
python
def e_step(self, n_dw, doc_inxs, context_batch, gather_ndw=False): "\n :param n_dw: freq of term 'w' occurrence in doc 'd'\n [[1, 1, 2, 1, 2] - for each word in a doc, ...] —\n [batch_size, context_size]\n :param doc_inxs: Tensor of doc inxs with shape [batch_si...
def e_step(self, n_dw, doc_inxs, context_batch, gather_ndw=False): "\n :param n_dw: freq of term 'w' occurrence in doc 'd'\n [[1, 1, 2, 1, 2] - for each word in a doc, ...] —\n [batch_size, context_size]\n :param doc_inxs: Tensor of doc inxs with shape [batch_si...
88c8670d83f2cde855d0d0ab6e6b666f8b2cf79bcb84852a81fa8ceb54688bec
def __init__(self, filters, p_m, get_mask, apply_mask, path_json='src/python_code/settings.json'): '\n CNN decoder layers (tensorflow 2 book)\n :param filters: list filters\n :param path_json: path settings\n ' settings = json.load(open(path_json))['Model'] hyperparameters = sett...
CNN decoder layers (tensorflow 2 book) :param filters: list filters :param path_json: path settings
src/python_code/Models/EAE_models/DecoderCNN.py
__init__
ipmach/Thesis2021
0
python
def __init__(self, filters, p_m, get_mask, apply_mask, path_json='src/python_code/settings.json'): '\n CNN decoder layers (tensorflow 2 book)\n :param filters: list filters\n :param path_json: path settings\n ' settings = json.load(open(path_json))['Model'] hyperparameters = sett...
def __init__(self, filters, p_m, get_mask, apply_mask, path_json='src/python_code/settings.json'): '\n CNN decoder layers (tensorflow 2 book)\n :param filters: list filters\n :param path_json: path settings\n ' settings = json.load(open(path_json))['Model'] hyperparameters = sett...
6809d902bbacf9eac6c00c94ba9882f5b7bc3526f525fb4d5d264651951d58da
def initialize_masks(self): '\n Initialize masks for the model\n :return:\n ' self._masks_ = [] for i in self._layers_: self.get_mask(i.get_weights()[0].shape, p=self.p_m)
Initialize masks for the model :return:
src/python_code/Models/EAE_models/DecoderCNN.py
initialize_masks
ipmach/Thesis2021
0
python
def initialize_masks(self): '\n Initialize masks for the model\n :return:\n ' self._masks_ = [] for i in self._layers_: self.get_mask(i.get_weights()[0].shape, p=self.p_m)
def initialize_masks(self): '\n Initialize masks for the model\n :return:\n ' self._masks_ = [] for i in self._layers_: self.get_mask(i.get_weights()[0].shape, p=self.p_m)<|docstring|>Initialize masks for the model :return:<|endoftext|>
6939b7bdd5414e29efdb790dced6d59dadc90a6f90011df8566df9288a0bbd20
def apply_masks(self): '\n Apply masks to all layers of the model\n :return:\n ' for (l, m) in zip(self._layers_, self._masks_): new_weights = self.apply_mask(m, l.get_weights()) l.set_weights(new_weights)
Apply masks to all layers of the model :return:
src/python_code/Models/EAE_models/DecoderCNN.py
apply_masks
ipmach/Thesis2021
0
python
def apply_masks(self): '\n Apply masks to all layers of the model\n :return:\n ' for (l, m) in zip(self._layers_, self._masks_): new_weights = self.apply_mask(m, l.get_weights()) l.set_weights(new_weights)
def apply_masks(self): '\n Apply masks to all layers of the model\n :return:\n ' for (l, m) in zip(self._layers_, self._masks_): new_weights = self.apply_mask(m, l.get_weights()) l.set_weights(new_weights)<|docstring|>Apply masks to all layers of the model :return:<|endoftex...
e863dfd88212590acb95344865d47f979802c29a18849919053f337bdcffad5a
def binary_exp(n): 'Binary exponentiation algorithm' cur = base res = 1 if (not n): return res while True: if (n & 1): res *= cur if (n == 1): return res cur *= cur n >>= 1
Binary exponentiation algorithm
tests/perfomance/power.py
binary_exp
borzunov/cpmoptimize
121
python
def binary_exp(n): cur = base res = 1 if (not n): return res while True: if (n & 1): res *= cur if (n == 1): return res cur *= cur n >>= 1
def binary_exp(n): cur = base res = 1 if (not n): return res while True: if (n & 1): res *= cur if (n == 1): return res cur *= cur n >>= 1<|docstring|>Binary exponentiation algorithm<|endoftext|>
f3abeb105731c3a677d6412c50614bc26a7a908b5482a79c8e232b2344973cbe
def train(train_generator, test_generator, criterion, model, epochs, optimizer, Batch_size): 'Function to train a pytorch model\n Args:\n train_generator: pytorch train generator instance\n test_generator: pytorch test generator instance\n criterion: pytorch criterion\n model: pytorch...
Function to train a pytorch model Args: train_generator: pytorch train generator instance test_generator: pytorch test generator instance criterion: pytorch criterion model: pytorch model epochs: int, number of epochs to train optmizer: pytorch optmizer Batch_size: int, batch size for forwar...
60_Grainsize_project/DL_functions/DL_train.py
train
htorodriguez/grainsize_measure
0
python
def train(train_generator, test_generator, criterion, model, epochs, optimizer, Batch_size): 'Function to train a pytorch model\n Args:\n train_generator: pytorch train generator instance\n test_generator: pytorch test generator instance\n criterion: pytorch criterion\n model: pytorch...
def train(train_generator, test_generator, criterion, model, epochs, optimizer, Batch_size): 'Function to train a pytorch model\n Args:\n train_generator: pytorch train generator instance\n test_generator: pytorch test generator instance\n criterion: pytorch criterion\n model: pytorch...
04e79e025310e9b0232e0401f757198630acefbc7e907eef0399631aa9d9ce03
@fitparam(param_name='flat_topP', param_latex='$P^{mie}_\\mathrm{top}$', default_mode='log', default_fit=False, default_bounds=[1e-20, 1]) def mieTopPressure(self): '\n Pressure at top of absorbing region in Pa\n ' return self._mie_top_pressure
Pressure at top of absorbing region in Pa
taurex/contributions/flatmie.py
mieTopPressure
ucl-exoplanets/TauREx3_public
10
python
@fitparam(param_name='flat_topP', param_latex='$P^{mie}_\\mathrm{top}$', default_mode='log', default_fit=False, default_bounds=[1e-20, 1]) def mieTopPressure(self): '\n \n ' return self._mie_top_pressure
@fitparam(param_name='flat_topP', param_latex='$P^{mie}_\\mathrm{top}$', default_mode='log', default_fit=False, default_bounds=[1e-20, 1]) def mieTopPressure(self): '\n \n ' return self._mie_top_pressure<|docstring|>Pressure at top of absorbing region in Pa<|endoftext|>
9b1a1534d195ab21458fb1320f77668ae73fce0e6fc0d659cdfe14925d54a6dd
@fitparam(param_name='flat_bottomP', param_latex='$P^{mie}_\\mathrm{bottom}$', default_mode='log', default_fit=False, default_bounds=[1e-20, 1]) def mieBottomPressure(self): '\n Pressure at bottom of absorbing region in Pa\n ' return self._mie_bottom_pressure
Pressure at bottom of absorbing region in Pa
taurex/contributions/flatmie.py
mieBottomPressure
ucl-exoplanets/TauREx3_public
10
python
@fitparam(param_name='flat_bottomP', param_latex='$P^{mie}_\\mathrm{bottom}$', default_mode='log', default_fit=False, default_bounds=[1e-20, 1]) def mieBottomPressure(self): '\n \n ' return self._mie_bottom_pressure
@fitparam(param_name='flat_bottomP', param_latex='$P^{mie}_\\mathrm{bottom}$', default_mode='log', default_fit=False, default_bounds=[1e-20, 1]) def mieBottomPressure(self): '\n \n ' return self._mie_bottom_pressure<|docstring|>Pressure at bottom of absorbing region in Pa<|endoftext|>
52f3d0e5a67b7806b3c1360f72c13b1bde0f0c1ff55b30e52eb6b874596a1295
@fitparam(param_name='flat_mix_ratio', param_latex='$\\chi_\\mathrm{mie}$', default_mode='log', default_fit=False, default_bounds=[1e-20, 1]) def mieMixing(self): '\n Opacity of absorbing region in m2\n ' return self._mie_mix
Opacity of absorbing region in m2
taurex/contributions/flatmie.py
mieMixing
ucl-exoplanets/TauREx3_public
10
python
@fitparam(param_name='flat_mix_ratio', param_latex='$\\chi_\\mathrm{mie}$', default_mode='log', default_fit=False, default_bounds=[1e-20, 1]) def mieMixing(self): '\n \n ' return self._mie_mix
@fitparam(param_name='flat_mix_ratio', param_latex='$\\chi_\\mathrm{mie}$', default_mode='log', default_fit=False, default_bounds=[1e-20, 1]) def mieMixing(self): '\n \n ' return self._mie_mix<|docstring|>Opacity of absorbing region in m2<|endoftext|>
5bcc51c3d54fd573aef99598ef45fe097a57863f03bf89f35d734fd152d06d1d
def prepare_each(self, model, wngrid): '\n Computes and flat absorbing opacity for\n the pressure regions given\n\n Parameters\n ----------\n model: :class:`~taurex.model.model.ForwardModel`\n Forward model\n\n wngrid: :obj:`array`\n Wavenumber grid\n\...
Computes and flat absorbing opacity for the pressure regions given Parameters ---------- model: :class:`~taurex.model.model.ForwardModel` Forward model wngrid: :obj:`array` Wavenumber grid Yields ------ component: :obj:`tuple` of type (str, :obj:`array`) ``Flat`` and the weighted mie opacity.
taurex/contributions/flatmie.py
prepare_each
ucl-exoplanets/TauREx3_public
10
python
def prepare_each(self, model, wngrid): '\n Computes and flat absorbing opacity for\n the pressure regions given\n\n Parameters\n ----------\n model: :class:`~taurex.model.model.ForwardModel`\n Forward model\n\n wngrid: :obj:`array`\n Wavenumber grid\n\...
def prepare_each(self, model, wngrid): '\n Computes and flat absorbing opacity for\n the pressure regions given\n\n Parameters\n ----------\n model: :class:`~taurex.model.model.ForwardModel`\n Forward model\n\n wngrid: :obj:`array`\n Wavenumber grid\n\...
b9d5e19d475f55978824f8d0e9c9f4915d3a46e6905ffe0d99ad4181c8cfc155
def __init__(self, account_id=None, document_id=None, external_id=None, signer_id=None, external_signer_id=None, error=None, sign_success=None, expires=None, aborted=None, additional_properties={}): 'Constructor for the JwtPayload class' self.account_id = account_id self.document_id = document_id self.e...
Constructor for the JwtPayload class
idfy_rest_client/models/jwt_payload.py
__init__
dealflowteam/Idfy
0
python
def __init__(self, account_id=None, document_id=None, external_id=None, signer_id=None, external_signer_id=None, error=None, sign_success=None, expires=None, aborted=None, additional_properties={}): self.account_id = account_id self.document_id = document_id self.external_id = external_id self.sign...
def __init__(self, account_id=None, document_id=None, external_id=None, signer_id=None, external_signer_id=None, error=None, sign_success=None, expires=None, aborted=None, additional_properties={}): self.account_id = account_id self.document_id = document_id self.external_id = external_id self.sign...
dc3c69c195d84776dc8c0d2ee75525a35d738145a857e9e6cd3464d9280c1c3b
@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.
idfy_rest_client/models/jwt_payload.py
from_dictionary
dealflowteam/Idfy
0
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...
6a0ebe3d8c82ef380cbf357b98235e7d3b36597612a2759116ce150525e331b0
@click.command() @click.argument('dir', default='env') @click.option('-n', '--name', metavar='NAME', help='Environment name (default is env parent directory name).') @click.option('-p', '--python', metavar='VERSION', help='Version of Python to use for the environment.') @click.option('-g', '--guild', metavar='VERSION_O...
Initialize a Guild environment. `init` initializes a Guild environment in `DIR`, which is the current directory by default. `init` creates a virtual environment in `DIR` using `virtualenv`. Use `--python` to specify the Python interpreter to use within the generated virtual environment. By default, the default Pytho...
guild/commands/init.py
init
flamato/guildai
1
python
@click.command() @click.argument('dir', default='env') @click.option('-n', '--name', metavar='NAME', help='Environment name (default is env parent directory name).') @click.option('-p', '--python', metavar='VERSION', help='Version of Python to use for the environment.') @click.option('-g', '--guild', metavar='VERSION_O...
@click.command() @click.argument('dir', default='env') @click.option('-n', '--name', metavar='NAME', help='Environment name (default is env parent directory name).') @click.option('-p', '--python', metavar='VERSION', help='Version of Python to use for the environment.') @click.option('-g', '--guild', metavar='VERSION_O...
11d30c192889d10b4d2a0c840d19812496fef21654e5734c2ff0eda9f97a8e3e
def test_invalid(self): 'Invalid pipeline param name and op_name.' with self.assertRaises(ValueError): p = PipelineParam(name='123_abc')
Invalid pipeline param name and op_name.
sdk/python/tests/dsl/pipeline_param_tests.py
test_invalid
awesome-archive/pipelines
2
python
def test_invalid(self): with self.assertRaises(ValueError): p = PipelineParam(name='123_abc')
def test_invalid(self): with self.assertRaises(ValueError): p = PipelineParam(name='123_abc')<|docstring|>Invalid pipeline param name and op_name.<|endoftext|>
689fa98e57057a93774e13840a518d78d646fcb9db4484c98d86d77b76f7b516
def test_str_repr(self): 'Test string representation.' p = PipelineParam(name='param1', op_name='op1') self.assertEqual('{{pipelineparam:op=op1;name=param1;value=}}', str(p)) p = PipelineParam(name='param2') self.assertEqual('{{pipelineparam:op=;name=param2;value=}}', str(p)) p = PipelineParam(n...
Test string representation.
sdk/python/tests/dsl/pipeline_param_tests.py
test_str_repr
awesome-archive/pipelines
2
python
def test_str_repr(self): p = PipelineParam(name='param1', op_name='op1') self.assertEqual('{{pipelineparam:op=op1;name=param1;value=}}', str(p)) p = PipelineParam(name='param2') self.assertEqual('{{pipelineparam:op=;name=param2;value=}}', str(p)) p = PipelineParam(name='param3', value='value3')...
def test_str_repr(self): p = PipelineParam(name='param1', op_name='op1') self.assertEqual('{{pipelineparam:op=op1;name=param1;value=}}', str(p)) p = PipelineParam(name='param2') self.assertEqual('{{pipelineparam:op=;name=param2;value=}}', str(p)) p = PipelineParam(name='param3', value='value3')...
3646d646fd9d26c6faeae5901453bfb29f56cc9c9a658ce4759d6629900c295e
def load_indicators(): 'Load indicators from file.\n\n :return:\n ' ti = list() try: ti_file: Path = Path(__file__).with_name('json').joinpath('tv_indicators.json') if (ti_file.exists() and ti_file.is_file()): text = ti_file.read_text() ti = json.loads(text) ...
Load indicators from file. :return:
pytvc/cli.py
load_indicators
havocesp/pytvc
12
python
def load_indicators(): 'Load indicators from file.\n\n :return:\n ' ti = list() try: ti_file: Path = Path(__file__).with_name('json').joinpath('tv_indicators.json') if (ti_file.exists() and ti_file.is_file()): text = ti_file.read_text() ti = json.loads(text) ...
def load_indicators(): 'Load indicators from file.\n\n :return:\n ' ti = list() try: ti_file: Path = Path(__file__).with_name('json').joinpath('tv_indicators.json') if (ti_file.exists() and ti_file.is_file()): text = ti_file.read_text() ti = json.loads(text) ...
153ad8de4b913930279e729ac841089f1650d23bd1f1ae44f8a40efc38f28022
def list_indicators() -> int: 'List all supported indicators.\n\n :return: 0 if all was fine.\n ' ti = load_indicators() indicators = [f'- {v:<30}' for v in ti] indicators.sort() for i in indicators: print(i) return 0
List all supported indicators. :return: 0 if all was fine.
pytvc/cli.py
list_indicators
havocesp/pytvc
12
python
def list_indicators() -> int: 'List all supported indicators.\n\n :return: 0 if all was fine.\n ' ti = load_indicators() indicators = [f'- {v:<30}' for v in ti] indicators.sort() for i in indicators: print(i) return 0
def list_indicators() -> int: 'List all supported indicators.\n\n :return: 0 if all was fine.\n ' ti = load_indicators() indicators = [f'- {v:<30}' for v in ti] indicators.sort() for i in indicators: print(i) return 0<|docstring|>List all supported indicators. :return: 0 if all wa...
b932f3dda037f12cfb6f41ce264ad66e553213b9a2ce318e1340f7cfa29c7248
def main(args) -> int: 'TradingView Chart parserr.\n \n :param Namespace args:\n :return:\n ' tvc = TradingViewChart() tvc.launch(**vars(args)) return 0
TradingView Chart parserr. :param Namespace args: :return:
pytvc/cli.py
main
havocesp/pytvc
12
python
def main(args) -> int: 'TradingView Chart parserr.\n \n :param Namespace args:\n :return:\n ' tvc = TradingViewChart() tvc.launch(**vars(args)) return 0
def main(args) -> int: 'TradingView Chart parserr.\n \n :param Namespace args:\n :return:\n ' tvc = TradingViewChart() tvc.launch(**vars(args)) return 0<|docstring|>TradingView Chart parserr. :param Namespace args: :return:<|endoftext|>
aacd552f635f6c6a0a64708728b14f03d00f99df080dbb827f28256341916eee
def run(): 'As CLI starting point, this function dispatch argument parsing to be supplied to main function.' base_markets = ['BTC', 'TUSD', 'USDT', 'USD', 'EUR', 'PAX', 'USDS'] exchanges = ['binance', 'hitbtc2', 'poloniex', 'kraken', 'coinbase', 'cexio'] exchanges = {e: e.strip('_12345 ') for e in excha...
As CLI starting point, this function dispatch argument parsing to be supplied to main function.
pytvc/cli.py
run
havocesp/pytvc
12
python
def run(): base_markets = ['BTC', 'TUSD', 'USDT', 'USD', 'EUR', 'PAX', 'USDS'] exchanges = ['binance', 'hitbtc2', 'poloniex', 'kraken', 'coinbase', 'cexio'] exchanges = {e: e.strip('_12345 ') for e in exchanges} parser = argparse.ArgumentParser() parser.add_argument('-l, --list-indicators', act...
def run(): base_markets = ['BTC', 'TUSD', 'USDT', 'USD', 'EUR', 'PAX', 'USDS'] exchanges = ['binance', 'hitbtc2', 'poloniex', 'kraken', 'coinbase', 'cexio'] exchanges = {e: e.strip('_12345 ') for e in exchanges} parser = argparse.ArgumentParser() parser.add_argument('-l, --list-indicators', act...
360dba7075008b5182ff54dff468af1e5cd97787bff6a069d85f2f46090c21c2
def get_location(loc): '\n currently working only on my computer\n english Model\n english.muc.7class.distsim.crf.ser.gz\n german Models\n german.dewac_175m_600.crf.ser.gz\n german.hgc_175m_600.crf.ser.gz\n ' st = StanfordNERTagger('stanford-ner-2015-12-09/classifiers/english.mu...
currently working only on my computer english Model english.muc.7class.distsim.crf.ser.gz german Models german.dewac_175m_600.crf.ser.gz german.hgc_175m_600.crf.ser.gz
extractor.py
get_location
phucdev/weatherbot
0
python
def get_location(loc): '\n currently working only on my computer\n english Model\n english.muc.7class.distsim.crf.ser.gz\n german Models\n german.dewac_175m_600.crf.ser.gz\n german.hgc_175m_600.crf.ser.gz\n ' st = StanfordNERTagger('stanford-ner-2015-12-09/classifiers/english.mu...
def get_location(loc): '\n currently working only on my computer\n english Model\n english.muc.7class.distsim.crf.ser.gz\n german Models\n german.dewac_175m_600.crf.ser.gz\n german.hgc_175m_600.crf.ser.gz\n ' st = StanfordNERTagger('stanford-ner-2015-12-09/classifiers/english.mu...
6e691b4afac0e44e94ed72229fd79a3ae83be04d4f26008245f0ce566c7d973e
def flask_post_json(): 'Ah the joys of frameworks! They do so much work for you\n that they get in the way of sane operation!' if (request.json != None): return request.json elif ((request.data != None) and (request.data.decode('utf8') != u'')): return json.loads(request.data.decode('u...
Ah the joys of frameworks! They do so much work for you that they get in the way of sane operation!
server.py
flask_post_json
dcones/CMPUT404-assignment-ajax
1
python
def flask_post_json(): 'Ah the joys of frameworks! They do so much work for you\n that they get in the way of sane operation!' if (request.json != None): return request.json elif ((request.data != None) and (request.data.decode('utf8') != u)): return json.loads(request.data.decode('utf...
def flask_post_json(): 'Ah the joys of frameworks! They do so much work for you\n that they get in the way of sane operation!' if (request.json != None): return request.json elif ((request.data != None) and (request.data.decode('utf8') != u)): return json.loads(request.data.decode('utf...
9dca322af1c95789df86925512386d1aa5155f41fb9ec3ab474d222c3cc149f8
def __init__(self, byte: int, line: int, index: int, args: List[Token], resolved_vars: dict={}, resolved_gotos: dict={}): 'Represents a compilable line.\n\n Args:\n byte (int): The bytecode byte of the instruction associated.\n ' self.byte = byte self.args = args self.line = lin...
Represents a compilable line. Args: byte (int): The bytecode byte of the instruction associated.
assemblyish/compiler.py
__init__
vcokltfre/assemblyish
1
python
def __init__(self, byte: int, line: int, index: int, args: List[Token], resolved_vars: dict={}, resolved_gotos: dict={}): 'Represents a compilable line.\n\n Args:\n byte (int): The bytecode byte of the instruction associated.\n ' self.byte = byte self.args = args self.line = lin...
def __init__(self, byte: int, line: int, index: int, args: List[Token], resolved_vars: dict={}, resolved_gotos: dict={}): 'Represents a compilable line.\n\n Args:\n byte (int): The bytecode byte of the instruction associated.\n ' self.byte = byte self.args = args self.line = lin...
e439d61e76b4636fc0521f928161011d7c151ea40fd8f512276ad88ef749d82f
def __init__(self, filename: str, tokens: List[Token]): "A compiler class for assemblyish.\n\n Args:\n filename (str): The filename of the file being compiled. Used for error logging.\n tokens (List[Token]): A list of Token objects representing the program's code.\n " self.fi...
A compiler class for assemblyish. Args: filename (str): The filename of the file being compiled. Used for error logging. tokens (List[Token]): A list of Token objects representing the program's code.
assemblyish/compiler.py
__init__
vcokltfre/assemblyish
1
python
def __init__(self, filename: str, tokens: List[Token]): "A compiler class for assemblyish.\n\n Args:\n filename (str): The filename of the file being compiled. Used for error logging.\n tokens (List[Token]): A list of Token objects representing the program's code.\n " self.fi...
def __init__(self, filename: str, tokens: List[Token]): "A compiler class for assemblyish.\n\n Args:\n filename (str): The filename of the file being compiled. Used for error logging.\n tokens (List[Token]): A list of Token objects representing the program's code.\n " self.fi...
d33d96144f3fc75049c4af3beafe357192a1031f88ab8e0bd8f3948b63422447
def calc_cos(self, batch_size, n_tau=32): '\n Calculating the cosinus values depending on the number of tau samples\n ' taus = th.rand(batch_size, n_tau).unsqueeze((- 1)).to(self.device) cos = th.cos((taus * self.pis.to(self.device))) assert (cos.shape == (batch_size, n_tau, self.n_cos)), ...
Calculating the cosinus values depending on the number of tau samples
custom_algos/d3pg/policies.py
calc_cos
vinerich/rl-baselines3-zoo
0
python
def calc_cos(self, batch_size, n_tau=32): '\n \n ' taus = th.rand(batch_size, n_tau).unsqueeze((- 1)).to(self.device) cos = th.cos((taus * self.pis.to(self.device))) assert (cos.shape == (batch_size, n_tau, self.n_cos)), 'cos shape is incorrect' return (cos, taus)
def calc_cos(self, batch_size, n_tau=32): '\n \n ' taus = th.rand(batch_size, n_tau).unsqueeze((- 1)).to(self.device) cos = th.cos((taus * self.pis.to(self.device))) assert (cos.shape == (batch_size, n_tau, self.n_cos)), 'cos shape is incorrect' return (cos, taus)<|docstring|>Calculati...
37c18a736586dca84f0ca40fdb8086e4296534633e48f7a669439c6ac73bd86d
@property def id(self): 'Returns the SHA1 ID of this commitish' if (self._id is None): self._id = self.repo.revparse(self.ref) return self._id
Returns the SHA1 ID of this commitish
src/geogigpy/commitish.py
id
boundlessgeo/geogig-py
7
python
@property def id(self): if (self._id is None): self._id = self.repo.revparse(self.ref) return self._id
@property def id(self): if (self._id is None): self._id = self.repo.revparse(self.ref) return self._id<|docstring|>Returns the SHA1 ID of this commitish<|endoftext|>
558d36ca1237fd8f9b6421157a3d73a8811139acdf1d4e24d7e249a945a71301
def log(self): 'Return the history up to this commitish' return self.repo.log(self.ref)
Return the history up to this commitish
src/geogigpy/commitish.py
log
boundlessgeo/geogig-py
7
python
def log(self): return self.repo.log(self.ref)
def log(self): return self.repo.log(self.ref)<|docstring|>Return the history up to this commitish<|endoftext|>
4074d6c0af2d8f8e957fdc031e1c04d62c3215142706c5343da440cfdb17065d
@property def root(self): 'Returns a Tree that represents the root tree at this snapshot' return Tree(self.repo, self.ref)
Returns a Tree that represents the root tree at this snapshot
src/geogigpy/commitish.py
root
boundlessgeo/geogig-py
7
python
@property def root(self): return Tree(self.repo, self.ref)
@property def root(self): return Tree(self.repo, self.ref)<|docstring|>Returns a Tree that represents the root tree at this snapshot<|endoftext|>
923927d34044c67cae9fcf8598d92d502d155fe1e4dc71269fa4fc559ff2a000
def checkout(self): 'Checks out this commitish, and set it as the current HEAD' self.repo.checkout(self.ref)
Checks out this commitish, and set it as the current HEAD
src/geogigpy/commitish.py
checkout
boundlessgeo/geogig-py
7
python
def checkout(self): self.repo.checkout(self.ref)
def checkout(self): self.repo.checkout(self.ref)<|docstring|>Checks out this commitish, and set it as the current HEAD<|endoftext|>
b001b8d1de85228124517b705ad769abc10815102199ba0ffb1f14831a71b065
def diff(self): 'Returns a list of DiffEntry with all changes introduced by this commitish' if (self._diff is None): self._diff = self.repo.diff((self.ref + '~1'), self.ref) return self._diff
Returns a list of DiffEntry with all changes introduced by this commitish
src/geogigpy/commitish.py
diff
boundlessgeo/geogig-py
7
python
def diff(self): if (self._diff is None): self._diff = self.repo.diff((self.ref + '~1'), self.ref) return self._diff
def diff(self): if (self._diff is None): self._diff = self.repo.diff((self.ref + '~1'), self.ref) return self._diff<|docstring|>Returns a list of DiffEntry with all changes introduced by this commitish<|endoftext|>
92690b4ebc00a873c04a81b7440c3be5a6bc95465999d29af322c528a5727726
@property def parent(self): 'Returns a commitish that represents the parent of this one' return Commitish(self.repo, (self.ref + '~1'))
Returns a commitish that represents the parent of this one
src/geogigpy/commitish.py
parent
boundlessgeo/geogig-py
7
python
@property def parent(self): return Commitish(self.repo, (self.ref + '~1'))
@property def parent(self): return Commitish(self.repo, (self.ref + '~1'))<|docstring|>Returns a commitish that represents the parent of this one<|endoftext|>
656eb7fd477a9f3a5afe33af99fa28aee264f5b1e5f7c44953c767d8d22a4396
def humantext(self): 'Returns a nice human-readable description of the commitish' headid = self.repo.revparse(self.repo.head.ref) if (headid == self.id): return 'Current branch' return self.ref
Returns a nice human-readable description of the commitish
src/geogigpy/commitish.py
humantext
boundlessgeo/geogig-py
7
python
def humantext(self): headid = self.repo.revparse(self.repo.head.ref) if (headid == self.id): return 'Current branch' return self.ref
def humantext(self): headid = self.repo.revparse(self.repo.head.ref) if (headid == self.id): return 'Current branch' return self.ref<|docstring|>Returns a nice human-readable description of the commitish<|endoftext|>
e8f1f38099c8f224dec038fca1b03ecce00136188f7c31b2776eaed0f386bb5a
def read_triformat(directory, x_filename): '\n X - 2d numpy array with rows representing compounds and columns represnting features\n compounds - pandas DataFrame with compound information\n features - pandas DataFrame with features information\n ' features_path = os.path.join(directory, 'features.t...
X - 2d numpy array with rows representing compounds and columns represnting features compounds - pandas DataFrame with compound information features - pandas DataFrame with features information
projects/remyelination/feature_reader.py
read_triformat
dhimmel/serg-pycode
0
python
def read_triformat(directory, x_filename): '\n X - 2d numpy array with rows representing compounds and columns represnting features\n compounds - pandas DataFrame with compound information\n features - pandas DataFrame with features information\n ' features_path = os.path.join(directory, 'features.t...
def read_triformat(directory, x_filename): '\n X - 2d numpy array with rows representing compounds and columns represnting features\n compounds - pandas DataFrame with compound information\n features - pandas DataFrame with features information\n ' features_path = os.path.join(directory, 'features.t...
e795c20b4fac8ca817b57c2c9d417b9a9b8111b64b2bd949aef207b998d7df8c
def whoami(string): 'Leon introduces himself' return utils.output('end', 'introduction', utils.translate('introduction'))
Leon introduces himself
packages/leon/whoami.py
whoami
jankeromnes/leon
4
python
def whoami(string): return utils.output('end', 'introduction', utils.translate('introduction'))
def whoami(string): return utils.output('end', 'introduction', utils.translate('introduction'))<|docstring|>Leon introduces himself<|endoftext|>
5e1981956e8cf250b39eff83e25d76ae200d81d2f4c2a215f394865d1aa8dad0
def __get_node_label_charcnn_embeddings(self, unique_labels_as_characters: tf.Tensor, node_labels_to_unique_labels: tf.Tensor) -> tf.Tensor: '\n Compute representation of node labels using a 2-layer character CNN.\n\n Args:\n unique_labels_as_characters: int32 tensor of shape [U, C]\n ...
Compute representation of node labels using a 2-layer character CNN. Args: unique_labels_as_characters: int32 tensor of shape [U, C] representing the unique (node) labels occurring in a batch, where U is the number of such labels and C the maximal number of characters. node_labels_to_un...
tf-gnn-samples/tasks/varmisuse_task.py
__get_node_label_charcnn_embeddings
yangzhou6666/adversarial-examples
10
python
def __get_node_label_charcnn_embeddings(self, unique_labels_as_characters: tf.Tensor, node_labels_to_unique_labels: tf.Tensor) -> tf.Tensor: '\n Compute representation of node labels using a 2-layer character CNN.\n\n Args:\n unique_labels_as_characters: int32 tensor of shape [U, C]\n ...
def __get_node_label_charcnn_embeddings(self, unique_labels_as_characters: tf.Tensor, node_labels_to_unique_labels: tf.Tensor) -> tf.Tensor: '\n Compute representation of node labels using a 2-layer character CNN.\n\n Args:\n unique_labels_as_characters: int32 tensor of shape [U, C]\n ...
897ec548dd608c28f7be3f343d6a7a053c6d5f6555328aeaeea4735fde122199
def image_entropy(im): '\n Calculate the entropy of an image. Used for "smart cropping".\n ' if (not isinstance(im, Image.Image)): return 0 hist = im.histogram() hist_size = float(sum(hist)) hist = [(h / hist_size) for h in hist] return (- sum([(p * math.log(p, 2)) for p in hist if...
Calculate the entropy of an image. Used for "smart cropping".
pressurecooker/thumbscropping.py
image_entropy
kollivier/pressurecooker
14
python
def image_entropy(im): '\n \n ' if (not isinstance(im, Image.Image)): return 0 hist = im.histogram() hist_size = float(sum(hist)) hist = [(h / hist_size) for h in hist] return (- sum([(p * math.log(p, 2)) for p in hist if (p != 0)]))
def image_entropy(im): '\n \n ' if (not isinstance(im, Image.Image)): return 0 hist = im.histogram() hist_size = float(sum(hist)) hist = [(h / hist_size) for h in hist] return (- sum([(p * math.log(p, 2)) for p in hist if (p != 0)]))<|docstring|>Calculate the entropy of an image. U...
4ee07f37b37b93de7c5119bdbba3880554199858a29ab561929eace8c6180bc7
def _compare_entropy(start_slice, end_slice, slice, difference): '\n Calculate the entropy of two slices (from the start and end of an axis),\n returning a tuple containing the amount that should be added to the start\n and removed from the end of the axis.\n ' start_entropy = image_entropy(start_sl...
Calculate the entropy of two slices (from the start and end of an axis), returning a tuple containing the amount that should be added to the start and removed from the end of the axis.
pressurecooker/thumbscropping.py
_compare_entropy
kollivier/pressurecooker
14
python
def _compare_entropy(start_slice, end_slice, slice, difference): '\n Calculate the entropy of two slices (from the start and end of an axis),\n returning a tuple containing the amount that should be added to the start\n and removed from the end of the axis.\n ' start_entropy = image_entropy(start_sl...
def _compare_entropy(start_slice, end_slice, slice, difference): '\n Calculate the entropy of two slices (from the start and end of an axis),\n returning a tuple containing the amount that should be added to the start\n and removed from the end of the axis.\n ' start_entropy = image_entropy(start_sl...
1172381e4328887fb2d06d20f7aaea9d2a3001418c1e71c419911a4a09b8f873
def scale_and_crop(im, size, crop=False, upscale=False, zoom=None, target=None, **kwargs): '\n Handle scaling and cropping the source image.\n Images can be scaled / cropped against a single dimension by using zero\n as the placeholder in the size. For example, ``size=(100, 0)`` will cause\n the image t...
Handle scaling and cropping the source image. Images can be scaled / cropped against a single dimension by using zero as the placeholder in the size. For example, ``size=(100, 0)`` will cause the image to be resized to 100 pixels wide, keeping the aspect ratio of the source image. crop Crop the source image height ...
pressurecooker/thumbscropping.py
scale_and_crop
kollivier/pressurecooker
14
python
def scale_and_crop(im, size, crop=False, upscale=False, zoom=None, target=None, **kwargs): '\n Handle scaling and cropping the source image.\n Images can be scaled / cropped against a single dimension by using zero\n as the placeholder in the size. For example, ``size=(100, 0)`` will cause\n the image t...
def scale_and_crop(im, size, crop=False, upscale=False, zoom=None, target=None, **kwargs): '\n Handle scaling and cropping the source image.\n Images can be scaled / cropped against a single dimension by using zero\n as the placeholder in the size. For example, ``size=(100, 0)`` will cause\n the image t...
e3066797096b000bdeb5e94b93a7bb4c622e2d28cc786709e71b4a62b2588ab6
def read_conf(self): 'MODEL' self.model_root = self.conf['Model'] self.model_name = self.model_root.get('ModelName') self.model_tag = '{model_name}.model'.format(model_name=self.model_name) self.model_field_param = self.model_root.get('ModelField') self.model_scene_param = self.model_root.get('M...
MODEL
config.py
read_conf
liuyang77886/captcha_trainer
2,548
python
def read_conf(self): self.model_root = self.conf['Model'] self.model_name = self.model_root.get('ModelName') self.model_tag = '{model_name}.model'.format(model_name=self.model_name) self.model_field_param = self.model_root.get('ModelField') self.model_scene_param = self.model_root.get('ModelSce...
def read_conf(self): self.model_root = self.conf['Model'] self.model_name = self.model_root.get('ModelName') self.model_tag = '{model_name}.model'.format(model_name=self.model_name) self.model_field_param = self.model_root.get('ModelField') self.model_scene_param = self.model_root.get('ModelSce...
0dfe2eb01bfd37947fa900aec4827f80d1fb31b9d71ec5b70761b5e76aa0fc17
def init_loader(args): 'Initialize test DataLoader' if (args.dataset_name is not None): datasets = load_dataset(args.dataset_name, args.dataset_config_name) else: data_files = {'test': args.data_path} extension = args.data_path.split('.')[(- 1)] datasets = load_dataset(extens...
Initialize test DataLoader
src/loaders.py
init_loader
Shreyas-21/DANCER-summ
7
python
def init_loader(args): if (args.dataset_name is not None): datasets = load_dataset(args.dataset_name, args.dataset_config_name) else: data_files = {'test': args.data_path} extension = args.data_path.split('.')[(- 1)] datasets = load_dataset(extension, data_files=data_files) ...
def init_loader(args): if (args.dataset_name is not None): datasets = load_dataset(args.dataset_name, args.dataset_config_name) else: data_files = {'test': args.data_path} extension = args.data_path.split('.')[(- 1)] datasets = load_dataset(extension, data_files=data_files) ...
f06d1f68ba12ba0d86e5706514e7045670c5cb6ec29613f42b6eb1a253b4e8d4
def load_model(args, device): 'Load model and tokenizer' print(f'Loading tokenizer {(args.tokenizer_name if args.tokenizer_name else args.model_path)}') tokenizer = AutoTokenizer.from_pretrained((args.tokenizer_name if args.tokenizer_name else args.model_path)) print(f'Loading model from {args.model_pat...
Load model and tokenizer
src/loaders.py
load_model
Shreyas-21/DANCER-summ
7
python
def load_model(args, device): print(f'Loading tokenizer {(args.tokenizer_name if args.tokenizer_name else args.model_path)}') tokenizer = AutoTokenizer.from_pretrained((args.tokenizer_name if args.tokenizer_name else args.model_path)) print(f'Loading model from {args.model_path}') model = AutoModel...
def load_model(args, device): print(f'Loading tokenizer {(args.tokenizer_name if args.tokenizer_name else args.model_path)}') tokenizer = AutoTokenizer.from_pretrained((args.tokenizer_name if args.tokenizer_name else args.model_path)) print(f'Loading model from {args.model_path}') model = AutoModel...
e734b190c6b313c30cf41bd2fdc7b2c746815cd7d296c56e947880cc7a80a5ba
def __init__(self, context, scenario): '\n Create and enter a temp directory which will be used to stored xpedite application information\n If a target application is being run remotely, TargetLauncher will create the temp directory on the remote host\n ' self.targetApp = scenario.makeTargetApp(context...
Create and enter a temp directory which will be used to stored xpedite application information If a target application is being run remotely, TargetLauncher will create the temp directory on the remote host
test/pytest/test_xpedite/test_profiler/app.py
__init__
mdlugajczyk/Xpedite
99
python
def __init__(self, context, scenario): '\n Create and enter a temp directory which will be used to stored xpedite application information\n If a target application is being run remotely, TargetLauncher will create the temp directory on the remote host\n ' self.targetApp = scenario.makeTargetApp(context...
def __init__(self, context, scenario): '\n Create and enter a temp directory which will be used to stored xpedite application information\n If a target application is being run remotely, TargetLauncher will create the temp directory on the remote host\n ' self.targetApp = scenario.makeTargetApp(context...
4eed2cafe5415085ddbb6b349a4040e4890d8cc92e3128c82dac93ace78f9f2a
def __init__(self, to, subject, sender, aws_access_key, aws_secret_key, aws_region='us-east-1'): '\n :param to:\n :param subject:\n :return:\n ' self.connection = None self.to = to self.subject = subject self._html = None self._text = None self._format = 'html' ...
:param to: :param subject: :return:
datacoco_cloud/ses_interaction.py
__init__
Phil-Ocone/datacoco-cloud
1
python
def __init__(self, to, subject, sender, aws_access_key, aws_secret_key, aws_region='us-east-1'): '\n :param to:\n :param subject:\n :return:\n ' self.connection = None self.to = to self.subject = subject self._html = None self._text = None self._format = 'html' ...
def __init__(self, to, subject, sender, aws_access_key, aws_secret_key, aws_region='us-east-1'): '\n :param to:\n :param subject:\n :return:\n ' self.connection = None self.to = to self.subject = subject self._html = None self._text = None self._format = 'html' ...
9feb10e239b447f4ac2be114de26e4baea0a328cb92846118b14f4f34698505f
def html(self, html): "\n set's email html message property\n :param html:\n :return:\n " self._html = html
set's email html message property :param html: :return:
datacoco_cloud/ses_interaction.py
html
Phil-Ocone/datacoco-cloud
1
python
def html(self, html): "\n set's email html message property\n :param html:\n :return:\n " self._html = html
def html(self, html): "\n set's email html message property\n :param html:\n :return:\n " self._html = html<|docstring|>set's email html message property :param html: :return:<|endoftext|>
670e35429a41e744d4c56e508865d063e3444969d4d358782a1d999406c03416
def text(self, text): "\n set's email text message property\n :param text:\n :return:\n " self._text = text
set's email text message property :param text: :return:
datacoco_cloud/ses_interaction.py
text
Phil-Ocone/datacoco-cloud
1
python
def text(self, text): "\n set's email text message property\n :param text:\n :return:\n " self._text = text
def text(self, text): "\n set's email text message property\n :param text:\n :return:\n " self._text = text<|docstring|>set's email text message property :param text: :return:<|endoftext|>
ef43abffa2c2272459b2103d2cd349888af5ec1c9c111562ec0ee50de6fcd326
def send(self, from_addr=None): '\n sends email\n :param from_addr:\n :return:\n ' body = self._html if isinstance(self.to, basestring): self.to = [self.to] if (not from_addr): from_addr = self.def_sender if ((not self._html) and (not self._text)): ...
sends email :param from_addr: :return:
datacoco_cloud/ses_interaction.py
send
Phil-Ocone/datacoco-cloud
1
python
def send(self, from_addr=None): '\n sends email\n :param from_addr:\n :return:\n ' body = self._html if isinstance(self.to, basestring): self.to = [self.to] if (not from_addr): from_addr = self.def_sender if ((not self._html) and (not self._text)): ...
def send(self, from_addr=None): '\n sends email\n :param from_addr:\n :return:\n ' body = self._html if isinstance(self.to, basestring): self.to = [self.to] if (not from_addr): from_addr = self.def_sender if ((not self._html) and (not self._text)): ...
de7931b4e1b4280b45155f897da01d4cb815badc9ae19d4a6d893a45da34dd58
def pool_output_length(input_length, pool_size, stride, pad, ignore_border): '\n Compute the output length of a pooling operator\n along a single dimension.\n\n Parameters\n ----------\n input_length : integer\n The length of the input in the pooling dimension\n pool_size : integer\n ...
Compute the output length of a pooling operator along a single dimension. Parameters ---------- input_length : integer The length of the input in the pooling dimension pool_size : integer The length of the pooling region stride : integer The stride between successive pooling regions pad : integer The n...
lasagne/layers/pool.py
pool_output_length
BenjaminBossan/Lasagne
0
python
def pool_output_length(input_length, pool_size, stride, pad, ignore_border): '\n Compute the output length of a pooling operator\n along a single dimension.\n\n Parameters\n ----------\n input_length : integer\n The length of the input in the pooling dimension\n pool_size : integer\n ...
def pool_output_length(input_length, pool_size, stride, pad, ignore_border): '\n Compute the output length of a pooling operator\n along a single dimension.\n\n Parameters\n ----------\n input_length : integer\n The length of the input in the pooling dimension\n pool_size : integer\n ...
a5df83ad447423a16cd91cf2cc2bb3a32a284fbc058de77f6f8f460ec435465b
def pool_2d(input, **kwargs): '\n Wrapper function that calls :func:`theano.tensor.signal.pool_2d` either\n with the new or old keyword argument names expected by Theano.\n ' try: return T.signal.pool.pool_2d(input, **kwargs) except TypeError: kwargs['ds'] = kwargs.pop('ws') ...
Wrapper function that calls :func:`theano.tensor.signal.pool_2d` either with the new or old keyword argument names expected by Theano.
lasagne/layers/pool.py
pool_2d
BenjaminBossan/Lasagne
0
python
def pool_2d(input, **kwargs): '\n Wrapper function that calls :func:`theano.tensor.signal.pool_2d` either\n with the new or old keyword argument names expected by Theano.\n ' try: return T.signal.pool.pool_2d(input, **kwargs) except TypeError: kwargs['ds'] = kwargs.pop('ws') ...
def pool_2d(input, **kwargs): '\n Wrapper function that calls :func:`theano.tensor.signal.pool_2d` either\n with the new or old keyword argument names expected by Theano.\n ' try: return T.signal.pool.pool_2d(input, **kwargs) except TypeError: kwargs['ds'] = kwargs.pop('ws') ...
42e9f2b53049f8378c70f7e4d1763e19d4986a779157f8d7e0511934da33cac2
@progress.setter def progress(self, progress): 'Should be overridden by different Task types.' self._progress = progress
Should be overridden by different Task types.
crispy/tasks.py
progress
StephenHermes/crispy
0
python
@progress.setter def progress(self, progress): self._progress = progress
@progress.setter def progress(self, progress): self._progress = progress<|docstring|>Should be overridden by different Task types.<|endoftext|>
0e7b100326078844ee1b07c18d05cb0d5bf062ed8f2b745b4005f9867e76e6df
def test_index(client): 'Check the index page loads.' response = client.get('/') assert (response.status_code == 200)
Check the index page loads.
test/test_app.py
test_index
j-penson/image-distortion
0
python
def test_index(client): response = client.get('/') assert (response.status_code == 200)
def test_index(client): response = client.get('/') assert (response.status_code == 200)<|docstring|>Check the index page loads.<|endoftext|>
ccb176e3535e7429040a53a0fd4c7dd04937e25921183175501c08fcce3893a9
def test_endpoint(client): 'Check the index page loads.' response = client.get('/v1/image') assert (response.status_code == 200)
Check the index page loads.
test/test_app.py
test_endpoint
j-penson/image-distortion
0
python
def test_endpoint(client): response = client.get('/v1/image') assert (response.status_code == 200)
def test_endpoint(client): response = client.get('/v1/image') assert (response.status_code == 200)<|docstring|>Check the index page loads.<|endoftext|>
ef201c4579fe609d59eb4378906fc6f8ce8c2c622b0cae2848d704801cd05ece
@manager.option('suite', default='all', nargs='?', choices=suites.keys(), help='Specify test suite to run (default all)') @manager.option('--spec', action='store_true', help='Output in spec style') def test(spec, suite): 'Runs tests' args = [] if spec: args.extend(['--spec']) if (not suite): ...
Runs tests
manage.py
test
crossgovernmentservices/csd_notes
0
python
@manager.option('suite', default='all', nargs='?', choices=suites.keys(), help='Specify test suite to run (default all)') @manager.option('--spec', action='store_true', help='Output in spec style') def test(spec, suite): args = [] if spec: args.extend(['--spec']) if (not suite): suite =...
@manager.option('suite', default='all', nargs='?', choices=suites.keys(), help='Specify test suite to run (default all)') @manager.option('--spec', action='store_true', help='Output in spec style') def test(spec, suite): args = [] if spec: args.extend(['--spec']) if (not suite): suite =...
e812f46d995e29059073e7e24f0211bdb3ddd403b1a96b75fd7002cb2787dbb6
def get_system_info(): '\n Get information about the system to be inserted into the User-Agent header.\n ' return 'lang={0}; arch={1}; os={2}; python.version={3}'.format('python', platform.machine(), platform.system(), platform.python_version())
Get information about the system to be inserted into the User-Agent header.
eventstreams_sdk/common.py
get_system_info
IBM/eventstreams-python-sdk
2
python
def get_system_info(): '\n \n ' return 'lang={0}; arch={1}; os={2}; python.version={3}'.format('python', platform.machine(), platform.system(), platform.python_version())
def get_system_info(): '\n \n ' return 'lang={0}; arch={1}; os={2}; python.version={3}'.format('python', platform.machine(), platform.system(), platform.python_version())<|docstring|>Get information about the system to be inserted into the User-Agent header.<|endoftext|>
f842c6e85de8afbf9f5613362baa495f8ac084fcc9202a1fbe7e459949db72b7
def get_user_agent(): '\n Get the value to be sent in the User-Agent header.\n ' return USER_AGENT
Get the value to be sent in the User-Agent header.
eventstreams_sdk/common.py
get_user_agent
IBM/eventstreams-python-sdk
2
python
def get_user_agent(): '\n \n ' return USER_AGENT
def get_user_agent(): '\n \n ' return USER_AGENT<|docstring|>Get the value to be sent in the User-Agent header.<|endoftext|>
35f0e7ba46352d79dce1561323a3e80f67a2078519b2a22c3a8e678d751fd30e
def get_sdk_headers(service_name, service_version, operation_id): '\n Get the request headers to be sent in requests by the SDK.\n \n If you plan to gather metrics for your SDK, the User-Agent header value must\n be a string similar to the following:\n eventstreams-python-sdk/0.0.1 (lang=python; arch...
Get the request headers to be sent in requests by the SDK. If you plan to gather metrics for your SDK, the User-Agent header value must be a string similar to the following: eventstreams-python-sdk/0.0.1 (lang=python; arch=x86_64; os=Linux; python.version=3.7.4) In the example above, the analytics tool will parse the...
eventstreams_sdk/common.py
get_sdk_headers
IBM/eventstreams-python-sdk
2
python
def get_sdk_headers(service_name, service_version, operation_id): '\n Get the request headers to be sent in requests by the SDK.\n \n If you plan to gather metrics for your SDK, the User-Agent header value must\n be a string similar to the following:\n eventstreams-python-sdk/0.0.1 (lang=python; arch...
def get_sdk_headers(service_name, service_version, operation_id): '\n Get the request headers to be sent in requests by the SDK.\n \n If you plan to gather metrics for your SDK, the User-Agent header value must\n be a string similar to the following:\n eventstreams-python-sdk/0.0.1 (lang=python; arch...
486f4a0e64deaaca514b569fb6cdb4701dc8784f56a046d0e29ce315bfab14bd
@property def base_api_url(self) -> str: 'The provider base REST API URL' return self._config.api_base_url
The provider base REST API URL
jupyterlab_pullrequests/managers/manager.py
base_api_url
fcollonval/pull-requests
32
python
@property def base_api_url(self) -> str: return self._config.api_base_url
@property def base_api_url(self) -> str: return self._config.api_base_url<|docstring|>The provider base REST API URL<|endoftext|>
5d4b7b93f46e3a20b0306a9dd7022ebfef5db4fb4c38774b7c1fd4f0e45156a7
@property def per_page_argument(self) -> Optional[Tuple[(str, int)]]: 'Returns query argument to set number of items per page.\n\n Returns\n [str, int]: (query argument name, value)\n None: the provider does not support pagination\n ' return None
Returns query argument to set number of items per page. Returns [str, int]: (query argument name, value) None: the provider does not support pagination
jupyterlab_pullrequests/managers/manager.py
per_page_argument
fcollonval/pull-requests
32
python
@property def per_page_argument(self) -> Optional[Tuple[(str, int)]]: 'Returns query argument to set number of items per page.\n\n Returns\n [str, int]: (query argument name, value)\n None: the provider does not support pagination\n ' return None
@property def per_page_argument(self) -> Optional[Tuple[(str, int)]]: 'Returns query argument to set number of items per page.\n\n Returns\n [str, int]: (query argument name, value)\n None: the provider does not support pagination\n ' return None<|docstring|>Returns query arg...
f1292826fb9ce348daa666b79df70a95992a762a6b48be559e7ff57aecef998e
@abc.abstractmethod async def get_current_user(self) -> str: 'Get the current user ID.' raise NotImplementedError()
Get the current user ID.
jupyterlab_pullrequests/managers/manager.py
get_current_user
fcollonval/pull-requests
32
python
@abc.abstractmethod async def get_current_user(self) -> str: raise NotImplementedError()
@abc.abstractmethod async def get_current_user(self) -> str: raise NotImplementedError()<|docstring|>Get the current user ID.<|endoftext|>
81f8cc9cd628a1d16f5d5641bbc3f0eb0d8cd8e52563f5168ac9765fe1e419db
@abc.abstractmethod async def get_file_diff(self, pr_id: str, filename: str) -> dict: 'Get the file diff for the pull request.\n\n Args:\n pr_id: pull request ID endpoint\n filename: The file name\n Returns:\n The file diff description\n ' raise NotImplement...
Get the file diff for the pull request. Args: pr_id: pull request ID endpoint filename: The file name Returns: The file diff description
jupyterlab_pullrequests/managers/manager.py
get_file_diff
fcollonval/pull-requests
32
python
@abc.abstractmethod async def get_file_diff(self, pr_id: str, filename: str) -> dict: 'Get the file diff for the pull request.\n\n Args:\n pr_id: pull request ID endpoint\n filename: The file name\n Returns:\n The file diff description\n ' raise NotImplement...
@abc.abstractmethod async def get_file_diff(self, pr_id: str, filename: str) -> dict: 'Get the file diff for the pull request.\n\n Args:\n pr_id: pull request ID endpoint\n filename: The file name\n Returns:\n The file diff description\n ' raise NotImplement...
87a8dd6bf03582b94cba7b5e3b5295ad0dc997361a9e89b6fa919f759320b5c2
@abc.abstractmethod async def get_threads(self, pr_id: str, filename: Optional[str]=None) -> List[dict]: 'Get the discussions on a file or the pull request.\n\n Args:\n pr_id: pull request ID endpoint\n filename: The file name; None to get the discussion on the pull requests\n Re...
Get the discussions on a file or the pull request. Args: pr_id: pull request ID endpoint filename: The file name; None to get the discussion on the pull requests Returns: The discussions
jupyterlab_pullrequests/managers/manager.py
get_threads
fcollonval/pull-requests
32
python
@abc.abstractmethod async def get_threads(self, pr_id: str, filename: Optional[str]=None) -> List[dict]: 'Get the discussions on a file or the pull request.\n\n Args:\n pr_id: pull request ID endpoint\n filename: The file name; None to get the discussion on the pull requests\n Re...
@abc.abstractmethod async def get_threads(self, pr_id: str, filename: Optional[str]=None) -> List[dict]: 'Get the discussions on a file or the pull request.\n\n Args:\n pr_id: pull request ID endpoint\n filename: The file name; None to get the discussion on the pull requests\n Re...
5e9a1b1c94335f57a67432313080d799e9e57c20f3c7153b21c3296d9f3de08e
@abc.abstractmethod async def list_files(self, pr_id: str) -> list: 'Get the list of modified files for a pull request.\n\n Args:\n pr_id: pull request ID endpoint\n Returns:\n The list of modified files\n ' raise NotImplementedError()
Get the list of modified files for a pull request. Args: pr_id: pull request ID endpoint Returns: The list of modified files
jupyterlab_pullrequests/managers/manager.py
list_files
fcollonval/pull-requests
32
python
@abc.abstractmethod async def list_files(self, pr_id: str) -> list: 'Get the list of modified files for a pull request.\n\n Args:\n pr_id: pull request ID endpoint\n Returns:\n The list of modified files\n ' raise NotImplementedError()
@abc.abstractmethod async def list_files(self, pr_id: str) -> list: 'Get the list of modified files for a pull request.\n\n Args:\n pr_id: pull request ID endpoint\n Returns:\n The list of modified files\n ' raise NotImplementedError()<|docstring|>Get the list of modif...
2c714dfc339b4b2c472009ce71041e4ec5d7ab40d00f0ba15e61d71c417d64a6
@abc.abstractmethod async def list_prs(self, username: str, pr_filter: str) -> list: 'Returns the list of pull requests for the given user.\n\n Args:\n username: User ID for the versioning service\n pr_filter: Filter to add to the pull requests requests\n Returns:\n Th...
Returns the list of pull requests for the given user. Args: username: User ID for the versioning service pr_filter: Filter to add to the pull requests requests Returns: The list of pull requests
jupyterlab_pullrequests/managers/manager.py
list_prs
fcollonval/pull-requests
32
python
@abc.abstractmethod async def list_prs(self, username: str, pr_filter: str) -> list: 'Returns the list of pull requests for the given user.\n\n Args:\n username: User ID for the versioning service\n pr_filter: Filter to add to the pull requests requests\n Returns:\n Th...
@abc.abstractmethod async def list_prs(self, username: str, pr_filter: str) -> list: 'Returns the list of pull requests for the given user.\n\n Args:\n username: User ID for the versioning service\n pr_filter: Filter to add to the pull requests requests\n Returns:\n Th...
5930610c6ea94fd87177154aa0abee12b364832fd6ec6fde5991e371d0949789
@abc.abstractmethod async def post_comment(self, pr_id: str, filename: str, body: str) -> Dict[(str, str)]: 'Create a new comment on a file or a the pull request.\n\n Args:\n pr_id: pull request ID endpoint\n filename: The file name; None to comment on the pull request\n body...
Create a new comment on a file or a the pull request. Args: pr_id: pull request ID endpoint filename: The file name; None to comment on the pull request body: Comment body Returns: The created comment
jupyterlab_pullrequests/managers/manager.py
post_comment
fcollonval/pull-requests
32
python
@abc.abstractmethod async def post_comment(self, pr_id: str, filename: str, body: str) -> Dict[(str, str)]: 'Create a new comment on a file or a the pull request.\n\n Args:\n pr_id: pull request ID endpoint\n filename: The file name; None to comment on the pull request\n body...
@abc.abstractmethod async def post_comment(self, pr_id: str, filename: str, body: str) -> Dict[(str, str)]: 'Create a new comment on a file or a the pull request.\n\n Args:\n pr_id: pull request ID endpoint\n filename: The file name; None to comment on the pull request\n body...
1363baf79b4e752bea64d31b7147507cbcb4625c55a3ad58caba3d5958676e13
async def _call_provider(self, url: str, load_json: bool=True, method: str='GET', body: Optional[dict]=None, params: Optional[Dict[(str, str)]]=None, headers: Optional[Dict[(str, str)]]=None, has_pagination: bool=True) -> Union[(dict, str)]: 'Call the third party service\n\n The request is presumed to suppor...
Call the third party service The request is presumed to support pagination by default if - The method is GET - load_json is True - The provider returns not None per_page_argument property Args: url: Endpoint to request load_json: Is the response of JSON type method: HTTP method body: Request body; Non...
jupyterlab_pullrequests/managers/manager.py
_call_provider
fcollonval/pull-requests
32
python
async def _call_provider(self, url: str, load_json: bool=True, method: str='GET', body: Optional[dict]=None, params: Optional[Dict[(str, str)]]=None, headers: Optional[Dict[(str, str)]]=None, has_pagination: bool=True) -> Union[(dict, str)]: 'Call the third party service\n\n The request is presumed to suppor...
async def _call_provider(self, url: str, load_json: bool=True, method: str='GET', body: Optional[dict]=None, params: Optional[Dict[(str, str)]]=None, headers: Optional[Dict[(str, str)]]=None, has_pagination: bool=True) -> Union[(dict, str)]: 'Call the third party service\n\n The request is presumed to suppor...
dc2dd5fc81968b55d78c1d52b972bc0834dc3c8535e3c8b8b9e8808eb9780a7f
def __init__(self, rouge_dir=None, rouge_args=None, verbose=False): '\n ROUGE metric\n Makes use of pyrouge: https://github.com/bheinzerling/pyrouge\n\n Args:\n :param rouge_dir: directory of ROUGE-1.5.5/, by default uses environment\'s ROUGE_HOME variable\n :param...
ROUGE metric Makes use of pyrouge: https://github.com/bheinzerling/pyrouge Args: :param rouge_dir: directory of ROUGE-1.5.5/, by default uses environment's ROUGE_HOME variable :param rouge_args: arguments for ROUGE calculation; if None, defaults to "-c 95 -2 -1 -U -r 1000 -n 4 -w 1.2 -a -m"; a string o...
cal_scores/SummEval/evaluation/summ_eval/rouge_metric.py
__init__
bzhao2718/ReliableSummEvalReg
0
python
def __init__(self, rouge_dir=None, rouge_args=None, verbose=False): '\n ROUGE metric\n Makes use of pyrouge: https://github.com/bheinzerling/pyrouge\n\n Args:\n :param rouge_dir: directory of ROUGE-1.5.5/, by default uses environment\'s ROUGE_HOME variable\n :param...
def __init__(self, rouge_dir=None, rouge_args=None, verbose=False): '\n ROUGE metric\n Makes use of pyrouge: https://github.com/bheinzerling/pyrouge\n\n Args:\n :param rouge_dir: directory of ROUGE-1.5.5/, by default uses environment\'s ROUGE_HOME variable\n :param...
2b34bda5f373e43077868ae89ff07d978c43822401a666818eb5c4895dada364
def get_validator() -> Type[AzPlatformValidator]: 'Returns the validator class for this module' return AzPlatformValidator
Returns the validator class for this module
scripts/commit_validation/commit_validation/validators/az_platform_validator.py
get_validator
eerock/o3de
11
python
def get_validator() -> Type[AzPlatformValidator]: return AzPlatformValidator
def get_validator() -> Type[AzPlatformValidator]: return AzPlatformValidator<|docstring|>Returns the validator class for this module<|endoftext|>