blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
6.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
438
7.52k
id
stringlengths
40
40
length_bytes
int64
506
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.25k
prompted_full_text
stringlengths
645
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.34k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
302
7.33k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
c4106a3a82de881295cbb5035a067e59df162f59
[ "super().__init__()\nself.add_module('norm1', Norm(num_input_features))\nself.add_module('relu1', nn.ReLU(inplace=True))\nself.add_module('conv1', Conv(num_input_features, bn_size * growth_rate, kernel_size=1, stride=1, bias=False))\nself.add_module('norm2', Norm(bn_size * growth_rate))\nself.add_module('relu2', nn...
<|body_start_0|> super().__init__() self.add_module('norm1', Norm(num_input_features)) self.add_module('relu1', nn.ReLU(inplace=True)) self.add_module('conv1', Conv(num_input_features, bn_size * growth_rate, kernel_size=1, stride=1, bias=False)) self.add_module('norm2', Norm(bn_s...
_DenseLayer
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _DenseLayer: def __init__(self, num_input_features, growth_rate, bn_size, drop_rate, Norm, Conv): """Constructor for _DenseLayer class. Parameters: num_input_features (int): Number of input channels to the layer. growth_rate (int): Number of output channels of each convolution operation ...
stack_v2_sparse_classes_36k_train_031600
12,081
permissive
[ { "docstring": "Constructor for _DenseLayer class. Parameters: num_input_features (int): Number of input channels to the layer. growth_rate (int): Number of output channels of each convolution operation in the layer. bn_size (int): Factor to scale the number of intermediate channels between the 1x1 and 3x3 conv...
2
null
Implement the Python class `_DenseLayer` described below. Class description: Implement the _DenseLayer class. Method signatures and docstrings: - def __init__(self, num_input_features, growth_rate, bn_size, drop_rate, Norm, Conv): Constructor for _DenseLayer class. Parameters: num_input_features (int): Number of inpu...
Implement the Python class `_DenseLayer` described below. Class description: Implement the _DenseLayer class. Method signatures and docstrings: - def __init__(self, num_input_features, growth_rate, bn_size, drop_rate, Norm, Conv): Constructor for _DenseLayer class. Parameters: num_input_features (int): Number of inpu...
72eb99f68205afd5f8d49a3bb6cfc08cfd467582
<|skeleton|> class _DenseLayer: def __init__(self, num_input_features, growth_rate, bn_size, drop_rate, Norm, Conv): """Constructor for _DenseLayer class. Parameters: num_input_features (int): Number of input channels to the layer. growth_rate (int): Number of output channels of each convolution operation ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _DenseLayer: def __init__(self, num_input_features, growth_rate, bn_size, drop_rate, Norm, Conv): """Constructor for _DenseLayer class. Parameters: num_input_features (int): Number of input channels to the layer. growth_rate (int): Number of output channels of each convolution operation in the layer. ...
the_stack_v2_python_sparse
GANDLF/models/densenet.py
mlcommons/GaNDLF
train
45
46396dbb544954d67ac2f79ad1f9cbdd32931612
[ "self.raw = raw\nself.timestamp = self.parse_timestamp(raw[self.TIMESTAMP])\nself.customer_ID = str(raw[self.CUSTOMER_ID])\nself.note = raw[self.NOTE]\nself.note_snippet = raw[self.NOTE_SNIPPET]\nself.name = raw[self.NAME]\nself.customer_user_name = raw[self.CUSTOMER_USER_NAME]\nself.added_by_username = raw[self.AD...
<|body_start_0|> self.raw = raw self.timestamp = self.parse_timestamp(raw[self.TIMESTAMP]) self.customer_ID = str(raw[self.CUSTOMER_ID]) self.note = raw[self.NOTE] self.note_snippet = raw[self.NOTE_SNIPPET] self.name = raw[self.NAME] self.customer_user_name = raw[...
Wrapper for Cloud Commerce customer log records.
CustomerLog
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomerLog: """Wrapper for Cloud Commerce customer log records.""" def __init__(self, raw): """Create log record from API response.""" <|body_0|> def parse_timestamp(timestamp_string): """Return log date string as datetime.datetime. Convert a timestamp in the fo...
stack_v2_sparse_classes_36k_train_031601
2,977
permissive
[ { "docstring": "Create log record from API response.", "name": "__init__", "signature": "def __init__(self, raw)" }, { "docstring": "Return log date string as datetime.datetime. Convert a timestamp in the format \"05/11/2018 10:23\" to a datetime.datetime object.", "name": "parse_timestamp",...
2
stack_v2_sparse_classes_30k_train_018530
Implement the Python class `CustomerLog` described below. Class description: Wrapper for Cloud Commerce customer log records. Method signatures and docstrings: - def __init__(self, raw): Create log record from API response. - def parse_timestamp(timestamp_string): Return log date string as datetime.datetime. Convert ...
Implement the Python class `CustomerLog` described below. Class description: Wrapper for Cloud Commerce customer log records. Method signatures and docstrings: - def __init__(self, raw): Create log record from API response. - def parse_timestamp(timestamp_string): Return log date string as datetime.datetime. Convert ...
2df4ac6e350a7eacb377cfecea25bacdb9b73975
<|skeleton|> class CustomerLog: """Wrapper for Cloud Commerce customer log records.""" def __init__(self, raw): """Create log record from API response.""" <|body_0|> def parse_timestamp(timestamp_string): """Return log date string as datetime.datetime. Convert a timestamp in the fo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomerLog: """Wrapper for Cloud Commerce customer log records.""" def __init__(self, raw): """Create log record from API response.""" self.raw = raw self.timestamp = self.parse_timestamp(raw[self.TIMESTAMP]) self.customer_ID = str(raw[self.CUSTOMER_ID]) self.note...
the_stack_v2_python_sparse
ccapi/requests/customers/getlogs.py
stcstores/ccapi
train
1
5533738cfe772ea3bb4f6f84500b97841a7e4725
[ "if self.field:\n return 'Summary aggregations for \"{0:s}\"'.format(self.field)\nreturn 'Summary aggregations for an unknown field.'", "self.field = field\nself.field_query_string = field_query_string\nformatted_field_name = self.format_field_by_type(field)\nif field_query_string == '*':\n formatted_field_...
<|body_start_0|> if self.field: return 'Summary aggregations for "{0:s}"'.format(self.field) return 'Summary aggregations for an unknown field.' <|end_body_0|> <|body_start_1|> self.field = field self.field_query_string = field_query_string formatted_field_name = sel...
Summary Aggregations.
SummaryAggregation
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SummaryAggregation: """Summary Aggregations.""" def chart_title(self): """Returns a title for the chart.""" <|body_0|> def run(self, field, field_query_string='*', start_time='', end_time='', most_common_limit=10, rare_value_document_limit=5): """Runs the Summary...
stack_v2_sparse_classes_36k_train_031602
13,136
permissive
[ { "docstring": "Returns a title for the chart.", "name": "chart_title", "signature": "def chart_title(self)" }, { "docstring": "Runs the SummaryAggregation aggregator. Args: field: What field to aggregate on. field_query_string: The field value(s) to aggregate on. supported_charts: The chart typ...
2
stack_v2_sparse_classes_30k_train_010983
Implement the Python class `SummaryAggregation` described below. Class description: Summary Aggregations. Method signatures and docstrings: - def chart_title(self): Returns a title for the chart. - def run(self, field, field_query_string='*', start_time='', end_time='', most_common_limit=10, rare_value_document_limit...
Implement the Python class `SummaryAggregation` described below. Class description: Summary Aggregations. Method signatures and docstrings: - def chart_title(self): Returns a title for the chart. - def run(self, field, field_query_string='*', start_time='', end_time='', most_common_limit=10, rare_value_document_limit...
24f471b58ca4a87cb053961b5f05c07a544ca7b8
<|skeleton|> class SummaryAggregation: """Summary Aggregations.""" def chart_title(self): """Returns a title for the chart.""" <|body_0|> def run(self, field, field_query_string='*', start_time='', end_time='', most_common_limit=10, rare_value_document_limit=5): """Runs the Summary...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SummaryAggregation: """Summary Aggregations.""" def chart_title(self): """Returns a title for the chart.""" if self.field: return 'Summary aggregations for "{0:s}"'.format(self.field) return 'Summary aggregations for an unknown field.' def run(self, field, field_q...
the_stack_v2_python_sparse
timesketch/lib/aggregators/summary.py
google/timesketch
train
2,263
e605f353656a8dceab4f7be24fc03942ac20f4fc
[ "if len(A) < 3:\n return 0\nA.append(2 ** 32)\nlast = 0\nret = 0\nold = 2 ** 32\nfor i in range(len(A) - 1):\n if A[i + 1] - A[i] == old:\n last += 1\n else:\n old = A[i + 1] - A[i]\n if last > 1:\n last -= 1\n ret += last * (last + 1) / 2\n last = 1\nretur...
<|body_start_0|> if len(A) < 3: return 0 A.append(2 ** 32) last = 0 ret = 0 old = 2 ** 32 for i in range(len(A) - 1): if A[i + 1] - A[i] == old: last += 1 else: old = A[i + 1] - A[i] if la...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def numberOfArithmeticSlices(self, A): """:type A: List[int] :rtype: int""" <|body_0|> def numberOfArithmeticSlices1(self, A): """:type A: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if len(A) < 3: ret...
stack_v2_sparse_classes_36k_train_031603
1,349
no_license
[ { "docstring": ":type A: List[int] :rtype: int", "name": "numberOfArithmeticSlices", "signature": "def numberOfArithmeticSlices(self, A)" }, { "docstring": ":type A: List[int] :rtype: int", "name": "numberOfArithmeticSlices1", "signature": "def numberOfArithmeticSlices1(self, A)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numberOfArithmeticSlices(self, A): :type A: List[int] :rtype: int - def numberOfArithmeticSlices1(self, A): :type A: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numberOfArithmeticSlices(self, A): :type A: List[int] :rtype: int - def numberOfArithmeticSlices1(self, A): :type A: List[int] :rtype: int <|skeleton|> class Solution: ...
70bdd75b6af2e1811c1beab22050c01d28d7373e
<|skeleton|> class Solution: def numberOfArithmeticSlices(self, A): """:type A: List[int] :rtype: int""" <|body_0|> def numberOfArithmeticSlices1(self, A): """:type A: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def numberOfArithmeticSlices(self, A): """:type A: List[int] :rtype: int""" if len(A) < 3: return 0 A.append(2 ** 32) last = 0 ret = 0 old = 2 ** 32 for i in range(len(A) - 1): if A[i + 1] - A[i] == old: ...
the_stack_v2_python_sparse
python/leetcode/413_Arithmetic_Slices.py
bobcaoge/my-code
train
0
419312cb8dc2220351eab71ae3594c7d722cba4b
[ "n_features = self.n_features\nplaceholder_scope = TensorflowGraph.get_placeholder_scope(graph, name_scopes)\nwith graph.as_default():\n with placeholder_scope:\n self.mol_features = tf.placeholder(tf.float32, shape=[None, n_features], name='mol_features')\n layer_sizes = self.layer_sizes\n weight_i...
<|body_start_0|> n_features = self.n_features placeholder_scope = TensorflowGraph.get_placeholder_scope(graph, name_scopes) with graph.as_default(): with placeholder_scope: self.mol_features = tf.placeholder(tf.float32, shape=[None, n_features], name='mol_features') ...
Implements an icml model as configured in a model_config.proto.
TensorflowMultiTaskRegressor
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TensorflowMultiTaskRegressor: """Implements an icml model as configured in a model_config.proto.""" def build(self, graph, name_scopes, training): """Constructs the graph architecture as specified in its config. This method creates the following Placeholders: mol_features: Molecule d...
stack_v2_sparse_classes_36k_train_031604
32,492
permissive
[ { "docstring": "Constructs the graph architecture as specified in its config. This method creates the following Placeholders: mol_features: Molecule descriptor (e.g. fingerprint) tensor with shape batch_size x n_features.", "name": "build", "signature": "def build(self, graph, name_scopes, training)" ...
2
stack_v2_sparse_classes_30k_train_005599
Implement the Python class `TensorflowMultiTaskRegressor` described below. Class description: Implements an icml model as configured in a model_config.proto. Method signatures and docstrings: - def build(self, graph, name_scopes, training): Constructs the graph architecture as specified in its config. This method cre...
Implement the Python class `TensorflowMultiTaskRegressor` described below. Class description: Implements an icml model as configured in a model_config.proto. Method signatures and docstrings: - def build(self, graph, name_scopes, training): Constructs the graph architecture as specified in its config. This method cre...
ee6e67ebcf7bf04259cf13aff6388e2b791fea3d
<|skeleton|> class TensorflowMultiTaskRegressor: """Implements an icml model as configured in a model_config.proto.""" def build(self, graph, name_scopes, training): """Constructs the graph architecture as specified in its config. This method creates the following Placeholders: mol_features: Molecule d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TensorflowMultiTaskRegressor: """Implements an icml model as configured in a model_config.proto.""" def build(self, graph, name_scopes, training): """Constructs the graph architecture as specified in its config. This method creates the following Placeholders: mol_features: Molecule descriptor (e....
the_stack_v2_python_sparse
contrib/atomicconv/models/legacy.py
deepchem/deepchem
train
4,876
a6baefee293177b5f32bb3be0ade3a0113d477b4
[ "L = self.codomain().base_ring()\nWR = self.codomain().weil_restriction()\nif L.is_finite():\n d = L.degree()\n if d == 1:\n return self\n newP = []\n for t in self:\n c = t.polynomial().coefficients(sparse=False)\n c = c + (d - len(c)) * [0]\n newP += c\nelse:\n d = L.rel...
<|body_start_0|> L = self.codomain().base_ring() WR = self.codomain().weil_restriction() if L.is_finite(): d = L.degree() if d == 1: return self newP = [] for t in self: c = t.polynomial().coefficients(sparse=False) ...
SchemeMorphism_point_affine_field
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SchemeMorphism_point_affine_field: def weil_restriction(self): """Compute the Weil restriction of this point over some extension field. If the field is a finite field, then this computes the Weil restriction to the prime subfield. A Weil restriction of scalars - denoted `Res_{L/k}` - is ...
stack_v2_sparse_classes_36k_train_031605
15,505
no_license
[ { "docstring": "Compute the Weil restriction of this point over some extension field. If the field is a finite field, then this computes the Weil restriction to the prime subfield. A Weil restriction of scalars - denoted `Res_{L/k}` - is a functor which, for any finite extension of fields `L/k` and any algebrai...
3
null
Implement the Python class `SchemeMorphism_point_affine_field` described below. Class description: Implement the SchemeMorphism_point_affine_field class. Method signatures and docstrings: - def weil_restriction(self): Compute the Weil restriction of this point over some extension field. If the field is a finite field...
Implement the Python class `SchemeMorphism_point_affine_field` described below. Class description: Implement the SchemeMorphism_point_affine_field class. Method signatures and docstrings: - def weil_restriction(self): Compute the Weil restriction of this point over some extension field. If the field is a finite field...
0d9eacbf74e2acffefde93e39f8bcbec745cdaba
<|skeleton|> class SchemeMorphism_point_affine_field: def weil_restriction(self): """Compute the Weil restriction of this point over some extension field. If the field is a finite field, then this computes the Weil restriction to the prime subfield. A Weil restriction of scalars - denoted `Res_{L/k}` - is ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SchemeMorphism_point_affine_field: def weil_restriction(self): """Compute the Weil restriction of this point over some extension field. If the field is a finite field, then this computes the Weil restriction to the prime subfield. A Weil restriction of scalars - denoted `Res_{L/k}` - is a functor whic...
the_stack_v2_python_sparse
sage/src/sage/schemes/affine/affine_point.py
bopopescu/geosci
train
0
3ae529ed25137259e089590503d195acaeb11622
[ "kwargs = locals()\nimage, mask = zipp.zipper_interp_rows(**kwargs)\nreturn (image, mask)", "min_cols = config.getint(cls.step_name, 'min_cols')\nmax_cols = config.getint(cls.step_name, 'max_cols')\ninterp_mask = maskbits.parse_badpix_mask(config.get(cls.step_name, 'interp_mask'))\ninvalid_mask = maskbits.parse_b...
<|body_start_0|> kwargs = locals() image, mask = zipp.zipper_interp_rows(**kwargs) return (image, mask) <|end_body_0|> <|body_start_1|> min_cols = config.getint(cls.step_name, 'min_cols') max_cols = config.getint(cls.step_name, 'max_cols') interp_mask = maskbits.parse_ba...
ZipperInterp
[ "NCSA" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ZipperInterp: def __call__(cls, image, mask, interp_mask=DEFAULT_INTERP_MASK, BADPIX_INTERP=maskbits.BADPIX_INTERP, min_cols=DEFAULT_MINCOLS, max_cols=DEFAULT_MAXCOLS, invalid_mask=DEFAULT_INVALID_MASK, add_noise=DEFAULT_ADD_NOISE, clobber=DEFAULT_CLOBBER, block_size=DEFAULT_BLOCK_SIZE, logger=l...
stack_v2_sparse_classes_36k_train_031606
5,753
permissive
[ { "docstring": "Interpolate over selected pixels by inserting average of pixels to left and right of any bunch of adjacent selected pixels. If the interpolation region touches an edge, or the adjacent pixel has flags marking it as invalid, than the value at other border is used for interpolation. No interpolati...
3
stack_v2_sparse_classes_30k_train_001438
Implement the Python class `ZipperInterp` described below. Class description: Implement the ZipperInterp class. Method signatures and docstrings: - def __call__(cls, image, mask, interp_mask=DEFAULT_INTERP_MASK, BADPIX_INTERP=maskbits.BADPIX_INTERP, min_cols=DEFAULT_MINCOLS, max_cols=DEFAULT_MAXCOLS, invalid_mask=DEF...
Implement the Python class `ZipperInterp` described below. Class description: Implement the ZipperInterp class. Method signatures and docstrings: - def __call__(cls, image, mask, interp_mask=DEFAULT_INTERP_MASK, BADPIX_INTERP=maskbits.BADPIX_INTERP, min_cols=DEFAULT_MINCOLS, max_cols=DEFAULT_MAXCOLS, invalid_mask=DEF...
8a299e9368d01cac51f53af6e4937e797f378d7a
<|skeleton|> class ZipperInterp: def __call__(cls, image, mask, interp_mask=DEFAULT_INTERP_MASK, BADPIX_INTERP=maskbits.BADPIX_INTERP, min_cols=DEFAULT_MINCOLS, max_cols=DEFAULT_MAXCOLS, invalid_mask=DEFAULT_INVALID_MASK, add_noise=DEFAULT_ADD_NOISE, clobber=DEFAULT_CLOBBER, block_size=DEFAULT_BLOCK_SIZE, logger=l...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ZipperInterp: def __call__(cls, image, mask, interp_mask=DEFAULT_INTERP_MASK, BADPIX_INTERP=maskbits.BADPIX_INTERP, min_cols=DEFAULT_MINCOLS, max_cols=DEFAULT_MAXCOLS, invalid_mask=DEFAULT_INVALID_MASK, add_noise=DEFAULT_ADD_NOISE, clobber=DEFAULT_CLOBBER, block_size=DEFAULT_BLOCK_SIZE, logger=logger): ...
the_stack_v2_python_sparse
python/pixcorrect/row_zipper.py
DarkEnergySurvey/pixcorrect
train
1
80d987c09743f66d7c7997655523d5e0aa163d1d
[ "result = 0\nfor i in xrange(0, len(nums)):\n for j in xrange(i + 1, len(nums)):\n result += self.findHammingDistance(nums[i] ^ nums[j])\nreturn result", "count = 0\nwhile num != 0:\n count += num & 1\n num >>= 1\nreturn count" ]
<|body_start_0|> result = 0 for i in xrange(0, len(nums)): for j in xrange(i + 1, len(nums)): result += self.findHammingDistance(nums[i] ^ nums[j]) return result <|end_body_0|> <|body_start_1|> count = 0 while num != 0: count += num & 1 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def totalHammingDistance(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findHammingDistance(self, num): """:param num: int :return: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> result = 0 for i in xrange...
stack_v2_sparse_classes_36k_train_031607
561
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "totalHammingDistance", "signature": "def totalHammingDistance(self, nums)" }, { "docstring": ":param num: int :return: int", "name": "findHammingDistance", "signature": "def findHammingDistance(self, num)" } ]
2
stack_v2_sparse_classes_30k_train_012471
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def totalHammingDistance(self, nums): :type nums: List[int] :rtype: int - def findHammingDistance(self, num): :param num: int :return: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def totalHammingDistance(self, nums): :type nums: List[int] :rtype: int - def findHammingDistance(self, num): :param num: int :return: int <|skeleton|> class Solution: def ...
0a833b8f666385500de5a55731b1a5590827b207
<|skeleton|> class Solution: def totalHammingDistance(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findHammingDistance(self, num): """:param num: int :return: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def totalHammingDistance(self, nums): """:type nums: List[int] :rtype: int""" result = 0 for i in xrange(0, len(nums)): for j in xrange(i + 1, len(nums)): result += self.findHammingDistance(nums[i] ^ nums[j]) return result def findHamm...
the_stack_v2_python_sparse
LeetCode-Python/477. Total Hamming Distance.py
KaranJaswani/Codes
train
0
fa84ce7c05b9b606acab73a0155ebd59b63af657
[ "self.center = Joint(origin, original_orientation, (False, False))\nself.neck = Joint(self.center.location + self.NECK_OFFSET_Z * e3, original_orientation, (False, [False, (number('-38.5'), number('29.5')), (number('-119.5'), number('119.5'))]))\nself.laser = Joint(self.neck.location + self.LASER_OFFSET_Z * e3, ori...
<|body_start_0|> self.center = Joint(origin, original_orientation, (False, False)) self.neck = Joint(self.center.location + self.NECK_OFFSET_Z * e3, original_orientation, (False, [False, (number('-38.5'), number('29.5')), (number('-119.5'), number('119.5'))])) self.laser = Joint(self.neck.locati...
NAO
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NAO: def __init__(self): """Generate the skeletal structure of the robot. It puts all the joints and kinematic chains in the object's "name space".""" <|body_0|> def compute_move(self, chain_name, target): """Compute the angles between the joints for the target posit...
stack_v2_sparse_classes_36k_train_031608
4,066
no_license
[ { "docstring": "Generate the skeletal structure of the robot. It puts all the joints and kinematic chains in the object's \"name space\".", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Compute the angles between the joints for the target position. It does not send the...
2
stack_v2_sparse_classes_30k_train_018033
Implement the Python class `NAO` described below. Class description: Implement the NAO class. Method signatures and docstrings: - def __init__(self): Generate the skeletal structure of the robot. It puts all the joints and kinematic chains in the object's "name space". - def compute_move(self, chain_name, target): Co...
Implement the Python class `NAO` described below. Class description: Implement the NAO class. Method signatures and docstrings: - def __init__(self): Generate the skeletal structure of the robot. It puts all the joints and kinematic chains in the object's "name space". - def compute_move(self, chain_name, target): Co...
d4491170d154e44212d4d1b6356980ff4fbf840f
<|skeleton|> class NAO: def __init__(self): """Generate the skeletal structure of the robot. It puts all the joints and kinematic chains in the object's "name space".""" <|body_0|> def compute_move(self, chain_name, target): """Compute the angles between the joints for the target posit...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NAO: def __init__(self): """Generate the skeletal structure of the robot. It puts all the joints and kinematic chains in the object's "name space".""" self.center = Joint(origin, original_orientation, (False, False)) self.neck = Joint(self.center.location + self.NECK_OFFSET_Z * e3, ori...
the_stack_v2_python_sparse
old/code/model.py
pkok/bsc-thesis
train
1
9e7a32ae9f6da41d06b0a066bc8fd2ff2d931ced
[ "for testvalue, expected in self.knownvalues:\n p = project.Project()\n result = p.dat_lump(testvalue, validate=True)\n self.assertEqual(expected, result)", "for testvalue, expected in self.knownvalues:\n p = project.Project()\n result = p.dat_lump(testvalue)\n self.assertEqual(expected, result)...
<|body_start_0|> for testvalue, expected in self.knownvalues: p = project.Project() result = p.dat_lump(testvalue, validate=True) self.assertEqual(expected, result) <|end_body_0|> <|body_start_1|> for testvalue, expected in self.knownvalues: p = project.P...
Test dat_lump validator
dat_lump_knownvalues
[ "BSD-2-Clause", "LicenseRef-scancode-warranty-disclaimer" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class dat_lump_knownvalues: """Test dat_lump validator""" def test_knownvalues_validate(self): """Test that known values are validated correctly""" <|body_0|> def test_knownvalues_set(self): """Test that known values are set correctly""" <|body_1|> def tes...
stack_v2_sparse_classes_36k_train_031609
3,994
permissive
[ { "docstring": "Test that known values are validated correctly", "name": "test_knownvalues_validate", "signature": "def test_knownvalues_validate(self)" }, { "docstring": "Test that known values are set correctly", "name": "test_knownvalues_set", "signature": "def test_knownvalues_set(se...
3
stack_v2_sparse_classes_30k_train_012408
Implement the Python class `dat_lump_knownvalues` described below. Class description: Test dat_lump validator Method signatures and docstrings: - def test_knownvalues_validate(self): Test that known values are validated correctly - def test_knownvalues_set(self): Test that known values are set correctly - def test_se...
Implement the Python class `dat_lump_knownvalues` described below. Class description: Test dat_lump validator Method signatures and docstrings: - def test_knownvalues_validate(self): Test that known values are validated correctly - def test_knownvalues_set(self): Test that known values are set correctly - def test_se...
307a9de864566fece1a999888e19048aeef9734c
<|skeleton|> class dat_lump_knownvalues: """Test dat_lump validator""" def test_knownvalues_validate(self): """Test that known values are validated correctly""" <|body_0|> def test_knownvalues_set(self): """Test that known values are set correctly""" <|body_1|> def tes...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class dat_lump_knownvalues: """Test dat_lump validator""" def test_knownvalues_validate(self): """Test that known values are validated correctly""" for testvalue, expected in self.knownvalues: p = project.Project() result = p.dat_lump(testvalue, validate=True) ...
the_stack_v2_python_sparse
project_test.py
An-dz/tilecutter
train
4
c0ae908c559fe007b7d36782d7643370e2131a72
[ "self.url = args.url\nif args.token is not None:\n self.token = args.token\nelse:\n self.netrcfile = args.netrcfile\n self.token = self.netrc()", "gitlab_connection = gitlab.Gitlab(self.url, self.token)\ngitlab_connection.auth()\nreturn gitlab_connection", "try:\n parser = netrc.netrc(self.netrcfile...
<|body_start_0|> self.url = args.url if args.token is not None: self.token = args.token else: self.netrcfile = args.netrcfile self.token = self.netrc() <|end_body_0|> <|body_start_1|> gitlab_connection = gitlab.Gitlab(self.url, self.token) git...
Main user auth class.
User
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class User: """Main user auth class.""" def __init__(self, args): """Init a thing""" <|body_0|> def auth(self): """Authorize user using token to GitLab API.""" <|body_1|> def netrc(self): """Use Netrc default or --netrcfile if passed as fallback.""...
stack_v2_sparse_classes_36k_train_031610
1,433
permissive
[ { "docstring": "Init a thing", "name": "__init__", "signature": "def __init__(self, args)" }, { "docstring": "Authorize user using token to GitLab API.", "name": "auth", "signature": "def auth(self)" }, { "docstring": "Use Netrc default or --netrcfile if passed as fallback.", ...
3
stack_v2_sparse_classes_30k_train_005239
Implement the Python class `User` described below. Class description: Main user auth class. Method signatures and docstrings: - def __init__(self, args): Init a thing - def auth(self): Authorize user using token to GitLab API. - def netrc(self): Use Netrc default or --netrcfile if passed as fallback.
Implement the Python class `User` described below. Class description: Main user auth class. Method signatures and docstrings: - def __init__(self, args): Init a thing - def auth(self): Authorize user using token to GitLab API. - def netrc(self): Use Netrc default or --netrcfile if passed as fallback. <|skeleton|> cl...
8ced932bf143148fe5a41fe7a5b5ef17cd7720af
<|skeleton|> class User: """Main user auth class.""" def __init__(self, args): """Init a thing""" <|body_0|> def auth(self): """Authorize user using token to GitLab API.""" <|body_1|> def netrc(self): """Use Netrc default or --netrcfile if passed as fallback.""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class User: """Main user auth class.""" def __init__(self, args): """Init a thing""" self.url = args.url if args.token is not None: self.token = args.token else: self.netrcfile = args.netrcfile self.token = self.netrc() def auth(self): ...
the_stack_v2_python_sparse
gitlab_api/auth/user.py
mrlesmithjr/python-gitlab-api
train
1
6bb164861316ce0e8cd53a7bf584b50ab695464d
[ "self.nums = nums\nself.lens = len(nums)\nself.BIT = [0] * (self.lens + 1)\nfor i in range(self.lens):\n k = i + 1\n while k <= self.lens:\n self.BIT[k] += nums[i]\n k += k & -k", "diff = val - self.nums[i]\nself.nums[i] = val\ni += 1\nwhile i <= self.lens:\n self.BIT[i] += diff\n i += i...
<|body_start_0|> self.nums = nums self.lens = len(nums) self.BIT = [0] * (self.lens + 1) for i in range(self.lens): k = i + 1 while k <= self.lens: self.BIT[k] += nums[i] k += k & -k <|end_body_0|> <|body_start_1|> diff = v...
NumArray
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumArray: def __init__(self, nums): """:type nums: List[int]""" <|body_0|> def update(self, i, val): """:type i: int :type val: int :rtype: void""" <|body_1|> def sumRange(self, i, j): """:type i: int :type j: int :rtype: int""" <|body_2|...
stack_v2_sparse_classes_36k_train_031611
1,866
no_license
[ { "docstring": ":type nums: List[int]", "name": "__init__", "signature": "def __init__(self, nums)" }, { "docstring": ":type i: int :type val: int :rtype: void", "name": "update", "signature": "def update(self, i, val)" }, { "docstring": ":type i: int :type j: int :rtype: int", ...
3
null
Implement the Python class `NumArray` described below. Class description: Implement the NumArray class. Method signatures and docstrings: - def __init__(self, nums): :type nums: List[int] - def update(self, i, val): :type i: int :type val: int :rtype: void - def sumRange(self, i, j): :type i: int :type j: int :rtype:...
Implement the Python class `NumArray` described below. Class description: Implement the NumArray class. Method signatures and docstrings: - def __init__(self, nums): :type nums: List[int] - def update(self, i, val): :type i: int :type val: int :rtype: void - def sumRange(self, i, j): :type i: int :type j: int :rtype:...
212f8b83d6ac22db1a777f980075d9e12ce521d2
<|skeleton|> class NumArray: def __init__(self, nums): """:type nums: List[int]""" <|body_0|> def update(self, i, val): """:type i: int :type val: int :rtype: void""" <|body_1|> def sumRange(self, i, j): """:type i: int :type j: int :rtype: int""" <|body_2|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NumArray: def __init__(self, nums): """:type nums: List[int]""" self.nums = nums self.lens = len(nums) self.BIT = [0] * (self.lens + 1) for i in range(self.lens): k = i + 1 while k <= self.lens: self.BIT[k] += nums[i] ...
the_stack_v2_python_sparse
LeetCode/python/307_(Binary Indexed Tree)_hard_Range Sum Query - Mutable.py
FrankieZhen/Lookoop
train
1
60782add4eab9020f5eeb94e8d669daff1d8dc72
[ "if padding:\n for item in input:\n item.insert(0, 0)\n item.append(0)\n z = [0] * len(input[0])\n input.insert(0, z)\n input.append(z)\ni_h = len(input)\ni_w = len(input[0])\nf_h = len(filter)\nf_w = len(filter[0])\nif (i_h - f_h) % stride != 0:\n print('!!请重新分配padding的长度')\n return...
<|body_start_0|> if padding: for item in input: item.insert(0, 0) item.append(0) z = [0] * len(input[0]) input.insert(0, z) input.append(z) i_h = len(input) i_w = len(input[0]) f_h = len(filter) f_w =...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def test(self, input, filter, padding, stride): """input为输入矩阵,filter为卷积核,返回卷积之后的结果""" <|body_0|> def sum(self, input, row, col, filter): """row,col为卷积操作在input的起始位置""" <|body_1|> <|end_skeleton|> <|body_start_0|> if padding: for...
stack_v2_sparse_classes_36k_train_031612
1,599
no_license
[ { "docstring": "input为输入矩阵,filter为卷积核,返回卷积之后的结果", "name": "test", "signature": "def test(self, input, filter, padding, stride)" }, { "docstring": "row,col为卷积操作在input的起始位置", "name": "sum", "signature": "def sum(self, input, row, col, filter)" } ]
2
stack_v2_sparse_classes_30k_train_020056
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def test(self, input, filter, padding, stride): input为输入矩阵,filter为卷积核,返回卷积之后的结果 - def sum(self, input, row, col, filter): row,col为卷积操作在input的起始位置
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def test(self, input, filter, padding, stride): input为输入矩阵,filter为卷积核,返回卷积之后的结果 - def sum(self, input, row, col, filter): row,col为卷积操作在input的起始位置 <|skeleton|> class Solution: ...
ef6aee94c7990d734271c204034ec273b665226d
<|skeleton|> class Solution: def test(self, input, filter, padding, stride): """input为输入矩阵,filter为卷积核,返回卷积之后的结果""" <|body_0|> def sum(self, input, row, col, filter): """row,col为卷积操作在input的起始位置""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def test(self, input, filter, padding, stride): """input为输入矩阵,filter为卷积核,返回卷积之后的结果""" if padding: for item in input: item.insert(0, 0) item.append(0) z = [0] * len(input[0]) input.insert(0, z) input.appen...
the_stack_v2_python_sparse
卷积操作.py
godzzbboss/leetcode
train
0
df94bd2dae0d74c9245f3edd8ee9e9820dc07ef6
[ "self.user = user\nself.first_name = first_name\nself.last_name = last_name\nself.facebook = facebook\nself.google = google\nself.github = github\nCreator.__init__(self)", "names = str(full_name).split(' ')\nself.last_name = ''\nself.first_name = names.pop(0)\nif len(names) > 0:\n self.last_name = ' '.join(nam...
<|body_start_0|> self.user = user self.first_name = first_name self.last_name = last_name self.facebook = facebook self.google = google self.github = github Creator.__init__(self) <|end_body_0|> <|body_start_1|> names = str(full_name).split(' ') s...
UserProfileCreator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserProfileCreator: def __init__(self, user, first_name='', last_name='', facebook='', google='', github=''): """The User Object must be passed into UserProfileCreator on init, the rest of the arguments are optional and could also be set after __init__ if needed. All the additional param...
stack_v2_sparse_classes_36k_train_031613
12,165
no_license
[ { "docstring": "The User Object must be passed into UserProfileCreator on init, the rest of the arguments are optional and could also be set after __init__ if needed. All the additional params are scalar column values belonging on the UserProfile table. :param user: :param first_name: :param last_name: :param f...
3
stack_v2_sparse_classes_30k_train_016766
Implement the Python class `UserProfileCreator` described below. Class description: Implement the UserProfileCreator class. Method signatures and docstrings: - def __init__(self, user, first_name='', last_name='', facebook='', google='', github=''): The User Object must be passed into UserProfileCreator on init, the ...
Implement the Python class `UserProfileCreator` described below. Class description: Implement the UserProfileCreator class. Method signatures and docstrings: - def __init__(self, user, first_name='', last_name='', facebook='', google='', github=''): The User Object must be passed into UserProfileCreator on init, the ...
e5401680f13299ece8d78f51e45c90773015cde4
<|skeleton|> class UserProfileCreator: def __init__(self, user, first_name='', last_name='', facebook='', google='', github=''): """The User Object must be passed into UserProfileCreator on init, the rest of the arguments are optional and could also be set after __init__ if needed. All the additional param...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserProfileCreator: def __init__(self, user, first_name='', last_name='', facebook='', google='', github=''): """The User Object must be passed into UserProfileCreator on init, the rest of the arguments are optional and could also be set after __init__ if needed. All the additional params are scalar c...
the_stack_v2_python_sparse
doc_docs/public/creator/creator.py
mrosata/doc-docs
train
0
744b1263b0fd6f8b6ce1192b112096f5b9851353
[ "queryset = super().get_queryset()\nif self.exclude_unverified:\n return queryset.filter(verified=True)\nreturn queryset", "kwargs['verified'] = kwargs.get('verified', False)\nobject: 'ModeratedModel' = super().create(*args, **kwargs)\nreturn object", "object: 'ModeratedModel'\nobject, created = super().get_...
<|body_start_0|> queryset = super().get_queryset() if self.exclude_unverified: return queryset.filter(verified=True) return queryset <|end_body_0|> <|body_start_1|> kwargs['verified'] = kwargs.get('verified', False) object: 'ModeratedModel' = super().create(*args, **...
Manager for moderated models.
ModeratedManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ModeratedManager: """Manager for moderated models.""" def get_queryset(self) -> ModeratedQuerySet: """Return the default queryset to be used by the manager.""" <|body_0|> def create(self, *args, **kwargs) -> 'ModeratedModel': """Create and return a model instance...
stack_v2_sparse_classes_36k_train_031614
2,139
no_license
[ { "docstring": "Return the default queryset to be used by the manager.", "name": "get_queryset", "signature": "def get_queryset(self) -> ModeratedQuerySet" }, { "docstring": "Create and return a model instance.", "name": "create", "signature": "def create(self, *args, **kwargs) -> 'Moder...
3
null
Implement the Python class `ModeratedManager` described below. Class description: Manager for moderated models. Method signatures and docstrings: - def get_queryset(self) -> ModeratedQuerySet: Return the default queryset to be used by the manager. - def create(self, *args, **kwargs) -> 'ModeratedModel': Create and re...
Implement the Python class `ModeratedManager` described below. Class description: Manager for moderated models. Method signatures and docstrings: - def get_queryset(self) -> ModeratedQuerySet: Return the default queryset to be used by the manager. - def create(self, *args, **kwargs) -> 'ModeratedModel': Create and re...
8bbdc8eec3622af22c17214051c34e36bea8e05a
<|skeleton|> class ModeratedManager: """Manager for moderated models.""" def get_queryset(self) -> ModeratedQuerySet: """Return the default queryset to be used by the manager.""" <|body_0|> def create(self, *args, **kwargs) -> 'ModeratedModel': """Create and return a model instance...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ModeratedManager: """Manager for moderated models.""" def get_queryset(self) -> ModeratedQuerySet: """Return the default queryset to be used by the manager.""" queryset = super().get_queryset() if self.exclude_unverified: return queryset.filter(verified=True) r...
the_stack_v2_python_sparse
apps/moderation/models/moderated_model/manager.py
abdulwahed-mansour/modularhistory
train
1
e864327a837f59188aa01a10d763c0827779d836
[ "self.supervised_input = ImageNetInput(split=supervised_split, is_training=True, batch_size=supervised_batch_size, augmentation=supervised_augmentation, **kwargs)\nself.unsupervised_input = ImageNetInput(split='train', is_training=True, batch_size=unsupervised_batch_size, augmentation=unsupervised_augmentation, **k...
<|body_start_0|> self.supervised_input = ImageNetInput(split=supervised_split, is_training=True, batch_size=supervised_batch_size, augmentation=supervised_augmentation, **kwargs) self.unsupervised_input = ImageNetInput(split='train', is_training=True, batch_size=unsupervised_batch_size, augmentation=uns...
Generates Imagenet input_fn for semi-supervised training.
ImageNetSslTrainInput
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageNetSslTrainInput: """Generates Imagenet input_fn for semi-supervised training.""" def __init__(self, supervised_split, supervised_batch_size, unsupervised_batch_size, supervised_augmentation, unsupervised_augmentation, **kwargs): """Initialize ImageNetSslTrainInput. Args: superv...
stack_v2_sparse_classes_36k_train_031615
16,434
permissive
[ { "docstring": "Initialize ImageNetSslTrainInput. Args: supervised_split: split of supervised data. supervised_batch_size: batch size for supervised data. unsupervised_batch_size: batch size for unsupervised data. supervised_augmentation: augmentation for supervised data. unsupervised_augmentation: augmentation...
2
stack_v2_sparse_classes_30k_test_000924
Implement the Python class `ImageNetSslTrainInput` described below. Class description: Generates Imagenet input_fn for semi-supervised training. Method signatures and docstrings: - def __init__(self, supervised_split, supervised_batch_size, unsupervised_batch_size, supervised_augmentation, unsupervised_augmentation, ...
Implement the Python class `ImageNetSslTrainInput` described below. Class description: Generates Imagenet input_fn for semi-supervised training. Method signatures and docstrings: - def __init__(self, supervised_split, supervised_batch_size, unsupervised_batch_size, supervised_augmentation, unsupervised_augmentation, ...
f8b7f184b91d6144927c7c4b34f7d9c0313f8a39
<|skeleton|> class ImageNetSslTrainInput: """Generates Imagenet input_fn for semi-supervised training.""" def __init__(self, supervised_split, supervised_batch_size, unsupervised_batch_size, supervised_augmentation, unsupervised_augmentation, **kwargs): """Initialize ImageNetSslTrainInput. Args: superv...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImageNetSslTrainInput: """Generates Imagenet input_fn for semi-supervised training.""" def __init__(self, supervised_split, supervised_batch_size, unsupervised_batch_size, supervised_augmentation, unsupervised_augmentation, **kwargs): """Initialize ImageNetSslTrainInput. Args: supervised_split: s...
the_stack_v2_python_sparse
imagenet/datasets/imagenet.py
paulxiong/fixmatch
train
1
c4d309a75020ab6eeafd6255881ba5197980b08b
[ "import revitron\ntry:\n return revitron.Document(self.element.GetLinkDocument()).getPath()\nexcept:\n pass", "import revitron\ntry:\n return revitron.DOC.GetElement(self.get('Type'))\nexcept:\n pass" ]
<|body_start_0|> import revitron try: return revitron.Document(self.element.GetLinkDocument()).getPath() except: pass <|end_body_0|> <|body_start_1|> import revitron try: return revitron.DOC.GetElement(self.get('Type')) except: ...
A wrapper class for Revit links.
LinkRvt
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LinkRvt: """A wrapper class for Revit links.""" def getPath(self): """Gets the path of the linked document. Returns: string: The path on disk""" <|body_0|> def getType(self): """Gets the type object of the link. Returns: object: The Link type""" <|body_1|...
stack_v2_sparse_classes_36k_train_031616
621
permissive
[ { "docstring": "Gets the path of the linked document. Returns: string: The path on disk", "name": "getPath", "signature": "def getPath(self)" }, { "docstring": "Gets the type object of the link. Returns: object: The Link type", "name": "getType", "signature": "def getType(self)" } ]
2
stack_v2_sparse_classes_30k_train_012585
Implement the Python class `LinkRvt` described below. Class description: A wrapper class for Revit links. Method signatures and docstrings: - def getPath(self): Gets the path of the linked document. Returns: string: The path on disk - def getType(self): Gets the type object of the link. Returns: object: The Link type
Implement the Python class `LinkRvt` described below. Class description: A wrapper class for Revit links. Method signatures and docstrings: - def getPath(self): Gets the path of the linked document. Returns: string: The path on disk - def getType(self): Gets the type object of the link. Returns: object: The Link type...
f373a0388c8b45f14f93510c9e8870190dba3b78
<|skeleton|> class LinkRvt: """A wrapper class for Revit links.""" def getPath(self): """Gets the path of the linked document. Returns: string: The path on disk""" <|body_0|> def getType(self): """Gets the type object of the link. Returns: object: The Link type""" <|body_1|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LinkRvt: """A wrapper class for Revit links.""" def getPath(self): """Gets the path of the linked document. Returns: string: The path on disk""" import revitron try: return revitron.Document(self.element.GetLinkDocument()).getPath() except: pass ...
the_stack_v2_python_sparse
revitron/link.py
Thomas84/revitron
train
0
f2c774a34b6fb013001e9d10ec56cb84462cea63
[ "self.datasets = datasets\nself.templates = {dataset_name: datasets[dataset_name]['template'] for dataset_name in datasets}\nself.phrases = {dataset_name: datasets[dataset_name]['phrases'] for dataset_name in datasets}\nself.texts = {dataset_name: datasets[dataset_name]['texts'] for dataset_name in datasets}", "i...
<|body_start_0|> self.datasets = datasets self.templates = {dataset_name: datasets[dataset_name]['template'] for dataset_name in datasets} self.phrases = {dataset_name: datasets[dataset_name]['phrases'] for dataset_name in datasets} self.texts = {dataset_name: datasets[dataset_name]['tex...
DemoData
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DemoData: def __init__(self): """A object for accessing datasets for demonstrations and testing. It contains the following datasets: 1. auction_advertisements: this is a use case of digitized 18th century Dutch newspapers from the National Library of the Netherlands. It contains a small ...
stack_v2_sparse_classes_36k_train_031617
3,633
permissive
[ { "docstring": "A object for accessing datasets for demonstrations and testing. It contains the following datasets: 1. auction_advertisements: this is a use case of digitized 18th century Dutch newspapers from the National Library of the Netherlands. It contains a small sample of texts from newspaper advertisem...
5
stack_v2_sparse_classes_30k_test_000282
Implement the Python class `DemoData` described below. Class description: Implement the DemoData class. Method signatures and docstrings: - def __init__(self): A object for accessing datasets for demonstrations and testing. It contains the following datasets: 1. auction_advertisements: this is a use case of digitized...
Implement the Python class `DemoData` described below. Class description: Implement the DemoData class. Method signatures and docstrings: - def __init__(self): A object for accessing datasets for demonstrations and testing. It contains the following datasets: 1. auction_advertisements: this is a use case of digitized...
1ac61e558f16b5a35918f55ac1f65857c740601e
<|skeleton|> class DemoData: def __init__(self): """A object for accessing datasets for demonstrations and testing. It contains the following datasets: 1. auction_advertisements: this is a use case of digitized 18th century Dutch newspapers from the National Library of the Netherlands. It contains a small ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DemoData: def __init__(self): """A object for accessing datasets for demonstrations and testing. It contains the following datasets: 1. auction_advertisements: this is a use case of digitized 18th century Dutch newspapers from the National Library of the Netherlands. It contains a small sample of text...
the_stack_v2_python_sparse
data/demo_data.py
marijnkoolen/fuzzy-search
train
18
8a5e866c031c4cb5a5b6bdb532290ce72f1ffc34
[ "kwargs = locals().copy()\nself._is_ray_client = ray.util.client.ray.is_connected()\nif _tuner_internal:\n if not self._is_ray_client:\n self._local_tuner = kwargs[_TUNER_INTERNAL]\n else:\n self._remote_tuner = kwargs[_TUNER_INTERNAL]\nelse:\n kwargs.pop(_TUNER_INTERNAL, None)\n kwargs.po...
<|body_start_0|> kwargs = locals().copy() self._is_ray_client = ray.util.client.ray.is_connected() if _tuner_internal: if not self._is_ray_client: self._local_tuner = kwargs[_TUNER_INTERNAL] else: self._remote_tuner = kwargs[_TUNER_INTERNAL...
HACK(geoffrey): This is a temporary fix to support Ray 2.1.0. Specifically, this Tuner ensures that TunerInternalRay210 is called by the class. For more details, see TunerInternalRay210.
TunerRay210
[ "Apache-2.0", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TunerRay210: """HACK(geoffrey): This is a temporary fix to support Ray 2.1.0. Specifically, this Tuner ensures that TunerInternalRay210 is called by the class. For more details, see TunerInternalRay210.""" def __init__(self, trainable: Optional[Union[str, Callable, Type[Trainable], 'BaseTrai...
stack_v2_sparse_classes_36k_train_031618
5,763
permissive
[ { "docstring": "Configure and construct a tune run.", "name": "__init__", "signature": "def __init__(self, trainable: Optional[Union[str, Callable, Type[Trainable], 'BaseTrainer']]=None, *, param_space: Optional[Dict[str, Any]]=None, tune_config: Optional[TuneConfig]=None, run_config: Optional[RunConfig...
2
null
Implement the Python class `TunerRay210` described below. Class description: HACK(geoffrey): This is a temporary fix to support Ray 2.1.0. Specifically, this Tuner ensures that TunerInternalRay210 is called by the class. For more details, see TunerInternalRay210. Method signatures and docstrings: - def __init__(self,...
Implement the Python class `TunerRay210` described below. Class description: HACK(geoffrey): This is a temporary fix to support Ray 2.1.0. Specifically, this Tuner ensures that TunerInternalRay210 is called by the class. For more details, see TunerInternalRay210. Method signatures and docstrings: - def __init__(self,...
e1d023e41606c9b76b35e1d231c2f13368a30eca
<|skeleton|> class TunerRay210: """HACK(geoffrey): This is a temporary fix to support Ray 2.1.0. Specifically, this Tuner ensures that TunerInternalRay210 is called by the class. For more details, see TunerInternalRay210.""" def __init__(self, trainable: Optional[Union[str, Callable, Type[Trainable], 'BaseTrai...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TunerRay210: """HACK(geoffrey): This is a temporary fix to support Ray 2.1.0. Specifically, this Tuner ensures that TunerInternalRay210 is called by the class. For more details, see TunerInternalRay210.""" def __init__(self, trainable: Optional[Union[str, Callable, Type[Trainable], 'BaseTrainer']]=None, ...
the_stack_v2_python_sparse
ludwig/backend/_ray210_compat.py
ludwig-ai/ludwig
train
2,567
a970b507741bcd2b7bd2659887c6c90985b6b7c5
[ "super(AlternatingCoattention, self).__init__()\nself.n_entities = 1 if weight_tying else 2\nwith self.init_scope():\n self.energy_layers_1 = chainer.ChainList(*[GraphLinear(hidden_dim + out_dim, head) for _ in range(self.n_entities)])\n self.energy_layers_2 = chainer.ChainList(*[GraphLinear(head, 1)])\n s...
<|body_start_0|> super(AlternatingCoattention, self).__init__() self.n_entities = 1 if weight_tying else 2 with self.init_scope(): self.energy_layers_1 = chainer.ChainList(*[GraphLinear(hidden_dim + out_dim, head) for _ in range(self.n_entities)]) self.energy_layers_2 = c...
AlternatingCoattention
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AlternatingCoattention: def __init__(self, hidden_dim, out_dim, head, weight_tying=False): """:param hidden_dim: dimension of atom representation :param out_dim: dimension of molecular representation :param head: number of heads in attention mechanism :param weight_tying: indicate whethe...
stack_v2_sparse_classes_36k_train_031619
3,771
permissive
[ { "docstring": ":param hidden_dim: dimension of atom representation :param out_dim: dimension of molecular representation :param head: number of heads in attention mechanism :param weight_tying: indicate whether the weights should be shared between two attention computation", "name": "__init__", "signat...
3
stack_v2_sparse_classes_30k_train_002795
Implement the Python class `AlternatingCoattention` described below. Class description: Implement the AlternatingCoattention class. Method signatures and docstrings: - def __init__(self, hidden_dim, out_dim, head, weight_tying=False): :param hidden_dim: dimension of atom representation :param out_dim: dimension of mo...
Implement the Python class `AlternatingCoattention` described below. Class description: Implement the AlternatingCoattention class. Method signatures and docstrings: - def __init__(self, hidden_dim, out_dim, head, weight_tying=False): :param hidden_dim: dimension of atom representation :param out_dim: dimension of mo...
21b64a3c8cc9bc33718ae09c65aa917e575132eb
<|skeleton|> class AlternatingCoattention: def __init__(self, hidden_dim, out_dim, head, weight_tying=False): """:param hidden_dim: dimension of atom representation :param out_dim: dimension of molecular representation :param head: number of heads in attention mechanism :param weight_tying: indicate whethe...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AlternatingCoattention: def __init__(self, hidden_dim, out_dim, head, weight_tying=False): """:param hidden_dim: dimension of atom representation :param out_dim: dimension of molecular representation :param head: number of heads in attention mechanism :param weight_tying: indicate whether the weights ...
the_stack_v2_python_sparse
models/coattention/alternating_coattention.py
Minys233/GCN-BMP
train
1
669321487c7e8da628aacbe3607a78982325e376
[ "for model, trained_examples in trained_examples_by_model.items():\n if not trained_examples:\n continue\n if trained_examples[-1].span < max_span:\n return model\nraise exceptions.SkipSignal()", "_validate_input_dict(input_dict)\nops_utils.validate_argument('wait_spans_before_eval', self.wait...
<|body_start_0|> for model, trained_examples in trained_examples_by_model.items(): if not trained_examples: continue if trained_examples[-1].span < max_span: return model raise exceptions.SkipSignal() <|end_body_0|> <|body_start_1|> _valid...
SpanDrivenEvaluatorInputs operator.
SpanDrivenEvaluatorInputs
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SpanDrivenEvaluatorInputs: """SpanDrivenEvaluatorInputs operator.""" def _get_model_to_evaluate(self, trained_examples_by_model: Dict[types.Artifact, List[types.Artifact]], max_span: int) -> Optional[types.Artifact]: """Finds the latest Model not trained on Examples with span max_spa...
stack_v2_sparse_classes_36k_train_031620
7,595
permissive
[ { "docstring": "Finds the latest Model not trained on Examples with span max_span.", "name": "_get_model_to_evaluate", "signature": "def _get_model_to_evaluate(self, trained_examples_by_model: Dict[types.Artifact, List[types.Artifact]], max_span: int) -> Optional[types.Artifact]" }, { "docstring...
2
stack_v2_sparse_classes_30k_train_011892
Implement the Python class `SpanDrivenEvaluatorInputs` described below. Class description: SpanDrivenEvaluatorInputs operator. Method signatures and docstrings: - def _get_model_to_evaluate(self, trained_examples_by_model: Dict[types.Artifact, List[types.Artifact]], max_span: int) -> Optional[types.Artifact]: Finds t...
Implement the Python class `SpanDrivenEvaluatorInputs` described below. Class description: SpanDrivenEvaluatorInputs operator. Method signatures and docstrings: - def _get_model_to_evaluate(self, trained_examples_by_model: Dict[types.Artifact, List[types.Artifact]], max_span: int) -> Optional[types.Artifact]: Finds t...
1b328504fa08a70388691e4072df76f143631325
<|skeleton|> class SpanDrivenEvaluatorInputs: """SpanDrivenEvaluatorInputs operator.""" def _get_model_to_evaluate(self, trained_examples_by_model: Dict[types.Artifact, List[types.Artifact]], max_span: int) -> Optional[types.Artifact]: """Finds the latest Model not trained on Examples with span max_spa...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SpanDrivenEvaluatorInputs: """SpanDrivenEvaluatorInputs operator.""" def _get_model_to_evaluate(self, trained_examples_by_model: Dict[types.Artifact, List[types.Artifact]], max_span: int) -> Optional[types.Artifact]: """Finds the latest Model not trained on Examples with span max_span.""" ...
the_stack_v2_python_sparse
tfx/dsl/input_resolution/ops/span_driven_evaluator_inputs_op.py
tensorflow/tfx
train
2,116
f05dd71590142c1a397e6b0e8867eed031b89d3e
[ "dirpath = path + os.sep + dirname_\nif os.path.exists(dirpath):\n print()\nelse:\n os.makedirs(dirpath)\nif os.path.exists(dirpath + os.sep + dirname):\n print('文件夹和文件已经存在')\nelse:\n os.makedirs(dirpath + os.sep + dirname)\n file = open(dirpath + os.sep + dirname + os.sep + '1.html', 'w')\n file....
<|body_start_0|> dirpath = path + os.sep + dirname_ if os.path.exists(dirpath): print() else: os.makedirs(dirpath) if os.path.exists(dirpath + os.sep + dirname): print('文件夹和文件已经存在') else: os.makedirs(dirpath + os.sep + dirname) ...
Test_1
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test_1: def check_dir(self, dirname, dirname_): """检查上面的文件夹和文件是否存在,如果不存在就创建 :param dirname: :param filename: :return:""" <|body_0|> def build_dir(self, dirname): """创建3级目录 :param dirname: :return:""" <|body_1|> def md5_get(self, filename): """获取文...
stack_v2_sparse_classes_36k_train_031621
2,241
no_license
[ { "docstring": "检查上面的文件夹和文件是否存在,如果不存在就创建 :param dirname: :param filename: :return:", "name": "check_dir", "signature": "def check_dir(self, dirname, dirname_)" }, { "docstring": "创建3级目录 :param dirname: :return:", "name": "build_dir", "signature": "def build_dir(self, dirname)" }, { ...
4
null
Implement the Python class `Test_1` described below. Class description: Implement the Test_1 class. Method signatures and docstrings: - def check_dir(self, dirname, dirname_): 检查上面的文件夹和文件是否存在,如果不存在就创建 :param dirname: :param filename: :return: - def build_dir(self, dirname): 创建3级目录 :param dirname: :return: - def md5_g...
Implement the Python class `Test_1` described below. Class description: Implement the Test_1 class. Method signatures and docstrings: - def check_dir(self, dirname, dirname_): 检查上面的文件夹和文件是否存在,如果不存在就创建 :param dirname: :param filename: :return: - def build_dir(self, dirname): 创建3级目录 :param dirname: :return: - def md5_g...
25986e44b65228dd0f5ccdee6bedb0fcd93e5b7c
<|skeleton|> class Test_1: def check_dir(self, dirname, dirname_): """检查上面的文件夹和文件是否存在,如果不存在就创建 :param dirname: :param filename: :return:""" <|body_0|> def build_dir(self, dirname): """创建3级目录 :param dirname: :return:""" <|body_1|> def md5_get(self, filename): """获取文...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Test_1: def check_dir(self, dirname, dirname_): """检查上面的文件夹和文件是否存在,如果不存在就创建 :param dirname: :param filename: :return:""" dirpath = path + os.sep + dirname_ if os.path.exists(dirpath): print() else: os.makedirs(dirpath) if os.path.exists(dirpath +...
the_stack_v2_python_sparse
Project/testcase/Test_1.py
Nightwish555/Weekly---practice
train
3
3d96f9353c027b7e870fb988fab584746903c16e
[ "tails = [0] * len(nums)\nsize = 0\nfor num in nums:\n left, right = (0, size)\n while left != right:\n mid = (left + right) / 2\n if tails[mid] < num:\n left = mid + 1\n else:\n right = mid\n tails[left] = num\n size = max(left + 1, size)\nreturn size", "num...
<|body_start_0|> tails = [0] * len(nums) size = 0 for num in nums: left, right = (0, size) while left != right: mid = (left + right) / 2 if tails[mid] < num: left = mid + 1 else: right...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def lengthOfLIS(self, nums): """:type nums: List[int] :rtype: int https://leetcode.com/problems/longest-increasing-subsequence/discuss/74824/ https://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-size-n-log-n/ tails is an array storing the smallest tail of ...
stack_v2_sparse_classes_36k_train_031622
2,432
no_license
[ { "docstring": ":type nums: List[int] :rtype: int https://leetcode.com/problems/longest-increasing-subsequence/discuss/74824/ https://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-size-n-log-n/ tails is an array storing the smallest tail of all increasing sub-sequences with length i+1 in ta...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLIS(self, nums): :type nums: List[int] :rtype: int https://leetcode.com/problems/longest-increasing-subsequence/discuss/74824/ https://www.geeksforgeeks.org/longest-m...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLIS(self, nums): :type nums: List[int] :rtype: int https://leetcode.com/problems/longest-increasing-subsequence/discuss/74824/ https://www.geeksforgeeks.org/longest-m...
7e0e917c15d3e35f49da3a00ef395bd5ff180d79
<|skeleton|> class Solution: def lengthOfLIS(self, nums): """:type nums: List[int] :rtype: int https://leetcode.com/problems/longest-increasing-subsequence/discuss/74824/ https://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-size-n-log-n/ tails is an array storing the smallest tail of ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def lengthOfLIS(self, nums): """:type nums: List[int] :rtype: int https://leetcode.com/problems/longest-increasing-subsequence/discuss/74824/ https://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-size-n-log-n/ tails is an array storing the smallest tail of all increasing...
the_stack_v2_python_sparse
LeetCode/300_longest_increasing_subsequence.py
yao23/Machine_Learning_Playground
train
12
e3ad3381da166e859bc34e0b7b16f2cdda4d6aea
[ "ret = []\n\ndef helper(node):\n if node == None:\n return ''\n ret.append(str(node.val))\n helper(node.left)\n helper(node.right)\nhelper(root)\nreturn ','.join(ret)", "if not data:\n return None\n\ndef helper(data):\n if data == []:\n return\n cur = int(data.pop(0))\n root ...
<|body_start_0|> ret = [] def helper(node): if node == None: return '' ret.append(str(node.val)) helper(node.left) helper(node.right) helper(root) return ','.join(ret) <|end_body_0|> <|body_start_1|> if not data: ...
Codec
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" <|body_0|> def deserialize(self, data: str) -> TreeNode: """Decodes your encoded data to tree.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ret = [] ...
stack_v2_sparse_classes_36k_train_031623
1,245
permissive
[ { "docstring": "Encodes a tree to a single string.", "name": "serialize", "signature": "def serialize(self, root: TreeNode) -> str" }, { "docstring": "Decodes your encoded data to tree.", "name": "deserialize", "signature": "def deserialize(self, data: str) -> TreeNode" } ]
2
stack_v2_sparse_classes_30k_test_000247
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: TreeNode) -> str: Encodes a tree to a single string. - def deserialize(self, data: str) -> TreeNode: Decodes your encoded data to tree.
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: TreeNode) -> str: Encodes a tree to a single string. - def deserialize(self, data: str) -> TreeNode: Decodes your encoded data to tree. <|skeleton|> class Co...
b4ecd5cb7122467ee479f38497faaabb17e6025e
<|skeleton|> class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" <|body_0|> def deserialize(self, data: str) -> TreeNode: """Decodes your encoded data to tree.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" ret = [] def helper(node): if node == None: return '' ret.append(str(node.val)) helper(node.left) helper(node.right) help...
the_stack_v2_python_sparse
solutions/0449.serialize-and-deserialize-bst/serialize-and-deserialize-bst.py
cocobear/LeetCode_in_Python
train
0
ebec1c7b19099ff206c70ca4350ebff1b1651e90
[ "m = len(grid)\nif m > 0:\n n = len(grid[0])\nelse:\n return 0\ncost = [[0 for _ in range(n)] for _ in range(m)]\ncost[0][0] = grid[0][0]\nfor j in range(1, n):\n cost[0][j] = grid[0][j] = grid[0][j] + cost[0][j - 1]\nfor i in range(1, m):\n cost[i][0] = grid[i][0] + cost[i - 1][0]\nfor i in range(1, m)...
<|body_start_0|> m = len(grid) if m > 0: n = len(grid[0]) else: return 0 cost = [[0 for _ in range(n)] for _ in range(m)] cost[0][0] = grid[0][0] for j in range(1, n): cost[0][j] = grid[0][j] = grid[0][j] + cost[0][j - 1] for i ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def minPathSum(self, grid): """:type grid: List[List[int]] :rtype: int""" <|body_0|> def minPathSum0(self, grid): """:type grid: List[List[int]] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> m = len(grid) if m > 0: ...
stack_v2_sparse_classes_36k_train_031624
1,214
no_license
[ { "docstring": ":type grid: List[List[int]] :rtype: int", "name": "minPathSum", "signature": "def minPathSum(self, grid)" }, { "docstring": ":type grid: List[List[int]] :rtype: int", "name": "minPathSum0", "signature": "def minPathSum0(self, grid)" } ]
2
stack_v2_sparse_classes_30k_train_003740
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minPathSum(self, grid): :type grid: List[List[int]] :rtype: int - def minPathSum0(self, grid): :type grid: List[List[int]] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minPathSum(self, grid): :type grid: List[List[int]] :rtype: int - def minPathSum0(self, grid): :type grid: List[List[int]] :rtype: int <|skeleton|> class Solution: def ...
9e49b2c6003b957276737005d4aaac276b44d251
<|skeleton|> class Solution: def minPathSum(self, grid): """:type grid: List[List[int]] :rtype: int""" <|body_0|> def minPathSum0(self, grid): """:type grid: List[List[int]] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def minPathSum(self, grid): """:type grid: List[List[int]] :rtype: int""" m = len(grid) if m > 0: n = len(grid[0]) else: return 0 cost = [[0 for _ in range(n)] for _ in range(m)] cost[0][0] = grid[0][0] for j in range(1,...
the_stack_v2_python_sparse
PythonCode/src/0064_Minimum_Path_Sum.py
oneyuan/CodeforFun
train
0
394828d907cf0f2b3ee48f0e5351684adb771078
[ "assert bias.shape[0] == 4\nassert weight_hh.shape[0] == 4\nassert weight_hh.shape[1] == 1\nself.hidden_size: int = 1\nself.input_size: int = input_size\nself.bias: np.ndarray = bias\nself.weight_hh: np.ndarray = weight_hh\nself.weight_xh: np.ndarray = weight_xh\nself.hx: np.ndarray = np.asarray([])\nself.c: np.nda...
<|body_start_0|> assert bias.shape[0] == 4 assert weight_hh.shape[0] == 4 assert weight_hh.shape[1] == 1 self.hidden_size: int = 1 self.input_size: int = input_size self.bias: np.ndarray = bias self.weight_hh: np.ndarray = weight_hh self.weight_xh: np.ndar...
Custom implementation of the single LSTM-cell.
LSTMCell
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LSTMCell: """Custom implementation of the single LSTM-cell.""" def __init__(self, input_size: int, bias: np.ndarray, weight_hh: np.ndarray, weight_xh: np.ndarray): """Create the LSTM-cell with the provided parameters. :param input_size: Number of inputs going into the cell :param bia...
stack_v2_sparse_classes_36k_train_031625
2,345
permissive
[ { "docstring": "Create the LSTM-cell with the provided parameters. :param input_size: Number of inputs going into the cell :param bias: Bias-vector from each of the internal nodes :param weight_hh: Weight-vector from hidden to hidden states :param weight_xh: Weight-vector from input to hidden states", "name...
2
stack_v2_sparse_classes_30k_train_002988
Implement the Python class `LSTMCell` described below. Class description: Custom implementation of the single LSTM-cell. Method signatures and docstrings: - def __init__(self, input_size: int, bias: np.ndarray, weight_hh: np.ndarray, weight_xh: np.ndarray): Create the LSTM-cell with the provided parameters. :param in...
Implement the Python class `LSTMCell` described below. Class description: Custom implementation of the single LSTM-cell. Method signatures and docstrings: - def __init__(self, input_size: int, bias: np.ndarray, weight_hh: np.ndarray, weight_xh: np.ndarray): Create the LSTM-cell with the provided parameters. :param in...
818a4ce941536611c0f1780f7c4a6238f0e1884e
<|skeleton|> class LSTMCell: """Custom implementation of the single LSTM-cell.""" def __init__(self, input_size: int, bias: np.ndarray, weight_hh: np.ndarray, weight_xh: np.ndarray): """Create the LSTM-cell with the provided parameters. :param input_size: Number of inputs going into the cell :param bia...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LSTMCell: """Custom implementation of the single LSTM-cell.""" def __init__(self, input_size: int, bias: np.ndarray, weight_hh: np.ndarray, weight_xh: np.ndarray): """Create the LSTM-cell with the provided parameters. :param input_size: Number of inputs going into the cell :param bias: Bias-vecto...
the_stack_v2_python_sparse
population/utils/rnn_cell_util/lstm.py
RubenPants/EvolvableRNN
train
1
ec67429fb2fb8fed002590ecf6fe34a524f7f753
[ "logger.info('Training the model.')\nconfig = self.get_config()\nif seed:\n logger.info(f'Setting seed to {seed}')\n seed_everything(seed, workers=True)\nconfig.trainer.deterministic = 'warn' if deterministic else deterministic\nlogger.info(\"Training Configs '%s'\", config)\ndatamodule = OTXAnomalyDataModule...
<|body_start_0|> logger.info('Training the model.') config = self.get_config() if seed: logger.info(f'Setting seed to {seed}') seed_everything(seed, workers=True) config.trainer.deterministic = 'warn' if deterministic else deterministic logger.info("Traini...
Base Anomaly Task.
TrainingTask
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TrainingTask: """Base Anomaly Task.""" def train(self, dataset: DatasetEntity, output_model: ModelEntity, train_parameters: TrainParameters, seed: Optional[int]=None, deterministic: bool=False) -> None: """Train the anomaly classification model. Args: dataset (DatasetEntity): Input d...
stack_v2_sparse_classes_36k_train_031626
5,264
permissive
[ { "docstring": "Train the anomaly classification model. Args: dataset (DatasetEntity): Input dataset. output_model (ModelEntity): Output model to save the model weights. train_parameters (TrainParameters): Training parameters seed (Optional[int]): Setting seed to a value other than 0 deterministic (bool): Setti...
2
stack_v2_sparse_classes_30k_train_004048
Implement the Python class `TrainingTask` described below. Class description: Base Anomaly Task. Method signatures and docstrings: - def train(self, dataset: DatasetEntity, output_model: ModelEntity, train_parameters: TrainParameters, seed: Optional[int]=None, deterministic: bool=False) -> None: Train the anomaly cla...
Implement the Python class `TrainingTask` described below. Class description: Base Anomaly Task. Method signatures and docstrings: - def train(self, dataset: DatasetEntity, output_model: ModelEntity, train_parameters: TrainParameters, seed: Optional[int]=None, deterministic: bool=False) -> None: Train the anomaly cla...
80454808b38727e358e8b880043eeac0f18152fb
<|skeleton|> class TrainingTask: """Base Anomaly Task.""" def train(self, dataset: DatasetEntity, output_model: ModelEntity, train_parameters: TrainParameters, seed: Optional[int]=None, deterministic: bool=False) -> None: """Train the anomaly classification model. Args: dataset (DatasetEntity): Input d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TrainingTask: """Base Anomaly Task.""" def train(self, dataset: DatasetEntity, output_model: ModelEntity, train_parameters: TrainParameters, seed: Optional[int]=None, deterministic: bool=False) -> None: """Train the anomaly classification model. Args: dataset (DatasetEntity): Input dataset. outpu...
the_stack_v2_python_sparse
src/otx/algorithms/anomaly/tasks/train.py
openvinotoolkit/training_extensions
train
397
e12f36c4fdfe164205d9e207fee538cae27ef937
[ "self.command_output = ''\nself.browsers = []\nself.data = ''\nself.current_path = os.getcwd()", "ret_data = {'List of Installed Browsers': []}\nself.command_output = os.popen(\"apropos 'web browser'\").read()\nself.browsers = self.command_output.split('\\n')\nself.browsers.pop()\nself.browsers = [i[:i.find('(') ...
<|body_start_0|> self.command_output = '' self.browsers = [] self.data = '' self.current_path = os.getcwd() <|end_body_0|> <|body_start_1|> ret_data = {'List of Installed Browsers': []} self.command_output = os.popen("apropos 'web browser'").read() self.browsers ...
********* THIS SCRIPT RETURNS A LIST CONTAINING BROWSERS INSTALLED ON USER'S LINUX SYSTEM ********* CLASS get_browsers DOCINFO: get_browsers HAVE TWO FUNCTIONS I.E., 1) __init__ 2) work() __init__ DOCFILE: __init__ BLOCK SERVES THE INITIALIZATION FUNCTION, CONTAINING INITIALIZED VARIABLES WHICH IS GOING TO BE USED LATE...
get_browsers
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class get_browsers: """********* THIS SCRIPT RETURNS A LIST CONTAINING BROWSERS INSTALLED ON USER'S LINUX SYSTEM ********* CLASS get_browsers DOCINFO: get_browsers HAVE TWO FUNCTIONS I.E., 1) __init__ 2) work() __init__ DOCFILE: __init__ BLOCK SERVES THE INITIALIZATION FUNCTION, CONTAINING INITIALIZED ...
stack_v2_sparse_classes_36k_train_031627
2,883
permissive
[ { "docstring": "__init__ DOCFILE: __init__ BLOCK SERVES THE INITIALIZATION FUNCTION, CONTAINING INITIALIZED VARIABLES WHICH IS GOING TO BE USED LATER BY OTHER MEMBER FUNCTION.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "WORK() DOCFILE: THE FUNCTION WORKS IN FOLLOWI...
2
stack_v2_sparse_classes_30k_test_001133
Implement the Python class `get_browsers` described below. Class description: ********* THIS SCRIPT RETURNS A LIST CONTAINING BROWSERS INSTALLED ON USER'S LINUX SYSTEM ********* CLASS get_browsers DOCINFO: get_browsers HAVE TWO FUNCTIONS I.E., 1) __init__ 2) work() __init__ DOCFILE: __init__ BLOCK SERVES THE INITIALIZ...
Implement the Python class `get_browsers` described below. Class description: ********* THIS SCRIPT RETURNS A LIST CONTAINING BROWSERS INSTALLED ON USER'S LINUX SYSTEM ********* CLASS get_browsers DOCINFO: get_browsers HAVE TWO FUNCTIONS I.E., 1) __init__ 2) work() __init__ DOCFILE: __init__ BLOCK SERVES THE INITIALIZ...
256149b6f22828ac668a68e8cac17f86925ccd5c
<|skeleton|> class get_browsers: """********* THIS SCRIPT RETURNS A LIST CONTAINING BROWSERS INSTALLED ON USER'S LINUX SYSTEM ********* CLASS get_browsers DOCINFO: get_browsers HAVE TWO FUNCTIONS I.E., 1) __init__ 2) work() __init__ DOCFILE: __init__ BLOCK SERVES THE INITIALIZATION FUNCTION, CONTAINING INITIALIZED ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class get_browsers: """********* THIS SCRIPT RETURNS A LIST CONTAINING BROWSERS INSTALLED ON USER'S LINUX SYSTEM ********* CLASS get_browsers DOCINFO: get_browsers HAVE TWO FUNCTIONS I.E., 1) __init__ 2) work() __init__ DOCFILE: __init__ BLOCK SERVES THE INITIALIZATION FUNCTION, CONTAINING INITIALIZED VARIABLES WHI...
the_stack_v2_python_sparse
lib/linux/get_browsers.py
chavarera/Cinfo
train
9
8ccab11af213921a549e0a623ec97cb18b27c996
[ "json_data = request.data.decode()\nkwargs = {'description': None, 'email': None}\ntry:\n parameters = json_data and loads(json_data)\n if parameters:\n for param in kwargs:\n if param in parameters:\n kwargs[param] = parameters[param]\nexcept ValueError:\n return generate_...
<|body_start_0|> json_data = request.data.decode() kwargs = {'description': None, 'email': None} try: parameters = json_data and loads(json_data) if parameters: for param in kwargs: if param in parameters: kwargs...
Add and update a VO.
VO
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VO: """Add and update a VO.""" def post(self, vo): """Add a VO with a given name. .. :quickref: VO; Add a VOs. :param vo: VO to be added. :<json string description: Desciption of VO. :<json string email: Admin email for VO. :status 201: VO created successfully. :status 401: Invalid A...
stack_v2_sparse_classes_36k_train_031628
9,092
permissive
[ { "docstring": "Add a VO with a given name. .. :quickref: VO; Add a VOs. :param vo: VO to be added. :<json string description: Desciption of VO. :<json string email: Admin email for VO. :status 201: VO created successfully. :status 401: Invalid Auth Token. :status 409: Unsupported operation. :status 500: Intern...
2
stack_v2_sparse_classes_30k_test_000645
Implement the Python class `VO` described below. Class description: Add and update a VO. Method signatures and docstrings: - def post(self, vo): Add a VO with a given name. .. :quickref: VO; Add a VOs. :param vo: VO to be added. :<json string description: Desciption of VO. :<json string email: Admin email for VO. :st...
Implement the Python class `VO` described below. Class description: Add and update a VO. Method signatures and docstrings: - def post(self, vo): Add a VO with a given name. .. :quickref: VO; Add a VOs. :param vo: VO to be added. :<json string description: Desciption of VO. :<json string email: Admin email for VO. :st...
bf33d9441d3b4ff160a392eed56724f635a03fe6
<|skeleton|> class VO: """Add and update a VO.""" def post(self, vo): """Add a VO with a given name. .. :quickref: VO; Add a VOs. :param vo: VO to be added. :<json string description: Desciption of VO. :<json string email: Admin email for VO. :status 201: VO created successfully. :status 401: Invalid A...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class VO: """Add and update a VO.""" def post(self, vo): """Add a VO with a given name. .. :quickref: VO; Add a VOs. :param vo: VO to be added. :<json string description: Desciption of VO. :<json string email: Admin email for VO. :status 201: VO created successfully. :status 401: Invalid Auth Token. :s...
the_stack_v2_python_sparse
lib/rucio/web/rest/flaskapi/v1/vos.py
viveknigam3003/rucio
train
1
66f19c2bd040e0a7bfc6131cbf1b69063e33276b
[ "credentials = pika.PlainCredentials(username, password)\nparams = pika.ConnectionParameters(host, port, vhost, credentials, socket_timeout=3, retry_delay=3)\nconnection = pika.BlockingConnection(params)\nself.channel = connection.channel()", "self.extra_callback = callback\nself.channel.queue_declare(queue=queue...
<|body_start_0|> credentials = pika.PlainCredentials(username, password) params = pika.ConnectionParameters(host, port, vhost, credentials, socket_timeout=3, retry_delay=3) connection = pika.BlockingConnection(params) self.channel = connection.channel() <|end_body_0|> <|body_start_1|> ...
Queue consumer.
Consumer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Consumer: """Queue consumer.""" def __init__(self, host, port, vhost, username, password): """Initialize LogConsumer.""" <|body_0|> def consume(self, queue, callback, args={}): """Consuming listener.""" <|body_1|> def callback(self, ch, method, props...
stack_v2_sparse_classes_36k_train_031629
1,991
no_license
[ { "docstring": "Initialize LogConsumer.", "name": "__init__", "signature": "def __init__(self, host, port, vhost, username, password)" }, { "docstring": "Consuming listener.", "name": "consume", "signature": "def consume(self, queue, callback, args={})" }, { "docstring": "Called ...
3
stack_v2_sparse_classes_30k_train_005373
Implement the Python class `Consumer` described below. Class description: Queue consumer. Method signatures and docstrings: - def __init__(self, host, port, vhost, username, password): Initialize LogConsumer. - def consume(self, queue, callback, args={}): Consuming listener. - def callback(self, ch, method, props, bo...
Implement the Python class `Consumer` described below. Class description: Queue consumer. Method signatures and docstrings: - def __init__(self, host, port, vhost, username, password): Initialize LogConsumer. - def consume(self, queue, callback, args={}): Consuming listener. - def callback(self, ch, method, props, bo...
b1067b8b90a4d0e2269a7a57779f81dd4209100c
<|skeleton|> class Consumer: """Queue consumer.""" def __init__(self, host, port, vhost, username, password): """Initialize LogConsumer.""" <|body_0|> def consume(self, queue, callback, args={}): """Consuming listener.""" <|body_1|> def callback(self, ch, method, props...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Consumer: """Queue consumer.""" def __init__(self, host, port, vhost, username, password): """Initialize LogConsumer.""" credentials = pika.PlainCredentials(username, password) params = pika.ConnectionParameters(host, port, vhost, credentials, socket_timeout=3, retry_delay=3) ...
the_stack_v2_python_sparse
packages/amqp/consumer.py
michaelmob/it490-car-calendar
train
0
6aad17c5e193f3eb93ad8ed0b9d6255d2cbf01da
[ "if isinstance(value, (int, float)):\n return datetime.fromtimestamp(value, tz=timezone.utc)\nelif isinstance(value, str):\n if value.startswith('+'):\n return timedelta(seconds=float(value[1:]))\n else:\n return datetime.fromtimestamp(float(value), tz=timezone.utc)\nelse:\n raise NotImple...
<|body_start_0|> if isinstance(value, (int, float)): return datetime.fromtimestamp(value, tz=timezone.utc) elif isinstance(value, str): if value.startswith('+'): return timedelta(seconds=float(value[1:])) else: return datetime.fromtimes...
TimerField
[ "GPL-1.0-or-later", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TimerField: def _deserialize(self, value: typing.Any, attr: typing.Optional[str], data: typing.Optional[typing.Mapping[str, typing.Any]], **kwargs): """Deserialize value. Concrete :class:`Field` classes should implement this method. :param value: The value to be deserialized. :param attr...
stack_v2_sparse_classes_36k_train_031630
2,769
permissive
[ { "docstring": "Deserialize value. Concrete :class:`Field` classes should implement this method. :param value: The value to be deserialized. :param attr: The attribute/key in `data` to be deserialized. :param data: The raw input data passed to the `Schema.load`. :param kwargs: Field-specific keyword arguments. ...
2
null
Implement the Python class `TimerField` described below. Class description: Implement the TimerField class. Method signatures and docstrings: - def _deserialize(self, value: typing.Any, attr: typing.Optional[str], data: typing.Optional[typing.Mapping[str, typing.Any]], **kwargs): Deserialize value. Concrete :class:`F...
Implement the Python class `TimerField` described below. Class description: Implement the TimerField class. Method signatures and docstrings: - def _deserialize(self, value: typing.Any, attr: typing.Optional[str], data: typing.Optional[typing.Mapping[str, typing.Any]], **kwargs): Deserialize value. Concrete :class:`F...
b260bd41d5aa091e6a4f1818328426fbe6f625c0
<|skeleton|> class TimerField: def _deserialize(self, value: typing.Any, attr: typing.Optional[str], data: typing.Optional[typing.Mapping[str, typing.Any]], **kwargs): """Deserialize value. Concrete :class:`Field` classes should implement this method. :param value: The value to be deserialized. :param attr...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TimerField: def _deserialize(self, value: typing.Any, attr: typing.Optional[str], data: typing.Optional[typing.Mapping[str, typing.Any]], **kwargs): """Deserialize value. Concrete :class:`Field` classes should implement this method. :param value: The value to be deserialized. :param attr: The attribut...
the_stack_v2_python_sparse
aiokraken/rest/schemas/ktm.py
asmodehn/aiokraken
train
1
b751186e072b41eaa4a4d57ebaa6fe20be4b4161
[ "obj = self.objects[0]\nupdate = self.update_object.copy()\n[self.assertNotEqual(getattr(obj, k), v) for k, v in update.items()]\npayload = self.get_object_template(self.template_object, 0)\npayload.update(update)\nurl = reverse(self.update_url, args=(obj.id,))\nresponse = self.client.put(url, data=payload)\nself.a...
<|body_start_0|> obj = self.objects[0] update = self.update_object.copy() [self.assertNotEqual(getattr(obj, k), v) for k, v in update.items()] payload = self.get_object_template(self.template_object, 0) payload.update(update) url = reverse(self.update_url, args=(obj.id,))...
BasicUpdateApiTestCaseRunMixin
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BasicUpdateApiTestCaseRunMixin: def test_update_anonymous(self): """Anonymous user should NOT be able to update""" <|body_0|> def test_update_staff_user(self): """Staff user should be able to update EVERY object""" <|body_1|> <|end_skeleton|> <|body_start_0...
stack_v2_sparse_classes_36k_train_031631
9,174
permissive
[ { "docstring": "Anonymous user should NOT be able to update", "name": "test_update_anonymous", "signature": "def test_update_anonymous(self)" }, { "docstring": "Staff user should be able to update EVERY object", "name": "test_update_staff_user", "signature": "def test_update_staff_user(s...
2
null
Implement the Python class `BasicUpdateApiTestCaseRunMixin` described below. Class description: Implement the BasicUpdateApiTestCaseRunMixin class. Method signatures and docstrings: - def test_update_anonymous(self): Anonymous user should NOT be able to update - def test_update_staff_user(self): Staff user should be ...
Implement the Python class `BasicUpdateApiTestCaseRunMixin` described below. Class description: Implement the BasicUpdateApiTestCaseRunMixin class. Method signatures and docstrings: - def test_update_anonymous(self): Anonymous user should NOT be able to update - def test_update_staff_user(self): Staff user should be ...
9baa530f2f3405322f74ccc145641148f253341b
<|skeleton|> class BasicUpdateApiTestCaseRunMixin: def test_update_anonymous(self): """Anonymous user should NOT be able to update""" <|body_0|> def test_update_staff_user(self): """Staff user should be able to update EVERY object""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BasicUpdateApiTestCaseRunMixin: def test_update_anonymous(self): """Anonymous user should NOT be able to update""" obj = self.objects[0] update = self.update_object.copy() [self.assertNotEqual(getattr(obj, k), v) for k, v in update.items()] payload = self.get_object_tem...
the_stack_v2_python_sparse
palvelutori/test_mixins.py
City-of-Turku/munpalvelut_backend
train
0
c608cb67843adb3d589064298bd0732b03a07bb4
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn DriveItemUploadableProperties()", "from .file_system_info import FileSystemInfo\nfrom .file_system_info import FileSystemInfo\nfields: Dict[str, Callable[[Any], None]] = {'description': lambda n: setattr(self, 'description', n.get_str_...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return DriveItemUploadableProperties() <|end_body_0|> <|body_start_1|> from .file_system_info import FileSystemInfo from .file_system_info import FileSystemInfo fields: Dict[str, Callab...
DriveItemUploadableProperties
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DriveItemUploadableProperties: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DriveItemUploadableProperties: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator val...
stack_v2_sparse_classes_36k_train_031632
3,548
permissive
[ { "docstring": "Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: DriveItemUploadableProperties", "name": "create_from_discriminator_value", "signature": "def create_from_dis...
3
null
Implement the Python class `DriveItemUploadableProperties` described below. Class description: Implement the DriveItemUploadableProperties class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DriveItemUploadableProperties: Creates a new instance of th...
Implement the Python class `DriveItemUploadableProperties` described below. Class description: Implement the DriveItemUploadableProperties class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DriveItemUploadableProperties: Creates a new instance of th...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class DriveItemUploadableProperties: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DriveItemUploadableProperties: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator val...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DriveItemUploadableProperties: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DriveItemUploadableProperties: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create ...
the_stack_v2_python_sparse
msgraph/generated/models/drive_item_uploadable_properties.py
microsoftgraph/msgraph-sdk-python
train
135
69c6794caf97f6a75638252e8c598e6039e9d4e1
[ "super(chorin, self).__init__(mesh, boundaryDomains, nu, cfl, uMax)\nself.solverName = 'chorin'\nself.us = dolfin.Function(self.V)\nself.F1 = 1 / self.k * dolfin.inner(self.v, self.u - self.u0) * dolfin.dx + dolfin.inner(self.v, dolfin.grad(self.u0) * self.u0) * dolfin.dx + self.nu * dolfin.inner(dolfin.grad(self.v...
<|body_start_0|> super(chorin, self).__init__(mesh, boundaryDomains, nu, cfl, uMax) self.solverName = 'chorin' self.us = dolfin.Function(self.V) self.F1 = 1 / self.k * dolfin.inner(self.v, self.u - self.u0) * dolfin.dx + dolfin.inner(self.v, dolfin.grad(self.u0) * self.u0) * dolfin.dx + ...
chorin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class chorin: def __init__(self, mesh, boundaryDomains, nu, cfl, uMax): """### WORK IN PROGRESS #### Initialize the solver specific parameters (for the chorin scheme). Usage ----- Solver.initialize(mesh, nu, dt, f) Parameters ---------- mesh :: the geometry mesh data file location. ---- (type:...
stack_v2_sparse_classes_36k_train_031633
12,599
no_license
[ { "docstring": "### WORK IN PROGRESS #### Initialize the solver specific parameters (for the chorin scheme). Usage ----- Solver.initialize(mesh, nu, dt, f) Parameters ---------- mesh :: the geometry mesh data file location. ---- (type: dolfin.cpp.Mesh; single object) nu :: the fluid kinematic viscosity. -- (typ...
2
null
Implement the Python class `chorin` described below. Class description: Implement the chorin class. Method signatures and docstrings: - def __init__(self, mesh, boundaryDomains, nu, cfl, uMax): ### WORK IN PROGRESS #### Initialize the solver specific parameters (for the chorin scheme). Usage ----- Solver.initialize(m...
Implement the Python class `chorin` described below. Class description: Implement the chorin class. Method signatures and docstrings: - def __init__(self, mesh, boundaryDomains, nu, cfl, uMax): ### WORK IN PROGRESS #### Initialize the solver specific parameters (for the chorin scheme). Usage ----- Solver.initialize(m...
98fbad93b2d1615e670ebdce71996ec3447a6917
<|skeleton|> class chorin: def __init__(self, mesh, boundaryDomains, nu, cfl, uMax): """### WORK IN PROGRESS #### Initialize the solver specific parameters (for the chorin scheme). Usage ----- Solver.initialize(mesh, nu, dt, f) Parameters ---------- mesh :: the geometry mesh data file location. ---- (type:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class chorin: def __init__(self, mesh, boundaryDomains, nu, cfl, uMax): """### WORK IN PROGRESS #### Initialize the solver specific parameters (for the chorin scheme). Usage ----- Solver.initialize(mesh, nu, dt, f) Parameters ---------- mesh :: the geometry mesh data file location. ---- (type: dolfin.cpp.Me...
the_stack_v2_python_sparse
src/python/eulerian/base/chorin.py
apalha/pHyFlow2.0
train
0
34a833cc3edb0affa150773b0707f27fc86f6fd4
[ "re = AlarmSetting(userLogin).setAlarm(send_data['parkName'], send_data['enterConfidence'])\nresult = re['status']\nAssertions().assert_text(result, expect['enableConfidenceAlarm'])", "re = cloudparking_service(centerMonitorLogin).mockCarInOut(send_data['carNum'], 0, send_data['inClientID'], confidence=send_data[...
<|body_start_0|> re = AlarmSetting(userLogin).setAlarm(send_data['parkName'], send_data['enterConfidence']) result = re['status'] Assertions().assert_text(result, expect['enableConfidenceAlarm']) <|end_body_0|> <|body_start_1|> re = cloudparking_service(centerMonitorLogin).mockCarInOut(...
远程值班室收到置信度提醒-并校正车牌
TestAdjustCarNumByConfidence
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestAdjustCarNumByConfidence: """远程值班室收到置信度提醒-并校正车牌""" def test_enableConfidenceAlarm(self, userLogin, send_data, expect): """开启告警配置-置信度告警功能""" <|body_0|> def test_mockCarIn(self, centerMonitorLogin, send_data, expect): """模拟进场""" <|body_1|> def test...
stack_v2_sparse_classes_36k_train_031634
2,956
no_license
[ { "docstring": "开启告警配置-置信度告警功能", "name": "test_enableConfidenceAlarm", "signature": "def test_enableConfidenceAlarm(self, userLogin, send_data, expect)" }, { "docstring": "模拟进场", "name": "test_mockCarIn", "signature": "def test_mockCarIn(self, centerMonitorLogin, send_data, expect)" },...
6
null
Implement the Python class `TestAdjustCarNumByConfidence` described below. Class description: 远程值班室收到置信度提醒-并校正车牌 Method signatures and docstrings: - def test_enableConfidenceAlarm(self, userLogin, send_data, expect): 开启告警配置-置信度告警功能 - def test_mockCarIn(self, centerMonitorLogin, send_data, expect): 模拟进场 - def test_adj...
Implement the Python class `TestAdjustCarNumByConfidence` described below. Class description: 远程值班室收到置信度提醒-并校正车牌 Method signatures and docstrings: - def test_enableConfidenceAlarm(self, userLogin, send_data, expect): 开启告警配置-置信度告警功能 - def test_mockCarIn(self, centerMonitorLogin, send_data, expect): 模拟进场 - def test_adj...
34c368c109867da26d9256bca85f872b0fac2ea7
<|skeleton|> class TestAdjustCarNumByConfidence: """远程值班室收到置信度提醒-并校正车牌""" def test_enableConfidenceAlarm(self, userLogin, send_data, expect): """开启告警配置-置信度告警功能""" <|body_0|> def test_mockCarIn(self, centerMonitorLogin, send_data, expect): """模拟进场""" <|body_1|> def test...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestAdjustCarNumByConfidence: """远程值班室收到置信度提醒-并校正车牌""" def test_enableConfidenceAlarm(self, userLogin, send_data, expect): """开启告警配置-置信度告警功能""" re = AlarmSetting(userLogin).setAlarm(send_data['parkName'], send_data['enterConfidence']) result = re['status'] Assertions().ass...
the_stack_v2_python_sparse
test_suite/parkingConfig/settingParking/alarmSetting/test_adjustCarNumByConfidence.py
oyebino/pomp_api
train
1
019c9362a9d03118b14561e470d5de8aafeae4aa
[ "self.id = str(identity)\nself.direction = 'none'\nself.speed = 0", "self.speed = speed\noutput = '0' + self.id\nif self.speed < 11 and self.speed > -11:\n self.speed = 0\nelif self.speed < 0:\n output += '-'\n self.speed = self.speed * -1\nfor _ in range(4 - len(str(self.speed))):\n output += '0'\nou...
<|body_start_0|> self.id = str(identity) self.direction = 'none' self.speed = 0 <|end_body_0|> <|body_start_1|> self.speed = speed output = '0' + self.id if self.speed < 11 and self.speed > -11: self.speed = 0 elif self.speed < 0: output +...
A Wheel class representing a wheel of the emubot
Wheel
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Wheel: """A Wheel class representing a wheel of the emubot""" def __init__(self, identity): """Wheel.__init__(ID): parameters - the ID of the wheel""" <|body_0|> def move_wheel(self, speed): """Move the wheel""" <|body_1|> <|end_skeleton|> <|body_start_...
stack_v2_sparse_classes_36k_train_031635
2,748
permissive
[ { "docstring": "Wheel.__init__(ID): parameters - the ID of the wheel", "name": "__init__", "signature": "def __init__(self, identity)" }, { "docstring": "Move the wheel", "name": "move_wheel", "signature": "def move_wheel(self, speed)" } ]
2
stack_v2_sparse_classes_30k_train_010619
Implement the Python class `Wheel` described below. Class description: A Wheel class representing a wheel of the emubot Method signatures and docstrings: - def __init__(self, identity): Wheel.__init__(ID): parameters - the ID of the wheel - def move_wheel(self, speed): Move the wheel
Implement the Python class `Wheel` described below. Class description: A Wheel class representing a wheel of the emubot Method signatures and docstrings: - def __init__(self, identity): Wheel.__init__(ID): parameters - the ID of the wheel - def move_wheel(self, speed): Move the wheel <|skeleton|> class Wheel: ""...
a39dc01f7c1213c8079216d49d376b317efbf5f3
<|skeleton|> class Wheel: """A Wheel class representing a wheel of the emubot""" def __init__(self, identity): """Wheel.__init__(ID): parameters - the ID of the wheel""" <|body_0|> def move_wheel(self, speed): """Move the wheel""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Wheel: """A Wheel class representing a wheel of the emubot""" def __init__(self, identity): """Wheel.__init__(ID): parameters - the ID of the wheel""" self.id = str(identity) self.direction = 'none' self.speed = 0 def move_wheel(self, speed): """Move the wheel...
the_stack_v2_python_sparse
Client-Code-2018/CurrentEmuBotCode2/basic_classes.py
maxgodfrey2004/RoboCup-2018-Driving-Code
train
1
57c437f895c844480d51b6d36a121ea67646e701
[ "super(Decoder, self).__init__()\nself.N = N\nself.dm = dm\nself.embedding = tf.keras.layers.Embedding(target_vocab, self.dm)\nself.positional_encoding = positional_encoding(max_seq_len, self.dm)\nself.blocks = [DecoderBlock(self.dm, h, hidden, drop_rate) for n in range(self.N)]\nself.dropout = tf.keras.layers.Drop...
<|body_start_0|> super(Decoder, self).__init__() self.N = N self.dm = dm self.embedding = tf.keras.layers.Embedding(target_vocab, self.dm) self.positional_encoding = positional_encoding(max_seq_len, self.dm) self.blocks = [DecoderBlock(self.dm, h, hidden, drop_rate) for n...
Decorder class
Decoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Decoder: """Decorder class""" def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): """Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (int): the number of heads. hidden (int): the number of ...
stack_v2_sparse_classes_36k_train_031636
2,514
no_license
[ { "docstring": "Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (int): the number of heads. hidden (int): the number of hidden units in the fully connected layer. target_vocab (int): the size of the target vocabulary. max_seq_len (int): the maxi...
2
null
Implement the Python class `Decoder` described below. Class description: Decorder class Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h...
Implement the Python class `Decoder` described below. Class description: Decorder class Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h...
5aff923277cfe9f2b5324a773e4e5c3cac810a0c
<|skeleton|> class Decoder: """Decorder class""" def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): """Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (int): the number of heads. hidden (int): the number of ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Decoder: """Decorder class""" def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): """Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (int): the number of heads. hidden (int): the number of hidden units ...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/10-transformer_decoder.py
cmmolanos1/holbertonschool-machine_learning
train
1
c6ec567468c7630ac8a91de88384b13f9d3f557b
[ "super(BitCountingGroupList, self).__init__(group_list)\nif bits is not None:\n self.bits = bits\n return\nbits = 0.0\nfor group in group_list:\n bits += group.metadata.bits\nself.bits = bits", "group_list = list(self)\nif group_list:\n last_group = group_list[-1]\n factory = BitCountingMetadataFac...
<|body_start_0|> super(BitCountingGroupList, self).__init__(group_list) if bits is not None: self.bits = bits return bits = 0.0 for group in group_list: bits += group.metadata.bits self.bits = bits <|end_body_0|> <|body_start_1|> group...
List of BitCountingGroup which tracks overall bit count. This is useful, as bit count of a subsequent group depends on average of the previous group. Having the logic encapsulated here spares the caller the effort to pass averages around. Method with_value_added_to_last_group() delegates to BitCountingGroup, with_group...
BitCountingGroupList
[ "Apache-2.0", "CC-BY-4.0", "LicenseRef-scancode-dco-1.1" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BitCountingGroupList: """List of BitCountingGroup which tracks overall bit count. This is useful, as bit count of a subsequent group depends on average of the previous group. Having the logic encapsulated here spares the caller the effort to pass averages around. Method with_value_added_to_last_g...
stack_v2_sparse_classes_36k_train_031637
3,450
permissive
[ { "docstring": "Create a group list from given list of groups. :param group_list: List of groups to compose this group. :param bits: Bit count if known, else None. :type group_list: list of BitCountingGroup :type bits: float or None", "name": "__init__", "signature": "def __init__(self, group_list=[], b...
3
null
Implement the Python class `BitCountingGroupList` described below. Class description: List of BitCountingGroup which tracks overall bit count. This is useful, as bit count of a subsequent group depends on average of the previous group. Having the logic encapsulated here spares the caller the effort to pass averages ar...
Implement the Python class `BitCountingGroupList` described below. Class description: List of BitCountingGroup which tracks overall bit count. This is useful, as bit count of a subsequent group depends on average of the previous group. Having the logic encapsulated here spares the caller the effort to pass averages ar...
3151c98618c78e3782e48bbe4d9c8f906c126f69
<|skeleton|> class BitCountingGroupList: """List of BitCountingGroup which tracks overall bit count. This is useful, as bit count of a subsequent group depends on average of the previous group. Having the logic encapsulated here spares the caller the effort to pass averages around. Method with_value_added_to_last_g...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BitCountingGroupList: """List of BitCountingGroup which tracks overall bit count. This is useful, as bit count of a subsequent group depends on average of the previous group. Having the logic encapsulated here spares the caller the effort to pass averages around. Method with_value_added_to_last_group() delega...
the_stack_v2_python_sparse
PyPI/jumpavg/jumpavg/BitCountingGroupList.py
preym17/csit
train
0
bc8a90a6d596fd8c8c4c9964076a79dfd8239ec6
[ "self.id = id\nself._rk = RedisKeyWrapper(self.id)\nself.rdb = redis.StrictRedis(host=redis_address[0], port=redis_address[1], db=redis_db, decode_responses=True)", "assert isinstance(file_path, str)\nd = {'FILE_PATH': file_path, 'TTL': ttl}\nd.update(kwargs)\ntry:\n task = json.dumps(d)\n self.rdb.rpush(se...
<|body_start_0|> self.id = id self._rk = RedisKeyWrapper(self.id) self.rdb = redis.StrictRedis(host=redis_address[0], port=redis_address[1], db=redis_db, decode_responses=True) <|end_body_0|> <|body_start_1|> assert isinstance(file_path, str) d = {'FILE_PATH': file_path, 'TTL': ...
This class is an api for other users to connect to Publisher. The basic usage for now is that users should push their file's name or directory, (assuming that user's process and Publisher are running on the same machine, so that we could read the file locally by provided file's directory)to the queue, and then our zmq ...
FileManager
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileManager: """This class is an api for other users to connect to Publisher. The basic usage for now is that users should push their file's name or directory, (assuming that user's process and Publisher are running on the same machine, so that we could read the file locally by provided file's di...
stack_v2_sparse_classes_36k_train_031638
24,489
permissive
[ { "docstring": ":param id: publisher's id", "name": "__init__", "signature": "def __init__(self, id, redis_address=('127.0.0.1', 6379), redis_db=0)" }, { "docstring": ":param ttl: if ttl is 0, then it will live forever in boxes, otherwise time unit is sec :param kwargs: other headers", "name...
3
stack_v2_sparse_classes_30k_train_014899
Implement the Python class `FileManager` described below. Class description: This class is an api for other users to connect to Publisher. The basic usage for now is that users should push their file's name or directory, (assuming that user's process and Publisher are running on the same machine, so that we could read...
Implement the Python class `FileManager` described below. Class description: This class is an api for other users to connect to Publisher. The basic usage for now is that users should push their file's name or directory, (assuming that user's process and Publisher are running on the same machine, so that we could read...
01c92ae15a12ddce2fe61348a829f77a5e02bb41
<|skeleton|> class FileManager: """This class is an api for other users to connect to Publisher. The basic usage for now is that users should push their file's name or directory, (assuming that user's process and Publisher are running on the same machine, so that we could read the file locally by provided file's di...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileManager: """This class is an api for other users to connect to Publisher. The basic usage for now is that users should push their file's name or directory, (assuming that user's process and Publisher are running on the same machine, so that we could read the file locally by provided file's directory)to th...
the_stack_v2_python_sparse
dandelion/httpclient.py
ktshen/Dandelion
train
0
c29dcfecdb2451b745ad56f625420de53e70a4f5
[ "client = APIServiceClient(timeout=2)\nif network_name is None:\n topologies = await client.request_all('getTopology', return_exceptions=True)\nelse:\n topologies = {network_name: await client.request(network_name, 'getTopology')}\ncoroutines = []\nfor name, topology in topologies.items():\n if isinstance(...
<|body_start_0|> client = APIServiceClient(timeout=2) if network_name is None: topologies = await client.request_all('getTopology', return_exceptions=True) else: topologies = {network_name: await client.request(network_name, 'getTopology')} coroutines = [] ...
Topology
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Topology: async def update_topologies(cls, network_name: Optional[str]=None) -> None: """Fetch latest topologies and update class params.""" <|body_0|> def get_site_maps(cls, network_name: str) -> None: """Generate node macs and site name maps.""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_031639
4,262
permissive
[ { "docstring": "Fetch latest topologies and update class params.", "name": "update_topologies", "signature": "async def update_topologies(cls, network_name: Optional[str]=None) -> None" }, { "docstring": "Generate node macs and site name maps.", "name": "get_site_maps", "signature": "def...
4
null
Implement the Python class `Topology` described below. Class description: Implement the Topology class. Method signatures and docstrings: - async def update_topologies(cls, network_name: Optional[str]=None) -> None: Fetch latest topologies and update class params. - def get_site_maps(cls, network_name: str) -> None: ...
Implement the Python class `Topology` described below. Class description: Implement the Topology class. Method signatures and docstrings: - async def update_topologies(cls, network_name: Optional[str]=None) -> None: Fetch latest topologies and update class params. - def get_site_maps(cls, network_name: str) -> None: ...
93c0c4bef28c1ed15dc61e9fd340a9faef4902e3
<|skeleton|> class Topology: async def update_topologies(cls, network_name: Optional[str]=None) -> None: """Fetch latest topologies and update class params.""" <|body_0|> def get_site_maps(cls, network_name: str) -> None: """Generate node macs and site name maps.""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Topology: async def update_topologies(cls, network_name: Optional[str]=None) -> None: """Fetch latest topologies and update class params.""" client = APIServiceClient(timeout=2) if network_name is None: topologies = await client.request_all('getTopology', return_exceptions=...
the_stack_v2_python_sparse
scan_service/scan_service/utils/topology.py
terragraph/tgnms
train
15
c235f3fe930ecc07f178311983aad70f6f0706f1
[ "super().__init__(name, instrument, **kwargs)\nself._reference = instrument.root_instrument.reference\nself._dll_get_function = partial(dll_get_function, self._reference)\nself._dll_set_function = partial(dll_set_function, self._reference)", "if hasattr(self.instrument, 'channel_number'):\n instr = cast(Instru...
<|body_start_0|> super().__init__(name, instrument, **kwargs) self._reference = instrument.root_instrument.reference self._dll_get_function = partial(dll_get_function, self._reference) self._dll_set_function = partial(dll_set_function, self._reference) <|end_body_0|> <|body_start_1|> ...
LdaParameter
[ "GPL-2.0-only", "GPL-2.0-or-later", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LdaParameter: def __init__(self, name: str, instrument: Union[Vaunix_LDA, LdaChannel], dll_get_function: Callable, dll_set_function: Callable, **kwargs): """Parameter associated with one channel of the LDA. Args: name: parameter name instrument: parent instrument, either LDA or LDA chann...
stack_v2_sparse_classes_36k_train_031640
12,103
permissive
[ { "docstring": "Parameter associated with one channel of the LDA. Args: name: parameter name instrument: parent instrument, either LDA or LDA channel dll_get_function: DLL function that gets the value dll_get_function: DLL function that sets the value", "name": "__init__", "signature": "def __init__(sel...
4
stack_v2_sparse_classes_30k_train_006616
Implement the Python class `LdaParameter` described below. Class description: Implement the LdaParameter class. Method signatures and docstrings: - def __init__(self, name: str, instrument: Union[Vaunix_LDA, LdaChannel], dll_get_function: Callable, dll_set_function: Callable, **kwargs): Parameter associated with one ...
Implement the Python class `LdaParameter` described below. Class description: Implement the LdaParameter class. Method signatures and docstrings: - def __init__(self, name: str, instrument: Union[Vaunix_LDA, LdaChannel], dll_get_function: Callable, dll_set_function: Callable, **kwargs): Parameter associated with one ...
e07c9f23339ab00b0f4c4cc46711593d88f7fc84
<|skeleton|> class LdaParameter: def __init__(self, name: str, instrument: Union[Vaunix_LDA, LdaChannel], dll_get_function: Callable, dll_set_function: Callable, **kwargs): """Parameter associated with one channel of the LDA. Args: name: parameter name instrument: parent instrument, either LDA or LDA chann...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LdaParameter: def __init__(self, name: str, instrument: Union[Vaunix_LDA, LdaChannel], dll_get_function: Callable, dll_set_function: Callable, **kwargs): """Parameter associated with one channel of the LDA. Args: name: parameter name instrument: parent instrument, either LDA or LDA channel dll_get_fun...
the_stack_v2_python_sparse
qcodes_contrib_drivers/drivers/Vaunix/LDA.py
QCoDeS/Qcodes_contrib_drivers
train
32
7a8bb2005a21974171ed36617195bc873b499240
[ "flags.AddParentFlagsToParser(parser)\nparser.add_argument('--location', metavar='LOCATION', required=True, help='Location')\nparser.add_argument('--recommender', metavar='RECOMMENDER', required=True, help='Recommender to list recommendations for. Supported recommenders can be found here: https://cloud.google.com/r...
<|body_start_0|> flags.AddParentFlagsToParser(parser) parser.add_argument('--location', metavar='LOCATION', required=True, help='Location') parser.add_argument('--recommender', metavar='RECOMMENDER', required=True, help='Recommender to list recommendations for. Supported recommenders can be foun...
List operations for a recommendation. This command lists all recommendations for a given cloud_entity_id, location and recommender. Supported recommenders can be found here: https://cloud.google.com/recommender/docs/recommenders. Currently the following cloud_entity_types are supported: project, billing_account, folder...
ListOriginal
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ListOriginal: """List operations for a recommendation. This command lists all recommendations for a given cloud_entity_id, location and recommender. Supported recommenders can be found here: https://cloud.google.com/recommender/docs/recommenders. Currently the following cloud_entity_types are sup...
stack_v2_sparse_classes_36k_train_031641
6,552
permissive
[ { "docstring": "Args is called by calliope to gather arguments for this command. Args: parser: An argparse parser that you can use to add arguments that go on the command line after this command.", "name": "Args", "signature": "def Args(parser)" }, { "docstring": "Run 'gcloud recommender recomme...
2
null
Implement the Python class `ListOriginal` described below. Class description: List operations for a recommendation. This command lists all recommendations for a given cloud_entity_id, location and recommender. Supported recommenders can be found here: https://cloud.google.com/recommender/docs/recommenders. Currently t...
Implement the Python class `ListOriginal` described below. Class description: List operations for a recommendation. This command lists all recommendations for a given cloud_entity_id, location and recommender. Supported recommenders can be found here: https://cloud.google.com/recommender/docs/recommenders. Currently t...
392abf004b16203030e6efd2f0af24db7c8d669e
<|skeleton|> class ListOriginal: """List operations for a recommendation. This command lists all recommendations for a given cloud_entity_id, location and recommender. Supported recommenders can be found here: https://cloud.google.com/recommender/docs/recommenders. Currently the following cloud_entity_types are sup...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ListOriginal: """List operations for a recommendation. This command lists all recommendations for a given cloud_entity_id, location and recommender. Supported recommenders can be found here: https://cloud.google.com/recommender/docs/recommenders. Currently the following cloud_entity_types are supported: proje...
the_stack_v2_python_sparse
lib/surface/recommender/recommendations/list.py
google-cloud-sdk-unofficial/google-cloud-sdk
train
9
a33d9ebca4a7476b41a3c0ab88702e913a5d60ba
[ "self.mode = mode\nself.allowed_urls = allowed_urls\nself.allowed_files = allowed_files", "if dictionary is None:\n return None\nmode = dictionary.get('mode')\nallowed_urls = None\nif dictionary.get('allowedUrls') != None:\n allowed_urls = list()\n for structure in dictionary.get('allowedUrls'):\n ...
<|body_start_0|> self.mode = mode self.allowed_urls = allowed_urls self.allowed_files = allowed_files <|end_body_0|> <|body_start_1|> if dictionary is None: return None mode = dictionary.get('mode') allowed_urls = None if dictionary.get('allowedUrls')...
Implementation of the 'updateNetworkSecurityMalwareSettings' model. TODO: type model description here. Attributes: mode (string): Set mode to 'enabled' to enable malware prevention, otherwise 'disabled' allowed_urls (list of AllowedUrlModel): The urls that should be permitted by the malware detection engine. If omitted...
UpdateNetworkSecurityMalwareSettingsModel
[ "MIT", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UpdateNetworkSecurityMalwareSettingsModel: """Implementation of the 'updateNetworkSecurityMalwareSettings' model. TODO: type model description here. Attributes: mode (string): Set mode to 'enabled' to enable malware prevention, otherwise 'disabled' allowed_urls (list of AllowedUrlModel): The urls...
stack_v2_sparse_classes_36k_train_031642
3,077
permissive
[ { "docstring": "Constructor for the UpdateNetworkSecurityMalwareSettingsModel class", "name": "__init__", "signature": "def __init__(self, mode=None, allowed_urls=None, allowed_files=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A di...
2
stack_v2_sparse_classes_30k_test_000457
Implement the Python class `UpdateNetworkSecurityMalwareSettingsModel` described below. Class description: Implementation of the 'updateNetworkSecurityMalwareSettings' model. TODO: type model description here. Attributes: mode (string): Set mode to 'enabled' to enable malware prevention, otherwise 'disabled' allowed_u...
Implement the Python class `UpdateNetworkSecurityMalwareSettingsModel` described below. Class description: Implementation of the 'updateNetworkSecurityMalwareSettings' model. TODO: type model description here. Attributes: mode (string): Set mode to 'enabled' to enable malware prevention, otherwise 'disabled' allowed_u...
9894089eb013318243ae48869cc5130eb37f80c0
<|skeleton|> class UpdateNetworkSecurityMalwareSettingsModel: """Implementation of the 'updateNetworkSecurityMalwareSettings' model. TODO: type model description here. Attributes: mode (string): Set mode to 'enabled' to enable malware prevention, otherwise 'disabled' allowed_urls (list of AllowedUrlModel): The urls...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UpdateNetworkSecurityMalwareSettingsModel: """Implementation of the 'updateNetworkSecurityMalwareSettings' model. TODO: type model description here. Attributes: mode (string): Set mode to 'enabled' to enable malware prevention, otherwise 'disabled' allowed_urls (list of AllowedUrlModel): The urls that should ...
the_stack_v2_python_sparse
meraki_sdk/models/update_network_security_malware_settings_model.py
RaulCatalano/meraki-python-sdk
train
1
48ffa6e64fd085a4e1938612c7097c9ec4669a96
[ "cache_directory = self.config['cache_directory']\nsimulation_state = SimulationState()\nsimulation_state.set_current_time(year)\nsimulation_state.set_cache_directory(cache_directory)\ntmconfig = self.config['travel_model_configuration']\nyear_config = tmconfig[year]\nmatrix_directory = tmconfig.get('matrix_h5_dire...
<|body_start_0|> cache_directory = self.config['cache_directory'] simulation_state = SimulationState() simulation_state.set_current_time(year) simulation_state.set_cache_directory(cache_directory) tmconfig = self.config['travel_model_configuration'] year_config = tmconfig...
Copy skims stored in hdf5 format into the UrbanSim cache.
GetEmme4DataFromH5IntoCache
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GetEmme4DataFromH5IntoCache: """Copy skims stored in hdf5 format into the UrbanSim cache.""" def run(self, year): """Copy skims stored in hdf5 format into the UrbanSim cache. Should run after psrc_parcel.emme.models.run_export_skims which creates the skims hdf5 file. It creates a tra...
stack_v2_sparse_classes_36k_train_031643
5,542
no_license
[ { "docstring": "Copy skims stored in hdf5 format into the UrbanSim cache. Should run after psrc_parcel.emme.models.run_export_skims which creates the skims hdf5 file. It creates a travel_model dataset with each skim being an attribute of it. Zones are assumed to have no gaps. Arguments: year -- year of the urba...
2
null
Implement the Python class `GetEmme4DataFromH5IntoCache` described below. Class description: Copy skims stored in hdf5 format into the UrbanSim cache. Method signatures and docstrings: - def run(self, year): Copy skims stored in hdf5 format into the UrbanSim cache. Should run after psrc_parcel.emme.models.run_export_...
Implement the Python class `GetEmme4DataFromH5IntoCache` described below. Class description: Copy skims stored in hdf5 format into the UrbanSim cache. Method signatures and docstrings: - def run(self, year): Copy skims stored in hdf5 format into the UrbanSim cache. Should run after psrc_parcel.emme.models.run_export_...
c392d15b35aa1d47bbc185ed76314f8e6dd9f92f
<|skeleton|> class GetEmme4DataFromH5IntoCache: """Copy skims stored in hdf5 format into the UrbanSim cache.""" def run(self, year): """Copy skims stored in hdf5 format into the UrbanSim cache. Should run after psrc_parcel.emme.models.run_export_skims which creates the skims hdf5 file. It creates a tra...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GetEmme4DataFromH5IntoCache: """Copy skims stored in hdf5 format into the UrbanSim cache.""" def run(self, year): """Copy skims stored in hdf5 format into the UrbanSim cache. Should run after psrc_parcel.emme.models.run_export_skims which creates the skims hdf5 file. It creates a travel_model dat...
the_stack_v2_python_sparse
psrc_parcel/emme/models/get_emme4_data_from_h5_into_cache.py
psrc/urbansim
train
4
0cf6592c04a57755ddeb987922308f852cc5f643
[ "if not nums:\n return 0\nf = 1\nd = 1\nfor i in range(1, len(nums)):\n if nums[i] > nums[i - 1]:\n f = d + 1\n elif nums[i] < nums[i - 1]:\n d = f + 1\nreturn max(f, d)", "if len(nums) < 2:\n return len(nums)\ndp = [None for _ in range(len(nums))]\ndp[0] = [1, None]\nfor i in range(1, l...
<|body_start_0|> if not nums: return 0 f = 1 d = 1 for i in range(1, len(nums)): if nums[i] > nums[i - 1]: f = d + 1 elif nums[i] < nums[i - 1]: d = f + 1 return max(f, d) <|end_body_0|> <|body_start_1|> ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def wiggleMaxLength(self, nums): """nearly the same as linear house rob :type nums: List[int] :rtype: int""" <|body_0|> def wiggleMaxLength2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_031644
1,231
no_license
[ { "docstring": "nearly the same as linear house rob :type nums: List[int] :rtype: int", "name": "wiggleMaxLength", "signature": "def wiggleMaxLength(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "wiggleMaxLength2", "signature": "def wiggleMaxLength2(self, nu...
2
stack_v2_sparse_classes_30k_train_019343
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wiggleMaxLength(self, nums): nearly the same as linear house rob :type nums: List[int] :rtype: int - def wiggleMaxLength2(self, nums): :type nums: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wiggleMaxLength(self, nums): nearly the same as linear house rob :type nums: List[int] :rtype: int - def wiggleMaxLength2(self, nums): :type nums: List[int] :rtype: int <|sk...
e16702d2b3ec4e5054baad56f4320bc3b31676ad
<|skeleton|> class Solution: def wiggleMaxLength(self, nums): """nearly the same as linear house rob :type nums: List[int] :rtype: int""" <|body_0|> def wiggleMaxLength2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def wiggleMaxLength(self, nums): """nearly the same as linear house rob :type nums: List[int] :rtype: int""" if not nums: return 0 f = 1 d = 1 for i in range(1, len(nums)): if nums[i] > nums[i - 1]: f = d + 1 ...
the_stack_v2_python_sparse
leetcode/medium/wiggle_sequence.py
SuperMartinYang/learning_algorithm
train
0
ae5bf63ab906639b1019c584f295a456ac4a63cd
[ "if not isinstance(dictionary, ImmutableDictionary):\n for k, v in dictionary.iteritems():\n dictionary[k] = Utils.make_immutable(v)\nsuper(ImmutableDictionary, self).__init__(dictionary)", "if name in self:\n return self[name]\ntry:\n return self[name]\nexcept KeyError:\n raise AttributeError(...
<|body_start_0|> if not isinstance(dictionary, ImmutableDictionary): for k, v in dictionary.iteritems(): dictionary[k] = Utils.make_immutable(v) super(ImmutableDictionary, self).__init__(dictionary) <|end_body_0|> <|body_start_1|> if name in self: return ...
ImmutableDictionary
[ "GPL-1.0-or-later", "GPL-2.0-or-later", "OFL-1.1", "MS-PL", "AFL-2.1", "GPL-2.0-only", "Python-2.0", "Apache-2.0", "BSD-2-Clause", "MIT", "BSD-3-Clause", "LicenseRef-scancode-free-unknown" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImmutableDictionary: def __init__(self, dictionary): """Recursively turn dict to ImmutableDictionary""" <|body_0|> def __getattr__(self, name): """Access to self['attribute'] as self.attribute""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not i...
stack_v2_sparse_classes_36k_train_031645
7,150
permissive
[ { "docstring": "Recursively turn dict to ImmutableDictionary", "name": "__init__", "signature": "def __init__(self, dictionary)" }, { "docstring": "Access to self['attribute'] as self.attribute", "name": "__getattr__", "signature": "def __getattr__(self, name)" } ]
2
stack_v2_sparse_classes_30k_train_014866
Implement the Python class `ImmutableDictionary` described below. Class description: Implement the ImmutableDictionary class. Method signatures and docstrings: - def __init__(self, dictionary): Recursively turn dict to ImmutableDictionary - def __getattr__(self, name): Access to self['attribute'] as self.attribute
Implement the Python class `ImmutableDictionary` described below. Class description: Implement the ImmutableDictionary class. Method signatures and docstrings: - def __init__(self, dictionary): Recursively turn dict to ImmutableDictionary - def __getattr__(self, name): Access to self['attribute'] as self.attribute <...
23881f23577a65de396238998e8672d6c4c5a250
<|skeleton|> class ImmutableDictionary: def __init__(self, dictionary): """Recursively turn dict to ImmutableDictionary""" <|body_0|> def __getattr__(self, name): """Access to self['attribute'] as self.attribute""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImmutableDictionary: def __init__(self, dictionary): """Recursively turn dict to ImmutableDictionary""" if not isinstance(dictionary, ImmutableDictionary): for k, v in dictionary.iteritems(): dictionary[k] = Utils.make_immutable(v) super(ImmutableDictionary,...
the_stack_v2_python_sparse
ambari-agent/src/main/python/ambari_agent/Utils.py
apache/ambari
train
2,078
c6c1ff53c73e6fbbb92f57162d5e0a99189a4ac6
[ "user = get_jwt_identity()\ndata = request.get_json()\nbooking = {'flight_name': data.get('flight_name'), 'seat_number': data.get('seat_number'), 'payment': data.get('payment')}\ntry:\n cleaned_data = validate_data(**booking)\nexcept AssertionError as error:\n return (jsonify({'error': error.args[0]}), 409)\n...
<|body_start_0|> user = get_jwt_identity() data = request.get_json() booking = {'flight_name': data.get('flight_name'), 'seat_number': data.get('seat_number'), 'payment': data.get('payment')} try: cleaned_data = validate_data(**booking) except AssertionError as error:...
Controls all bookings and those of each flight
BookingController
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BookingController: """Controls all bookings and those of each flight""" def create(): """creat booking objects for logged in users""" <|body_0|> def bookings(): """Returns all the bookings of a specific user""" <|body_1|> def flight_bookings(flight_i...
stack_v2_sparse_classes_36k_train_031646
2,523
no_license
[ { "docstring": "creat booking objects for logged in users", "name": "create", "signature": "def create()" }, { "docstring": "Returns all the bookings of a specific user", "name": "bookings", "signature": "def bookings()" }, { "docstring": "\"Returns all the flight bookings", ...
3
stack_v2_sparse_classes_30k_train_005861
Implement the Python class `BookingController` described below. Class description: Controls all bookings and those of each flight Method signatures and docstrings: - def create(): creat booking objects for logged in users - def bookings(): Returns all the bookings of a specific user - def flight_bookings(flight_id): ...
Implement the Python class `BookingController` described below. Class description: Controls all bookings and those of each flight Method signatures and docstrings: - def create(): creat booking objects for logged in users - def bookings(): Returns all the bookings of a specific user - def flight_bookings(flight_id): ...
f4174888ebaf0902d842894bb48f51b9ec0c3e7e
<|skeleton|> class BookingController: """Controls all bookings and those of each flight""" def create(): """creat booking objects for logged in users""" <|body_0|> def bookings(): """Returns all the bookings of a specific user""" <|body_1|> def flight_bookings(flight_i...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BookingController: """Controls all bookings and those of each flight""" def create(): """creat booking objects for logged in users""" user = get_jwt_identity() data = request.get_json() booking = {'flight_name': data.get('flight_name'), 'seat_number': data.get('seat_number...
the_stack_v2_python_sparse
flights/controller/booking_controller.py
Bonifase/flight-reservation-api
train
0
a13a2ecb0cd7c0bebe278951c7f0406fad3582aa
[ "super(subMemberEmbeddedObjectListNode, self).__init__(subMember, tree, container)\nself._parentTreeItemId = parentTreeItemId\nself._previousTreeItemId = tree.GetLastChild(parentTreeItemId)", "if pos == 0:\n if len(self._subTreeItemIds) == 0:\n if not self._previousTreeItemId.IsOk():\n treeIt...
<|body_start_0|> super(subMemberEmbeddedObjectListNode, self).__init__(subMember, tree, container) self._parentTreeItemId = parentTreeItemId self._previousTreeItemId = tree.GetLastChild(parentTreeItemId) <|end_body_0|> <|body_start_1|> if pos == 0: if len(self._subTreeItemId...
Private class. Information for a submember node that wraps a single object.
subMemberEmbeddedObjectListNode
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class subMemberEmbeddedObjectListNode: """Private class. Information for a submember node that wraps a single object.""" def __init__(self, subMember, tree, container, parentTreeItemId): """Create a new node inside the tree that wraps the specified submember""" <|body_0|> def ...
stack_v2_sparse_classes_36k_train_031647
11,787
no_license
[ { "docstring": "Create a new node inside the tree that wraps the specified submember", "name": "__init__", "signature": "def __init__(self, subMember, tree, container, parentTreeItemId)" }, { "docstring": "Private. Wraps the specified object in a new NodeData and inserts it at the specified posi...
2
stack_v2_sparse_classes_30k_train_000816
Implement the Python class `subMemberEmbeddedObjectListNode` described below. Class description: Private class. Information for a submember node that wraps a single object. Method signatures and docstrings: - def __init__(self, subMember, tree, container, parentTreeItemId): Create a new node inside the tree that wrap...
Implement the Python class `subMemberEmbeddedObjectListNode` described below. Class description: Private class. Information for a submember node that wraps a single object. Method signatures and docstrings: - def __init__(self, subMember, tree, container, parentTreeItemId): Create a new node inside the tree that wrap...
f5ecde937663091fd324c9d22fd72542d4eb1e16
<|skeleton|> class subMemberEmbeddedObjectListNode: """Private class. Information for a submember node that wraps a single object.""" def __init__(self, subMember, tree, container, parentTreeItemId): """Create a new node inside the tree that wraps the specified submember""" <|body_0|> def ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class subMemberEmbeddedObjectListNode: """Private class. Information for a submember node that wraps a single object.""" def __init__(self, subMember, tree, container, parentTreeItemId): """Create a new node inside the tree that wraps the specified submember""" super(subMemberEmbeddedObjectList...
the_stack_v2_python_sparse
Python/App/Proxys/NodeData.py
kujira70/simbicon
train
3
e21a20afbea56534d5163025dc7f9af39c5520cd
[ "assert len(observation_space.shape) == 1, 'Only flat spaces supported by MLP model'\nassert len(action_space.shape) == 1, 'Only flat action spaces supported by MLP model'\nsuper().__init__(observation_space, action_space, signal_space)\nself.policy_weight = policy_weight\nself.reward_scale = signal_space.span\nsel...
<|body_start_0|> assert len(observation_space.shape) == 1, 'Only flat spaces supported by MLP model' assert len(action_space.shape) == 1, 'Only flat action spaces supported by MLP model' super().__init__(observation_space, action_space, signal_space) self.policy_weight = policy_weight ...
Implements the Intrinsic Curiosity Module described in paper: https://arxiv.org/pdf/1705.05363.pdf The overview of the idea is to reward the agent for exploring unseen states. It is achieved by implementing two models. One called forward model that given the encoded state and encoded action computes predicts the encode...
MLPICM
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MLPICM: """Implements the Intrinsic Curiosity Module described in paper: https://arxiv.org/pdf/1705.05363.pdf The overview of the idea is to reward the agent for exploring unseen states. It is achieved by implementing two models. One called forward model that given the encoded state and encoded a...
stack_v2_sparse_classes_36k_train_031648
8,668
permissive
[ { "docstring": ":param policy_weight: weight to be applied to the ``policy_loss`` in the ``loss`` method. Allows to control how important optimizing policy to optimizing the curiosity module :param signal_space: used for scaling the intrinsic reward returned by this module. Can be used to control how the fluctu...
4
stack_v2_sparse_classes_30k_train_014774
Implement the Python class `MLPICM` described below. Class description: Implements the Intrinsic Curiosity Module described in paper: https://arxiv.org/pdf/1705.05363.pdf The overview of the idea is to reward the agent for exploring unseen states. It is achieved by implementing two models. One called forward model tha...
Implement the Python class `MLPICM` described below. Class description: Implements the Intrinsic Curiosity Module described in paper: https://arxiv.org/pdf/1705.05363.pdf The overview of the idea is to reward the agent for exploring unseen states. It is achieved by implementing two models. One called forward model tha...
21e3564696062b67151b013fd5e47df46cf44aa5
<|skeleton|> class MLPICM: """Implements the Intrinsic Curiosity Module described in paper: https://arxiv.org/pdf/1705.05363.pdf The overview of the idea is to reward the agent for exploring unseen states. It is achieved by implementing two models. One called forward model that given the encoded state and encoded a...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MLPICM: """Implements the Intrinsic Curiosity Module described in paper: https://arxiv.org/pdf/1705.05363.pdf The overview of the idea is to reward the agent for exploring unseen states. It is achieved by implementing two models. One called forward model that given the encoded state and encoded action compute...
the_stack_v2_python_sparse
neodroidagent/utilities/exploration/intrinsic_signals/torch_isp/curiosity/icm.py
sintefneodroid/agent
train
9
cf929f5a18ad3789f7a86ddd26c0fe42368527a5
[ "self.env.revert_snapshot('ready_with_3_slaves')\nself.prepare_plugin()\nself.helpers.create_cluster(name=self.__class__.__name__)\nself.activate_plugin()", "self.check_run('deploy_zabbix_monitoring_ha')\nself.env.revert_snapshot('ready_with_5_slaves')\nself.prepare_plugin()\nself.helpers.create_cluster(name=self...
<|body_start_0|> self.env.revert_snapshot('ready_with_3_slaves') self.prepare_plugin() self.helpers.create_cluster(name=self.__class__.__name__) self.activate_plugin() <|end_body_0|> <|body_start_1|> self.check_run('deploy_zabbix_monitoring_ha') self.env.revert_snapshot(...
Class for smoke testing the zabbix plugin.
TestZabbix
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestZabbix: """Class for smoke testing the zabbix plugin.""" def install_zabbix(self): """Install Zabbix plugin and check it exists Scenario: 1. Upload Zabbix plugin to the master node 2. Install the plugin 3. Create a cluster 4. Check that the plugin can be enabled Duration 20m""" ...
stack_v2_sparse_classes_36k_train_031649
4,155
no_license
[ { "docstring": "Install Zabbix plugin and check it exists Scenario: 1. Upload Zabbix plugin to the master node 2. Install the plugin 3. Create a cluster 4. Check that the plugin can be enabled Duration 20m", "name": "install_zabbix", "signature": "def install_zabbix(self)" }, { "docstring": "Dep...
4
stack_v2_sparse_classes_30k_train_010599
Implement the Python class `TestZabbix` described below. Class description: Class for smoke testing the zabbix plugin. Method signatures and docstrings: - def install_zabbix(self): Install Zabbix plugin and check it exists Scenario: 1. Upload Zabbix plugin to the master node 2. Install the plugin 3. Create a cluster ...
Implement the Python class `TestZabbix` described below. Class description: Class for smoke testing the zabbix plugin. Method signatures and docstrings: - def install_zabbix(self): Install Zabbix plugin and check it exists Scenario: 1. Upload Zabbix plugin to the master node 2. Install the plugin 3. Create a cluster ...
179249df2d206eeabb3955c9dc8cb78cac3c36c6
<|skeleton|> class TestZabbix: """Class for smoke testing the zabbix plugin.""" def install_zabbix(self): """Install Zabbix plugin and check it exists Scenario: 1. Upload Zabbix plugin to the master node 2. Install the plugin 3. Create a cluster 4. Check that the plugin can be enabled Duration 20m""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestZabbix: """Class for smoke testing the zabbix plugin.""" def install_zabbix(self): """Install Zabbix plugin and check it exists Scenario: 1. Upload Zabbix plugin to the master node 2. Install the plugin 3. Create a cluster 4. Check that the plugin can be enabled Duration 20m""" self.e...
the_stack_v2_python_sparse
stacklight_tests/zabbix/test_smoke_bvt.py
rkhozinov/stacklight-integration-tests
train
1
ae0e412dc35b56ae593b9a2bc3e50320f1708142
[ "m = len(obstacleGrid)\nn = len(obstacleGrid[0])\ndp = [[0 for _ in range(n)] for _ in range(m)]\nfor i in range(m):\n for j in range(n):\n if obstacleGrid[0][0] == 1:\n return 0\n if obstacleGrid[i][j] == 1:\n dp[i][j] = 0\n elif i == 0 or j == 0:\n dp[i][j]...
<|body_start_0|> m = len(obstacleGrid) n = len(obstacleGrid[0]) dp = [[0 for _ in range(n)] for _ in range(m)] for i in range(m): for j in range(n): if obstacleGrid[0][0] == 1: return 0 if obstacleGrid[i][j] == 1: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def uniquePathsWithObstacles(self, obstacleGrid): """:type obstacleGrid: List[List[int]] :rtype: int 记住:二维数组的row 是 len(obstacleGrid) col 是len(obstacleGrid{0])""" <|body_0|> def uniquePathsWithObstacles1(self, obstacleGrid): """:type obstacleGrid: List[List[...
stack_v2_sparse_classes_36k_train_031650
2,622
no_license
[ { "docstring": ":type obstacleGrid: List[List[int]] :rtype: int 记住:二维数组的row 是 len(obstacleGrid) col 是len(obstacleGrid{0])", "name": "uniquePathsWithObstacles", "signature": "def uniquePathsWithObstacles(self, obstacleGrid)" }, { "docstring": ":type obstacleGrid: List[List[int]] :rtype: int", ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def uniquePathsWithObstacles(self, obstacleGrid): :type obstacleGrid: List[List[int]] :rtype: int 记住:二维数组的row 是 len(obstacleGrid) col 是len(obstacleGrid{0]) - def uniquePathsWithO...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def uniquePathsWithObstacles(self, obstacleGrid): :type obstacleGrid: List[List[int]] :rtype: int 记住:二维数组的row 是 len(obstacleGrid) col 是len(obstacleGrid{0]) - def uniquePathsWithO...
069bb0b751ef7f469036b9897436eb5d138ffa24
<|skeleton|> class Solution: def uniquePathsWithObstacles(self, obstacleGrid): """:type obstacleGrid: List[List[int]] :rtype: int 记住:二维数组的row 是 len(obstacleGrid) col 是len(obstacleGrid{0])""" <|body_0|> def uniquePathsWithObstacles1(self, obstacleGrid): """:type obstacleGrid: List[List[...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def uniquePathsWithObstacles(self, obstacleGrid): """:type obstacleGrid: List[List[int]] :rtype: int 记住:二维数组的row 是 len(obstacleGrid) col 是len(obstacleGrid{0])""" m = len(obstacleGrid) n = len(obstacleGrid[0]) dp = [[0 for _ in range(n)] for _ in range(m)] for ...
the_stack_v2_python_sparse
算法/动态规划/不同路径2.py
RichieSong/algorithm
train
0
1304f8f616f91930fafd0307a67fd2fb1c24ad44
[ "next_index = next_object_key(self)\nelement_ids = self.get_member_ids_from_nodes_ids(node_A, node_B)\nif element_ids != None:\n print('There is more than one member with the same end nodes. Ensure they have different offsets.')\nmember = Member(node_A, node_B, section_id, fixity_A, fixity_B, type, cable_length)...
<|body_start_0|> next_index = next_object_key(self) element_ids = self.get_member_ids_from_nodes_ids(node_A, node_B) if element_ids != None: print('There is more than one member with the same end nodes. Ensure they have different offsets.') member = Member(node_A, node_B, sec...
Creates an instance of the SkyCiv Members class.
Members
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Members: """Creates an instance of the SkyCiv Members class.""" def add(self, node_A: int, node_B: int, section_id: int, fixity_A: str='FFFFFF', fixity_B: str='FFFFFF', type: Literal['normal', 'normal_continuous', 'cable', 'rigid']='normal', cable_length: float=None) -> int: """Creat...
stack_v2_sparse_classes_36k_train_031651
2,666
permissive
[ { "docstring": "Create a member with the next available ID. Args: node_A (int): The ID of the node at the beginning of the member. node_B (int): The ID of the node at the end of the member. section_id (int): The ID of the section to apply to the member. fixity_A (str, optional): See docs for restraint code. htt...
2
stack_v2_sparse_classes_30k_train_012880
Implement the Python class `Members` described below. Class description: Creates an instance of the SkyCiv Members class. Method signatures and docstrings: - def add(self, node_A: int, node_B: int, section_id: int, fixity_A: str='FFFFFF', fixity_B: str='FFFFFF', type: Literal['normal', 'normal_continuous', 'cable', '...
Implement the Python class `Members` described below. Class description: Creates an instance of the SkyCiv Members class. Method signatures and docstrings: - def add(self, node_A: int, node_B: int, section_id: int, fixity_A: str='FFFFFF', fixity_B: str='FFFFFF', type: Literal['normal', 'normal_continuous', 'cable', '...
1cf3dad7f8d451760df02886df41684add72a4eb
<|skeleton|> class Members: """Creates an instance of the SkyCiv Members class.""" def add(self, node_A: int, node_B: int, section_id: int, fixity_A: str='FFFFFF', fixity_B: str='FFFFFF', type: Literal['normal', 'normal_continuous', 'cable', 'rigid']='normal', cable_length: float=None) -> int: """Creat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Members: """Creates an instance of the SkyCiv Members class.""" def add(self, node_A: int, node_B: int, section_id: int, fixity_A: str='FFFFFF', fixity_B: str='FFFFFF', type: Literal['normal', 'normal_continuous', 'cable', 'rigid']='normal', cable_length: float=None) -> int: """Create a member wi...
the_stack_v2_python_sparse
src/skyciv/classes/model/components/members/members.py
osasanchezme/skyciv-pip
train
0
a3b5b67bccd916f09f37fb18587f6d9f64adf8da
[ "super().__init__()\nif backbone not in FLEXUNET_BACKBONE.register_dict:\n raise ValueError(f'invalid model_name {backbone} found, must be one of {FLEXUNET_BACKBONE.register_dict.keys()}.')\nif spatial_dims not in (2, 3):\n raise ValueError('spatial_dims can only be 2 or 3.')\nencoder = FLEXUNET_BACKBONE.regi...
<|body_start_0|> super().__init__() if backbone not in FLEXUNET_BACKBONE.register_dict: raise ValueError(f'invalid model_name {backbone} found, must be one of {FLEXUNET_BACKBONE.register_dict.keys()}.') if spatial_dims not in (2, 3): raise ValueError('spatial_dims can onl...
A flexible implementation of UNet-like encoder-decoder architecture.
FlexibleUNet
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FlexibleUNet: """A flexible implementation of UNet-like encoder-decoder architecture.""" def __init__(self, in_channels: int, out_channels: int, backbone: str, pretrained: bool=False, decoder_channels: tuple=(256, 128, 64, 32, 16), spatial_dims: int=2, norm: str | tuple=('batch', {'eps': 0.0...
stack_v2_sparse_classes_36k_train_031652
14,147
permissive
[ { "docstring": "A flexible implement of UNet, in which the backbone/encoder can be replaced with any efficient network. Currently the input must have a 2 or 3 spatial dimension and the spatial size of each dimension must be a multiple of 32 if is_pad parameter is False. Please notice each output of backbone mus...
2
stack_v2_sparse_classes_30k_train_004433
Implement the Python class `FlexibleUNet` described below. Class description: A flexible implementation of UNet-like encoder-decoder architecture. Method signatures and docstrings: - def __init__(self, in_channels: int, out_channels: int, backbone: str, pretrained: bool=False, decoder_channels: tuple=(256, 128, 64, 3...
Implement the Python class `FlexibleUNet` described below. Class description: A flexible implementation of UNet-like encoder-decoder architecture. Method signatures and docstrings: - def __init__(self, in_channels: int, out_channels: int, backbone: str, pretrained: bool=False, decoder_channels: tuple=(256, 128, 64, 3...
e48c3e2c741fa3fc705c4425d17ac4a5afac6c47
<|skeleton|> class FlexibleUNet: """A flexible implementation of UNet-like encoder-decoder architecture.""" def __init__(self, in_channels: int, out_channels: int, backbone: str, pretrained: bool=False, decoder_channels: tuple=(256, 128, 64, 32, 16), spatial_dims: int=2, norm: str | tuple=('batch', {'eps': 0.0...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FlexibleUNet: """A flexible implementation of UNet-like encoder-decoder architecture.""" def __init__(self, in_channels: int, out_channels: int, backbone: str, pretrained: bool=False, decoder_channels: tuple=(256, 128, 64, 32, 16), spatial_dims: int=2, norm: str | tuple=('batch', {'eps': 0.001, 'momentum...
the_stack_v2_python_sparse
monai/networks/nets/flexible_unet.py
Project-MONAI/MONAI
train
4,805
df8a70864db222d8fddd04e3ab2491a2a178eb39
[ "res = 0\ns = []\nfor i in range(len(height)):\n while s and height[i] > height[s[-1]]:\n top = s.pop()\n if s:\n w = i - s[-1] - 1\n l = min(height[s[-1]], height[i]) - height[top]\n res += w * l\n s.append(i)\nreturn res", "res = 0\nn = len(height)\nfor i in ...
<|body_start_0|> res = 0 s = [] for i in range(len(height)): while s and height[i] > height[s[-1]]: top = s.pop() if s: w = i - s[-1] - 1 l = min(height[s[-1]], height[i]) - height[top] res +=...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def trap(self, height): """:type height: List[int] :rtype: int using stack""" <|body_0|> def trap1(self, height): """:type height: List[int] :rtype: int brute forth""" <|body_1|> def trap2(self, height): """:type height: List[int] :rtyp...
stack_v2_sparse_classes_36k_train_031653
3,225
no_license
[ { "docstring": ":type height: List[int] :rtype: int using stack", "name": "trap", "signature": "def trap(self, height)" }, { "docstring": ":type height: List[int] :rtype: int brute forth", "name": "trap1", "signature": "def trap1(self, height)" }, { "docstring": ":type height: Li...
5
stack_v2_sparse_classes_30k_train_017904
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def trap(self, height): :type height: List[int] :rtype: int using stack - def trap1(self, height): :type height: List[int] :rtype: int brute forth - def trap2(self, height): :typ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def trap(self, height): :type height: List[int] :rtype: int using stack - def trap1(self, height): :type height: List[int] :rtype: int brute forth - def trap2(self, height): :typ...
9e49b2c6003b957276737005d4aaac276b44d251
<|skeleton|> class Solution: def trap(self, height): """:type height: List[int] :rtype: int using stack""" <|body_0|> def trap1(self, height): """:type height: List[int] :rtype: int brute forth""" <|body_1|> def trap2(self, height): """:type height: List[int] :rtyp...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def trap(self, height): """:type height: List[int] :rtype: int using stack""" res = 0 s = [] for i in range(len(height)): while s and height[i] > height[s[-1]]: top = s.pop() if s: w = i - s[-1] - 1 ...
the_stack_v2_python_sparse
PythonCode/src/0042_Trapping_Rain_Water.py
oneyuan/CodeforFun
train
0
17ee0daaafa97c0964a24881ac8b96baf8a1f688
[ "n = len(nums)\nM = [0] * n\nj = n - 1\nfor i in range(n - 2, -1, -1):\n if nums[i] != 0:\n M[i] = 1 + min(M[j:j + nums[i]])\n else:\n M[i] = 1 + M[j]\n j = i\nreturn M[0]", "length = len(nums)\njumps, curEnd, curFarthest = (0, 0, 0)\nfor i in range(length - 1):\n curFarthest = max(curFa...
<|body_start_0|> n = len(nums) M = [0] * n j = n - 1 for i in range(n - 2, -1, -1): if nums[i] != 0: M[i] = 1 + min(M[j:j + nums[i]]) else: M[i] = 1 + M[j] j = i return M[0] <|end_body_0|> <|body_start_1|> ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def jump(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def jump(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def jump(self, nums): """:type nums: List[int] :rtype: int""" <|body_2|> <|end_sk...
stack_v2_sparse_classes_36k_train_031654
1,304
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "jump", "signature": "def jump(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "jump", "signature": "def jump(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "j...
3
stack_v2_sparse_classes_30k_val_001121
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def jump(self, nums): :type nums: List[int] :rtype: int - def jump(self, nums): :type nums: List[int] :rtype: int - def jump(self, nums): :type nums: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def jump(self, nums): :type nums: List[int] :rtype: int - def jump(self, nums): :type nums: List[int] :rtype: int - def jump(self, nums): :type nums: List[int] :rtype: int <|ske...
a509b383a42f54313970168d9faa11f088f18708
<|skeleton|> class Solution: def jump(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def jump(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def jump(self, nums): """:type nums: List[int] :rtype: int""" <|body_2|> <|end_sk...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def jump(self, nums): """:type nums: List[int] :rtype: int""" n = len(nums) M = [0] * n j = n - 1 for i in range(n - 2, -1, -1): if nums[i] != 0: M[i] = 1 + min(M[j:j + nums[i]]) else: M[i] = 1 + M[j] ...
the_stack_v2_python_sparse
0045_Jump_Game_II.py
bingli8802/leetcode
train
0
a01f0b92b5474681ef51e6c9fe9d37b7d31b7413
[ "self.__bit = BIT(n)\nself.__lookup = {i: i + 1 for i in xrange(n)}\nself.__curr = n", "pos = self.__bit.binary_lift(k)\nval = self.__lookup.pop(pos)\nself.__bit.add(pos, -1)\nself.__bit.add(self.__curr, 1)\nself.__lookup[self.__curr] = val\nself.__curr += 1\nreturn val" ]
<|body_start_0|> self.__bit = BIT(n) self.__lookup = {i: i + 1 for i in xrange(n)} self.__curr = n <|end_body_0|> <|body_start_1|> pos = self.__bit.binary_lift(k) val = self.__lookup.pop(pos) self.__bit.add(pos, -1) self.__bit.add(self.__curr, 1) self.__l...
MRUQueue2
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MRUQueue2: def __init__(self, n): """:type n: int""" <|body_0|> def fetch(self, k): """:type k: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.__bit = BIT(n) self.__lookup = {i: i + 1 for i in xrange(n)} self.__...
stack_v2_sparse_classes_36k_train_031655
3,178
permissive
[ { "docstring": ":type n: int", "name": "__init__", "signature": "def __init__(self, n)" }, { "docstring": ":type k: int :rtype: int", "name": "fetch", "signature": "def fetch(self, k)" } ]
2
null
Implement the Python class `MRUQueue2` described below. Class description: Implement the MRUQueue2 class. Method signatures and docstrings: - def __init__(self, n): :type n: int - def fetch(self, k): :type k: int :rtype: int
Implement the Python class `MRUQueue2` described below. Class description: Implement the MRUQueue2 class. Method signatures and docstrings: - def __init__(self, n): :type n: int - def fetch(self, k): :type k: int :rtype: int <|skeleton|> class MRUQueue2: def __init__(self, n): """:type n: int""" ...
4dc4e6642dc92f1983c13564cc0fd99917cab358
<|skeleton|> class MRUQueue2: def __init__(self, n): """:type n: int""" <|body_0|> def fetch(self, k): """:type k: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MRUQueue2: def __init__(self, n): """:type n: int""" self.__bit = BIT(n) self.__lookup = {i: i + 1 for i in xrange(n)} self.__curr = n def fetch(self, k): """:type k: int :rtype: int""" pos = self.__bit.binary_lift(k) val = self.__lookup.pop(pos) ...
the_stack_v2_python_sparse
Python/design-most-recently-used-queue.py
kamyu104/LeetCode-Solutions
train
4,549
06e53bb7f00685fe2d0908c1c4d8fcfddc6f4fb5
[ "from two1.server.machine_auth_wallet import MachineAuthWallet\nsuper().__init__()\nif isinstance(wallet, MachineAuthWallet):\n self.wallet = wallet\nelse:\n self.wallet = MachineAuthWallet(wallet)\nif username is None:\n import two1.commands.util.config as config\n self.username = config.Config().usern...
<|body_start_0|> from two1.server.machine_auth_wallet import MachineAuthWallet super().__init__() if isinstance(wallet, MachineAuthWallet): self.wallet = wallet else: self.wallet = MachineAuthWallet(wallet) if username is None: import two1.comm...
BitRequests for making bit-transfer payments.
BitTransferRequests
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BitTransferRequests: """BitRequests for making bit-transfer payments.""" def __init__(self, wallet, username=None): """Initialize the bittransfer with wallet and username.""" <|body_0|> def make_402_payment(self, response, max_price): """Make a bit-transfer payme...
stack_v2_sparse_classes_36k_train_031656
16,246
permissive
[ { "docstring": "Initialize the bittransfer with wallet and username.", "name": "__init__", "signature": "def __init__(self, wallet, username=None)" }, { "docstring": "Make a bit-transfer payment to the payment-handling service.", "name": "make_402_payment", "signature": "def make_402_pay...
3
null
Implement the Python class `BitTransferRequests` described below. Class description: BitRequests for making bit-transfer payments. Method signatures and docstrings: - def __init__(self, wallet, username=None): Initialize the bittransfer with wallet and username. - def make_402_payment(self, response, max_price): Make...
Implement the Python class `BitTransferRequests` described below. Class description: BitRequests for making bit-transfer payments. Method signatures and docstrings: - def __init__(self, wallet, username=None): Initialize the bittransfer with wallet and username. - def make_402_payment(self, response, max_price): Make...
a5e99fccf11ed75420775ae3e924c9ce94f2e86d
<|skeleton|> class BitTransferRequests: """BitRequests for making bit-transfer payments.""" def __init__(self, wallet, username=None): """Initialize the bittransfer with wallet and username.""" <|body_0|> def make_402_payment(self, response, max_price): """Make a bit-transfer payme...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BitTransferRequests: """BitRequests for making bit-transfer payments.""" def __init__(self, wallet, username=None): """Initialize the bittransfer with wallet and username.""" from two1.server.machine_auth_wallet import MachineAuthWallet super().__init__() if isinstance(wal...
the_stack_v2_python_sparse
two1/bitrequests/bitrequests.py
shayanb/two1
train
4
d3d1c460503f3a9a83bceb566fbb2ffdd01e3dde
[ "super(InvoerFrame, self).__init__(parent, id, title, pos, size, style, name)\nself.Paneel = SubPaneel(self)\nself.Opslaan = OpslaanPaneel(self.Paneel, id)\nself.Knoppen = KnoppenPaneel(self.Paneel, butid, id)\nself.Zetten = ZettenPaneel(self.Paneel, id)\nallbox = wx.BoxSizer(wx.VERTICAL)\nallbox.Add(self.Opslaan, ...
<|body_start_0|> super(InvoerFrame, self).__init__(parent, id, title, pos, size, style, name) self.Paneel = SubPaneel(self) self.Opslaan = OpslaanPaneel(self.Paneel, id) self.Knoppen = KnoppenPaneel(self.Paneel, butid, id) self.Zetten = ZettenPaneel(self.Paneel, id) allbo...
Klasse maakt een frame met daarin een opslag module en de mogelijkheid om aantal zetten te bepalen voor DNA-Mind. Zie documentatie __init__ voor meer informatie.
InvoerFrame
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class InvoerFrame: """Klasse maakt een frame met daarin een opslag module en de mogelijkheid om aantal zetten te bepalen voor DNA-Mind. Zie documentatie __init__ voor meer informatie.""" def __init__(self, parent, butid, id=wx.ID_ANY, title='DNA-Mind', pos=wx.DefaultPosition, size=(300, 450), styl...
stack_v2_sparse_classes_36k_train_031657
3,857
no_license
[ { "docstring": "Maakt en toont InvoerScherm. De __init__ methode heeft 8 parameters nodig. parent De ouder van het paneel. butid Getal die gebruikt wordt om door te sturen naar KnoppenPaneel. Zie documentatie KnoppenPaneel voor meer informatie. id=wx.ID_ANY id voor frame. Als er geen id aanwezig is, dan zal dez...
2
stack_v2_sparse_classes_30k_train_019183
Implement the Python class `InvoerFrame` described below. Class description: Klasse maakt een frame met daarin een opslag module en de mogelijkheid om aantal zetten te bepalen voor DNA-Mind. Zie documentatie __init__ voor meer informatie. Method signatures and docstrings: - def __init__(self, parent, butid, id=wx.ID_...
Implement the Python class `InvoerFrame` described below. Class description: Klasse maakt een frame met daarin een opslag module en de mogelijkheid om aantal zetten te bepalen voor DNA-Mind. Zie documentatie __init__ voor meer informatie. Method signatures and docstrings: - def __init__(self, parent, butid, id=wx.ID_...
6093fb23294f0a5d42f61113e607d3c1fb94542f
<|skeleton|> class InvoerFrame: """Klasse maakt een frame met daarin een opslag module en de mogelijkheid om aantal zetten te bepalen voor DNA-Mind. Zie documentatie __init__ voor meer informatie.""" def __init__(self, parent, butid, id=wx.ID_ANY, title='DNA-Mind', pos=wx.DefaultPosition, size=(300, 450), styl...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class InvoerFrame: """Klasse maakt een frame met daarin een opslag module en de mogelijkheid om aantal zetten te bepalen voor DNA-Mind. Zie documentatie __init__ voor meer informatie.""" def __init__(self, parent, butid, id=wx.ID_ANY, title='DNA-Mind', pos=wx.DefaultPosition, size=(300, 450), style=wx.DEFAULT_...
the_stack_v2_python_sparse
DNA-Mastermind-application/InvoerScherm.py
sdevriend/Student-Portfolio
train
0
bf9053c6e6f73810fbb974f84e797cbf6d39f7c4
[ "ans = []\nself.combination(ans, [], [i + 1 for i in range(n)], k)\nreturn ans", "if len(pre) == k:\n ans.append(pre.copy())\nelse:\n for i in range(len(nums)):\n num = nums[i]\n if pre and num < pre[-1]:\n continue\n pre.append(num)\n nums.pop(i)\n self.combina...
<|body_start_0|> ans = [] self.combination(ans, [], [i + 1 for i in range(n)], k) return ans <|end_body_0|> <|body_start_1|> if len(pre) == k: ans.append(pre.copy()) else: for i in range(len(nums)): num = nums[i] if pre and...
20190907
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """20190907""" def combine(self, n: int, k: int) -> List[List[int]]: """从 n 里面选 k 个,但是注意是组合,不是排列 结果慢得不行""" <|body_0|> def combination(self, ans: List[List[int]], pre: List[int], nums: List[int], k: int): """组合""" <|body_1|> def permutation(...
stack_v2_sparse_classes_36k_train_031658
1,670
no_license
[ { "docstring": "从 n 里面选 k 个,但是注意是组合,不是排列 结果慢得不行", "name": "combine", "signature": "def combine(self, n: int, k: int) -> List[List[int]]" }, { "docstring": "组合", "name": "combination", "signature": "def combination(self, ans: List[List[int]], pre: List[int], nums: List[int], k: int)" },...
3
null
Implement the Python class `Solution` described below. Class description: 20190907 Method signatures and docstrings: - def combine(self, n: int, k: int) -> List[List[int]]: 从 n 里面选 k 个,但是注意是组合,不是排列 结果慢得不行 - def combination(self, ans: List[List[int]], pre: List[int], nums: List[int], k: int): 组合 - def permutation(self...
Implement the Python class `Solution` described below. Class description: 20190907 Method signatures and docstrings: - def combine(self, n: int, k: int) -> List[List[int]]: 从 n 里面选 k 个,但是注意是组合,不是排列 结果慢得不行 - def combination(self, ans: List[List[int]], pre: List[int], nums: List[int], k: int): 组合 - def permutation(self...
efea806d49f07d78e3db0390696778d4a7fc6c28
<|skeleton|> class Solution: """20190907""" def combine(self, n: int, k: int) -> List[List[int]]: """从 n 里面选 k 个,但是注意是组合,不是排列 结果慢得不行""" <|body_0|> def combination(self, ans: List[List[int]], pre: List[int], nums: List[int], k: int): """组合""" <|body_1|> def permutation(...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: """20190907""" def combine(self, n: int, k: int) -> List[List[int]]: """从 n 里面选 k 个,但是注意是组合,不是排列 结果慢得不行""" ans = [] self.combination(ans, [], [i + 1 for i in range(n)], k) return ans def combination(self, ans: List[List[int]], pre: List[int], nums: List[int]...
the_stack_v2_python_sparse
ToolsX/leetcode/0077/0077.py
JunLei-MI/PythonX
train
0
f014376d5dce38c1fe70606fb04b3cf8007194c5
[ "wrapper = getSAWrapper('gites_wallons')\nsession = wrapper.session\nquery = session.query(Commune)\nquery = query.order_by(Commune.com_nom)\nallCommunes = query.all()\nreturn allCommunes", "if langue == 'N':\n provincePk = [0]\nif langue == 'F':\n provincePk = [1, 2, 3, 4, 5, 6]\nif langue == 'E':\n pro...
<|body_start_0|> wrapper = getSAWrapper('gites_wallons') session = wrapper.session query = session.query(Commune) query = query.order_by(Commune.com_nom) allCommunes = query.all() return allCommunes <|end_body_0|> <|body_start_1|> if langue == 'N': pr...
CommuneView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CommuneView: def getAllCommunes(self): """recuperation de toutes les communes""" <|body_0|> def getAllCommunesByRegion(self, langue, tri=None): """recuperation de toutes les communes selon leur langues basé sur la com_prov_pk (table priovince) 0 --> toutes les provin...
stack_v2_sparse_classes_36k_train_031659
4,194
no_license
[ { "docstring": "recuperation de toutes les communes", "name": "getAllCommunes", "signature": "def getAllCommunes(self)" }, { "docstring": "recuperation de toutes les communes selon leur langues basé sur la com_prov_pk (table priovince) 0 --> toutes les provinces flamandes", "name": "getAllCo...
6
stack_v2_sparse_classes_30k_train_005890
Implement the Python class `CommuneView` described below. Class description: Implement the CommuneView class. Method signatures and docstrings: - def getAllCommunes(self): recuperation de toutes les communes - def getAllCommunesByRegion(self, langue, tri=None): recuperation de toutes les communes selon leur langues b...
Implement the Python class `CommuneView` described below. Class description: Implement the CommuneView class. Method signatures and docstrings: - def getAllCommunes(self): recuperation de toutes les communes - def getAllCommunesByRegion(self, langue, tri=None): recuperation de toutes les communes selon leur langues b...
1135360f71efb6f19ecf420a521787fe36b3f77d
<|skeleton|> class CommuneView: def getAllCommunes(self): """recuperation de toutes les communes""" <|body_0|> def getAllCommunesByRegion(self, langue, tri=None): """recuperation de toutes les communes selon leur langues basé sur la com_prov_pk (table priovince) 0 --> toutes les provin...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CommuneView: def getAllCommunes(self): """recuperation de toutes les communes""" wrapper = getSAWrapper('gites_wallons') session = wrapper.session query = session.query(Commune) query = query.order_by(Commune.com_nom) allCommunes = query.all() return all...
the_stack_v2_python_sparse
gites/gdwadmin/browser/manage_commune.py
gitesdewallonie/gites.gdwadmin
train
0
8646305231138426c8f84f194405b45dedd8ec38
[ "fin = open(filein, 'r')\nfout = open(fileout, 'w')\nl_cnt = 0\nfor line in fin:\n l_List = line.rstrip('|').lstrip('|').split('|')\n l_List = [el.strip() for el in l_List]\n if l_cnt == 0:\n l_cnt += 1\n line_o = ','.join(l_List).rstrip(',') + '\\n'\n fout.write(line_o)\n conti...
<|body_start_0|> fin = open(filein, 'r') fout = open(fileout, 'w') l_cnt = 0 for line in fin: l_List = line.rstrip('|').lstrip('|').split('|') l_List = [el.strip() for el in l_List] if l_cnt == 0: l_cnt += 1 line_o = ','...
SAPFile
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SAPFile: def fixLines1(self, filein, fileout): """This class takes a sap file from ZSE16 on a DSO in unconverted format. It reformats the data so that it can be loaded back via a flat file data source to the same DSO a) fixes quantities by removing trailing minus and adding to the front ...
stack_v2_sparse_classes_36k_train_031660
3,793
no_license
[ { "docstring": "This class takes a sap file from ZSE16 on a DSO in unconverted format. It reformats the data so that it can be loaded back via a flat file data source to the same DSO a) fixes quantities by removing trailing minus and adding to the front b) Puts dates in the correct format dd.mm.yyyy -> YYYYMMDD...
4
stack_v2_sparse_classes_30k_train_003708
Implement the Python class `SAPFile` described below. Class description: Implement the SAPFile class. Method signatures and docstrings: - def fixLines1(self, filein, fileout): This class takes a sap file from ZSE16 on a DSO in unconverted format. It reformats the data so that it can be loaded back via a flat file dat...
Implement the Python class `SAPFile` described below. Class description: Implement the SAPFile class. Method signatures and docstrings: - def fixLines1(self, filein, fileout): This class takes a sap file from ZSE16 on a DSO in unconverted format. It reformats the data so that it can be loaded back via a flat file dat...
553f5e4da3c68856159664cb56408ffcc470cb97
<|skeleton|> class SAPFile: def fixLines1(self, filein, fileout): """This class takes a sap file from ZSE16 on a DSO in unconverted format. It reformats the data so that it can be loaded back via a flat file data source to the same DSO a) fixes quantities by removing trailing minus and adding to the front ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SAPFile: def fixLines1(self, filein, fileout): """This class takes a sap file from ZSE16 on a DSO in unconverted format. It reformats the data so that it can be loaded back via a flat file data source to the same DSO a) fixes quantities by removing trailing minus and adding to the front b) Puts dates ...
the_stack_v2_python_sparse
Utilities.py
JonathanWaterhouse/FileManipulation
train
0
6d77a849b98c8cd2c36dd676ce4807063d3ed048
[ "super(RNNDecoder, self).__init__()\nself.embedding = tf.keras.layers.Embedding(vocab, embedding)\nself.gru = tf.keras.layers.GRU(units, recurrent_initializer='glorot_uniform', return_sequences=True, return_state=True)\nself.F = tf.keras.layers.Dense(vocab)", "batch, units = s_prev.shape\nattention = SelfAttentio...
<|body_start_0|> super(RNNDecoder, self).__init__() self.embedding = tf.keras.layers.Embedding(vocab, embedding) self.gru = tf.keras.layers.GRU(units, recurrent_initializer='glorot_uniform', return_sequences=True, return_state=True) self.F = tf.keras.layers.Dense(vocab) <|end_body_0|> <...
RNNDecoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RNNDecoder: def __init__(self, vocab, embedding, units, batch): """Args: vocab: integer representing the size of the output vocabulary embedding: integer representing the dimensionality of the embedding vector units: integer representing the number of hidden units in the RNN cell batch: ...
stack_v2_sparse_classes_36k_train_031661
2,520
no_license
[ { "docstring": "Args: vocab: integer representing the size of the output vocabulary embedding: integer representing the dimensionality of the embedding vector units: integer representing the number of hidden units in the RNN cell batch: integer representing the batch size", "name": "__init__", "signatur...
2
null
Implement the Python class `RNNDecoder` described below. Class description: Implement the RNNDecoder class. Method signatures and docstrings: - def __init__(self, vocab, embedding, units, batch): Args: vocab: integer representing the size of the output vocabulary embedding: integer representing the dimensionality of ...
Implement the Python class `RNNDecoder` described below. Class description: Implement the RNNDecoder class. Method signatures and docstrings: - def __init__(self, vocab, embedding, units, batch): Args: vocab: integer representing the size of the output vocabulary embedding: integer representing the dimensionality of ...
7f9a040f23eda32c5aa154c991c930a01b490f0f
<|skeleton|> class RNNDecoder: def __init__(self, vocab, embedding, units, batch): """Args: vocab: integer representing the size of the output vocabulary embedding: integer representing the dimensionality of the embedding vector units: integer representing the number of hidden units in the RNN cell batch: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RNNDecoder: def __init__(self, vocab, embedding, units, batch): """Args: vocab: integer representing the size of the output vocabulary embedding: integer representing the dimensionality of the embedding vector units: integer representing the number of hidden units in the RNN cell batch: integer repres...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/2-rnn_decoder.py
dbaroli/holbertonschool-machine_learning
train
0
7ada38ce3f9e547a2bbc91c707b9c16f68211b33
[ "view = ElasticListAPIView()\nview.Meta.model = None\nwith self.assertRaises(AssertionError):\n view.get_queryset()", "expectation = Search().query('match', field='value')\nview = ElasticListAPIView()\nview.Meta.model = MagicMock()\nview.Meta.model.return_value = 'Some'\nview.Meta.model.search.return_value = e...
<|body_start_0|> view = ElasticListAPIView() view.Meta.model = None with self.assertRaises(AssertionError): view.get_queryset() <|end_body_0|> <|body_start_1|> expectation = Search().query('match', field='value') view = ElasticListAPIView() view.Meta.model = ...
View testing. Testing the actual get would take a lot of mocking for little value since it is pretty generic.
ViewTests
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ViewTests: """View testing. Testing the actual get would take a lot of mocking for little value since it is pretty generic.""" def test_model_not_set(self): """Test handling of no model""" <|body_0|> def test_model_set(self): """Test handling when model is set"""...
stack_v2_sparse_classes_36k_train_031662
12,045
permissive
[ { "docstring": "Test handling of no model", "name": "test_model_not_set", "signature": "def test_model_not_set(self)" }, { "docstring": "Test handling when model is set", "name": "test_model_set", "signature": "def test_model_set(self)" } ]
2
stack_v2_sparse_classes_30k_test_000785
Implement the Python class `ViewTests` described below. Class description: View testing. Testing the actual get would take a lot of mocking for little value since it is pretty generic. Method signatures and docstrings: - def test_model_not_set(self): Test handling of no model - def test_model_set(self): Test handling...
Implement the Python class `ViewTests` described below. Class description: View testing. Testing the actual get would take a lot of mocking for little value since it is pretty generic. Method signatures and docstrings: - def test_model_not_set(self): Test handling of no model - def test_model_set(self): Test handling...
73d334a9f0df7c044c06989977a9a22dd2ff9b7a
<|skeleton|> class ViewTests: """View testing. Testing the actual get would take a lot of mocking for little value since it is pretty generic.""" def test_model_not_set(self): """Test handling of no model""" <|body_0|> def test_model_set(self): """Test handling when model is set"""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ViewTests: """View testing. Testing the actual get would take a lot of mocking for little value since it is pretty generic.""" def test_model_not_set(self): """Test handling of no model""" view = ElasticListAPIView() view.Meta.model = None with self.assertRaises(AssertionE...
the_stack_v2_python_sparse
goldstone/drfes/tests.py
bhuvan-rk/goldstone-server
train
0
337045cc7722463867f6cd9f0d62f1d6cae18876
[ "password1 = self.cleaned_data.get('password1')\npassword2 = self.cleaned_data.get('password2')\nif password1 and password2 and (password1 != password2):\n raise forms.ValidationError(_('Passwords Mismatch'))\nself.instance.username = self.cleaned_data.get('username')\npassword_validation.validate_password(self....
<|body_start_0|> password1 = self.cleaned_data.get('password1') password2 = self.cleaned_data.get('password2') if password1 and password2 and (password1 != password2): raise forms.ValidationError(_('Passwords Mismatch')) self.instance.username = self.cleaned_data.get('usernam...
Validates the user creation process.
UserCreationForm
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserCreationForm: """Validates the user creation process.""" def clean_password2(self): """Validates two passwords and username.""" <|body_0|> def save(self, commit=True): """Saves the user data.""" <|body_1|> <|end_skeleton|> <|body_start_0|> p...
stack_v2_sparse_classes_36k_train_031663
2,027
permissive
[ { "docstring": "Validates two passwords and username.", "name": "clean_password2", "signature": "def clean_password2(self)" }, { "docstring": "Saves the user data.", "name": "save", "signature": "def save(self, commit=True)" } ]
2
stack_v2_sparse_classes_30k_train_002963
Implement the Python class `UserCreationForm` described below. Class description: Validates the user creation process. Method signatures and docstrings: - def clean_password2(self): Validates two passwords and username. - def save(self, commit=True): Saves the user data.
Implement the Python class `UserCreationForm` described below. Class description: Validates the user creation process. Method signatures and docstrings: - def clean_password2(self): Validates two passwords and username. - def save(self, commit=True): Saves the user data. <|skeleton|> class UserCreationForm: """V...
3fdc01eabdff459b31e016f9f6d1cafc19c5a292
<|skeleton|> class UserCreationForm: """Validates the user creation process.""" def clean_password2(self): """Validates two passwords and username.""" <|body_0|> def save(self, commit=True): """Saves the user data.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserCreationForm: """Validates the user creation process.""" def clean_password2(self): """Validates two passwords and username.""" password1 = self.cleaned_data.get('password1') password2 = self.cleaned_data.get('password2') if password1 and password2 and (password1 != pa...
the_stack_v2_python_sparse
apps/accounts/forms.py
jimialex/django-wise
train
0
419dfd4b3a05a126410ab8ba58573027ef391d5c
[ "indice_or_slice, old_values = self.convert_to_list(indice_or_slice, old_values)\nif new_values is not None and (not isinstance(new_values, list)):\n new_values = [new_values]\nif mod_type == Relation.TYPE_DELETE:\n for old_object in old_values:\n self.inverse.set_related(old_object, None)\n return\...
<|body_start_0|> indice_or_slice, old_values = self.convert_to_list(indice_or_slice, old_values) if new_values is not None and (not isinstance(new_values, list)): new_values = [new_values] if mod_type == Relation.TYPE_DELETE: for old_object in old_values: ...
Abstract class defining a many-to-one relation. This relation is used when the owning side defines a HasMany field type and the inverse side defines a HasOne field type. If the relation is bidirectional (the default), then the inverse relation is a One2Many.
Many2OneRelation
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Many2OneRelation: """Abstract class defining a many-to-one relation. This relation is used when the owning side defines a HasMany field type and the inverse side defines a HasOne field type. If the relation is bidirectional (the default), then the inverse relation is a One2Many.""" def affec...
stack_v2_sparse_classes_36k_train_031664
4,896
permissive
[ { "docstring": "Affect the inverse's side (a single object). Depending on the mod_type attribute (delete, add or modify), different actions are performed. In any case, the List4Many representing the many's part of this relation (the owning's side) affects the inverse's side (the one part of the many2one relatio...
3
null
Implement the Python class `Many2OneRelation` described below. Class description: Abstract class defining a many-to-one relation. This relation is used when the owning side defines a HasMany field type and the inverse side defines a HasOne field type. If the relation is bidirectional (the default), then the inverse re...
Implement the Python class `Many2OneRelation` described below. Class description: Abstract class defining a many-to-one relation. This relation is used when the owning side defines a HasMany field type and the inverse side defines a HasOne field type. If the relation is bidirectional (the default), then the inverse re...
f459733c9307c2f843dd9ad5d1d82feafc065816
<|skeleton|> class Many2OneRelation: """Abstract class defining a many-to-one relation. This relation is used when the owning side defines a HasMany field type and the inverse side defines a HasOne field type. If the relation is bidirectional (the default), then the inverse relation is a One2Many.""" def affec...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Many2OneRelation: """Abstract class defining a many-to-one relation. This relation is used when the owning side defines a HasMany field type and the inverse side defines a HasOne field type. If the relation is bidirectional (the default), then the inverse relation is a One2Many.""" def affect(self, model...
the_stack_v2_python_sparse
src/model/relations/many2one.py
v-legoff/pa-poc3
train
0
7acfaad2df0755913dd9ea8e663b7639942ece3b
[ "if f is not None:\n self.f = f\n if hasattr(f, '__name__'):\n self.__name__ = f.__name__\n else:\n self.__name__ = f.__name__\n self.__module__ = f.__module__\n self.af = ArgumentFixer(f)\nif name is not None:\n self.name = name\nself.options = options", "options = self.options\ni...
<|body_start_0|> if f is not None: self.f = f if hasattr(f, '__name__'): self.__name__ = f.__name__ else: self.__name__ = f.__name__ self.__module__ = f.__module__ self.af = ArgumentFixer(f) if name is not None: ...
Decorator for :class:`EnumeratedSetFromIterator`. Name could be string or a function ``(args,kwds) -> string``. .. WARNING:: If you are going to use this with the decorator ``cached_function``, you must place the ``cached_function`` first. See the example below. EXAMPLES:: sage: from sage.sets.set_from_iterator import ...
EnumeratedSetFromIterator_function_decorator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EnumeratedSetFromIterator_function_decorator: """Decorator for :class:`EnumeratedSetFromIterator`. Name could be string or a function ``(args,kwds) -> string``. .. WARNING:: If you are going to use this with the decorator ``cached_function``, you must place the ``cached_function`` first. See the ...
stack_v2_sparse_classes_36k_train_031665
34,216
no_license
[ { "docstring": "Initialize ``self``. TESTS:: sage: from sage.sets.set_from_iterator import set_from_function sage: F = set_from_function(category=FiniteEnumeratedSets())(xsrange) sage: TestSuite(F(100)).run() sage: TestSuite(F(1,5,2)).run() sage: TestSuite(F(0)).run()", "name": "__init__", "signature": ...
2
stack_v2_sparse_classes_30k_train_021171
Implement the Python class `EnumeratedSetFromIterator_function_decorator` described below. Class description: Decorator for :class:`EnumeratedSetFromIterator`. Name could be string or a function ``(args,kwds) -> string``. .. WARNING:: If you are going to use this with the decorator ``cached_function``, you must place ...
Implement the Python class `EnumeratedSetFromIterator_function_decorator` described below. Class description: Decorator for :class:`EnumeratedSetFromIterator`. Name could be string or a function ``(args,kwds) -> string``. .. WARNING:: If you are going to use this with the decorator ``cached_function``, you must place ...
0d9eacbf74e2acffefde93e39f8bcbec745cdaba
<|skeleton|> class EnumeratedSetFromIterator_function_decorator: """Decorator for :class:`EnumeratedSetFromIterator`. Name could be string or a function ``(args,kwds) -> string``. .. WARNING:: If you are going to use this with the decorator ``cached_function``, you must place the ``cached_function`` first. See the ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EnumeratedSetFromIterator_function_decorator: """Decorator for :class:`EnumeratedSetFromIterator`. Name could be string or a function ``(args,kwds) -> string``. .. WARNING:: If you are going to use this with the decorator ``cached_function``, you must place the ``cached_function`` first. See the example below...
the_stack_v2_python_sparse
sage/src/sage/sets/set_from_iterator.py
bopopescu/geosci
train
0
7a60a9eb60fc6e2149bedc1f8e4aa229a2b906f1
[ "self._strategy = strategy\nself._listener = listener\nself._telemetry_runtime_producer = telemetry_runtime_producer", "for_log, for_listener = self._strategy.process_impressions(impressions)\nif len(impressions) > len(for_log):\n self._telemetry_runtime_producer.record_impression_stats(telemetry.CounterConsta...
<|body_start_0|> self._strategy = strategy self._listener = listener self._telemetry_runtime_producer = telemetry_runtime_producer <|end_body_0|> <|body_start_1|> for_log, for_listener = self._strategy.process_impressions(impressions) if len(impressions) > len(for_log): ...
Impression manager.
Manager
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Manager: """Impression manager.""" def __init__(self, strategy, telemetry_runtime_producer, listener=None): """Construct a manger to track and forward impressions to the queue. :param listener: Optional impressions listener that will capture all seen impressions. :type listener: spli...
stack_v2_sparse_classes_36k_train_031666
2,373
permissive
[ { "docstring": "Construct a manger to track and forward impressions to the queue. :param listener: Optional impressions listener that will capture all seen impressions. :type listener: splitio.client.listener.ImpressionListenerWrapper :param strategy: Impressions stragetgy instance :type strategy: (BaseStrategy...
3
null
Implement the Python class `Manager` described below. Class description: Impression manager. Method signatures and docstrings: - def __init__(self, strategy, telemetry_runtime_producer, listener=None): Construct a manger to track and forward impressions to the queue. :param listener: Optional impressions listener tha...
Implement the Python class `Manager` described below. Class description: Impression manager. Method signatures and docstrings: - def __init__(self, strategy, telemetry_runtime_producer, listener=None): Construct a manger to track and forward impressions to the queue. :param listener: Optional impressions listener tha...
523d2395d39d189772b1db1c944db0cf4ca5769a
<|skeleton|> class Manager: """Impression manager.""" def __init__(self, strategy, telemetry_runtime_producer, listener=None): """Construct a manger to track and forward impressions to the queue. :param listener: Optional impressions listener that will capture all seen impressions. :type listener: spli...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Manager: """Impression manager.""" def __init__(self, strategy, telemetry_runtime_producer, listener=None): """Construct a manger to track and forward impressions to the queue. :param listener: Optional impressions listener that will capture all seen impressions. :type listener: splitio.client.li...
the_stack_v2_python_sparse
splitio/engine/impressions/impressions.py
splitio/python-client
train
17
eddf2ead8fe6bd9a355f21e5ae1f12a83ed34bfa
[ "self.metric_name = metric_name\nself.timestamp_msecs = timestamp_msecs\nself.value = value", "if dictionary is None:\n return None\nmetric_name = dictionary.get('metricName')\ntimestamp_msecs = dictionary.get('timestampMsecs')\nvalue = cohesity_management_sdk.models.value.Value.from_dictionary(dictionary.get(...
<|body_start_0|> self.metric_name = metric_name self.timestamp_msecs = timestamp_msecs self.value = value <|end_body_0|> <|body_start_1|> if dictionary is None: return None metric_name = dictionary.get('metricName') timestamp_msecs = dictionary.get('timestamp...
Implementation of the 'MetricValue' model. Specifies one data point of a metric. Attributes: metric_name (string): Specifies the metric name. timestamp_msecs (long|int): Specifies the creation time of a data point as a Unix epoch Timestamp (in milliseconds). value (Value): Specifies the value of the data point.
MetricValue
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MetricValue: """Implementation of the 'MetricValue' model. Specifies one data point of a metric. Attributes: metric_name (string): Specifies the metric name. timestamp_msecs (long|int): Specifies the creation time of a data point as a Unix epoch Timestamp (in milliseconds). value (Value): Specifi...
stack_v2_sparse_classes_36k_train_031667
2,016
permissive
[ { "docstring": "Constructor for the MetricValue class", "name": "__init__", "signature": "def __init__(self, metric_name=None, timestamp_msecs=None, value=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of t...
2
stack_v2_sparse_classes_30k_train_015190
Implement the Python class `MetricValue` described below. Class description: Implementation of the 'MetricValue' model. Specifies one data point of a metric. Attributes: metric_name (string): Specifies the metric name. timestamp_msecs (long|int): Specifies the creation time of a data point as a Unix epoch Timestamp (i...
Implement the Python class `MetricValue` described below. Class description: Implementation of the 'MetricValue' model. Specifies one data point of a metric. Attributes: metric_name (string): Specifies the metric name. timestamp_msecs (long|int): Specifies the creation time of a data point as a Unix epoch Timestamp (i...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class MetricValue: """Implementation of the 'MetricValue' model. Specifies one data point of a metric. Attributes: metric_name (string): Specifies the metric name. timestamp_msecs (long|int): Specifies the creation time of a data point as a Unix epoch Timestamp (in milliseconds). value (Value): Specifi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MetricValue: """Implementation of the 'MetricValue' model. Specifies one data point of a metric. Attributes: metric_name (string): Specifies the metric name. timestamp_msecs (long|int): Specifies the creation time of a data point as a Unix epoch Timestamp (in milliseconds). value (Value): Specifies the value ...
the_stack_v2_python_sparse
cohesity_management_sdk/models/metric_value.py
cohesity/management-sdk-python
train
24
8b6e75cb154509f310f46801a1f5e93530d2ef52
[ "super().__init__()\nself.down_rate = down_rate\nself.residual = residual\nself.c1 = get_1x1(in_width, middle_width)\nself.c2 = get_3x3(middle_width, middle_width) if use_3x3 else get_1x1(middle_width, middle_width)\nself.c3 = get_3x3(middle_width, middle_width) if use_3x3 else get_1x1(middle_width, middle_width)\n...
<|body_start_0|> super().__init__() self.down_rate = down_rate self.residual = residual self.c1 = get_1x1(in_width, middle_width) self.c2 = get_3x3(middle_width, middle_width) if use_3x3 else get_1x1(middle_width, middle_width) self.c3 = get_3x3(middle_width, middle_width...
Block
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Block: def __init__(self, in_width: int, middle_width: int, out_width: int, down_rate: int=None, residual=False, use_3x3=True, zero_last=False): """Bottleneck Residual Block Parameters ---------- in_width : int Number of input features middle_width : int Number of intermediate features o...
stack_v2_sparse_classes_36k_train_031668
9,154
permissive
[ { "docstring": "Bottleneck Residual Block Parameters ---------- in_width : int Number of input features middle_width : int Number of intermediate features out_width : int Number of output features down_rate : int, optional Input downsampling rate, by default None residual : bool, optional Whether to include res...
2
stack_v2_sparse_classes_30k_train_004660
Implement the Python class `Block` described below. Class description: Implement the Block class. Method signatures and docstrings: - def __init__(self, in_width: int, middle_width: int, out_width: int, down_rate: int=None, residual=False, use_3x3=True, zero_last=False): Bottleneck Residual Block Parameters ---------...
Implement the Python class `Block` described below. Class description: Implement the Block class. Method signatures and docstrings: - def __init__(self, in_width: int, middle_width: int, out_width: int, down_rate: int=None, residual=False, use_3x3=True, zero_last=False): Bottleneck Residual Block Parameters ---------...
65a46e41845982def17e553a46be849d948f9f45
<|skeleton|> class Block: def __init__(self, in_width: int, middle_width: int, out_width: int, down_rate: int=None, residual=False, use_3x3=True, zero_last=False): """Bottleneck Residual Block Parameters ---------- in_width : int Number of input features middle_width : int Number of intermediate features o...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Block: def __init__(self, in_width: int, middle_width: int, out_width: int, down_rate: int=None, residual=False, use_3x3=True, zero_last=False): """Bottleneck Residual Block Parameters ---------- in_width : int Number of input features middle_width : int Number of intermediate features out_width : int...
the_stack_v2_python_sparse
src/models/resnet/modules.py
yizhe-ang/vi-lab
train
1
2805a1c497e4f93966678b95a82387d37a5da1a9
[ "super(PseTae_pretrained, self).__init__()\nself.weight_folder = weight_folder\nself.hyperparameters = hyperparameters\nself.fold_folders = [os.path.join(weight_folder, f) for f in os.listdir(weight_folder) if os.path.isdir(os.path.join(weight_folder, f))]\nif fold == 'all':\n self.n_folds = len(self.fold_folder...
<|body_start_0|> super(PseTae_pretrained, self).__init__() self.weight_folder = weight_folder self.hyperparameters = hyperparameters self.fold_folders = [os.path.join(weight_folder, f) for f in os.listdir(weight_folder) if os.path.isdir(os.path.join(weight_folder, f))] if fold ==...
PseTae_pretrained
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PseTae_pretrained: def __init__(self, weight_folder, hyperparameters, device='cuda', fold='all'): """Pretrained PseTea classifier. The class can either load the weights of a single fold or aggregate the predictions of the different sets of weights obtained during k-fold cross-validation ...
stack_v2_sparse_classes_36k_train_031669
19,964
no_license
[ { "docstring": "Pretrained PseTea classifier. The class can either load the weights of a single fold or aggregate the predictions of the different sets of weights obtained during k-fold cross-validation and produces a single prediction. Args: weight_folder (str): Path to the folder containing the different sets...
3
null
Implement the Python class `PseTae_pretrained` described below. Class description: Implement the PseTae_pretrained class. Method signatures and docstrings: - def __init__(self, weight_folder, hyperparameters, device='cuda', fold='all'): Pretrained PseTea classifier. The class can either load the weights of a single f...
Implement the Python class `PseTae_pretrained` described below. Class description: Implement the PseTae_pretrained class. Method signatures and docstrings: - def __init__(self, weight_folder, hyperparameters, device='cuda', fold='all'): Pretrained PseTea classifier. The class can either load the weights of a single f...
7e55a422588c1d1e00f35a3d3a3ff896cce59e18
<|skeleton|> class PseTae_pretrained: def __init__(self, weight_folder, hyperparameters, device='cuda', fold='all'): """Pretrained PseTea classifier. The class can either load the weights of a single fold or aggregate the predictions of the different sets of weights obtained during k-fold cross-validation ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PseTae_pretrained: def __init__(self, weight_folder, hyperparameters, device='cuda', fold='all'): """Pretrained PseTea classifier. The class can either load the weights of a single fold or aggregate the predictions of the different sets of weights obtained during k-fold cross-validation and produces a...
the_stack_v2_python_sparse
generated/test_VSainteuf_pytorch_psetae.py
jansel/pytorch-jit-paritybench
train
35
c2325c19d82323e374c65c6de9fe5b1ceb86f727
[ "if not root:\n return root\nqueue = deque([root, None])\npre_node = None\nwhile len(queue) > 0:\n node = queue.popleft()\n if node:\n if not pre_node:\n pre_node = node\n else:\n pre_node.next = node\n pre_node = node\n if node.left:\n queue...
<|body_start_0|> if not root: return root queue = deque([root, None]) pre_node = None while len(queue) > 0: node = queue.popleft() if node: if not pre_node: pre_node = node else: p...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def connect(self, root: Node) -> Node: """BFS(一次遍历)。""" <|body_0|> def connect2(self, root: Node) -> Node: """层序遍历(迭代)。""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not root: return root queue = deque([root, None]...
stack_v2_sparse_classes_36k_train_031670
6,787
no_license
[ { "docstring": "BFS(一次遍历)。", "name": "connect", "signature": "def connect(self, root: Node) -> Node" }, { "docstring": "层序遍历(迭代)。", "name": "connect2", "signature": "def connect2(self, root: Node) -> Node" } ]
2
stack_v2_sparse_classes_30k_train_016940
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def connect(self, root: Node) -> Node: BFS(一次遍历)。 - def connect2(self, root: Node) -> Node: 层序遍历(迭代)。
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def connect(self, root: Node) -> Node: BFS(一次遍历)。 - def connect2(self, root: Node) -> Node: 层序遍历(迭代)。 <|skeleton|> class Solution: def connect(self, root: Node) -> Node: ...
6932d69353b94ec824dd0ddc86a92453f6673232
<|skeleton|> class Solution: def connect(self, root: Node) -> Node: """BFS(一次遍历)。""" <|body_0|> def connect2(self, root: Node) -> Node: """层序遍历(迭代)。""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def connect(self, root: Node) -> Node: """BFS(一次遍历)。""" if not root: return root queue = deque([root, None]) pre_node = None while len(queue) > 0: node = queue.popleft() if node: if not pre_node: ...
the_stack_v2_python_sparse
0116_populating-next-right-pointers-in-each-node.py
Nigirimeshi/leetcode
train
0
feb77b35af1dff64dce2c0a5a9701f4861715d0b
[ "super(FeedForwardGenerator, self).__init__()\nword_ids = sorted(word_ids)\nself.word_embedd = word_embedd\nself.word_ids = word_ids\nself.word_ids_set = set(word_ids)\nm_emb = word_embedd.weight.size(-1)\nweight = torch.index_select(word_embedd.weight, 0, torch.tensor(word_ids, device=cfg.device))\nself.obfenc = O...
<|body_start_0|> super(FeedForwardGenerator, self).__init__() word_ids = sorted(word_ids) self.word_embedd = word_embedd self.word_ids = word_ids self.word_ids_set = set(word_ids) m_emb = word_embedd.weight.size(-1) weight = torch.index_select(word_embedd.weight, ...
FeedForwardGenerator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FeedForwardGenerator: def __init__(self, word_ids, word_embedd, word_alphabet, char_alphabet): """in the generator, we try to hijack the biaffine parser model provided by Max thanks for the dynamic feature of python, we want to substitute the embedd_word all the ablation study is done he...
stack_v2_sparse_classes_36k_train_031671
10,807
no_license
[ { "docstring": "in the generator, we try to hijack the biaffine parser model provided by Max thanks for the dynamic feature of python, we want to substitute the embedd_word all the ablation study is done here, notice that once done, we need the result from the final decoder. It seems impossible to this end. But...
2
stack_v2_sparse_classes_30k_val_000919
Implement the Python class `FeedForwardGenerator` described below. Class description: Implement the FeedForwardGenerator class. Method signatures and docstrings: - def __init__(self, word_ids, word_embedd, word_alphabet, char_alphabet): in the generator, we try to hijack the biaffine parser model provided by Max than...
Implement the Python class `FeedForwardGenerator` described below. Class description: Implement the FeedForwardGenerator class. Method signatures and docstrings: - def __init__(self, word_ids, word_embedd, word_alphabet, char_alphabet): in the generator, we try to hijack the biaffine parser model provided by Max than...
aa1da79dea82c36bc1b8d4d83e1d8ad40871d330
<|skeleton|> class FeedForwardGenerator: def __init__(self, word_ids, word_embedd, word_alphabet, char_alphabet): """in the generator, we try to hijack the biaffine parser model provided by Max thanks for the dynamic feature of python, we want to substitute the embedd_word all the ablation study is done he...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FeedForwardGenerator: def __init__(self, word_ids, word_embedd, word_alphabet, char_alphabet): """in the generator, we try to hijack the biaffine parser model provided by Max thanks for the dynamic feature of python, we want to substitute the embedd_word all the ablation study is done here, notice tha...
the_stack_v2_python_sparse
net/generator/ff.py
ichn-hu/Parsing-Obfuscation
train
3
d94e4d1a2c61f4612ff95f8c0dd4113042e00815
[ "for i in range(len(arr)):\n arr[i] = -float('inf')\n replace_val = max(arr)\n if replace_val == -float('inf'):\n replace_val = -1\n arr[i] = -replace_val\nreturn [-x for x in arr]", "for i in range(len(A) - 1, -1, -1):\n A[i], mx = (mx, max(mx, A[i]))\nreturn A" ]
<|body_start_0|> for i in range(len(arr)): arr[i] = -float('inf') replace_val = max(arr) if replace_val == -float('inf'): replace_val = -1 arr[i] = -replace_val return [-x for x in arr] <|end_body_0|> <|body_start_1|> for i in rang...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def replaceElements(self, arr): """:type arr: List[int] :rtype: List[int]""" <|body_0|> def replaceElements(self, A, mx=-1): """mx = 1 A[i] = 1 mx = (1, 6) = 6 Input: arr = [17,18,5,4,1,-1] i""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_031672
1,032
no_license
[ { "docstring": ":type arr: List[int] :rtype: List[int]", "name": "replaceElements", "signature": "def replaceElements(self, arr)" }, { "docstring": "mx = 1 A[i] = 1 mx = (1, 6) = 6 Input: arr = [17,18,5,4,1,-1] i", "name": "replaceElements", "signature": "def replaceElements(self, A, mx=...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def replaceElements(self, arr): :type arr: List[int] :rtype: List[int] - def replaceElements(self, A, mx=-1): mx = 1 A[i] = 1 mx = (1, 6) = 6 Input: arr = [17,18,5,4,1,-1] i
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def replaceElements(self, arr): :type arr: List[int] :rtype: List[int] - def replaceElements(self, A, mx=-1): mx = 1 A[i] = 1 mx = (1, 6) = 6 Input: arr = [17,18,5,4,1,-1] i <|s...
2e1751263f484709102f7f2caf18776a004c8230
<|skeleton|> class Solution: def replaceElements(self, arr): """:type arr: List[int] :rtype: List[int]""" <|body_0|> def replaceElements(self, A, mx=-1): """mx = 1 A[i] = 1 mx = (1, 6) = 6 Input: arr = [17,18,5,4,1,-1] i""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def replaceElements(self, arr): """:type arr: List[int] :rtype: List[int]""" for i in range(len(arr)): arr[i] = -float('inf') replace_val = max(arr) if replace_val == -float('inf'): replace_val = -1 arr[i] = -replace_val...
the_stack_v2_python_sparse
Python/Leetcode Daily Practice/Array/1299. Replace Elements with Greatest Element on Right Side.py
YaqianQi/Algorithm-and-Data-Structure
train
1
8b723db43a5ab241fb6a084d0eeb1fd2143eed7f
[ "from expedient.common.permissions.models import Permittee\nfrom expedient.common.permissions.models import ObjectPermission\nfrom expedient.common.permissions.models import PermissionOwnership\ntry:\n obj_permission = ObjectPermission.objects.get_for_object_or_class(permission, obj_or_class)\nexcept ObjectPermi...
<|body_start_0|> from expedient.common.permissions.models import Permittee from expedient.common.permissions.models import ObjectPermission from expedient.common.permissions.models import PermissionOwnership try: obj_permission = ObjectPermission.objects.get_for_object_or_cla...
Manager for PermissionOwnership model. Adds the delete_ownership and get_ownership methods to the default manager.
PermissionOwnershipManager
[ "BSD-3-Clause", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PermissionOwnershipManager: """Manager for PermissionOwnership model. Adds the delete_ownership and get_ownership methods to the default manager.""" def get_ownership(self, permission, obj_or_class, owner): """Get a PermissionOwnership instance. @param permission: The name of the per...
stack_v2_sparse_classes_36k_train_031673
21,795
permissive
[ { "docstring": "Get a PermissionOwnership instance. @param permission: The name of the permission or its L{ExpedientPermission} instance. @type permission: C{str} or L{ExpedientPermission}. @param obj_or_class: The target object or class for the permission. @type obj_or_class: C{Model} instance or C{class}. @pa...
3
null
Implement the Python class `PermissionOwnershipManager` described below. Class description: Manager for PermissionOwnership model. Adds the delete_ownership and get_ownership methods to the default manager. Method signatures and docstrings: - def get_ownership(self, permission, obj_or_class, owner): Get a PermissionO...
Implement the Python class `PermissionOwnershipManager` described below. Class description: Manager for PermissionOwnership model. Adds the delete_ownership and get_ownership methods to the default manager. Method signatures and docstrings: - def get_ownership(self, permission, obj_or_class, owner): Get a PermissionO...
059ed2b3308bda2af5e1942dc9967e6573dd6a53
<|skeleton|> class PermissionOwnershipManager: """Manager for PermissionOwnership model. Adds the delete_ownership and get_ownership methods to the default manager.""" def get_ownership(self, permission, obj_or_class, owner): """Get a PermissionOwnership instance. @param permission: The name of the per...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PermissionOwnershipManager: """Manager for PermissionOwnership model. Adds the delete_ownership and get_ownership methods to the default manager.""" def get_ownership(self, permission, obj_or_class, owner): """Get a PermissionOwnership instance. @param permission: The name of the permission or it...
the_stack_v2_python_sparse
expedient/src/python/expedient/common/permissions/managers.py
dana-i2cat/felix
train
4
97121c708408294e0bb9804efec9e695d6907591
[ "location = self._parse_location(response)\nmeeting_map = {}\nfor item in response.css('.layoutArea li'):\n start = self._parse_start(item)\n if not start:\n continue\n meeting = Meeting(title='State Street Commission', description='', classification=COMMISSION, start=start, end=None, time_notes='',...
<|body_start_0|> location = self._parse_location(response) meeting_map = {} for item in response.css('.layoutArea li'): start = self._parse_start(item) if not start: continue meeting = Meeting(title='State Street Commission', description='', cl...
ChiSsa1Spider
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ChiSsa1Spider: def parse(self, response): """`parse` should always `yield` Meeting items. Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping needs.""" <|body_0|> def _parse_start(self, item): """Parse start date and time.""" <|body_1|...
stack_v2_sparse_classes_36k_train_031674
2,987
permissive
[ { "docstring": "`parse` should always `yield` Meeting items. Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping needs.", "name": "parse", "signature": "def parse(self, response)" }, { "docstring": "Parse start date and time.", "name": "_parse_start", "signature":...
4
stack_v2_sparse_classes_30k_train_020091
Implement the Python class `ChiSsa1Spider` described below. Class description: Implement the ChiSsa1Spider class. Method signatures and docstrings: - def parse(self, response): `parse` should always `yield` Meeting items. Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping needs. - def _parse_...
Implement the Python class `ChiSsa1Spider` described below. Class description: Implement the ChiSsa1Spider class. Method signatures and docstrings: - def parse(self, response): `parse` should always `yield` Meeting items. Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping needs. - def _parse_...
611fce6a2705446e25a2fc33e32090a571eb35d1
<|skeleton|> class ChiSsa1Spider: def parse(self, response): """`parse` should always `yield` Meeting items. Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping needs.""" <|body_0|> def _parse_start(self, item): """Parse start date and time.""" <|body_1|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ChiSsa1Spider: def parse(self, response): """`parse` should always `yield` Meeting items. Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping needs.""" location = self._parse_location(response) meeting_map = {} for item in response.css('.layoutArea li'):...
the_stack_v2_python_sparse
city_scrapers/spiders/chi_ssa_1.py
City-Bureau/city-scrapers
train
308
8e777edd2101493e12c6b87c386837f52062e5e8
[ "self.qobj_model = qobj_model\nself.default_qubit_los = default_qubit_los\nself.default_meas_los = default_meas_los\nself.run_config = run_config", "lo_config = {}\nq_los = self.get_qubit_los(user_lo_config)\nif q_los:\n lo_config['qubit_lo_freq'] = q_los\nm_los = self.get_meas_los(user_lo_config)\nif m_los:\n...
<|body_start_0|> self.qobj_model = qobj_model self.default_qubit_los = default_qubit_los self.default_meas_los = default_meas_los self.run_config = run_config <|end_body_0|> <|body_start_1|> lo_config = {} q_los = self.get_qubit_los(user_lo_config) if q_los: ...
This class supports to convert LoConfig into ~`lo_freq` attribute of configs. The format of LO frequency setup can be easily modified by replacing `get_qubit_los` and `get_meas_los` to align with your backend.
LoConfigConverter
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoConfigConverter: """This class supports to convert LoConfig into ~`lo_freq` attribute of configs. The format of LO frequency setup can be easily modified by replacing `get_qubit_los` and `get_meas_los` to align with your backend.""" def __init__(self, qobj_model, default_qubit_los, default...
stack_v2_sparse_classes_36k_train_031675
3,391
permissive
[ { "docstring": "Create new converter. Args: qobj_model (PulseQobjExperimentConfig): qobj model for experiment config. default_qubit_los (list): List of default qubit lo frequencies. default_meas_los (list): List of default meas lo frequencies. run_config (dict): experimental configuration.", "name": "__init...
4
stack_v2_sparse_classes_30k_train_009647
Implement the Python class `LoConfigConverter` described below. Class description: This class supports to convert LoConfig into ~`lo_freq` attribute of configs. The format of LO frequency setup can be easily modified by replacing `get_qubit_los` and `get_meas_los` to align with your backend. Method signatures and doc...
Implement the Python class `LoConfigConverter` described below. Class description: This class supports to convert LoConfig into ~`lo_freq` attribute of configs. The format of LO frequency setup can be easily modified by replacing `get_qubit_los` and `get_meas_los` to align with your backend. Method signatures and doc...
56ee4ca815dd0165dd62684abd364ae706b4fe10
<|skeleton|> class LoConfigConverter: """This class supports to convert LoConfig into ~`lo_freq` attribute of configs. The format of LO frequency setup can be easily modified by replacing `get_qubit_los` and `get_meas_los` to align with your backend.""" def __init__(self, qobj_model, default_qubit_los, default...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LoConfigConverter: """This class supports to convert LoConfig into ~`lo_freq` attribute of configs. The format of LO frequency setup can be easily modified by replacing `get_qubit_los` and `get_meas_los` to align with your backend.""" def __init__(self, qobj_model, default_qubit_los, default_meas_los, **...
the_stack_v2_python_sparse
qiskit/qobj/converters/lo_config.py
uguraba/qiskit-terra
train
0
f811a14b2db36a66f2d787b29be2f53fd04d5aef
[ "self.sizes = sizes\nself.num_layers = len(sizes) - 1\nself.weights = [np.random.randn(ch2, ch1) for ch1, ch2 in zip(sizes[:-1], sizes[1:])]\nself.biases = [np.random.randn(ch, 1) for ch in sizes[1:]]", "for b, w in zip(self.biases, self.weights):\n z = np.dot(w, x) + b\n x = sigmoid(z)\nreturn x", "nabla...
<|body_start_0|> self.sizes = sizes self.num_layers = len(sizes) - 1 self.weights = [np.random.randn(ch2, ch1) for ch1, ch2 in zip(sizes[:-1], sizes[1:])] self.biases = [np.random.randn(ch, 1) for ch in sizes[1:]] <|end_body_0|> <|body_start_1|> for b, w in zip(self.biases, self...
MLP_np
[ "LicenseRef-scancode-mulanpsl-1.0-en", "MulanPSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MLP_np: def __init__(self, sizes): """size :[784,30,10]""" <|body_0|> def forward(self, x): """x:[784,1]""" <|body_1|> def backprop(self, x, y): """x:[784,1] y:[10,1]""" <|body_2|> def train(self, training_data, epochs, batchsz, lr, ...
stack_v2_sparse_classes_36k_train_031676
5,469
permissive
[ { "docstring": "size :[784,30,10]", "name": "__init__", "signature": "def __init__(self, sizes)" }, { "docstring": "x:[784,1]", "name": "forward", "signature": "def forward(self, x)" }, { "docstring": "x:[784,1] y:[10,1]", "name": "backprop", "signature": "def backprop(se...
6
null
Implement the Python class `MLP_np` described below. Class description: Implement the MLP_np class. Method signatures and docstrings: - def __init__(self, sizes): size :[784,30,10] - def forward(self, x): x:[784,1] - def backprop(self, x, y): x:[784,1] y:[10,1] - def train(self, training_data, epochs, batchsz, lr, te...
Implement the Python class `MLP_np` described below. Class description: Implement the MLP_np class. Method signatures and docstrings: - def __init__(self, sizes): size :[784,30,10] - def forward(self, x): x:[784,1] - def backprop(self, x, y): x:[784,1] y:[10,1] - def train(self, training_data, epochs, batchsz, lr, te...
17a225169873b3c232bdfcccf7c0366d2a688354
<|skeleton|> class MLP_np: def __init__(self, sizes): """size :[784,30,10]""" <|body_0|> def forward(self, x): """x:[784,1]""" <|body_1|> def backprop(self, x, y): """x:[784,1] y:[10,1]""" <|body_2|> def train(self, training_data, epochs, batchsz, lr, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MLP_np: def __init__(self, sizes): """size :[784,30,10]""" self.sizes = sizes self.num_layers = len(sizes) - 1 self.weights = [np.random.randn(ch2, ch1) for ch1, ch2 in zip(sizes[:-1], sizes[1:])] self.biases = [np.random.randn(ch, 1) for ch in sizes[1:]] def forwa...
the_stack_v2_python_sparse
深度学习/手写数字例子/学生 NUMPY构建BP深度神经网络 自己写的.py
3453566/pythonbook
train
1
4816b461155108cc8c60633c0f746c9de3096cd7
[ "if status == 'CANCELLED' and (not cancel_reason):\n raise AcquisitionError('You have to provide a cancel reason when cancelling the order')\nif cancel_reason and (not status == 'CANCELLED'):\n raise AcquisitionError('If you select a cancel reason you need to select \"Cancelled\" in the state')", "Provider ...
<|body_start_0|> if status == 'CANCELLED' and (not cancel_reason): raise AcquisitionError('You have to provide a cancel reason when cancelling the order') if cancel_reason and (not status == 'CANCELLED'): raise AcquisitionError('If you select a cancel reason you need to select "C...
Order record validator.
OrderValidator
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OrderValidator: """Order record validator.""" def validate_cancel(self, status, cancel_reason): """Validate decline is correct.""" <|body_0|> def ensure_provider_exists(self, provider_pid): """Ensure provider exists or raise.""" <|body_1|> def ensure...
stack_v2_sparse_classes_36k_train_031677
5,122
permissive
[ { "docstring": "Validate decline is correct.", "name": "validate_cancel", "signature": "def validate_cancel(self, status, cancel_reason)" }, { "docstring": "Ensure provider exists or raise.", "name": "ensure_provider_exists", "signature": "def ensure_provider_exists(self, provider_pid)" ...
6
null
Implement the Python class `OrderValidator` described below. Class description: Order record validator. Method signatures and docstrings: - def validate_cancel(self, status, cancel_reason): Validate decline is correct. - def ensure_provider_exists(self, provider_pid): Ensure provider exists or raise. - def ensure_doc...
Implement the Python class `OrderValidator` described below. Class description: Order record validator. Method signatures and docstrings: - def validate_cancel(self, status, cancel_reason): Validate decline is correct. - def ensure_provider_exists(self, provider_pid): Ensure provider exists or raise. - def ensure_doc...
1c36526e85510100c5f64059518d1b716d87ac10
<|skeleton|> class OrderValidator: """Order record validator.""" def validate_cancel(self, status, cancel_reason): """Validate decline is correct.""" <|body_0|> def ensure_provider_exists(self, provider_pid): """Ensure provider exists or raise.""" <|body_1|> def ensure...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OrderValidator: """Order record validator.""" def validate_cancel(self, status, cancel_reason): """Validate decline is correct.""" if status == 'CANCELLED' and (not cancel_reason): raise AcquisitionError('You have to provide a cancel reason when cancelling the order') ...
the_stack_v2_python_sparse
invenio_app_ils/acquisition/api.py
inveniosoftware/invenio-app-ils
train
64
742da9a67f06192b7f0716ea788b6498591a8de7
[ "B = A[::-1]\nfor i in range(1, len(A)):\n A[i] *= A[i - 1] or 1\n B[i] *= B[i - 1] or 1\nreturn max(A + B)", "dp = [None] * len(nums)\ndp[0] = nums[0]\nfor i in range(1, len(nums)):\n dp[i] = max(dp[i - 1] + nums[i], nums[i])\nprint(dp)\nreturn max(dp)", "dp = nums.copy()\nfor i in range(2, len(nums))...
<|body_start_0|> B = A[::-1] for i in range(1, len(A)): A[i] *= A[i - 1] or 1 B[i] *= B[i - 1] or 1 return max(A + B) <|end_body_0|> <|body_start_1|> dp = [None] * len(nums) dp[0] = nums[0] for i in range(1, len(nums)): dp[i] = max(dp[...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProduct(self, A): """:type nums: List[int] :rtype: int""" <|body_0|> def maxSubArray(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def rob(self, nums): """:type nums: List[int] :rtype: int""" <|body_2|> ...
stack_v2_sparse_classes_36k_train_031678
1,014
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "maxProduct", "signature": "def maxProduct(self, A)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "maxSubArray", "signature": "def maxSubArray(self, nums)" }, { "docstring": ":type nums: List[int] :rtyp...
3
stack_v2_sparse_classes_30k_train_015117
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProduct(self, A): :type nums: List[int] :rtype: int - def maxSubArray(self, nums): :type nums: List[int] :rtype: int - def rob(self, nums): :type nums: List[int] :rtype: i...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProduct(self, A): :type nums: List[int] :rtype: int - def maxSubArray(self, nums): :type nums: List[int] :rtype: int - def rob(self, nums): :type nums: List[int] :rtype: i...
7bcba42556475f56fad995b97a37b98f4981da8c
<|skeleton|> class Solution: def maxProduct(self, A): """:type nums: List[int] :rtype: int""" <|body_0|> def maxSubArray(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def rob(self, nums): """:type nums: List[int] :rtype: int""" <|body_2|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxProduct(self, A): """:type nums: List[int] :rtype: int""" B = A[::-1] for i in range(1, len(A)): A[i] *= A[i - 1] or 1 B[i] *= B[i - 1] or 1 return max(A + B) def maxSubArray(self, nums): """:type nums: List[int] :rtype: int...
the_stack_v2_python_sparse
Problems/152. Maximum Product Subarray.py
chendingyan/My-Leetcode
train
0
0670e3c6c8cf4576effc01a6d76e614c73b7bf12
[ "self.set = set()\nself.list = []\nself.label = True", "if val not in self.set:\n self.set.add(val)\n self.list.append(val)\n return True\nelse:\n return False", "if val in self.set:\n self.set.remove(val)\n self.label = False\n return True\nelse:\n return False", "if self.label is Fal...
<|body_start_0|> self.set = set() self.list = [] self.label = True <|end_body_0|> <|body_start_1|> if val not in self.set: self.set.add(val) self.list.append(val) return True else: return False <|end_body_1|> <|body_start_2|> ...
RandomizedSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RandomizedSet: def __init__(self): """Initialize your data structure here.""" <|body_0|> def insert(self, val): """Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: int :rtype: bool""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_031679
1,619
no_license
[ { "docstring": "Initialize your data structure here.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: int :rtype: bool", "name": "insert", "signature": ...
4
stack_v2_sparse_classes_30k_train_009368
Implement the Python class `RandomizedSet` described below. Class description: Implement the RandomizedSet class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def insert(self, val): Inserts a value to the set. Returns true if the set did not already contain the specif...
Implement the Python class `RandomizedSet` described below. Class description: Implement the RandomizedSet class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def insert(self, val): Inserts a value to the set. Returns true if the set did not already contain the specif...
0c4c38849309124121b03cc0b4bf39071b5d1c8c
<|skeleton|> class RandomizedSet: def __init__(self): """Initialize your data structure here.""" <|body_0|> def insert(self, val): """Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: int :rtype: bool""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RandomizedSet: def __init__(self): """Initialize your data structure here.""" self.set = set() self.list = [] self.label = True def insert(self, val): """Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: i...
the_stack_v2_python_sparse
380.py
zhangchizju2012/LeetCode
train
7
01fdc9653946bbcc5aa8a50a99b38c7a267ceb31
[ "state_space, action_space = super().setup_spaces()\nstate_space.add_dim(Dimension(p_name_long='alpha 1', p_name_short='a1', p_description='Angular Acceleration of Pendulum 1', p_name_latex='', p_unit='degrees/second^2', p_unit_latex='\\text/s^2', p_boundaries=[-8500000, 8500000]))\nstate_space.add_dim(Dimension(p_...
<|body_start_0|> state_space, action_space = super().setup_spaces() state_space.add_dim(Dimension(p_name_long='alpha 1', p_name_short='a1', p_description='Angular Acceleration of Pendulum 1', p_name_latex='', p_unit='degrees/second^2', p_unit_latex='\text/s^2', p_boundaries=[-8500000, 8500000])) ...
This is the classic implementation of Double Pendulum with 7 dimensional state space including derived accelerations of both the poles and the input torque. The dynamics of the system are inherited from the Double Pendulum Root class. Parameters ---------- p_mode Mode of environment. Possible values are Mode.C_MODE_SIM...
DoublePendulumSystemS7
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DoublePendulumSystemS7: """This is the classic implementation of Double Pendulum with 7 dimensional state space including derived accelerations of both the poles and the input torque. The dynamics of the system are inherited from the Double Pendulum Root class. Parameters ---------- p_mode Mode o...
stack_v2_sparse_classes_36k_train_031680
34,346
permissive
[ { "docstring": "Method to set up the state and action spaces of the classic Double Pendulum Environment. Inheriting from the root class, this method adds 3 dimensions for accelerations and torque respectively.", "name": "setup_spaces", "signature": "def setup_spaces(self)" }, { "docstring": "Thi...
3
null
Implement the Python class `DoublePendulumSystemS7` described below. Class description: This is the classic implementation of Double Pendulum with 7 dimensional state space including derived accelerations of both the poles and the input torque. The dynamics of the system are inherited from the Double Pendulum Root cla...
Implement the Python class `DoublePendulumSystemS7` described below. Class description: This is the classic implementation of Double Pendulum with 7 dimensional state space including derived accelerations of both the poles and the input torque. The dynamics of the system are inherited from the Double Pendulum Root cla...
43faa99508d29191dd3edea05d28892db8ddd357
<|skeleton|> class DoublePendulumSystemS7: """This is the classic implementation of Double Pendulum with 7 dimensional state space including derived accelerations of both the poles and the input torque. The dynamics of the system are inherited from the Double Pendulum Root class. Parameters ---------- p_mode Mode o...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DoublePendulumSystemS7: """This is the classic implementation of Double Pendulum with 7 dimensional state space including derived accelerations of both the poles and the input torque. The dynamics of the system are inherited from the Double Pendulum Root class. Parameters ---------- p_mode Mode of environment...
the_stack_v2_python_sparse
src/mlpro/bf/systems/pool/doublependulum.py
fhswf/MLPro
train
15
438982ed06b3dfe85696f774892ac9ab800ee085
[ "self.res = 0\n\ndef solve(tmps):\n if len(tmps) == 0:\n self.res += 1\n return\n for i in range(min(len(tmps), 2)):\n if int(tmps[:i + 1]) > 0 and int(tmps[:i + 1]) <= 26:\n solve(tmps[i + 1:])\n else:\n return\nsolve(s)\nreturn self.res", "n = len(s)\nif n...
<|body_start_0|> self.res = 0 def solve(tmps): if len(tmps) == 0: self.res += 1 return for i in range(min(len(tmps), 2)): if int(tmps[:i + 1]) > 0 and int(tmps[:i + 1]) <= 26: solve(tmps[i + 1:]) ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def numDecodings(self, s): """:type s: str :rtype: int""" <|body_0|> def numDecodings2(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.res = 0 def solve(tmps): if len(tmps) ==...
stack_v2_sparse_classes_36k_train_031681
1,150
no_license
[ { "docstring": ":type s: str :rtype: int", "name": "numDecodings", "signature": "def numDecodings(self, s)" }, { "docstring": ":type s: str :rtype: int", "name": "numDecodings2", "signature": "def numDecodings2(self, s)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numDecodings(self, s): :type s: str :rtype: int - def numDecodings2(self, s): :type s: str :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numDecodings(self, s): :type s: str :rtype: int - def numDecodings2(self, s): :type s: str :rtype: int <|skeleton|> class Solution: def numDecodings(self, s): "...
a4018931622cb29dea2ba6a202aad0a4873e73d3
<|skeleton|> class Solution: def numDecodings(self, s): """:type s: str :rtype: int""" <|body_0|> def numDecodings2(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def numDecodings(self, s): """:type s: str :rtype: int""" self.res = 0 def solve(tmps): if len(tmps) == 0: self.res += 1 return for i in range(min(len(tmps), 2)): if int(tmps[:i + 1]) > 0 and int(tmps[:i...
the_stack_v2_python_sparse
0091. 解码方法/main.py
swbuild1988/leetcode
train
0
a38036e61c7488377c8a4d98f9cbbd428f47f133
[ "SIZE = 512\nx, y = np.meshgrid(np.linspace(-1, 1, SIZE), np.linspace(-1, 1, SIZE))\nd = np.sqrt(x ** 2 + y ** 2)\nsigma, mu = (1.0, 0.0)\ngaussian = np.exp(-((d - mu) ** 2 / (2.0 * sigma ** 2)))\nimg = binarize_mat(gaussian)\nself.assertEqual(len(np.unique(img)), 2)", "verticies = get_ts_verticies(img, u=20, z=0...
<|body_start_0|> SIZE = 512 x, y = np.meshgrid(np.linspace(-1, 1, SIZE), np.linspace(-1, 1, SIZE)) d = np.sqrt(x ** 2 + y ** 2) sigma, mu = (1.0, 0.0) gaussian = np.exp(-((d - mu) ** 2 / (2.0 * sigma ** 2))) img = binarize_mat(gaussian) self.assertEqual(len(np.uni...
Image normalizer tester.
TestNormalizer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestNormalizer: """Image normalizer tester.""" def test_binarize(self): """Test image binarizer.""" <|body_0|> def visualize_ts(self, img): """Visualize the ts space representation of an image, points with a value of 1 will be converted to ts space. Parameters --...
stack_v2_sparse_classes_36k_train_031682
1,362
no_license
[ { "docstring": "Test image binarizer.", "name": "test_binarize", "signature": "def test_binarize(self)" }, { "docstring": "Visualize the ts space representation of an image, points with a value of 1 will be converted to ts space. Parameters ---------- img: opencv mat Image to be converted to ts ...
2
stack_v2_sparse_classes_30k_train_009979
Implement the Python class `TestNormalizer` described below. Class description: Image normalizer tester. Method signatures and docstrings: - def test_binarize(self): Test image binarizer. - def visualize_ts(self, img): Visualize the ts space representation of an image, points with a value of 1 will be converted to ts...
Implement the Python class `TestNormalizer` described below. Class description: Image normalizer tester. Method signatures and docstrings: - def test_binarize(self): Test image binarizer. - def visualize_ts(self, img): Visualize the ts space representation of an image, points with a value of 1 will be converted to ts...
6228d8a4f0396b422b2803f24873070ea5c8b4e1
<|skeleton|> class TestNormalizer: """Image normalizer tester.""" def test_binarize(self): """Test image binarizer.""" <|body_0|> def visualize_ts(self, img): """Visualize the ts space representation of an image, points with a value of 1 will be converted to ts space. Parameters --...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestNormalizer: """Image normalizer tester.""" def test_binarize(self): """Test image binarizer.""" SIZE = 512 x, y = np.meshgrid(np.linspace(-1, 1, SIZE), np.linspace(-1, 1, SIZE)) d = np.sqrt(x ** 2 + y ** 2) sigma, mu = (1.0, 0.0) gaussian = np.exp(-((d ...
the_stack_v2_python_sparse
vision/unit_tests/test_normalize.py
MissouriMRR/IARC-2019
train
6
d31134d6d03f1a33bffb33e259ea0347f0e0f75b
[ "HTTPBasicAuthHandler.__init__(self, *args, **kwargs)\nself._tried_login = False\nself._otp_token_method = None\nself._otp_token_attempts = 0\nself._last_otp_token = None", "otp_header = headers.get(self.OTP_TOKEN_HEADER, '')\nif otp_header and otp_header.startswith('required'):\n try:\n self._otp_token...
<|body_start_0|> HTTPBasicAuthHandler.__init__(self, *args, **kwargs) self._tried_login = False self._otp_token_method = None self._otp_token_attempts = 0 self._last_otp_token = None <|end_body_0|> <|body_start_1|> otp_header = headers.get(self.OTP_TOKEN_HEADER, '') ...
Custom Basic Auth handler that doesn't retry excessively. urllib's HTTPBasicAuthHandler retries over and over, which is useless. This subclass only retries once to make sure we've attempted with a valid username and password. It will then fail so we can use our own retry handler. This also supports two-factor auth, for...
ReviewBoardHTTPBasicAuthHandler
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReviewBoardHTTPBasicAuthHandler: """Custom Basic Auth handler that doesn't retry excessively. urllib's HTTPBasicAuthHandler retries over and over, which is useless. This subclass only retries once to make sure we've attempted with a valid username and password. It will then fail so we can use our...
stack_v2_sparse_classes_36k_train_031683
29,345
permissive
[ { "docstring": "Initialize the Basic Auth handler. Args: *args (tuple): Positional arguments to pass to the parent class. **kwargs (dict): Keyword arguments to pass to the parent class.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Handle an HTTP 401...
3
null
Implement the Python class `ReviewBoardHTTPBasicAuthHandler` described below. Class description: Custom Basic Auth handler that doesn't retry excessively. urllib's HTTPBasicAuthHandler retries over and over, which is useless. This subclass only retries once to make sure we've attempted with a valid username and passwo...
Implement the Python class `ReviewBoardHTTPBasicAuthHandler` described below. Class description: Custom Basic Auth handler that doesn't retry excessively. urllib's HTTPBasicAuthHandler retries over and over, which is useless. This subclass only retries once to make sure we've attempted with a valid username and passwo...
b106c84c274c59f7944ba5bf7706d865c78a3408
<|skeleton|> class ReviewBoardHTTPBasicAuthHandler: """Custom Basic Auth handler that doesn't retry excessively. urllib's HTTPBasicAuthHandler retries over and over, which is useless. This subclass only retries once to make sure we've attempted with a valid username and password. It will then fail so we can use our...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ReviewBoardHTTPBasicAuthHandler: """Custom Basic Auth handler that doesn't retry excessively. urllib's HTTPBasicAuthHandler retries over and over, which is useless. This subclass only retries once to make sure we've attempted with a valid username and password. It will then fail so we can use our own retry ha...
the_stack_v2_python_sparse
rbtools/api/request.py
anirudha-banerjee/rbtools
train
1
6190f73c9b46a8789549bcd0427fc8cae5ed743c
[ "self.conf = conf\nself.kwarg = kwargs\nself.last_status_code = None\nself.last_exception = None\nif 'timeout' not in self.kwarg:\n self.kwarg['timeout'] = self.conf['timeout']", "retries = self.conf['retries']\nwhile retries > 0:\n try:\n response = requests.get(url, **self.kwarg)\n return re...
<|body_start_0|> self.conf = conf self.kwarg = kwargs self.last_status_code = None self.last_exception = None if 'timeout' not in self.kwarg: self.kwarg['timeout'] = self.conf['timeout'] <|end_body_0|> <|body_start_1|> retries = self.conf['retries'] w...
This class enables easy usage of request module. Its main feature is trying to connect multiple times before throwing an exception.
Scraper
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Scraper: """This class enables easy usage of request module. Its main feature is trying to connect multiple times before throwing an exception.""" def __init__(self, conf, **kwargs): """This __init__ sets the necessary arguments for connecting with request. Args: conf (dict): This di...
stack_v2_sparse_classes_36k_train_031684
3,023
no_license
[ { "docstring": "This __init__ sets the necessary arguments for connecting with request. Args: conf (dict): This dict contains scraper configuration. **kwargs: Request arguments.", "name": "__init__", "signature": "def __init__(self, conf, **kwargs)" }, { "docstring": "Try to get a response from ...
5
stack_v2_sparse_classes_30k_train_013042
Implement the Python class `Scraper` described below. Class description: This class enables easy usage of request module. Its main feature is trying to connect multiple times before throwing an exception. Method signatures and docstrings: - def __init__(self, conf, **kwargs): This __init__ sets the necessary argument...
Implement the Python class `Scraper` described below. Class description: This class enables easy usage of request module. Its main feature is trying to connect multiple times before throwing an exception. Method signatures and docstrings: - def __init__(self, conf, **kwargs): This __init__ sets the necessary argument...
51bf1b08aaf75373c9e9e88a41d5df154f675160
<|skeleton|> class Scraper: """This class enables easy usage of request module. Its main feature is trying to connect multiple times before throwing an exception.""" def __init__(self, conf, **kwargs): """This __init__ sets the necessary arguments for connecting with request. Args: conf (dict): This di...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Scraper: """This class enables easy usage of request module. Its main feature is trying to connect multiple times before throwing an exception.""" def __init__(self, conf, **kwargs): """This __init__ sets the necessary arguments for connecting with request. Args: conf (dict): This dict contains s...
the_stack_v2_python_sparse
python_package/pytraffic/collectors/util/scraper.py
robertcv/DICE-BigData-Traffic
train
0
3aba6aa9e4795f157e89b4b3bf5f188091d6b390
[ "super().__init__(data, *args, **kwargs)\nif user is None:\n raise TypeError(\"'user' argument must not be None\")\nself.user = user", "if not self.user.check_password(self.cleaned_data['password']):\n raise forms.ValidationError(_('Please enter the correct password!'))\nreturn self.cleaned_data['password']...
<|body_start_0|> super().__init__(data, *args, **kwargs) if user is None: raise TypeError("'user' argument must not be None") self.user = user <|end_body_0|> <|body_start_1|> if not self.user.check_password(self.cleaned_data['password']): raise forms.ValidationEr...
Simple form with one password field for confirmation when deleting a Team.
DeleteForm
[ "MIT", "ISC" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DeleteForm: """Simple form with one password field for confirmation when deleting a Team.""" def __init__(self, data=None, *args, user=None, **kwargs): """Custom initializer which takes the user account to be deleted as an additional argument.""" <|body_0|> def clean_pas...
stack_v2_sparse_classes_36k_train_031685
8,844
permissive
[ { "docstring": "Custom initializer which takes the user account to be deleted as an additional argument.", "name": "__init__", "signature": "def __init__(self, data=None, *args, user=None, **kwargs)" }, { "docstring": "Ensures that the entered password is valid for the specified user account.", ...
2
stack_v2_sparse_classes_30k_train_014403
Implement the Python class `DeleteForm` described below. Class description: Simple form with one password field for confirmation when deleting a Team. Method signatures and docstrings: - def __init__(self, data=None, *args, user=None, **kwargs): Custom initializer which takes the user account to be deleted as an addi...
Implement the Python class `DeleteForm` described below. Class description: Simple form with one password field for confirmation when deleting a Team. Method signatures and docstrings: - def __init__(self, data=None, *args, user=None, **kwargs): Custom initializer which takes the user account to be deleted as an addi...
03e0d0377e9687c60dd0454c1c1dc0efb5151bff
<|skeleton|> class DeleteForm: """Simple form with one password field for confirmation when deleting a Team.""" def __init__(self, data=None, *args, user=None, **kwargs): """Custom initializer which takes the user account to be deleted as an additional argument.""" <|body_0|> def clean_pas...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DeleteForm: """Simple form with one password field for confirmation when deleting a Team.""" def __init__(self, data=None, *args, user=None, **kwargs): """Custom initializer which takes the user account to be deleted as an additional argument.""" super().__init__(data, *args, **kwargs) ...
the_stack_v2_python_sparse
src/ctf_gameserver/web/registration/forms.py
fausecteam/ctf-gameserver
train
43
4f71fa459c4bca6fea712763a181b5c51296e448
[ "self.config = lib.get_config()\nself.logger = lib.get_logger()\nself.color_gpio = self.config['simon']['colors']\nself.color_detectors = dict()\nfor color in self.color_gpio:\n self.color_detectors[color] = bbb.mod.GPIO(self.color_gpio[color])\nself.pot = Pot('pot1', self.color_detectors)\nfor d in self.color_d...
<|body_start_0|> self.config = lib.get_config() self.logger = lib.get_logger() self.color_gpio = self.config['simon']['colors'] self.color_detectors = dict() for color in self.color_gpio: self.color_detectors[color] = bbb.mod.GPIO(self.color_gpio[color]) self....
LightDetector
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LightDetector: def __init(self): """Sets up the light detecting hardware.""" <|body_0|> def read_all(self): """read current value from all four detectors. :return: dict {"red":<val>, "green":<val>, "blue":<val>, "yellow":<val>}""" <|body_1|> def read_inp...
stack_v2_sparse_classes_36k_train_031686
1,488
permissive
[ { "docstring": "Sets up the light detecting hardware.", "name": "__init", "signature": "def __init(self)" }, { "docstring": "read current value from all four detectors. :return: dict {\"red\":<val>, \"green\":<val>, \"blue\":<val>, \"yellow\":<val>}", "name": "read_all", "signature": "de...
3
stack_v2_sparse_classes_30k_train_009541
Implement the Python class `LightDetector` described below. Class description: Implement the LightDetector class. Method signatures and docstrings: - def __init(self): Sets up the light detecting hardware. - def read_all(self): read current value from all four detectors. :return: dict {"red":<val>, "green":<val>, "bl...
Implement the Python class `LightDetector` described below. Class description: Implement the LightDetector class. Method signatures and docstrings: - def __init(self): Sets up the light detecting hardware. - def read_all(self): read current value from all four detectors. :return: dict {"red":<val>, "green":<val>, "bl...
96908d2f4d8cd652d8bfc98416c45ea9f5cefc3a
<|skeleton|> class LightDetector: def __init(self): """Sets up the light detecting hardware.""" <|body_0|> def read_all(self): """read current value from all four detectors. :return: dict {"red":<val>, "green":<val>, "blue":<val>, "yellow":<val>}""" <|body_1|> def read_inp...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LightDetector: def __init(self): """Sets up the light detecting hardware.""" self.config = lib.get_config() self.logger = lib.get_logger() self.color_gpio = self.config['simon']['colors'] self.color_detectors = dict() for color in self.color_gpio: se...
the_stack_v2_python_sparse
bot/hardware/lightDetector.py
imohame/bot
train
0
6ed0931aa391e0ed7a075e0203ae4e836df71b01
[ "self.width = width\nself.progress = progress\nself.last_status = ''\nself.time = time\nself.start_time = perf_counter() if time else None\nself.update(progress, skip_erase=True)", "self.progress = progress\nif self.time:\n now = perf_counter()\n elapsed = self.format_time(now - self.start_time)\n remain...
<|body_start_0|> self.width = width self.progress = progress self.last_status = '' self.time = time self.start_time = perf_counter() if time else None self.update(progress, skip_erase=True) <|end_body_0|> <|body_start_1|> self.progress = progress if self....
A command-line progress bar.
ProgressBar
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProgressBar: """A command-line progress bar.""" def __init__(self, width=50, progress=0, time=False): """Create a progress bar. This writes it to the console.""" <|body_0|> def update(self, progress, status='', skip_erase=False): """Update the progress bar, rewri...
stack_v2_sparse_classes_36k_train_031687
4,529
no_license
[ { "docstring": "Create a progress bar. This writes it to the console.", "name": "__init__", "signature": "def __init__(self, width=50, progress=0, time=False)" }, { "docstring": "Update the progress bar, rewriting it to the console.", "name": "update", "signature": "def update(self, prog...
4
null
Implement the Python class `ProgressBar` described below. Class description: A command-line progress bar. Method signatures and docstrings: - def __init__(self, width=50, progress=0, time=False): Create a progress bar. This writes it to the console. - def update(self, progress, status='', skip_erase=False): Update th...
Implement the Python class `ProgressBar` described below. Class description: A command-line progress bar. Method signatures and docstrings: - def __init__(self, width=50, progress=0, time=False): Create a progress bar. This writes it to the console. - def update(self, progress, status='', skip_erase=False): Update th...
cb87ccf8d77244c92ea57148124e9aa8654d2a46
<|skeleton|> class ProgressBar: """A command-line progress bar.""" def __init__(self, width=50, progress=0, time=False): """Create a progress bar. This writes it to the console.""" <|body_0|> def update(self, progress, status='', skip_erase=False): """Update the progress bar, rewri...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProgressBar: """A command-line progress bar.""" def __init__(self, width=50, progress=0, time=False): """Create a progress bar. This writes it to the console.""" self.width = width self.progress = progress self.last_status = '' self.time = time self.start_t...
the_stack_v2_python_sparse
hw2/src/helpers.py
ariporad/FAI
train
0
2779914145f1d58dc6ad77af9955395c51c9336c
[ "self.sdo_data = sdo_data\nself.external_reference = external_reference\nself.fetch_ssn = fetch_ssn\nself.additional_properties = additional_properties", "if dictionary is None:\n return None\nsdo_data = dictionary.get('sdoData')\nexternal_reference = dictionary.get('externalReference')\nfetch_ssn = dictionary...
<|body_start_0|> self.sdo_data = sdo_data self.external_reference = external_reference self.fetch_ssn = fetch_ssn self.additional_properties = additional_properties <|end_body_0|> <|body_start_1|> if dictionary is None: return None sdo_data = dictionary.get('...
Implementation of the 'ParseSDORequest' model. TODO: type model description here. Attributes: sdo_data (string): Base 64 encoded SDO (Signed document) external_reference (string): The service reference for the signing. Will be used for auditlog, and invoicing fetch_ssn (bool): Fetch social security number (Requires val...
ParseSDORequest
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ParseSDORequest: """Implementation of the 'ParseSDORequest' model. TODO: type model description here. Attributes: sdo_data (string): Base 64 encoded SDO (Signed document) external_reference (string): The service reference for the signing. Will be used for auditlog, and invoicing fetch_ssn (bool):...
stack_v2_sparse_classes_36k_train_031688
2,474
permissive
[ { "docstring": "Constructor for the ParseSDORequest class", "name": "__init__", "signature": "def __init__(self, sdo_data=None, external_reference=None, fetch_ssn=None, additional_properties={})" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary)...
2
null
Implement the Python class `ParseSDORequest` described below. Class description: Implementation of the 'ParseSDORequest' model. TODO: type model description here. Attributes: sdo_data (string): Base 64 encoded SDO (Signed document) external_reference (string): The service reference for the signing. Will be used for au...
Implement the Python class `ParseSDORequest` described below. Class description: Implementation of the 'ParseSDORequest' model. TODO: type model description here. Attributes: sdo_data (string): Base 64 encoded SDO (Signed document) external_reference (string): The service reference for the signing. Will be used for au...
fa3918a6c54ea0eedb9146578645b7eb1755b642
<|skeleton|> class ParseSDORequest: """Implementation of the 'ParseSDORequest' model. TODO: type model description here. Attributes: sdo_data (string): Base 64 encoded SDO (Signed document) external_reference (string): The service reference for the signing. Will be used for auditlog, and invoicing fetch_ssn (bool):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ParseSDORequest: """Implementation of the 'ParseSDORequest' model. TODO: type model description here. Attributes: sdo_data (string): Base 64 encoded SDO (Signed document) external_reference (string): The service reference for the signing. Will be used for auditlog, and invoicing fetch_ssn (bool): Fetch social...
the_stack_v2_python_sparse
idfy_rest_client/models/parse_sdo_request.py
dealflowteam/Idfy
train
0
a5843c092b533200e039c8b9013af4c99543248a
[ "lengths = [len(s) for s in strs]\nnstrs = len(strs)\nencoded = str(nstrs) + '|' + '|'.join([str(l) for l in lengths]) + '|'\nencoded += ''.join(strs)\nreturn encoded", "i, j = (0, 0)\nwhile s[j] != '|':\n j += 1\nnstrs = int(s[i:j])\ni = j + 1\nj += 1\nlengths = list()\nfor _ in range(nstrs):\n while s[j] ...
<|body_start_0|> lengths = [len(s) for s in strs] nstrs = len(strs) encoded = str(nstrs) + '|' + '|'.join([str(l) for l in lengths]) + '|' encoded += ''.join(strs) return encoded <|end_body_0|> <|body_start_1|> i, j = (0, 0) while s[j] != '|': j += 1 ...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def encode(self, strs: [str]) -> str: """Encodes a list of strings to a single string.""" <|body_0|> def decode(self, s: str) -> [str]: """Decodes a single string to a list of strings.""" <|body_1|> <|end_skeleton|> <|body_start_0|> lengths =...
stack_v2_sparse_classes_36k_train_031689
995
no_license
[ { "docstring": "Encodes a list of strings to a single string.", "name": "encode", "signature": "def encode(self, strs: [str]) -> str" }, { "docstring": "Decodes a single string to a list of strings.", "name": "decode", "signature": "def decode(self, s: str) -> [str]" } ]
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def encode(self, strs: [str]) -> str: Encodes a list of strings to a single string. - def decode(self, s: str) -> [str]: Decodes a single string to a list of strings.
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def encode(self, strs: [str]) -> str: Encodes a list of strings to a single string. - def decode(self, s: str) -> [str]: Decodes a single string to a list of strings. <|skeleton|> cla...
78ed11f34fd03e9a188c9c6cb352e883016d05d9
<|skeleton|> class Codec: def encode(self, strs: [str]) -> str: """Encodes a list of strings to a single string.""" <|body_0|> def decode(self, s: str) -> [str]: """Decodes a single string to a list of strings.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def encode(self, strs: [str]) -> str: """Encodes a list of strings to a single string.""" lengths = [len(s) for s in strs] nstrs = len(strs) encoded = str(nstrs) + '|' + '|'.join([str(l) for l in lengths]) + '|' encoded += ''.join(strs) return encoded ...
the_stack_v2_python_sparse
271_Encode_and_Decode_Strings.py
26XINXIN/leetcode
train
0
09d3a4dd719a692522aa0b105199cf0e5108e1bf
[ "count0 = 0\ncount1 = 0\ncount2 = 0\nfor i in nums:\n if i == 0:\n count0 += 1\n if i == 1:\n count1 += 1\n if i == 2:\n count2 += 1\nnums[0:count0] = [0 for _ in range(count0)]\nnums[count0:count0 + count1] = [1 for _ in range(count1)]\nnums[count0 + count1:count0 + count1 + count2] =...
<|body_start_0|> count0 = 0 count1 = 0 count2 = 0 for i in nums: if i == 0: count0 += 1 if i == 1: count1 += 1 if i == 2: count2 += 1 nums[0:count0] = [0 for _ in range(count0)] nums[count...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def sortColors(self, nums) -> None: """Do not return anything, modify nums in-place instead.""" <|body_0|> def sortColors2(self, nums) -> None: """Do not return anything, modify nums in-place instead.""" <|body_1|> <|end_skeleton|> <|body_start_0|...
stack_v2_sparse_classes_36k_train_031690
1,211
no_license
[ { "docstring": "Do not return anything, modify nums in-place instead.", "name": "sortColors", "signature": "def sortColors(self, nums) -> None" }, { "docstring": "Do not return anything, modify nums in-place instead.", "name": "sortColors2", "signature": "def sortColors2(self, nums) -> N...
2
stack_v2_sparse_classes_30k_train_020665
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def sortColors(self, nums) -> None: Do not return anything, modify nums in-place instead. - def sortColors2(self, nums) -> None: Do not return anything, modify nums in-place inst...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def sortColors(self, nums) -> None: Do not return anything, modify nums in-place instead. - def sortColors2(self, nums) -> None: Do not return anything, modify nums in-place inst...
39d765c4580fcb0d411c485213232bb404447f11
<|skeleton|> class Solution: def sortColors(self, nums) -> None: """Do not return anything, modify nums in-place instead.""" <|body_0|> def sortColors2(self, nums) -> None: """Do not return anything, modify nums in-place instead.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def sortColors(self, nums) -> None: """Do not return anything, modify nums in-place instead.""" count0 = 0 count1 = 0 count2 = 0 for i in nums: if i == 0: count0 += 1 if i == 1: count1 += 1 if...
the_stack_v2_python_sparse
num75.py
wuchenxi118/lc
train
0
c8f08f4e6f6571f8ee62ee8afd601ed7ebd2e0cb
[ "def neighbors(i, j):\n if i > 0:\n yield (i - 1, j)\n if j > 0:\n yield (i, j - 1)\n if i < len(matrix) - 1:\n yield (i + 1, j)\n if j < len(matrix[0]) - 1:\n yield (i, j + 1)\nmemo = [[0] * len(matrix[0]) for _ in matrix]\n\ndef dfs(i, j):\n if memo[i][j] != 0:\n ...
<|body_start_0|> def neighbors(i, j): if i > 0: yield (i - 1, j) if j > 0: yield (i, j - 1) if i < len(matrix) - 1: yield (i + 1, j) if j < len(matrix[0]) - 1: yield (i, j + 1) memo = [[0] * l...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longestIncreasingPath(self, matrix: List[List[int]]) -> int: """10/01/2020 19:52""" <|body_0|> def longestIncreasingPath(self, matrix: List[List[int]]) -> int: """04/29/2021 10:00 DFS from each cell leveraging cache Time complexity: O(m*n) Space complex...
stack_v2_sparse_classes_36k_train_031691
4,753
no_license
[ { "docstring": "10/01/2020 19:52", "name": "longestIncreasingPath", "signature": "def longestIncreasingPath(self, matrix: List[List[int]]) -> int" }, { "docstring": "04/29/2021 10:00 DFS from each cell leveraging cache Time complexity: O(m*n) Space complexity: O(m*n)", "name": "longestIncrea...
4
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestIncreasingPath(self, matrix: List[List[int]]) -> int: 10/01/2020 19:52 - def longestIncreasingPath(self, matrix: List[List[int]]) -> int: 04/29/2021 10:00 DFS from eac...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestIncreasingPath(self, matrix: List[List[int]]) -> int: 10/01/2020 19:52 - def longestIncreasingPath(self, matrix: List[List[int]]) -> int: 04/29/2021 10:00 DFS from eac...
1389a009a02e90e8700a7a00e0b7f797c129cdf4
<|skeleton|> class Solution: def longestIncreasingPath(self, matrix: List[List[int]]) -> int: """10/01/2020 19:52""" <|body_0|> def longestIncreasingPath(self, matrix: List[List[int]]) -> int: """04/29/2021 10:00 DFS from each cell leveraging cache Time complexity: O(m*n) Space complex...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def longestIncreasingPath(self, matrix: List[List[int]]) -> int: """10/01/2020 19:52""" def neighbors(i, j): if i > 0: yield (i - 1, j) if j > 0: yield (i, j - 1) if i < len(matrix) - 1: yield (i + 1,...
the_stack_v2_python_sparse
leetcode/solved/329_Longest_Increasing_Path_in_a_Matrix/solution.py
sungminoh/algorithms
train
0
2f6fc69f1cf0df52636e94f11100818f7ff3d96c
[ "filetypes = (('text files', '*.txt'), ('pcd files', '*.pcd'), ('ply files', '*.ply'), ('All files', '*.*'))\nselectedFile = filedialog.askopenfilename(title='Open a file', initialdir='.', filetypes=filetypes)\nif selectedFile == None or selectedFile == () or selectedFile == '':\n return\nself.selectedFile = sel...
<|body_start_0|> filetypes = (('text files', '*.txt'), ('pcd files', '*.pcd'), ('ply files', '*.ply'), ('All files', '*.*')) selectedFile = filedialog.askopenfilename(title='Open a file', initialdir='.', filetypes=filetypes) if selectedFile == None or selectedFile == () or selectedFile == '': ...
:Description: window to allow the user to select a file from their filesystem along with its exact format
FileSelect
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileSelect: """:Description: window to allow the user to select a file from their filesystem along with its exact format""" def select_file(self): """:Description: prompt the user to select a file from their filesystem""" <|body_0|> def runCloseFunction(self): ""...
stack_v2_sparse_classes_36k_train_031692
3,573
no_license
[ { "docstring": ":Description: prompt the user to select a file from their filesystem", "name": "select_file", "signature": "def select_file(self)" }, { "docstring": ":Description: run the specified callback function when the window is closed", "name": "runCloseFunction", "signature": "de...
3
stack_v2_sparse_classes_30k_train_016912
Implement the Python class `FileSelect` described below. Class description: :Description: window to allow the user to select a file from their filesystem along with its exact format Method signatures and docstrings: - def select_file(self): :Description: prompt the user to select a file from their filesystem - def ru...
Implement the Python class `FileSelect` described below. Class description: :Description: window to allow the user to select a file from their filesystem along with its exact format Method signatures and docstrings: - def select_file(self): :Description: prompt the user to select a file from their filesystem - def ru...
8dda8fc474f3af1fe7ed611c801a541b1723b985
<|skeleton|> class FileSelect: """:Description: window to allow the user to select a file from their filesystem along with its exact format""" def select_file(self): """:Description: prompt the user to select a file from their filesystem""" <|body_0|> def runCloseFunction(self): ""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileSelect: """:Description: window to allow the user to select a file from their filesystem along with its exact format""" def select_file(self): """:Description: prompt the user to select a file from their filesystem""" filetypes = (('text files', '*.txt'), ('pcd files', '*.pcd'), ('ply...
the_stack_v2_python_sparse
src/GUI/file_select.py
nchaconbgeo/pointcloudpackage
train
1
ba47d5cff5803b1ab354517493b6c1d14210dc85
[ "self._cache_whitelist = set(benchmark_setup['cache_whitelist'])\nself._original_requests = set(cache_validation_result['effective_encoded_data_lengths'].keys())\nself._original_post_requests = set(cache_validation_result['effective_post_requests'])\nself._original_cached_requests = self._original_requests.intersec...
<|body_start_0|> self._cache_whitelist = set(benchmark_setup['cache_whitelist']) self._original_requests = set(cache_validation_result['effective_encoded_data_lengths'].keys()) self._original_post_requests = set(cache_validation_result['effective_post_requests']) self._original_cached_re...
Object to verify benchmark run from traces and WPR log stored in the runner output directory.
_RunOutputVerifier
[ "BSD-3-Clause", "LGPL-2.0-or-later", "LicenseRef-scancode-unknown-license-reference", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-unknown", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _RunOutputVerifier: """Object to verify benchmark run from traces and WPR log stored in the runner output directory.""" def __init__(self, cache_validation_result, benchmark_setup): """Constructor. Args: cache_validation_result: JSON of the cache validation task. benchmark_setup: JSO...
stack_v2_sparse_classes_36k_train_031693
28,927
permissive
[ { "docstring": "Constructor. Args: cache_validation_result: JSON of the cache validation task. benchmark_setup: JSON of the benchmark setup.", "name": "__init__", "signature": "def __init__(self, cache_validation_result, benchmark_setup)" }, { "docstring": "Verifies a trace with the cache valida...
3
stack_v2_sparse_classes_30k_train_012694
Implement the Python class `_RunOutputVerifier` described below. Class description: Object to verify benchmark run from traces and WPR log stored in the runner output directory. Method signatures and docstrings: - def __init__(self, cache_validation_result, benchmark_setup): Constructor. Args: cache_validation_result...
Implement the Python class `_RunOutputVerifier` described below. Class description: Object to verify benchmark run from traces and WPR log stored in the runner output directory. Method signatures and docstrings: - def __init__(self, cache_validation_result, benchmark_setup): Constructor. Args: cache_validation_result...
72a05af97787001756bae2511b7985e61498c965
<|skeleton|> class _RunOutputVerifier: """Object to verify benchmark run from traces and WPR log stored in the runner output directory.""" def __init__(self, cache_validation_result, benchmark_setup): """Constructor. Args: cache_validation_result: JSON of the cache validation task. benchmark_setup: JSO...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _RunOutputVerifier: """Object to verify benchmark run from traces and WPR log stored in the runner output directory.""" def __init__(self, cache_validation_result, benchmark_setup): """Constructor. Args: cache_validation_result: JSON of the cache validation task. benchmark_setup: JSON of the benc...
the_stack_v2_python_sparse
tools/android/loading/sandwich_prefetch.py
metux/chromium-suckless
train
5
b788c401a0d172e09009ea433b224665ee1c62da
[ "super().__init__(device=device, env=env, tx_conn=tx_conn, topics_to_subs=topics_to_subs)\nself.done = False\nself.stop_queue = stop_queue\nself.received_event = False", "ev = DummyServiceEvent(self.env, 'aa:aa:aa:aa:aa:aa', 'dummy_value')\nyield self.async_wait_for_event(ev)\nself.received_event = True\nself.sto...
<|body_start_0|> super().__init__(device=device, env=env, tx_conn=tx_conn, topics_to_subs=topics_to_subs) self.done = False self.stop_queue = stop_queue self.received_event = False <|end_body_0|> <|body_start_1|> ev = DummyServiceEvent(self.env, 'aa:aa:aa:aa:aa:aa', 'dummy_value...
WaiterService
[ "Apache-2.0", "GPL-1.0-or-later", "GPL-2.0-or-later", "GPL-2.0-only" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WaiterService: def __init__(self, device, env, tx_conn, topics_to_subs, stop_queue): """Instanciate a Dummy WirelessService that waits for Events to happen. Args: device: WirelessDevice that owns the service env: simpy environment tx_conn: Connection (e.g. pipe end with 'send' method) us...
stack_v2_sparse_classes_36k_train_031694
4,078
permissive
[ { "docstring": "Instanciate a Dummy WirelessService that waits for Events to happen. Args: device: WirelessDevice that owns the service env: simpy environment tx_conn: Connection (e.g. pipe end with 'send' method) used to send packets.", "name": "__init__", "signature": "def __init__(self, device, env, ...
2
stack_v2_sparse_classes_30k_train_018274
Implement the Python class `WaiterService` described below. Class description: Implement the WaiterService class. Method signatures and docstrings: - def __init__(self, device, env, tx_conn, topics_to_subs, stop_queue): Instanciate a Dummy WirelessService that waits for Events to happen. Args: device: WirelessDevice ...
Implement the Python class `WaiterService` described below. Class description: Implement the WaiterService class. Method signatures and docstrings: - def __init__(self, device, env, tx_conn, topics_to_subs, stop_queue): Instanciate a Dummy WirelessService that waits for Events to happen. Args: device: WirelessDevice ...
3a6d63af1ff468f94887a091e3a408a8449cf832
<|skeleton|> class WaiterService: def __init__(self, device, env, tx_conn, topics_to_subs, stop_queue): """Instanciate a Dummy WirelessService that waits for Events to happen. Args: device: WirelessDevice that owns the service env: simpy environment tx_conn: Connection (e.g. pipe end with 'send' method) us...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WaiterService: def __init__(self, device, env, tx_conn, topics_to_subs, stop_queue): """Instanciate a Dummy WirelessService that waits for Events to happen. Args: device: WirelessDevice that owns the service env: simpy environment tx_conn: Connection (e.g. pipe end with 'send' method) used to send pac...
the_stack_v2_python_sparse
scripts/automation/trex_control_plane/interactive/trex/wireless/services/unit_tests/wireless_service_event_test.py
elados93/trex-core
train
1
7a64897f4330d833ad9b04294c4e0fb4de834ad5
[ "super(GibbsSamplingInference, self).__init__(model)\nself.traces = {}\nself._initial_values = initial_values\nself._samples = samples\nself._burn_in = burn_in\nself._callback = callback", "if self._initial_values:\n self.traces = {variable: [initial_value] for variable, initial_value in self._initial_values.i...
<|body_start_0|> super(GibbsSamplingInference, self).__init__(model) self.traces = {} self._initial_values = initial_values self._samples = samples self._burn_in = burn_in self._callback = callback <|end_body_0|> <|body_start_1|> if self._initial_values: ...
An inference object to calibrate the potentials.
GibbsSamplingInference
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GibbsSamplingInference: """An inference object to calibrate the potentials.""" def __init__(self, model, initial_values=None, samples=1000, burn_in=100, callback=None): """Constructor. :param model: The model.""" <|body_0|> def _calibrate(self, evidence): """Cali...
stack_v2_sparse_classes_36k_train_031695
3,924
permissive
[ { "docstring": "Constructor. :param model: The model.", "name": "__init__", "signature": "def __init__(self, model, initial_values=None, samples=1000, burn_in=100, callback=None)" }, { "docstring": "Calibrate all the factors in the model.", "name": "_calibrate", "signature": "def _calibr...
3
stack_v2_sparse_classes_30k_train_001286
Implement the Python class `GibbsSamplingInference` described below. Class description: An inference object to calibrate the potentials. Method signatures and docstrings: - def __init__(self, model, initial_values=None, samples=1000, burn_in=100, callback=None): Constructor. :param model: The model. - def _calibrate(...
Implement the Python class `GibbsSamplingInference` described below. Class description: An inference object to calibrate the potentials. Method signatures and docstrings: - def __init__(self, model, initial_values=None, samples=1000, burn_in=100, callback=None): Constructor. :param model: The model. - def _calibrate(...
445b2cf8736a4a28cff2b074a32afe8fe6986d53
<|skeleton|> class GibbsSamplingInference: """An inference object to calibrate the potentials.""" def __init__(self, model, initial_values=None, samples=1000, burn_in=100, callback=None): """Constructor. :param model: The model.""" <|body_0|> def _calibrate(self, evidence): """Cali...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GibbsSamplingInference: """An inference object to calibrate the potentials.""" def __init__(self, model, initial_values=None, samples=1000, burn_in=100, callback=None): """Constructor. :param model: The model.""" super(GibbsSamplingInference, self).__init__(model) self.traces = {}...
the_stack_v2_python_sparse
Statistical_methods/LoopyBeliefPropagation/pyugm/infer_sampling.py
WN1695173791/Background-Subtraction-Unsupervised-Learning
train
1
e00d6c369bcfcecdd10a257d4e9da71a74ec6b10
[ "self.predictions = class_counts(data, classCol)\nkeys = self.predictions.keys()\nls = []\nfor key in keys:\n ls.append([key, self.predictions[key]])\nls.sort(key=lambda x: x[1], reverse=True)\nself.mostLikely = ls[0][0]", "keys = self.predictions.keys()\nvalues = self.predictions.values()\ntotal = sum(values)...
<|body_start_0|> self.predictions = class_counts(data, classCol) keys = self.predictions.keys() ls = [] for key in keys: ls.append([key, self.predictions[key]]) ls.sort(key=lambda x: x[1], reverse=True) self.mostLikely = ls[0][0] <|end_body_0|> <|body_start_1...
A leaf of a decision tree aka the very bottom node.
Leaf
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Leaf: """A leaf of a decision tree aka the very bottom node.""" def __init__(self, data, classCol): """The constructor for a leaf object Key word arguments: data: self explanatory classCol: The index for each rpw that the class is on""" <|body_0|> def getAllChances(self)...
stack_v2_sparse_classes_36k_train_031696
15,954
no_license
[ { "docstring": "The constructor for a leaf object Key word arguments: data: self explanatory classCol: The index for each rpw that the class is on", "name": "__init__", "signature": "def __init__(self, data, classCol)" }, { "docstring": "Gets the chances for each class to be in the leaf.", "...
2
stack_v2_sparse_classes_30k_test_001196
Implement the Python class `Leaf` described below. Class description: A leaf of a decision tree aka the very bottom node. Method signatures and docstrings: - def __init__(self, data, classCol): The constructor for a leaf object Key word arguments: data: self explanatory classCol: The index for each rpw that the class...
Implement the Python class `Leaf` described below. Class description: A leaf of a decision tree aka the very bottom node. Method signatures and docstrings: - def __init__(self, data, classCol): The constructor for a leaf object Key word arguments: data: self explanatory classCol: The index for each rpw that the class...
0022c0bee14cdc3a773c0fe60d196cb12a0dd9f0
<|skeleton|> class Leaf: """A leaf of a decision tree aka the very bottom node.""" def __init__(self, data, classCol): """The constructor for a leaf object Key word arguments: data: self explanatory classCol: The index for each rpw that the class is on""" <|body_0|> def getAllChances(self)...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Leaf: """A leaf of a decision tree aka the very bottom node.""" def __init__(self, data, classCol): """The constructor for a leaf object Key word arguments: data: self explanatory classCol: The index for each rpw that the class is on""" self.predictions = class_counts(data, classCol) ...
the_stack_v2_python_sparse
random forest tree/InsuranceClaimPrediction.py
ShaaficiAli/PersonalProjects
train
0
2d9b0e4ac0596a74cd5b7d4f4f3be33a071d72ad
[ "fieldsets = super().get_fieldsets(request, obj)\nfieldsets += ((_('Extra info'), {'fields': ['created', 'modified']}),)\nreturn fieldsets", "readonly_fields = super().get_readonly_fields(request, obj)\nreadonly_fields = readonly_fields + ('created', 'modified')\nif not self.create_only_fields or not obj:\n re...
<|body_start_0|> fieldsets = super().get_fieldsets(request, obj) fieldsets += ((_('Extra info'), {'fields': ['created', 'modified']}),) return fieldsets <|end_body_0|> <|body_start_1|> readonly_fields = super().get_readonly_fields(request, obj) readonly_fields = readonly_fields ...
Base admin representation.
BaseAdmin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseAdmin: """Base admin representation.""" def get_fieldsets(self, request, obj=None): """Add created and modified to fieldsets.""" <|body_0|> def get_readonly_fields(self, request, obj=None): """Add created and modified to readonly_fields. Also if create_only_f...
stack_v2_sparse_classes_36k_train_031697
1,885
no_license
[ { "docstring": "Add created and modified to fieldsets.", "name": "get_fieldsets", "signature": "def get_fieldsets(self, request, obj=None)" }, { "docstring": "Add created and modified to readonly_fields. Also if create_only_fields were specified add them to readonly_fields, if user is working on...
2
stack_v2_sparse_classes_30k_train_012963
Implement the Python class `BaseAdmin` described below. Class description: Base admin representation. Method signatures and docstrings: - def get_fieldsets(self, request, obj=None): Add created and modified to fieldsets. - def get_readonly_fields(self, request, obj=None): Add created and modified to readonly_fields. ...
Implement the Python class `BaseAdmin` described below. Class description: Base admin representation. Method signatures and docstrings: - def get_fieldsets(self, request, obj=None): Add created and modified to fieldsets. - def get_readonly_fields(self, request, obj=None): Add created and modified to readonly_fields. ...
0879ade24685b628624dce06698f8a0afd042000
<|skeleton|> class BaseAdmin: """Base admin representation.""" def get_fieldsets(self, request, obj=None): """Add created and modified to fieldsets.""" <|body_0|> def get_readonly_fields(self, request, obj=None): """Add created and modified to readonly_fields. Also if create_only_f...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseAdmin: """Base admin representation.""" def get_fieldsets(self, request, obj=None): """Add created and modified to fieldsets.""" fieldsets = super().get_fieldsets(request, obj) fieldsets += ((_('Extra info'), {'fields': ['created', 'modified']}),) return fieldsets ...
the_stack_v2_python_sparse
project_template/apps/core/admin.py
rhanmar/oi_projects_summer_2021
train
0
8c543d33c6500bdd96f6404b8fd23c2a8caf78dc
[ "self.lowest_new_price = lowest_new_price\nself.lowest_used_price = lowest_used_price\nself.lowest_collectible_price = lowest_collectible_price\nself.lowest_refurbished_price = lowest_refurbished_price\nself.total_new = total_new\nself.total_used = total_used\nself.total_collectible = total_collectible\nself.total_...
<|body_start_0|> self.lowest_new_price = lowest_new_price self.lowest_used_price = lowest_used_price self.lowest_collectible_price = lowest_collectible_price self.lowest_refurbished_price = lowest_refurbished_price self.total_new = total_new self.total_used = total_used ...
Implementation of the 'OfferSummary' model. TODO: type model description here. Attributes: lowest_new_price (Price): TODO: type description here. lowest_used_price (Price): TODO: type description here. lowest_collectible_price (Price): TODO: type description here. lowest_refurbished_price (Price): TODO: type descriptio...
OfferSummary
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OfferSummary: """Implementation of the 'OfferSummary' model. TODO: type model description here. Attributes: lowest_new_price (Price): TODO: type description here. lowest_used_price (Price): TODO: type description here. lowest_collectible_price (Price): TODO: type description here. lowest_refurbis...
stack_v2_sparse_classes_36k_train_031698
4,010
permissive
[ { "docstring": "Constructor for the OfferSummary class", "name": "__init__", "signature": "def __init__(self, lowest_new_price=None, lowest_used_price=None, lowest_collectible_price=None, lowest_refurbished_price=None, total_new=None, total_used=None, total_collectible=None, total_refurbished=None)" }...
2
stack_v2_sparse_classes_30k_train_017624
Implement the Python class `OfferSummary` described below. Class description: Implementation of the 'OfferSummary' model. TODO: type model description here. Attributes: lowest_new_price (Price): TODO: type description here. lowest_used_price (Price): TODO: type description here. lowest_collectible_price (Price): TODO:...
Implement the Python class `OfferSummary` described below. Class description: Implementation of the 'OfferSummary' model. TODO: type model description here. Attributes: lowest_new_price (Price): TODO: type description here. lowest_used_price (Price): TODO: type description here. lowest_collectible_price (Price): TODO:...
26ea1019115a1de3b1b37a4b830525e164ac55ce
<|skeleton|> class OfferSummary: """Implementation of the 'OfferSummary' model. TODO: type model description here. Attributes: lowest_new_price (Price): TODO: type description here. lowest_used_price (Price): TODO: type description here. lowest_collectible_price (Price): TODO: type description here. lowest_refurbis...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OfferSummary: """Implementation of the 'OfferSummary' model. TODO: type model description here. Attributes: lowest_new_price (Price): TODO: type description here. lowest_used_price (Price): TODO: type description here. lowest_collectible_price (Price): TODO: type description here. lowest_refurbished_price (Pr...
the_stack_v2_python_sparse
awsecommerceservice/models/offer_summary.py
nidaizamir/Test-PY
train
0
801a861f2d8fab540fb6225be46064eb4f81564a
[ "self.driver.get(detail_url)\nsleep(2)\nself.driver.execute_script('window.scrollTo(0, 1300)')\nreport_title = self.driver.find_element(CarDetail_Locator.REPORT_TITLE).text\ntt_check.assertEqual('检测报告', report_title, '检测报告tab的title,期望是检测报告,实际是%s' % report_title)", "self.driver.get(detail_url)\nsleep(2)\nself.driv...
<|body_start_0|> self.driver.get(detail_url) sleep(2) self.driver.execute_script('window.scrollTo(0, 1300)') report_title = self.driver.find_element(CarDetail_Locator.REPORT_TITLE).text tt_check.assertEqual('检测报告', report_title, '检测报告tab的title,期望是检测报告,实际是%s' % report_title) <|end...
Report
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Report: def test_report_title(self): """测试检测报告title显示的是否正确@author:zhangyanli""" <|body_0|> def test_report_type(self): """测试检测报告各类型显示的是否正确@author:zhangyanli""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.driver.get(detail_url) sleep(2)...
stack_v2_sparse_classes_36k_train_031699
1,735
no_license
[ { "docstring": "测试检测报告title显示的是否正确@author:zhangyanli", "name": "test_report_title", "signature": "def test_report_title(self)" }, { "docstring": "测试检测报告各类型显示的是否正确@author:zhangyanli", "name": "test_report_type", "signature": "def test_report_type(self)" } ]
2
stack_v2_sparse_classes_30k_train_016996
Implement the Python class `Report` described below. Class description: Implement the Report class. Method signatures and docstrings: - def test_report_title(self): 测试检测报告title显示的是否正确@author:zhangyanli - def test_report_type(self): 测试检测报告各类型显示的是否正确@author:zhangyanli
Implement the Python class `Report` described below. Class description: Implement the Report class. Method signatures and docstrings: - def test_report_title(self): 测试检测报告title显示的是否正确@author:zhangyanli - def test_report_type(self): 测试检测报告各类型显示的是否正确@author:zhangyanli <|skeleton|> class Report: def test_report_ti...
a73e4ed1dc02f05e93f11788591efe68109fd277
<|skeleton|> class Report: def test_report_title(self): """测试检测报告title显示的是否正确@author:zhangyanli""" <|body_0|> def test_report_type(self): """测试检测报告各类型显示的是否正确@author:zhangyanli""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Report: def test_report_title(self): """测试检测报告title显示的是否正确@author:zhangyanli""" self.driver.get(detail_url) sleep(2) self.driver.execute_script('window.scrollTo(0, 1300)') report_title = self.driver.find_element(CarDetail_Locator.REPORT_TITLE).text tt_check.asse...
the_stack_v2_python_sparse
taocheM/test_detail/test_carreport.py
zhangyanli616/TaoCheAuto
train
0