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
1bbecd0812b097516c66d62a2f2e859eb7fd5366
[ "auth_serializer = self.serializer_class(data=request.data)\nauth_serializer.is_valid(raise_exception=True)\nclient = request.client\nremember_me = bool(request.data.get('remember_me', False))\nid = auth_serializer.validated_data['user'].pk\nreturn self.response_login(id=id, client=client, remember_me=remember_me)"...
<|body_start_0|> auth_serializer = self.serializer_class(data=request.data) auth_serializer.is_valid(raise_exception=True) client = request.client remember_me = bool(request.data.get('remember_me', False)) id = auth_serializer.validated_data['user'].pk return self.respons...
AuthViewSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AuthViewSet: def create(self, request): """@apiVersion 1.0.0 @api {post} /auth Login @apiName Authenticate @apiGroup VMS_API Account @apiPermission none @apiHeader {number} Type Device type (1: Mobile, 2: Android phone, 3: IOS phone, 4: Window phone, 5: Android tablet, 6: IOS tablet, 7: ...
stack_v2_sparse_classes_36k_train_010700
4,091
no_license
[ { "docstring": "@apiVersion 1.0.0 @api {post} /auth Login @apiName Authenticate @apiGroup VMS_API Account @apiPermission none @apiHeader {number} Type Device type (1: Mobile, 2: Android phone, 3: IOS phone, 4: Window phone, 5: Android tablet, 6: IOS tablet, 7: Mobile web, tablet web, 8: Desktop web) @apiHeader ...
2
stack_v2_sparse_classes_30k_train_017405
Implement the Python class `AuthViewSet` described below. Class description: Implement the AuthViewSet class. Method signatures and docstrings: - def create(self, request): @apiVersion 1.0.0 @api {post} /auth Login @apiName Authenticate @apiGroup VMS_API Account @apiPermission none @apiHeader {number} Type Device typ...
Implement the Python class `AuthViewSet` described below. Class description: Implement the AuthViewSet class. Method signatures and docstrings: - def create(self, request): @apiVersion 1.0.0 @api {post} /auth Login @apiName Authenticate @apiGroup VMS_API Account @apiPermission none @apiHeader {number} Type Device typ...
b5c5bd25fb05965621615d09439bf79fa1b8d5e8
<|skeleton|> class AuthViewSet: def create(self, request): """@apiVersion 1.0.0 @api {post} /auth Login @apiName Authenticate @apiGroup VMS_API Account @apiPermission none @apiHeader {number} Type Device type (1: Mobile, 2: Android phone, 3: IOS phone, 4: Window phone, 5: Android tablet, 6: IOS tablet, 7: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AuthViewSet: def create(self, request): """@apiVersion 1.0.0 @api {post} /auth Login @apiName Authenticate @apiGroup VMS_API Account @apiPermission none @apiHeader {number} Type Device type (1: Mobile, 2: Android phone, 3: IOS phone, 4: Window phone, 5: Android tablet, 6: IOS tablet, 7: Mobile web, ta...
the_stack_v2_python_sparse
src/kitchenrock_api/views/auth.py
thqbop/kitchenrock
train
0
6bb32b76d02e3da36e1001a08aa52405b0dfb527
[ "self.input_str_1 = 'ZXVVYZW'\nself.input_str_2 = 'XKYKZPW'\nself.output = ['X', 'Y', 'Z', 'W']\nreturn (self.input_str_1, self.input_str_2, self.output)", "input_str_1, input_str_2, output = self.setUp()\noutput_method = longestCommonSubsequence(input_str_1, input_str_2)\nself.assertEqual(output, output_method)"...
<|body_start_0|> self.input_str_1 = 'ZXVVYZW' self.input_str_2 = 'XKYKZPW' self.output = ['X', 'Y', 'Z', 'W'] return (self.input_str_1, self.input_str_2, self.output) <|end_body_0|> <|body_start_1|> input_str_1, input_str_2, output = self.setUp() output_method = longestC...
Class with unittests for LongestCommonSubsequence.py
test_LongestCommonSubsequence
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class test_LongestCommonSubsequence: """Class with unittests for LongestCommonSubsequence.py""" def setUp(self): """Sets up input.""" <|body_0|> def test_user_input(self): """Checks if method works properly.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_010701
1,000
no_license
[ { "docstring": "Sets up input.", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Checks if method works properly.", "name": "test_user_input", "signature": "def test_user_input(self)" } ]
2
null
Implement the Python class `test_LongestCommonSubsequence` described below. Class description: Class with unittests for LongestCommonSubsequence.py Method signatures and docstrings: - def setUp(self): Sets up input. - def test_user_input(self): Checks if method works properly.
Implement the Python class `test_LongestCommonSubsequence` described below. Class description: Class with unittests for LongestCommonSubsequence.py Method signatures and docstrings: - def setUp(self): Sets up input. - def test_user_input(self): Checks if method works properly. <|skeleton|> class test_LongestCommonSu...
3aa62ad36c3b06b2a3b05f1f8e2a9e21d68b371f
<|skeleton|> class test_LongestCommonSubsequence: """Class with unittests for LongestCommonSubsequence.py""" def setUp(self): """Sets up input.""" <|body_0|> def test_user_input(self): """Checks if method works properly.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class test_LongestCommonSubsequence: """Class with unittests for LongestCommonSubsequence.py""" def setUp(self): """Sets up input.""" self.input_str_1 = 'ZXVVYZW' self.input_str_2 = 'XKYKZPW' self.output = ['X', 'Y', 'Z', 'W'] return (self.input_str_1, self.input_str_2, ...
the_stack_v2_python_sparse
AlgoExpert_algorithms/Hard/LongestCommonSubsequence/test_LongestCommonSubsequence.py
JakubKazimierski/PythonPortfolio
train
9
50286fddcb1510f97603ded61af83027e649e057
[ "self._name = name or 'eurodollar_futures'\nif (rate_term is None) == (maturity_date is None):\n msg = 'Error creating the EurodollarFutures contract. Either rate_term or maturity_date is required.'\n raise ValueError(msg)\nif rate_term is not None and maturity_date is not None:\n msg = 'Error creating the...
<|body_start_0|> self._name = name or 'eurodollar_futures' if (rate_term is None) == (maturity_date is None): msg = 'Error creating the EurodollarFutures contract. Either rate_term or maturity_date is required.' raise ValueError(msg) if rate_term is not None and maturity_...
Represents a collection of Eurodollar futures contracts. Interest rate futures are exchange traded futures contracts on Libor rates liquidly traded on exchanges such as Chicago Mercantile Exchange (CME) or London International Financial Futures and Options Exchange (LIFFE). Contracts on CME on a US Dollar spot Libor ra...
EurodollarFutures
[ "Apache-2.0", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EurodollarFutures: """Represents a collection of Eurodollar futures contracts. Interest rate futures are exchange traded futures contracts on Libor rates liquidly traded on exchanges such as Chicago Mercantile Exchange (CME) or London International Financial Futures and Options Exchange (LIFFE). ...
stack_v2_sparse_classes_36k_train_010702
7,341
permissive
[ { "docstring": "Initialize the Eurodollar futures object. Args: expiry_date: A Rank 1 `DateTensor` specifying the dates on which the futures contracts expire. contract_notional: An optional scalar or Rank 1 `Tensor` of real dtype specifying the unit (or size) for the contract. For example for eurodollar futures...
2
stack_v2_sparse_classes_30k_train_017157
Implement the Python class `EurodollarFutures` described below. Class description: Represents a collection of Eurodollar futures contracts. Interest rate futures are exchange traded futures contracts on Libor rates liquidly traded on exchanges such as Chicago Mercantile Exchange (CME) or London International Financial...
Implement the Python class `EurodollarFutures` described below. Class description: Represents a collection of Eurodollar futures contracts. Interest rate futures are exchange traded futures contracts on Libor rates liquidly traded on exchanges such as Chicago Mercantile Exchange (CME) or London International Financial...
0d3a2193c0f2d320b65e602cf01d7a617da484df
<|skeleton|> class EurodollarFutures: """Represents a collection of Eurodollar futures contracts. Interest rate futures are exchange traded futures contracts on Libor rates liquidly traded on exchanges such as Chicago Mercantile Exchange (CME) or London International Financial Futures and Options Exchange (LIFFE). ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EurodollarFutures: """Represents a collection of Eurodollar futures contracts. Interest rate futures are exchange traded futures contracts on Libor rates liquidly traded on exchanges such as Chicago Mercantile Exchange (CME) or London International Financial Futures and Options Exchange (LIFFE). Contracts on ...
the_stack_v2_python_sparse
tf_quant_finance/experimental/instruments/eurodollar_futures.py
google/tf-quant-finance
train
4,165
138c38d57df430790b62993346246a3886ccd638
[ "if not heights:\n return 0\nstack = []\nresult, index = (0, 0)\nwhile index < len(heights):\n if not stack or heights[index] >= heights[stack[-1]]:\n stack.append(index)\n index += 1\n else:\n curr = stack.pop()\n if not stack:\n area = heights[curr] * index\n ...
<|body_start_0|> if not heights: return 0 stack = [] result, index = (0, 0) while index < len(heights): if not stack or heights[index] >= heights[stack[-1]]: stack.append(index) index += 1 else: curr = st...
Solution
[ "MIT", "LicenseRef-scancode-other-permissive" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def largestRectangleArea(self, heights): """:type heights: List[int] :rtype: int""" <|body_0|> def maximalRectangle(self, matrix): """:type matrix: List[List[str]] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not heights:...
stack_v2_sparse_classes_36k_train_010703
1,752
permissive
[ { "docstring": ":type heights: List[int] :rtype: int", "name": "largestRectangleArea", "signature": "def largestRectangleArea(self, heights)" }, { "docstring": ":type matrix: List[List[str]] :rtype: int", "name": "maximalRectangle", "signature": "def maximalRectangle(self, matrix)" } ]
2
stack_v2_sparse_classes_30k_train_011348
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def largestRectangleArea(self, heights): :type heights: List[int] :rtype: int - def maximalRectangle(self, matrix): :type matrix: List[List[str]] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def largestRectangleArea(self, heights): :type heights: List[int] :rtype: int - def maximalRectangle(self, matrix): :type matrix: List[List[str]] :rtype: int <|skeleton|> class ...
b0136eb1e4ae11dc6abcc10f5dc82fa9761bdaba
<|skeleton|> class Solution: def largestRectangleArea(self, heights): """:type heights: List[int] :rtype: int""" <|body_0|> def maximalRectangle(self, matrix): """:type matrix: List[List[str]] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def largestRectangleArea(self, heights): """:type heights: List[int] :rtype: int""" if not heights: return 0 stack = [] result, index = (0, 0) while index < len(heights): if not stack or heights[index] >= heights[stack[-1]]: ...
the_stack_v2_python_sparse
1-100q/85.py
aggy07/Leetcode
train
1
2189d5dbe608f60fa01eb42710210ab807be59d1
[ "flag, ele = self.dr.judge_element(tgp_login_button)\ntry:\n if flag:\n self.qq_login(ele)\n self.judeg_first_login()\n self.lgnore_update()\n else:\n self.lgnore_update()\n self.dr.click(tgp_nav_my)\n flag, loginPop_login = self.dr.judge_element(tgp_loginPop_login)\n...
<|body_start_0|> flag, ele = self.dr.judge_element(tgp_login_button) try: if flag: self.qq_login(ele) self.judeg_first_login() self.lgnore_update() else: self.lgnore_update() self.dr.click(tgp_nav_my)...
enterApp_page
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class enterApp_page: def tgp_login_main(self): """tgp登录主函数 :return:""" <|body_0|> def lgnore_update(self): """首页判断有无更新弹窗,有则忽略 :return:""" <|body_1|> def judeg_first_login(self): """判断是否为首次登录,首次登录完善资料 :return:""" <|body_2|> def qq_login(sel...
stack_v2_sparse_classes_36k_train_010704
4,622
no_license
[ { "docstring": "tgp登录主函数 :return:", "name": "tgp_login_main", "signature": "def tgp_login_main(self)" }, { "docstring": "首页判断有无更新弹窗,有则忽略 :return:", "name": "lgnore_update", "signature": "def lgnore_update(self)" }, { "docstring": "判断是否为首次登录,首次登录完善资料 :return:", "name": "judeg_...
4
stack_v2_sparse_classes_30k_train_013585
Implement the Python class `enterApp_page` described below. Class description: Implement the enterApp_page class. Method signatures and docstrings: - def tgp_login_main(self): tgp登录主函数 :return: - def lgnore_update(self): 首页判断有无更新弹窗,有则忽略 :return: - def judeg_first_login(self): 判断是否为首次登录,首次登录完善资料 :return: - def qq_logi...
Implement the Python class `enterApp_page` described below. Class description: Implement the enterApp_page class. Method signatures and docstrings: - def tgp_login_main(self): tgp登录主函数 :return: - def lgnore_update(self): 首页判断有无更新弹窗,有则忽略 :return: - def judeg_first_login(self): 判断是否为首次登录,首次登录完善资料 :return: - def qq_logi...
8e82a6051c22d6d9480b9f60aefad347d927c592
<|skeleton|> class enterApp_page: def tgp_login_main(self): """tgp登录主函数 :return:""" <|body_0|> def lgnore_update(self): """首页判断有无更新弹窗,有则忽略 :return:""" <|body_1|> def judeg_first_login(self): """判断是否为首次登录,首次登录完善资料 :return:""" <|body_2|> def qq_login(sel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class enterApp_page: def tgp_login_main(self): """tgp登录主函数 :return:""" flag, ele = self.dr.judge_element(tgp_login_button) try: if flag: self.qq_login(ele) self.judeg_first_login() self.lgnore_update() else: ...
the_stack_v2_python_sparse
Po/testpage/enterApp_page.py
Felixshao/UiAutomation
train
1
e5e327f31990ba02267e9b8dffa25f2fe1269096
[ "self.name = name\nself.owner = owner\nself.tag = tag\nself.state = state\nself.countr = countr", "if self.tag is not None:\n query = '\\n { repository(name: \"%s\", owner: \"%s\") {\\n pullRequests(states: %s, last: %i, orderBy: {field: CREATED_AT, direction: ASC},labels:\"...
<|body_start_0|> self.name = name self.owner = owner self.tag = tag self.state = state self.countr = countr <|end_body_0|> <|body_start_1|> if self.tag is not None: query = '\n { repository(name: "%s", owner: "%s") {\n pull...
The Queries class defines an object that represents a pull request query
Queries
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Queries: """The Queries class defines an object that represents a pull request query""" def __init__(self, owner, name, state, tag=None, countr=30): """initialize query object with state, name, owner, tag and counter.""" <|body_0|> def pulls(self): """this functi...
stack_v2_sparse_classes_36k_train_010705
2,463
permissive
[ { "docstring": "initialize query object with state, name, owner, tag and counter.", "name": "__init__", "signature": "def __init__(self, owner, name, state, tag=None, countr=30)" }, { "docstring": "this function returns pull request query", "name": "pulls", "signature": "def pulls(self)"...
2
stack_v2_sparse_classes_30k_train_008948
Implement the Python class `Queries` described below. Class description: The Queries class defines an object that represents a pull request query Method signatures and docstrings: - def __init__(self, owner, name, state, tag=None, countr=30): initialize query object with state, name, owner, tag and counter. - def pul...
Implement the Python class `Queries` described below. Class description: The Queries class defines an object that represents a pull request query Method signatures and docstrings: - def __init__(self, owner, name, state, tag=None, countr=30): initialize query object with state, name, owner, tag and counter. - def pul...
31fd3fb1233f39ea2252a7a44160ff8a2140f7bd
<|skeleton|> class Queries: """The Queries class defines an object that represents a pull request query""" def __init__(self, owner, name, state, tag=None, countr=30): """initialize query object with state, name, owner, tag and counter.""" <|body_0|> def pulls(self): """this functi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Queries: """The Queries class defines an object that represents a pull request query""" def __init__(self, owner, name, state, tag=None, countr=30): """initialize query object with state, name, owner, tag and counter.""" self.name = name self.owner = owner self.tag = tag ...
the_stack_v2_python_sparse
Python/PR_Workflow/src/graphqlapi.py
HarshCasper/Rotten-Scripts
train
1,474
beaf1d281f37daf7409f336c2ff27968fc0f0e64
[ "if x + y <= z or x + z <= y or y + z <= x:\n raise TriangleError('The triangle inequality failed.')\nself.sides = (x, y, z)", "if self.sides[0] == self.sides[1] == self.sides[2]:\n return 'equilateral'\nelif self.sides[0] == self.sides[1] or self.sides[0] == self.sides[2] or self.sides[1] == self.sides[2]:...
<|body_start_0|> if x + y <= z or x + z <= y or y + z <= x: raise TriangleError('The triangle inequality failed.') self.sides = (x, y, z) <|end_body_0|> <|body_start_1|> if self.sides[0] == self.sides[1] == self.sides[2]: return 'equilateral' elif self.sides[0] =...
A triangle.
Triangle
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Triangle: """A triangle.""" def __init__(self, x, y, z): """Create a triangle. Args: x: The length of a side of a triangle. y: The length of a side of a triangle. z: The length of a side of a triangle. Raises: TriangleError: The triangle inequality failed.""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_010706
1,095
no_license
[ { "docstring": "Create a triangle. Args: x: The length of a side of a triangle. y: The length of a side of a triangle. z: The length of a side of a triangle. Raises: TriangleError: The triangle inequality failed.", "name": "__init__", "signature": "def __init__(self, x, y, z)" }, { "docstring": ...
2
stack_v2_sparse_classes_30k_train_002446
Implement the Python class `Triangle` described below. Class description: A triangle. Method signatures and docstrings: - def __init__(self, x, y, z): Create a triangle. Args: x: The length of a side of a triangle. y: The length of a side of a triangle. z: The length of a side of a triangle. Raises: TriangleError: Th...
Implement the Python class `Triangle` described below. Class description: A triangle. Method signatures and docstrings: - def __init__(self, x, y, z): Create a triangle. Args: x: The length of a side of a triangle. y: The length of a side of a triangle. z: The length of a side of a triangle. Raises: TriangleError: Th...
be0e2f635a7558f56c61bc0b36c6146b01d1e6e6
<|skeleton|> class Triangle: """A triangle.""" def __init__(self, x, y, z): """Create a triangle. Args: x: The length of a side of a triangle. y: The length of a side of a triangle. z: The length of a side of a triangle. Raises: TriangleError: The triangle inequality failed.""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Triangle: """A triangle.""" def __init__(self, x, y, z): """Create a triangle. Args: x: The length of a side of a triangle. y: The length of a side of a triangle. z: The length of a side of a triangle. Raises: TriangleError: The triangle inequality failed.""" if x + y <= z or x + z <= y o...
the_stack_v2_python_sparse
all_data/exercism_data/python/triangle/638401889cd4482babbebb5553bd5b24.py
itsolutionscorp/AutoStyle-Clustering
train
4
c5afd837def6a6ec93ab77a5746a49b3d3ffd86d
[ "assert padding in ['SAME', 'VALID', 'REFLECT'], 'Error: unsupported padding'\nself._padding = padding\nwith tf.variable_scope(name):\n if isinstance(stride, int):\n stride = [1, stride, stride, 1]\n else:\n assert len(stride) == 0, 'stride is either an int or a 2-tuple'\n stride = [1, st...
<|body_start_0|> assert padding in ['SAME', 'VALID', 'REFLECT'], 'Error: unsupported padding' self._padding = padding with tf.variable_scope(name): if isinstance(stride, int): stride = [1, stride, stride, 1] else: assert len(stride) == 0, '...
Convolution layer with support for equalized learning.
LayerConv
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LayerConv: """Convolution layer with support for equalized learning.""" def __init__(self, name, w, n, stride, padding='SAME', use_scaling=False, relu_slope=1.0): """Layer constructor. Args: name: string, layer name. stride: int or 2-tuple, stride for the convolution kernel. w: int o...
stack_v2_sparse_classes_36k_train_010707
13,442
permissive
[ { "docstring": "Layer constructor. Args: name: string, layer name. stride: int or 2-tuple, stride for the convolution kernel. w: int or 2-tuple, width of the convolution kernel. n: 2-tuple of ints, input and output channel depths. padding: string, the padding method. {SAME, VALID, REFLECT}. use_scaling: bool, w...
2
stack_v2_sparse_classes_30k_train_000196
Implement the Python class `LayerConv` described below. Class description: Convolution layer with support for equalized learning. Method signatures and docstrings: - def __init__(self, name, w, n, stride, padding='SAME', use_scaling=False, relu_slope=1.0): Layer constructor. Args: name: string, layer name. stride: in...
Implement the Python class `LayerConv` described below. Class description: Convolution layer with support for equalized learning. Method signatures and docstrings: - def __init__(self, name, w, n, stride, padding='SAME', use_scaling=False, relu_slope=1.0): Layer constructor. Args: name: string, layer name. stride: in...
091d6ae9e087cf5a6e18b00bce7d8f7ede9d9d08
<|skeleton|> class LayerConv: """Convolution layer with support for equalized learning.""" def __init__(self, name, w, n, stride, padding='SAME', use_scaling=False, relu_slope=1.0): """Layer constructor. Args: name: string, layer name. stride: int or 2-tuple, stride for the convolution kernel. w: int o...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LayerConv: """Convolution layer with support for equalized learning.""" def __init__(self, name, w, n, stride, padding='SAME', use_scaling=False, relu_slope=1.0): """Layer constructor. Args: name: string, layer name. stride: int or 2-tuple, stride for the convolution kernel. w: int or 2-tuple, wi...
the_stack_v2_python_sparse
layers.py
MoustafaMeshry/StEP
train
6
ce9c034a1a8cca208d23b5ae7f3a721d71178484
[ "corp = CorporationFactory.get()\nlabel_group = corp.product_label_group_repository.get_label_group(args['label_group_id'])\nresult = label_group.add_label(args['label_name'])\nif isinstance(result, basestring):\n return (500, result)\nelse:\n return {'label': {'id': result.id, 'name': result.name, 'label_gro...
<|body_start_0|> corp = CorporationFactory.get() label_group = corp.product_label_group_repository.get_label_group(args['label_group_id']) result = label_group.add_label(args['label_name']) if isinstance(result, basestring): return (500, result) else: retu...
商品标签
AProductLable
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AProductLable: """商品标签""" def put(args): """创建标签""" <|body_0|> def delete(args): """删除标签""" <|body_1|> <|end_skeleton|> <|body_start_0|> corp = CorporationFactory.get() label_group = corp.product_label_group_repository.get_label_group(ar...
stack_v2_sparse_classes_36k_train_010708
1,045
no_license
[ { "docstring": "创建标签", "name": "put", "signature": "def put(args)" }, { "docstring": "删除标签", "name": "delete", "signature": "def delete(args)" } ]
2
null
Implement the Python class `AProductLable` described below. Class description: 商品标签 Method signatures and docstrings: - def put(args): 创建标签 - def delete(args): 删除标签
Implement the Python class `AProductLable` described below. Class description: 商品标签 Method signatures and docstrings: - def put(args): 创建标签 - def delete(args): 删除标签 <|skeleton|> class AProductLable: """商品标签""" def put(args): """创建标签""" <|body_0|> def delete(args): """删除标签""" ...
39860a451678ab50ad93ce8ebe2ef8490af65d62
<|skeleton|> class AProductLable: """商品标签""" def put(args): """创建标签""" <|body_0|> def delete(args): """删除标签""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AProductLable: """商品标签""" def put(args): """创建标签""" corp = CorporationFactory.get() label_group = corp.product_label_group_repository.get_label_group(args['label_group_id']) result = label_group.add_label(args['label_name']) if isinstance(result, basestring): ...
the_stack_v2_python_sparse
api/mall/product_label/a_product_label.py
chengdg/gaia
train
0
fcaee598f9b2a8f09f1c45d18f52f32a666f6275
[ "expected_children_level_0 = ['render', 'configuration']\nfor child in expected_children_level_0:\n if len(xml_object.xpath(child)) != 1:\n raise ValueError(\"Graphical Slider Tool definition must include exactly one '{0}' tag\".format(child))\nexpected_children_level_1 = ['functions']...
<|body_start_0|> expected_children_level_0 = ['render', 'configuration'] for child in expected_children_level_0: if len(xml_object.xpath(child)) != 1: raise ValueError("Graphical Slider Tool definition must include exactly one '{0}' tag".format(child)) ...
GraphicalSliderToolDescriptor
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GraphicalSliderToolDescriptor: def definition_from_xml(cls, xml_object, system): """Pull out the data into dictionary. Args: xml_object: xml from file. Returns: dict""" <|body_0|> def definition_to_xml(self, resource_fs): """Return an xml element representing this de...
stack_v2_sparse_classes_36k_train_010709
7,776
no_license
[ { "docstring": "Pull out the data into dictionary. Args: xml_object: xml from file. Returns: dict", "name": "definition_from_xml", "signature": "def definition_from_xml(cls, xml_object, system)" }, { "docstring": "Return an xml element representing this definition.", "name": "definition_to_x...
2
stack_v2_sparse_classes_30k_train_000823
Implement the Python class `GraphicalSliderToolDescriptor` described below. Class description: Implement the GraphicalSliderToolDescriptor class. Method signatures and docstrings: - def definition_from_xml(cls, xml_object, system): Pull out the data into dictionary. Args: xml_object: xml from file. Returns: dict - de...
Implement the Python class `GraphicalSliderToolDescriptor` described below. Class description: Implement the GraphicalSliderToolDescriptor class. Method signatures and docstrings: - def definition_from_xml(cls, xml_object, system): Pull out the data into dictionary. Args: xml_object: xml from file. Returns: dict - de...
5fa3a818c3d41bd9c3eb25122e1d376c8910269c
<|skeleton|> class GraphicalSliderToolDescriptor: def definition_from_xml(cls, xml_object, system): """Pull out the data into dictionary. Args: xml_object: xml from file. Returns: dict""" <|body_0|> def definition_to_xml(self, resource_fs): """Return an xml element representing this de...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GraphicalSliderToolDescriptor: def definition_from_xml(cls, xml_object, system): """Pull out the data into dictionary. Args: xml_object: xml from file. Returns: dict""" expected_children_level_0 = ['render', 'configuration'] for child in expected_children_level_0: if len(xm...
the_stack_v2_python_sparse
ExtractFeatures/Data/pratik98/gst_module.py
vivekaxl/LexisNexis
train
9
61f9948d1b883fbfedb6da7fe5a350094cdf5242
[ "self.adder = Adder()\nself.subtracter = Subtracter()\nself.multiplier = Multiplier()\nself.divider = Divider()\nself.calculator = Calculator(self.adder, self.subtracter, self.multiplier, self.divider)", "self.calculator.enter_number(0)\nwith self.assertRaises(InsufficientOperands):\n self.calculator.add()", ...
<|body_start_0|> self.adder = Adder() self.subtracter = Subtracter() self.multiplier = Multiplier() self.divider = Divider() self.calculator = Calculator(self.adder, self.subtracter, self.multiplier, self.divider) <|end_body_0|> <|body_start_1|> self.calculator.enter_num...
Class for testing the Calculator
CalculatorTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CalculatorTests: """Class for testing the Calculator""" def setUp(self): """Configure a new Adder, Subtractor, Multiplier, and Divider to instantiate a calculator""" <|body_0|> def test_insufficient_operands(self): """At least two operands are needed.""" ...
stack_v2_sparse_classes_36k_train_010710
3,649
no_license
[ { "docstring": "Configure a new Adder, Subtractor, Multiplier, and Divider to instantiate a calculator", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "At least two operands are needed.", "name": "test_insufficient_operands", "signature": "def test_insufficient_operan...
6
stack_v2_sparse_classes_30k_train_020721
Implement the Python class `CalculatorTests` described below. Class description: Class for testing the Calculator Method signatures and docstrings: - def setUp(self): Configure a new Adder, Subtractor, Multiplier, and Divider to instantiate a calculator - def test_insufficient_operands(self): At least two operands ar...
Implement the Python class `CalculatorTests` described below. Class description: Class for testing the Calculator Method signatures and docstrings: - def setUp(self): Configure a new Adder, Subtractor, Multiplier, and Divider to instantiate a calculator - def test_insufficient_operands(self): At least two operands ar...
b1fea0309b3495b3e1dc167d7029bc9e4b6f00f1
<|skeleton|> class CalculatorTests: """Class for testing the Calculator""" def setUp(self): """Configure a new Adder, Subtractor, Multiplier, and Divider to instantiate a calculator""" <|body_0|> def test_insufficient_operands(self): """At least two operands are needed.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CalculatorTests: """Class for testing the Calculator""" def setUp(self): """Configure a new Adder, Subtractor, Multiplier, and Divider to instantiate a calculator""" self.adder = Adder() self.subtracter = Subtracter() self.multiplier = Multiplier() self.divider = D...
the_stack_v2_python_sparse
students/roy_t/lesson06/unittest_calculator.py
UWPCE-PythonCert-ClassRepos/SP_Online_Course2_2018
train
4
fdcddb34ad7adda4320d3826e9ad5ce24805d888
[ "self.logger = logger\nself.account_name = config[constants.azure_storage_account_name_key_name]\nself.access_key = config[constants.azure_storage_access_key_key_name]\nself.endpoint_suffix = config[constants.azure_storage_endpoint_suffix_key_name]\nself.connection_string = 'DefaultEndpointsProtocol=https;AccountNa...
<|body_start_0|> self.logger = logger self.account_name = config[constants.azure_storage_account_name_key_name] self.access_key = config[constants.azure_storage_access_key_key_name] self.endpoint_suffix = config[constants.azure_storage_endpoint_suffix_key_name] self.connection_st...
This reader reads data from given table Attributes ---------- logger : AirbyteLogger Airbyte's Logger instance account_name : str The name of your storage account. access_key : str The access key to your storage account. Read more about access keys here - https://docs.microsoft.com/en-us/azure/storage/common/storage-ac...
AzureTableReader
[ "MIT", "Elastic-2.0", "Apache-2.0", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AzureTableReader: """This reader reads data from given table Attributes ---------- logger : AirbyteLogger Airbyte's Logger instance account_name : str The name of your storage account. access_key : str The access key to your storage account. Read more about access keys here - https://docs.microso...
stack_v2_sparse_classes_36k_train_010711
4,691
permissive
[ { "docstring": "Parameters ---------- config : dict Airbyte's configuration obect", "name": "__init__", "signature": "def __init__(self, logger: AirbyteLogger, config: dict)" }, { "docstring": "Returns azure table service client from connection string. Table service client facilitate interaction...
5
stack_v2_sparse_classes_30k_train_021271
Implement the Python class `AzureTableReader` described below. Class description: This reader reads data from given table Attributes ---------- logger : AirbyteLogger Airbyte's Logger instance account_name : str The name of your storage account. access_key : str The access key to your storage account. Read more about ...
Implement the Python class `AzureTableReader` described below. Class description: This reader reads data from given table Attributes ---------- logger : AirbyteLogger Airbyte's Logger instance account_name : str The name of your storage account. access_key : str The access key to your storage account. Read more about ...
8d5f9a2d49ab8f9e85ccf058cb02c2fda287afc6
<|skeleton|> class AzureTableReader: """This reader reads data from given table Attributes ---------- logger : AirbyteLogger Airbyte's Logger instance account_name : str The name of your storage account. access_key : str The access key to your storage account. Read more about access keys here - https://docs.microso...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AzureTableReader: """This reader reads data from given table Attributes ---------- logger : AirbyteLogger Airbyte's Logger instance account_name : str The name of your storage account. access_key : str The access key to your storage account. Read more about access keys here - https://docs.microsoft.com/en-us/...
the_stack_v2_python_sparse
dts/airbyte/airbyte-integrations/connectors/source-azure-table/source_azure_table/azure_table.py
alldatacenter/alldata
train
774
07a67dc383eb73700592342f6236403dd1cf8ef5
[ "if not isinstance(input_shape, Iterable):\n input_shape = (input_shape,)\nif not isinstance(output_shape, Iterable):\n output_shape = (output_shape,)\nself.input_shape = input_shape\nself.output_shape = output_shape\nself.kernel = np.zeros(input_shape + output_shape)\nself.bias = np.zeros(output_shape)", "...
<|body_start_0|> if not isinstance(input_shape, Iterable): input_shape = (input_shape,) if not isinstance(output_shape, Iterable): output_shape = (output_shape,) self.input_shape = input_shape self.output_shape = output_shape self.kernel = np.zeros(input_s...
Predict linear combination
Linear
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Linear: """Predict linear combination""" def __init__(self, input_shape, output_shape): """init""" <|body_0|> def __call__(self, x): """call""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not isinstance(input_shape, Iterable): in...
stack_v2_sparse_classes_36k_train_010712
1,500
permissive
[ { "docstring": "init", "name": "__init__", "signature": "def __init__(self, input_shape, output_shape)" }, { "docstring": "call", "name": "__call__", "signature": "def __call__(self, x)" } ]
2
stack_v2_sparse_classes_30k_train_001625
Implement the Python class `Linear` described below. Class description: Predict linear combination Method signatures and docstrings: - def __init__(self, input_shape, output_shape): init - def __call__(self, x): call
Implement the Python class `Linear` described below. Class description: Predict linear combination Method signatures and docstrings: - def __init__(self, input_shape, output_shape): init - def __call__(self, x): call <|skeleton|> class Linear: """Predict linear combination""" def __init__(self, input_shape,...
5be08e2fa4ef8cad9a3c1d4134c13acf4c68637f
<|skeleton|> class Linear: """Predict linear combination""" def __init__(self, input_shape, output_shape): """init""" <|body_0|> def __call__(self, x): """call""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Linear: """Predict linear combination""" def __init__(self, input_shape, output_shape): """init""" if not isinstance(input_shape, Iterable): input_shape = (input_shape,) if not isinstance(output_shape, Iterable): output_shape = (output_shape,) self....
the_stack_v2_python_sparse
timecast/modules/_linear.py
NeoTim/timecast
train
0
d8e4e6c538261220281f8af300add7742b332b82
[ "d = {}\nk = {}\nstart = 0\nstep = 0\nfor i in range(8):\n start = start | cells[i] << i\nd[start] = step\nk[step] = start\nnn = 0\nwhile nn < N:\n nn += 1\n step += 1\n start = ~((start ^ start << 2) >> 1) & 126\n if start in d:\n T = nn - d[start]\n t_ = d[start] + (N - d[start]) % T\...
<|body_start_0|> d = {} k = {} start = 0 step = 0 for i in range(8): start = start | cells[i] << i d[start] = step k[step] = start nn = 0 while nn < N: nn += 1 step += 1 start = ~((start ^ start << 2)...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def prisonAfterNDays(self, cells, N): """:type cells: List[int] :type N: int :rtype: List[int]""" <|body_0|> def raw(self, cells, N): """:type cells: List[int] :type N: int :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_010713
1,587
no_license
[ { "docstring": ":type cells: List[int] :type N: int :rtype: List[int]", "name": "prisonAfterNDays", "signature": "def prisonAfterNDays(self, cells, N)" }, { "docstring": ":type cells: List[int] :type N: int :rtype: List[int]", "name": "raw", "signature": "def raw(self, cells, N)" } ]
2
stack_v2_sparse_classes_30k_train_014455
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def prisonAfterNDays(self, cells, N): :type cells: List[int] :type N: int :rtype: List[int] - def raw(self, cells, N): :type cells: List[int] :type N: int :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def prisonAfterNDays(self, cells, N): :type cells: List[int] :type N: int :rtype: List[int] - def raw(self, cells, N): :type cells: List[int] :type N: int :rtype: List[int] <|sk...
8075fbb40987d5e6af8d30941a19fa48a3320f56
<|skeleton|> class Solution: def prisonAfterNDays(self, cells, N): """:type cells: List[int] :type N: int :rtype: List[int]""" <|body_0|> def raw(self, cells, N): """:type cells: List[int] :type N: int :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def prisonAfterNDays(self, cells, N): """:type cells: List[int] :type N: int :rtype: List[int]""" d = {} k = {} start = 0 step = 0 for i in range(8): start = start | cells[i] << i d[start] = step k[step] = start nn =...
the_stack_v2_python_sparse
p957/Solution.py
carwestsam/leetCode
train
4
f8991605b63979febe95371fada99ea635315fd0
[ "super().__init__(mass_profile=None, grid=grid, mat_plot_1d=mat_plot_1d, visuals_1d=visuals_1d, include_1d=include_1d, mat_plot_2d=mat_plot_2d, visuals_2d=visuals_2d, include_2d=include_2d)\nself.mass_profile_pdf_list = mass_profile_pdf_list\nself.sigma = sigma\nself.low_limit = (1 - math.erf(sigma / math.sqrt(2)))...
<|body_start_0|> super().__init__(mass_profile=None, grid=grid, mat_plot_1d=mat_plot_1d, visuals_1d=visuals_1d, include_1d=include_1d, mat_plot_2d=mat_plot_2d, visuals_2d=visuals_2d, include_2d=include_2d) self.mass_profile_pdf_list = mass_profile_pdf_list self.sigma = sigma self.low_lim...
MassProfilePDFPlotter
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MassProfilePDFPlotter: def __init__(self, mass_profile_pdf_list: List[MassProfile], grid: aa.Grid2D, mat_plot_1d: MatPlot1D=MatPlot1D(), visuals_1d: Visuals1D=Visuals1D(), include_1d: Include1D=Include1D(), mat_plot_2d: MatPlot2D=MatPlot2D(), visuals_2d: Visuals2D=Visuals2D(), include_2d: Includ...
stack_v2_sparse_classes_36k_train_010714
14,759
permissive
[ { "docstring": "Plots the attributes of a list of `MassProfile` objects using the matplotlib methods `plot()` and `imshow()` and many other matplotlib functions which customize the plot's appearance. Figures plotted by this object average over a list mass profiles to computed the average value of each attribute...
2
stack_v2_sparse_classes_30k_train_012564
Implement the Python class `MassProfilePDFPlotter` described below. Class description: Implement the MassProfilePDFPlotter class. Method signatures and docstrings: - def __init__(self, mass_profile_pdf_list: List[MassProfile], grid: aa.Grid2D, mat_plot_1d: MatPlot1D=MatPlot1D(), visuals_1d: Visuals1D=Visuals1D(), inc...
Implement the Python class `MassProfilePDFPlotter` described below. Class description: Implement the MassProfilePDFPlotter class. Method signatures and docstrings: - def __init__(self, mass_profile_pdf_list: List[MassProfile], grid: aa.Grid2D, mat_plot_1d: MatPlot1D=MatPlot1D(), visuals_1d: Visuals1D=Visuals1D(), inc...
d1a2e400b7ac984a21d972f54e419d8783342454
<|skeleton|> class MassProfilePDFPlotter: def __init__(self, mass_profile_pdf_list: List[MassProfile], grid: aa.Grid2D, mat_plot_1d: MatPlot1D=MatPlot1D(), visuals_1d: Visuals1D=Visuals1D(), include_1d: Include1D=Include1D(), mat_plot_2d: MatPlot2D=MatPlot2D(), visuals_2d: Visuals2D=Visuals2D(), include_2d: Includ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MassProfilePDFPlotter: def __init__(self, mass_profile_pdf_list: List[MassProfile], grid: aa.Grid2D, mat_plot_1d: MatPlot1D=MatPlot1D(), visuals_1d: Visuals1D=Visuals1D(), include_1d: Include1D=Include1D(), mat_plot_2d: MatPlot2D=MatPlot2D(), visuals_2d: Visuals2D=Visuals2D(), include_2d: Include2D=Include2D(...
the_stack_v2_python_sparse
autogalaxy/profiles/plot/mass_profile_plotters.py
Jammy2211/PyAutoGalaxy
train
27
82ba59cb5ccc331af05d3cf2014a300eebea8f3e
[ "if not (obj and len(TestCase.objects.filter(application=obj)) and len(Variable.objects.filter(application=obj))):\n return admin.ModelAdmin.get_fieldsets(self, request, obj=obj)\nelse:\n return ((None, {'fields': ('name', 'linkedApplication'), 'description': '<div style=\"font-size: 16px;color: red;\">All te...
<|body_start_0|> if not (obj and len(TestCase.objects.filter(application=obj)) and len(Variable.objects.filter(application=obj))): return admin.ModelAdmin.get_fieldsets(self, request, obj=obj) else: return ((None, {'fields': ('name', 'linkedApplication'), 'description': '<div sty...
ApplicationAdmin
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ApplicationAdmin: def get_fieldsets(self, request, obj=None): """Display error message when it's impossible to delete the application""" <|body_0|> def has_delete_permission(self, request, obj=None): """Do not display delete button if some tests / variables are linke...
stack_v2_sparse_classes_36k_train_010715
21,881
permissive
[ { "docstring": "Display error message when it's impossible to delete the application", "name": "get_fieldsets", "signature": "def get_fieldsets(self, request, obj=None)" }, { "docstring": "Do not display delete button if some tests / variables are linked to this application", "name": "has_de...
2
stack_v2_sparse_classes_30k_train_018195
Implement the Python class `ApplicationAdmin` described below. Class description: Implement the ApplicationAdmin class. Method signatures and docstrings: - def get_fieldsets(self, request, obj=None): Display error message when it's impossible to delete the application - def has_delete_permission(self, request, obj=No...
Implement the Python class `ApplicationAdmin` described below. Class description: Implement the ApplicationAdmin class. Method signatures and docstrings: - def get_fieldsets(self, request, obj=None): Display error message when it's impossible to delete the application - def has_delete_permission(self, request, obj=No...
590c84d5078fee4021fa23956390eb612b5f123d
<|skeleton|> class ApplicationAdmin: def get_fieldsets(self, request, obj=None): """Display error message when it's impossible to delete the application""" <|body_0|> def has_delete_permission(self, request, obj=None): """Do not display delete button if some tests / variables are linke...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ApplicationAdmin: def get_fieldsets(self, request, obj=None): """Display error message when it's impossible to delete the application""" if not (obj and len(TestCase.objects.filter(application=obj)) and len(Variable.objects.filter(application=obj))): return admin.ModelAdmin.get_fie...
the_stack_v2_python_sparse
variableServer/admin.py
bhecquet/seleniumRobot-server
train
0
d0456bc22093db2ba0ba60e76021be1c854cc978
[ "if which_challenge not in ('singlecoil', 'multicoil'):\n raise ValueError(f'Challenge should either be \"singlecoil\" or \"multicoil\"')\nself.mask_func = mask_func\nself.resolution = resolution\nself.which_challenge = which_challenge\nself.use_seed = use_seed", "kspace = T.to_tensor(kspace)\nsensitivity = T....
<|body_start_0|> if which_challenge not in ('singlecoil', 'multicoil'): raise ValueError(f'Challenge should either be "singlecoil" or "multicoil"') self.mask_func = mask_func self.resolution = resolution self.which_challenge = which_challenge self.use_seed = use_seed ...
Data Transformer for training U-Net models.
DataTransform
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DataTransform: """Data Transformer for training U-Net models.""" def __init__(self, resolution, which_challenge, mask_func=None, use_seed=True): """Args: mask_func (common.subsample.MaskFunc): A function that can create a mask of appropriate shape. resolution (int): Resolution of the...
stack_v2_sparse_classes_36k_train_010716
8,057
no_license
[ { "docstring": "Args: mask_func (common.subsample.MaskFunc): A function that can create a mask of appropriate shape. resolution (int): Resolution of the image. which_challenge (str): Either \"singlecoil\" or \"multicoil\" denoting the dataset. use_seed (bool): If true, this class computes a pseudo random number...
2
stack_v2_sparse_classes_30k_train_018503
Implement the Python class `DataTransform` described below. Class description: Data Transformer for training U-Net models. Method signatures and docstrings: - def __init__(self, resolution, which_challenge, mask_func=None, use_seed=True): Args: mask_func (common.subsample.MaskFunc): A function that can create a mask ...
Implement the Python class `DataTransform` described below. Class description: Data Transformer for training U-Net models. Method signatures and docstrings: - def __init__(self, resolution, which_challenge, mask_func=None, use_seed=True): Args: mask_func (common.subsample.MaskFunc): A function that can create a mask ...
219652c8a08c4f2f682acd9f95a4e1b3fd36b70b
<|skeleton|> class DataTransform: """Data Transformer for training U-Net models.""" def __init__(self, resolution, which_challenge, mask_func=None, use_seed=True): """Args: mask_func (common.subsample.MaskFunc): A function that can create a mask of appropriate shape. resolution (int): Resolution of the...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DataTransform: """Data Transformer for training U-Net models.""" def __init__(self, resolution, which_challenge, mask_func=None, use_seed=True): """Args: mask_func (common.subsample.MaskFunc): A function that can create a mask of appropriate shape. resolution (int): Resolution of the image. which...
the_stack_v2_python_sparse
vs_rsn_fastmri/valid.py
Bala93/Holistic-MRI-Reconstruction
train
1
f04f140f9907bcc2315ae873c771811ca5dc9c6e
[ "self.index = int(index)\nself.valid = False\nself.delta = Coordinate2D(unit='arcsec')\nself.before = None\nself.after = None\nself.epoch = None\nself.utc_range = Range()\nself.next_utc = None\nself.parse_header(header)", "s = ''\nfor key, value in self.__dict__.items():\n s += f'{key}: {value}\\n'\nreturn s",...
<|body_start_0|> self.index = int(index) self.valid = False self.delta = Coordinate2D(unit='arcsec') self.before = None self.after = None self.epoch = None self.utc_range = Range() self.next_utc = None self.parse_header(header) <|end_body_0|> <|bo...
GyroDrift
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GyroDrift: def __init__(self, header, index): """Initializes a single drift. Contains information on a single drift consisting of a spatial delta between one time and another. Parameters ---------- header : fits.header.Header index : str or int The drift index identifier.""" <|bo...
stack_v2_sparse_classes_36k_train_010717
9,526
permissive
[ { "docstring": "Initializes a single drift. Contains information on a single drift consisting of a spatial delta between one time and another. Parameters ---------- header : fits.header.Header index : str or int The drift index identifier.", "name": "__init__", "signature": "def __init__(self, header, i...
4
stack_v2_sparse_classes_30k_test_000333
Implement the Python class `GyroDrift` described below. Class description: Implement the GyroDrift class. Method signatures and docstrings: - def __init__(self, header, index): Initializes a single drift. Contains information on a single drift consisting of a spatial delta between one time and another. Parameters ---...
Implement the Python class `GyroDrift` described below. Class description: Implement the GyroDrift class. Method signatures and docstrings: - def __init__(self, header, index): Initializes a single drift. Contains information on a single drift consisting of a spatial delta between one time and another. Parameters ---...
493700340cd34d5f319af6f3a562a82135bb30dd
<|skeleton|> class GyroDrift: def __init__(self, header, index): """Initializes a single drift. Contains information on a single drift consisting of a spatial delta between one time and another. Parameters ---------- header : fits.header.Header index : str or int The drift index identifier.""" <|bo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GyroDrift: def __init__(self, header, index): """Initializes a single drift. Contains information on a single drift consisting of a spatial delta between one time and another. Parameters ---------- header : fits.header.Header index : str or int The drift index identifier.""" self.index = int(i...
the_stack_v2_python_sparse
sofia_redux/scan/custom/sofia/info/gyro_drifts.py
SOFIA-USRA/sofia_redux
train
12
97fa4e181a1f55f1cd74680e46a85450435c8dbe
[ "self.food = food\nself.height = height\nself.width = width\nself.idx = 0\nself.pipe = deque([[0, 0]])\nself.snake = set()\nself.snake.add('0#0')\nself.piv = [0, 0]\nself.score = 0", "if direction == 'U':\n self.piv[0] -= 1\nif direction == 'L':\n self.piv[1] -= 1\nif direction == 'R':\n self.piv[1] += 1...
<|body_start_0|> self.food = food self.height = height self.width = width self.idx = 0 self.pipe = deque([[0, 0]]) self.snake = set() self.snake.add('0#0') self.piv = [0, 0] self.score = 0 <|end_body_0|> <|body_start_1|> if direction == 'U...
SnakeGame
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SnakeGame: def __init__(self, width, height, food): """Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. :typ...
stack_v2_sparse_classes_36k_train_010718
2,350
no_license
[ { "docstring": "Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. :type width: int :type height: int :type food: List[List[int]]", ...
2
null
Implement the Python class `SnakeGame` described below. Class description: Implement the SnakeGame class. Method signatures and docstrings: - def __init__(self, width, height, food): Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E...
Implement the Python class `SnakeGame` described below. Class description: Implement the SnakeGame class. Method signatures and docstrings: - def __init__(self, width, height, food): Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E...
196e58cd38db846653fb074cfd0363997121a7cf
<|skeleton|> class SnakeGame: def __init__(self, width, height, food): """Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. :typ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SnakeGame: def __init__(self, width, height, food): """Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. :type width: int :...
the_stack_v2_python_sparse
Design Snake Game.py
nithinveer/leetcode-solutions
train
0
671eb46ae04c718978037e2680592b8d7086387d
[ "filter_columns = self._filter_columns if hasattr(self, '_filter_columns') else []\ncolumns = [c for c in self.__table__.columns if c.name not in filter_columns]\nreturn {c.name: getattr(self, c.name) for c in columns}", "if 'default' not in kwargs:\n kwargs['default'] = lib.json_serializer\nreturn json.dumps(...
<|body_start_0|> filter_columns = self._filter_columns if hasattr(self, '_filter_columns') else [] columns = [c for c in self.__table__.columns if c.name not in filter_columns] return {c.name: getattr(self, c.name) for c in columns} <|end_body_0|> <|body_start_1|> if 'default' not in kw...
base class for models
BaseObject
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseObject: """base class for models""" def as_dict(self, **kwargs): """Get object as a dictionary""" <|body_0|> def json(self, **kwargs): """Get json string representation of object""" <|body_1|> def get_from_item(cls, db, the_item): """this...
stack_v2_sparse_classes_36k_train_010719
11,165
permissive
[ { "docstring": "Get object as a dictionary", "name": "as_dict", "signature": "def as_dict(self, **kwargs)" }, { "docstring": "Get json string representation of object", "name": "json", "signature": "def json(self, **kwargs)" }, { "docstring": "this function is auto-wired using th...
3
stack_v2_sparse_classes_30k_train_000845
Implement the Python class `BaseObject` described below. Class description: base class for models Method signatures and docstrings: - def as_dict(self, **kwargs): Get object as a dictionary - def json(self, **kwargs): Get json string representation of object - def get_from_item(cls, db, the_item): this function is au...
Implement the Python class `BaseObject` described below. Class description: base class for models Method signatures and docstrings: - def as_dict(self, **kwargs): Get object as a dictionary - def json(self, **kwargs): Get json string representation of object - def get_from_item(cls, db, the_item): this function is au...
c0c38c7b02f41f482b01f145b0348ecbb82952a9
<|skeleton|> class BaseObject: """base class for models""" def as_dict(self, **kwargs): """Get object as a dictionary""" <|body_0|> def json(self, **kwargs): """Get json string representation of object""" <|body_1|> def get_from_item(cls, db, the_item): """this...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseObject: """base class for models""" def as_dict(self, **kwargs): """Get object as a dictionary""" filter_columns = self._filter_columns if hasattr(self, '_filter_columns') else [] columns = [c for c in self.__table__.columns if c.name not in filter_columns] return {c.n...
the_stack_v2_python_sparse
slick/model.py
underscorenygren/slick
train
1
8a2945974629483c959c2473f5a2fcee81de1895
[ "lst = list(self.fields)\nif SETTINGS.get('admin_show_publisher'):\n lst.append('original_publisher')\nif SETTINGS.get('admin_show_saan') or SETTINGS.get('enforce_saan'):\n lst.append('saan')\nlst.append('publisher_fee')\nreturn lst", "if obj.controlled and obj.writer:\n return obj.writer.get_publisher_d...
<|body_start_0|> lst = list(self.fields) if SETTINGS.get('admin_show_publisher'): lst.append('original_publisher') if SETTINGS.get('admin_show_saan') or SETTINGS.get('enforce_saan'): lst.append('saan') lst.append('publisher_fee') return lst <|end_body_0|> ...
Inline interface for :class:`.models.WriterInWork`.
WriterInWorkInline
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WriterInWorkInline: """Inline interface for :class:`.models.WriterInWork`.""" def get_fields(self, *args, **kwargs): """Return list of fields depending on settings.""" <|body_0|> def original_publisher(self, obj): """Return the original publisher. This makes sens...
stack_v2_sparse_classes_36k_train_010720
33,789
permissive
[ { "docstring": "Return list of fields depending on settings.", "name": "get_fields", "signature": "def get_fields(self, *args, **kwargs)" }, { "docstring": "Return the original publisher. This makes sense only in the US context.", "name": "original_publisher", "signature": "def original_...
2
stack_v2_sparse_classes_30k_test_001093
Implement the Python class `WriterInWorkInline` described below. Class description: Inline interface for :class:`.models.WriterInWork`. Method signatures and docstrings: - def get_fields(self, *args, **kwargs): Return list of fields depending on settings. - def original_publisher(self, obj): Return the original publi...
Implement the Python class `WriterInWorkInline` described below. Class description: Inline interface for :class:`.models.WriterInWork`. Method signatures and docstrings: - def get_fields(self, *args, **kwargs): Return list of fields depending on settings. - def original_publisher(self, obj): Return the original publi...
298fe497670c02951d617aa6b6a6e03995fa6562
<|skeleton|> class WriterInWorkInline: """Inline interface for :class:`.models.WriterInWork`.""" def get_fields(self, *args, **kwargs): """Return list of fields depending on settings.""" <|body_0|> def original_publisher(self, obj): """Return the original publisher. This makes sens...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WriterInWorkInline: """Inline interface for :class:`.models.WriterInWork`.""" def get_fields(self, *args, **kwargs): """Return list of fields depending on settings.""" lst = list(self.fields) if SETTINGS.get('admin_show_publisher'): lst.append('original_publisher') ...
the_stack_v2_python_sparse
music_publisher/admin.py
Huanghibo/django-music-publisher
train
1
8af8dd684f38a5f1f5b9507f4f1d93b0c8c20210
[ "self.logger = logging.getLogger('PynealLog')\nself.settings = settings\nmask_img = nib.load(settings['maskFile'])\nif settings['maskIsWeighted'] is True:\n self.weightMask = True\n self.weights = mask_img.get_fdata().copy()\n self.mask = mask_img.get_fdata() > 0\nelse:\n self.weightMask = False\n se...
<|body_start_0|> self.logger = logging.getLogger('PynealLog') self.settings = settings mask_img = nib.load(settings['maskFile']) if settings['maskIsWeighted'] is True: self.weightMask = True self.weights = mask_img.get_fdata().copy() self.mask = mask_i...
Analysis Class This is the main Analysis module that gets instantiated by Pyneal, and will handle executing the specific analyses throughout the scan. The specific analysis functions that get used will be based on the analyses specified in the settings dictionary that gets passed in.
Analyzer
[ "MIT", "LicenseRef-scancode-free-unknown" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Analyzer: """Analysis Class This is the main Analysis module that gets instantiated by Pyneal, and will handle executing the specific analyses throughout the scan. The specific analysis functions that get used will be based on the analyses specified in the settings dictionary that gets passed in....
stack_v2_sparse_classes_36k_train_010721
6,539
permissive
[ { "docstring": "Initialize the class Parameters ---------- settings : dict dictionary that contains all of the pyneal settings for the current session. This dictionary is loaded/configured by the GUI once Pyneal is first launched", "name": "__init__", "signature": "def __init__(self, settings)" }, {...
4
stack_v2_sparse_classes_30k_train_008742
Implement the Python class `Analyzer` described below. Class description: Analysis Class This is the main Analysis module that gets instantiated by Pyneal, and will handle executing the specific analyses throughout the scan. The specific analysis functions that get used will be based on the analyses specified in the s...
Implement the Python class `Analyzer` described below. Class description: Analysis Class This is the main Analysis module that gets instantiated by Pyneal, and will handle executing the specific analyses throughout the scan. The specific analysis functions that get used will be based on the analyses specified in the s...
750f0ec5a231ccfa77aea960242de9b5019ba493
<|skeleton|> class Analyzer: """Analysis Class This is the main Analysis module that gets instantiated by Pyneal, and will handle executing the specific analyses throughout the scan. The specific analysis functions that get used will be based on the analyses specified in the settings dictionary that gets passed in....
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Analyzer: """Analysis Class This is the main Analysis module that gets instantiated by Pyneal, and will handle executing the specific analyses throughout the scan. The specific analysis functions that get used will be based on the analyses specified in the settings dictionary that gets passed in.""" def ...
the_stack_v2_python_sparse
src/pynealAnalysis.py
jeffmacinnes/pyneal
train
36
ffbcf06dfb4ca6f267808f4235baf87d86dcaf11
[ "E0 = a0 * m_e * c ** 2 * k0 / e\nzr = 0.5 * k0 * waist ** 2\nself.k0 = k0\nself.inv_waist2 = 1.0 / waist ** 2\nself.inv_zr = 1.0 / zr\nself.inv_tau = 1.0 / tau\nself.t_peak = t_peak\nself.E0 = E0\nself.v_antenna = source_v\nself.focal_length = focal_length\nself.boost = boost\nself.temporal_order = temporal_order\...
<|body_start_0|> E0 = a0 * m_e * c ** 2 * k0 / e zr = 0.5 * k0 * waist ** 2 self.k0 = k0 self.inv_waist2 = 1.0 / waist ** 2 self.inv_zr = 1.0 / zr self.inv_tau = 1.0 / tau self.t_peak = t_peak self.E0 = E0 self.v_antenna = source_v self.foc...
Class that calculates a Gaussian laser pulse.
GaussianProfile
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GaussianProfile: """Class that calculates a Gaussian laser pulse.""" def __init__(self, k0, waist, tau, t_peak, a0, dim, focal_length=0, temporal_order=2, boost=None, source_v=0, cep=0.0): """Define a Gaussian laser profile. (Gaussian transversally, hypergaussian longitudinally) This...
stack_v2_sparse_classes_36k_train_010722
34,589
permissive
[ { "docstring": "Define a Gaussian laser profile. (Gaussian transversally, hypergaussian longitudinally) This object can then be passed to the `EM3D` class, as the argument `laser_func`, in order to have a Gaussian laser emitted by the antenna. Parameters: ----------- k0: float (in meters^-1) Laser wavevector (i...
2
null
Implement the Python class `GaussianProfile` described below. Class description: Class that calculates a Gaussian laser pulse. Method signatures and docstrings: - def __init__(self, k0, waist, tau, t_peak, a0, dim, focal_length=0, temporal_order=2, boost=None, source_v=0, cep=0.0): Define a Gaussian laser profile. (G...
Implement the Python class `GaussianProfile` described below. Class description: Class that calculates a Gaussian laser pulse. Method signatures and docstrings: - def __init__(self, k0, waist, tau, t_peak, a0, dim, focal_length=0, temporal_order=2, boost=None, source_v=0, cep=0.0): Define a Gaussian laser profile. (G...
091c982f82788209017315e13eb7d0e743687d46
<|skeleton|> class GaussianProfile: """Class that calculates a Gaussian laser pulse.""" def __init__(self, k0, waist, tau, t_peak, a0, dim, focal_length=0, temporal_order=2, boost=None, source_v=0, cep=0.0): """Define a Gaussian laser profile. (Gaussian transversally, hypergaussian longitudinally) This...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GaussianProfile: """Class that calculates a Gaussian laser pulse.""" def __init__(self, k0, waist, tau, t_peak, a0, dim, focal_length=0, temporal_order=2, boost=None, source_v=0, cep=0.0): """Define a Gaussian laser profile. (Gaussian transversally, hypergaussian longitudinally) This object can t...
the_stack_v2_python_sparse
scripts/field_solvers/laser/laser_profiles.py
giadarol/warp
train
0
1b3538cb8b6ddc9180fb62f925ab213932bb6415
[ "self.__rootFile = ROOT.TFile(rootPath)\nself.__rootTree = self.__rootFile.Get('Config')\nself.__rootTree.GetEntry(0)", "leaf = self.__rootTree.GetLeaf(registerName)\nimport array\nregInfo = PRECINCT_INFO[precinctName][registerName]\nregData = array.array(ROOT_TYPECODE_2_ARRAY_TYPECODE[regInfo.typeCode], [0] * re...
<|body_start_0|> self.__rootFile = ROOT.TFile(rootPath) self.__rootTree = self.__rootFile.Get('Config') self.__rootTree.GetEntry(0) <|end_body_0|> <|body_start_1|> leaf = self.__rootTree.GetLeaf(registerName) import array regInfo = PRECINCT_INFO[precinctName][registerNam...
Provide LATC ROOT file data in form of python arrays
LATCRootFile
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LATCRootFile: """Provide LATC ROOT file data in form of python arrays""" def __init__(self, rootPath): """open ROOT File args: rootPath - path to input LATC ROOT file""" <|body_0|> def getRegisterData(self, precinctName, registerName): """retrieve single dimensio...
stack_v2_sparse_classes_36k_train_010723
9,121
permissive
[ { "docstring": "open ROOT File args: rootPath - path to input LATC ROOT file", "name": "__init__", "signature": "def __init__(self, rootPath)" }, { "docstring": "retrieve single dimensional python array with data for specified register", "name": "getRegisterData", "signature": "def getRe...
2
stack_v2_sparse_classes_30k_train_021452
Implement the Python class `LATCRootFile` described below. Class description: Provide LATC ROOT file data in form of python arrays Method signatures and docstrings: - def __init__(self, rootPath): open ROOT File args: rootPath - path to input LATC ROOT file - def getRegisterData(self, precinctName, registerName): ret...
Implement the Python class `LATCRootFile` described below. Class description: Provide LATC ROOT file data in form of python arrays Method signatures and docstrings: - def __init__(self, rootPath): open ROOT File args: rootPath - path to input LATC ROOT file - def getRegisterData(self, precinctName, registerName): ret...
3b824540d8173a24be12316a3821304e4ea20a1f
<|skeleton|> class LATCRootFile: """Provide LATC ROOT file data in form of python arrays""" def __init__(self, rootPath): """open ROOT File args: rootPath - path to input LATC ROOT file""" <|body_0|> def getRegisterData(self, precinctName, registerName): """retrieve single dimensio...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LATCRootFile: """Provide LATC ROOT file data in form of python arrays""" def __init__(self, rootPath): """open ROOT File args: rootPath - path to input LATC ROOT file""" self.__rootFile = ROOT.TFile(rootPath) self.__rootTree = self.__rootFile.Get('Config') self.__rootTree....
the_stack_v2_python_sparse
python/LATCRootData.py
fermi-lat/configData
train
0
704f263fc429f8f9a3d384ab1dd83372127d741e
[ "l = []\nfor fieldname in _columns.getColumnIds():\n l.append(getattr(self, fieldname))\nreturn l", "assert isinstance(_columns, Columns)\nl = []\nfor column in _columns:\n assert isinstance(column, Column)\n if column.isDataField():\n data_id = getattr(self, column.getId())\n if data_id is...
<|body_start_0|> l = [] for fieldname in _columns.getColumnIds(): l.append(getattr(self, fieldname)) return l <|end_body_0|> <|body_start_1|> assert isinstance(_columns, Columns) l = [] for column in _columns: assert isinstance(column, Column) ...
CsvMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CsvMixin: def to_list_old(self, _columns): """called by JsonRpcDispatcher to create TSV or CSV record. This is named after to_dict() which is defined in ndb.Model.""" <|body_0|> def to_list(self, _columns): """similar to to_list including dataId resolver.""" ...
stack_v2_sparse_classes_36k_train_010724
1,681
no_license
[ { "docstring": "called by JsonRpcDispatcher to create TSV or CSV record. This is named after to_dict() which is defined in ndb.Model.", "name": "to_list_old", "signature": "def to_list_old(self, _columns)" }, { "docstring": "similar to to_list including dataId resolver.", "name": "to_list", ...
2
stack_v2_sparse_classes_30k_train_006868
Implement the Python class `CsvMixin` described below. Class description: Implement the CsvMixin class. Method signatures and docstrings: - def to_list_old(self, _columns): called by JsonRpcDispatcher to create TSV or CSV record. This is named after to_dict() which is defined in ndb.Model. - def to_list(self, _column...
Implement the Python class `CsvMixin` described below. Class description: Implement the CsvMixin class. Method signatures and docstrings: - def to_list_old(self, _columns): called by JsonRpcDispatcher to create TSV or CSV record. This is named after to_dict() which is defined in ndb.Model. - def to_list(self, _column...
890d12095ac04b4fe6e60d7aacf6f46aa3865a81
<|skeleton|> class CsvMixin: def to_list_old(self, _columns): """called by JsonRpcDispatcher to create TSV or CSV record. This is named after to_dict() which is defined in ndb.Model.""" <|body_0|> def to_list(self, _columns): """similar to to_list including dataId resolver.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CsvMixin: def to_list_old(self, _columns): """called by JsonRpcDispatcher to create TSV or CSV record. This is named after to_dict() which is defined in ndb.Model.""" l = [] for fieldname in _columns.getColumnIds(): l.append(getattr(self, fieldname)) return l d...
the_stack_v2_python_sparse
odenkiapi/model/CsvMixin.py
TakashiSasaki/odenkiapi
train
0
937cd2831a22aef87c13f176e99ea3628e87ff03
[ "if len(nums) < 1:\n return []\nnum_set = set()\nresult = []\nfor num in nums:\n num_set.add(num)\nfor i in range(1, len(nums) + 1):\n if i not in num_set:\n result.append(i)\nreturn result", "if len(nums) < 1:\n return []\nres = []\nn = len(nums)\nfor num in nums:\n idx = abs(num) - 1\n ...
<|body_start_0|> if len(nums) < 1: return [] num_set = set() result = [] for num in nums: num_set.add(num) for i in range(1, len(nums) + 1): if i not in num_set: result.append(i) return result <|end_body_0|> <|body_star...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def find_disappeared_numbers(self, nums: List[int]) -> int: """找出没有出现过的数字 Args: nums: 数组 Returns: 没有出现过的数字""" <|body_0|> def find_disappeared_numbers2(self, nums: List[int]) -> int: """找出没有出现过的数字 Args: nums: 数组 Returns: 没有出现过的数字""" <|body_1|> <|end...
stack_v2_sparse_classes_36k_train_010725
2,512
permissive
[ { "docstring": "找出没有出现过的数字 Args: nums: 数组 Returns: 没有出现过的数字", "name": "find_disappeared_numbers", "signature": "def find_disappeared_numbers(self, nums: List[int]) -> int" }, { "docstring": "找出没有出现过的数字 Args: nums: 数组 Returns: 没有出现过的数字", "name": "find_disappeared_numbers2", "signature": "...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find_disappeared_numbers(self, nums: List[int]) -> int: 找出没有出现过的数字 Args: nums: 数组 Returns: 没有出现过的数字 - def find_disappeared_numbers2(self, nums: List[int]) -> int: 找出没有出现过的数字 ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find_disappeared_numbers(self, nums: List[int]) -> int: 找出没有出现过的数字 Args: nums: 数组 Returns: 没有出现过的数字 - def find_disappeared_numbers2(self, nums: List[int]) -> int: 找出没有出现过的数字 ...
50f35eef6a0ad63173efed10df3c835b1dceaa3f
<|skeleton|> class Solution: def find_disappeared_numbers(self, nums: List[int]) -> int: """找出没有出现过的数字 Args: nums: 数组 Returns: 没有出现过的数字""" <|body_0|> def find_disappeared_numbers2(self, nums: List[int]) -> int: """找出没有出现过的数字 Args: nums: 数组 Returns: 没有出现过的数字""" <|body_1|> <|end...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def find_disappeared_numbers(self, nums: List[int]) -> int: """找出没有出现过的数字 Args: nums: 数组 Returns: 没有出现过的数字""" if len(nums) < 1: return [] num_set = set() result = [] for num in nums: num_set.add(num) for i in range(1, len(nums) ...
the_stack_v2_python_sparse
src/leetcodepython/array/find_all_numbers_disappeared_array _448.py
zhangyu345293721/leetcode
train
101
6a1c209edf4081a080840ac24f1a7fe2c87dedc3
[ "if isinstance(message, dict):\n if message.get('title', None) is None or message.get('time', None) is None or message.get('body', None) is None:\n return False\n return True\nelse:\n return False", "super(EmailNotify, self).notify(message)\ntry:\n if not self.valid_message(message):\n r...
<|body_start_0|> if isinstance(message, dict): if message.get('title', None) is None or message.get('time', None) is None or message.get('body', None) is None: return False return True else: return False <|end_body_0|> <|body_start_1|> super(E...
Email Notify Class.
EmailNotify
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EmailNotify: """Email Notify Class.""" def valid_message(self, message): """Check whether message is available. :param message: :return:""" <|body_0|> def notify(self, message): """:param message: dict, must includes title, time and body; supplement is optional :...
stack_v2_sparse_classes_36k_train_010726
5,030
permissive
[ { "docstring": "Check whether message is available. :param message: :return:", "name": "valid_message", "signature": "def valid_message(self, message)" }, { "docstring": ":param message: dict, must includes title, time and body; supplement is optional :return:", "name": "notify", "signat...
2
null
Implement the Python class `EmailNotify` described below. Class description: Email Notify Class. Method signatures and docstrings: - def valid_message(self, message): Check whether message is available. :param message: :return: - def notify(self, message): :param message: dict, must includes title, time and body; sup...
Implement the Python class `EmailNotify` described below. Class description: Email Notify Class. Method signatures and docstrings: - def valid_message(self, message): Check whether message is available. :param message: :return: - def notify(self, message): :param message: dict, must includes title, time and body; sup...
8b97efdc9287645ea6b99dcf3a99fbe3f6ba6862
<|skeleton|> class EmailNotify: """Email Notify Class.""" def valid_message(self, message): """Check whether message is available. :param message: :return:""" <|body_0|> def notify(self, message): """:param message: dict, must includes title, time and body; supplement is optional :...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EmailNotify: """Email Notify Class.""" def valid_message(self, message): """Check whether message is available. :param message: :return:""" if isinstance(message, dict): if message.get('title', None) is None or message.get('time', None) is None or message.get('body', None) is ...
the_stack_v2_python_sparse
infrastructure/messenger/couriers.py
creditease-natrix/natrix
train
4
00f77d47348729011cdb5d9c27b7dfac6965db2b
[ "for field, type_info in fields_spec.items():\n has_default = not isinstance(type_info, type)\n if field not in config and (not has_default):\n raise RuntimeError('Configuration not complete. %s missing' % field)", "defaults = dict([(f, d) for f, d in fields_spec.items() if not isinstance(d, type)])\...
<|body_start_0|> for field, type_info in fields_spec.items(): has_default = not isinstance(type_info, type) if field not in config and (not has_default): raise RuntimeError('Configuration not complete. %s missing' % field) <|end_body_0|> <|body_start_1|> defaults...
A collection of methods/functions working on catalogues. The registry also holds information about the type of the input arguments
CatalogueFunctionRegistry
[ "AGPL-3.0-only", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CatalogueFunctionRegistry: """A collection of methods/functions working on catalogues. The registry also holds information about the type of the input arguments""" def check_config(self, config, fields_spec): """Check that `config` has each field in `fields_spec` if a default has not...
stack_v2_sparse_classes_36k_train_010727
5,960
permissive
[ { "docstring": "Check that `config` has each field in `fields_spec` if a default has not been provided.", "name": "check_config", "signature": "def check_config(self, config, fields_spec)" }, { "docstring": "Set default values got from `fields_spec` into the `config` dictionary", "name": "se...
4
null
Implement the Python class `CatalogueFunctionRegistry` described below. Class description: A collection of methods/functions working on catalogues. The registry also holds information about the type of the input arguments Method signatures and docstrings: - def check_config(self, config, fields_spec): Check that `con...
Implement the Python class `CatalogueFunctionRegistry` described below. Class description: A collection of methods/functions working on catalogues. The registry also holds information about the type of the input arguments Method signatures and docstrings: - def check_config(self, config, fields_spec): Check that `con...
0da9ba5a575360081715e8b90c71d4b16c6687c8
<|skeleton|> class CatalogueFunctionRegistry: """A collection of methods/functions working on catalogues. The registry also holds information about the type of the input arguments""" def check_config(self, config, fields_spec): """Check that `config` has each field in `fields_spec` if a default has not...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CatalogueFunctionRegistry: """A collection of methods/functions working on catalogues. The registry also holds information about the type of the input arguments""" def check_config(self, config, fields_spec): """Check that `config` has each field in `fields_spec` if a default has not been provide...
the_stack_v2_python_sparse
openquake/hmtk/registry.py
GFZ-Centre-for-Early-Warning/shakyground
train
1
115a90083d76ae4dc4d1315cec8bd6158a105fe0
[ "with ops.Graph().as_default():\n z1 = array_ops.identity(1)\n pivot = control_flow_ops.no_op()\n context = tpu_replication.TPUReplicateContext(b'context', 1, pivot=pivot)\n context.Enter()\n z2 = array_ops.identity(1)\n context.Exit()\n self.assertFalse(control_flow_util.IsInXLAContext(z1.op))...
<|body_start_0|> with ops.Graph().as_default(): z1 = array_ops.identity(1) pivot = control_flow_ops.no_op() context = tpu_replication.TPUReplicateContext(b'context', 1, pivot=pivot) context.Enter() z2 = array_ops.identity(1) context.Exit() ...
TPUContextTest
[ "Apache-2.0", "LicenseRef-scancode-generic-cla", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TPUContextTest: def testIsInContext(self): """Test that control_flow_util can check that we're in a TPU context.""" <|body_0|> def testHandlesNameCollision(self): """Test AddValue handles name collisions for ops from different graphs.""" <|body_1|> <|end_ske...
stack_v2_sparse_classes_36k_train_010728
8,993
permissive
[ { "docstring": "Test that control_flow_util can check that we're in a TPU context.", "name": "testIsInContext", "signature": "def testIsInContext(self)" }, { "docstring": "Test AddValue handles name collisions for ops from different graphs.", "name": "testHandlesNameCollision", "signatur...
2
null
Implement the Python class `TPUContextTest` described below. Class description: Implement the TPUContextTest class. Method signatures and docstrings: - def testIsInContext(self): Test that control_flow_util can check that we're in a TPU context. - def testHandlesNameCollision(self): Test AddValue handles name collisi...
Implement the Python class `TPUContextTest` described below. Class description: Implement the TPUContextTest class. Method signatures and docstrings: - def testIsInContext(self): Test that control_flow_util can check that we're in a TPU context. - def testHandlesNameCollision(self): Test AddValue handles name collisi...
a7f3934a67900720af3d3b15389551483bee50b8
<|skeleton|> class TPUContextTest: def testIsInContext(self): """Test that control_flow_util can check that we're in a TPU context.""" <|body_0|> def testHandlesNameCollision(self): """Test AddValue handles name collisions for ops from different graphs.""" <|body_1|> <|end_ske...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TPUContextTest: def testIsInContext(self): """Test that control_flow_util can check that we're in a TPU context.""" with ops.Graph().as_default(): z1 = array_ops.identity(1) pivot = control_flow_ops.no_op() context = tpu_replication.TPUReplicateContext(b'con...
the_stack_v2_python_sparse
tensorflow/python/tpu/tpu_test.py
tensorflow/tensorflow
train
208,740
0960020f36e83c50446ef6ea1006b6c5531c6f8d
[ "a, b = (ROOT.Comparable(), ROOT.Comparable())\nself.assertEqual(a, b)\nself.assertEqual(b, a)\nself.assertTrue(a.__eq__(b))\nself.assertTrue(b.__eq__(a))\nself.assertTrue(a.__ne__(a))\nself.assertTrue(b.__ne__(b))\nself.assertEqual(a.__eq__(b), True)\nself.assertEqual(b.__eq__(a), True)\nself.assertEqual(a.__eq__(...
<|body_start_0|> a, b = (ROOT.Comparable(), ROOT.Comparable()) self.assertEqual(a, b) self.assertEqual(b, a) self.assertTrue(a.__eq__(b)) self.assertTrue(b.__eq__(a)) self.assertTrue(a.__ne__(a)) self.assertTrue(b.__ne__(b)) self.assertEqual(a.__eq__(b), T...
Cpp07GloballyOverloadedComparator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Cpp07GloballyOverloadedComparator: def test1Comparator(self): """Check that the global operator!=/== is picked up""" <|body_0|> def test2Comparator(self): """Check that the namespaced global operator!=/== is picked up""" <|body_1|> def test3DirectUseComp...
stack_v2_sparse_classes_36k_train_010729
30,462
no_license
[ { "docstring": "Check that the global operator!=/== is picked up", "name": "test1Comparator", "signature": "def test1Comparator(self)" }, { "docstring": "Check that the namespaced global operator!=/== is picked up", "name": "test2Comparator", "signature": "def test2Comparator(self)" },...
3
stack_v2_sparse_classes_30k_train_013479
Implement the Python class `Cpp07GloballyOverloadedComparator` described below. Class description: Implement the Cpp07GloballyOverloadedComparator class. Method signatures and docstrings: - def test1Comparator(self): Check that the global operator!=/== is picked up - def test2Comparator(self): Check that the namespac...
Implement the Python class `Cpp07GloballyOverloadedComparator` described below. Class description: Implement the Cpp07GloballyOverloadedComparator class. Method signatures and docstrings: - def test1Comparator(self): Check that the global operator!=/== is picked up - def test2Comparator(self): Check that the namespac...
134508460915282a5d82d6cbbb6e6afa14653413
<|skeleton|> class Cpp07GloballyOverloadedComparator: def test1Comparator(self): """Check that the global operator!=/== is picked up""" <|body_0|> def test2Comparator(self): """Check that the namespaced global operator!=/== is picked up""" <|body_1|> def test3DirectUseComp...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Cpp07GloballyOverloadedComparator: def test1Comparator(self): """Check that the global operator!=/== is picked up""" a, b = (ROOT.Comparable(), ROOT.Comparable()) self.assertEqual(a, b) self.assertEqual(b, a) self.assertTrue(a.__eq__(b)) self.assertTrue(b.__eq__...
the_stack_v2_python_sparse
python/cpp/PyROOT_advancedtests.py
root-project/roottest
train
41
74a2af8d8b59b0cb3142fee192a8e4e5ac293e7f
[ "super(Jade, self).setup()\nself.argv.append(self.jade or 'jade')\nself.argv.append('--client')\nif self.jade_no_debug:\n self.argv.append('--no-debug')\nif not self.js_var:\n self.js_var = 'templates'", "proc = subprocess.Popen(self.argv, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIP...
<|body_start_0|> super(Jade, self).setup() self.argv.append(self.jade or 'jade') self.argv.append('--client') if self.jade_no_debug: self.argv.append('--no-debug') if not self.js_var: self.js_var = 'templates' <|end_body_0|> <|body_start_1|> proc ...
Converts `Jade <http://jade-lang.com/>`_ templates to client-side JavaScript functions. Requires the Jade executable to be available externally. You can install it using the `Node Package Manager <http://npmjs.org/>`_:: $ npm install jade Jade templates are compiled and stored in a window-level JavaScript object under ...
Jade
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Jade: """Converts `Jade <http://jade-lang.com/>`_ templates to client-side JavaScript functions. Requires the Jade executable to be available externally. You can install it using the `Node Package Manager <http://npmjs.org/>`_:: $ npm install jade Jade templates are compiled and stored in a windo...
stack_v2_sparse_classes_36k_train_010730
4,016
permissive
[ { "docstring": "Check options and apply defaults if necessary", "name": "setup", "signature": "def setup(self)" }, { "docstring": "Compile individual Jade templates", "name": "input", "signature": "def input(self, _in, out, **kwargs)" }, { "docstring": "Prepend Jade runtime and i...
3
null
Implement the Python class `Jade` described below. Class description: Converts `Jade <http://jade-lang.com/>`_ templates to client-side JavaScript functions. Requires the Jade executable to be available externally. You can install it using the `Node Package Manager <http://npmjs.org/>`_:: $ npm install jade Jade templ...
Implement the Python class `Jade` described below. Class description: Converts `Jade <http://jade-lang.com/>`_ templates to client-side JavaScript functions. Requires the Jade executable to be available externally. You can install it using the `Node Package Manager <http://npmjs.org/>`_:: $ npm install jade Jade templ...
65b7a50b22fcb9dadc7e91a98225f6ca2b33f3b8
<|skeleton|> class Jade: """Converts `Jade <http://jade-lang.com/>`_ templates to client-side JavaScript functions. Requires the Jade executable to be available externally. You can install it using the `Node Package Manager <http://npmjs.org/>`_:: $ npm install jade Jade templates are compiled and stored in a windo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Jade: """Converts `Jade <http://jade-lang.com/>`_ templates to client-side JavaScript functions. Requires the Jade executable to be available externally. You can install it using the `Node Package Manager <http://npmjs.org/>`_:: $ npm install jade Jade templates are compiled and stored in a window-level JavaS...
the_stack_v2_python_sparse
weppy_assets/webassets/filter/jade.py
gi0baro/weppy-assets
train
2
397e735b5a62ed49e22c9d50970bc0f817a9cac2
[ "self.argmax_ndvi = argmax_ndvi\nself.argmin_ndvi = argmin_ndvi\nself.argmax_red = argmax_red\nself.argmax_ndvi_slope = argmax_ndvi_slope\nself.argmin_ndvi_slope = argmin_ndvi_slope\nself.feats_feature = feats_feature\nself.data_feature = data_feature\nif indices is None:\n indices = [2, 3, 7, 11]\nself.indices ...
<|body_start_0|> self.argmax_ndvi = argmax_ndvi self.argmin_ndvi = argmin_ndvi self.argmax_red = argmax_red self.argmax_ndvi_slope = argmax_ndvi_slope self.argmin_ndvi_slope = argmin_ndvi_slope self.feats_feature = feats_feature self.data_feature = data_feature ...
Task that implements and adds to eopatch the spatio-temporal features proposed in [1]. This task assumes that the argmax/argmin of NDVI, NDVI slope and B4 are present in eopatch. The computed spatio-temporal features correspond to the concatenation of reflectance (green, red, near-infrared and short-wave infrared in [1...
AddSpatioTemporalFeaturesTask
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AddSpatioTemporalFeaturesTask: """Task that implements and adds to eopatch the spatio-temporal features proposed in [1]. This task assumes that the argmax/argmin of NDVI, NDVI slope and B4 are present in eopatch. The computed spatio-temporal features correspond to the concatenation of reflectance...
stack_v2_sparse_classes_36k_train_010731
10,624
permissive
[ { "docstring": "Class constructor Initialisation of task variables. The name of the dictionary keys that will be used for the computation of the features needs to be specified. These features are assumed to be existing in the eopatch. The indices of the reflectances to be used as features is an input parameter....
2
stack_v2_sparse_classes_30k_train_003039
Implement the Python class `AddSpatioTemporalFeaturesTask` described below. Class description: Task that implements and adds to eopatch the spatio-temporal features proposed in [1]. This task assumes that the argmax/argmin of NDVI, NDVI slope and B4 are present in eopatch. The computed spatio-temporal features corresp...
Implement the Python class `AddSpatioTemporalFeaturesTask` described below. Class description: Task that implements and adds to eopatch the spatio-temporal features proposed in [1]. This task assumes that the argmax/argmin of NDVI, NDVI slope and B4 are present in eopatch. The computed spatio-temporal features corresp...
a65899e4632b50c9c41a67e1f7698c09b929d840
<|skeleton|> class AddSpatioTemporalFeaturesTask: """Task that implements and adds to eopatch the spatio-temporal features proposed in [1]. This task assumes that the argmax/argmin of NDVI, NDVI slope and B4 are present in eopatch. The computed spatio-temporal features correspond to the concatenation of reflectance...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AddSpatioTemporalFeaturesTask: """Task that implements and adds to eopatch the spatio-temporal features proposed in [1]. This task assumes that the argmax/argmin of NDVI, NDVI slope and B4 are present in eopatch. The computed spatio-temporal features correspond to the concatenation of reflectance (green, red,...
the_stack_v2_python_sparse
features/eolearn/features/temporal_features.py
sentinel-hub/eo-learn
train
1,072
3248b044a38f8f177a84c24d2eda205f09e9c038
[ "cur_time = datetime.fromtimestamp(1036)\ntimestamp_array = []\nresponse = common.check_date(cur_time, timestamp_array)\nassert response is False", "cur_time = datetime.fromtimestamp(1036)\ntimestamp_array = []\nresponse = common.check_run_status(timestamp_array, cur_time, 1, None, 'hourly', None)\nassert respons...
<|body_start_0|> cur_time = datetime.fromtimestamp(1036) timestamp_array = [] response = common.check_date(cur_time, timestamp_array) assert response is False <|end_body_0|> <|body_start_1|> cur_time = datetime.fromtimestamp(1036) timestamp_array = [] response = ...
Contains all the tests for common Diagnostic
TestDiagnosticsCommon
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestDiagnosticsCommon: """Contains all the tests for common Diagnostic""" def test_common_check_date(self): """test the common check date""" <|body_0|> def test_common_check_run_status(self): """test the common check run status""" <|body_1|> def test...
stack_v2_sparse_classes_36k_train_010732
14,928
permissive
[ { "docstring": "test the common check date", "name": "test_common_check_date", "signature": "def test_common_check_date(self)" }, { "docstring": "test the common check run status", "name": "test_common_check_run_status", "signature": "def test_common_check_run_status(self)" }, { ...
4
null
Implement the Python class `TestDiagnosticsCommon` described below. Class description: Contains all the tests for common Diagnostic Method signatures and docstrings: - def test_common_check_date(self): test the common check date - def test_common_check_run_status(self): test the common check run status - def test_com...
Implement the Python class `TestDiagnosticsCommon` described below. Class description: Contains all the tests for common Diagnostic Method signatures and docstrings: - def test_common_check_date(self): test the common check date - def test_common_check_run_status(self): test the common check run status - def test_com...
24d50729aef8d91036cc13b0f5c03be76f3237ed
<|skeleton|> class TestDiagnosticsCommon: """Contains all the tests for common Diagnostic""" def test_common_check_date(self): """test the common check date""" <|body_0|> def test_common_check_run_status(self): """test the common check run status""" <|body_1|> def test...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestDiagnosticsCommon: """Contains all the tests for common Diagnostic""" def test_common_check_date(self): """test the common check date""" cur_time = datetime.fromtimestamp(1036) timestamp_array = [] response = common.check_date(cur_time, timestamp_array) assert ...
the_stack_v2_python_sparse
EnergyEfficiency/AirsideRCxAgent/airside/test.py
shwethanidd/volttron-pnnl-applications-2
train
0
a05ad29d5592a1517c358384b5559256a8cf13b0
[ "self.existing_robots.append(self)\nself.name = None\nself.reset()", "letters = ''.join(random.sample(string.uppercase, self.LETTERS))\nnumbers = random.randint(0, 10 ** self.DIGITS - 1)\nreturn letters + '{0:0{1}}'.format(numbers, self.DIGITS)", "while True:\n name = self.generate_name()\n if name not in...
<|body_start_0|> self.existing_robots.append(self) self.name = None self.reset() <|end_body_0|> <|body_start_1|> letters = ''.join(random.sample(string.uppercase, self.LETTERS)) numbers = random.randint(0, 10 ** self.DIGITS - 1) return letters + '{0:0{1}}'.format(numbers...
A robot with a unique random name.
Robot
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Robot: """A robot with a unique random name.""" def __init__(self): """Create (and boot up) a new robot with a random name.""" <|body_0|> def generate_name(self): """Generate a new random robot name.""" <|body_1|> def reset(self): """Reset ro...
stack_v2_sparse_classes_36k_train_010733
858
no_license
[ { "docstring": "Create (and boot up) a new robot with a random name.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Generate a new random robot name.", "name": "generate_name", "signature": "def generate_name(self)" }, { "docstring": "Reset robot's nam...
3
stack_v2_sparse_classes_30k_train_016750
Implement the Python class `Robot` described below. Class description: A robot with a unique random name. Method signatures and docstrings: - def __init__(self): Create (and boot up) a new robot with a random name. - def generate_name(self): Generate a new random robot name. - def reset(self): Reset robot's name.
Implement the Python class `Robot` described below. Class description: A robot with a unique random name. Method signatures and docstrings: - def __init__(self): Create (and boot up) a new robot with a random name. - def generate_name(self): Generate a new random robot name. - def reset(self): Reset robot's name. <|...
be0e2f635a7558f56c61bc0b36c6146b01d1e6e6
<|skeleton|> class Robot: """A robot with a unique random name.""" def __init__(self): """Create (and boot up) a new robot with a random name.""" <|body_0|> def generate_name(self): """Generate a new random robot name.""" <|body_1|> def reset(self): """Reset ro...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Robot: """A robot with a unique random name.""" def __init__(self): """Create (and boot up) a new robot with a random name.""" self.existing_robots.append(self) self.name = None self.reset() def generate_name(self): """Generate a new random robot name.""" ...
the_stack_v2_python_sparse
all_data/exercism_data/python/robot-name/480850c388f94bfab36a461b16d658f3.py
itsolutionscorp/AutoStyle-Clustering
train
4
58c365a77cb3a8fbf63ed0bf940313624d084707
[ "super(Domain, self).__init__(xh)\nself.dg = 0.5 * self.dxh\nreturn", "self.p = order\nq = polys.Legendre()\nself.zp = q.zeros[order]\nself.wp = q.weights[order]\nb = polys.Lagrange()\nb.interpolate(self.zp, np.ones(self.p))\nself.Lm1 = np.zeros(self.nh * self.p)\nself.Lp1 = np.zeros(self.nh * self.p)\nself.xp = ...
<|body_start_0|> super(Domain, self).__init__(xh) self.dg = 0.5 * self.dxh return <|end_body_0|> <|body_start_1|> self.p = order q = polys.Legendre() self.zp = q.zeros[order] self.wp = q.weights[order] b = polys.Lagrange() b.interpolate(self.zp, n...
Domain for a discontinuous galerkin field has attributes for cell vertex and nodal points, quadrature points and weights, cell boundary extrapolation vectors and cell jacobians, and mass matrix
Domain
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Domain: """Domain for a discontinuous galerkin field has attributes for cell vertex and nodal points, quadrature points and weights, cell boundary extrapolation vectors and cell jacobians, and mass matrix""" def __init__(self, xh): """initialise Domain with cell vertices and sizes"""...
stack_v2_sparse_classes_36k_train_010734
4,877
no_license
[ { "docstring": "initialise Domain with cell vertices and sizes", "name": "__init__", "signature": "def __init__(self, xh)" }, { "docstring": "set the expansion basis type and order, and the quadrature point type calculate the physical nodal points, cell jacobians and cell boundary extrapolation ...
2
stack_v2_sparse_classes_30k_train_008126
Implement the Python class `Domain` described below. Class description: Domain for a discontinuous galerkin field has attributes for cell vertex and nodal points, quadrature points and weights, cell boundary extrapolation vectors and cell jacobians, and mass matrix Method signatures and docstrings: - def __init__(sel...
Implement the Python class `Domain` described below. Class description: Domain for a discontinuous galerkin field has attributes for cell vertex and nodal points, quadrature points and weights, cell boundary extrapolation vectors and cell jacobians, and mass matrix Method signatures and docstrings: - def __init__(sel...
35ccd15fce4df144446b84319cf467562a69a44b
<|skeleton|> class Domain: """Domain for a discontinuous galerkin field has attributes for cell vertex and nodal points, quadrature points and weights, cell boundary extrapolation vectors and cell jacobians, and mass matrix""" def __init__(self, xh): """initialise Domain with cell vertices and sizes"""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Domain: """Domain for a discontinuous galerkin field has attributes for cell vertex and nodal points, quadrature points and weights, cell boundary extrapolation vectors and cell jacobians, and mass matrix""" def __init__(self, xh): """initialise Domain with cell vertices and sizes""" supe...
the_stack_v2_python_sparse
dg/fields.py
JHopeCollins/Sandbox
train
0
6f413b9fbf7b5a3ca34a221788db176c5dac95b6
[ "yamllint_configs = {'extends': 'default', 'rules': {'document-start': {'present': False}}}\nif document_start:\n yamllint_configs['rules']['document-start']['present'] = True\nreturn yaml.dump(yamllint_configs)", "args = ('-f', 'parsable', filename)\nif yamllint_config:\n args += ('--config-file=' + yamlli...
<|body_start_0|> yamllint_configs = {'extends': 'default', 'rules': {'document-start': {'present': False}}} if document_start: yamllint_configs['rules']['document-start']['present'] = True return yaml.dump(yamllint_configs) <|end_body_0|> <|body_start_1|> args = ('-f', 'pars...
Check yaml code for errors and possible problems. You can read more about capabilities at <http://yamllint.readthedocs.org/en/latest/rules.html>.
YAMLLintBear
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class YAMLLintBear: """Check yaml code for errors and possible problems. You can read more about capabilities at <http://yamllint.readthedocs.org/en/latest/rules.html>.""" def generate_config(filename, file, document_start: bool=False): """:param document_start: Use this rule to require or...
stack_v2_sparse_classes_36k_train_010735
1,798
no_license
[ { "docstring": ":param document_start: Use this rule to require or forbid the use of document start marker (---).", "name": "generate_config", "signature": "def generate_config(filename, file, document_start: bool=False)" }, { "docstring": ":param yamllint_config: Path to a custom configuration ...
2
null
Implement the Python class `YAMLLintBear` described below. Class description: Check yaml code for errors and possible problems. You can read more about capabilities at <http://yamllint.readthedocs.org/en/latest/rules.html>. Method signatures and docstrings: - def generate_config(filename, file, document_start: bool=F...
Implement the Python class `YAMLLintBear` described below. Class description: Check yaml code for errors and possible problems. You can read more about capabilities at <http://yamllint.readthedocs.org/en/latest/rules.html>. Method signatures and docstrings: - def generate_config(filename, file, document_start: bool=F...
278e4f6f8ce4677e213150716704330d83debf9f
<|skeleton|> class YAMLLintBear: """Check yaml code for errors and possible problems. You can read more about capabilities at <http://yamllint.readthedocs.org/en/latest/rules.html>.""" def generate_config(filename, file, document_start: bool=False): """:param document_start: Use this rule to require or...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class YAMLLintBear: """Check yaml code for errors and possible problems. You can read more about capabilities at <http://yamllint.readthedocs.org/en/latest/rules.html>.""" def generate_config(filename, file, document_start: bool=False): """:param document_start: Use this rule to require or forbid the u...
the_stack_v2_python_sparse
ve/Lib/site-packages/bears/yml/YAMLLintBear.py
lugnitdgp/avskr2.0
train
4
52b4cf039b39431b1e8b169f4e5a4f969a1eee95
[ "self.ptr = c_void_p()\nself.obj = byref(self.ptr)\nself.indices = numpy.empty(len(dims), numpy.uintp)\nMINTLIB.mnt_multiarrayiter_new.argtypes = [POINTER(c_void_p), c_int, SIZE_T_ARRAY_PTR]\nier = MINTLIB.mnt_multiarrayiter_new(self.obj, len(dims), numpy.array(dims, numpy.uint64))\nif ier:\n error_handler(FILE,...
<|body_start_0|> self.ptr = c_void_p() self.obj = byref(self.ptr) self.indices = numpy.empty(len(dims), numpy.uintp) MINTLIB.mnt_multiarrayiter_new.argtypes = [POINTER(c_void_p), c_int, SIZE_T_ARRAY_PTR] ier = MINTLIB.mnt_multiarrayiter_new(self.obj, len(dims), numpy.array(dims, ...
A class to iterate data across time, elevation and other non-spatial dimensions
MultiArrayIter
[ "0BSD" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiArrayIter: """A class to iterate data across time, elevation and other non-spatial dimensions""" def __init__(self, dims): """Constructor. :param dims array of data dimensions""" <|body_0|> def __del__(self): """Destructor.""" <|body_1|> def beg...
stack_v2_sparse_classes_36k_train_010736
2,666
permissive
[ { "docstring": "Constructor. :param dims array of data dimensions", "name": "__init__", "signature": "def __init__(self, dims)" }, { "docstring": "Destructor.", "name": "__del__", "signature": "def __del__(self)" }, { "docstring": "Set the iterator to the beginning.", "name":...
6
null
Implement the Python class `MultiArrayIter` described below. Class description: A class to iterate data across time, elevation and other non-spatial dimensions Method signatures and docstrings: - def __init__(self, dims): Constructor. :param dims array of data dimensions - def __del__(self): Destructor. - def begin(s...
Implement the Python class `MultiArrayIter` described below. Class description: A class to iterate data across time, elevation and other non-spatial dimensions Method signatures and docstrings: - def __init__(self, dims): Constructor. :param dims array of data dimensions - def __del__(self): Destructor. - def begin(s...
50c2c66bce5e09cf14f9f244da67ab4be84fbe5b
<|skeleton|> class MultiArrayIter: """A class to iterate data across time, elevation and other non-spatial dimensions""" def __init__(self, dims): """Constructor. :param dims array of data dimensions""" <|body_0|> def __del__(self): """Destructor.""" <|body_1|> def beg...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MultiArrayIter: """A class to iterate data across time, elevation and other non-spatial dimensions""" def __init__(self, dims): """Constructor. :param dims array of data dimensions""" self.ptr = c_void_p() self.obj = byref(self.ptr) self.indices = numpy.empty(len(dims), nu...
the_stack_v2_python_sparse
mint/multi_array_iter.py
pletzer/mint
train
6
7de688acc3b1a209bd8712d8788c7e41aa9f1578
[ "num1_copy = nums1[:]\np1, p2 = (0, 0)\nfor i in range(len(num1_copy)):\n if p1 == m:\n nums1[i] = nums2[p2]\n p2 += 1\n elif p2 == n:\n nums1[i] = num1_copy[p1]\n p1 += 1\n elif num1_copy[p1] <= nums2[p2]:\n nums1[i] = num1_copy[p1]\n p1 += 1\n else:\n n...
<|body_start_0|> num1_copy = nums1[:] p1, p2 = (0, 0) for i in range(len(num1_copy)): if p1 == m: nums1[i] = nums2[p2] p2 += 1 elif p2 == n: nums1[i] = num1_copy[p1] p1 += 1 elif num1_copy[p1] <= ...
Idea Detailed Implementation: Create a copy of nums1, and use it to compare with nums2. The intuition is similar to two pointer sliding over two array. Since, we know the elements in both array were sorted, so it's ok two use two pointer strategy. If the value in nums1_copy is greater than nums2, and copy it to nums1(b...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """Idea Detailed Implementation: Create a copy of nums1, and use it to compare with nums2. The intuition is similar to two pointer sliding over two array. Since, we know the elements in both array were sorted, so it's ok two use two pointer strategy. If the value in nums1_copy is greate...
stack_v2_sparse_classes_36k_train_010737
5,244
no_license
[ { "docstring": "Do not return anything, modify nums1 in-place instead.", "name": "merge2", "signature": "def merge2(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None" }, { "docstring": "Do not return anything, modify nums1 in-place instead.", "name": "merge3", "signature"...
3
stack_v2_sparse_classes_30k_train_002907
Implement the Python class `Solution` described below. Class description: Idea Detailed Implementation: Create a copy of nums1, and use it to compare with nums2. The intuition is similar to two pointer sliding over two array. Since, we know the elements in both array were sorted, so it's ok two use two pointer strateg...
Implement the Python class `Solution` described below. Class description: Idea Detailed Implementation: Create a copy of nums1, and use it to compare with nums2. The intuition is similar to two pointer sliding over two array. Since, we know the elements in both array were sorted, so it's ok two use two pointer strateg...
9d9b3eff8251effcd3d6d9d1fbc9de6341f9f426
<|skeleton|> class Solution: """Idea Detailed Implementation: Create a copy of nums1, and use it to compare with nums2. The intuition is similar to two pointer sliding over two array. Since, we know the elements in both array were sorted, so it's ok two use two pointer strategy. If the value in nums1_copy is greate...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: """Idea Detailed Implementation: Create a copy of nums1, and use it to compare with nums2. The intuition is similar to two pointer sliding over two array. Since, we know the elements in both array were sorted, so it's ok two use two pointer strategy. If the value in nums1_copy is greater than nums2,...
the_stack_v2_python_sparse
实战例题/Array_and_Two_Pointer/88.Merge_sorted_array.py
SilasYa/2021_SU_Algorithms
train
0
5d8ca1051c952063654c28ac2117bedac70221ed
[ "if root == None:\n return (0, True)\nif root.left == None and root.right == None:\n return (1, True)\nleft_depth, left_flag = self.maxDepth(root.left)\nright_depth, right_flag = self.maxDepth(root.right)\nif abs(left_depth - right_depth) < 2 and (left_flag and right_flag):\n return (max(left_depth, right_...
<|body_start_0|> if root == None: return (0, True) if root.left == None and root.right == None: return (1, True) left_depth, left_flag = self.maxDepth(root.left) right_depth, right_flag = self.maxDepth(root.right) if abs(left_depth - right_depth) < 2 and (...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxDepth(self, root): """:type root: TreeNode :rtype: int""" <|body_0|> def isBalanced(self, root): """:type root: TreeNode :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> if root == None: return (0, True) ...
stack_v2_sparse_classes_36k_train_010738
1,567
no_license
[ { "docstring": ":type root: TreeNode :rtype: int", "name": "maxDepth", "signature": "def maxDepth(self, root)" }, { "docstring": ":type root: TreeNode :rtype: bool", "name": "isBalanced", "signature": "def isBalanced(self, root)" } ]
2
stack_v2_sparse_classes_30k_train_016769
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxDepth(self, root): :type root: TreeNode :rtype: int - def isBalanced(self, root): :type root: TreeNode :rtype: bool
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxDepth(self, root): :type root: TreeNode :rtype: int - def isBalanced(self, root): :type root: TreeNode :rtype: bool <|skeleton|> class Solution: def maxDepth(self, r...
4a7f24a6fbba9b8bdb2bcdc8c416d39fb60970c5
<|skeleton|> class Solution: def maxDepth(self, root): """:type root: TreeNode :rtype: int""" <|body_0|> def isBalanced(self, root): """:type root: TreeNode :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxDepth(self, root): """:type root: TreeNode :rtype: int""" if root == None: return (0, True) if root.left == None and root.right == None: return (1, True) left_depth, left_flag = self.maxDepth(root.left) right_depth, right_flag = ...
the_stack_v2_python_sparse
leetcode_python/Balanced_Binary_Tree_110.py
xiaoxiaojiangshang/LeetCode
train
0
8e5749d582627e01df978ee621d036a5016a53ac
[ "self.Kp = P\nself.Ki = I\nself.Kd = D\nself.dt = dt\nself.heights = 0\nif simple:\n self.clear_simple()\nelse:\n self.clear()", "self.integral = 0\nself.previous_error = 0\nself.window_up = 20", "if self.Ki != 0:\n self.Ti = self.Kp / self.Ki\nelse:\n self.Ti = 10000000\nif self.Kd != 0:\n self....
<|body_start_0|> self.Kp = P self.Ki = I self.Kd = D self.dt = dt self.heights = 0 if simple: self.clear_simple() else: self.clear() <|end_body_0|> <|body_start_1|> self.integral = 0 self.previous_error = 0 self.win...
PID
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PID: def __init__(self, P, I, D, dt, simple): """PID definitions Parameters ---------- P : Proportional gain I : Integral gain D : Derivative gain dt : Sample time""" <|body_0|> def clear_simple(self): """Variables initialization for update_simple() Parameters ------...
stack_v2_sparse_classes_36k_train_010739
3,290
permissive
[ { "docstring": "PID definitions Parameters ---------- P : Proportional gain I : Integral gain D : Derivative gain dt : Sample time", "name": "__init__", "signature": "def __init__(self, P, I, D, dt, simple)" }, { "docstring": "Variables initialization for update_simple() Parameters ---------- se...
5
stack_v2_sparse_classes_30k_test_000996
Implement the Python class `PID` described below. Class description: Implement the PID class. Method signatures and docstrings: - def __init__(self, P, I, D, dt, simple): PID definitions Parameters ---------- P : Proportional gain I : Integral gain D : Derivative gain dt : Sample time - def clear_simple(self): Variab...
Implement the Python class `PID` described below. Class description: Implement the PID class. Method signatures and docstrings: - def __init__(self, P, I, D, dt, simple): PID definitions Parameters ---------- P : Proportional gain I : Integral gain D : Derivative gain dt : Sample time - def clear_simple(self): Variab...
da67c53cb7fc7f16c0df862a5cff820e9a0a470f
<|skeleton|> class PID: def __init__(self, P, I, D, dt, simple): """PID definitions Parameters ---------- P : Proportional gain I : Integral gain D : Derivative gain dt : Sample time""" <|body_0|> def clear_simple(self): """Variables initialization for update_simple() Parameters ------...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PID: def __init__(self, P, I, D, dt, simple): """PID definitions Parameters ---------- P : Proportional gain I : Integral gain D : Derivative gain dt : Sample time""" self.Kp = P self.Ki = I self.Kd = D self.dt = dt self.heights = 0 if simple: ...
the_stack_v2_python_sparse
ros_radar_mine/neuro_learning/controller/pid/myPID.py
marina-go-al/blimp_snn
train
0
dffe148df558e00b55ab2743ad037ecd5f084682
[ "if not nums:\n return -1\nleft, right = (0, len(nums) - 1)\nwhile 1:\n mid = (left + right) // 2\n if nums[mid] == target:\n return mid\n if nums[left] == target:\n return left\n if nums[right] == target:\n return right\n if left > right:\n return -1\n if nums[mid] ...
<|body_start_0|> if not nums: return -1 left, right = (0, len(nums) - 1) while 1: mid = (left + right) // 2 if nums[mid] == target: return mid if nums[left] == target: return left if nums[right] == target...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def search(self, nums, target): """:type nums: List[int] :type target: int :rtype: int 0,1,2,3,4,5,6,7,8,9 3,4,5,6,7,8,9,|0,1,2 8,9,|0,1,2,3,4,5,6,7""" <|body_0|> def search2(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" ...
stack_v2_sparse_classes_36k_train_010740
1,851
no_license
[ { "docstring": ":type nums: List[int] :type target: int :rtype: int 0,1,2,3,4,5,6,7,8,9 3,4,5,6,7,8,9,|0,1,2 8,9,|0,1,2,3,4,5,6,7", "name": "search", "signature": "def search(self, nums, target)" }, { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "search2", ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def search(self, nums, target): :type nums: List[int] :type target: int :rtype: int 0,1,2,3,4,5,6,7,8,9 3,4,5,6,7,8,9,|0,1,2 8,9,|0,1,2,3,4,5,6,7 - def search2(self, nums, target...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def search(self, nums, target): :type nums: List[int] :type target: int :rtype: int 0,1,2,3,4,5,6,7,8,9 3,4,5,6,7,8,9,|0,1,2 8,9,|0,1,2,3,4,5,6,7 - def search2(self, nums, target...
85128e7d26157b3c36eb43868269de42ea2fcb98
<|skeleton|> class Solution: def search(self, nums, target): """:type nums: List[int] :type target: int :rtype: int 0,1,2,3,4,5,6,7,8,9 3,4,5,6,7,8,9,|0,1,2 8,9,|0,1,2,3,4,5,6,7""" <|body_0|> def search2(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def search(self, nums, target): """:type nums: List[int] :type target: int :rtype: int 0,1,2,3,4,5,6,7,8,9 3,4,5,6,7,8,9,|0,1,2 8,9,|0,1,2,3,4,5,6,7""" if not nums: return -1 left, right = (0, len(nums) - 1) while 1: mid = (left + right) // 2 ...
the_stack_v2_python_sparse
src/Search in Rotated Sorted Array.py
jsdiuf/leetcode
train
1
b7077645900666334948ab5b00e3d751f77c8cb7
[ "if ratio is None and number_of_leaves is None:\n raise LeafSubsamplerError(\"At least one of 'ratio' and 'number_of_leaves' must be specified.\")\nif ratio is not None and number_of_leaves is not None:\n raise LeafSubsamplerError(\"Exactly one of 'ratio' and 'number_of_leaves'must be specified.\")\nself.__ra...
<|body_start_0|> if ratio is None and number_of_leaves is None: raise LeafSubsamplerError("At least one of 'ratio' and 'number_of_leaves' must be specified.") if ratio is not None and number_of_leaves is not None: raise LeafSubsamplerError("Exactly one of 'ratio' and 'number_of_l...
UniformLeafSubsampler
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UniformLeafSubsampler: def __init__(self, ratio: Optional[float]=None, number_of_leaves: Optional[int]=None): """Uniformly subsample leaf samples of a CassiopeiaTree. If 'ratio' is provided, samples 'ratio' of the leaves, rounded down, uniformly at random. If instead 'number_of_leaves' i...
stack_v2_sparse_classes_36k_train_010741
4,709
permissive
[ { "docstring": "Uniformly subsample leaf samples of a CassiopeiaTree. If 'ratio' is provided, samples 'ratio' of the leaves, rounded down, uniformly at random. If instead 'number_of_leaves' is provided, 'number_of_leaves' of the leaves are sampled uniformly at random. Only one of the two criteria can be provide...
2
null
Implement the Python class `UniformLeafSubsampler` described below. Class description: Implement the UniformLeafSubsampler class. Method signatures and docstrings: - def __init__(self, ratio: Optional[float]=None, number_of_leaves: Optional[int]=None): Uniformly subsample leaf samples of a CassiopeiaTree. If 'ratio' ...
Implement the Python class `UniformLeafSubsampler` described below. Class description: Implement the UniformLeafSubsampler class. Method signatures and docstrings: - def __init__(self, ratio: Optional[float]=None, number_of_leaves: Optional[int]=None): Uniformly subsample leaf samples of a CassiopeiaTree. If 'ratio' ...
07b48a1720d84dffacd9a56e380b148206d171bf
<|skeleton|> class UniformLeafSubsampler: def __init__(self, ratio: Optional[float]=None, number_of_leaves: Optional[int]=None): """Uniformly subsample leaf samples of a CassiopeiaTree. If 'ratio' is provided, samples 'ratio' of the leaves, rounded down, uniformly at random. If instead 'number_of_leaves' i...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UniformLeafSubsampler: def __init__(self, ratio: Optional[float]=None, number_of_leaves: Optional[int]=None): """Uniformly subsample leaf samples of a CassiopeiaTree. If 'ratio' is provided, samples 'ratio' of the leaves, rounded down, uniformly at random. If instead 'number_of_leaves' is provided, 'n...
the_stack_v2_python_sparse
cassiopeia/simulator/UniformLeafSubsampler.py
YosefLab/Cassiopeia
train
73
24cc5a34d1144648a5b8e8e203ecc2e9a7737025
[ "self.comment('Step 1. Test current state')\ncurrentState = self.state()\nself.comment('Current state is ' + currentState)\nif not currentState:\n self.fail('Failed to get current state from the phone')\nif currentState != 'com.nokia.homescreen':\n self.fail('Current state not com.nokia.homescreen')\nself.com...
<|body_start_0|> self.comment('Step 1. Test current state') currentState = self.state() self.comment('Current state is ' + currentState) if not currentState: self.fail('Failed to get current state from the phone') if currentState != 'com.nokia.homescreen': ...
testBed
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class testBed: def testState(self): """@tcId State""" <|body_0|> def testStateInMainMenu(self): """@tcId State inMainMenu""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.comment('Step 1. Test current state') currentState = self.state() ...
stack_v2_sparse_classes_36k_train_010742
1,414
no_license
[ { "docstring": "@tcId State", "name": "testState", "signature": "def testState(self)" }, { "docstring": "@tcId State inMainMenu", "name": "testStateInMainMenu", "signature": "def testStateInMainMenu(self)" } ]
2
null
Implement the Python class `testBed` described below. Class description: Implement the testBed class. Method signatures and docstrings: - def testState(self): @tcId State - def testStateInMainMenu(self): @tcId State inMainMenu
Implement the Python class `testBed` described below. Class description: Implement the testBed class. Method signatures and docstrings: - def testState(self): @tcId State - def testStateInMainMenu(self): @tcId State inMainMenu <|skeleton|> class testBed: def testState(self): """@tcId State""" <|...
0bc1f24ac8e8fb7d4c53f91ae2d1322d385e296a
<|skeleton|> class testBed: def testState(self): """@tcId State""" <|body_0|> def testStateInMainMenu(self): """@tcId State inMainMenu""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class testBed: def testState(self): """@tcId State""" self.comment('Step 1. Test current state') currentState = self.state() self.comment('Current state is ' + currentState) if not currentState: self.fail('Failed to get current state from the phone') if cu...
the_stack_v2_python_sparse
test_scripts/self_tests/state.py
slimsymphony/astt
train
4
3e2227a8d484c5cfedccb6c9d49c40685632ad52
[ "super(IdealFedbatch, self).__init__(organisms, metabolites, id=id, volume_max=volume_max, Xfeed=Xfeed, Sfeed=Sfeed, deltaX=deltaX, deltaS=deltaS, initial_conditions=initial_conditions, oxygen_availability=oxygen_availability)\nif primary_substrate:\n assert primary_substrate in metabolites\n self.primary_sub...
<|body_start_0|> super(IdealFedbatch, self).__init__(organisms, metabolites, id=id, volume_max=volume_max, Xfeed=Xfeed, Sfeed=Sfeed, deltaX=deltaX, deltaS=deltaS, initial_conditions=initial_conditions, oxygen_availability=oxygen_availability) if primary_substrate: assert primary_substrate in...
This class describes an ideal fedbatch reactor with a single primary substrate. - The flow_rate_in is automatically adjusted using the following rules: - otherwise, calculates flow_rate_in so that substrate concentration is maintained (d_substrate/dt = 0) - The primary substrate (usually the carbon & energy source) can...
IdealFedbatch
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IdealFedbatch: """This class describes an ideal fedbatch reactor with a single primary substrate. - The flow_rate_in is automatically adjusted using the following rules: - otherwise, calculates flow_rate_in so that substrate concentration is maintained (d_substrate/dt = 0) - The primary substrate...
stack_v2_sparse_classes_36k_train_010743
6,215
permissive
[ { "docstring": ":param organisms: list of Organism :param metabolites: list of string :param Sfeed: concentration of metabolites in the feed stream [mmol/L] :param primary_substrate (string): usually the carbon & energy source. :param volume_max (float): liquid capacity of the bioreactor :param Xfeed: concentra...
2
stack_v2_sparse_classes_30k_val_000387
Implement the Python class `IdealFedbatch` described below. Class description: This class describes an ideal fedbatch reactor with a single primary substrate. - The flow_rate_in is automatically adjusted using the following rules: - otherwise, calculates flow_rate_in so that substrate concentration is maintained (d_su...
Implement the Python class `IdealFedbatch` described below. Class description: This class describes an ideal fedbatch reactor with a single primary substrate. - The flow_rate_in is automatically adjusted using the following rules: - otherwise, calculates flow_rate_in so that substrate concentration is maintained (d_su...
36d56437685cbf5c7c3c8ee4f6d85b8f05f4d345
<|skeleton|> class IdealFedbatch: """This class describes an ideal fedbatch reactor with a single primary substrate. - The flow_rate_in is automatically adjusted using the following rules: - otherwise, calculates flow_rate_in so that substrate concentration is maintained (d_substrate/dt = 0) - The primary substrate...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class IdealFedbatch: """This class describes an ideal fedbatch reactor with a single primary substrate. - The flow_rate_in is automatically adjusted using the following rules: - otherwise, calculates flow_rate_in so that substrate concentration is maintained (d_substrate/dt = 0) - The primary substrate (usually the...
the_stack_v2_python_sparse
src/framed/bioreactor/bioreactors.py
arshah18/framed
train
0
d4cd6ee3952fa71ea13008c882487e4a6d7c7913
[ "endpoint = '/WarehouseNumberSet'\nparams = {}\nif descriptions or storagebins:\n exvalues = []\n if descriptions:\n exvalues.append('WarehouseDescriptions')\n if storagebins:\n exvalues.append('StorageBins')\n params['$expand'] = ','.join(exvalues)\nids = {'Lgnum': lgnum}\nhttp_resp = sel...
<|body_start_0|> endpoint = '/WarehouseNumberSet' params = {} if descriptions or storagebins: exvalues = [] if descriptions: exvalues.append('WarehouseDescriptions') if storagebins: exvalues.append('StorageBins') par...
Interaction with EWM warehouse APIs.
WarehouseOData
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WarehouseOData: """Interaction with EWM warehouse APIs.""" def get_warehouse(self, lgnum: str, descriptions: bool=False, storagebins: bool=False) -> Warehouse: """Get data of one warehouse. Optionally expand descriptions and storage bins.""" <|body_0|> def get_warehouses...
stack_v2_sparse_classes_36k_train_010744
27,237
permissive
[ { "docstring": "Get data of one warehouse. Optionally expand descriptions and storage bins.", "name": "get_warehouse", "signature": "def get_warehouse(self, lgnum: str, descriptions: bool=False, storagebins: bool=False) -> Warehouse" }, { "docstring": "Get data of all warehouses. Optionally expa...
6
stack_v2_sparse_classes_30k_train_016086
Implement the Python class `WarehouseOData` described below. Class description: Interaction with EWM warehouse APIs. Method signatures and docstrings: - def get_warehouse(self, lgnum: str, descriptions: bool=False, storagebins: bool=False) -> Warehouse: Get data of one warehouse. Optionally expand descriptions and st...
Implement the Python class `WarehouseOData` described below. Class description: Interaction with EWM warehouse APIs. Method signatures and docstrings: - def get_warehouse(self, lgnum: str, descriptions: bool=False, storagebins: bool=False) -> Warehouse: Get data of one warehouse. Optionally expand descriptions and st...
80be05b5bc81a5e3ffd89279e2f49023bd71b478
<|skeleton|> class WarehouseOData: """Interaction with EWM warehouse APIs.""" def get_warehouse(self, lgnum: str, descriptions: bool=False, storagebins: bool=False) -> Warehouse: """Get data of one warehouse. Optionally expand descriptions and storage bins.""" <|body_0|> def get_warehouses...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WarehouseOData: """Interaction with EWM warehouse APIs.""" def get_warehouse(self, lgnum: str, descriptions: bool=False, storagebins: bool=False) -> Warehouse: """Get data of one warehouse. Optionally expand descriptions and storage bins.""" endpoint = '/WarehouseNumberSet' params...
the_stack_v2_python_sparse
python-modules/robcoewminterface/robcoewminterface/ewm.py
SAP/ewm-cloud-robotics
train
29
fc27b726778212c860cc251142374e17c8da52cd
[ "host = '127.0.0.1'\nuser = 'root'\npassword = '123456'\ndatabase = 'notebook'\nself.db = pymysql.connect(host=host, user=user, password=password, db=database)\nself.cursor = self.db.cursor(cursor=pymysql.cursors.DictCursor)", "try:\n self.cursor.execute(sql)\n self.db.commit()\nexcept Exception:\n print...
<|body_start_0|> host = '127.0.0.1' user = 'root' password = '123456' database = 'notebook' self.db = pymysql.connect(host=host, user=user, password=password, db=database) self.cursor = self.db.cursor(cursor=pymysql.cursors.DictCursor) <|end_body_0|> <|body_start_1|> ...
MysqlUtil
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MysqlUtil: def __init__(self): """初始化方法,连接数据库""" <|body_0|> def insert(self, sql): """插入数据库 sql:插入数据库的sql语句""" <|body_1|> def fetchone(self, sql): """查询数据库:单个结果集 fetchone(): 该方法获取下一个查询结果集。结果集是一个对象""" <|body_2|> def fetchall(self, sql...
stack_v2_sparse_classes_36k_train_010745
3,579
no_license
[ { "docstring": "初始化方法,连接数据库", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "插入数据库 sql:插入数据库的sql语句", "name": "insert", "signature": "def insert(self, sql)" }, { "docstring": "查询数据库:单个结果集 fetchone(): 该方法获取下一个查询结果集。结果集是一个对象", "name": "fetchone", "s...
6
stack_v2_sparse_classes_30k_train_007776
Implement the Python class `MysqlUtil` described below. Class description: Implement the MysqlUtil class. Method signatures and docstrings: - def __init__(self): 初始化方法,连接数据库 - def insert(self, sql): 插入数据库 sql:插入数据库的sql语句 - def fetchone(self, sql): 查询数据库:单个结果集 fetchone(): 该方法获取下一个查询结果集。结果集是一个对象 - def fetchall(self, sq...
Implement the Python class `MysqlUtil` described below. Class description: Implement the MysqlUtil class. Method signatures and docstrings: - def __init__(self): 初始化方法,连接数据库 - def insert(self, sql): 插入数据库 sql:插入数据库的sql语句 - def fetchone(self, sql): 查询数据库:单个结果集 fetchone(): 该方法获取下一个查询结果集。结果集是一个对象 - def fetchall(self, sq...
77ed974e08b3d6240b591b1d99a23883eab9b8fb
<|skeleton|> class MysqlUtil: def __init__(self): """初始化方法,连接数据库""" <|body_0|> def insert(self, sql): """插入数据库 sql:插入数据库的sql语句""" <|body_1|> def fetchone(self, sql): """查询数据库:单个结果集 fetchone(): 该方法获取下一个查询结果集。结果集是一个对象""" <|body_2|> def fetchall(self, sql...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MysqlUtil: def __init__(self): """初始化方法,连接数据库""" host = '127.0.0.1' user = 'root' password = '123456' database = 'notebook' self.db = pymysql.connect(host=host, user=user, password=password, db=database) self.cursor = self.db.cursor(cursor=pymysql.cursor...
the_stack_v2_python_sparse
my_project/notebook/mysql_util.py
wangleiliugang/myproject
train
0
5118e334b175e78c1f828bc487961e8d46eba801
[ "LOGGER.debug(f'Copying {self.archive_path} to {self.duplicate_path}')\nshutil.copyfile(self.archive_path, self.duplicate_path)\nLOGGER.debug(f'Copied {self.archive_path} to {self.duplicate_path}')\nwith DataExplorer(self.duplicate_path, allow_edits=True) as data:\n for step in self.preprocessing_steps:\n ...
<|body_start_0|> LOGGER.debug(f'Copying {self.archive_path} to {self.duplicate_path}') shutil.copyfile(self.archive_path, self.duplicate_path) LOGGER.debug(f'Copied {self.archive_path} to {self.duplicate_path}') with DataExplorer(self.duplicate_path, allow_edits=True) as data: ...
Coordinate multiple steps of processing.
ProcessCoordinator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProcessCoordinator: """Coordinate multiple steps of processing.""" def run_preprocess(self, debug: bool=False) -> None: """Run the pre-processing steps.""" <|body_0|> def run_process(self, debug: bool=False) -> None: """Run the processing steps.""" <|body...
stack_v2_sparse_classes_36k_train_010746
12,852
permissive
[ { "docstring": "Run the pre-processing steps.", "name": "run_preprocess", "signature": "def run_preprocess(self, debug: bool=False) -> None" }, { "docstring": "Run the processing steps.", "name": "run_process", "signature": "def run_process(self, debug: bool=False) -> None" }, { ...
3
stack_v2_sparse_classes_30k_train_014492
Implement the Python class `ProcessCoordinator` described below. Class description: Coordinate multiple steps of processing. Method signatures and docstrings: - def run_preprocess(self, debug: bool=False) -> None: Run the pre-processing steps. - def run_process(self, debug: bool=False) -> None: Run the processing ste...
Implement the Python class `ProcessCoordinator` described below. Class description: Coordinate multiple steps of processing. Method signatures and docstrings: - def run_preprocess(self, debug: bool=False) -> None: Run the pre-processing steps. - def run_process(self, debug: bool=False) -> None: Run the processing ste...
1c2b5b861849ccf76b5ea6aaf0fcbf429aa6bfcf
<|skeleton|> class ProcessCoordinator: """Coordinate multiple steps of processing.""" def run_preprocess(self, debug: bool=False) -> None: """Run the pre-processing steps.""" <|body_0|> def run_process(self, debug: bool=False) -> None: """Run the processing steps.""" <|body...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProcessCoordinator: """Coordinate multiple steps of processing.""" def run_preprocess(self, debug: bool=False) -> None: """Run the pre-processing steps.""" LOGGER.debug(f'Copying {self.archive_path} to {self.duplicate_path}') shutil.copyfile(self.archive_path, self.duplicate_path)...
the_stack_v2_python_sparse
shabanipy/utils/data_processing.py
jnt299/shabanipy
train
1
973b5e1c5a3394797fe82c8bf903a551d8e8e052
[ "super(SaleImages, self).__init__(*args, **kwargs)\nself.endpoint = 'sale/images'\nself._headers = {'Accept': 'application/vnd.allegro.public.v1+json', 'Content-type': 'image/jpeg'}", "image_format_map = {'JPG': 'image/jpeg', 'PNG': 'image/png', 'GIF': 'image/gif'}\nself._headers['Content-type'] = image_format_ma...
<|body_start_0|> super(SaleImages, self).__init__(*args, **kwargs) self.endpoint = 'sale/images' self._headers = {'Accept': 'application/vnd.allegro.public.v1+json', 'Content-type': 'image/jpeg'} <|end_body_0|> <|body_start_1|> image_format_map = {'JPG': 'image/jpeg', 'PNG': 'image/png'...
Manage offer images
SaleImages
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SaleImages: """Manage offer images""" def __init__(self, *args, **kwargs): """Initialize the endpoint""" <|body_0|> def upload(self, image_location, image_type='JPG'): """Upload local image ex. upload("/imgs/1.jpg", "JPG") :param image_location: The location of i...
stack_v2_sparse_classes_36k_train_010747
1,554
permissive
[ { "docstring": "Initialize the endpoint", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Upload local image ex. upload(\"/imgs/1.jpg\", \"JPG\") :param image_location: The location of image file (must not be URL but local!) :type image_location: :py:cla...
2
stack_v2_sparse_classes_30k_train_009623
Implement the Python class `SaleImages` described below. Class description: Manage offer images Method signatures and docstrings: - def __init__(self, *args, **kwargs): Initialize the endpoint - def upload(self, image_location, image_type='JPG'): Upload local image ex. upload("/imgs/1.jpg", "JPG") :param image_locati...
Implement the Python class `SaleImages` described below. Class description: Manage offer images Method signatures and docstrings: - def __init__(self, *args, **kwargs): Initialize the endpoint - def upload(self, image_location, image_type='JPG'): Upload local image ex. upload("/imgs/1.jpg", "JPG") :param image_locati...
112b0f2570fcf3840645dd62f6f7150956e56f9c
<|skeleton|> class SaleImages: """Manage offer images""" def __init__(self, *args, **kwargs): """Initialize the endpoint""" <|body_0|> def upload(self, image_location, image_type='JPG'): """Upload local image ex. upload("/imgs/1.jpg", "JPG") :param image_location: The location of i...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SaleImages: """Manage offer images""" def __init__(self, *args, **kwargs): """Initialize the endpoint""" super(SaleImages, self).__init__(*args, **kwargs) self.endpoint = 'sale/images' self._headers = {'Accept': 'application/vnd.allegro.public.v1+json', 'Content-type': 'im...
the_stack_v2_python_sparse
allegroapi/entities/saleimages.py
krystianmagdziarz/python-allegro
train
0
541a2dd097a2d5437d85750e068f3585f2fc76f2
[ "try:\n self.hide_keyboard()\n logging.info('===隐藏键盘===')\nexcept BaseException as e:\n logging.info('%s' % e)\n self.driver.find_element(*self.loginBtn).click()\n logging.info('ok!')\nelse:\n self.driver.find_element(*self.loginBtn).click()\n logging.info('ok!')", "logging.info('============...
<|body_start_0|> try: self.hide_keyboard() logging.info('===隐藏键盘===') except BaseException as e: logging.info('%s' % e) self.driver.find_element(*self.loginBtn).click() logging.info('ok!') else: self.driver.find_element(*sel...
LoginView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoginView: def click_login_button(self): """登录按钮""" <|body_0|> def pwd_login(self, username, password): """密码登录业务""" <|body_1|> def code_login(self, username, cod): """验证码登录业务""" <|body_2|> def login_action(self, username, password):...
stack_v2_sparse_classes_36k_train_010748
3,383
no_license
[ { "docstring": "登录按钮", "name": "click_login_button", "signature": "def click_login_button(self)" }, { "docstring": "密码登录业务", "name": "pwd_login", "signature": "def pwd_login(self, username, password)" }, { "docstring": "验证码登录业务", "name": "code_login", "signature": "def co...
5
null
Implement the Python class `LoginView` described below. Class description: Implement the LoginView class. Method signatures and docstrings: - def click_login_button(self): 登录按钮 - def pwd_login(self, username, password): 密码登录业务 - def code_login(self, username, cod): 验证码登录业务 - def login_action(self, username, password)...
Implement the Python class `LoginView` described below. Class description: Implement the LoginView class. Method signatures and docstrings: - def click_login_button(self): 登录按钮 - def pwd_login(self, username, password): 密码登录业务 - def code_login(self, username, cod): 验证码登录业务 - def login_action(self, username, password)...
80539f8d3fc5ccb5c07aab2ad37a9c071bb4944d
<|skeleton|> class LoginView: def click_login_button(self): """登录按钮""" <|body_0|> def pwd_login(self, username, password): """密码登录业务""" <|body_1|> def code_login(self, username, cod): """验证码登录业务""" <|body_2|> def login_action(self, username, password):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LoginView: def click_login_button(self): """登录按钮""" try: self.hide_keyboard() logging.info('===隐藏键盘===') except BaseException as e: logging.info('%s' % e) self.driver.find_element(*self.loginBtn).click() logging.info('ok!') ...
the_stack_v2_python_sparse
WFX_App_Test/businessView/loginView.py
yangyuexiong/WFX_Test
train
0
52f07bad44027010157743f2eba017a1d52bc7d4
[ "super(SentimentRNN, self).__init__()\nself.output_size = output_size\nself.n_layers = n_layers\nself.hidden_dim = hidden_dim\nself.embedding = nn.Embedding(vocab_size, embedding_dim)\nself.lstm = nn.LSTM(embedding_dim, hidden_dim, n_layers, dropout=drop_prob, batch_first=True)\nself.dropout = nn.Dropout(0.5)\nself...
<|body_start_0|> super(SentimentRNN, self).__init__() self.output_size = output_size self.n_layers = n_layers self.hidden_dim = hidden_dim self.embedding = nn.Embedding(vocab_size, embedding_dim) self.lstm = nn.LSTM(embedding_dim, hidden_dim, n_layers, dropout=drop_prob, ...
The RNN model that will be used to perform Sentiment analysis.
SentimentRNN
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SentimentRNN: """The RNN model that will be used to perform Sentiment analysis.""" def __init__(self, vocab_size, output_size, embedding_dim, hidden_dim, n_layers, drop_prob=0.5): """Initialize the model by setting up the layers.""" <|body_0|> def forward(self, x, hidden...
stack_v2_sparse_classes_36k_train_010749
5,077
permissive
[ { "docstring": "Initialize the model by setting up the layers.", "name": "__init__", "signature": "def __init__(self, vocab_size, output_size, embedding_dim, hidden_dim, n_layers, drop_prob=0.5)" }, { "docstring": "Perform a forward pass of our model on some input and hidden state.", "name":...
3
stack_v2_sparse_classes_30k_train_016533
Implement the Python class `SentimentRNN` described below. Class description: The RNN model that will be used to perform Sentiment analysis. Method signatures and docstrings: - def __init__(self, vocab_size, output_size, embedding_dim, hidden_dim, n_layers, drop_prob=0.5): Initialize the model by setting up the layer...
Implement the Python class `SentimentRNN` described below. Class description: The RNN model that will be used to perform Sentiment analysis. Method signatures and docstrings: - def __init__(self, vocab_size, output_size, embedding_dim, hidden_dim, n_layers, drop_prob=0.5): Initialize the model by setting up the layer...
6426c102f02df799717596346ea0bf417361bfa0
<|skeleton|> class SentimentRNN: """The RNN model that will be used to perform Sentiment analysis.""" def __init__(self, vocab_size, output_size, embedding_dim, hidden_dim, n_layers, drop_prob=0.5): """Initialize the model by setting up the layers.""" <|body_0|> def forward(self, x, hidden...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SentimentRNN: """The RNN model that will be used to perform Sentiment analysis.""" def __init__(self, vocab_size, output_size, embedding_dim, hidden_dim, n_layers, drop_prob=0.5): """Initialize the model by setting up the layers.""" super(SentimentRNN, self).__init__() self.output...
the_stack_v2_python_sparse
InteligênciaArtificial/rating-comments-nlp/src/textminig_code.py
rafanthx13/college-projects
train
0
d942cbc878eca461492077c261fc3a65d3665446
[ "sf = SurfaceForm(u'verkoeílikheid', 'rejected')\nassert sf.value == u'verkoeílikheid'\nassert sf.status == 'rejected'\nsf = SurfaceForm(u'varkieş', 'todo', 3, 30, datetime.fromtimestamp(0), 33, 333)\nassert sf.value == u'varkieş'\nassert sf.status == 'todo'\nassert sf.id == 3\nassert sf.user_id == 30\nassert sf.da...
<|body_start_0|> sf = SurfaceForm(u'verkoeílikheid', 'rejected') assert sf.value == u'verkoeílikheid' assert sf.status == 'rejected' sf = SurfaceForm(u'varkieş', 'todo', 3, 30, datetime.fromtimestamp(0), 33, 333) assert sf.value == u'varkieş' assert sf.status == 'todo' ...
Unit test for the SurfaceForm model class.
TestSurfaceForm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestSurfaceForm: """Unit test for the SurfaceForm model class.""" def test_create_no_xml(self): """Test creation of a simple SurfaceForm object with its own constructor.""" <|body_0|> def test_create_from_xml(self): """Test creation of a SurfaceForm instance by u...
stack_v2_sparse_classes_36k_train_010750
2,880
no_license
[ { "docstring": "Test creation of a simple SurfaceForm object with its own constructor.", "name": "test_create_no_xml", "signature": "def test_create_no_xml(self)" }, { "docstring": "Test creation of a SurfaceForm instance by using the create_from_elem() factory method.", "name": "test_create...
2
stack_v2_sparse_classes_30k_train_012013
Implement the Python class `TestSurfaceForm` described below. Class description: Unit test for the SurfaceForm model class. Method signatures and docstrings: - def test_create_no_xml(self): Test creation of a simple SurfaceForm object with its own constructor. - def test_create_from_xml(self): Test creation of a Surf...
Implement the Python class `TestSurfaceForm` described below. Class description: Unit test for the SurfaceForm model class. Method signatures and docstrings: - def test_create_no_xml(self): Test creation of a simple SurfaceForm object with its own constructor. - def test_create_from_xml(self): Test creation of a Surf...
2c169f0904d54d462958049e5527c3d8fb780238
<|skeleton|> class TestSurfaceForm: """Unit test for the SurfaceForm model class.""" def test_create_no_xml(self): """Test creation of a simple SurfaceForm object with its own constructor.""" <|body_0|> def test_create_from_xml(self): """Test creation of a SurfaceForm instance by u...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestSurfaceForm: """Unit test for the SurfaceForm model class.""" def test_create_no_xml(self): """Test creation of a simple SurfaceForm object with its own constructor.""" sf = SurfaceForm(u'verkoeílikheid', 'rejected') assert sf.value == u'verkoeílikheid' assert sf.statu...
the_stack_v2_python_sparse
spelt/models/test_surface_form.py
translate/spelt
train
2
af7d3fc2f88e16a3900aa24b80d863e00d5bdf61
[ "super().__init__()\nself.title = 'Transient Analyser'\nself.left = 300\nself.top = 100\nself.width = 1400\nself.height = 900\nself.initUI()\nself.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())\npg.setConfigOption('background', 0.1)\npg.setConfigOption('foreground', 0.7)", "self.setWindowTitle(self.title)\nsel...
<|body_start_0|> super().__init__() self.title = 'Transient Analyser' self.left = 300 self.top = 100 self.width = 1400 self.height = 900 self.initUI() self.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5()) pg.setConfigOption('background', 0.1) ...
Main application window
MainWindow
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MainWindow: """Main application window""" def __init__(self): """Initialize by setting window title, size and graphic options""" <|body_0|> def initUI(self): """Create the layout, adding central widget, layout style and status bar.""" <|body_1|> <|end_sk...
stack_v2_sparse_classes_36k_train_010751
17,415
permissive
[ { "docstring": "Initialize by setting window title, size and graphic options", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Create the layout, adding central widget, layout style and status bar.", "name": "initUI", "signature": "def initUI(self)" } ]
2
stack_v2_sparse_classes_30k_train_017051
Implement the Python class `MainWindow` described below. Class description: Main application window Method signatures and docstrings: - def __init__(self): Initialize by setting window title, size and graphic options - def initUI(self): Create the layout, adding central widget, layout style and status bar.
Implement the Python class `MainWindow` described below. Class description: Main application window Method signatures and docstrings: - def __init__(self): Initialize by setting window title, size and graphic options - def initUI(self): Create the layout, adding central widget, layout style and status bar. <|skeleto...
138e11613c15cea73d73a64daed591c15303fd4d
<|skeleton|> class MainWindow: """Main application window""" def __init__(self): """Initialize by setting window title, size and graphic options""" <|body_0|> def initUI(self): """Create the layout, adding central widget, layout style and status bar.""" <|body_1|> <|end_sk...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MainWindow: """Main application window""" def __init__(self): """Initialize by setting window title, size and graphic options""" super().__init__() self.title = 'Transient Analyser' self.left = 300 self.top = 100 self.width = 1400 self.height = 900 ...
the_stack_v2_python_sparse
GUI/TransientsWidgets.py
steinnymir/RegAscope2017
train
1
12254d006245e24817d2ad965fe1b577c2cc1286
[ "import time\nimport thread\nthread.start_new_thread(self.run, ())", "import viewer_basics\ntry:\n self.app = viewer_basics.SecondThreadApp(0)\n self.app.MainLoop()\nexcept TypeError:\n self.app = None", "import viewer_basics\nif self.app:\n evt = viewer_basics.AddCone()\n viewer_basics.wxPostEve...
<|body_start_0|> import time import thread thread.start_new_thread(self.run, ()) <|end_body_0|> <|body_start_1|> import viewer_basics try: self.app = viewer_basics.SecondThreadApp(0) self.app.MainLoop() except TypeError: self.app = Non...
viewer_thread
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class viewer_thread: def start(self): """start the GUI thread""" <|body_0|> def run(self): """Note that viewer_basices is first imported ***here***. This is the second thread. viewer_basics imports wxPython. if we imported it at the module level instead of in this function...
stack_v2_sparse_classes_36k_train_010752
3,430
no_license
[ { "docstring": "start the GUI thread", "name": "start", "signature": "def start(self)" }, { "docstring": "Note that viewer_basices is first imported ***here***. This is the second thread. viewer_basics imports wxPython. if we imported it at the module level instead of in this function, the impor...
3
stack_v2_sparse_classes_30k_train_002362
Implement the Python class `viewer_thread` described below. Class description: Implement the viewer_thread class. Method signatures and docstrings: - def start(self): start the GUI thread - def run(self): Note that viewer_basices is first imported ***here***. This is the second thread. viewer_basics imports wxPython....
Implement the Python class `viewer_thread` described below. Class description: Implement the viewer_thread class. Method signatures and docstrings: - def start(self): start the GUI thread - def run(self): Note that viewer_basices is first imported ***here***. This is the second thread. viewer_basics imports wxPython....
13cceab2a1891ab443e62078be729dc1e1e2e283
<|skeleton|> class viewer_thread: def start(self): """start the GUI thread""" <|body_0|> def run(self): """Note that viewer_basices is first imported ***here***. This is the second thread. viewer_basics imports wxPython. if we imported it at the module level instead of in this function...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class viewer_thread: def start(self): """start the GUI thread""" import time import thread thread.start_new_thread(self.run, ()) def run(self): """Note that viewer_basices is first imported ***here***. This is the second thread. viewer_basics imports wxPython. if we impo...
the_stack_v2_python_sparse
wxPython/demo/viewer.py
nvaccess/wxPython
train
1
e00a52feb2616c75c3683be3cd45c1011ca82899
[ "carrierfac = CarrierFacility.objects.get(id=pk)\nif not check_permissions_from_request(request, carrierfac.facility, 'c'):\n return Response(status=status.HTTP_403_FORBIDDEN)\ncarrierfac.status = 'ok'\ncarrierfac.save()\nreturn Response(self.serializer_class(carrierfac).data)", "carrierfac = CarrierFacility.o...
<|body_start_0|> carrierfac = CarrierFacility.objects.get(id=pk) if not check_permissions_from_request(request, carrierfac.facility, 'c'): return Response(status=status.HTTP_403_FORBIDDEN) carrierfac.status = 'ok' carrierfac.save() return Response(self.serializer_clas...
Custom API endpoints for the carrier-facility object, exposed to api/carrierfac/{id}/{action}
CarrierFacilityMixin
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CarrierFacilityMixin: """Custom API endpoints for the carrier-facility object, exposed to api/carrierfac/{id}/{action}""" def approve(self, request, pk, *args, **kwargs): """Allows the org to approve a carrier listing at their facility""" <|body_0|> def reject(self, requ...
stack_v2_sparse_classes_36k_train_010753
40,361
permissive
[ { "docstring": "Allows the org to approve a carrier listing at their facility", "name": "approve", "signature": "def approve(self, request, pk, *args, **kwargs)" }, { "docstring": "Allows the org to reject a carrier listing at their facility", "name": "reject", "signature": "def reject(s...
2
null
Implement the Python class `CarrierFacilityMixin` described below. Class description: Custom API endpoints for the carrier-facility object, exposed to api/carrierfac/{id}/{action} Method signatures and docstrings: - def approve(self, request, pk, *args, **kwargs): Allows the org to approve a carrier listing at their ...
Implement the Python class `CarrierFacilityMixin` described below. Class description: Custom API endpoints for the carrier-facility object, exposed to api/carrierfac/{id}/{action} Method signatures and docstrings: - def approve(self, request, pk, *args, **kwargs): Allows the org to approve a carrier listing at their ...
3f62b2d97c78ccf151fb1a5761637e28463b9541
<|skeleton|> class CarrierFacilityMixin: """Custom API endpoints for the carrier-facility object, exposed to api/carrierfac/{id}/{action}""" def approve(self, request, pk, *args, **kwargs): """Allows the org to approve a carrier listing at their facility""" <|body_0|> def reject(self, requ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CarrierFacilityMixin: """Custom API endpoints for the carrier-facility object, exposed to api/carrierfac/{id}/{action}""" def approve(self, request, pk, *args, **kwargs): """Allows the org to approve a carrier listing at their facility""" carrierfac = CarrierFacility.objects.get(id=pk) ...
the_stack_v2_python_sparse
peeringdb_server/rest.py
peeringdb/peeringdb
train
311
64c21eb7e3397b5d3e490561f13c0216dfae40cb
[ "guids = []\nignore = parse_gitignore_lines(ignore_lines, os.path.join(folder, 'nofile.txt'), folder)\nfor root, dirs, files in os.walk(folder):\n for d in dirs[:]:\n fullpath = os.path.join(root, d)\n if ignore(fullpath):\n logging.debug(f'Ignore folder: {fullpath}')\n dirs.r...
<|body_start_0|> guids = [] ignore = parse_gitignore_lines(ignore_lines, os.path.join(folder, 'nofile.txt'), folder) for root, dirs, files in os.walk(folder): for d in dirs[:]: fullpath = os.path.join(root, d) if ignore(fullpath): l...
Static class for returning Guids.
GuidList
[ "BSD-2-Clause-Patent" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GuidList: """Static class for returning Guids.""" def guidlist_from_filesystem(folder: str, ignore_lines: list=list()) -> list: """Create a list of GuidListEntry from files found in the file system. Args: folder (str): path string to root folder to walk ignore_lines (list): list of g...
stack_v2_sparse_classes_36k_train_010754
4,603
permissive
[ { "docstring": "Create a list of GuidListEntry from files found in the file system. Args: folder (str): path string to root folder to walk ignore_lines (list): list of gitignore syntax to ignore files and folders Returns: (list[GuidListEntry]): guids", "name": "guidlist_from_filesystem", "signature": "d...
4
stack_v2_sparse_classes_30k_train_010392
Implement the Python class `GuidList` described below. Class description: Static class for returning Guids. Method signatures and docstrings: - def guidlist_from_filesystem(folder: str, ignore_lines: list=list()) -> list: Create a list of GuidListEntry from files found in the file system. Args: folder (str): path str...
Implement the Python class `GuidList` described below. Class description: Static class for returning Guids. Method signatures and docstrings: - def guidlist_from_filesystem(folder: str, ignore_lines: list=list()) -> list: Create a list of GuidListEntry from files found in the file system. Args: folder (str): path str...
78295929b37af62a8cfc4c28eab72ed0c468f350
<|skeleton|> class GuidList: """Static class for returning Guids.""" def guidlist_from_filesystem(folder: str, ignore_lines: list=list()) -> list: """Create a list of GuidListEntry from files found in the file system. Args: folder (str): path string to root folder to walk ignore_lines (list): list of g...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GuidList: """Static class for returning Guids.""" def guidlist_from_filesystem(folder: str, ignore_lines: list=list()) -> list: """Create a list of GuidListEntry from files found in the file system. Args: folder (str): path string to root folder to walk ignore_lines (list): list of gitignore synt...
the_stack_v2_python_sparse
edk2toollib/uefi/edk2/guid_list.py
tianocore/edk2-pytool-library
train
47
df559ebb20da446d3e89da980481ae63899edc62
[ "if n == 3 or n == 2:\n return 2\nelif n == 1:\n return 1\nelse:\n base = 4 * self.lastRemaining_(n / 4)\n if n % 4 == 0 or n % 4 == 1:\n return base - 2\n else:\n return base", "a = p = 1\ncnt = 0\nwhile n > 1:\n n /= 2\n cnt += 1\n p *= 2\n if cnt % 2:\n a += p / ...
<|body_start_0|> if n == 3 or n == 2: return 2 elif n == 1: return 1 else: base = 4 * self.lastRemaining_(n / 4) if n % 4 == 0 or n % 4 == 1: return base - 2 else: return base <|end_body_0|> <|body_start...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def lastRemaining_(self, n): """:type n: int :rtype: int""" <|body_0|> def lastRemaining(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if n == 3 or n == 2: return 2 elif n == 1: ...
stack_v2_sparse_classes_36k_train_010755
1,529
no_license
[ { "docstring": ":type n: int :rtype: int", "name": "lastRemaining_", "signature": "def lastRemaining_(self, n)" }, { "docstring": ":type n: int :rtype: int", "name": "lastRemaining", "signature": "def lastRemaining(self, n)" } ]
2
stack_v2_sparse_classes_30k_train_001618
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lastRemaining_(self, n): :type n: int :rtype: int - def lastRemaining(self, n): :type n: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lastRemaining_(self, n): :type n: int :rtype: int - def lastRemaining(self, n): :type n: int :rtype: int <|skeleton|> class Solution: def lastRemaining_(self, n): ...
1520e1e9bb0c428797a3e5234e5b328110472c20
<|skeleton|> class Solution: def lastRemaining_(self, n): """:type n: int :rtype: int""" <|body_0|> def lastRemaining(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def lastRemaining_(self, n): """:type n: int :rtype: int""" if n == 3 or n == 2: return 2 elif n == 1: return 1 else: base = 4 * self.lastRemaining_(n / 4) if n % 4 == 0 or n % 4 == 1: return base - 2 ...
the_stack_v2_python_sparse
simulation/390. Elimination Game.py
tinkle1129/Leetcode_Solution
train
0
e23bcee24105e40fd1fe594d716146490d323db9
[ "date = ['2013-04-20', '2013-04-21', '2013-04-22']\ntitle = ['MA for 2013-04', 'Football', 'Shopping']\ndetail = ['Time schedule is from 10:00 to 14:00', 'Plays football at Shin-Yokohama park.', 'Shopping with friends at Yokohama Station']\nexpected_date = ['2013-04-20', '2013-04-21', '2013-04-22', '2019-10-31']\ne...
<|body_start_0|> date = ['2013-04-20', '2013-04-21', '2013-04-22'] title = ['MA for 2013-04', 'Football', 'Shopping'] detail = ['Time schedule is from 10:00 to 14:00', 'Plays football at Shin-Yokohama park.', 'Shopping with friends at Yokohama Station'] expected_date = ['2013-04-20', '20...
TestStringMethods
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestStringMethods: def test_adding_schedule_success(self): """This is testing for adding schedule to the current schedule""" <|body_0|> def testing_delete_function(self): """This is testing for deleting schedule from the current schedule""" <|body_1|> de...
stack_v2_sparse_classes_36k_train_010756
5,436
no_license
[ { "docstring": "This is testing for adding schedule to the current schedule", "name": "test_adding_schedule_success", "signature": "def test_adding_schedule_success(self)" }, { "docstring": "This is testing for deleting schedule from the current schedule", "name": "testing_delete_function", ...
4
stack_v2_sparse_classes_30k_train_012682
Implement the Python class `TestStringMethods` described below. Class description: Implement the TestStringMethods class. Method signatures and docstrings: - def test_adding_schedule_success(self): This is testing for adding schedule to the current schedule - def testing_delete_function(self): This is testing for del...
Implement the Python class `TestStringMethods` described below. Class description: Implement the TestStringMethods class. Method signatures and docstrings: - def test_adding_schedule_success(self): This is testing for adding schedule to the current schedule - def testing_delete_function(self): This is testing for del...
72181672d800ec59bac06978cab08a59e734933e
<|skeleton|> class TestStringMethods: def test_adding_schedule_success(self): """This is testing for adding schedule to the current schedule""" <|body_0|> def testing_delete_function(self): """This is testing for deleting schedule from the current schedule""" <|body_1|> de...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestStringMethods: def test_adding_schedule_success(self): """This is testing for adding schedule to the current schedule""" date = ['2013-04-20', '2013-04-21', '2013-04-22'] title = ['MA for 2013-04', 'Football', 'Shopping'] detail = ['Time schedule is from 10:00 to 14:00', 'P...
the_stack_v2_python_sparse
TechExam/Exam Folder/Calendar_EYM/UnitTest.py
yemarn510/YM_Python
train
0
59ee3e2aedfd1fdba44076c9b8763c9d042da6ad
[ "if os.environ.get('MODELICAPATH', None):\n print('Using predefined MODELICAPATH')\n self.modelica_lib_path = os.environ['MODELICAPATH']\nelse:\n self.modelica_lib_path = modelica_lib_path\nlocal_path = os.path.dirname(os.path.abspath(__file__))\nself.jmodelica_py_path = os.path.join(local_path, 'lib', 'ru...
<|body_start_0|> if os.environ.get('MODELICAPATH', None): print('Using predefined MODELICAPATH') self.modelica_lib_path = os.environ['MODELICAPATH'] else: self.modelica_lib_path = modelica_lib_path local_path = os.path.dirname(os.path.abspath(__file__)) ...
Class to run Modelica models. This is a very simple implementation of what needs to be a full CLI to run Modelica easily. At the moment, this probably only works on Linux/Mac and perhaps in Windows with Docker. For Ubuntu, here is the installation instruction: https://docs.docker.com/engine/install/ubuntu/ # TODO: test...
ModelicaRunner
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ModelicaRunner: """Class to run Modelica models. This is a very simple implementation of what needs to be a full CLI to run Modelica easily. At the moment, this probably only works on Linux/Mac and perhaps in Windows with Docker. For Ubuntu, here is the installation instruction: https://docs.dock...
stack_v2_sparse_classes_36k_train_010757
9,256
permissive
[ { "docstring": "Initialize the runner with data needed for simulation :param modelica_lib_path: string, Path to the MBL to run against", "name": "__init__", "signature": "def __init__(self, modelica_lib_path=None)" }, { "docstring": "Run the Modelica project in a docker-based environment. Result...
4
stack_v2_sparse_classes_30k_train_019612
Implement the Python class `ModelicaRunner` described below. Class description: Class to run Modelica models. This is a very simple implementation of what needs to be a full CLI to run Modelica easily. At the moment, this probably only works on Linux/Mac and perhaps in Windows with Docker. For Ubuntu, here is the inst...
Implement the Python class `ModelicaRunner` described below. Class description: Class to run Modelica models. This is a very simple implementation of what needs to be a full CLI to run Modelica easily. At the moment, this probably only works on Linux/Mac and perhaps in Windows with Docker. For Ubuntu, here is the inst...
b3245ec30c172c649041c4a2bd5298fb26d90e6f
<|skeleton|> class ModelicaRunner: """Class to run Modelica models. This is a very simple implementation of what needs to be a full CLI to run Modelica easily. At the moment, this probably only works on Linux/Mac and perhaps in Windows with Docker. For Ubuntu, here is the installation instruction: https://docs.dock...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ModelicaRunner: """Class to run Modelica models. This is a very simple implementation of what needs to be a full CLI to run Modelica easily. At the moment, this probably only works on Linux/Mac and perhaps in Windows with Docker. For Ubuntu, here is the installation instruction: https://docs.docker.com/engine...
the_stack_v2_python_sparse
geojson_modelica_translator/modelica/modelica_runner.py
ChengnanShi-Work/geojson-modelica-translator
train
0
03d4af03043cb42d12fa0dcb712029948a280d2d
[ "dummy = ListNode(-1)\ndummy.next = head\nslow, fast = (dummy, dummy)\nfor i in range(n):\n fast = fast.next\nwhile fast.next:\n slow, fast = (slow.next, fast.next)\nslow.next = slow.next.next\nreturn dummy.next", "previous, slow, fast = (None, head, head)\ncount = 0\nwhile fast:\n if count >= n:\n ...
<|body_start_0|> dummy = ListNode(-1) dummy.next = head slow, fast = (dummy, dummy) for i in range(n): fast = fast.next while fast.next: slow, fast = (slow.next, fast.next) slow.next = slow.next.next return dummy.next <|end_body_0|> <|body...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def removeNthFromEnd(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" <|body_0|> def removeNthFromEnd_v2(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" <|body_1|> def removeNthFromEnd_array(self...
stack_v2_sparse_classes_36k_train_010758
2,965
no_license
[ { "docstring": ":type head: ListNode :type n: int :rtype: ListNode", "name": "removeNthFromEnd", "signature": "def removeNthFromEnd(self, head, n)" }, { "docstring": ":type head: ListNode :type n: int :rtype: ListNode", "name": "removeNthFromEnd_v2", "signature": "def removeNthFromEnd_v2...
4
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeNthFromEnd(self, head, n): :type head: ListNode :type n: int :rtype: ListNode - def removeNthFromEnd_v2(self, head, n): :type head: ListNode :type n: int :rtype: ListNo...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeNthFromEnd(self, head, n): :type head: ListNode :type n: int :rtype: ListNode - def removeNthFromEnd_v2(self, head, n): :type head: ListNode :type n: int :rtype: ListNo...
e60ba45fe2f2e5e3b3abfecec3db76f5ce1fde59
<|skeleton|> class Solution: def removeNthFromEnd(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" <|body_0|> def removeNthFromEnd_v2(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" <|body_1|> def removeNthFromEnd_array(self...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def removeNthFromEnd(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" dummy = ListNode(-1) dummy.next = head slow, fast = (dummy, dummy) for i in range(n): fast = fast.next while fast.next: slow, fast = (...
the_stack_v2_python_sparse
src/lt_19.py
oxhead/CodingYourWay
train
0
ef0357dfe8945837588f841b7f40f274b2fdaefe
[ "instance = self.instance_id\nif self:\n instance.connect_in_shopify()\n shopify_webhook = shopify.Webhook()\nfor record in self:\n if record.webhook_id:\n url = record.get_base_url()\n route = record.get_route()\n try:\n webhook = shopify_webhook.find(record.webhook_id)\n ...
<|body_start_0|> instance = self.instance_id if self: instance.connect_in_shopify() shopify_webhook = shopify.Webhook() for record in self: if record.webhook_id: url = record.get_base_url() route = record.get_route() ...
ShopifyWebhookEpt
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ShopifyWebhookEpt: def unlink(self): """This method is used to delete record of webhook in shopify store. Delete receord from here Shopify => Configuration => Instances => Webhooks @author: Angel Patel@Emipro Technologies Pvt. Ltd.""" <|body_0|> def deactivate_auto_create_we...
stack_v2_sparse_classes_36k_train_010759
6,515
no_license
[ { "docstring": "This method is used to delete record of webhook in shopify store. Delete receord from here Shopify => Configuration => Instances => Webhooks @author: Angel Patel@Emipro Technologies Pvt. Ltd.", "name": "unlink", "signature": "def unlink(self)" }, { "docstring": "This method is us...
5
stack_v2_sparse_classes_30k_train_010180
Implement the Python class `ShopifyWebhookEpt` described below. Class description: Implement the ShopifyWebhookEpt class. Method signatures and docstrings: - def unlink(self): This method is used to delete record of webhook in shopify store. Delete receord from here Shopify => Configuration => Instances => Webhooks @...
Implement the Python class `ShopifyWebhookEpt` described below. Class description: Implement the ShopifyWebhookEpt class. Method signatures and docstrings: - def unlink(self): This method is used to delete record of webhook in shopify store. Delete receord from here Shopify => Configuration => Instances => Webhooks @...
6b64f0dfbeae0610605de9321d736f6f09768bb3
<|skeleton|> class ShopifyWebhookEpt: def unlink(self): """This method is used to delete record of webhook in shopify store. Delete receord from here Shopify => Configuration => Instances => Webhooks @author: Angel Patel@Emipro Technologies Pvt. Ltd.""" <|body_0|> def deactivate_auto_create_we...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ShopifyWebhookEpt: def unlink(self): """This method is used to delete record of webhook in shopify store. Delete receord from here Shopify => Configuration => Instances => Webhooks @author: Angel Patel@Emipro Technologies Pvt. Ltd.""" instance = self.instance_id if self: in...
the_stack_v2_python_sparse
shopify_ept/models/webhook_ept.py
marandagroup/sh_v14_addons
train
0
3dd0d8edb17023d24740181a00f06d6ec22ff317
[ "visit_func = getattr(self, f'visit_{type(node).__name__}', None)\nif visit_func is not None:\n retval = visit_func(node)\nelse:\n retval = True\nreturn False if retval is False else True", "leave_func = getattr(self, f'leave_{type(original_node).__name__}', None)\nif leave_func is not None:\n updated_no...
<|body_start_0|> visit_func = getattr(self, f'visit_{type(node).__name__}', None) if visit_func is not None: retval = visit_func(node) else: retval = True return False if retval is False else True <|end_body_0|> <|body_start_1|> leave_func = getattr(self,...
The low-level base visitor class for traversing a CST and creating an updated copy of the original CST. This should be used in conjunction with the :func:`~libcst.CSTNode.visit` method on a :class:`~libcst.CSTNode` to visit each element in a tree starting with that node, and possibly returning a new node in its place. ...
CSTTransformer
[ "Python-2.0", "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CSTTransformer: """The low-level base visitor class for traversing a CST and creating an updated copy of the original CST. This should be used in conjunction with the :func:`~libcst.CSTNode.visit` method on a :class:`~libcst.CSTNode` to visit each element in a tree starting with that node, and po...
stack_v2_sparse_classes_36k_train_010760
6,835
permissive
[ { "docstring": "Called every time a node is visited, before we've visited its children. Returns ``True`` if children should be visited, and returns ``False`` otherwise.", "name": "on_visit", "signature": "def on_visit(self, node: 'CSTNode') -> bool" }, { "docstring": "Called every time we leave ...
4
stack_v2_sparse_classes_30k_train_000974
Implement the Python class `CSTTransformer` described below. Class description: The low-level base visitor class for traversing a CST and creating an updated copy of the original CST. This should be used in conjunction with the :func:`~libcst.CSTNode.visit` method on a :class:`~libcst.CSTNode` to visit each element in...
Implement the Python class `CSTTransformer` described below. Class description: The low-level base visitor class for traversing a CST and creating an updated copy of the original CST. This should be used in conjunction with the :func:`~libcst.CSTNode.visit` method on a :class:`~libcst.CSTNode` to visit each element in...
9286446f889f1778b8f11451a68107052b2930b3
<|skeleton|> class CSTTransformer: """The low-level base visitor class for traversing a CST and creating an updated copy of the original CST. This should be used in conjunction with the :func:`~libcst.CSTNode.visit` method on a :class:`~libcst.CSTNode` to visit each element in a tree starting with that node, and po...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CSTTransformer: """The low-level base visitor class for traversing a CST and creating an updated copy of the original CST. This should be used in conjunction with the :func:`~libcst.CSTNode.visit` method on a :class:`~libcst.CSTNode` to visit each element in a tree starting with that node, and possibly return...
the_stack_v2_python_sparse
libcst/_visitors.py
Instagram/LibCST
train
1,300
00fb08a518628f5d661c84d48ae38d31c907aa5d
[ "super(CNN_Text, self).__init__()\nself.args = args\nVocab = args.embed_num\nDim = args.embed_dim\nCla = args.class_num\nCi = 1\nKnum = args.kernel_num\nKs = args.kernel_sizes\nself.embed = nn.Embedding(Vocab, Dim)\nself.convs = nn.ModuleList([nn.Conv2d(Ci, Knum, (K, Dim)) for K in Ks])\nself.dropout = nn.Dropout(a...
<|body_start_0|> super(CNN_Text, self).__init__() self.args = args Vocab = args.embed_num Dim = args.embed_dim Cla = args.class_num Ci = 1 Knum = args.kernel_num Ks = args.kernel_sizes self.embed = nn.Embedding(Vocab, Dim) self.convs = nn.M...
CNN_Text
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CNN_Text: def __init__(self, args): """Your code here. Define a text CNN structure. Note that args.kernel_sizes is a list, so you may need to use nn.ModuleList.""" <|body_0|> def forward(self, x): """Your code here. Give the forward pass of the model. With multiple k...
stack_v2_sparse_classes_36k_train_010761
2,079
no_license
[ { "docstring": "Your code here. Define a text CNN structure. Note that args.kernel_sizes is a list, so you may need to use nn.ModuleList.", "name": "__init__", "signature": "def __init__(self, args)" }, { "docstring": "Your code here. Give the forward pass of the model. With multiple kernel size...
2
stack_v2_sparse_classes_30k_train_019732
Implement the Python class `CNN_Text` described below. Class description: Implement the CNN_Text class. Method signatures and docstrings: - def __init__(self, args): Your code here. Define a text CNN structure. Note that args.kernel_sizes is a list, so you may need to use nn.ModuleList. - def forward(self, x): Your c...
Implement the Python class `CNN_Text` described below. Class description: Implement the CNN_Text class. Method signatures and docstrings: - def __init__(self, args): Your code here. Define a text CNN structure. Note that args.kernel_sizes is a list, so you may need to use nn.ModuleList. - def forward(self, x): Your c...
f1af0599ac8c3c8be4852472838dca775a22aa53
<|skeleton|> class CNN_Text: def __init__(self, args): """Your code here. Define a text CNN structure. Note that args.kernel_sizes is a list, so you may need to use nn.ModuleList.""" <|body_0|> def forward(self, x): """Your code here. Give the forward pass of the model. With multiple k...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CNN_Text: def __init__(self, args): """Your code here. Define a text CNN structure. Note that args.kernel_sizes is a list, so you may need to use nn.ModuleList.""" super(CNN_Text, self).__init__() self.args = args Vocab = args.embed_num Dim = args.embed_dim Cla ...
the_stack_v2_python_sparse
homework5/Shiqiang/model.py
Lukeming-tsinghua/pytorch-NLP-guidance
train
12
d45c89ffa6db18c2886a8cd0a16a8ca66fa57aff
[ "session = requests.Session()\nlogin_res = session.post(url=self.TestData['login']['login_url'], data=self.TestData['login']['login_data'], headers=self.headers)\nself.assertTrue(login_res.status_code == 200)\nLogger(self.TestData['name']).Info(str(self.TestData['login']) + '\\n' + login_res.text)\nsession.close()"...
<|body_start_0|> session = requests.Session() login_res = session.post(url=self.TestData['login']['login_url'], data=self.TestData['login']['login_data'], headers=self.headers) self.assertTrue(login_res.status_code == 200) Logger(self.TestData['name']).Info(str(self.TestData['login']) + ...
新采购系统接口测试
PurchaseM
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PurchaseM: """新采购系统接口测试""" def test1(self): """登录接口测试""" <|body_0|> def test2(self): """城市商品管理展示""" <|body_1|> <|end_skeleton|> <|body_start_0|> session = requests.Session() login_res = session.post(url=self.TestData['login']['login_url'...
stack_v2_sparse_classes_36k_train_010762
4,267
no_license
[ { "docstring": "登录接口测试", "name": "test1", "signature": "def test1(self)" }, { "docstring": "城市商品管理展示", "name": "test2", "signature": "def test2(self)" } ]
2
stack_v2_sparse_classes_30k_train_010538
Implement the Python class `PurchaseM` described below. Class description: 新采购系统接口测试 Method signatures and docstrings: - def test1(self): 登录接口测试 - def test2(self): 城市商品管理展示
Implement the Python class `PurchaseM` described below. Class description: 新采购系统接口测试 Method signatures and docstrings: - def test1(self): 登录接口测试 - def test2(self): 城市商品管理展示 <|skeleton|> class PurchaseM: """新采购系统接口测试""" def test1(self): """登录接口测试""" <|body_0|> def test2(self): ""...
c32f1686f44454ca2d32eb0a2a8258a0f5d64601
<|skeleton|> class PurchaseM: """新采购系统接口测试""" def test1(self): """登录接口测试""" <|body_0|> def test2(self): """城市商品管理展示""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PurchaseM: """新采购系统接口测试""" def test1(self): """登录接口测试""" session = requests.Session() login_res = session.post(url=self.TestData['login']['login_url'], data=self.TestData['login']['login_data'], headers=self.headers) self.assertTrue(login_res.status_code == 200) Lo...
the_stack_v2_python_sparse
pycharmProjects/System_Api/Project/purchase_management/purchaseMana.py
xiaocheng903/projects
train
0
a54acbcfe9c3cbafee7e711c1d7b541651a65def
[ "if not matrix or not matrix[0]:\n return\nm, n = (len(matrix), len(matrix[0]))\nrow_ind, col_ind = (set(), set())\nfor i in xrange(m):\n for j in xrange(n):\n if not matrix[i][j]:\n row_ind.add(i)\n col_ind.add(j)\nfor i in row_ind:\n matrix[i] = [0] * n\nfor j in col_ind:\n ...
<|body_start_0|> if not matrix or not matrix[0]: return m, n = (len(matrix), len(matrix[0])) row_ind, col_ind = (set(), set()) for i in xrange(m): for j in xrange(n): if not matrix[i][j]: row_ind.add(i) col_i...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def setZeroes(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.""" <|body_0|> def setZeroes2(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matri...
stack_v2_sparse_classes_36k_train_010763
2,424
no_license
[ { "docstring": ":type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.", "name": "setZeroes", "signature": "def setZeroes(self, matrix)" }, { "docstring": ":type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instea...
2
stack_v2_sparse_classes_30k_train_016882
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def setZeroes(self, matrix): :type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead. - def setZeroes2(self, matrix): :type matrix: List...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def setZeroes(self, matrix): :type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead. - def setZeroes2(self, matrix): :type matrix: List...
18ed31a3edf20a3e5a0b7a0b56acca5b98939693
<|skeleton|> class Solution: def setZeroes(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.""" <|body_0|> def setZeroes2(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matri...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def setZeroes(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.""" if not matrix or not matrix[0]: return m, n = (len(matrix), len(matrix[0])) row_ind, col_ind = (set(), set()) for ...
the_stack_v2_python_sparse
exercises/array/set_zeros.py
nahgnaw/data-structure
train
0
5e64c07affa1968ea878f4be27f9d4baa44c9ec0
[ "if model == FilterRecordingTracking:\n return 'db_rest_api'\nreturn None", "if model == FilterRecordingTracking:\n return 'db_rest_api'\nreturn None" ]
<|body_start_0|> if model == FilterRecordingTracking: return 'db_rest_api' return None <|end_body_0|> <|body_start_1|> if model == FilterRecordingTracking: return 'db_rest_api' return None <|end_body_1|>
CloudDBRouter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CloudDBRouter: def db_for_read(self, model, **hints): """reading FilterRecordingTracking from barc-prod""" <|body_0|> def db_for_write(self, model, **hints): """writing FilterRecordingTracking to barc-prod""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_010764
649
no_license
[ { "docstring": "reading FilterRecordingTracking from barc-prod", "name": "db_for_read", "signature": "def db_for_read(self, model, **hints)" }, { "docstring": "writing FilterRecordingTracking to barc-prod", "name": "db_for_write", "signature": "def db_for_write(self, model, **hints)" }...
2
stack_v2_sparse_classes_30k_train_003935
Implement the Python class `CloudDBRouter` described below. Class description: Implement the CloudDBRouter class. Method signatures and docstrings: - def db_for_read(self, model, **hints): reading FilterRecordingTracking from barc-prod - def db_for_write(self, model, **hints): writing FilterRecordingTracking to barc-...
Implement the Python class `CloudDBRouter` described below. Class description: Implement the CloudDBRouter class. Method signatures and docstrings: - def db_for_read(self, model, **hints): reading FilterRecordingTracking from barc-prod - def db_for_write(self, model, **hints): writing FilterRecordingTracking to barc-...
d084c6146de114823f68046fd4a57fe04544a403
<|skeleton|> class CloudDBRouter: def db_for_read(self, model, **hints): """reading FilterRecordingTracking from barc-prod""" <|body_0|> def db_for_write(self, model, **hints): """writing FilterRecordingTracking to barc-prod""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CloudDBRouter: def db_for_read(self, model, **hints): """reading FilterRecordingTracking from barc-prod""" if model == FilterRecordingTracking: return 'db_rest_api' return None def db_for_write(self, model, **hints): """writing FilterRecordingTracking to barc-p...
the_stack_v2_python_sparse
dashboard/rest_api/dbrouters.py
teraflik/ao-tv-recording-dashboard
train
1
109a7f4b043dc9bb993cd3ba83c004b66adc1b9c
[ "plugin = NeighbourSelection()\nsite_altitude = 3.0\nnodes = np.array([[0, 4], [1, 4], [2, 4], [3, 4], [4, 4]])\ndistance = np.arange(5)\nindices = np.arange(5)\nresult = plugin.select_minimum_dz(self.region_orography, site_altitude, nodes, distance, indices)\nself.assertArrayEqual(result, nodes[0])", "plugin = N...
<|body_start_0|> plugin = NeighbourSelection() site_altitude = 3.0 nodes = np.array([[0, 4], [1, 4], [2, 4], [3, 4], [4, 4]]) distance = np.arange(5) indices = np.arange(5) result = plugin.select_minimum_dz(self.region_orography, site_altitude, nodes, distance, indices) ...
Test extraction of the minimum height difference points from a provided array of neighbours. Note that the region orography has a series of islands at a y index of 4, changing elevation with x. As such the nodes are chosen along this line, e.g. [0, 4], [1, 4], etc.
Test_select_minimum_dz
[ "BSD-3-Clause", "LicenseRef-scancode-proprietary-license" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test_select_minimum_dz: """Test extraction of the minimum height difference points from a provided array of neighbours. Note that the region orography has a series of islands at a y index of 4, changing elevation with x. As such the nodes are chosen along this line, e.g. [0, 4], [1, 4], etc.""" ...
stack_v2_sparse_classes_36k_train_010765
40,371
permissive
[ { "docstring": "Test a simple case where the first element in the provided lists has the smallest vertical displacement to the site. Expect the coordinates of the first node to be returned.", "name": "test_basic", "signature": "def test_basic(self)" }, { "docstring": "Test a case where some node...
4
null
Implement the Python class `Test_select_minimum_dz` described below. Class description: Test extraction of the minimum height difference points from a provided array of neighbours. Note that the region orography has a series of islands at a y index of 4, changing elevation with x. As such the nodes are chosen along th...
Implement the Python class `Test_select_minimum_dz` described below. Class description: Test extraction of the minimum height difference points from a provided array of neighbours. Note that the region orography has a series of islands at a y index of 4, changing elevation with x. As such the nodes are chosen along th...
cd2c9019944345df1e703bf8f625db537ad9f559
<|skeleton|> class Test_select_minimum_dz: """Test extraction of the minimum height difference points from a provided array of neighbours. Note that the region orography has a series of islands at a y index of 4, changing elevation with x. As such the nodes are chosen along this line, e.g. [0, 4], [1, 4], etc.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Test_select_minimum_dz: """Test extraction of the minimum height difference points from a provided array of neighbours. Note that the region orography has a series of islands at a y index of 4, changing elevation with x. As such the nodes are chosen along this line, e.g. [0, 4], [1, 4], etc.""" def test_...
the_stack_v2_python_sparse
improver_tests/spotdata/test_NeighbourSelection.py
metoppv/improver
train
101
c1eb32943203889bcfdc34ffa4814b759b25094e
[ "fast = slow = chain\nwhile fast is not None and fast.next is not None:\n fast = fast.next.next\n slow = slow.next\n if fast == slow:\n return False\nreturn True", "fast = slow = chain\nwhile fast is not None and fast.next is not None:\n fast = fast.next.next\n slow = slow.next\n if fast ...
<|body_start_0|> fast = slow = chain while fast is not None and fast.next is not None: fast = fast.next.next slow = slow.next if fast == slow: return False return True <|end_body_0|> <|body_start_1|> fast = slow = chain while f...
类似下面的思路,我们还可以让快指针一次前进两步,慢指针一次前进一步,当快指针到达链表尽头时,慢指针就处于链表的中间位置。
Pointer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Pointer: """类似下面的思路,我们还可以让快指针一次前进两步,慢指针一次前进一步,当快指针到达链表尽头时,慢指针就处于链表的中间位置。""" def has_cycle(self, chain: ChainNode) -> bool: """一个块指针,一个慢指针,当快慢指针相遇时,说明有环; 当块指针next为None时,说明不为环;""" <|body_0|> def detect_cycle(self, chain: ChainNode) -> ChainNode: """假设chain是环,求环开始的地...
stack_v2_sparse_classes_36k_train_010766
2,203
no_license
[ { "docstring": "一个块指针,一个慢指针,当快慢指针相遇时,说明有环; 当块指针next为None时,说明不为环;", "name": "has_cycle", "signature": "def has_cycle(self, chain: ChainNode) -> bool" }, { "docstring": "假设chain是环,求环开始的地方。 当快慢指针相遇,慢指针走了k,则块指针一定走了2k,则环的距离为k; 假设相遇点距离环起点距离为m,则head与相遇点距离为k - m,刚好从相遇点再走k - m步,刚好到达环起点", "name": "det...
3
null
Implement the Python class `Pointer` described below. Class description: 类似下面的思路,我们还可以让快指针一次前进两步,慢指针一次前进一步,当快指针到达链表尽头时,慢指针就处于链表的中间位置。 Method signatures and docstrings: - def has_cycle(self, chain: ChainNode) -> bool: 一个块指针,一个慢指针,当快慢指针相遇时,说明有环; 当块指针next为None时,说明不为环; - def detect_cycle(self, chain: ChainNode) -> ChainN...
Implement the Python class `Pointer` described below. Class description: 类似下面的思路,我们还可以让快指针一次前进两步,慢指针一次前进一步,当快指针到达链表尽头时,慢指针就处于链表的中间位置。 Method signatures and docstrings: - def has_cycle(self, chain: ChainNode) -> bool: 一个块指针,一个慢指针,当快慢指针相遇时,说明有环; 当块指针next为None时,说明不为环; - def detect_cycle(self, chain: ChainNode) -> ChainN...
f656e605fc30917f79e9152dd2b424049280e960
<|skeleton|> class Pointer: """类似下面的思路,我们还可以让快指针一次前进两步,慢指针一次前进一步,当快指针到达链表尽头时,慢指针就处于链表的中间位置。""" def has_cycle(self, chain: ChainNode) -> bool: """一个块指针,一个慢指针,当快慢指针相遇时,说明有环; 当块指针next为None时,说明不为环;""" <|body_0|> def detect_cycle(self, chain: ChainNode) -> ChainNode: """假设chain是环,求环开始的地...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Pointer: """类似下面的思路,我们还可以让快指针一次前进两步,慢指针一次前进一步,当快指针到达链表尽头时,慢指针就处于链表的中间位置。""" def has_cycle(self, chain: ChainNode) -> bool: """一个块指针,一个慢指针,当快慢指针相遇时,说明有环; 当块指针next为None时,说明不为环;""" fast = slow = chain while fast is not None and fast.next is not None: fast = fast.next.next...
the_stack_v2_python_sparse
tree/pointer.py
JustMeliyu/Algorithm
train
0
1b5cc9845e549e1be584d246b375293b6d76be38
[ "keys = self.getKeys(value)\nif len(keys) > 0:\n return keys[0]\nelse:\n return None", "keys = []\nfor key, keyedValue in self.items():\n if keyedValue == value:\n keys.append(key)\n continue\nkeys.sort()\nreturn keys" ]
<|body_start_0|> keys = self.getKeys(value) if len(keys) > 0: return keys[0] else: return None <|end_body_0|> <|body_start_1|> keys = [] for key, keyedValue in self.items(): if keyedValue == value: keys.append(key) ...
ValueDict
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ValueDict: def getFirstKey(self, value): """Return the first key that has the specified value, returns None if the value can't be found.""" <|body_0|> def getKeys(self, value): """Return a sorted list of keys that have the specified value. Returns an empty list if th...
stack_v2_sparse_classes_36k_train_010767
733
no_license
[ { "docstring": "Return the first key that has the specified value, returns None if the value can't be found.", "name": "getFirstKey", "signature": "def getFirstKey(self, value)" }, { "docstring": "Return a sorted list of keys that have the specified value. Returns an empty list if the value isn'...
2
null
Implement the Python class `ValueDict` described below. Class description: Implement the ValueDict class. Method signatures and docstrings: - def getFirstKey(self, value): Return the first key that has the specified value, returns None if the value can't be found. - def getKeys(self, value): Return a sorted list of k...
Implement the Python class `ValueDict` described below. Class description: Implement the ValueDict class. Method signatures and docstrings: - def getFirstKey(self, value): Return the first key that has the specified value, returns None if the value can't be found. - def getKeys(self, value): Return a sorted list of k...
fa3e3fa061833f04d9a21fa3c29580259243841a
<|skeleton|> class ValueDict: def getFirstKey(self, value): """Return the first key that has the specified value, returns None if the value can't be found.""" <|body_0|> def getKeys(self, value): """Return a sorted list of keys that have the specified value. Returns an empty list if th...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ValueDict: def getFirstKey(self, value): """Return the first key that has the specified value, returns None if the value can't be found.""" keys = self.getKeys(value) if len(keys) > 0: return keys[0] else: return None def getKeys(self, value): ...
the_stack_v2_python_sparse
Server/ipl/types/ValueDict.py
shabnamparsa-stemcell/RoboSep-STest
train
1
0974239e6d6361063e1eab70da650ce93b4e09e2
[ "self.persons = persons\nself.times = times\nself.cache = {}", "if t in self.cache:\n return self.cache[t]\ncounter = collections.Counter()\ntickets = []\nfor i, tm in enumerate(self.times):\n if t < tm:\n break\n tickets.append(self.persons[i])\ncounter.update(tickets)\ncandidates = set()\nfor i ...
<|body_start_0|> self.persons = persons self.times = times self.cache = {} <|end_body_0|> <|body_start_1|> if t in self.cache: return self.cache[t] counter = collections.Counter() tickets = [] for i, tm in enumerate(self.times): if t < tm:...
TopVotedCandidate
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TopVotedCandidate: def __init__(self, persons, times): """:type persons: List[int] :type times: List[int]""" <|body_0|> def q(self, t): """:type t: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.persons = persons self.t...
stack_v2_sparse_classes_36k_train_010768
1,505
no_license
[ { "docstring": ":type persons: List[int] :type times: List[int]", "name": "__init__", "signature": "def __init__(self, persons, times)" }, { "docstring": ":type t: int :rtype: int", "name": "q", "signature": "def q(self, t)" } ]
2
stack_v2_sparse_classes_30k_test_001159
Implement the Python class `TopVotedCandidate` described below. Class description: Implement the TopVotedCandidate class. Method signatures and docstrings: - def __init__(self, persons, times): :type persons: List[int] :type times: List[int] - def q(self, t): :type t: int :rtype: int
Implement the Python class `TopVotedCandidate` described below. Class description: Implement the TopVotedCandidate class. Method signatures and docstrings: - def __init__(self, persons, times): :type persons: List[int] :type times: List[int] - def q(self, t): :type t: int :rtype: int <|skeleton|> class TopVotedCandi...
d2cbd0aabff2f0b617d34a59b62771f6764adf95
<|skeleton|> class TopVotedCandidate: def __init__(self, persons, times): """:type persons: List[int] :type times: List[int]""" <|body_0|> def q(self, t): """:type t: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TopVotedCandidate: def __init__(self, persons, times): """:type persons: List[int] :type times: List[int]""" self.persons = persons self.times = times self.cache = {} def q(self, t): """:type t: int :rtype: int""" if t in self.cache: return self...
the_stack_v2_python_sparse
911.在线选举.py
ChenghaoZHU/LeetCode
train
0
c00ecc88838314256947875c026edee9048581e6
[ "self.value_stack = []\nwhile root:\n self.value_stack.append(root)\n root = root.left", "temp_root = self.value_stack.pop()\ntemp_value = temp_root.val\ntemp_root = temp_root.right\nwhile temp_root:\n self.value_stack.append(temp_root)\n temp_root = temp_root.left\nreturn temp_value", "if self.valu...
<|body_start_0|> self.value_stack = [] while root: self.value_stack.append(root) root = root.left <|end_body_0|> <|body_start_1|> temp_root = self.value_stack.pop() temp_value = temp_root.val temp_root = temp_root.right while temp_root: ...
BSTIterator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BSTIterator: def __init__(self, root): """:type root: TreeNode""" <|body_0|> def next(self): """:rtype: int""" <|body_1|> def hasNext(self): """:rtype: bool""" <|body_2|> <|end_skeleton|> <|body_start_0|> self.value_stack = [] ...
stack_v2_sparse_classes_36k_train_010769
1,145
no_license
[ { "docstring": ":type root: TreeNode", "name": "__init__", "signature": "def __init__(self, root)" }, { "docstring": ":rtype: int", "name": "next", "signature": "def next(self)" }, { "docstring": ":rtype: bool", "name": "hasNext", "signature": "def hasNext(self)" } ]
3
stack_v2_sparse_classes_30k_test_000638
Implement the Python class `BSTIterator` described below. Class description: Implement the BSTIterator class. Method signatures and docstrings: - def __init__(self, root): :type root: TreeNode - def next(self): :rtype: int - def hasNext(self): :rtype: bool
Implement the Python class `BSTIterator` described below. Class description: Implement the BSTIterator class. Method signatures and docstrings: - def __init__(self, root): :type root: TreeNode - def next(self): :rtype: int - def hasNext(self): :rtype: bool <|skeleton|> class BSTIterator: def __init__(self, root...
dc45210cb2cc50bfefd8c21c865e6ee2163a022a
<|skeleton|> class BSTIterator: def __init__(self, root): """:type root: TreeNode""" <|body_0|> def next(self): """:rtype: int""" <|body_1|> def hasNext(self): """:rtype: bool""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BSTIterator: def __init__(self, root): """:type root: TreeNode""" self.value_stack = [] while root: self.value_stack.append(root) root = root.left def next(self): """:rtype: int""" temp_root = self.value_stack.pop() temp_value = temp...
the_stack_v2_python_sparse
practice/solution/0173_binary_search_tree_iterator.py
kesarb/leetcode-summary-python
train
0
f1c389cd1843d8d9663d5368ddf7e4f596059b8f
[ "form_data = {'title': 'Post', 'text': 'TEST POST', 'image': make_dummy_image()}\nresponse = self.client.post(reverse('blogs:post'), data=form_data)\nself.assertRedirects(response, reverse('login') + '?next=' + reverse('blogs:post'))", "self.client.force_login(User.objects.create_user('tester', 'test@gmail.com', ...
<|body_start_0|> form_data = {'title': 'Post', 'text': 'TEST POST', 'image': make_dummy_image()} response = self.client.post(reverse('blogs:post'), data=form_data) self.assertRedirects(response, reverse('login') + '?next=' + reverse('blogs:post')) <|end_body_0|> <|body_start_1|> self.cl...
Tests PostCreateView
PostCreateViewTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PostCreateViewTests: """Tests PostCreateView""" def test_not_logged_in_post(self): """If the user are not authenticated, they are redirected to login page""" <|body_0|> def test_logged_in_post(self): """If the user are authenticated, they can create post and are ...
stack_v2_sparse_classes_36k_train_010770
16,313
no_license
[ { "docstring": "If the user are not authenticated, they are redirected to login page", "name": "test_not_logged_in_post", "signature": "def test_not_logged_in_post(self)" }, { "docstring": "If the user are authenticated, they can create post and are redirected to index page", "name": "test_l...
2
stack_v2_sparse_classes_30k_train_012197
Implement the Python class `PostCreateViewTests` described below. Class description: Tests PostCreateView Method signatures and docstrings: - def test_not_logged_in_post(self): If the user are not authenticated, they are redirected to login page - def test_logged_in_post(self): If the user are authenticated, they can...
Implement the Python class `PostCreateViewTests` described below. Class description: Tests PostCreateView Method signatures and docstrings: - def test_not_logged_in_post(self): If the user are not authenticated, they are redirected to login page - def test_logged_in_post(self): If the user are authenticated, they can...
5c34181eb63edcf3d6cecd4e22748f30f73cf2ae
<|skeleton|> class PostCreateViewTests: """Tests PostCreateView""" def test_not_logged_in_post(self): """If the user are not authenticated, they are redirected to login page""" <|body_0|> def test_logged_in_post(self): """If the user are authenticated, they can create post and are ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PostCreateViewTests: """Tests PostCreateView""" def test_not_logged_in_post(self): """If the user are not authenticated, they are redirected to login page""" form_data = {'title': 'Post', 'text': 'TEST POST', 'image': make_dummy_image()} response = self.client.post(reverse('blogs:...
the_stack_v2_python_sparse
blogs/tests.py
ino777/myblogapp
train
0
56af4f14d7a7bc49058f75a5ffd34e3bf122239b
[ "ss = acm.FStoredScenario.Select(\"name='{0}'\".format(title))\nif len(ss) != 1:\n raise ValueError('Could not find the specified scenario.')\nself.scenario = ss[0].Scenario()", "scen_dim = self.scenario.ExplicitDimensions()[vector_nr]\nsel_value = lambda x: str(x.Parameter('rs'))\nvec = scen_dim.ShiftVectors(...
<|body_start_0|> ss = acm.FStoredScenario.Select("name='{0}'".format(title)) if len(ss) != 1: raise ValueError('Could not find the specified scenario.') self.scenario = ss[0].Scenario() <|end_body_0|> <|body_start_1|> scen_dim = self.scenario.ExplicitDimensions()[vector_nr] ...
Contains methods that are related to FStoredScenario.
FScenarioUtil
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FScenarioUtil: """Contains methods that are related to FStoredScenario.""" def __init__(self, title): """Sets the scenario attribute to the front arena instance of the FStoredScenario type with the corresponding title""" <|body_0|> def get_scenario_vector_as_list(self, v...
stack_v2_sparse_classes_36k_train_010771
8,293
no_license
[ { "docstring": "Sets the scenario attribute to the front arena instance of the FStoredScenario type with the corresponding title", "name": "__init__", "signature": "def __init__(self, title)" }, { "docstring": "Returns the tuple (title, values) with the vector title and the vector items values",...
2
stack_v2_sparse_classes_30k_train_004458
Implement the Python class `FScenarioUtil` described below. Class description: Contains methods that are related to FStoredScenario. Method signatures and docstrings: - def __init__(self, title): Sets the scenario attribute to the front arena instance of the FStoredScenario type with the corresponding title - def get...
Implement the Python class `FScenarioUtil` described below. Class description: Contains methods that are related to FStoredScenario. Method signatures and docstrings: - def __init__(self, title): Sets the scenario attribute to the front arena instance of the FStoredScenario type with the corresponding title - def get...
5e7cc7de3495145501ca53deb9efee2233ab7e1c
<|skeleton|> class FScenarioUtil: """Contains methods that are related to FStoredScenario.""" def __init__(self, title): """Sets the scenario attribute to the front arena instance of the FStoredScenario type with the corresponding title""" <|body_0|> def get_scenario_vector_as_list(self, v...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FScenarioUtil: """Contains methods that are related to FStoredScenario.""" def __init__(self, title): """Sets the scenario attribute to the front arena instance of the FStoredScenario type with the corresponding title""" ss = acm.FStoredScenario.Select("name='{0}'".format(title)) ...
the_stack_v2_python_sparse
Python modules/RiskMatrixViewSimpleReport.py
webclinic017/fa-absa-py3
train
0
d4d543ba40731f99c1e403d817fb5599e73eb0e6
[ "self.seed = [13579, 34628, 2888, 11111, 67917]\nself.dim = 6\nself.test_order = 5", "for s in self.seed:\n seed(s)\n x = rand(self.dim, self.dim)\n y = rand(self.dim, self.dim)\n z = rand(self.dim, self.dim)\n test = bch_expand(x, y, order=self.test_order)\n baseline = bch_expand_baseline(x, y,...
<|body_start_0|> self.seed = [13579, 34628, 2888, 11111, 67917] self.dim = 6 self.test_order = 5 <|end_body_0|> <|body_start_1|> for s in self.seed: seed(s) x = rand(self.dim, self.dim) y = rand(self.dim, self.dim) z = rand(self.dim, self....
BCHTest
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BCHTest: def setUp(self): """Initialize a few density matrices""" <|body_0|> def test_bch(self): """Test efficient bch expansion against hard-coded baseline coefficients""" <|body_1|> def test_verification(self): """Verify basic sanity checking o...
stack_v2_sparse_classes_36k_train_010772
4,231
permissive
[ { "docstring": "Initialize a few density matrices", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Test efficient bch expansion against hard-coded baseline coefficients", "name": "test_bch", "signature": "def test_bch(self)" }, { "docstring": "Verify basic san...
3
stack_v2_sparse_classes_30k_train_019027
Implement the Python class `BCHTest` described below. Class description: Implement the BCHTest class. Method signatures and docstrings: - def setUp(self): Initialize a few density matrices - def test_bch(self): Test efficient bch expansion against hard-coded baseline coefficients - def test_verification(self): Verify...
Implement the Python class `BCHTest` described below. Class description: Implement the BCHTest class. Method signatures and docstrings: - def setUp(self): Initialize a few density matrices - def test_bch(self): Test efficient bch expansion against hard-coded baseline coefficients - def test_verification(self): Verify...
788481753c798a72c5cb3aa9f2aa9da3ce3190b0
<|skeleton|> class BCHTest: def setUp(self): """Initialize a few density matrices""" <|body_0|> def test_bch(self): """Test efficient bch expansion against hard-coded baseline coefficients""" <|body_1|> def test_verification(self): """Verify basic sanity checking o...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BCHTest: def setUp(self): """Initialize a few density matrices""" self.seed = [13579, 34628, 2888, 11111, 67917] self.dim = 6 self.test_order = 5 def test_bch(self): """Test efficient bch expansion against hard-coded baseline coefficients""" for s in self.s...
the_stack_v2_python_sparse
src/openfermion/utils/bch_expansion_test.py
quantumlib/OpenFermion
train
1,481
ad4113e2e9574e8455576a20da154d01898ee567
[ "scale_fac = self._get_stress_drop_scaling_factor(rup.mag)\nmean = self._get_mean(sites.vs30, rup.mag, dists.rrup, imt, scale_fac)\nstddevs = self._get_stddevs(stddev_types, num_sites=sites.vs30.size)\nreturn (mean, stddevs)", "stress_drop = 10.0 ** (3.45 - 0.2 * magnitude)\ncap = 10.0 ** (3.45 - 0.2 * 5.0)\nif s...
<|body_start_0|> scale_fac = self._get_stress_drop_scaling_factor(rup.mag) mean = self._get_mean(sites.vs30, rup.mag, dists.rrup, imt, scale_fac) stddevs = self._get_stddevs(stddev_types, num_sites=sites.vs30.size) return (mean, stddevs) <|end_body_0|> <|body_start_1|> stress_dr...
This GMPE modifies the original implementation of :class: `AtkinsonBoore2006` with the magnitude dependent stress-drop scaling factor proposed in Atkinson & Boore (2011) Atkinson, G. A. and Boore D. M. (2011) Modifications to Existing Ground-Motion Prediciton Equations in Light of New Data. Bulletin of the Seismologica...
AtkinsonBoore2006Modified2011
[ "AGPL-3.0-only", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AtkinsonBoore2006Modified2011: """This GMPE modifies the original implementation of :class: `AtkinsonBoore2006` with the magnitude dependent stress-drop scaling factor proposed in Atkinson & Boore (2011) Atkinson, G. A. and Boore D. M. (2011) Modifications to Existing Ground-Motion Prediciton Equ...
stack_v2_sparse_classes_36k_train_010773
25,097
permissive
[ { "docstring": "See :meth:`superclass method <.base.GroundShakingIntensityModel.get_mean_and_stddevs>` for spec of input and result values.", "name": "get_mean_and_stddevs", "signature": "def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types)" }, { "docstring": "Returns the magnitu...
2
null
Implement the Python class `AtkinsonBoore2006Modified2011` described below. Class description: This GMPE modifies the original implementation of :class: `AtkinsonBoore2006` with the magnitude dependent stress-drop scaling factor proposed in Atkinson & Boore (2011) Atkinson, G. A. and Boore D. M. (2011) Modifications t...
Implement the Python class `AtkinsonBoore2006Modified2011` described below. Class description: This GMPE modifies the original implementation of :class: `AtkinsonBoore2006` with the magnitude dependent stress-drop scaling factor proposed in Atkinson & Boore (2011) Atkinson, G. A. and Boore D. M. (2011) Modifications t...
0da9ba5a575360081715e8b90c71d4b16c6687c8
<|skeleton|> class AtkinsonBoore2006Modified2011: """This GMPE modifies the original implementation of :class: `AtkinsonBoore2006` with the magnitude dependent stress-drop scaling factor proposed in Atkinson & Boore (2011) Atkinson, G. A. and Boore D. M. (2011) Modifications to Existing Ground-Motion Prediciton Equ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AtkinsonBoore2006Modified2011: """This GMPE modifies the original implementation of :class: `AtkinsonBoore2006` with the magnitude dependent stress-drop scaling factor proposed in Atkinson & Boore (2011) Atkinson, G. A. and Boore D. M. (2011) Modifications to Existing Ground-Motion Prediciton Equations in Lig...
the_stack_v2_python_sparse
openquake/hazardlib/gsim/atkinson_boore_2006.py
GFZ-Centre-for-Early-Warning/shakyground
train
1
3fe4955dd4a1f00935f929893e4848b52c046aae
[ "lookup_a = HostLookup()\nlookup_a.add_node('nodename', 'hostname')\nlookup_b = HostLookup()\nself.assertEquals(lookup_a.get_host('nodename'), lookup_b.get_host('nodename'))", "lookup = HostLookup()\nfor x in range(1, 3):\n rstat = RatedStatistics()\n rstat.host = 'host1'\n rstat.seuid = 'n%s%s%d' % (SEU...
<|body_start_0|> lookup_a = HostLookup() lookup_a.add_node('nodename', 'hostname') lookup_b = HostLookup() self.assertEquals(lookup_a.get_host('nodename'), lookup_b.get_host('nodename')) <|end_body_0|> <|body_start_1|> lookup = HostLookup() for x in range(1, 3): ...
TestHostLookup
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestHostLookup: def test_singleton(self): """Test if the singleton is working properly.""" <|body_0|> def test_callback_easy(self): """Test if a called callback adds the node - host to the dict.""" <|body_1|> def test_get_node_list(self): """Test...
stack_v2_sparse_classes_36k_train_010774
1,553
permissive
[ { "docstring": "Test if the singleton is working properly.", "name": "test_singleton", "signature": "def test_singleton(self)" }, { "docstring": "Test if a called callback adds the node - host to the dict.", "name": "test_callback_easy", "signature": "def test_callback_easy(self)" }, ...
3
null
Implement the Python class `TestHostLookup` described below. Class description: Implement the TestHostLookup class. Method signatures and docstrings: - def test_singleton(self): Test if the singleton is working properly. - def test_callback_easy(self): Test if a called callback adds the node - host to the dict. - def...
Implement the Python class `TestHostLookup` described below. Class description: Implement the TestHostLookup class. Method signatures and docstrings: - def test_singleton(self): Test if the singleton is working properly. - def test_callback_easy(self): Test if a called callback adds the node - host to the dict. - def...
6a934f25341fa4e49afb0c18aac8767db32ba177
<|skeleton|> class TestHostLookup: def test_singleton(self): """Test if the singleton is working properly.""" <|body_0|> def test_callback_easy(self): """Test if a called callback adds the node - host to the dict.""" <|body_1|> def test_get_node_list(self): """Test...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestHostLookup: def test_singleton(self): """Test if the singleton is working properly.""" lookup_a = HostLookup() lookup_a.add_node('nodename', 'hostname') lookup_b = HostLookup() self.assertEquals(lookup_a.get_host('nodename'), lookup_b.get_host('nodename')) def ...
the_stack_v2_python_sparse
arni_core/src/arni_core/test_host_lookup.py
ROS-PSE/arni
train
16
20181cde79aed270068f202a65271e2e59b72b92
[ "for menu in self:\n if menu.item_with_command(cmd):\n return menu\nreturn None", "for menu in self:\n item = menu.item_with_command(cmd)\n if item:\n return item\nreturn None" ]
<|body_start_0|> for menu in self: if menu.item_with_command(cmd): return menu return None <|end_body_0|> <|body_start_1|> for menu in self: item = menu.item_with_command(cmd) if item: return item return None <|end_body...
A MenuList is a sequence of Menus with methods for finding menus and menu items by command.
MenuList
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MenuList: """A MenuList is a sequence of Menus with methods for finding menus and menu items by command.""" def menu_with_command(self, cmd): """Returns the menu containing the given command, or None if there is no such menu in the list.""" <|body_0|> def item_with_comma...
stack_v2_sparse_classes_36k_train_010775
660
permissive
[ { "docstring": "Returns the menu containing the given command, or None if there is no such menu in the list.", "name": "menu_with_command", "signature": "def menu_with_command(self, cmd)" }, { "docstring": "Returns the menu item having the given command, or None if there is no such item.", "...
2
stack_v2_sparse_classes_30k_train_018670
Implement the Python class `MenuList` described below. Class description: A MenuList is a sequence of Menus with methods for finding menus and menu items by command. Method signatures and docstrings: - def menu_with_command(self, cmd): Returns the menu containing the given command, or None if there is no such menu in...
Implement the Python class `MenuList` described below. Class description: A MenuList is a sequence of Menus with methods for finding menus and menu items by command. Method signatures and docstrings: - def menu_with_command(self, cmd): Returns the menu containing the given command, or None if there is no such menu in...
58c6c38ccb8e66acdf98dea6b24bef1d9a03147c
<|skeleton|> class MenuList: """A MenuList is a sequence of Menus with methods for finding menus and menu items by command.""" def menu_with_command(self, cmd): """Returns the menu containing the given command, or None if there is no such menu in the list.""" <|body_0|> def item_with_comma...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MenuList: """A MenuList is a sequence of Menus with methods for finding menus and menu items by command.""" def menu_with_command(self, cmd): """Returns the menu containing the given command, or None if there is no such menu in the list.""" for menu in self: if menu.item_with_...
the_stack_v2_python_sparse
GUI/Generic/MenuList.py
coldmax88/PyGUI
train
0
536188c0dfcd7109cbf376aa0e73d7efecd59d64
[ "create_patient()\nc = Client()\nc.login(email='test_patient@gmail.com', password='12345pas')\nresponse = c.get(reverse('patient:index'))\nself.assertEqual(response.status_code, 200)\nself.assertContains(response, 'Your Monthly Calendar')", "patient = create_patient()\nname = 'Appointment'\ndate = datetime.date.t...
<|body_start_0|> create_patient() c = Client() c.login(email='test_patient@gmail.com', password='12345pas') response = c.get(reverse('patient:index')) self.assertEqual(response.status_code, 200) self.assertContains(response, 'Your Monthly Calendar') <|end_body_0|> <|body...
CalendarViewTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CalendarViewTests: def test_index_view_with_no_events(self): """If no events exist, just check for default calendar view.""" <|body_0|> def test_index_view_with_one_event(self): """If one event exists, check if it is displayed.""" <|body_1|> <|end_skeleton|>...
stack_v2_sparse_classes_36k_train_010776
2,187
no_license
[ { "docstring": "If no events exist, just check for default calendar view.", "name": "test_index_view_with_no_events", "signature": "def test_index_view_with_no_events(self)" }, { "docstring": "If one event exists, check if it is displayed.", "name": "test_index_view_with_one_event", "sig...
2
stack_v2_sparse_classes_30k_train_001086
Implement the Python class `CalendarViewTests` described below. Class description: Implement the CalendarViewTests class. Method signatures and docstrings: - def test_index_view_with_no_events(self): If no events exist, just check for default calendar view. - def test_index_view_with_one_event(self): If one event exi...
Implement the Python class `CalendarViewTests` described below. Class description: Implement the CalendarViewTests class. Method signatures and docstrings: - def test_index_view_with_no_events(self): If no events exist, just check for default calendar view. - def test_index_view_with_one_event(self): If one event exi...
e48c753cc9f479e0e51e31d739f8fffb329299ed
<|skeleton|> class CalendarViewTests: def test_index_view_with_no_events(self): """If no events exist, just check for default calendar view.""" <|body_0|> def test_index_view_with_one_event(self): """If one event exists, check if it is displayed.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CalendarViewTests: def test_index_view_with_no_events(self): """If no events exist, just check for default calendar view.""" create_patient() c = Client() c.login(email='test_patient@gmail.com', password='12345pas') response = c.get(reverse('patient:index')) sel...
the_stack_v2_python_sparse
patient_homepage/tests.py
ayanaadylova/HealthNet
train
0
3e53ebba10be2b2c70c9d2efc190f5cef9dd8aca
[ "mycursor = self.db.connection.cursor()\nsql = '\\n INSERT INTO Product (name_product, category_fk, store, nutriscore, link)\\n VALUES (%(name_product)s, (SELECT id FROM Category WHERE name_cat=%(name_cat)s), %(store)s, %(nutriscore)s, %(link)s)\\n '\nfor product in products:\n mycursor.exec...
<|body_start_0|> mycursor = self.db.connection.cursor() sql = '\n INSERT INTO Product (name_product, category_fk, store, nutriscore, link)\n VALUES (%(name_product)s, (SELECT id FROM Category WHERE name_cat=%(name_cat)s), %(store)s, %(nutriscore)s, %(link)s)\n ' for product ...
Manage the products in the SQL database
ProductManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProductManager: """Manage the products in the SQL database""" def insert_product(self, products): """Inserts all the products into the SQL Product table""" <|body_0|> def fetch_all_products(self, category): """Fetch all the products from the SQL Product table so ...
stack_v2_sparse_classes_36k_train_010777
7,181
no_license
[ { "docstring": "Inserts all the products into the SQL Product table", "name": "insert_product", "signature": "def insert_product(self, products)" }, { "docstring": "Fetch all the products from the SQL Product table so that the controllers can call them", "name": "fetch_all_products", "si...
4
stack_v2_sparse_classes_30k_train_004579
Implement the Python class `ProductManager` described below. Class description: Manage the products in the SQL database Method signatures and docstrings: - def insert_product(self, products): Inserts all the products into the SQL Product table - def fetch_all_products(self, category): Fetch all the products from the ...
Implement the Python class `ProductManager` described below. Class description: Manage the products in the SQL database Method signatures and docstrings: - def insert_product(self, products): Inserts all the products into the SQL Product table - def fetch_all_products(self, category): Fetch all the products from the ...
8b1ae1ed03d2274e85b8a38c39ebfcf354857e42
<|skeleton|> class ProductManager: """Manage the products in the SQL database""" def insert_product(self, products): """Inserts all the products into the SQL Product table""" <|body_0|> def fetch_all_products(self, category): """Fetch all the products from the SQL Product table so ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProductManager: """Manage the products in the SQL database""" def insert_product(self, products): """Inserts all the products into the SQL Product table""" mycursor = self.db.connection.cursor() sql = '\n INSERT INTO Product (name_product, category_fk, store, nutriscore, li...
the_stack_v2_python_sparse
core/managers.py
bientavu/openfoodfacts
train
0
6fde82cef390e617af7283ccd0d77bbf7f5c5440
[ "Writter.event('delete task n°{} and subtasks linked'.format(self.id))\ntry:\n data = {'id': self.id, 'node_id': self.id}\n sql_query = 'DELETE FROM {} WHERE id = :id OR node_id = :node_id'.format(self.table_name)\n self.database.cursor_execute(sql_query, data)\n self.database.connection.commit()\n r...
<|body_start_0|> Writter.event('delete task n°{} and subtasks linked'.format(self.id)) try: data = {'id': self.id, 'node_id': self.id} sql_query = 'DELETE FROM {} WHERE id = :id OR node_id = :node_id'.format(self.table_name) self.database.cursor_execute(sql_query, dat...
Task
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Task: def delete(self): """delete task and also subtasks""" <|body_0|> def subtasks(self): """return all subtasks linked to this task""" <|body_1|> def worktimes(self): """generator wortimes""" <|body_2|> def spended_time(self): ...
stack_v2_sparse_classes_36k_train_010778
1,605
permissive
[ { "docstring": "delete task and also subtasks", "name": "delete", "signature": "def delete(self)" }, { "docstring": "return all subtasks linked to this task", "name": "subtasks", "signature": "def subtasks(self)" }, { "docstring": "generator wortimes", "name": "worktimes", ...
4
stack_v2_sparse_classes_30k_train_017303
Implement the Python class `Task` described below. Class description: Implement the Task class. Method signatures and docstrings: - def delete(self): delete task and also subtasks - def subtasks(self): return all subtasks linked to this task - def worktimes(self): generator wortimes - def spended_time(self): return t...
Implement the Python class `Task` described below. Class description: Implement the Task class. Method signatures and docstrings: - def delete(self): delete task and also subtasks - def subtasks(self): return all subtasks linked to this task - def worktimes(self): generator wortimes - def spended_time(self): return t...
34cbdcde3bcdf2942a4f62077406e08ccd9c1ed7
<|skeleton|> class Task: def delete(self): """delete task and also subtasks""" <|body_0|> def subtasks(self): """return all subtasks linked to this task""" <|body_1|> def worktimes(self): """generator wortimes""" <|body_2|> def spended_time(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Task: def delete(self): """delete task and also subtasks""" Writter.event('delete task n°{} and subtasks linked'.format(self.id)) try: data = {'id': self.id, 'node_id': self.id} sql_query = 'DELETE FROM {} WHERE id = :id OR node_id = :node_id'.format(self.table_...
the_stack_v2_python_sparse
classes/task.py
madeindjs/pomodore_manager
train
1
3610fa11406aab74feba6b034e76e404bb00c387
[ "self._params = Parameters()\nfor path, param in network.get_variables().items():\n self._params.add(path + '_velocity', numpy.zeros_like(param.get_value()))\nif 'momentum' not in optimization_options:\n raise ValueError('Momentum is not given in optimization options.')\nself._momentum = optimization_options[...
<|body_start_0|> self._params = Parameters() for path, param in network.get_variables().items(): self._params.add(path + '_velocity', numpy.zeros_like(param.get_value())) if 'momentum' not in optimization_options: raise ValueError('Momentum is not given in optimization op...
Nesterov Momentum Optimization Method Normally Nesterov momentum is implemented by first taking a step towards the previous update direction, calculating gradient at that position, using the gradient to obtain the new update direction, and finally updating the parameters. We use an alternative formulation that requires...
NesterovOptimizer
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NesterovOptimizer: """Nesterov Momentum Optimization Method Normally Nesterov momentum is implemented by first taking a step towards the previous update direction, calculating gradient at that position, using the gradient to obtain the new update direction, and finally updating the parameters. We...
stack_v2_sparse_classes_36k_train_010779
2,905
permissive
[ { "docstring": "Creates a Nesterov momentum optimizer. Nesterov momentum optimizer does not use additional parameters. :type optimization_options: dict :param optimization_options: a dictionary of optimization options :type network: Network :param network: the neural network object", "name": "__init__", ...
2
stack_v2_sparse_classes_30k_train_000119
Implement the Python class `NesterovOptimizer` described below. Class description: Nesterov Momentum Optimization Method Normally Nesterov momentum is implemented by first taking a step towards the previous update direction, calculating gradient at that position, using the gradient to obtain the new update direction, ...
Implement the Python class `NesterovOptimizer` described below. Class description: Nesterov Momentum Optimization Method Normally Nesterov momentum is implemented by first taking a step towards the previous update direction, calculating gradient at that position, using the gradient to obtain the new update direction, ...
9904faec19ad5718470f21927229aad2656e5686
<|skeleton|> class NesterovOptimizer: """Nesterov Momentum Optimization Method Normally Nesterov momentum is implemented by first taking a step towards the previous update direction, calculating gradient at that position, using the gradient to obtain the new update direction, and finally updating the parameters. We...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NesterovOptimizer: """Nesterov Momentum Optimization Method Normally Nesterov momentum is implemented by first taking a step towards the previous update direction, calculating gradient at that position, using the gradient to obtain the new update direction, and finally updating the parameters. We use an alter...
the_stack_v2_python_sparse
theanolm/training/nesterovoptimizer.py
senarvi/theanolm
train
95
28a8684efcf8e1625e30daab248736b20fca0d9d
[ "assert callable(callback)\ncallbacks = cls.callbacks.setdefault(key, [])\nif callback in callbacks and (not append):\n logger.debug('%r is already a registered callback for %r', callback, key)\n return\ncallbacks.append(callback)\nlogger.debug('Registered callback %r for %r', callback, key)", "results = cl...
<|body_start_0|> assert callable(callback) callbacks = cls.callbacks.setdefault(key, []) if callback in callbacks and (not append): logger.debug('%r is already a registered callback for %r', callback, key) return callbacks.append(callback) logger.debug('Re...
Subclass of :class:`.LoggingDictionary` that provides the ability to run a function when a value is changed.
ConfigurationWithCallbacks
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConfigurationWithCallbacks: """Subclass of :class:`.LoggingDictionary` that provides the ability to run a function when a value is changed.""" def register_callback(cls, key, callback, append=False): """Register a function as a callback for ``key``. When ``key`` is set the given ``ca...
stack_v2_sparse_classes_36k_train_010780
11,654
permissive
[ { "docstring": "Register a function as a callback for ``key``. When ``key`` is set the given ``callback`` will be run by :meth:`.changed` :param string key: the key which when changed in any way will execute ``callback`` :param callable callback: the function or method to register :param boolean append: by defa...
4
stack_v2_sparse_classes_30k_train_002194
Implement the Python class `ConfigurationWithCallbacks` described below. Class description: Subclass of :class:`.LoggingDictionary` that provides the ability to run a function when a value is changed. Method signatures and docstrings: - def register_callback(cls, key, callback, append=False): Register a function as a...
Implement the Python class `ConfigurationWithCallbacks` described below. Class description: Subclass of :class:`.LoggingDictionary` that provides the ability to run a function when a value is changed. Method signatures and docstrings: - def register_callback(cls, key, callback, append=False): Register a function as a...
aa87504ab8679db0ed8da4818729b8e5fc1c0ecb
<|skeleton|> class ConfigurationWithCallbacks: """Subclass of :class:`.LoggingDictionary` that provides the ability to run a function when a value is changed.""" def register_callback(cls, key, callback, append=False): """Register a function as a callback for ``key``. When ``key`` is set the given ``ca...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ConfigurationWithCallbacks: """Subclass of :class:`.LoggingDictionary` that provides the ability to run a function when a value is changed.""" def register_callback(cls, key, callback, append=False): """Register a function as a callback for ``key``. When ``key`` is set the given ``callback`` will...
the_stack_v2_python_sparse
pyfarm/agent/config.py
pyfarm/pyfarm-agent
train
1
6d9229cbfed24dd11c7fbe064e52d7df8d9f631b
[ "project.users.add(request.user)\nlog.info('Project imported.', project_slug=project.slug, user_username=request.user.username)\nproject_import.send(sender=project, request=request)\nself.trigger_initial_build(project, request.user)", "update_docs, build = prepare_build(project)\nif (update_docs, build) == (None,...
<|body_start_0|> project.users.add(request.user) log.info('Project imported.', project_slug=project.slug, user_username=request.user.username) project_import.send(sender=project, request=request) self.trigger_initial_build(project, request.user) <|end_body_0|> <|body_start_1|> u...
Helpers to import a Project.
ProjectImportMixin
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProjectImportMixin: """Helpers to import a Project.""" def finish_import_project(self, request, project): """Perform last steps to import a project into Read the Docs. - Add the user from request as maintainer - Send Django Signal - Trigger initial build It requires the Project was a...
stack_v2_sparse_classes_36k_train_010781
4,573
permissive
[ { "docstring": "Perform last steps to import a project into Read the Docs. - Add the user from request as maintainer - Send Django Signal - Trigger initial build It requires the Project was already saved into the DB. :param request: Django Request object :param project: Project instance just imported (already s...
2
null
Implement the Python class `ProjectImportMixin` described below. Class description: Helpers to import a Project. Method signatures and docstrings: - def finish_import_project(self, request, project): Perform last steps to import a project into Read the Docs. - Add the user from request as maintainer - Send Django Sig...
Implement the Python class `ProjectImportMixin` described below. Class description: Helpers to import a Project. Method signatures and docstrings: - def finish_import_project(self, request, project): Perform last steps to import a project into Read the Docs. - Add the user from request as maintainer - Send Django Sig...
bf88ce6d1085d922322a5fadce63a22c5544c830
<|skeleton|> class ProjectImportMixin: """Helpers to import a Project.""" def finish_import_project(self, request, project): """Perform last steps to import a project into Read the Docs. - Add the user from request as maintainer - Send Django Signal - Trigger initial build It requires the Project was a...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProjectImportMixin: """Helpers to import a Project.""" def finish_import_project(self, request, project): """Perform last steps to import a project into Read the Docs. - Add the user from request as maintainer - Send Django Signal - Trigger initial build It requires the Project was already saved ...
the_stack_v2_python_sparse
readthedocs/projects/views/mixins.py
readthedocs/readthedocs.org
train
2,894
c23397f2914ab04a067047951db39e1107b1a4e7
[ "address_distribution = AddressDistribution(date=Date, receive_only_per=ReceiveOnlyPer, send_receive_per=SendReceivePer)\ndb_session.add(address_distribution)\ntry:\n db_session.commit()\n response = {'ResponseCode': ResponseCodes.Success.value, 'ResponseDesc': ResponseCodes.Success.name, 'AddressDistribution...
<|body_start_0|> address_distribution = AddressDistribution(date=Date, receive_only_per=ReceiveOnlyPer, send_receive_per=SendReceivePer) db_session.add(address_distribution) try: db_session.commit() response = {'ResponseCode': ResponseCodes.Success.value, 'ResponseDesc': ...
Class implementing address distribution by date
AddressDistributionByDateEndpoint
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AddressDistributionByDateEndpoint: """Class implementing address distribution by date""" def post(self, Date, ReceiveOnlyPer=None, SendReceivePer=None): """Method for POST request :param Date: :param ReceiveOnlyPer: :param SendReceivePer:""" <|body_0|> def get(self, Date...
stack_v2_sparse_classes_36k_train_010782
3,932
no_license
[ { "docstring": "Method for POST request :param Date: :param ReceiveOnlyPer: :param SendReceivePer:", "name": "post", "signature": "def post(self, Date, ReceiveOnlyPer=None, SendReceivePer=None)" }, { "docstring": "Method for GET request :param Date:", "name": "get", "signature": "def get...
3
stack_v2_sparse_classes_30k_train_021468
Implement the Python class `AddressDistributionByDateEndpoint` described below. Class description: Class implementing address distribution by date Method signatures and docstrings: - def post(self, Date, ReceiveOnlyPer=None, SendReceivePer=None): Method for POST request :param Date: :param ReceiveOnlyPer: :param Send...
Implement the Python class `AddressDistributionByDateEndpoint` described below. Class description: Class implementing address distribution by date Method signatures and docstrings: - def post(self, Date, ReceiveOnlyPer=None, SendReceivePer=None): Method for POST request :param Date: :param ReceiveOnlyPer: :param Send...
83a7000c4aa8020481771c0956a9918a335fc2f5
<|skeleton|> class AddressDistributionByDateEndpoint: """Class implementing address distribution by date""" def post(self, Date, ReceiveOnlyPer=None, SendReceivePer=None): """Method for POST request :param Date: :param ReceiveOnlyPer: :param SendReceivePer:""" <|body_0|> def get(self, Date...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AddressDistributionByDateEndpoint: """Class implementing address distribution by date""" def post(self, Date, ReceiveOnlyPer=None, SendReceivePer=None): """Method for POST request :param Date: :param ReceiveOnlyPer: :param SendReceivePer:""" address_distribution = AddressDistribution(date...
the_stack_v2_python_sparse
foundations/bitcoin_api/resources/graph/address_distribution.py
tskiranmayee/Blockchain-Analysis-Project
train
0
9864549a87e2b6b199a7130cc4f3cfb27647a201
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn UnifiedRoleManagementPolicyAssignment()", "from .entity import Entity\nfrom .unified_role_management_policy import UnifiedRoleManagementPolicy\nfrom .entity import Entity\nfrom .unified_role_management_policy import UnifiedRoleManageme...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return UnifiedRoleManagementPolicyAssignment() <|end_body_0|> <|body_start_1|> from .entity import Entity from .unified_role_management_policy import UnifiedRoleManagementPolicy from .e...
UnifiedRoleManagementPolicyAssignment
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UnifiedRoleManagementPolicyAssignment: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UnifiedRoleManagementPolicyAssignment: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the d...
stack_v2_sparse_classes_36k_train_010783
3,619
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: UnifiedRoleManagementPolicyAssignment", "name": "create_from_discriminator_value", "signature": "def create_...
3
null
Implement the Python class `UnifiedRoleManagementPolicyAssignment` described below. Class description: Implement the UnifiedRoleManagementPolicyAssignment class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UnifiedRoleManagementPolicyAssignment: Crea...
Implement the Python class `UnifiedRoleManagementPolicyAssignment` described below. Class description: Implement the UnifiedRoleManagementPolicyAssignment class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UnifiedRoleManagementPolicyAssignment: Crea...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class UnifiedRoleManagementPolicyAssignment: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UnifiedRoleManagementPolicyAssignment: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UnifiedRoleManagementPolicyAssignment: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UnifiedRoleManagementPolicyAssignment: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator v...
the_stack_v2_python_sparse
msgraph/generated/models/unified_role_management_policy_assignment.py
microsoftgraph/msgraph-sdk-python
train
135
6c7b92d711a3149db2cf5a313b492ffda70a088a
[ "super().__init__(**kwargs)\nself.prediction_length = prediction_length\nself.context_length = context_length\nself.cardinality = cardinality\nself.kernel_output = kernel_output\nself.params_scaling = params_scaling\nself.float_type = float_type\nself.max_iter_jitter = max_iter_jitter\nself.jitter_method = jitter_m...
<|body_start_0|> super().__init__(**kwargs) self.prediction_length = prediction_length self.context_length = context_length self.cardinality = cardinality self.kernel_output = kernel_output self.params_scaling = params_scaling self.float_type = float_type ...
Defines a Gluon block used for GP training and predictions.
GaussianProcessNetworkBase
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GaussianProcessNetworkBase: """Defines a Gluon block used for GP training and predictions.""" def __init__(self, prediction_length: int, context_length: int, cardinality: int, kernel_output: KernelOutputDict, params_scaling: bool, float_type: DType, max_iter_jitter: int, jitter_method: str, ...
stack_v2_sparse_classes_36k_train_010784
9,486
permissive
[ { "docstring": "Parameters ---------- prediction_length Prediction length. context_length Training length. cardinality Number of time series. kernel_output KernelOutput instance to determine which kernel subclass to be instantiated. params_scaling Determines whether or not to scale the model parameters. float_t...
2
stack_v2_sparse_classes_30k_train_019467
Implement the Python class `GaussianProcessNetworkBase` described below. Class description: Defines a Gluon block used for GP training and predictions. Method signatures and docstrings: - def __init__(self, prediction_length: int, context_length: int, cardinality: int, kernel_output: KernelOutputDict, params_scaling:...
Implement the Python class `GaussianProcessNetworkBase` described below. Class description: Defines a Gluon block used for GP training and predictions. Method signatures and docstrings: - def __init__(self, prediction_length: int, context_length: int, cardinality: int, kernel_output: KernelOutputDict, params_scaling:...
df4256b0e67120db555c109a1bf6cfa2b3bd3cd8
<|skeleton|> class GaussianProcessNetworkBase: """Defines a Gluon block used for GP training and predictions.""" def __init__(self, prediction_length: int, context_length: int, cardinality: int, kernel_output: KernelOutputDict, params_scaling: bool, float_type: DType, max_iter_jitter: int, jitter_method: str, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GaussianProcessNetworkBase: """Defines a Gluon block used for GP training and predictions.""" def __init__(self, prediction_length: int, context_length: int, cardinality: int, kernel_output: KernelOutputDict, params_scaling: bool, float_type: DType, max_iter_jitter: int, jitter_method: str, **kwargs) -> ...
the_stack_v2_python_sparse
src/gluonts/model/gp_forecaster/_network.py
mbohlkeschneider/gluon-ts
train
54
bc271f64ae7ddf5671460415f515f8e5865a90f6
[ "super().__init__(fasta, out_file)\nself.fasta = SeqIO.parse(fasta, 'fasta')\nself.base_url = 'https://mobidb.bio.unipd.it/api/download?acc={}{}&format=json'\nself.filter = '&projection=prediction-disorder-mobidb_lite'\nif curated:\n raise NotImplementedError('Handling of curated MobiDB annotations is not yet su...
<|body_start_0|> super().__init__(fasta, out_file) self.fasta = SeqIO.parse(fasta, 'fasta') self.base_url = 'https://mobidb.bio.unipd.it/api/download?acc={}{}&format=json' self.filter = '&projection=prediction-disorder-mobidb_lite' if curated: raise NotImplementedErro...
Class to query MobiDB for all proteins in a specified fasta file. Protein identifiers must be in standard UniProt/ SwissProt format. Protein IDs are queried to MobiDB and predicted disordered regions (from MobiDB-Lite) are extracted and written to an output file. For information on MobiDB API, see: https://mobidb.bio.u...
APIDisorderAnnotator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class APIDisorderAnnotator: """Class to query MobiDB for all proteins in a specified fasta file. Protein identifiers must be in standard UniProt/ SwissProt format. Protein IDs are queried to MobiDB and predicted disordered regions (from MobiDB-Lite) are extracted and written to an output file. For info...
stack_v2_sparse_classes_36k_train_010785
8,962
permissive
[ { "docstring": "Parameters curated (bool): (Not implemented!) Should curated information from MobiDB be incorporated in output? (default:False)", "name": "__init__", "signature": "def __init__(self, fasta, out_file, curated=False)" }, { "docstring": "Construct url for current protein id and filt...
3
stack_v2_sparse_classes_30k_train_000570
Implement the Python class `APIDisorderAnnotator` described below. Class description: Class to query MobiDB for all proteins in a specified fasta file. Protein identifiers must be in standard UniProt/ SwissProt format. Protein IDs are queried to MobiDB and predicted disordered regions (from MobiDB-Lite) are extracted ...
Implement the Python class `APIDisorderAnnotator` described below. Class description: Class to query MobiDB for all proteins in a specified fasta file. Protein identifiers must be in standard UniProt/ SwissProt format. Protein IDs are queried to MobiDB and predicted disordered regions (from MobiDB-Lite) are extracted ...
9c48da8f2ef67c7a9b8fd0ed46ffadd116ee5450
<|skeleton|> class APIDisorderAnnotator: """Class to query MobiDB for all proteins in a specified fasta file. Protein identifiers must be in standard UniProt/ SwissProt format. Protein IDs are queried to MobiDB and predicted disordered regions (from MobiDB-Lite) are extracted and written to an output file. For info...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class APIDisorderAnnotator: """Class to query MobiDB for all proteins in a specified fasta file. Protein identifiers must be in standard UniProt/ SwissProt format. Protein IDs are queried to MobiDB and predicted disordered regions (from MobiDB-Lite) are extracted and written to an output file. For information on Mo...
the_stack_v2_python_sparse
python/src/disorder_annotators.py
acg-team/swissprot_human_strs
train
0
d0f794c8c0ffd169050df54e43805a71a63a0904
[ "B, N, C = pts.shape\ndevice = pts.device\ncentroids = torch.zeros((B, n_point), dtype=torch.long, device=device)\nfarthest = torch.randint(0, N, (B,), dtype=torch.long)\ndistances = torch.ones((B, N)) * 10000000000.0\nbatch_indices = torch.arange(B, dtype=torch.long).to(device)\nfor i in range(n_point):\n centr...
<|body_start_0|> B, N, C = pts.shape device = pts.device centroids = torch.zeros((B, n_point), dtype=torch.long, device=device) farthest = torch.randint(0, N, (B,), dtype=torch.long) distances = torch.ones((B, N)) * 10000000000.0 batch_indices = torch.arange(B, dtype=torc...
Operator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Operator: def farthest_points_sample(cls, pts, n_point): """C - channel, N- Point total number get farthest points sample :param pts: points (B,N,C) :param n_point: sample target number :return: idx (B, n_point)""" <|body_0|> def indexes2points(cls, pts, indexes): ""...
stack_v2_sparse_classes_36k_train_010786
4,606
no_license
[ { "docstring": "C - channel, N- Point total number get farthest points sample :param pts: points (B,N,C) :param n_point: sample target number :return: idx (B, n_point)", "name": "farthest_points_sample", "signature": "def farthest_points_sample(cls, pts, n_point)" }, { "docstring": ":param pts: ...
4
null
Implement the Python class `Operator` described below. Class description: Implement the Operator class. Method signatures and docstrings: - def farthest_points_sample(cls, pts, n_point): C - channel, N- Point total number get farthest points sample :param pts: points (B,N,C) :param n_point: sample target number :retu...
Implement the Python class `Operator` described below. Class description: Implement the Operator class. Method signatures and docstrings: - def farthest_points_sample(cls, pts, n_point): C - channel, N- Point total number get farthest points sample :param pts: points (B,N,C) :param n_point: sample target number :retu...
804d0443c8d0558074cc4f4ab2f91cf73e9913d7
<|skeleton|> class Operator: def farthest_points_sample(cls, pts, n_point): """C - channel, N- Point total number get farthest points sample :param pts: points (B,N,C) :param n_point: sample target number :return: idx (B, n_point)""" <|body_0|> def indexes2points(cls, pts, indexes): ""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Operator: def farthest_points_sample(cls, pts, n_point): """C - channel, N- Point total number get farthest points sample :param pts: points (B,N,C) :param n_point: sample target number :return: idx (B, n_point)""" B, N, C = pts.shape device = pts.device centroids = torch.zeros...
the_stack_v2_python_sparse
net/PointNetPP.py
kadimakipp/network
train
1
c6894faf5f991e6567e059e23ddf517b6fe6075b
[ "if conn_string:\n _update_meta(conn_string)\n Meta.Session = new_sessionmaker()\n Meta.engine = Meta.Session.kw['bind']\n logger.info(f'Connecting user:{Meta.DBUSER} to {Meta.DBHOST}:{Meta.DBPORT}/{Meta.DBNAME}')\n Meta._init_db()\nif not Meta.log_path:\n init_logging()\nreturn cls", "import fo...
<|body_start_0|> if conn_string: _update_meta(conn_string) Meta.Session = new_sessionmaker() Meta.engine = Meta.Session.kw['bind'] logger.info(f'Connecting user:{Meta.DBUSER} to {Meta.DBHOST}:{Meta.DBPORT}/{Meta.DBNAME}') Meta._init_db() if not...
Singleton-like metadata class for all global variables. Adapted from the Unique Design Pattern: https://stackoverflow.com/questions/1318406/why-is-the-borg-pattern-better-than-the-singleton-pattern-in-python
Meta
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Meta: """Singleton-like metadata class for all global variables. Adapted from the Unique Design Pattern: https://stackoverflow.com/questions/1318406/why-is-the-borg-pattern-better-than-the-singleton-pattern-in-python""" def init(cls, conn_string: Optional[str]=None) -> Type['Meta']: ...
stack_v2_sparse_classes_36k_train_010787
5,551
permissive
[ { "docstring": "Return the unique Meta class.", "name": "init", "signature": "def init(cls, conn_string: Optional[str]=None) -> Type['Meta']" }, { "docstring": "Initialize the storage schema. This call must be performed after all classes that extend Base are declared to ensure the storage schema...
2
stack_v2_sparse_classes_30k_val_000608
Implement the Python class `Meta` described below. Class description: Singleton-like metadata class for all global variables. Adapted from the Unique Design Pattern: https://stackoverflow.com/questions/1318406/why-is-the-borg-pattern-better-than-the-singleton-pattern-in-python Method signatures and docstrings: - def ...
Implement the Python class `Meta` described below. Class description: Singleton-like metadata class for all global variables. Adapted from the Unique Design Pattern: https://stackoverflow.com/questions/1318406/why-is-the-borg-pattern-better-than-the-singleton-pattern-in-python Method signatures and docstrings: - def ...
e857285867f01536192524a195b02cbffe40c4b2
<|skeleton|> class Meta: """Singleton-like metadata class for all global variables. Adapted from the Unique Design Pattern: https://stackoverflow.com/questions/1318406/why-is-the-borg-pattern-better-than-the-singleton-pattern-in-python""" def init(cls, conn_string: Optional[str]=None) -> Type['Meta']: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Meta: """Singleton-like metadata class for all global variables. Adapted from the Unique Design Pattern: https://stackoverflow.com/questions/1318406/why-is-the-borg-pattern-better-than-the-singleton-pattern-in-python""" def init(cls, conn_string: Optional[str]=None) -> Type['Meta']: """Return the...
the_stack_v2_python_sparse
src/fonduer/meta.py
HiromuHota/fonduer
train
0
27804157bd4866469b89c0294fee607aa4b4d174
[ "gt = cv2.imread(TestImageFeature.sample)\ngt = cv2.cvtColor(gt, cv2.COLOR_BGR2RGB)\nif image.shape != gt.shape:\n gt = cv2.resize(gt, (255, 255))\ngt = tf.convert_to_tensor(gt, dtype=tf.float32)\nssim = tf.image.ssim(image, gt, max_val=255)\nassert ssim.numpy() > criteria", "if resize:\n feat = ImageFeatur...
<|body_start_0|> gt = cv2.imread(TestImageFeature.sample) gt = cv2.cvtColor(gt, cv2.COLOR_BGR2RGB) if image.shape != gt.shape: gt = cv2.resize(gt, (255, 255)) gt = tf.convert_to_tensor(gt, dtype=tf.float32) ssim = tf.image.ssim(image, gt, max_val=255) assert s...
TestImageFeature
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestImageFeature: def check_ssim(image: tf.Tensor, criteria: float=0.99): """Check ssim with groud-truth sample""" <|body_0|> def test_encode_decode_in_eager_execution(self, resize): """Test encode-decode within eager execution mode Use ssim to check the decoded imag...
stack_v2_sparse_classes_36k_train_010788
8,391
no_license
[ { "docstring": "Check ssim with groud-truth sample", "name": "check_ssim", "signature": "def check_ssim(image: tf.Tensor, criteria: float=0.99)" }, { "docstring": "Test encode-decode within eager execution mode Use ssim to check the decoded image", "name": "test_encode_decode_in_eager_execut...
3
stack_v2_sparse_classes_30k_train_015369
Implement the Python class `TestImageFeature` described below. Class description: Implement the TestImageFeature class. Method signatures and docstrings: - def check_ssim(image: tf.Tensor, criteria: float=0.99): Check ssim with groud-truth sample - def test_encode_decode_in_eager_execution(self, resize): Test encode-...
Implement the Python class `TestImageFeature` described below. Class description: Implement the TestImageFeature class. Method signatures and docstrings: - def check_ssim(image: tf.Tensor, criteria: float=0.99): Check ssim with groud-truth sample - def test_encode_decode_in_eager_execution(self, resize): Test encode-...
5da5317cedd380c244f20a96213e883d6ef29de2
<|skeleton|> class TestImageFeature: def check_ssim(image: tf.Tensor, criteria: float=0.99): """Check ssim with groud-truth sample""" <|body_0|> def test_encode_decode_in_eager_execution(self, resize): """Test encode-decode within eager execution mode Use ssim to check the decoded imag...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestImageFeature: def check_ssim(image: tf.Tensor, criteria: float=0.99): """Check ssim with groud-truth sample""" gt = cv2.imread(TestImageFeature.sample) gt = cv2.cvtColor(gt, cv2.COLOR_BGR2RGB) if image.shape != gt.shape: gt = cv2.resize(gt, (255, 255)) g...
the_stack_v2_python_sparse
Database/_unittests/test_features.py
MingRuey/mlbox
train
2
6d765fe6d4147b13003153e363d4405cc4921e16
[ "try:\n return json.loads(os.environ[key])\nexcept json.decoder.JSONDecodeError:\n return os.environ[key]", "config_value_json = self.query(ConfigValue).get(key)\nif config_value_json is None:\n raise MissingConfigValue(key)\ntry:\n return json.loads(config_value_json.value)\nexcept json.decoder.JSOND...
<|body_start_0|> try: return json.loads(os.environ[key]) except json.decoder.JSONDecodeError: return os.environ[key] <|end_body_0|> <|body_start_1|> config_value_json = self.query(ConfigValue).get(key) if config_value_json is None: raise MissingConfig...
Service for reading and writing configuration values for the Rasa X server. Use this service for storing configuration values that can change during the execution of the Rasa X server, and that therefore should be persisted to the SQL database across server restarts. Any configuration value may be overidden by setting ...
ConfigService
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConfigService: """Service for reading and writing configuration values for the Rasa X server. Use this service for storing configuration values that can change during the execution of the Rasa X server, and that therefore should be persisted to the SQL database across server restarts. Any configu...
stack_v2_sparse_classes_36k_train_010789
6,853
no_license
[ { "docstring": "Read a configuration value from the environment. Args: key: Name of the configuration value. Returns: Configuration value.", "name": "_get_value_from_env", "signature": "def _get_value_from_env(self, key: Text) -> Any" }, { "docstring": "Read a configuration value from the databa...
5
stack_v2_sparse_classes_30k_train_002791
Implement the Python class `ConfigService` described below. Class description: Service for reading and writing configuration values for the Rasa X server. Use this service for storing configuration values that can change during the execution of the Rasa X server, and that therefore should be persisted to the SQL datab...
Implement the Python class `ConfigService` described below. Class description: Service for reading and writing configuration values for the Rasa X server. Use this service for storing configuration values that can change during the execution of the Rasa X server, and that therefore should be persisted to the SQL datab...
4d97e7e66225e526fc47d666351a16b7caea46d5
<|skeleton|> class ConfigService: """Service for reading and writing configuration values for the Rasa X server. Use this service for storing configuration values that can change during the execution of the Rasa X server, and that therefore should be persisted to the SQL database across server restarts. Any configu...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ConfigService: """Service for reading and writing configuration values for the Rasa X server. Use this service for storing configuration values that can change during the execution of the Rasa X server, and that therefore should be persisted to the SQL database across server restarts. Any configuration value ...
the_stack_v2_python_sparse
rasax/community/services/config_service.py
TrellixVulnTeam/Chat-bot-tuy-n-sinh_BZ0M
train
0
c77535cad3921adab29478d554b0df1ec3998a2d
[ "super().__init__(DOMAIN)\nself.hass: HomeAssistant = hass\nself.client: XboxLiveClient = client", "_, category, url = async_parse_identifier(item)\nkind = category.split('#', 1)[1]\nreturn PlayMedia(url, MIME_TYPE_MAP[kind])", "title, category, _ = async_parse_identifier(item)\nif not title:\n return await ...
<|body_start_0|> super().__init__(DOMAIN) self.hass: HomeAssistant = hass self.client: XboxLiveClient = client <|end_body_0|> <|body_start_1|> _, category, url = async_parse_identifier(item) kind = category.split('#', 1)[1] return PlayMedia(url, MIME_TYPE_MAP[kind]) <|en...
Provide Xbox screenshots and gameclips as media sources.
XboxSource
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class XboxSource: """Provide Xbox screenshots and gameclips as media sources.""" def __init__(self, hass: HomeAssistant, client: XboxLiveClient) -> None: """Initialize Xbox source.""" <|body_0|> async def async_resolve_media(self, item: MediaSourceItem) -> PlayMedia: "...
stack_v2_sparse_classes_36k_train_010790
9,043
permissive
[ { "docstring": "Initialize Xbox source.", "name": "__init__", "signature": "def __init__(self, hass: HomeAssistant, client: XboxLiveClient) -> None" }, { "docstring": "Resolve media to a url.", "name": "async_resolve_media", "signature": "async def async_resolve_media(self, item: MediaSo...
5
stack_v2_sparse_classes_30k_train_016131
Implement the Python class `XboxSource` described below. Class description: Provide Xbox screenshots and gameclips as media sources. Method signatures and docstrings: - def __init__(self, hass: HomeAssistant, client: XboxLiveClient) -> None: Initialize Xbox source. - async def async_resolve_media(self, item: MediaSou...
Implement the Python class `XboxSource` described below. Class description: Provide Xbox screenshots and gameclips as media sources. Method signatures and docstrings: - def __init__(self, hass: HomeAssistant, client: XboxLiveClient) -> None: Initialize Xbox source. - async def async_resolve_media(self, item: MediaSou...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class XboxSource: """Provide Xbox screenshots and gameclips as media sources.""" def __init__(self, hass: HomeAssistant, client: XboxLiveClient) -> None: """Initialize Xbox source.""" <|body_0|> async def async_resolve_media(self, item: MediaSourceItem) -> PlayMedia: "...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class XboxSource: """Provide Xbox screenshots and gameclips as media sources.""" def __init__(self, hass: HomeAssistant, client: XboxLiveClient) -> None: """Initialize Xbox source.""" super().__init__(DOMAIN) self.hass: HomeAssistant = hass self.client: XboxLiveClient = client ...
the_stack_v2_python_sparse
homeassistant/components/xbox/media_source.py
home-assistant/core
train
35,501
2073c2f8dcca9528de0b54e1e30d0d4e0e40a84a
[ "inst_cp_module_mqtt()\nif os.path.exists(os.path.join(target_file, 'node_modules')) and os.path.exists(os.path.join(mqtt_file, 'mqtt.js')):\n oldscp = self.target.connection.scp[:]\n self.target.connection.scp.insert(1, '-r')\n self.target.copy_to(mqtt_file, '/tmp')\n self.target.copy_to(os.path.join(t...
<|body_start_0|> inst_cp_module_mqtt() if os.path.exists(os.path.join(target_file, 'node_modules')) and os.path.exists(os.path.join(mqtt_file, 'mqtt.js')): oldscp = self.target.connection.scp[:] self.target.connection.scp.insert(1, '-r') self.target.copy_to(mqtt_file,...
@class mqttTest
mqttTest
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class mqttTest: """@class mqttTest""" def setUp(self): """Copy mqtt.js and node module mqtt to target @fn setUp @param self @param return""" <|body_0|> def test_mqtt(self): """Execute the tests and check the status @fn test_mqtt @param self @param return""" <|b...
stack_v2_sparse_classes_36k_train_010791
3,346
permissive
[ { "docstring": "Copy mqtt.js and node module mqtt to target @fn setUp @param self @param return", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Execute the tests and check the status @fn test_mqtt @param self @param return", "name": "test_mqtt", "signature": "def tes...
3
stack_v2_sparse_classes_30k_train_015819
Implement the Python class `mqttTest` described below. Class description: @class mqttTest Method signatures and docstrings: - def setUp(self): Copy mqtt.js and node module mqtt to target @fn setUp @param self @param return - def test_mqtt(self): Execute the tests and check the status @fn test_mqtt @param self @param ...
Implement the Python class `mqttTest` described below. Class description: @class mqttTest Method signatures and docstrings: - def setUp(self): Copy mqtt.js and node module mqtt to target @fn setUp @param self @param return - def test_mqtt(self): Execute the tests and check the status @fn test_mqtt @param self @param ...
786a4de29c30b47f885d8ad9cb2d110a08919ebd
<|skeleton|> class mqttTest: """@class mqttTest""" def setUp(self): """Copy mqtt.js and node module mqtt to target @fn setUp @param self @param return""" <|body_0|> def test_mqtt(self): """Execute the tests and check the status @fn test_mqtt @param self @param return""" <|b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class mqttTest: """@class mqttTest""" def setUp(self): """Copy mqtt.js and node module mqtt to target @fn setUp @param self @param return""" inst_cp_module_mqtt() if os.path.exists(os.path.join(target_file, 'node_modules')) and os.path.exists(os.path.join(mqtt_file, 'mqtt.js')): ...
the_stack_v2_python_sparse
meta-iotqa/lib/oeqa/runtime/programming/nodejs/mqtt.py
intel/intel-iot-refkit
train
38
4afeee56b76ffb22a28cfbbe374952d30b65d3ca
[ "if n <= 0:\n return 0\nif n == 1:\n return 1\nreturn self.fibonacci_recursive(n - 1) + self.fibonacci_recursive(n - 2)", "if n <= 0:\n return 0\ntemp = [0, 1]\nif n >= 2:\n for i in range(2, n + 1):\n temp[i % 2] = temp[0] + temp[1]\nreturn temp[n % 2]", "if n <= 0:\n return 0\nif n == 1:...
<|body_start_0|> if n <= 0: return 0 if n == 1: return 1 return self.fibonacci_recursive(n - 1) + self.fibonacci_recursive(n - 2) <|end_body_0|> <|body_start_1|> if n <= 0: return 0 temp = [0, 1] if n >= 2: for i in range(2...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def fibonacci_recursive(self, n): """递归""" <|body_0|> def Fibonacci(self, n): """保存中间项1""" <|body_1|> def fibonacci_1(self, n): """保存中间项2""" <|body_2|> <|end_skeleton|> <|body_start_0|> if n <= 0: return 0 ...
stack_v2_sparse_classes_36k_train_010792
1,354
no_license
[ { "docstring": "递归", "name": "fibonacci_recursive", "signature": "def fibonacci_recursive(self, n)" }, { "docstring": "保存中间项1", "name": "Fibonacci", "signature": "def Fibonacci(self, n)" }, { "docstring": "保存中间项2", "name": "fibonacci_1", "signature": "def fibonacci_1(self...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def fibonacci_recursive(self, n): 递归 - def Fibonacci(self, n): 保存中间项1 - def fibonacci_1(self, n): 保存中间项2
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def fibonacci_recursive(self, n): 递归 - def Fibonacci(self, n): 保存中间项1 - def fibonacci_1(self, n): 保存中间项2 <|skeleton|> class Solution: def fibonacci_recursive(self, n): ...
3b8b36bcf8a983de4d8ce29734a85b6bfbe59fbc
<|skeleton|> class Solution: def fibonacci_recursive(self, n): """递归""" <|body_0|> def Fibonacci(self, n): """保存中间项1""" <|body_1|> def fibonacci_1(self, n): """保存中间项2""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def fibonacci_recursive(self, n): """递归""" if n <= 0: return 0 if n == 1: return 1 return self.fibonacci_recursive(n - 1) + self.fibonacci_recursive(n - 2) def Fibonacci(self, n): """保存中间项1""" if n <= 0: return ...
the_stack_v2_python_sparse
TargetOffer/10、斐波那契数列.py
a625687551/Leetcode
train
0
30e3ca8b72cc31243d061348299db2db33ef26de
[ "self._baseline_action_fn = baseline_action_fn\nself._comparator_fn = comparator_fn\nself._error_loss_fn = functools.partial(loss_utils.pinball_loss, quantile=quantile)\nsuper(RelativeQuantileConstraint, self).__init__(time_step_spec, action_spec, constraint_network, error_loss_fn=self._error_loss_fn, name=name)", ...
<|body_start_0|> self._baseline_action_fn = baseline_action_fn self._comparator_fn = comparator_fn self._error_loss_fn = functools.partial(loss_utils.pinball_loss, quantile=quantile) super(RelativeQuantileConstraint, self).__init__(time_step_spec, action_spec, constraint_network, error_l...
Class for representing a trainable relative quantile constraint. This constraint class implements a relative quantile constraint such as ``` Q_tau(action) >= Q_tau(baseline_action) ``` or ``` Q_tau(action) <= Q_tau(baseline_action) ```
RelativeQuantileConstraint
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RelativeQuantileConstraint: """Class for representing a trainable relative quantile constraint. This constraint class implements a relative quantile constraint such as ``` Q_tau(action) >= Q_tau(baseline_action) ``` or ``` Q_tau(action) <= Q_tau(baseline_action) ```""" def __init__(self, tim...
stack_v2_sparse_classes_36k_train_010793
22,532
permissive
[ { "docstring": "Creates a trainable relative quantile constraint using a neural network. Args: time_step_spec: A `TimeStep` spec of the expected time_steps. action_spec: A nest of `BoundedTensorSpec` representing the actions. constraint_network: An instance of `tf_agents.network.Network` used to provide estimat...
2
null
Implement the Python class `RelativeQuantileConstraint` described below. Class description: Class for representing a trainable relative quantile constraint. This constraint class implements a relative quantile constraint such as ``` Q_tau(action) >= Q_tau(baseline_action) ``` or ``` Q_tau(action) <= Q_tau(baseline_act...
Implement the Python class `RelativeQuantileConstraint` described below. Class description: Class for representing a trainable relative quantile constraint. This constraint class implements a relative quantile constraint such as ``` Q_tau(action) >= Q_tau(baseline_action) ``` or ``` Q_tau(action) <= Q_tau(baseline_act...
eca1093d3a047e538f17f6ab92ab4d8144284f23
<|skeleton|> class RelativeQuantileConstraint: """Class for representing a trainable relative quantile constraint. This constraint class implements a relative quantile constraint such as ``` Q_tau(action) >= Q_tau(baseline_action) ``` or ``` Q_tau(action) <= Q_tau(baseline_action) ```""" def __init__(self, tim...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RelativeQuantileConstraint: """Class for representing a trainable relative quantile constraint. This constraint class implements a relative quantile constraint such as ``` Q_tau(action) >= Q_tau(baseline_action) ``` or ``` Q_tau(action) <= Q_tau(baseline_action) ```""" def __init__(self, time_step_spec: ...
the_stack_v2_python_sparse
tf_agents/bandits/policies/constraints.py
tensorflow/agents
train
2,755
a8a1415f5b14701c989bebce54ad0ede4fbf9a4c
[ "super(Critic, self).__init__()\ninput_shape = (state_size + action_size) * 2\nself.seed = torch.manual_seed(seed)\nself.fc1 = nn.Linear(input_shape, layer_in_out[0])\nself.fc2 = nn.Linear(layer_in_out[0], layer_in_out[1])\nself.fc3 = nn.Linear(layer_in_out[1], 1)\nself.bn1 = nn.BatchNorm1d(layer_in_out[0])\nself.r...
<|body_start_0|> super(Critic, self).__init__() input_shape = (state_size + action_size) * 2 self.seed = torch.manual_seed(seed) self.fc1 = nn.Linear(input_shape, layer_in_out[0]) self.fc2 = nn.Linear(layer_in_out[0], layer_in_out[1]) self.fc3 = nn.Linear(layer_in_out[1],...
Critic (Value) Model.
Critic
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Critic: """Critic (Value) Model.""" def __init__(self, state_size, action_size, layer_in_out, seed): """Initialize parameters and build model. Params ====== input_size (int): number of dimensions for input layer seed (int): random seed fc1_units (int): number of nodes in the first hi...
stack_v2_sparse_classes_36k_train_010794
2,775
no_license
[ { "docstring": "Initialize parameters and build model. Params ====== input_size (int): number of dimensions for input layer seed (int): random seed fc1_units (int): number of nodes in the first hidden layer fc2_units (int): number of nodes in the second hidden layer", "name": "__init__", "signature": "d...
3
stack_v2_sparse_classes_30k_train_002733
Implement the Python class `Critic` described below. Class description: Critic (Value) Model. Method signatures and docstrings: - def __init__(self, state_size, action_size, layer_in_out, seed): Initialize parameters and build model. Params ====== input_size (int): number of dimensions for input layer seed (int): ran...
Implement the Python class `Critic` described below. Class description: Critic (Value) Model. Method signatures and docstrings: - def __init__(self, state_size, action_size, layer_in_out, seed): Initialize parameters and build model. Params ====== input_size (int): number of dimensions for input layer seed (int): ran...
31e9aca1a97e83d323eea46287048bc6a3a0fb5f
<|skeleton|> class Critic: """Critic (Value) Model.""" def __init__(self, state_size, action_size, layer_in_out, seed): """Initialize parameters and build model. Params ====== input_size (int): number of dimensions for input layer seed (int): random seed fc1_units (int): number of nodes in the first hi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Critic: """Critic (Value) Model.""" def __init__(self, state_size, action_size, layer_in_out, seed): """Initialize parameters and build model. Params ====== input_size (int): number of dimensions for input layer seed (int): random seed fc1_units (int): number of nodes in the first hidden layer fc...
the_stack_v2_python_sparse
src/collab_compete/model.py
Sardhendu/DeepRL
train
3
16f2f2c2c4ab04135fbf9b18101d965b1876d5d0
[ "results = re.finditer(pattern=pattern, string=string)\nfor result in results:\n print(result)\n old_data = result.group()\n key = result.group(1)\n new_data = str(getattr(cls, key, ''))\n string = string.replace(old_data, new_data)\nreturn string", "fk = faker.Faker(locale='zh-CN')\nwhile True:\n ...
<|body_start_0|> results = re.finditer(pattern=pattern, string=string) for result in results: print(result) old_data = result.group() key = result.group(1) new_data = str(getattr(cls, key, '')) string = string.replace(old_data, new_data) ...
任务:中间层。common 和 调用层。 使用项目得配置数据,填充common模块
Handler
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Handler: """任务:中间层。common 和 调用层。 使用项目得配置数据,填充common模块""" def replace_data(cls, string, pattern='#(.*?)#'): """数据动态替换""" <|body_0|> def generate_new_phone(cls): """自动生成手机号""" <|body_1|> <|end_skeleton|> <|body_start_0|> results = re.finditer(patt...
stack_v2_sparse_classes_36k_train_010795
5,478
no_license
[ { "docstring": "数据动态替换", "name": "replace_data", "signature": "def replace_data(cls, string, pattern='#(.*?)#')" }, { "docstring": "自动生成手机号", "name": "generate_new_phone", "signature": "def generate_new_phone(cls)" } ]
2
null
Implement the Python class `Handler` described below. Class description: 任务:中间层。common 和 调用层。 使用项目得配置数据,填充common模块 Method signatures and docstrings: - def replace_data(cls, string, pattern='#(.*?)#'): 数据动态替换 - def generate_new_phone(cls): 自动生成手机号
Implement the Python class `Handler` described below. Class description: 任务:中间层。common 和 调用层。 使用项目得配置数据,填充common模块 Method signatures and docstrings: - def replace_data(cls, string, pattern='#(.*?)#'): 数据动态替换 - def generate_new_phone(cls): 自动生成手机号 <|skeleton|> class Handler: """任务:中间层。common 和 调用层。 使用项目得配置数据,填充co...
da800ed3374d1d43eb75485588ddb8c3a159bb41
<|skeleton|> class Handler: """任务:中间层。common 和 调用层。 使用项目得配置数据,填充common模块""" def replace_data(cls, string, pattern='#(.*?)#'): """数据动态替换""" <|body_0|> def generate_new_phone(cls): """自动生成手机号""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Handler: """任务:中间层。common 和 调用层。 使用项目得配置数据,填充common模块""" def replace_data(cls, string, pattern='#(.*?)#'): """数据动态替换""" results = re.finditer(pattern=pattern, string=string) for result in results: print(result) old_data = result.group() key = re...
the_stack_v2_python_sparse
lesson30_api_v9/middleware/handler.py
zengcong1314/python1205
train
0
0cd22bf1872e9834dddb5dd6a0bbc8f30af4f9a5
[ "calendar_event = serializer.save(owner=self.request.user)\nif calendar_event.type_of == constants.CALENDAR_EVENT_BY_TAG_TYPE:\n for tag in calendar_event.tags.all():\n me = Me.objects.get(tags__id=tag.id)\n calendar_event.pending.add(me)\nself.send_notification(calendar_event)", "try:\n calen...
<|body_start_0|> calendar_event = serializer.save(owner=self.request.user) if calendar_event.type_of == constants.CALENDAR_EVENT_BY_TAG_TYPE: for tag in calendar_event.tags.all(): me = Me.objects.get(tags__id=tag.id) calendar_event.pending.add(me) self...
CalendarEventViewSet
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CalendarEventViewSet: def perform_create(self, serializer): """Override the create function to add additional computations.""" <|body_0|> def attending(self, request, pk=None): """Will set the current authenticated User to be attending this event.""" <|body_1...
stack_v2_sparse_classes_36k_train_010796
6,051
permissive
[ { "docstring": "Override the create function to add additional computations.", "name": "perform_create", "signature": "def perform_create(self, serializer)" }, { "docstring": "Will set the current authenticated User to be attending this event.", "name": "attending", "signature": "def att...
3
null
Implement the Python class `CalendarEventViewSet` described below. Class description: Implement the CalendarEventViewSet class. Method signatures and docstrings: - def perform_create(self, serializer): Override the create function to add additional computations. - def attending(self, request, pk=None): Will set the c...
Implement the Python class `CalendarEventViewSet` described below. Class description: Implement the CalendarEventViewSet class. Method signatures and docstrings: - def perform_create(self, serializer): Override the create function to add additional computations. - def attending(self, request, pk=None): Will set the c...
053973b5ff0b997c52bfaca8daf8e07db64a877c
<|skeleton|> class CalendarEventViewSet: def perform_create(self, serializer): """Override the create function to add additional computations.""" <|body_0|> def attending(self, request, pk=None): """Will set the current authenticated User to be attending this event.""" <|body_1...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CalendarEventViewSet: def perform_create(self, serializer): """Override the create function to add additional computations.""" calendar_event = serializer.save(owner=self.request.user) if calendar_event.type_of == constants.CALENDAR_EVENT_BY_TAG_TYPE: for tag in calendar_ev...
the_stack_v2_python_sparse
api/views/foundation_tenant_base/calendareventviewset.py
smegurus/smegurus-django
train
1
ec6875ff85ed384d628ed6d27d3f8de2ecec6cb3
[ "set = {}\nfor name, arg in [('database', 'db'), ('user', 'user'), ('password', 'passwd'), ('host', 'host')]:\n set[arg] = getattr(fullSpecifier, name)\nreturn MySQLdb.connect(**set)", "if key != 'queries':\n script = self.queries.get(key)\n if script:\n return script\nraise AttributeError('%r obj...
<|body_start_0|> set = {} for name, arg in [('database', 'db'), ('user', 'user'), ('password', 'passwd'), ('host', 'host')]: set[arg] = getattr(fullSpecifier, name) return MySQLdb.connect(**set) <|end_body_0|> <|body_start_1|> if key != 'queries': script = self.q...
MySQLdb database driver
MyDriver
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyDriver: """MySQLdb database driver""" def establishConnection(self, fullSpecifier): """Connect using the fully specified specifier fullSpecifier -- a specifier with all arguments unified and ready to be connected. This specifier should include everything required to do the actual c...
stack_v2_sparse_classes_36k_train_010797
4,590
no_license
[ { "docstring": "Connect using the fully specified specifier fullSpecifier -- a specifier with all arguments unified and ready to be connected. This specifier should include everything required to do the actual connection (including passwords or the like). All sub-classes must override this method!", "name":...
2
stack_v2_sparse_classes_30k_train_002183
Implement the Python class `MyDriver` described below. Class description: MySQLdb database driver Method signatures and docstrings: - def establishConnection(self, fullSpecifier): Connect using the fully specified specifier fullSpecifier -- a specifier with all arguments unified and ready to be connected. This specif...
Implement the Python class `MyDriver` described below. Class description: MySQLdb database driver Method signatures and docstrings: - def establishConnection(self, fullSpecifier): Connect using the fully specified specifier fullSpecifier -- a specifier with all arguments unified and ready to be connected. This specif...
86410d2e8bece963ee7e7306560c94930467a1a7
<|skeleton|> class MyDriver: """MySQLdb database driver""" def establishConnection(self, fullSpecifier): """Connect using the fully specified specifier fullSpecifier -- a specifier with all arguments unified and ready to be connected. This specifier should include everything required to do the actual c...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MyDriver: """MySQLdb database driver""" def establishConnection(self, fullSpecifier): """Connect using the fully specified specifier fullSpecifier -- a specifier with all arguments unified and ready to be connected. This specifier should include everything required to do the actual connection (in...
the_stack_v2_python_sparse
build/pytable/pytable/mysql/mydriver.py
icot/euler
train
0
b5e23aff68e215988a78bdcd1f135e395128fd48
[ "handle = self._handle\nhandle.seek(0)\nquery_id_idx = self._query_id_idx\nqresult_key = None\nheader_mark = b'#'\nsplit_mark = b' '\nline = header_mark\nwhile line.startswith(header_mark):\n start_offset = handle.tell()\n line = handle.readline()\nwhile True:\n end_offset = handle.tell()\n if not line:...
<|body_start_0|> handle = self._handle handle.seek(0) query_id_idx = self._query_id_idx qresult_key = None header_mark = b'#' split_mark = b' ' line = header_mark while line.startswith(header_mark): start_offset = handle.tell() line...
Indexer class for HMMER table output.
Hmmer3TabIndexer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Hmmer3TabIndexer: """Indexer class for HMMER table output.""" def __iter__(self): """Iterate over the file handle; yields key, start offset, and length.""" <|body_0|> def get_raw(self, offset): """Return the raw bytes string of a QueryResult object from the given...
stack_v2_sparse_classes_36k_train_010798
12,818
permissive
[ { "docstring": "Iterate over the file handle; yields key, start offset, and length.", "name": "__iter__", "signature": "def __iter__(self)" }, { "docstring": "Return the raw bytes string of a QueryResult object from the given offset.", "name": "get_raw", "signature": "def get_raw(self, o...
2
null
Implement the Python class `Hmmer3TabIndexer` described below. Class description: Indexer class for HMMER table output. Method signatures and docstrings: - def __iter__(self): Iterate over the file handle; yields key, start offset, and length. - def get_raw(self, offset): Return the raw bytes string of a QueryResult ...
Implement the Python class `Hmmer3TabIndexer` described below. Class description: Indexer class for HMMER table output. Method signatures and docstrings: - def __iter__(self): Iterate over the file handle; yields key, start offset, and length. - def get_raw(self, offset): Return the raw bytes string of a QueryResult ...
595c5c46794ae08a1f19716636eac7430cededa1
<|skeleton|> class Hmmer3TabIndexer: """Indexer class for HMMER table output.""" def __iter__(self): """Iterate over the file handle; yields key, start offset, and length.""" <|body_0|> def get_raw(self, offset): """Return the raw bytes string of a QueryResult object from the given...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Hmmer3TabIndexer: """Indexer class for HMMER table output.""" def __iter__(self): """Iterate over the file handle; yields key, start offset, and length.""" handle = self._handle handle.seek(0) query_id_idx = self._query_id_idx qresult_key = None header_mark...
the_stack_v2_python_sparse
env/Lib/site-packages/Bio/SearchIO/HmmerIO/hmmer3_tab.py
abner-lucas/tp-cruzi-db
train
2
57c5a37686029dfc6c4cc153532c921ef397c4aa
[ "matrix = [['.' for i in range(n)] for j in range(n)]\nresults = []\nself.findNqueens(matrix, 0, results)\nreturn results", "if k == len(matrix):\n result = []\n for l in range(len(matrix)):\n result.append(''.join(matrix[l]))\n results.append(result)\n return\nfor i in range(len(matrix[k])):\n...
<|body_start_0|> matrix = [['.' for i in range(n)] for j in range(n)] results = [] self.findNqueens(matrix, 0, results) return results <|end_body_0|> <|body_start_1|> if k == len(matrix): result = [] for l in range(len(matrix)): result.app...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def solveNQueens(self, n): """:type n: int :rtype: List[List[str]]""" <|body_0|> def findNqueens(self, matrix, k, results): """摆放皇后 :param matrix: :param k: :return:""" <|body_1|> def checkConflicts(self, matrix, k, i): """检测冲突 :param m...
stack_v2_sparse_classes_36k_train_010799
1,751
no_license
[ { "docstring": ":type n: int :rtype: List[List[str]]", "name": "solveNQueens", "signature": "def solveNQueens(self, n)" }, { "docstring": "摆放皇后 :param matrix: :param k: :return:", "name": "findNqueens", "signature": "def findNqueens(self, matrix, k, results)" }, { "docstring": "检...
3
stack_v2_sparse_classes_30k_train_020792
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def solveNQueens(self, n): :type n: int :rtype: List[List[str]] - def findNqueens(self, matrix, k, results): 摆放皇后 :param matrix: :param k: :return: - def checkConflicts(self, mat...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def solveNQueens(self, n): :type n: int :rtype: List[List[str]] - def findNqueens(self, matrix, k, results): 摆放皇后 :param matrix: :param k: :return: - def checkConflicts(self, mat...
4af7182f125295cfd47390381e55b3fdfdb24775
<|skeleton|> class Solution: def solveNQueens(self, n): """:type n: int :rtype: List[List[str]]""" <|body_0|> def findNqueens(self, matrix, k, results): """摆放皇后 :param matrix: :param k: :return:""" <|body_1|> def checkConflicts(self, matrix, k, i): """检测冲突 :param m...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def solveNQueens(self, n): """:type n: int :rtype: List[List[str]]""" matrix = [['.' for i in range(n)] for j in range(n)] results = [] self.findNqueens(matrix, 0, results) return results def findNqueens(self, matrix, k, results): """摆放皇后 :param m...
the_stack_v2_python_sparse
LeetCode_051.py
UpTownCat/LeetCode
train
0