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
85eabc921a215db7dcf82dc69f0cd928cc1f43f7
[ "if not asnode:\n self.translate_coding_to_rule(rule)\nelse:\n self.rule = rule\n self.human_read = self.rule.visit_easy_read()\n self.polish_notation = self.rule.visit_with_polish_notation()\n self.coding = self.rule.visit_make_coding()\n self.find_needed_premises()\n self.find_conclusions()",...
<|body_start_0|> if not asnode: self.translate_coding_to_rule(rule) else: self.rule = rule self.human_read = self.rule.visit_easy_read() self.polish_notation = self.rule.visit_with_polish_notation() self.coding = self.rule.visit_make_coding() ...
This class represents a Rule for the rule approach. It has its Coding which is a string of its binary coding, a node named rule which is the starting node of the rule in its tree representation, a string representation of the polish notation of the Rule and an easily human readable representation of the rule.
Rule
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Rule: """This class represents a Rule for the rule approach. It has its Coding which is a string of its binary coding, a node named rule which is the starting node of the rule in its tree representation, a string representation of the polish notation of the Rule and an easily human readable repre...
stack_v2_sparse_classes_36k_train_020500
3,168
permissive
[ { "docstring": ":param rule: the rule :param asnode: change it to false if you are only passing a lib which should be transformed to a rule. This constructor takes either a Node which represents the starting node of a rule and fills in all other needed information. Or an coding which represents a rule in its bi...
5
stack_v2_sparse_classes_30k_train_003406
Implement the Python class `Rule` described below. Class description: This class represents a Rule for the rule approach. It has its Coding which is a string of its binary coding, a node named rule which is the starting node of the rule in its tree representation, a string representation of the polish notation of the ...
Implement the Python class `Rule` described below. Class description: This class represents a Rule for the rule approach. It has its Coding which is a string of its binary coding, a node named rule which is the starting node of the rule in its tree representation, a string representation of the polish notation of the ...
ac73fb60387aad37d3b3fb823f9b2c205c6cb458
<|skeleton|> class Rule: """This class represents a Rule for the rule approach. It has its Coding which is a string of its binary coding, a node named rule which is the starting node of the rule in its tree representation, a string representation of the polish notation of the Rule and an easily human readable repre...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Rule: """This class represents a Rule for the rule approach. It has its Coding which is a string of its binary coding, a node named rule which is the starting node of the rule in its tree representation, a string representation of the polish notation of the Rule and an easily human readable representation of ...
the_stack_v2_python_sparse
relational/student_projects/2019_guth/models/Rule_Genetic/Rule.py
CognitiveComputationLab/cogmods
train
1
42498c95b1dec89ab6f33ea3ae550e0851733877
[ "self.counter = 0\nself.frequency = spawning_frequency\nself.mix_and_match = mix_and_match\nself.prebuilts = prebuilt_vehicle_probs\nself.drivers = driver_template_probs\nself.vehicles = vehicle_template_probs", "self.counter += time_since_last_prompt\nif self.counter >= self.frequency:\n self.counter = 0\n ...
<|body_start_0|> self.counter = 0 self.frequency = spawning_frequency self.mix_and_match = mix_and_match self.prebuilts = prebuilt_vehicle_probs self.drivers = driver_template_probs self.vehicles = vehicle_template_probs <|end_body_0|> <|body_start_1|> self.count...
TemplatePairFactory
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TemplatePairFactory: def __init__(self, spawning_frequency, prebuilt_vehicle_probs, mix_and_match=False, driver_template_probs=None, vehicle_template_probs=None): """A TemplatePairFactory behaves in one of two ways. If the parameter mix_and_match is False, a VehicleTemplate-DriverTemplat...
stack_v2_sparse_classes_36k_train_020501
3,503
permissive
[ { "docstring": "A TemplatePairFactory behaves in one of two ways. If the parameter mix_and_match is False, a VehicleTemplate-DriverTemplate pair are returned according to the prebuilt probabilities. If mix_and_match is true, the VehicleTemplate-DriverTemplate pair are selected independantly from the driver_temp...
2
null
Implement the Python class `TemplatePairFactory` described below. Class description: Implement the TemplatePairFactory class. Method signatures and docstrings: - def __init__(self, spawning_frequency, prebuilt_vehicle_probs, mix_and_match=False, driver_template_probs=None, vehicle_template_probs=None): A TemplatePair...
Implement the Python class `TemplatePairFactory` described below. Class description: Implement the TemplatePairFactory class. Method signatures and docstrings: - def __init__(self, spawning_frequency, prebuilt_vehicle_probs, mix_and_match=False, driver_template_probs=None, vehicle_template_probs=None): A TemplatePair...
69ba3bfddc8b8772b80a99fb7bb6b4367b417e5d
<|skeleton|> class TemplatePairFactory: def __init__(self, spawning_frequency, prebuilt_vehicle_probs, mix_and_match=False, driver_template_probs=None, vehicle_template_probs=None): """A TemplatePairFactory behaves in one of two ways. If the parameter mix_and_match is False, a VehicleTemplate-DriverTemplat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TemplatePairFactory: def __init__(self, spawning_frequency, prebuilt_vehicle_probs, mix_and_match=False, driver_template_probs=None, vehicle_template_probs=None): """A TemplatePairFactory behaves in one of two ways. If the parameter mix_and_match is False, a VehicleTemplate-DriverTemplate pair are ret...
the_stack_v2_python_sparse
src/TemplatePairFactory.py
DLance96/TrafficSim-Simulator
train
0
5038b39d3a7c5014b278e4900f24bb3ba935fcef
[ "graph = Graph()\nself.assertEqual({}, graph.getListNode())\nself.assertEqual([], graph.getListEdge())", "graph = Graph()\nnodeA = Node(1, 5, 10)\nnodeB = Node(2, 6, 8)\nlistNode = {}\nlistNode[nodeA.getId()] = nodeA\nlistNode[nodeB.getId()] = nodeB\ngraph.setListNode(listNode)\nself.assertIs(listNode, graph.getL...
<|body_start_0|> graph = Graph() self.assertEqual({}, graph.getListNode()) self.assertEqual([], graph.getListEdge()) <|end_body_0|> <|body_start_1|> graph = Graph() nodeA = Node(1, 5, 10) nodeB = Node(2, 6, 8) listNode = {} listNode[nodeA.getId()] = nodeA...
Test case utilisé pour tester les fonctions de la classe 'Graph'.
testNode
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class testNode: """Test case utilisé pour tester les fonctions de la classe 'Graph'.""" def test_init(self): """Test du __init__""" <|body_0|> def test_setListNode(self): """Test le fonctionnement de la fonction setListNode()""" <|body_1|> def test_setList...
stack_v2_sparse_classes_36k_train_020502
1,396
no_license
[ { "docstring": "Test du __init__", "name": "test_init", "signature": "def test_init(self)" }, { "docstring": "Test le fonctionnement de la fonction setListNode()", "name": "test_setListNode", "signature": "def test_setListNode(self)" }, { "docstring": "Test le fonctionnement de l...
3
stack_v2_sparse_classes_30k_train_014213
Implement the Python class `testNode` described below. Class description: Test case utilisé pour tester les fonctions de la classe 'Graph'. Method signatures and docstrings: - def test_init(self): Test du __init__ - def test_setListNode(self): Test le fonctionnement de la fonction setListNode() - def test_setListEdge...
Implement the Python class `testNode` described below. Class description: Test case utilisé pour tester les fonctions de la classe 'Graph'. Method signatures and docstrings: - def test_init(self): Test du __init__ - def test_setListNode(self): Test le fonctionnement de la fonction setListNode() - def test_setListEdge...
b93ae4c114add1fa2a49f23276ea31ee895ce66c
<|skeleton|> class testNode: """Test case utilisé pour tester les fonctions de la classe 'Graph'.""" def test_init(self): """Test du __init__""" <|body_0|> def test_setListNode(self): """Test le fonctionnement de la fonction setListNode()""" <|body_1|> def test_setList...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class testNode: """Test case utilisé pour tester les fonctions de la classe 'Graph'.""" def test_init(self): """Test du __init__""" graph = Graph() self.assertEqual({}, graph.getListNode()) self.assertEqual([], graph.getListEdge()) def test_setListNode(self): """Tes...
the_stack_v2_python_sparse
model/testGraph.py
dimespi/graphanalysis
train
0
8c2bdcc730c42e5f73c9f5222de72053c930b45f
[ "p = head\nfor i in range(k - 1):\n if p:\n p = p.next\nrhead = p\nif not rhead:\n return head\np1 = head\np2 = rhead.next\ntail = head\nprev = None\ni = 1\nwhile p1:\n tmp = p1.next\n p1.next = prev\n prev = p1\n if i % k == 0:\n if p2:\n tail.next = p2\n tail ...
<|body_start_0|> p = head for i in range(k - 1): if p: p = p.next rhead = p if not rhead: return head p1 = head p2 = rhead.next tail = head prev = None i = 1 while p1: tmp = p1.next ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def reverseKGroup_v1(self, head: ListNode, k: int) -> ListNode: """Double pointer.""" <|body_0|> def reverseKGroup_v2(self, head: ListNode, k: int) -> ListNode: """Double pointer.""" <|body_1|> <|end_skeleton|> <|body_start_0|> p = head ...
stack_v2_sparse_classes_36k_train_020503
3,369
no_license
[ { "docstring": "Double pointer.", "name": "reverseKGroup_v1", "signature": "def reverseKGroup_v1(self, head: ListNode, k: int) -> ListNode" }, { "docstring": "Double pointer.", "name": "reverseKGroup_v2", "signature": "def reverseKGroup_v2(self, head: ListNode, k: int) -> ListNode" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverseKGroup_v1(self, head: ListNode, k: int) -> ListNode: Double pointer. - def reverseKGroup_v2(self, head: ListNode, k: int) -> ListNode: Double pointer.
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverseKGroup_v1(self, head: ListNode, k: int) -> ListNode: Double pointer. - def reverseKGroup_v2(self, head: ListNode, k: int) -> ListNode: Double pointer. <|skeleton|> cl...
97a2386f5e3adbd7138fd123810c3232bdf7f622
<|skeleton|> class Solution: def reverseKGroup_v1(self, head: ListNode, k: int) -> ListNode: """Double pointer.""" <|body_0|> def reverseKGroup_v2(self, head: ListNode, k: int) -> ListNode: """Double pointer.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def reverseKGroup_v1(self, head: ListNode, k: int) -> ListNode: """Double pointer.""" p = head for i in range(k - 1): if p: p = p.next rhead = p if not rhead: return head p1 = head p2 = rhead.next ...
the_stack_v2_python_sparse
python3/linked_list/reverse_k_group.py
victorchu/algorithms
train
0
ec0d731ec57d62298d405bd47cbafb254d86bc27
[ "hr('StreamHandler')\nself._run_streamhandler_example()\nhr('FileHandler')\nself._run_filehandler_example()", "logdir = pathlib.Path(tempfile.gettempdir())\nlogfile = logdir / 'logging05.log'\nhandler = logging.FileHandler(logfile, mode='w', encoding='utf-8')\nlogger = logging.getLogger('filehandler1')\nlogger.ad...
<|body_start_0|> hr('StreamHandler') self._run_streamhandler_example() hr('FileHandler') self._run_filehandler_example() <|end_body_0|> <|body_start_1|> logdir = pathlib.Path(tempfile.gettempdir()) logfile = logdir / 'logging05.log' handler = logging.FileHandler(...
サンプルクラス
Sample
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Sample: """サンプルクラス""" def exec(self): """サンプル処理を実行します""" <|body_0|> def _run_filehandler_example(self): """logging.FileHandler のサンプル""" <|body_1|> def _run_streamhandler_example(self): """logging.StreamHandler のサンプル""" <|body_2|> <|e...
stack_v2_sparse_classes_36k_train_020504
5,131
permissive
[ { "docstring": "サンプル処理を実行します", "name": "exec", "signature": "def exec(self)" }, { "docstring": "logging.FileHandler のサンプル", "name": "_run_filehandler_example", "signature": "def _run_filehandler_example(self)" }, { "docstring": "logging.StreamHandler のサンプル", "name": "_run_str...
3
stack_v2_sparse_classes_30k_train_007254
Implement the Python class `Sample` described below. Class description: サンプルクラス Method signatures and docstrings: - def exec(self): サンプル処理を実行します - def _run_filehandler_example(self): logging.FileHandler のサンプル - def _run_streamhandler_example(self): logging.StreamHandler のサンプル
Implement the Python class `Sample` described below. Class description: サンプルクラス Method signatures and docstrings: - def exec(self): サンプル処理を実行します - def _run_filehandler_example(self): logging.FileHandler のサンプル - def _run_streamhandler_example(self): logging.StreamHandler のサンプル <|skeleton|> class Sample: """サンプルクラ...
8f0e9997012c7ef5a4f71c15c98ea2832424136d
<|skeleton|> class Sample: """サンプルクラス""" def exec(self): """サンプル処理を実行します""" <|body_0|> def _run_filehandler_example(self): """logging.FileHandler のサンプル""" <|body_1|> def _run_streamhandler_example(self): """logging.StreamHandler のサンプル""" <|body_2|> <|e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Sample: """サンプルクラス""" def exec(self): """サンプル処理を実行します""" hr('StreamHandler') self._run_streamhandler_example() hr('FileHandler') self._run_filehandler_example() def _run_filehandler_example(self): """logging.FileHandler のサンプル""" logdir = pathli...
the_stack_v2_python_sparse
trypython/stdlib/logging_/logging05.py
devlights/try-python
train
6
260e45f19db618492bef6e83aeeb9fb20d9762b2
[ "url = 'https://api.maocode.cn/tiger/accounts/logout'\nres = requests.post(url=url, headers=self.headers)\nself.assertEquals(res.status_code, 204)", "headers = self.headers.copy()\nheaders['authorization'] = ''\nurl = 'https://api.maocode.cn/tiger/accounts/logout'\nres = requests.post(url=url, headers=headers)\ns...
<|body_start_0|> url = 'https://api.maocode.cn/tiger/accounts/logout' res = requests.post(url=url, headers=self.headers) self.assertEquals(res.status_code, 204) <|end_body_0|> <|body_start_1|> headers = self.headers.copy() headers['authorization'] = '' url = 'https://api...
退出登录接口
Logout
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Logout: """退出登录接口""" def test_26_logout(self): """登录态正常--退出登录操作""" <|body_0|> def test_27_logout(self): """登录态失效--退出登录操作""" <|body_1|> <|end_skeleton|> <|body_start_0|> url = 'https://api.maocode.cn/tiger/accounts/logout' res = requests....
stack_v2_sparse_classes_36k_train_020505
1,174
no_license
[ { "docstring": "登录态正常--退出登录操作", "name": "test_26_logout", "signature": "def test_26_logout(self)" }, { "docstring": "登录态失效--退出登录操作", "name": "test_27_logout", "signature": "def test_27_logout(self)" } ]
2
stack_v2_sparse_classes_30k_train_016219
Implement the Python class `Logout` described below. Class description: 退出登录接口 Method signatures and docstrings: - def test_26_logout(self): 登录态正常--退出登录操作 - def test_27_logout(self): 登录态失效--退出登录操作
Implement the Python class `Logout` described below. Class description: 退出登录接口 Method signatures and docstrings: - def test_26_logout(self): 登录态正常--退出登录操作 - def test_27_logout(self): 登录态失效--退出登录操作 <|skeleton|> class Logout: """退出登录接口""" def test_26_logout(self): """登录态正常--退出登录操作""" <|body_0|...
e75039fcd2361977a2a5dc7ea95b7fb2fbc96bb0
<|skeleton|> class Logout: """退出登录接口""" def test_26_logout(self): """登录态正常--退出登录操作""" <|body_0|> def test_27_logout(self): """登录态失效--退出登录操作""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Logout: """退出登录接口""" def test_26_logout(self): """登录态正常--退出登录操作""" url = 'https://api.maocode.cn/tiger/accounts/logout' res = requests.post(url=url, headers=self.headers) self.assertEquals(res.status_code, 204) def test_27_logout(self): """登录态失效--退出登录操作""" ...
the_stack_v2_python_sparse
API_study/Wood/H_Logout.py
JmeterChen/api_wood
train
1
4019039f663f17ee6c87ade74a3205524bdfe54f
[ "combinations = []\nself.subroutine(n, 0, 0, '', combinations)\nreturn combinations", "if num_open == n and num_close == n:\n combinations.append(string)\nif num_open < n:\n self.subroutine(n, num_open + 1, num_close, string + '(', combinations)\nif num_close < num_open:\n self.subroutine(n, num_open, nu...
<|body_start_0|> combinations = [] self.subroutine(n, 0, 0, '', combinations) return combinations <|end_body_0|> <|body_start_1|> if num_open == n and num_close == n: combinations.append(string) if num_open < n: self.subroutine(n, num_open + 1, num_close,...
Leet22
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Leet22: def generate_parenthesis(self, n): """Generate all combinations of well-formed parentheses. Args: n -- An integer. Returns: All combinations of well-formed parentheses.""" <|body_0|> def subroutine(self, n, num_open, num_close, string, combinations): """Gener...
stack_v2_sparse_classes_36k_train_020506
1,779
no_license
[ { "docstring": "Generate all combinations of well-formed parentheses. Args: n -- An integer. Returns: All combinations of well-formed parentheses.", "name": "generate_parenthesis", "signature": "def generate_parenthesis(self, n)" }, { "docstring": "Generate all combinations of well-formed parent...
2
stack_v2_sparse_classes_30k_train_019194
Implement the Python class `Leet22` described below. Class description: Implement the Leet22 class. Method signatures and docstrings: - def generate_parenthesis(self, n): Generate all combinations of well-formed parentheses. Args: n -- An integer. Returns: All combinations of well-formed parentheses. - def subroutine...
Implement the Python class `Leet22` described below. Class description: Implement the Leet22 class. Method signatures and docstrings: - def generate_parenthesis(self, n): Generate all combinations of well-formed parentheses. Args: n -- An integer. Returns: All combinations of well-formed parentheses. - def subroutine...
b0cfcfa1eff0101cf8e0e3fb9db55fb83f566f6f
<|skeleton|> class Leet22: def generate_parenthesis(self, n): """Generate all combinations of well-formed parentheses. Args: n -- An integer. Returns: All combinations of well-formed parentheses.""" <|body_0|> def subroutine(self, n, num_open, num_close, string, combinations): """Gener...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Leet22: def generate_parenthesis(self, n): """Generate all combinations of well-formed parentheses. Args: n -- An integer. Returns: All combinations of well-formed parentheses.""" combinations = [] self.subroutine(n, 0, 0, '', combinations) return combinations def subrouti...
the_stack_v2_python_sparse
archive/algorithms-leetcode/leet22.py
riehseun/software-engineering
train
0
f0d84f8bd3334c01e032974b70b19aa3fc15485f
[ "self.files_downloaded = 0\nself.files_processed = 0\nself.exception_count = 0\nself.now = time_utils.get_utc_now()\nself.grib_processor = GribFileProcessor(station_source)\nself.model_type: ModelEnum = model_type\nif self.model_type == ModelEnum.GDPS:\n self.projection = ProjectionEnum.LATLON_15X_15\nelif self....
<|body_start_0|> self.files_downloaded = 0 self.files_processed = 0 self.exception_count = 0 self.now = time_utils.get_utc_now() self.grib_processor = GribFileProcessor(station_source) self.model_type: ModelEnum = model_type if self.model_type == ModelEnum.GDPS: ...
Class that orchestrates downloading and processing of weather model grib files from environment Canada.
EnvCanada
[ "Apache-2.0", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EnvCanada: """Class that orchestrates downloading and processing of weather model grib files from environment Canada.""" def __init__(self, model_type: ModelEnum, station_source: StationSourceEnum=StationSourceEnum.UNSPECIFIED): """Prep variables""" <|body_0|> def proces...
stack_v2_sparse_classes_36k_train_020507
17,429
permissive
[ { "docstring": "Prep variables", "name": "__init__", "signature": "def __init__(self, model_type: ModelEnum, station_source: StationSourceEnum=StationSourceEnum.UNSPECIFIED)" }, { "docstring": "Process the urls for a model run.", "name": "process_model_run_urls", "signature": "def proces...
4
stack_v2_sparse_classes_30k_val_000100
Implement the Python class `EnvCanada` described below. Class description: Class that orchestrates downloading and processing of weather model grib files from environment Canada. Method signatures and docstrings: - def __init__(self, model_type: ModelEnum, station_source: StationSourceEnum=StationSourceEnum.UNSPECIFI...
Implement the Python class `EnvCanada` described below. Class description: Class that orchestrates downloading and processing of weather model grib files from environment Canada. Method signatures and docstrings: - def __init__(self, model_type: ModelEnum, station_source: StationSourceEnum=StationSourceEnum.UNSPECIFI...
0ba707b0eddc280240964efa481988df92046e6a
<|skeleton|> class EnvCanada: """Class that orchestrates downloading and processing of weather model grib files from environment Canada.""" def __init__(self, model_type: ModelEnum, station_source: StationSourceEnum=StationSourceEnum.UNSPECIFIED): """Prep variables""" <|body_0|> def proces...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EnvCanada: """Class that orchestrates downloading and processing of weather model grib files from environment Canada.""" def __init__(self, model_type: ModelEnum, station_source: StationSourceEnum=StationSourceEnum.UNSPECIFIED): """Prep variables""" self.files_downloaded = 0 self....
the_stack_v2_python_sparse
api/app/jobs/env_canada.py
bcgov/wps
train
35
71a8b055abd65a0d53fb913f89b3efc45a7db7bc
[ "l = len(arr)\npos = bisect.bisect_left(arr, x)\nif pos > 0:\n start = pos - 1\nelse:\n start = 0\nend = start + 1\nwhile k > 0:\n print(start, end)\n if end == l or (start >= 0 and x - arr[start] <= arr[end] - x):\n start -= 1\n else:\n end += 1\n k -= 1\nresult = [arr[i] for i in r...
<|body_start_0|> l = len(arr) pos = bisect.bisect_left(arr, x) if pos > 0: start = pos - 1 else: start = 0 end = start + 1 while k > 0: print(start, end) if end == l or (start >= 0 and x - arr[start] <= arr[end] - x): ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findClosestElements(self, arr, k, x): """:type arr: List[int] :type k: int :type x: int :rtype: List[int] 245ms""" <|body_0|> def findClosestElements(self, arr, k, x): """:type arr: List[int] :type k: int :type x: int :rtype: List[int] 218ms""" ...
stack_v2_sparse_classes_36k_train_020508
2,702
no_license
[ { "docstring": ":type arr: List[int] :type k: int :type x: int :rtype: List[int] 245ms", "name": "findClosestElements", "signature": "def findClosestElements(self, arr, k, x)" }, { "docstring": ":type arr: List[int] :type k: int :type x: int :rtype: List[int] 218ms", "name": "findClosestElem...
3
stack_v2_sparse_classes_30k_train_015910
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findClosestElements(self, arr, k, x): :type arr: List[int] :type k: int :type x: int :rtype: List[int] 245ms - def findClosestElements(self, arr, k, x): :type arr: List[int] ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findClosestElements(self, arr, k, x): :type arr: List[int] :type k: int :type x: int :rtype: List[int] 245ms - def findClosestElements(self, arr, k, x): :type arr: List[int] ...
679a2b246b8b6bb7fc55ed1c8096d3047d6d4461
<|skeleton|> class Solution: def findClosestElements(self, arr, k, x): """:type arr: List[int] :type k: int :type x: int :rtype: List[int] 245ms""" <|body_0|> def findClosestElements(self, arr, k, x): """:type arr: List[int] :type k: int :type x: int :rtype: List[int] 218ms""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findClosestElements(self, arr, k, x): """:type arr: List[int] :type k: int :type x: int :rtype: List[int] 245ms""" l = len(arr) pos = bisect.bisect_left(arr, x) if pos > 0: start = pos - 1 else: start = 0 end = start + 1 ...
the_stack_v2_python_sparse
FindKClosestElements_MID_658.py
953250587/leetcode-python
train
2
367f71aaf0b86cbf74c93b962f312eb0a9aced72
[ "last = next = 0\nmax_len = len(nums) - 1\nwhile next < max_len:\n last, next = (next, max((i + nums[i] for i in range(last, next + 1))))\n if last == next:\n return False\nreturn True", "steps = 1\nfor v in nums[:-1]:\n steps -= 1\n if v == steps == 0:\n return False\n steps = max(st...
<|body_start_0|> last = next = 0 max_len = len(nums) - 1 while next < max_len: last, next = (next, max((i + nums[i] for i in range(last, next + 1)))) if last == next: return False return True <|end_body_0|> <|body_start_1|> steps = 1 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def canJump(self, nums): """当前索引表示最大的跳数,求到达终点的最小跳数 每一次挑选下一步能调的最远的地方 :type nums: List[int] :rtype: bool""" <|body_0|> def canJump2(self, nums): """只需要判断能否到达 每次记录当前能到达的最远距离 如果之前的最远距离为0(即到达当前位置)且当前位置也为0,则失败""" <|body_1|> <|end_skeleton|> <|body_start...
stack_v2_sparse_classes_36k_train_020509
1,048
no_license
[ { "docstring": "当前索引表示最大的跳数,求到达终点的最小跳数 每一次挑选下一步能调的最远的地方 :type nums: List[int] :rtype: bool", "name": "canJump", "signature": "def canJump(self, nums)" }, { "docstring": "只需要判断能否到达 每次记录当前能到达的最远距离 如果之前的最远距离为0(即到达当前位置)且当前位置也为0,则失败", "name": "canJump2", "signature": "def canJump2(self, nums)...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canJump(self, nums): 当前索引表示最大的跳数,求到达终点的最小跳数 每一次挑选下一步能调的最远的地方 :type nums: List[int] :rtype: bool - def canJump2(self, nums): 只需要判断能否到达 每次记录当前能到达的最远距离 如果之前的最远距离为0(即到达当前位置)且当前位置...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canJump(self, nums): 当前索引表示最大的跳数,求到达终点的最小跳数 每一次挑选下一步能调的最远的地方 :type nums: List[int] :rtype: bool - def canJump2(self, nums): 只需要判断能否到达 每次记录当前能到达的最远距离 如果之前的最远距离为0(即到达当前位置)且当前位置...
86352d3f51ab030afdb7b472a80bc8cab7260c08
<|skeleton|> class Solution: def canJump(self, nums): """当前索引表示最大的跳数,求到达终点的最小跳数 每一次挑选下一步能调的最远的地方 :type nums: List[int] :rtype: bool""" <|body_0|> def canJump2(self, nums): """只需要判断能否到达 每次记录当前能到达的最远距离 如果之前的最远距离为0(即到达当前位置)且当前位置也为0,则失败""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def canJump(self, nums): """当前索引表示最大的跳数,求到达终点的最小跳数 每一次挑选下一步能调的最远的地方 :type nums: List[int] :rtype: bool""" last = next = 0 max_len = len(nums) - 1 while next < max_len: last, next = (next, max((i + nums[i] for i in range(last, next + 1)))) if la...
the_stack_v2_python_sparse
leetcode/_055_JumpGame.py
scolphew/leetcode_python
train
0
81c9908a1b9e51c7b1957e14eb1d69890a472ac0
[ "try:\n self.acl.get(user=None, permission_read=True)\n return True\nexcept ObjectDoesNotExist:\n return False", "if not self.can_write(user):\n return\ntry:\n ace = self.acl.get(user=None)\n if not ace.permission_read:\n ace.permission_read = True\n ace.save()\nexcept ObjectDoesNo...
<|body_start_0|> try: self.acl.get(user=None, permission_read=True) return True except ObjectDoesNotExist: return False <|end_body_0|> <|body_start_1|> if not self.can_write(user): return try: ace = self.acl.get(user=None) ...
MixIn for classes with generic relationship with AccessControlEntry. Common functions to manipulate and use the permission system.
AccessControlMixIn
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AccessControlMixIn: """MixIn for classes with generic relationship with AccessControlEntry. Common functions to manipulate and use the permission system.""" def is_public(self): """Determine if the ACL is open to everyone for the specific object. Returns: Boolean value to indicate if...
stack_v2_sparse_classes_36k_train_020510
5,589
permissive
[ { "docstring": "Determine if the ACL is open to everyone for the specific object. Returns: Boolean value to indicate if the object is readable by everyone.", "name": "is_public", "signature": "def is_public(self)" }, { "docstring": "Make object public. Args: user. user object (instance of django...
6
stack_v2_sparse_classes_30k_train_000423
Implement the Python class `AccessControlMixIn` described below. Class description: MixIn for classes with generic relationship with AccessControlEntry. Common functions to manipulate and use the permission system. Method signatures and docstrings: - def is_public(self): Determine if the ACL is open to everyone for t...
Implement the Python class `AccessControlMixIn` described below. Class description: MixIn for classes with generic relationship with AccessControlEntry. Common functions to manipulate and use the permission system. Method signatures and docstrings: - def is_public(self): Determine if the ACL is open to everyone for t...
ce692b42cb4cfbc999df631852c5c72d13c19561
<|skeleton|> class AccessControlMixIn: """MixIn for classes with generic relationship with AccessControlEntry. Common functions to manipulate and use the permission system.""" def is_public(self): """Determine if the ACL is open to everyone for the specific object. Returns: Boolean value to indicate if...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AccessControlMixIn: """MixIn for classes with generic relationship with AccessControlEntry. Common functions to manipulate and use the permission system.""" def is_public(self): """Determine if the ACL is open to everyone for the specific object. Returns: Boolean value to indicate if the object i...
the_stack_v2_python_sparse
timesketch/apps/acl/models.py
pombredanne/timesketch
train
0
2ae78819a125a52db6285e04519dd5ca79b853f5
[ "dom = minidom.parseString(string)\nsecurity_group_rule = self._extract_security_group_rule(dom)\nreturn {'body': {'security_group_rule': security_group_rule}}", "sg_rule = {}\nsg_rule_node = self.find_first_child_named(node, 'security_group_rule')\nif sg_rule_node is not None:\n ip_protocol_node = self.find_f...
<|body_start_0|> dom = minidom.parseString(string) security_group_rule = self._extract_security_group_rule(dom) return {'body': {'security_group_rule': security_group_rule}} <|end_body_0|> <|body_start_1|> sg_rule = {} sg_rule_node = self.find_first_child_named(node, 'security_g...
Deserializer to handle xml-formatted security group requests.
SecurityGroupRulesXMLDeserializer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SecurityGroupRulesXMLDeserializer: """Deserializer to handle xml-formatted security group requests.""" def create(self, string): """Deserialize an xml-formatted security group create request""" <|body_0|> def _extract_security_group_rule(self, node): """Marshal t...
stack_v2_sparse_classes_36k_train_020511
22,481
permissive
[ { "docstring": "Deserialize an xml-formatted security group create request", "name": "create", "signature": "def create(self, string)" }, { "docstring": "Marshal the security group rule attribute of a parsed request", "name": "_extract_security_group_rule", "signature": "def _extract_sec...
2
stack_v2_sparse_classes_30k_val_000821
Implement the Python class `SecurityGroupRulesXMLDeserializer` described below. Class description: Deserializer to handle xml-formatted security group requests. Method signatures and docstrings: - def create(self, string): Deserialize an xml-formatted security group create request - def _extract_security_group_rule(s...
Implement the Python class `SecurityGroupRulesXMLDeserializer` described below. Class description: Deserializer to handle xml-formatted security group requests. Method signatures and docstrings: - def create(self, string): Deserialize an xml-formatted security group create request - def _extract_security_group_rule(s...
1a3d7575d4b341f64fa1764ed47e47a7504a9bcc
<|skeleton|> class SecurityGroupRulesXMLDeserializer: """Deserializer to handle xml-formatted security group requests.""" def create(self, string): """Deserialize an xml-formatted security group create request""" <|body_0|> def _extract_security_group_rule(self, node): """Marshal t...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SecurityGroupRulesXMLDeserializer: """Deserializer to handle xml-formatted security group requests.""" def create(self, string): """Deserialize an xml-formatted security group create request""" dom = minidom.parseString(string) security_group_rule = self._extract_security_group_ru...
the_stack_v2_python_sparse
stack/nova/nova/api/openstack/contrib/security_groups.py
ashokcse/openstack-bill
train
5
922c051951c2b0c935488685dff8d0a3c0e28648
[ "dict_ = cls._numbers\nif len(number) <= 2 and dict_.get(int(number)):\n string = dict_.get(int(number))\nelif int(number) < 40 and number[1] == '0':\n string = f'{dict_.get(int(number[0]))}дцать'\nelif int(number) < 40 and number[1] != '0':\n string = f'{dict_.get(int(number[0]))}дцать {dict_.get(int(numb...
<|body_start_0|> dict_ = cls._numbers if len(number) <= 2 and dict_.get(int(number)): string = dict_.get(int(number)) elif int(number) < 40 and number[1] == '0': string = f'{dict_.get(int(number[0]))}дцать' elif int(number) < 40 and number[1] != '0': s...
RepresentNumberFrom_1_To_99
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RepresentNumberFrom_1_To_99: def str(cls, number): """Return number in words for number in appropriate range""" <|body_0|> def update_list_of_functionality(cls): """Add method str to the list of functionality and propagate invokation of the method to the child class"...
stack_v2_sparse_classes_36k_train_020512
9,968
no_license
[ { "docstring": "Return number in words for number in appropriate range", "name": "str", "signature": "def str(cls, number)" }, { "docstring": "Add method str to the list of functionality and propagate invokation of the method to the child class", "name": "update_list_of_functionality", "...
2
stack_v2_sparse_classes_30k_train_011687
Implement the Python class `RepresentNumberFrom_1_To_99` described below. Class description: Implement the RepresentNumberFrom_1_To_99 class. Method signatures and docstrings: - def str(cls, number): Return number in words for number in appropriate range - def update_list_of_functionality(cls): Add method str to the ...
Implement the Python class `RepresentNumberFrom_1_To_99` described below. Class description: Implement the RepresentNumberFrom_1_To_99 class. Method signatures and docstrings: - def str(cls, number): Return number in words for number in appropriate range - def update_list_of_functionality(cls): Add method str to the ...
5992788fdf1f38272f0ff31ae9ebf944774d6894
<|skeleton|> class RepresentNumberFrom_1_To_99: def str(cls, number): """Return number in words for number in appropriate range""" <|body_0|> def update_list_of_functionality(cls): """Add method str to the list of functionality and propagate invokation of the method to the child class"...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RepresentNumberFrom_1_To_99: def str(cls, number): """Return number in words for number in appropriate range""" dict_ = cls._numbers if len(number) <= 2 and dict_.get(int(number)): string = dict_.get(int(number)) elif int(number) < 40 and number[1] == '0': ...
the_stack_v2_python_sparse
task5.py
AntonAmu/Dp-207-python_Anton
train
0
861168420e282f74628ff391f8e2c18636782e95
[ "assert not np.isinf(domain[1])\nself.x_pts, self.dx = get_asymmetric_interval_points(domain, max_nof_coefficients, interval_type=interval_type, get_spacing=True, **kwargs)\ntry:\n self.ignore_zeros = kwargs['ignore_zeros']\nexcept KeyError:\n self.ignore_zeros = False\nself.J = J\nself.interval_type = interv...
<|body_start_0|> assert not np.isinf(domain[1]) self.x_pts, self.dx = get_asymmetric_interval_points(domain, max_nof_coefficients, interval_type=interval_type, get_spacing=True, **kwargs) try: self.ignore_zeros = kwargs['ignore_zeros'] except KeyError: self.ignore...
TrapzDiscretizedAsymmetricBath
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TrapzDiscretizedAsymmetricBath: def __init__(self, J, domain, max_nof_coefficients=100, interval_type='lin', **kwargs): """Generates direct discretization coefficients from a spectral density J, by computing the integrals: gamma_i = sqrt(int_i^i+1 J(x) dx) xi_i = int_i^i+1 J(x) * x dx/ g...
stack_v2_sparse_classes_36k_train_020513
3,530
permissive
[ { "docstring": "Generates direct discretization coefficients from a spectral density J, by computing the integrals: gamma_i = sqrt(int_i^i+1 J(x) dx) xi_i = int_i^i+1 J(x) * x dx/ gamma_i^2 :param J: Spectral density. A function defined on 'domain', must be >0 in the inner part of domain :param domain: List/tup...
2
stack_v2_sparse_classes_30k_val_000535
Implement the Python class `TrapzDiscretizedAsymmetricBath` described below. Class description: Implement the TrapzDiscretizedAsymmetricBath class. Method signatures and docstrings: - def __init__(self, J, domain, max_nof_coefficients=100, interval_type='lin', **kwargs): Generates direct discretization coefficients f...
Implement the Python class `TrapzDiscretizedAsymmetricBath` described below. Class description: Implement the TrapzDiscretizedAsymmetricBath class. Method signatures and docstrings: - def __init__(self, J, domain, max_nof_coefficients=100, interval_type='lin', **kwargs): Generates direct discretization coefficients f...
daf37f522f8acb6af2285d44f39cab31f34b01a4
<|skeleton|> class TrapzDiscretizedAsymmetricBath: def __init__(self, J, domain, max_nof_coefficients=100, interval_type='lin', **kwargs): """Generates direct discretization coefficients from a spectral density J, by computing the integrals: gamma_i = sqrt(int_i^i+1 J(x) dx) xi_i = int_i^i+1 J(x) * x dx/ g...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TrapzDiscretizedAsymmetricBath: def __init__(self, J, domain, max_nof_coefficients=100, interval_type='lin', **kwargs): """Generates direct discretization coefficients from a spectral density J, by computing the integrals: gamma_i = sqrt(int_i^i+1 J(x) dx) xi_i = int_i^i+1 J(x) * x dx/ gamma_i^2 :para...
the_stack_v2_python_sparse
mapping/star/discretized_bath/asymmetric_trapz.py
fhoeb/py-mapping
train
2
861178ff18b6ad503457dad7141f03bec4b48e3a
[ "logger.info('iNPS Peak Caller')\nTool.__init__(self)\nif configuration is None:\n configuration = {}\nself.configuration.update(configuration)", "bed_file = bam_file + '.bed'\ncommand_line_1 = 'bedtools bamtobed -i ' + bam_file\ncommand_line_2 = 'iNPS ' + ' '.join(inps_params)\ncommand_line_2 = command_line_2...
<|body_start_0|> logger.info('iNPS Peak Caller') Tool.__init__(self) if configuration is None: configuration = {} self.configuration.update(configuration) <|end_body_0|> <|body_start_1|> bed_file = bam_file + '.bed' command_line_1 = 'bedtools bamtobed -i ' + ...
Tool for peak calling for MNase-seq data
inps
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class inps: """Tool for peak calling for MNase-seq data""" def __init__(self, configuration=None): """Initialise the tool with its configuration. Parameters ---------- configuration : dict a dictionary containing parameters that define how the operation should be carried out, which are spe...
stack_v2_sparse_classes_36k_train_020514
5,797
permissive
[ { "docstring": "Initialise the tool with its configuration. Parameters ---------- configuration : dict a dictionary containing parameters that define how the operation should be carried out, which are specific to each Tool.", "name": "__init__", "signature": "def __init__(self, configuration=None)" },...
3
stack_v2_sparse_classes_30k_train_013750
Implement the Python class `inps` described below. Class description: Tool for peak calling for MNase-seq data Method signatures and docstrings: - def __init__(self, configuration=None): Initialise the tool with its configuration. Parameters ---------- configuration : dict a dictionary containing parameters that defi...
Implement the Python class `inps` described below. Class description: Tool for peak calling for MNase-seq data Method signatures and docstrings: - def __init__(self, configuration=None): Initialise the tool with its configuration. Parameters ---------- configuration : dict a dictionary containing parameters that defi...
50c7115c0c1a6af48dc34f275e469d1b9eb02999
<|skeleton|> class inps: """Tool for peak calling for MNase-seq data""" def __init__(self, configuration=None): """Initialise the tool with its configuration. Parameters ---------- configuration : dict a dictionary containing parameters that define how the operation should be carried out, which are spe...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class inps: """Tool for peak calling for MNase-seq data""" def __init__(self, configuration=None): """Initialise the tool with its configuration. Parameters ---------- configuration : dict a dictionary containing parameters that define how the operation should be carried out, which are specific to each...
the_stack_v2_python_sparse
tool/inps.py
Multiscale-Genomics/mg-process-fastq
train
2
00e5e0d509c9a17bf7bb6083ef0d9be41c42e90a
[ "enter_app_manual()\nglobal case_flag\ncase_flag = False\nbrowser.pre_check()\nif not test_suit_browser.BOOL_STK_WIFI_CHECK:\n start_activity('com.android.settings', '.Settings')\n settings.disable_wifi()\nif not is_cdma():\n start_activity('com.android.settings', '.Settings')\n settings.set_default_dat...
<|body_start_0|> enter_app_manual() global case_flag case_flag = False browser.pre_check() if not test_suit_browser.BOOL_STK_WIFI_CHECK: start_activity('com.android.settings', '.Settings') settings.disable_wifi() if not is_cdma(): start...
test_suit_browser_case2 is a class for browser case. @see: L{TestCaseBase <TestCaseBase>}
test_suit_browser_case2
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class test_suit_browser_case2: """test_suit_browser_case2 is a class for browser case. @see: L{TestCaseBase <TestCaseBase>}""" def test_case_main(self, case_results): """main entry. @type case_results: tuple @param case_results: record some case result information""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_020515
2,773
no_license
[ { "docstring": "main entry. @type case_results: tuple @param case_results: record some case result information", "name": "test_case_main", "signature": "def test_case_main(self, case_results)" }, { "docstring": "record the case result", "name": "test_case_end", "signature": "def test_cas...
2
null
Implement the Python class `test_suit_browser_case2` described below. Class description: test_suit_browser_case2 is a class for browser case. @see: L{TestCaseBase <TestCaseBase>} Method signatures and docstrings: - def test_case_main(self, case_results): main entry. @type case_results: tuple @param case_results: reco...
Implement the Python class `test_suit_browser_case2` described below. Class description: test_suit_browser_case2 is a class for browser case. @see: L{TestCaseBase <TestCaseBase>} Method signatures and docstrings: - def test_case_main(self, case_results): main entry. @type case_results: tuple @param case_results: reco...
a04b717ae437511abae1e7e9e399373c161a7b65
<|skeleton|> class test_suit_browser_case2: """test_suit_browser_case2 is a class for browser case. @see: L{TestCaseBase <TestCaseBase>}""" def test_case_main(self, case_results): """main entry. @type case_results: tuple @param case_results: record some case result information""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class test_suit_browser_case2: """test_suit_browser_case2 is a class for browser case. @see: L{TestCaseBase <TestCaseBase>}""" def test_case_main(self, case_results): """main entry. @type case_results: tuple @param case_results: record some case result information""" enter_app_manual() ...
the_stack_v2_python_sparse
test_env/test_suit_browser/test_suit_browser_case2.py
wwlwwlqaz/Qualcomm
train
1
30adfa153b5bfe7124ab0c9793504dc8e331680a
[ "if atom.IsInRing():\n return True\ncount = self.depth_first_search_for_ring(atom)\nreturn count > 1", "count = 0\nfor nbor in atom.GetAtoms():\n visited = set()\n visited.add(atom)\n if nbor.IsInRing() or self.traverse_for_ring(visited, nbor):\n count += 1\nreturn count", "visited.add(atom)\...
<|body_start_0|> if atom.IsInRing(): return True count = self.depth_first_search_for_ring(atom) return count > 1 <|end_body_0|> <|body_start_1|> count = 0 for nbor in atom.GetAtoms(): visited = set() visited.add(atom) if nbor.IsInR...
Test if an atom is part of the Murcko scaffold of a molecule.
IsInScaffold
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IsInScaffold: """Test if an atom is part of the Murcko scaffold of a molecule.""" def __call__(self, atom): """Check whether an atom is in the Murcko scaffold. Parameters ---------- atom : OEAtom Atom.""" <|body_0|> def depth_first_search_for_ring(self, atom): ""...
stack_v2_sparse_classes_36k_train_020516
3,664
permissive
[ { "docstring": "Check whether an atom is in the Murcko scaffold. Parameters ---------- atom : OEAtom Atom.", "name": "__call__", "signature": "def __call__(self, atom)" }, { "docstring": "Perform a depth-first search to count the number of rings that are directly or indirectly connected to an at...
3
stack_v2_sparse_classes_30k_train_016640
Implement the Python class `IsInScaffold` described below. Class description: Test if an atom is part of the Murcko scaffold of a molecule. Method signatures and docstrings: - def __call__(self, atom): Check whether an atom is in the Murcko scaffold. Parameters ---------- atom : OEAtom Atom. - def depth_first_search_...
Implement the Python class `IsInScaffold` described below. Class description: Test if an atom is part of the Murcko scaffold of a molecule. Method signatures and docstrings: - def __call__(self, atom): Check whether an atom is in the Murcko scaffold. Parameters ---------- atom : OEAtom Atom. - def depth_first_search_...
a6af3686c82a5d1d6b68341fe5e5b16e8e4ed356
<|skeleton|> class IsInScaffold: """Test if an atom is part of the Murcko scaffold of a molecule.""" def __call__(self, atom): """Check whether an atom is in the Murcko scaffold. Parameters ---------- atom : OEAtom Atom.""" <|body_0|> def depth_first_search_for_ring(self, atom): ""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class IsInScaffold: """Test if an atom is part of the Murcko scaffold of a molecule.""" def __call__(self, atom): """Check whether an atom is in the Murcko scaffold. Parameters ---------- atom : OEAtom Atom.""" if atom.IsInRing(): return True count = self.depth_first_search_...
the_stack_v2_python_sparse
oe_utils/chem/scaffold.py
skearnes/color-features
train
5
5927366327e8e5a9229ff4e941d989e024abe33b
[ "self.args = args\nself.actions_dict = {}\nself.first_call = True\nself.MAX_DEPTH = 0", "self.first_call = False\nself.nb_agent = state.getNumAgents()\nx = max(state.getWalls().asList())\nnb_cell = x[0] * x[1]\nif nb_cell <= 20:\n self.MAX_DEPTH = 4\nelif 21 < nb_cell <= 40:\n self.MAX_DEPTH = 3\nelif 41 < ...
<|body_start_0|> self.args = args self.actions_dict = {} self.first_call = True self.MAX_DEPTH = 0 <|end_body_0|> <|body_start_1|> self.first_call = False self.nb_agent = state.getNumAgents() x = max(state.getWalls().asList()) nb_cell = x[0] * x[1] ...
PacmanAgent
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PacmanAgent: def __init__(self, args): """Arguments: ---------- - `args`: Namespace of arguments from command-line prompt.""" <|body_0|> def initVariable(self, state): """Given a pacman game state, initialise the class variables Arguments: ---------- - `state`: the c...
stack_v2_sparse_classes_36k_train_020517
12,574
no_license
[ { "docstring": "Arguments: ---------- - `args`: Namespace of arguments from command-line prompt.", "name": "__init__", "signature": "def __init__(self, args)" }, { "docstring": "Given a pacman game state, initialise the class variables Arguments: ---------- - `state`: the current game state.", ...
5
stack_v2_sparse_classes_30k_train_008246
Implement the Python class `PacmanAgent` described below. Class description: Implement the PacmanAgent class. Method signatures and docstrings: - def __init__(self, args): Arguments: ---------- - `args`: Namespace of arguments from command-line prompt. - def initVariable(self, state): Given a pacman game state, initi...
Implement the Python class `PacmanAgent` described below. Class description: Implement the PacmanAgent class. Method signatures and docstrings: - def __init__(self, args): Arguments: ---------- - `args`: Namespace of arguments from command-line prompt. - def initVariable(self, state): Given a pacman game state, initi...
d0914255dfc71d524f490b060d3f17a9b027da02
<|skeleton|> class PacmanAgent: def __init__(self, args): """Arguments: ---------- - `args`: Namespace of arguments from command-line prompt.""" <|body_0|> def initVariable(self, state): """Given a pacman game state, initialise the class variables Arguments: ---------- - `state`: the c...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PacmanAgent: def __init__(self, args): """Arguments: ---------- - `args`: Namespace of arguments from command-line prompt.""" self.args = args self.actions_dict = {} self.first_call = True self.MAX_DEPTH = 0 def initVariable(self, state): """Given a pacman ...
the_stack_v2_python_sparse
P2/hminimax.py
nDerroitte/INFO8006-1-Pacman-IA
train
1
080c5198932f7f177d27a684401b59c6521573d1
[ "self.schema = schema\nself.fragments = fragments\nself.operation = operation\nself.context = context\nself.root_value = root_value\nself.variable_values = variable_values\nself.errors: List['TartifletteError'] = []", "exceptions = raw_exception.exceptions if isinstance(raw_exception, MultipleException) else [raw...
<|body_start_0|> self.schema = schema self.fragments = fragments self.operation = operation self.context = context self.root_value = root_value self.variable_values = variable_values self.errors: List['TartifletteError'] = [] <|end_body_0|> <|body_start_1|> ...
Utility class containing all the information needed to run an end-to-end GraphQL request.
ExecutionContext
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ExecutionContext: """Utility class containing all the information needed to run an end-to-end GraphQL request.""" def __init__(self, schema: 'GraphQLSchema', fragments: Dict[str, 'FragmentDefinitionNode'], operation: 'OperationDefinitionNode', context: Optional[Any], root_value: Optional[Any...
stack_v2_sparse_classes_36k_train_020518
6,455
permissive
[ { "docstring": ":param schema: the GraphQLSchema instance linked to the engine :param fragments: the dictionary of fragment definition AST node contained in the request :param operation: the AST operation definition node to execute :param context: value that can contain everything you need and that will be acce...
2
null
Implement the Python class `ExecutionContext` described below. Class description: Utility class containing all the information needed to run an end-to-end GraphQL request. Method signatures and docstrings: - def __init__(self, schema: 'GraphQLSchema', fragments: Dict[str, 'FragmentDefinitionNode'], operation: 'Operat...
Implement the Python class `ExecutionContext` described below. Class description: Utility class containing all the information needed to run an end-to-end GraphQL request. Method signatures and docstrings: - def __init__(self, schema: 'GraphQLSchema', fragments: Dict[str, 'FragmentDefinitionNode'], operation: 'Operat...
421c1e937f553d6a5bf2f30154022c0d77053cfb
<|skeleton|> class ExecutionContext: """Utility class containing all the information needed to run an end-to-end GraphQL request.""" def __init__(self, schema: 'GraphQLSchema', fragments: Dict[str, 'FragmentDefinitionNode'], operation: 'OperationDefinitionNode', context: Optional[Any], root_value: Optional[Any...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ExecutionContext: """Utility class containing all the information needed to run an end-to-end GraphQL request.""" def __init__(self, schema: 'GraphQLSchema', fragments: Dict[str, 'FragmentDefinitionNode'], operation: 'OperationDefinitionNode', context: Optional[Any], root_value: Optional[Any], variable_v...
the_stack_v2_python_sparse
tartiflette/execution/context.py
tartiflette/tartiflette
train
586
cba7ae0c95294becc7d3c7b767dae8e1ac43eedb
[ "super(QDockFrameLayout, self).__init__(parent)\nself._size_hint = QSize()\nself._min_size = QSize()\nself._max_size = QSize()", "super(QDockFrameLayout, self).invalidate()\nself._size_hint = QSize()\nself._min_size = QSize()\nself._max_size = QSize()", "hint = self._size_hint\nif hint.isValid():\n return hi...
<|body_start_0|> super(QDockFrameLayout, self).__init__(parent) self._size_hint = QSize() self._min_size = QSize() self._max_size = QSize() <|end_body_0|> <|body_start_1|> super(QDockFrameLayout, self).invalidate() self._size_hint = QSize() self._min_size = QSize...
A single widget layout for dock frames. This class is used by the docking framework and is not intended for direct use by user code.
QDockFrameLayout
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class QDockFrameLayout: """A single widget layout for dock frames. This class is used by the docking framework and is not intended for direct use by user code.""" def __init__(self, parent=None): """Initialize a QDockFrameLayout. Parameters ---------- parent : QWidget or None The parent wi...
stack_v2_sparse_classes_36k_train_020519
2,406
permissive
[ { "docstring": "Initialize a QDockFrameLayout. Parameters ---------- parent : QWidget or None The parent widget owner of the layout.", "name": "__init__", "signature": "def __init__(self, parent=None)" }, { "docstring": "Invalidate the cached layout data.", "name": "invalidate", "signatu...
5
null
Implement the Python class `QDockFrameLayout` described below. Class description: A single widget layout for dock frames. This class is used by the docking framework and is not intended for direct use by user code. Method signatures and docstrings: - def __init__(self, parent=None): Initialize a QDockFrameLayout. Par...
Implement the Python class `QDockFrameLayout` described below. Class description: A single widget layout for dock frames. This class is used by the docking framework and is not intended for direct use by user code. Method signatures and docstrings: - def __init__(self, parent=None): Initialize a QDockFrameLayout. Par...
1544e7fb371b8f941cfa2fde682795e479380284
<|skeleton|> class QDockFrameLayout: """A single widget layout for dock frames. This class is used by the docking framework and is not intended for direct use by user code.""" def __init__(self, parent=None): """Initialize a QDockFrameLayout. Parameters ---------- parent : QWidget or None The parent wi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class QDockFrameLayout: """A single widget layout for dock frames. This class is used by the docking framework and is not intended for direct use by user code.""" def __init__(self, parent=None): """Initialize a QDockFrameLayout. Parameters ---------- parent : QWidget or None The parent widget owner of...
the_stack_v2_python_sparse
enaml/qt/docking/q_dock_frame_layout.py
MatthieuDartiailh/enaml
train
26
1a246b5f0f6da16c971189b2759f5e7ffd9c3cbf
[ "i, n = (0, len(s))\nfor j in range(n - 1, -1, -1):\n if s[i] == s[j]:\n i += 1\n print(i, j)\nif i == n:\n return s\nrem = s[i:]\nprint(i, rem)\nreturn rem[::-1] + self.shortestPalindrome(s[:i]) + s[i:]", "r = s[::-1]\nfor i in range(len(s) + 1):\n if s.startswith(r[i:]):\n return r...
<|body_start_0|> i, n = (0, len(s)) for j in range(n - 1, -1, -1): if s[i] == s[j]: i += 1 print(i, j) if i == n: return s rem = s[i:] print(i, rem) return rem[::-1] + self.shortestPalindrome(s[:i]) + s[i:] <|end_bod...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def shortestPalindrome(self, s): """:type s: str :rtype: str""" <|body_0|> def shortestPalindrome2(self, s): """:type s: str :rtype: str""" <|body_1|> def shortestPalindromeKMP(self, s): """:type s: str :rtype: str""" <|body_2|>...
stack_v2_sparse_classes_36k_train_020520
2,171
no_license
[ { "docstring": ":type s: str :rtype: str", "name": "shortestPalindrome", "signature": "def shortestPalindrome(self, s)" }, { "docstring": ":type s: str :rtype: str", "name": "shortestPalindrome2", "signature": "def shortestPalindrome2(self, s)" }, { "docstring": ":type s: str :rt...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def shortestPalindrome(self, s): :type s: str :rtype: str - def shortestPalindrome2(self, s): :type s: str :rtype: str - def shortestPalindromeKMP(self, s): :type s: str :rtype: ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def shortestPalindrome(self, s): :type s: str :rtype: str - def shortestPalindrome2(self, s): :type s: str :rtype: str - def shortestPalindromeKMP(self, s): :type s: str :rtype: ...
810575368ecffa97677bdb51744d1f716140bbb1
<|skeleton|> class Solution: def shortestPalindrome(self, s): """:type s: str :rtype: str""" <|body_0|> def shortestPalindrome2(self, s): """:type s: str :rtype: str""" <|body_1|> def shortestPalindromeKMP(self, s): """:type s: str :rtype: str""" <|body_2|>...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def shortestPalindrome(self, s): """:type s: str :rtype: str""" i, n = (0, len(s)) for j in range(n - 1, -1, -1): if s[i] == s[j]: i += 1 print(i, j) if i == n: return s rem = s[i:] print(i, rem) ...
the_stack_v2_python_sparse
S/ShortestPalindrome.py
bssrdf/pyleet
train
2
7566277fbe5b4aa47cb2e1ce09af0cf0711df3d1
[ "encoding = jnp.ones(shape=(self.bsz, self.seq_len, self.model_dim), dtype=self.dtype)\nattention_mask = jnp.ones(shape=(self.bsz, self.seq_len), dtype=self.dtype)\nmodel = transformer.TransformerLayer(model_dim=self.model_dim, intermediate_dim=self.intermediate_dim, num_heads=self.num_heads, dropout_rate=self.drop...
<|body_start_0|> encoding = jnp.ones(shape=(self.bsz, self.seq_len, self.model_dim), dtype=self.dtype) attention_mask = jnp.ones(shape=(self.bsz, self.seq_len), dtype=self.dtype) model = transformer.TransformerLayer(model_dim=self.model_dim, intermediate_dim=self.intermediate_dim, num_heads=self...
Transformer layer test.
TransformerTest
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TransformerTest: """Transformer layer test.""" def test_transformer_layer_shape(self): """Testing transformer layer shape.""" <|body_0|> def test_transformer_block_shape(self): """Testing transformer block shape.""" <|body_1|> <|end_skeleton|> <|body_st...
stack_v2_sparse_classes_36k_train_020521
2,562
permissive
[ { "docstring": "Testing transformer layer shape.", "name": "test_transformer_layer_shape", "signature": "def test_transformer_layer_shape(self)" }, { "docstring": "Testing transformer block shape.", "name": "test_transformer_block_shape", "signature": "def test_transformer_block_shape(se...
2
null
Implement the Python class `TransformerTest` described below. Class description: Transformer layer test. Method signatures and docstrings: - def test_transformer_layer_shape(self): Testing transformer layer shape. - def test_transformer_block_shape(self): Testing transformer block shape.
Implement the Python class `TransformerTest` described below. Class description: Transformer layer test. Method signatures and docstrings: - def test_transformer_layer_shape(self): Testing transformer layer shape. - def test_transformer_block_shape(self): Testing transformer block shape. <|skeleton|> class Transform...
ac9447064195e06de48cc91ff642f7fffa28ffe8
<|skeleton|> class TransformerTest: """Transformer layer test.""" def test_transformer_layer_shape(self): """Testing transformer layer shape.""" <|body_0|> def test_transformer_block_shape(self): """Testing transformer block shape.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TransformerTest: """Transformer layer test.""" def test_transformer_layer_shape(self): """Testing transformer layer shape.""" encoding = jnp.ones(shape=(self.bsz, self.seq_len, self.model_dim), dtype=self.dtype) attention_mask = jnp.ones(shape=(self.bsz, self.seq_len), dtype=self....
the_stack_v2_python_sparse
language/mentionmemory/modules/transformer_test.py
google-research/language
train
1,567
8163b7602588f699b3e0958e0d6ebfd6b0b6053a
[ "self.d = {}\nfor idx, word in enumerate(words):\n if word not in self.d:\n self.d[word] = [idx]\n else:\n self.d[word].append(idx)", "list1, list2 = (self.d[word1], self.d[word2])\nresult, c1, c2 = (float('inf'), 0, 0)\nwhile c1 < len(list1) and c2 < len(list2):\n if list1[c1] < list2[c2]:...
<|body_start_0|> self.d = {} for idx, word in enumerate(words): if word not in self.d: self.d[word] = [idx] else: self.d[word].append(idx) <|end_body_0|> <|body_start_1|> list1, list2 = (self.d[word1], self.d[word2]) result, c1, c2...
WordDistance
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WordDistance: def __init__(self, words): """:type words: List[str]""" <|body_0|> def shortest(self, word1, word2): """:type word1: str :type word2: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.d = {} for idx, word in ...
stack_v2_sparse_classes_36k_train_020522
1,821
no_license
[ { "docstring": ":type words: List[str]", "name": "__init__", "signature": "def __init__(self, words)" }, { "docstring": ":type word1: str :type word2: str :rtype: int", "name": "shortest", "signature": "def shortest(self, word1, word2)" } ]
2
null
Implement the Python class `WordDistance` described below. Class description: Implement the WordDistance class. Method signatures and docstrings: - def __init__(self, words): :type words: List[str] - def shortest(self, word1, word2): :type word1: str :type word2: str :rtype: int
Implement the Python class `WordDistance` described below. Class description: Implement the WordDistance class. Method signatures and docstrings: - def __init__(self, words): :type words: List[str] - def shortest(self, word1, word2): :type word1: str :type word2: str :rtype: int <|skeleton|> class WordDistance: ...
dd268af242d18bc2fd9527661c71d2e51af1039d
<|skeleton|> class WordDistance: def __init__(self, words): """:type words: List[str]""" <|body_0|> def shortest(self, word1, word2): """:type word1: str :type word2: str :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WordDistance: def __init__(self, words): """:type words: List[str]""" self.d = {} for idx, word in enumerate(words): if word not in self.d: self.d[word] = [idx] else: self.d[word].append(idx) def shortest(self, word1, word2):...
the_stack_v2_python_sparse
Categories/No_Fucking_Clue/RRR244.Shortest_Word_Distance_II.py
HotsauceLee/Leetcode
train
2
01c9b2533fdc8b368cad4fd2cd0d3d3d2606ec4d
[ "w = [(x2 - x1 + 1) * (y2 - y1 + 1) for x1, y1, x2, y2 in rects]\nself.weights = [i / sum(w) for i in accumulate(w)]\nself.rects = rects", "n_rect = bisect.bisect(self.weights, random.random())\nx1, y1, x2, y2 = self.rects[n_rect]\nreturn [random.randint(x1, x2), random.randint(y1, y2)]" ]
<|body_start_0|> w = [(x2 - x1 + 1) * (y2 - y1 + 1) for x1, y1, x2, y2 in rects] self.weights = [i / sum(w) for i in accumulate(w)] self.rects = rects <|end_body_0|> <|body_start_1|> n_rect = bisect.bisect(self.weights, random.random()) x1, y1, x2, y2 = self.rects[n_rect] ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def __init__(self, rects): """:type rects: List[List[int]]""" <|body_0|> def pick(self): """:rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> w = [(x2 - x1 + 1) * (y2 - y1 + 1) for x1, y1, x2, y2 in rects] self.weig...
stack_v2_sparse_classes_36k_train_020523
1,355
no_license
[ { "docstring": ":type rects: List[List[int]]", "name": "__init__", "signature": "def __init__(self, rects)" }, { "docstring": ":rtype: List[int]", "name": "pick", "signature": "def pick(self)" } ]
2
stack_v2_sparse_classes_30k_train_014171
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, rects): :type rects: List[List[int]] - def pick(self): :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, rects): :type rects: List[List[int]] - def pick(self): :rtype: List[int] <|skeleton|> class Solution: def __init__(self, rects): """:type rects: ...
f93380721b8383817fe2b0d728deca1321c9ef45
<|skeleton|> class Solution: def __init__(self, rects): """:type rects: List[List[int]]""" <|body_0|> def pick(self): """:rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def __init__(self, rects): """:type rects: List[List[int]]""" w = [(x2 - x1 + 1) * (y2 - y1 + 1) for x1, y1, x2, y2 in rects] self.weights = [i / sum(w) for i in accumulate(w)] self.rects = rects def pick(self): """:rtype: List[int]""" n_rect = bi...
the_stack_v2_python_sparse
explore/2020/august/Random_Point_in_Non-overlapping_Rectangles.2.py
lixiang2017/leetcode
train
5
baae2d126980579124c690513037aae4b633096d
[ "res = []\ntotal = 0\nwhile head:\n total += 1\n res.append(head.val)\n head = head.next\nfor i in range(total // 2):\n if res[i] != res[-i - 1]:\n return False\nreturn True", "res = []\ntotal = 0\nwhile head:\n total += 1\n res.append(head.val)\n head = head.next\nreturn res == res[::...
<|body_start_0|> res = [] total = 0 while head: total += 1 res.append(head.val) head = head.next for i in range(total // 2): if res[i] != res[-i - 1]: return False return True <|end_body_0|> <|body_start_1|> ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def isPalindrome(self, head: ListNode) -> bool: """先遍历链表,然后再进行判断 空间复杂度O(n) 时间复杂度O(n) :param head: 单链表 :return: bool True False""" <|body_0|> def isPalindromeMethod1(self, head: ListNode) -> bool: """先遍历链表,然后再进行判断 空间复杂度O(n) 时间复杂度O(n) :param head: 单链表 :return...
stack_v2_sparse_classes_36k_train_020524
1,748
no_license
[ { "docstring": "先遍历链表,然后再进行判断 空间复杂度O(n) 时间复杂度O(n) :param head: 单链表 :return: bool True False", "name": "isPalindrome", "signature": "def isPalindrome(self, head: ListNode) -> bool" }, { "docstring": "先遍历链表,然后再进行判断 空间复杂度O(n) 时间复杂度O(n) :param head: 单链表 :return: bool True False", "name": "isPali...
2
stack_v2_sparse_classes_30k_train_016204
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def isPalindrome(self, head: ListNode) -> bool: 先遍历链表,然后再进行判断 空间复杂度O(n) 时间复杂度O(n) :param head: 单链表 :return: bool True False - def isPalindromeMethod1(self, head: ListNode) -> boo...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def isPalindrome(self, head: ListNode) -> bool: 先遍历链表,然后再进行判断 空间复杂度O(n) 时间复杂度O(n) :param head: 单链表 :return: bool True False - def isPalindromeMethod1(self, head: ListNode) -> boo...
af13162360a28a0bcd71918fd8bff77c41ddcc2a
<|skeleton|> class Solution: def isPalindrome(self, head: ListNode) -> bool: """先遍历链表,然后再进行判断 空间复杂度O(n) 时间复杂度O(n) :param head: 单链表 :return: bool True False""" <|body_0|> def isPalindromeMethod1(self, head: ListNode) -> bool: """先遍历链表,然后再进行判断 空间复杂度O(n) 时间复杂度O(n) :param head: 单链表 :return...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def isPalindrome(self, head: ListNode) -> bool: """先遍历链表,然后再进行判断 空间复杂度O(n) 时间复杂度O(n) :param head: 单链表 :return: bool True False""" res = [] total = 0 while head: total += 1 res.append(head.val) head = head.next for i in range...
the_stack_v2_python_sparse
算法分析和归类/链表/回文链表.py
Carmenliukang/leetcode
train
4
0f065cc62950dd0d4b1e42b7e5eb47ba1562811f
[ "super(Transformer, self).__init__()\nself.encoder = Encoder(N, dm, h, hidden, input_vocab, max_seq_input, drop_rate)\nself.decoder = Decoder(N, dm, h, hidden, target_vocab, max_seq_target, drop_rate)\nself.linear = tf.keras.layers.Dense(target_vocab)", "enc = self.encoder(inputs, training, encoder_mask)\ndec = s...
<|body_start_0|> super(Transformer, self).__init__() self.encoder = Encoder(N, dm, h, hidden, input_vocab, max_seq_input, drop_rate) self.decoder = Decoder(N, dm, h, hidden, target_vocab, max_seq_target, drop_rate) self.linear = tf.keras.layers.Dense(target_vocab) <|end_body_0|> <|body_...
a transformer network
Transformer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Transformer: """a transformer network""" def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1): """initialization""" <|body_0|> def call(self, inputs, target, training, encoder_mask, look_ahead_mask, decoder_mask): ...
stack_v2_sparse_classes_36k_train_020525
1,355
no_license
[ { "docstring": "initialization", "name": "__init__", "signature": "def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1)" }, { "docstring": "call function", "name": "call", "signature": "def call(self, inputs, target, training, enco...
2
stack_v2_sparse_classes_30k_train_007906
Implement the Python class `Transformer` described below. Class description: a transformer network Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1): initialization - def call(self, inputs, target, training, encoder_mask, ...
Implement the Python class `Transformer` described below. Class description: a transformer network Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1): initialization - def call(self, inputs, target, training, encoder_mask, ...
16dc37d1c6dc00a271053b60724c51763914029a
<|skeleton|> class Transformer: """a transformer network""" def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1): """initialization""" <|body_0|> def call(self, inputs, target, training, encoder_mask, look_ahead_mask, decoder_mask): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Transformer: """a transformer network""" def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1): """initialization""" super(Transformer, self).__init__() self.encoder = Encoder(N, dm, h, hidden, input_vocab, max_seq_input, dro...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/11-transformer.py
jaycer95/holbertonschool-machine_learning
train
0
1a327a9baf0e8679700c937f96f46ea003a09a11
[ "self.drop_pdbs_if_exists = drop_pdbs_if_exists\nself.existing_cdb = existing_cdb\nself.include_in_restore = include_in_restore\nself.pdb_entity_info_vec = pdb_entity_info_vec\nself.rename_pdb_map = rename_pdb_map", "if dictionary is None:\n return None\ndrop_pdbs_if_exists = dictionary.get('dropPdbsIfExists')...
<|body_start_0|> self.drop_pdbs_if_exists = drop_pdbs_if_exists self.existing_cdb = existing_cdb self.include_in_restore = include_in_restore self.pdb_entity_info_vec = pdb_entity_info_vec self.rename_pdb_map = rename_pdb_map <|end_body_0|> <|body_start_1|> if dictionary...
Implementation of the 'PDBRestoreParam' model. TODO: type description here. Attributes: drop_pdbs_if_exists (bool): During the restore workflow, drop the pdb if the same name pdb exists. existing_cdb (bool): Restore given list of pdbs to an existing CDB. include_in_restore (bool): Whether or not to restore the PDB when...
PDBRestoreParam
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PDBRestoreParam: """Implementation of the 'PDBRestoreParam' model. TODO: type description here. Attributes: drop_pdbs_if_exists (bool): During the restore workflow, drop the pdb if the same name pdb exists. existing_cdb (bool): Restore given list of pdbs to an existing CDB. include_in_restore (bo...
stack_v2_sparse_classes_36k_train_020526
3,630
permissive
[ { "docstring": "Constructor for the PDBRestoreParam class", "name": "__init__", "signature": "def __init__(self, drop_pdbs_if_exists=None, existing_cdb=None, include_in_restore=None, pdb_entity_info_vec=None, rename_pdb_map=None)" }, { "docstring": "Creates an instance of this model from a dicti...
2
null
Implement the Python class `PDBRestoreParam` described below. Class description: Implementation of the 'PDBRestoreParam' model. TODO: type description here. Attributes: drop_pdbs_if_exists (bool): During the restore workflow, drop the pdb if the same name pdb exists. existing_cdb (bool): Restore given list of pdbs to ...
Implement the Python class `PDBRestoreParam` described below. Class description: Implementation of the 'PDBRestoreParam' model. TODO: type description here. Attributes: drop_pdbs_if_exists (bool): During the restore workflow, drop the pdb if the same name pdb exists. existing_cdb (bool): Restore given list of pdbs to ...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class PDBRestoreParam: """Implementation of the 'PDBRestoreParam' model. TODO: type description here. Attributes: drop_pdbs_if_exists (bool): During the restore workflow, drop the pdb if the same name pdb exists. existing_cdb (bool): Restore given list of pdbs to an existing CDB. include_in_restore (bo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PDBRestoreParam: """Implementation of the 'PDBRestoreParam' model. TODO: type description here. Attributes: drop_pdbs_if_exists (bool): During the restore workflow, drop the pdb if the same name pdb exists. existing_cdb (bool): Restore given list of pdbs to an existing CDB. include_in_restore (bool): Whether ...
the_stack_v2_python_sparse
cohesity_management_sdk/models/pdb_restore_param.py
cohesity/management-sdk-python
train
24
aaad78e3221c86b992e1b2de9dffcde636c1b8db
[ "for pos, assertions in other.failed.items():\n self.failed[pos].update(assertions)\nfor pos, assertions in other.error.items():\n self.error[pos].update(assertions)", "if stmt_idx in self.failed and assertion_idx in self.failed[stmt_idx]:\n return True\nif stmt_idx in self.error and assertion_idx in sel...
<|body_start_0|> for pos, assertions in other.failed.items(): self.failed[pos].update(assertions) for pos, assertions in other.error.items(): self.error[pos].update(assertions) <|end_body_0|> <|body_start_1|> if stmt_idx in self.failed and assertion_idx in self.failed[st...
Trace for assertion verification.
AssertionVerificationTrace
[ "CC-BY-4.0", "LGPL-2.1-or-later", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AssertionVerificationTrace: """Trace for assertion verification.""" def merge(self, other: AssertionVerificationTrace) -> None: """Merge another trace into this trace. Args: other: The other trace""" <|body_0|> def was_violated(self, stmt_idx: int, assertion_idx: int) ->...
stack_v2_sparse_classes_36k_train_020527
3,855
permissive
[ { "docstring": "Merge another trace into this trace. Args: other: The other trace", "name": "merge", "signature": "def merge(self, other: AssertionVerificationTrace) -> None" }, { "docstring": "Was the assertion at the given position violated? This may happen because the assertion failed or anot...
2
stack_v2_sparse_classes_30k_train_019629
Implement the Python class `AssertionVerificationTrace` described below. Class description: Trace for assertion verification. Method signatures and docstrings: - def merge(self, other: AssertionVerificationTrace) -> None: Merge another trace into this trace. Args: other: The other trace - def was_violated(self, stmt_...
Implement the Python class `AssertionVerificationTrace` described below. Class description: Trace for assertion verification. Method signatures and docstrings: - def merge(self, other: AssertionVerificationTrace) -> None: Merge another trace into this trace. Args: other: The other trace - def was_violated(self, stmt_...
cc083252c7054824bfaf200533a8b7ad45f7c4fb
<|skeleton|> class AssertionVerificationTrace: """Trace for assertion verification.""" def merge(self, other: AssertionVerificationTrace) -> None: """Merge another trace into this trace. Args: other: The other trace""" <|body_0|> def was_violated(self, stmt_idx: int, assertion_idx: int) ->...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AssertionVerificationTrace: """Trace for assertion verification.""" def merge(self, other: AssertionVerificationTrace) -> None: """Merge another trace into this trace. Args: other: The other trace""" for pos, assertions in other.failed.items(): self.failed[pos].update(assertio...
the_stack_v2_python_sparse
src/pynguin/assertion/assertion_trace.py
se2p/pynguin
train
1,223
3d9e78c57add055f3642a9768fd751b0c6955765
[ "if type(ids) == type([]):\n move = self.browse(cr, user, ids[0]).move_line_id\nelse:\n move = self.browse(cr, user, ids).move_line_id\nif move:\n invoice_ids = self.pool.get('account.invoice').search(cr, user, [('move_id', '=', move.move_id.id)])\n if invoice_ids:\n invoice = self.pool.get('acco...
<|body_start_0|> if type(ids) == type([]): move = self.browse(cr, user, ids[0]).move_line_id else: move = self.browse(cr, user, ids).move_line_id if move: invoice_ids = self.pool.get('account.invoice').search(cr, user, [('move_id', '=', move.move_id.id)]) ...
account_voucher_line
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class account_voucher_line: def write(self, cr, user, ids, vals, context=None): """Add invoice and description in payment modification line""" <|body_0|> def create(self, cr, user, vals, context=None): """Add invoice and description in payment modification line""" ...
stack_v2_sparse_classes_36k_train_020528
8,345
no_license
[ { "docstring": "Add invoice and description in payment modification line", "name": "write", "signature": "def write(self, cr, user, ids, vals, context=None)" }, { "docstring": "Add invoice and description in payment modification line", "name": "create", "signature": "def create(self, cr,...
3
null
Implement the Python class `account_voucher_line` described below. Class description: Implement the account_voucher_line class. Method signatures and docstrings: - def write(self, cr, user, ids, vals, context=None): Add invoice and description in payment modification line - def create(self, cr, user, vals, context=No...
Implement the Python class `account_voucher_line` described below. Class description: Implement the account_voucher_line class. Method signatures and docstrings: - def write(self, cr, user, ids, vals, context=None): Add invoice and description in payment modification line - def create(self, cr, user, vals, context=No...
b5cf28bdbb347df4c39ffe3ca32355bd2206077b
<|skeleton|> class account_voucher_line: def write(self, cr, user, ids, vals, context=None): """Add invoice and description in payment modification line""" <|body_0|> def create(self, cr, user, vals, context=None): """Add invoice and description in payment modification line""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class account_voucher_line: def write(self, cr, user, ids, vals, context=None): """Add invoice and description in payment modification line""" if type(ids) == type([]): move = self.browse(cr, user, ids[0]).move_line_id else: move = self.browse(cr, user, ids).move_line...
the_stack_v2_python_sparse
account_check_writing/account_voucher.py
aryaadiputra/addons60_ptgbu_2013
train
0
1e67d877a398575070d0734a96a63f238d8869ae
[ "dir_name = 'test_dir'\nif not os.path.exists(dir_name):\n os.makedirs(dir_name)\n download_csv_file(NASA_URL, NASA_CON_NAME + CSV_END, dir_name)\n path = os.path.join(os.getcwd(), dir_name, NASA_CON_NAME + CSV_END)\n self.assertTrue(os.path.exists(path))\n os.remove(path)\n os.rmdir(dir_name)\nel...
<|body_start_0|> dir_name = 'test_dir' if not os.path.exists(dir_name): os.makedirs(dir_name) download_csv_file(NASA_URL, NASA_CON_NAME + CSV_END, dir_name) path = os.path.join(os.getcwd(), dir_name, NASA_CON_NAME + CSV_END) self.assertTrue(os.path.exists(...
Test class to test the csv downloader module
TestCSVDownloader
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestCSVDownloader: """Test class to test the csv downloader module""" def test_nasa_site(self): """Test Nasa Exoplanet site""" <|body_0|> def test_exoplanet_site(self): """Test Nasa Exoplanet site""" <|body_1|> def test_Invalid(self): """chec...
stack_v2_sparse_classes_36k_train_020529
1,259
no_license
[ { "docstring": "Test Nasa Exoplanet site", "name": "test_nasa_site", "signature": "def test_nasa_site(self)" }, { "docstring": "Test Nasa Exoplanet site", "name": "test_exoplanet_site", "signature": "def test_exoplanet_site(self)" }, { "docstring": "check if ValueError cause the ...
3
stack_v2_sparse_classes_30k_train_002902
Implement the Python class `TestCSVDownloader` described below. Class description: Test class to test the csv downloader module Method signatures and docstrings: - def test_nasa_site(self): Test Nasa Exoplanet site - def test_exoplanet_site(self): Test Nasa Exoplanet site - def test_Invalid(self): check if ValueError...
Implement the Python class `TestCSVDownloader` described below. Class description: Test class to test the csv downloader module Method signatures and docstrings: - def test_nasa_site(self): Test Nasa Exoplanet site - def test_exoplanet_site(self): Test Nasa Exoplanet site - def test_Invalid(self): check if ValueError...
de5c0690c7891eaa5f6b29f12995ba46d5fb6d15
<|skeleton|> class TestCSVDownloader: """Test class to test the csv downloader module""" def test_nasa_site(self): """Test Nasa Exoplanet site""" <|body_0|> def test_exoplanet_site(self): """Test Nasa Exoplanet site""" <|body_1|> def test_Invalid(self): """chec...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestCSVDownloader: """Test class to test the csv downloader module""" def test_nasa_site(self): """Test Nasa Exoplanet site""" dir_name = 'test_dir' if not os.path.exists(dir_name): os.makedirs(dir_name) download_csv_file(NASA_URL, NASA_CON_NAME + CSV_END, ...
the_stack_v2_python_sparse
OECSynchronizer/test_csv_downloader.py
marhabac33/oec-synchronizer
train
0
4c55d1d11be9471bd623e486fc8554279b5ba68d
[ "super().__init__(expected=(source,))\nself.temperature = temperature\nself.threshold = threshold", "strengths, = self.extract_inputs(inputs)\nthresholded = nd.threshold(strengths, th=self.threshold)\nprobabilities = nd.boltzmann(thresholded, self.temperature)\nd = nd.draw(probabilities, n=1)\nd = nd.with_default...
<|body_start_0|> super().__init__(expected=(source,)) self.temperature = temperature self.threshold = threshold <|end_body_0|> <|body_start_1|> strengths, = self.extract_inputs(inputs) thresholded = nd.threshold(strengths, th=self.threshold) probabilities = nd.boltzmann(...
Selects a chunk according to a Boltzmann distribution.
BoltzmannSelector
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BoltzmannSelector: """Selects a chunk according to a Boltzmann distribution.""" def __init__(self, source, temperature=0.01, threshold=0.25): """Initialize a ``BoltzmannSelector`` instance. :param temperature: Temperature of the Boltzmann distribution.""" <|body_0|> def ...
stack_v2_sparse_classes_36k_train_020530
7,721
permissive
[ { "docstring": "Initialize a ``BoltzmannSelector`` instance. :param temperature: Temperature of the Boltzmann distribution.", "name": "__init__", "signature": "def __init__(self, source, temperature=0.01, threshold=0.25)" }, { "docstring": "Select chunks through an activation-based competition. ...
2
stack_v2_sparse_classes_30k_train_003376
Implement the Python class `BoltzmannSelector` described below. Class description: Selects a chunk according to a Boltzmann distribution. Method signatures and docstrings: - def __init__(self, source, temperature=0.01, threshold=0.25): Initialize a ``BoltzmannSelector`` instance. :param temperature: Temperature of th...
Implement the Python class `BoltzmannSelector` described below. Class description: Selects a chunk according to a Boltzmann distribution. Method signatures and docstrings: - def __init__(self, source, temperature=0.01, threshold=0.25): Initialize a ``BoltzmannSelector`` instance. :param temperature: Temperature of th...
d8ff4c545785ec6cddc989dded9c1a9d3dd91514
<|skeleton|> class BoltzmannSelector: """Selects a chunk according to a Boltzmann distribution.""" def __init__(self, source, temperature=0.01, threshold=0.25): """Initialize a ``BoltzmannSelector`` instance. :param temperature: Temperature of the Boltzmann distribution.""" <|body_0|> def ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BoltzmannSelector: """Selects a chunk according to a Boltzmann distribution.""" def __init__(self, source, temperature=0.01, threshold=0.25): """Initialize a ``BoltzmannSelector`` instance. :param temperature: Temperature of the Boltzmann distribution.""" super().__init__(expected=(source...
the_stack_v2_python_sparse
pyClarion/components/propagators.py
HZeng3/pyClarion
train
0
ae64ad298dd824b3ab414055358f97759267dac2
[ "self.mddb_env = MDDBEnv()\nif configFile:\n self.mddb_env.configure(configFile)\nelse:\n self.mddb_env.configure()", "cmd = []\ncmd.append(self.mddb_env.executable)\ncmd = self.__cmdSwitches(cmd)\nlogname = 'file_guid_' + collId + '.log'\nlogFileName = join(self.mddb_env.logs, logname)\ncmd.extend(['--serv...
<|body_start_0|> self.mddb_env = MDDBEnv() if configFile: self.mddb_env.configure(configFile) else: self.mddb_env.configure() <|end_body_0|> <|body_start_1|> cmd = [] cmd.append(self.mddb_env.executable) cmd = self.__cmdSwitches(cmd) logna...
F2CArgs
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class F2CArgs: def __init__(self, configFile=None): """Constuctor returns an F2CArgs instance. All other functionality is called via supplied methods.""" <|body_0|> def buildCmdLine(self, collId, override, config, defaults, uri): """Builds the fits2caom command line for us...
stack_v2_sparse_classes_36k_train_020531
4,055
no_license
[ { "docstring": "Constuctor returns an F2CArgs instance. All other functionality is called via supplied methods.", "name": "__init__", "signature": "def __init__(self, configFile=None)" }, { "docstring": "Builds the fits2caom command line for use by caller. parameters: <string>, <string>, <string...
3
stack_v2_sparse_classes_30k_train_017132
Implement the Python class `F2CArgs` described below. Class description: Implement the F2CArgs class. Method signatures and docstrings: - def __init__(self, configFile=None): Constuctor returns an F2CArgs instance. All other functionality is called via supplied methods. - def buildCmdLine(self, collId, override, conf...
Implement the Python class `F2CArgs` described below. Class description: Implement the F2CArgs class. Method signatures and docstrings: - def __init__(self, configFile=None): Constuctor returns an F2CArgs instance. All other functionality is called via supplied methods. - def buildCmdLine(self, collId, override, conf...
cdb21a4e23de796407916314e07777842eee9b42
<|skeleton|> class F2CArgs: def __init__(self, configFile=None): """Constuctor returns an F2CArgs instance. All other functionality is called via supplied methods.""" <|body_0|> def buildCmdLine(self, collId, override, config, defaults, uri): """Builds the fits2caom command line for us...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class F2CArgs: def __init__(self, configFile=None): """Constuctor returns an F2CArgs instance. All other functionality is called via supplied methods.""" self.mddb_env = MDDBEnv() if configFile: self.mddb_env.configure(configFile) else: self.mddb_env.configure...
the_stack_v2_python_sparse
utils/f2cArgs.py
kiloRomeoAlpha/mddb_v1.3.2
train
0
3052a6773ed02c8b4dfe7858000b72e3c89efa12
[ "if not email:\n raise ValueError('Users must have an email address')\nuser = self.model(email=self.normalize_email(email))\nuser.set_password(password)\nuser.is_admin = False\nuser.is_superuser = False\nuser.save(using=self._db)\nreturn user", "user = self.create_user(email, password=password)\nuser.is_admin ...
<|body_start_0|> if not email: raise ValueError('Users must have an email address') user = self.model(email=self.normalize_email(email)) user.set_password(password) user.is_admin = False user.is_superuser = False user.save(using=self._db) return user <...
MyUserManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyUserManager: def create_user(self, email, password=None): """Creates and saves a User with the given email and password.""" <|body_0|> def create_superuser(self, email, password): """Creates and saves a superuser with the given email and password.""" <|body...
stack_v2_sparse_classes_36k_train_020532
5,264
no_license
[ { "docstring": "Creates and saves a User with the given email and password.", "name": "create_user", "signature": "def create_user(self, email, password=None)" }, { "docstring": "Creates and saves a superuser with the given email and password.", "name": "create_superuser", "signature": "...
2
stack_v2_sparse_classes_30k_train_007360
Implement the Python class `MyUserManager` described below. Class description: Implement the MyUserManager class. Method signatures and docstrings: - def create_user(self, email, password=None): Creates and saves a User with the given email and password. - def create_superuser(self, email, password): Creates and save...
Implement the Python class `MyUserManager` described below. Class description: Implement the MyUserManager class. Method signatures and docstrings: - def create_user(self, email, password=None): Creates and saves a User with the given email and password. - def create_superuser(self, email, password): Creates and save...
48b30854bd1fe7a064204c3c13574af80e9136dc
<|skeleton|> class MyUserManager: def create_user(self, email, password=None): """Creates and saves a User with the given email and password.""" <|body_0|> def create_superuser(self, email, password): """Creates and saves a superuser with the given email and password.""" <|body...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MyUserManager: def create_user(self, email, password=None): """Creates and saves a User with the given email and password.""" if not email: raise ValueError('Users must have an email address') user = self.model(email=self.normalize_email(email)) user.set_password(pa...
the_stack_v2_python_sparse
autoriz/models.py
bwrm/alip
train
0
b0d0f363e29aad0a64be302d58f9e85cfcec7e2b
[ "if 'fileIds' not in self.my_osid_object._my_map or 'preview' not in self.my_osid_object._my_map['fileIds'] or self.my_osid_object._my_map['fileIds']['preview'] is None:\n return False\nreturn bool(self.my_osid_object._my_map['fileIds']['preview'])", "if self.has_preview():\n pass\nraise LookupError('No PDF...
<|body_start_0|> if 'fileIds' not in self.my_osid_object._my_map or 'preview' not in self.my_osid_object._my_map['fileIds'] or self.my_osid_object._my_map['fileIds']['preview'] is None: return False return bool(self.my_osid_object._my_map['fileIds']['preview']) <|end_body_0|> <|body_start_1...
for records with a PDF preview file
PDFPreviewRecord
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PDFPreviewRecord: """for records with a PDF preview file""" def has_preview(self): """stub""" <|body_0|> def get_preview(self): """stub""" <|body_1|> def get_preview_raw(self): """stub""" <|body_2|> <|end_skeleton|> <|body_start_0|>...
stack_v2_sparse_classes_36k_train_020533
15,792
permissive
[ { "docstring": "stub", "name": "has_preview", "signature": "def has_preview(self)" }, { "docstring": "stub", "name": "get_preview", "signature": "def get_preview(self)" }, { "docstring": "stub", "name": "get_preview_raw", "signature": "def get_preview_raw(self)" } ]
3
null
Implement the Python class `PDFPreviewRecord` described below. Class description: for records with a PDF preview file Method signatures and docstrings: - def has_preview(self): stub - def get_preview(self): stub - def get_preview_raw(self): stub
Implement the Python class `PDFPreviewRecord` described below. Class description: for records with a PDF preview file Method signatures and docstrings: - def has_preview(self): stub - def get_preview(self): stub - def get_preview_raw(self): stub <|skeleton|> class PDFPreviewRecord: """for records with a PDF prev...
445f968a175d61c8d92c0f617a3c17dc1dc7c584
<|skeleton|> class PDFPreviewRecord: """for records with a PDF preview file""" def has_preview(self): """stub""" <|body_0|> def get_preview(self): """stub""" <|body_1|> def get_preview_raw(self): """stub""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PDFPreviewRecord: """for records with a PDF preview file""" def has_preview(self): """stub""" if 'fileIds' not in self.my_osid_object._my_map or 'preview' not in self.my_osid_object._my_map['fileIds'] or self.my_osid_object._my_map['fileIds']['preview'] is None: return False ...
the_stack_v2_python_sparse
dlkit/records/assessment/mecqbank/mecqbank_base_records.py
mitsei/dlkit
train
2
039bbe909fd4e15984002568dc5398b733bdb3bd
[ "driver = obj.driver\nWebDriverWait(driver, 100).until(lambda driver: driver.find_element(*self.locator))\ndriver.find_element(*self.locator).clear()\ndriver.find_element(*self.locator).send_keys(value)", "driver = obj.driver\nWebDriverWait(driver, 100).until(lambda driver: driver.find_element(*self.locator))\nel...
<|body_start_0|> driver = obj.driver WebDriverWait(driver, 100).until(lambda driver: driver.find_element(*self.locator)) driver.find_element(*self.locator).clear() driver.find_element(*self.locator).send_keys(value) <|end_body_0|> <|body_start_1|> driver = obj.driver Web...
Base page class that is initialized on every page object class.
BasePageElement
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BasePageElement: """Base page class that is initialized on every page object class.""" def __set__(self, obj, value): """Sets the text to the value supplied""" <|body_0|> def __get__(self, obj, owner): """Gets the text of the specified object""" <|body_1|...
stack_v2_sparse_classes_36k_train_020534
3,363
no_license
[ { "docstring": "Sets the text to the value supplied", "name": "__set__", "signature": "def __set__(self, obj, value)" }, { "docstring": "Gets the text of the specified object", "name": "__get__", "signature": "def __get__(self, obj, owner)" }, { "docstring": "Gets the text of the...
3
stack_v2_sparse_classes_30k_train_015967
Implement the Python class `BasePageElement` described below. Class description: Base page class that is initialized on every page object class. Method signatures and docstrings: - def __set__(self, obj, value): Sets the text to the value supplied - def __get__(self, obj, owner): Gets the text of the specified object...
Implement the Python class `BasePageElement` described below. Class description: Base page class that is initialized on every page object class. Method signatures and docstrings: - def __set__(self, obj, value): Sets the text to the value supplied - def __get__(self, obj, owner): Gets the text of the specified object...
2b08d3cc153f0ebdd6272a17962e1601390391c5
<|skeleton|> class BasePageElement: """Base page class that is initialized on every page object class.""" def __set__(self, obj, value): """Sets the text to the value supplied""" <|body_0|> def __get__(self, obj, owner): """Gets the text of the specified object""" <|body_1|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BasePageElement: """Base page class that is initialized on every page object class.""" def __set__(self, obj, value): """Sets the text to the value supplied""" driver = obj.driver WebDriverWait(driver, 100).until(lambda driver: driver.find_element(*self.locator)) driver.fi...
the_stack_v2_python_sparse
sbt/selenium/pages/element.py
jinnymus/Python
train
0
a2458abae27c79116134293130c98e820dfd3f37
[ "if model._meta.app_label == self.app_label:\n return get_audit_db()\nreturn None", "if model._meta.app_label == self.app_label:\n return get_audit_db()\nreturn None", "if obj1._meta.app_label == self.app_label or obj2._meta.app_label == self.app_label:\n return False\nreturn None", "if app_label == ...
<|body_start_0|> if model._meta.app_label == self.app_label: return get_audit_db() return None <|end_body_0|> <|body_start_1|> if model._meta.app_label == self.app_label: return get_audit_db() return None <|end_body_1|> <|body_start_2|> if obj1._meta.app...
A router to control all database operations on models in the audit application.
AuditRouter
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AuditRouter: """A router to control all database operations on models in the audit application.""" def db_for_read(self, model, **hints): """Attempts to read auth models go to audit.""" <|body_0|> def db_for_write(self, model, **hints): """Attempts to write auth ...
stack_v2_sparse_classes_36k_train_020535
1,966
permissive
[ { "docstring": "Attempts to read auth models go to audit.", "name": "db_for_read", "signature": "def db_for_read(self, model, **hints)" }, { "docstring": "Attempts to write auth models go to audit.", "name": "db_for_write", "signature": "def db_for_write(self, model, **hints)" }, { ...
4
null
Implement the Python class `AuditRouter` described below. Class description: A router to control all database operations on models in the audit application. Method signatures and docstrings: - def db_for_read(self, model, **hints): Attempts to read auth models go to audit. - def db_for_write(self, model, **hints): At...
Implement the Python class `AuditRouter` described below. Class description: A router to control all database operations on models in the audit application. Method signatures and docstrings: - def db_for_read(self, model, **hints): Attempts to read auth models go to audit. - def db_for_write(self, model, **hints): At...
33c8f4ffe8697081abcfc5771b98a88c0578059f
<|skeleton|> class AuditRouter: """A router to control all database operations on models in the audit application.""" def db_for_read(self, model, **hints): """Attempts to read auth models go to audit.""" <|body_0|> def db_for_write(self, model, **hints): """Attempts to write auth ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AuditRouter: """A router to control all database operations on models in the audit application.""" def db_for_read(self, model, **hints): """Attempts to read auth models go to audit.""" if model._meta.app_label == self.app_label: return get_audit_db() return None ...
the_stack_v2_python_sparse
saas/backend/audit/routers.py
robert871126/bk-iam-saas
train
0
0dbd7c11be62197540c652848ca26a367fbb1505
[ "cls.dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), 'temp'))\nos.makedirs(os.path.join(cls.dirname, 'pdep'))\ntest_family = 'R_Recombination'\ncls.rmg = RMG()\nfrom rmgpy.rmg.input import set_global_rmg, pressure_dependence\nset_global_rmg(cls.rmg)\npressure_dependence(method='modified strong col...
<|body_start_0|> cls.dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), 'temp')) os.makedirs(os.path.join(cls.dirname, 'pdep')) test_family = 'R_Recombination' cls.rmg = RMG() from rmgpy.rmg.input import set_global_rmg, pressure_dependence set_global_rmg(cl...
Contains unit tests for CoreEdgeReactionModel.enlarge.
TestEnlarge
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestEnlarge: """Contains unit tests for CoreEdgeReactionModel.enlarge.""" def setUpClass(cls): """A method that is run ONCE before all unit tests in this class.""" <|body_0|> def test_enlarge_1_add_nonreactive_species(self): """Test that we can add a nonreactive ...
stack_v2_sparse_classes_36k_train_020536
34,780
permissive
[ { "docstring": "A method that is run ONCE before all unit tests in this class.", "name": "setUpClass", "signature": "def setUpClass(cls)" }, { "docstring": "Test that we can add a nonreactive species to CERM", "name": "test_enlarge_1_add_nonreactive_species", "signature": "def test_enlar...
6
stack_v2_sparse_classes_30k_train_019168
Implement the Python class `TestEnlarge` described below. Class description: Contains unit tests for CoreEdgeReactionModel.enlarge. Method signatures and docstrings: - def setUpClass(cls): A method that is run ONCE before all unit tests in this class. - def test_enlarge_1_add_nonreactive_species(self): Test that we c...
Implement the Python class `TestEnlarge` described below. Class description: Contains unit tests for CoreEdgeReactionModel.enlarge. Method signatures and docstrings: - def setUpClass(cls): A method that is run ONCE before all unit tests in this class. - def test_enlarge_1_add_nonreactive_species(self): Test that we c...
349a4af759cf8877197772cd7eaca1e51d46eff5
<|skeleton|> class TestEnlarge: """Contains unit tests for CoreEdgeReactionModel.enlarge.""" def setUpClass(cls): """A method that is run ONCE before all unit tests in this class.""" <|body_0|> def test_enlarge_1_add_nonreactive_species(self): """Test that we can add a nonreactive ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestEnlarge: """Contains unit tests for CoreEdgeReactionModel.enlarge.""" def setUpClass(cls): """A method that is run ONCE before all unit tests in this class.""" cls.dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), 'temp')) os.makedirs(os.path.join(cls.dirname, ...
the_stack_v2_python_sparse
rmgpy/rmg/modelTest.py
CanePan-cc/CanePanWorkshop
train
2
c085289f31151cb3b8ae782250141b9d4c00732e
[ "context = super().get_context_data(**kwargs)\ncontext['n_responses'] = len(context['study'].responses.all())\nreturn context", "output, writer = self.csv_output_and_writer()\nwriter.writerow(self.get_csv_participant_headers())\nfor resp in responses:\n writer.writerow(self.build_csv_participant_row_data(resp)...
<|body_start_0|> context = super().get_context_data(**kwargs) context['n_responses'] = len(context['study'].responses.all()) return context <|end_body_0|> <|body_start_1|> output, writer = self.csv_output_and_writer() writer.writerow(self.get_csv_participant_headers()) f...
StudyParticiapnts view shows participant demographic snapshots associated with each response to the study
StudyDemographics
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StudyDemographics: """StudyParticiapnts view shows participant demographic snapshots associated with each response to the study""" def get_context_data(self, **kwargs): """In addition to the study, adds several items to the context dictionary. Study results are paginated.""" ...
stack_v2_sparse_classes_36k_train_020537
34,217
permissive
[ { "docstring": "In addition to the study, adds several items to the context dictionary. Study results are paginated.", "name": "get_context_data", "signature": "def get_context_data(self, **kwargs)" }, { "docstring": "Builds CSV file contents for all participant data", "name": "build_all_par...
2
stack_v2_sparse_classes_30k_train_013956
Implement the Python class `StudyDemographics` described below. Class description: StudyParticiapnts view shows participant demographic snapshots associated with each response to the study Method signatures and docstrings: - def get_context_data(self, **kwargs): In addition to the study, adds several items to the con...
Implement the Python class `StudyDemographics` described below. Class description: StudyParticiapnts view shows participant demographic snapshots associated with each response to the study Method signatures and docstrings: - def get_context_data(self, **kwargs): In addition to the study, adds several items to the con...
621fbb8b25100a21fd94721d39003b5d4f651dc5
<|skeleton|> class StudyDemographics: """StudyParticiapnts view shows participant demographic snapshots associated with each response to the study""" def get_context_data(self, **kwargs): """In addition to the study, adds several items to the context dictionary. Study results are paginated.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StudyDemographics: """StudyParticiapnts view shows participant demographic snapshots associated with each response to the study""" def get_context_data(self, **kwargs): """In addition to the study, adds several items to the context dictionary. Study results are paginated.""" context = sup...
the_stack_v2_python_sparse
exp/views/study.py
enrobyn/lookit-api
train
0
f0cfb79a09fd6655c4c3315f0183587bf9251ec9
[ "if self.payment is None:\n return str(uuid.uuid4())\ndate_str = self.payment.creation_time.strftime('%Y%m%d')\nif self.payment.item.event.activity_types:\n activity_str = self.payment.item.event.activity_types[0].trigram\nelse:\n activity_str = 'NCL'\nrolling_id = self.payment.id % 10000\nreturn f'CAF{dat...
<|body_start_0|> if self.payment is None: return str(uuid.uuid4()) date_str = self.payment.creation_time.strftime('%Y%m%d') if self.payment.item.event.activity_types: activity_str = self.payment.item.event.activity_types[0].trigram else: activity_str =...
Class describing an order for a payment request. Will usually be constructed from a :py:class:`collectives.models.payment.Payment` object
OrderInfo
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OrderInfo: """Class describing an order for a payment request. Will usually be constructed from a :py:class:`collectives.models.payment.Payment` object""" def unique_ref(self): """:return: An unique reference for the order :rtype: string""" <|body_0|> def private_data(se...
stack_v2_sparse_classes_36k_train_020538
22,232
no_license
[ { "docstring": ":return: An unique reference for the order :rtype: string", "name": "unique_ref", "signature": "def unique_ref(self)" }, { "docstring": ":return: Metadata in the Payline key-value list format :rtype: dict", "name": "private_data", "signature": "def private_data(self)" }...
3
null
Implement the Python class `OrderInfo` described below. Class description: Class describing an order for a payment request. Will usually be constructed from a :py:class:`collectives.models.payment.Payment` object Method signatures and docstrings: - def unique_ref(self): :return: An unique reference for the order :rty...
Implement the Python class `OrderInfo` described below. Class description: Class describing an order for a payment request. Will usually be constructed from a :py:class:`collectives.models.payment.Payment` object Method signatures and docstrings: - def unique_ref(self): :return: An unique reference for the order :rty...
1ae05ae9029a28fd0656c06a2092f67a87a93dcd
<|skeleton|> class OrderInfo: """Class describing an order for a payment request. Will usually be constructed from a :py:class:`collectives.models.payment.Payment` object""" def unique_ref(self): """:return: An unique reference for the order :rtype: string""" <|body_0|> def private_data(se...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OrderInfo: """Class describing an order for a payment request. Will usually be constructed from a :py:class:`collectives.models.payment.Payment` object""" def unique_ref(self): """:return: An unique reference for the order :rtype: string""" if self.payment is None: return str(...
the_stack_v2_python_sparse
collectives/utils/payline.py
Club-Alpin-Annecy/collectives
train
12
a9747ce41ff499347bf66d2de1eadd68e0cacc14
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn AdministrativeUnit()", "from .directory_object import DirectoryObject\nfrom .extension import Extension\nfrom .scoped_role_membership import ScopedRoleMembership\nfrom .directory_object import DirectoryObject\nfrom .extension import Ex...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return AdministrativeUnit() <|end_body_0|> <|body_start_1|> from .directory_object import DirectoryObject from .extension import Extension from .scoped_role_membership import ScopedRole...
AdministrativeUnit
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdministrativeUnit: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AdministrativeUnit: """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 obje...
stack_v2_sparse_classes_36k_train_020539
4,322
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: AdministrativeUnit", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_...
3
null
Implement the Python class `AdministrativeUnit` described below. Class description: Implement the AdministrativeUnit class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AdministrativeUnit: Creates a new instance of the appropriate class based on disc...
Implement the Python class `AdministrativeUnit` described below. Class description: Implement the AdministrativeUnit class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AdministrativeUnit: Creates a new instance of the appropriate class based on disc...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class AdministrativeUnit: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AdministrativeUnit: """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 obje...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AdministrativeUnit: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AdministrativeUnit: """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: Ad...
the_stack_v2_python_sparse
msgraph/generated/models/administrative_unit.py
microsoftgraph/msgraph-sdk-python
train
135
618866b1cb47aff3e7ff182ccdf645c7e702c96c
[ "self.assertIn(simulation(1, 1000).outcome(), [0, 2000])\nself.assertIn(simulation(10, 100).outcome(), list(range(0, 2002, 200)))\nself.assertIn(simulation(100, 10).outcome(), list(range(0, 2002, 20)))\nself.assertIn(simulation(1000, 1).outcome(), list(range(0, 2001, 2)))\nself.assertEqual(len(simulation(1000, 1).o...
<|body_start_0|> self.assertIn(simulation(1, 1000).outcome(), [0, 2000]) self.assertIn(simulation(10, 100).outcome(), list(range(0, 2002, 200))) self.assertIn(simulation(100, 10).outcome(), list(range(0, 2002, 20))) self.assertIn(simulation(1000, 1).outcome(), list(range(0, 2001, 2))) ...
Test
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test: def test_simulation(self): """Test the simulation class""" <|body_0|> def test_reading_in(self): """Test the reading_in function""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.assertIn(simulation(1, 1000).outcome(), [0, 2000]) se...
stack_v2_sparse_classes_36k_train_020540
1,256
no_license
[ { "docstring": "Test the simulation class", "name": "test_simulation", "signature": "def test_simulation(self)" }, { "docstring": "Test the reading_in function", "name": "test_reading_in", "signature": "def test_reading_in(self)" } ]
2
null
Implement the Python class `Test` described below. Class description: Implement the Test class. Method signatures and docstrings: - def test_simulation(self): Test the simulation class - def test_reading_in(self): Test the reading_in function
Implement the Python class `Test` described below. Class description: Implement the Test class. Method signatures and docstrings: - def test_simulation(self): Test the simulation class - def test_reading_in(self): Test the reading_in function <|skeleton|> class Test: def test_simulation(self): """Test t...
5b904060e8bced7f91547ad7f7819773a7450a1e
<|skeleton|> class Test: def test_simulation(self): """Test the simulation class""" <|body_0|> def test_reading_in(self): """Test the reading_in function""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Test: def test_simulation(self): """Test the simulation class""" self.assertIn(simulation(1, 1000).outcome(), [0, 2000]) self.assertIn(simulation(10, 100).outcome(), list(range(0, 2002, 200))) self.assertIn(simulation(100, 10).outcome(), list(range(0, 2002, 20))) self.a...
the_stack_v2_python_sparse
nw1045/unittest_assignmemt8.py
ds-ga-1007/assignment8
train
1
ba6fd91c54e210ed43e57d736d374dae86e6042c
[ "if cache is None:\n cache = cmsis_pack_manager.Cache(True, True)\nresults = []\nfor pack in cache.packs_for_devices(cache.index.values()):\n pack_path = os.path.join(cache.data_path, pack.get_pack_name())\n if os.path.isfile(pack_path):\n results.append(pack)\nreturn results", "if cache is None:\...
<|body_start_0|> if cache is None: cache = cmsis_pack_manager.Cache(True, True) results = [] for pack in cache.packs_for_devices(cache.index.values()): pack_path = os.path.join(cache.data_path, pack.get_pack_name()) if os.path.isfile(pack_path): ...
@brief Namespace for managed CMSIS-Pack utilities. By managed, we mean managed by the cmsis-pack-manager package. All the methods on this class apply only to those packs managed by cmsis-pack-manager, not any targets from packs specified by the user.
ManagedPacksImpl
[ "CC-BY-4.0", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ManagedPacksImpl: """@brief Namespace for managed CMSIS-Pack utilities. By managed, we mean managed by the cmsis-pack-manager package. All the methods on this class apply only to those packs managed by cmsis-pack-manager, not any targets from packs specified by the user.""" def get_installed...
stack_v2_sparse_classes_36k_train_020541
29,452
permissive
[ { "docstring": "@brief Return a list containing CmsisPackRef objects for all installed packs.", "name": "get_installed_packs", "signature": "def get_installed_packs(cache: Optional[cmsis_pack_manager.Cache]=None) -> List[CmsisPackRef]" }, { "docstring": "@brief Return a list of CmsisPackDevice o...
3
stack_v2_sparse_classes_30k_train_012501
Implement the Python class `ManagedPacksImpl` described below. Class description: @brief Namespace for managed CMSIS-Pack utilities. By managed, we mean managed by the cmsis-pack-manager package. All the methods on this class apply only to those packs managed by cmsis-pack-manager, not any targets from packs specified...
Implement the Python class `ManagedPacksImpl` described below. Class description: @brief Namespace for managed CMSIS-Pack utilities. By managed, we mean managed by the cmsis-pack-manager package. All the methods on this class apply only to those packs managed by cmsis-pack-manager, not any targets from packs specified...
9253740baf46ebf4eacbce6bf3369150c5fb8ee0
<|skeleton|> class ManagedPacksImpl: """@brief Namespace for managed CMSIS-Pack utilities. By managed, we mean managed by the cmsis-pack-manager package. All the methods on this class apply only to those packs managed by cmsis-pack-manager, not any targets from packs specified by the user.""" def get_installed...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ManagedPacksImpl: """@brief Namespace for managed CMSIS-Pack utilities. By managed, we mean managed by the cmsis-pack-manager package. All the methods on this class apply only to those packs managed by cmsis-pack-manager, not any targets from packs specified by the user.""" def get_installed_packs(cache:...
the_stack_v2_python_sparse
pyocd/target/pack/pack_target.py
pyocd/pyOCD
train
507
e1e9a58806b4339173f4503debdf3701940bb642
[ "threading.Thread.__init__(self)\nself.mail_server = mail_server\nself.mail_address = mail_address\nself.str_from = str_from\nself.str_subject = str_subject\nself.str_to = str_to\nself.str_msg = str_msg\nself.callbacks = callbacks", "logging.debug('Starting thread')\nsuccess = False\ntry:\n logging.info('Sendi...
<|body_start_0|> threading.Thread.__init__(self) self.mail_server = mail_server self.mail_address = mail_address self.str_from = str_from self.str_subject = str_subject self.str_to = str_to self.str_msg = str_msg self.callbacks = callbacks <|end_body_0|> ...
MailSenderThread
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MailSenderThread: def __init__(self, mail_server, mail_address, str_from, str_subject, str_to, str_msg, callbacks=[]): """Initializes the thread :param mail_server: The server :param mail_address: The email address :param str_from: From address :param str_subject: The Subject :param str_...
stack_v2_sparse_classes_36k_train_020542
5,713
no_license
[ { "docstring": "Initializes the thread :param mail_server: The server :param mail_address: The email address :param str_from: From address :param str_subject: The Subject :param str_to: To address :param str_msg: The message :param callbacks: List of callbacks", "name": "__init__", "signature": "def __i...
2
stack_v2_sparse_classes_30k_train_001342
Implement the Python class `MailSenderThread` described below. Class description: Implement the MailSenderThread class. Method signatures and docstrings: - def __init__(self, mail_server, mail_address, str_from, str_subject, str_to, str_msg, callbacks=[]): Initializes the thread :param mail_server: The server :param ...
Implement the Python class `MailSenderThread` described below. Class description: Implement the MailSenderThread class. Method signatures and docstrings: - def __init__(self, mail_server, mail_address, str_from, str_subject, str_to, str_msg, callbacks=[]): Initializes the thread :param mail_server: The server :param ...
e586760a3a4899cf85367f85d7895ed3bf765f60
<|skeleton|> class MailSenderThread: def __init__(self, mail_server, mail_address, str_from, str_subject, str_to, str_msg, callbacks=[]): """Initializes the thread :param mail_server: The server :param mail_address: The email address :param str_from: From address :param str_subject: The Subject :param str_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MailSenderThread: def __init__(self, mail_server, mail_address, str_from, str_subject, str_to, str_msg, callbacks=[]): """Initializes the thread :param mail_server: The server :param mail_address: The email address :param str_from: From address :param str_subject: The Subject :param str_to: To address...
the_stack_v2_python_sparse
src/sender/mail/MailBot.py
RaspiSurveillance/Raspi-Surveillance
train
0
4b3edcd6fafe2174ab0f19bb94e4d075b116fbe7
[ "super(ranker, self).__init__()\nself.scoring_function = scoring_function\nself.all_kb = all_kb\nself.knowns_o = {}\nself.knowns_s = {}\nfor fact in self.all_kb.facts:\n if (fact[0], fact[1]) not in self.knowns_o:\n self.knowns_o[fact[0], fact[1]] = set()\n self.knowns_o[fact[0], fact[1]].add(fact[2])\...
<|body_start_0|> super(ranker, self).__init__() self.scoring_function = scoring_function self.all_kb = all_kb self.knowns_o = {} self.knowns_s = {} for fact in self.all_kb.facts: if (fact[0], fact[1]) not in self.knowns_o: self.knowns_o[fact[0]...
A network that ranks entities based on a scoring function. It excludes entities that have already been seen in any kb to compute the ranking as in ####### cite paper here ########. It can be constructed from any scoring function/model from models.py
ranker
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ranker: """A network that ranks entities based on a scoring function. It excludes entities that have already been seen in any kb to compute the ranking as in ####### cite paper here ########. It can be constructed from any scoring function/model from models.py""" def __init__(self, scoring_f...
stack_v2_sparse_classes_36k_train_020543
11,823
no_license
[ { "docstring": "The initializer :param scoring_function: The model function to used to rank the entities :param all_kb: A union of all the knowledge bases (train/test/valid)", "name": "__init__", "signature": "def __init__(self, scoring_function, all_kb)" }, { "docstring": "computes and returns ...
3
stack_v2_sparse_classes_30k_train_008916
Implement the Python class `ranker` described below. Class description: A network that ranks entities based on a scoring function. It excludes entities that have already been seen in any kb to compute the ranking as in ####### cite paper here ########. It can be constructed from any scoring function/model from models....
Implement the Python class `ranker` described below. Class description: A network that ranks entities based on a scoring function. It excludes entities that have already been seen in any kb to compute the ranking as in ####### cite paper here ########. It can be constructed from any scoring function/model from models....
81e6f1ea24968303a6c426f704228e8618966f6a
<|skeleton|> class ranker: """A network that ranks entities based on a scoring function. It excludes entities that have already been seen in any kb to compute the ranking as in ####### cite paper here ########. It can be constructed from any scoring function/model from models.py""" def __init__(self, scoring_f...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ranker: """A network that ranks entities based on a scoring function. It excludes entities that have already been seen in any kb to compute the ranking as in ####### cite paper here ########. It can be constructed from any scoring function/model from models.py""" def __init__(self, scoring_function, all_...
the_stack_v2_python_sparse
combined/type_complex/evaluate.py
YerayL/IterefinE
train
0
683d76c9c33929407a4d8707b24e793daeefe1cc
[ "ret = 0\nD = defaultdict(lambda: defaultdict(int))\nfor i in range(len(A)):\n for j in range(i):\n d = A[i] - A[j]\n D[i][d] += 1 + D[j][d]\n if D[j][d] > 0:\n ret += D[j][d]\nreturn ret", "ret = 0\nD = defaultdict(lambda: defaultdict(int))\nfor i in range(len(A)):\n for j i...
<|body_start_0|> ret = 0 D = defaultdict(lambda: defaultdict(int)) for i in range(len(A)): for j in range(i): d = A[i] - A[j] D[i][d] += 1 + D[j][d] if D[j][d] > 0: ret += D[j][d] return ret <|end_body_0|> <...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def numberOfArithmeticSlices(self, A): """Subsequence, count the number, looks like dp use defaultdict for easy dp array construction D[i][d] stores the number of arithmetic subsequence ending at A[i], with delta d result would be sum( D[i][d] if >= 3 consecutive subsequence A[...
stack_v2_sparse_classes_36k_train_020544
1,999
permissive
[ { "docstring": "Subsequence, count the number, looks like dp use defaultdict for easy dp array construction D[i][d] stores the number of arithmetic subsequence ending at A[i], with delta d result would be sum( D[i][d] if >= 3 consecutive subsequence A[i], A[j], A[k] ... for some j, k ) summing D[j][d] rather th...
2
stack_v2_sparse_classes_30k_train_011186
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numberOfArithmeticSlices(self, A): Subsequence, count the number, looks like dp use defaultdict for easy dp array construction D[i][d] stores the number of arithmetic subsequ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numberOfArithmeticSlices(self, A): Subsequence, count the number, looks like dp use defaultdict for easy dp array construction D[i][d] stores the number of arithmetic subsequ...
cbbd4a67ab342ada2421e13f82d660b1d47d4d20
<|skeleton|> class Solution: def numberOfArithmeticSlices(self, A): """Subsequence, count the number, looks like dp use defaultdict for easy dp array construction D[i][d] stores the number of arithmetic subsequence ending at A[i], with delta d result would be sum( D[i][d] if >= 3 consecutive subsequence A[...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def numberOfArithmeticSlices(self, A): """Subsequence, count the number, looks like dp use defaultdict for easy dp array construction D[i][d] stores the number of arithmetic subsequence ending at A[i], with delta d result would be sum( D[i][d] if >= 3 consecutive subsequence A[i], A[j], A[k]...
the_stack_v2_python_sparse
446 Arithmetic Slices II - Subsequence.py
Aminaba123/LeetCode
train
1
a928350ecea8bcbda0e68aca57199c8fd884109a
[ "val_list = []\n\ndef inorderTransverse(root):\n if root:\n inorderTransverse(root.left)\n val_list.append(root.val)\n inorderTransverse(root.right)\n return\ninorderTransverse(root)\nfor i in range(len(val_list) - 1):\n if val_list[i + 1] <= val_list[i]:\n return False\nreturn ...
<|body_start_0|> val_list = [] def inorderTransverse(root): if root: inorderTransverse(root.left) val_list.append(root.val) inorderTransverse(root.right) return inorderTransverse(root) for i in range(len(val_list) -...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def isValidBST_1(self, root: TreeNode) -> bool: """1. 中序遍历创建值的列表,判断值列表是否递增 直接递归比较左、根、右,结果不正确,右子树所有点的值要大于根......""" <|body_0|> def isValidBST(self, root: TreeNode) -> bool: """2.迭代 KEY: 上下限制,右子树最小值大于根,左子树最大值小于根""" <|body_1|> <|end_skeleton|> <|body...
stack_v2_sparse_classes_36k_train_020545
2,503
no_license
[ { "docstring": "1. 中序遍历创建值的列表,判断值列表是否递增 直接递归比较左、根、右,结果不正确,右子树所有点的值要大于根......", "name": "isValidBST_1", "signature": "def isValidBST_1(self, root: TreeNode) -> bool" }, { "docstring": "2.迭代 KEY: 上下限制,右子树最小值大于根,左子树最大值小于根", "name": "isValidBST", "signature": "def isValidBST(self, root: Tree...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def isValidBST_1(self, root: TreeNode) -> bool: 1. 中序遍历创建值的列表,判断值列表是否递增 直接递归比较左、根、右,结果不正确,右子树所有点的值要大于根...... - def isValidBST(self, root: TreeNode) -> bool: 2.迭代 KEY: 上下限制,右子树最小值...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def isValidBST_1(self, root: TreeNode) -> bool: 1. 中序遍历创建值的列表,判断值列表是否递增 直接递归比较左、根、右,结果不正确,右子树所有点的值要大于根...... - def isValidBST(self, root: TreeNode) -> bool: 2.迭代 KEY: 上下限制,右子树最小值...
4732fb80710a08a715c3e7080c394f5298b8326d
<|skeleton|> class Solution: def isValidBST_1(self, root: TreeNode) -> bool: """1. 中序遍历创建值的列表,判断值列表是否递增 直接递归比较左、根、右,结果不正确,右子树所有点的值要大于根......""" <|body_0|> def isValidBST(self, root: TreeNode) -> bool: """2.迭代 KEY: 上下限制,右子树最小值大于根,左子树最大值小于根""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def isValidBST_1(self, root: TreeNode) -> bool: """1. 中序遍历创建值的列表,判断值列表是否递增 直接递归比较左、根、右,结果不正确,右子树所有点的值要大于根......""" val_list = [] def inorderTransverse(root): if root: inorderTransverse(root.left) val_list.append(root.val) ...
the_stack_v2_python_sparse
.leetcode/98.验证二叉搜索树.py
xiaoruijiang/algorithm
train
0
498349361381e88270775de2cdbd57bdc27e37bf
[ "self.patients = {}\nself.audit_time = []\nself.audit_beds = []\nself.bed_count = 0\nself.admissions = 0\nreturn", "self.audit_time.append(time)\nself.audit_beds.append(self.bed_count)\nreturn", "self.audit_report = pd.DataFrame()\nself.audit_report['Time'] = self.audit_time\nself.audit_report['Occupied_beds'] ...
<|body_start_0|> self.patients = {} self.audit_time = [] self.audit_beds = [] self.bed_count = 0 self.admissions = 0 return <|end_body_0|> <|body_start_1|> self.audit_time.append(time) self.audit_beds.append(self.bed_count) return <|end_body_1|> ...
Hospital class holds: 1) Dictionary of patients present 2) List of audit times 3) List of beds occupied at each audit time 4) Current total beds occupied 5) Admissions to data Methods: __init__: Set up hospital instance audit: records number of beds occupied build_audit_report: builds audit report at end of run (calcul...
Hospital
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Hospital: """Hospital class holds: 1) Dictionary of patients present 2) List of audit times 3) List of beds occupied at each audit time 4) Current total beds occupied 5) Admissions to data Methods: __init__: Set up hospital instance audit: records number of beds occupied build_audit_report: build...
stack_v2_sparse_classes_36k_train_020546
11,444
no_license
[ { "docstring": "Constructor method for hospital class\" Initialise object with attributes.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Audit method. When called appends current simulation time to audit_time list, and appends current bed count to audit_beds.", "...
4
null
Implement the Python class `Hospital` described below. Class description: Hospital class holds: 1) Dictionary of patients present 2) List of audit times 3) List of beds occupied at each audit time 4) Current total beds occupied 5) Admissions to data Methods: __init__: Set up hospital instance audit: records number of ...
Implement the Python class `Hospital` described below. Class description: Hospital class holds: 1) Dictionary of patients present 2) List of audit times 3) List of beds occupied at each audit time 4) Current total beds occupied 5) Admissions to data Methods: __init__: Set up hospital instance audit: records number of ...
b16f2b16f161cd68e0532e7a3381518e0d565bdf
<|skeleton|> class Hospital: """Hospital class holds: 1) Dictionary of patients present 2) List of audit times 3) List of beds occupied at each audit time 4) Current total beds occupied 5) Admissions to data Methods: __init__: Set up hospital instance audit: records number of beds occupied build_audit_report: build...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Hospital: """Hospital class holds: 1) Dictionary of patients present 2) List of audit times 3) List of beds occupied at each audit time 4) Current total beds occupied 5) Admissions to data Methods: __init__: Set up hospital instance audit: records number of beds occupied build_audit_report: builds audit repor...
the_stack_v2_python_sparse
py_files/0087_bed_occupancy_object_based.py
tospolkaw/CloanGit_PythonHealthcare
train
1
6efc94643b8ebcc6085981e46cf71eac3c74abb8
[ "if id is not None:\n self.id = id\nelse:\n Base.__nb_objects += 1\n self.id = Base.__nb_objects", "if list_dictionaries is None or not list_dictionaries:\n return '[]'\nreturn json.dumps(list_dictionaries)", "dictobj_list = []\nfor obj in list_objs:\n dictobj_list.append(obj.to_dictionary())\nst...
<|body_start_0|> if id is not None: self.id = id else: Base.__nb_objects += 1 self.id = Base.__nb_objects <|end_body_0|> <|body_start_1|> if list_dictionaries is None or not list_dictionaries: return '[]' return json.dumps(list_dictionarie...
Class called base with different methods that have an effect on subclasses when called.
Base
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Base: """Class called base with different methods that have an effect on subclasses when called.""" def __init__(self, id=None): """defining a cls constructor with private cls attribute. (Task 1)""" <|body_0|> def to_json_string(list_dictionaries): """return the ...
stack_v2_sparse_classes_36k_train_020547
2,226
no_license
[ { "docstring": "defining a cls constructor with private cls attribute. (Task 1)", "name": "__init__", "signature": "def __init__(self, id=None)" }, { "docstring": "return the json representation of list_dictionaries. (Task 15)", "name": "to_json_string", "signature": "def to_json_string(...
6
stack_v2_sparse_classes_30k_train_014888
Implement the Python class `Base` described below. Class description: Class called base with different methods that have an effect on subclasses when called. Method signatures and docstrings: - def __init__(self, id=None): defining a cls constructor with private cls attribute. (Task 1) - def to_json_string(list_dicti...
Implement the Python class `Base` described below. Class description: Class called base with different methods that have an effect on subclasses when called. Method signatures and docstrings: - def __init__(self, id=None): defining a cls constructor with private cls attribute. (Task 1) - def to_json_string(list_dicti...
239ff141e6d82cf9fcbcdab355bdf2cb283b9f13
<|skeleton|> class Base: """Class called base with different methods that have an effect on subclasses when called.""" def __init__(self, id=None): """defining a cls constructor with private cls attribute. (Task 1)""" <|body_0|> def to_json_string(list_dictionaries): """return the ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Base: """Class called base with different methods that have an effect on subclasses when called.""" def __init__(self, id=None): """defining a cls constructor with private cls attribute. (Task 1)""" if id is not None: self.id = id else: Base.__nb_objects +=...
the_stack_v2_python_sparse
0x0C-python-almost_a_circle/models/base.py
seleniadelgado/holbertonschool-higher_level_programming
train
0
e9a89339d188544f0e198c1ed82ad35310706633
[ "if not head:\n return head\nroot = head\nlast = None\nwhile root:\n if root.val >= x:\n break\n last = root\n root = root.next\nflag = True\nif not last:\n last = ListNode(1)\n last.next = root\n head = last\n flag = False\nif not root:\n return head\nfast = root.next\nwhile fast:...
<|body_start_0|> if not head: return head root = head last = None while root: if root.val >= x: break last = root root = root.next flag = True if not last: last = ListNode(1) last.next...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def _partition(self, head, x): """:type head: ListNode :type x: int :rtype: ListNode""" <|body_0|> def partition(self, head, x): """:type head: ListNode :type x: int :rtype: ListNode""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not h...
stack_v2_sparse_classes_36k_train_020548
2,870
permissive
[ { "docstring": ":type head: ListNode :type x: int :rtype: ListNode", "name": "_partition", "signature": "def _partition(self, head, x)" }, { "docstring": ":type head: ListNode :type x: int :rtype: ListNode", "name": "partition", "signature": "def partition(self, head, x)" } ]
2
stack_v2_sparse_classes_30k_train_020949
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _partition(self, head, x): :type head: ListNode :type x: int :rtype: ListNode - def partition(self, head, x): :type head: ListNode :type x: int :rtype: ListNode
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _partition(self, head, x): :type head: ListNode :type x: int :rtype: ListNode - def partition(self, head, x): :type head: ListNode :type x: int :rtype: ListNode <|skeleton|>...
0dd67edca4e0b0323cb5a7239f02ea46383cd15a
<|skeleton|> class Solution: def _partition(self, head, x): """:type head: ListNode :type x: int :rtype: ListNode""" <|body_0|> def partition(self, head, x): """:type head: ListNode :type x: int :rtype: ListNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def _partition(self, head, x): """:type head: ListNode :type x: int :rtype: ListNode""" if not head: return head root = head last = None while root: if root.val >= x: break last = root root = root...
the_stack_v2_python_sparse
86.partition-list.py
windard/leeeeee
train
0
ba3fe3891cfaab36da0bf47caaf39ff4a5bf5e1f
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "conte...
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
Missing associated documentation comment in .proto file.
ConsensusServicer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConsensusServicer: """Missing associated documentation comment in .proto file.""" def PrePrepare(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def Prepare(self, request, context): """Missing associated document...
stack_v2_sparse_classes_36k_train_020549
24,581
no_license
[ { "docstring": "Missing associated documentation comment in .proto file.", "name": "PrePrepare", "signature": "def PrePrepare(self, request, context)" }, { "docstring": "Missing associated documentation comment in .proto file.", "name": "Prepare", "signature": "def Prepare(self, request,...
3
stack_v2_sparse_classes_30k_train_017735
Implement the Python class `ConsensusServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def PrePrepare(self, request, context): Missing associated documentation comment in .proto file. - def Prepare(self, request, context): Missin...
Implement the Python class `ConsensusServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def PrePrepare(self, request, context): Missing associated documentation comment in .proto file. - def Prepare(self, request, context): Missin...
345bf7df822c4ae5cd9988ffdedae2fa5c1ffd99
<|skeleton|> class ConsensusServicer: """Missing associated documentation comment in .proto file.""" def PrePrepare(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def Prepare(self, request, context): """Missing associated document...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ConsensusServicer: """Missing associated documentation comment in .proto file.""" def PrePrepare(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') ...
the_stack_v2_python_sparse
grpc_pb2_grpc.py
isSPDL/SPDL
train
3
bdd16bb6870ea5a9ded39bef95448c15cdc1223b
[ "super(GraphVisualizerTimeline, self).__init__(grid, column_id, column_span)\nfor i in range(column_span):\n self._grid.setColumnStretch(self._column_id + i, 0)", "painter = QPainter(surface)\nfor connection in self._connected_items:\n start = surface.mapFromGlobal(connection.from_item.get_attach_point_bot(...
<|body_start_0|> super(GraphVisualizerTimeline, self).__init__(grid, column_id, column_span) for i in range(column_span): self._grid.setColumnStretch(self._column_id + i, 0) <|end_body_0|> <|body_start_1|> painter = QPainter(surface) for connection in self._connected_items: ...
Draw a visual column, compressed by another other column.
GraphVisualizerTimeline
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GraphVisualizerTimeline: """Draw a visual column, compressed by another other column.""" def __init__(self, grid, column_id, column_span=1): """Initialize a GraphVisualizerTimeline instance.""" <|body_0|> def draw(self, surface): """Draw the surface.""" <...
stack_v2_sparse_classes_36k_train_020550
24,840
permissive
[ { "docstring": "Initialize a GraphVisualizerTimeline instance.", "name": "__init__", "signature": "def __init__(self, grid, column_id, column_span=1)" }, { "docstring": "Draw the surface.", "name": "draw", "signature": "def draw(self, surface)" } ]
2
stack_v2_sparse_classes_30k_train_004091
Implement the Python class `GraphVisualizerTimeline` described below. Class description: Draw a visual column, compressed by another other column. Method signatures and docstrings: - def __init__(self, grid, column_id, column_span=1): Initialize a GraphVisualizerTimeline instance. - def draw(self, surface): Draw the ...
Implement the Python class `GraphVisualizerTimeline` described below. Class description: Draw a visual column, compressed by another other column. Method signatures and docstrings: - def __init__(self, grid, column_id, column_span=1): Initialize a GraphVisualizerTimeline instance. - def draw(self, surface): Draw the ...
bbcf475a4b4e85836123452053bbbf34cc44063a
<|skeleton|> class GraphVisualizerTimeline: """Draw a visual column, compressed by another other column.""" def __init__(self, grid, column_id, column_span=1): """Initialize a GraphVisualizerTimeline instance.""" <|body_0|> def draw(self, surface): """Draw the surface.""" <...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GraphVisualizerTimeline: """Draw a visual column, compressed by another other column.""" def __init__(self, grid, column_id, column_span=1): """Initialize a GraphVisualizerTimeline instance.""" super(GraphVisualizerTimeline, self).__init__(grid, column_id, column_span) for i in ra...
the_stack_v2_python_sparse
posydon/visualization/VH_diagram/GraphVisualizer.py
POSYDON-code/POSYDON
train
11
2d9ea30849c73f779073d3bbf02547187151091d
[ "examples, metadata = tfds.load('ted_hrlr_translate/pt_to_en', with_info=True, as_supervised=True)\nself.data_train = examples['train']\nself.data_valid = examples['validation']\nself.tokenizer_pt, self.tokenizer_en = self.tokenize_dataset(self.data_train)\n\ndef filter_max_length(x, y, max_len=max_len):\n \"\"\...
<|body_start_0|> examples, metadata = tfds.load('ted_hrlr_translate/pt_to_en', with_info=True, as_supervised=True) self.data_train = examples['train'] self.data_valid = examples['validation'] self.tokenizer_pt, self.tokenizer_en = self.tokenize_dataset(self.data_train) def filte...
Class that loads and preps a dataset for machine translation
Dataset
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Dataset: """Class that loads and preps a dataset for machine translation""" def __init__(self, batch_size, max_len): """Class constructor creates the instance attributes: data_train, which contains the ted_hrlr_translate/pt_to_en tf.data. Dataset train split, loaded as_supervided dat...
stack_v2_sparse_classes_36k_train_020551
4,978
no_license
[ { "docstring": "Class constructor creates the instance attributes: data_train, which contains the ted_hrlr_translate/pt_to_en tf.data. Dataset train split, loaded as_supervided data_valid, which contains the ted_hrlr_translate/pt_to_en tf.data. Dataset validate split, loaded as_supervided tokenizer_pt is the Po...
4
null
Implement the Python class `Dataset` described below. Class description: Class that loads and preps a dataset for machine translation Method signatures and docstrings: - def __init__(self, batch_size, max_len): Class constructor creates the instance attributes: data_train, which contains the ted_hrlr_translate/pt_to_...
Implement the Python class `Dataset` described below. Class description: Class that loads and preps a dataset for machine translation Method signatures and docstrings: - def __init__(self, batch_size, max_len): Class constructor creates the instance attributes: data_train, which contains the ted_hrlr_translate/pt_to_...
e8a98d85b3bfd5665cb04bec9ee8c3eb23d6bd58
<|skeleton|> class Dataset: """Class that loads and preps a dataset for machine translation""" def __init__(self, batch_size, max_len): """Class constructor creates the instance attributes: data_train, which contains the ted_hrlr_translate/pt_to_en tf.data. Dataset train split, loaded as_supervided dat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Dataset: """Class that loads and preps a dataset for machine translation""" def __init__(self, batch_size, max_len): """Class constructor creates the instance attributes: data_train, which contains the ted_hrlr_translate/pt_to_en tf.data. Dataset train split, loaded as_supervided data_valid, whic...
the_stack_v2_python_sparse
supervised_learning/0x12-transformer_apps/3-dataset.py
AndrewMiranda/holbertonschool-machine_learning-1
train
0
117d59c2f010250d9973533a6fbb26ce12c344c8
[ "scans = util.parse_multi_range(','.join(command).replace(' ', ','))\nfor scanno in scans:\n yield backend.Job(scan=scanno)", "super(Input, self).process_job(job)\nscan = job.scan\naaf = numpy.linspace(0, numpy.random.random() * 20, 100)\nadelta = numpy.linspace(0, numpy.random.random() * 20, 100)\naai = numpy...
<|body_start_0|> scans = util.parse_multi_range(','.join(command).replace(' ', ',')) for scanno in scans: yield backend.Job(scan=scanno) <|end_body_0|> <|body_start_1|> super(Input, self).process_job(job) scan = job.scan aaf = numpy.linspace(0, numpy.random.random() ...
Input
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Input: def generate_jobs(self, command): """Command is supplied when the program is started in the terminal. This can used to differentiate between separate datasets that will be processed independently.""" <|body_0|> def process_job(self, job): """This methods is a ...
stack_v2_sparse_classes_36k_train_020552
7,583
no_license
[ { "docstring": "Command is supplied when the program is started in the terminal. This can used to differentiate between separate datasets that will be processed independently.", "name": "generate_jobs", "signature": "def generate_jobs(self, command)" }, { "docstring": "This methods is a generato...
4
stack_v2_sparse_classes_30k_train_014361
Implement the Python class `Input` described below. Class description: Implement the Input class. Method signatures and docstrings: - def generate_jobs(self, command): Command is supplied when the program is started in the terminal. This can used to differentiate between separate datasets that will be processed indep...
Implement the Python class `Input` described below. Class description: Implement the Input class. Method signatures and docstrings: - def generate_jobs(self, command): Command is supplied when the program is started in the terminal. This can used to differentiate between separate datasets that will be processed indep...
2bc9132fd8ee989272e9dc3fdfa1efd98fa681a0
<|skeleton|> class Input: def generate_jobs(self, command): """Command is supplied when the program is started in the terminal. This can used to differentiate between separate datasets that will be processed independently.""" <|body_0|> def process_job(self, job): """This methods is a ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Input: def generate_jobs(self, command): """Command is supplied when the program is started in the terminal. This can used to differentiate between separate datasets that will be processed independently.""" scans = util.parse_multi_range(','.join(command).replace(' ', ',')) for scanno ...
the_stack_v2_python_sparse
binoculars/backends/example.py
picca/binoculars
train
1
a083cbe7228e4a718f29b96cb6aaa3fad557ec4e
[ "self.pool = []\npre = 0\nfor weight in w:\n self.pool.append(pre + weight)\n pre = self.pool[-1]", "if not self.pool:\n return -1\nprint(self.pool)\nimport random\nfrom bisect import bisect_left\nchoice = random.uniform(0, self.pool[-1])\nprint(choice)\nresult = bisect_left(self.pool, choice)\nreturn re...
<|body_start_0|> self.pool = [] pre = 0 for weight in w: self.pool.append(pre + weight) pre = self.pool[-1] <|end_body_0|> <|body_start_1|> if not self.pool: return -1 print(self.pool) import random from bisect import bisect_le...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def __init__(self, w): """:type w: List[int]""" <|body_0|> def pickIndex(self): """:rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.pool = [] pre = 0 for weight in w: self.pool.append(pre + weigh...
stack_v2_sparse_classes_36k_train_020553
1,317
no_license
[ { "docstring": ":type w: List[int]", "name": "__init__", "signature": "def __init__(self, w)" }, { "docstring": ":rtype: int", "name": "pickIndex", "signature": "def pickIndex(self)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, w): :type w: List[int] - def pickIndex(self): :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, w): :type w: List[int] - def pickIndex(self): :rtype: int <|skeleton|> class Solution: def __init__(self, w): """:type w: List[int]""" <|...
11d6bf2ba7b50c07e048df37c4e05c8f46b92241
<|skeleton|> class Solution: def __init__(self, w): """:type w: List[int]""" <|body_0|> def pickIndex(self): """:rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def __init__(self, w): """:type w: List[int]""" self.pool = [] pre = 0 for weight in w: self.pool.append(pre + weight) pre = self.pool[-1] def pickIndex(self): """:rtype: int""" if not self.pool: return -1 ...
the_stack_v2_python_sparse
LeetCodes/uber/Random Pick with Weight.py
chutianwen/LeetCodes
train
0
99fab39e856b6fabb354cf7329d606cb571f2d42
[ "cases = ('string', 1.5)\nfor b in cases:\n with self.subTest(x=b):\n self.assertRaises(TypeError, factorize, b)", "cases = (-1, -10, -100)\nfor b in cases:\n with self.subTest(x=b):\n self.assertRaises(ValueError, factorize, b)", "cases = ((0, (0,)), (1, (1,)))\nfor b, a in cases:\n with...
<|body_start_0|> cases = ('string', 1.5) for b in cases: with self.subTest(x=b): self.assertRaises(TypeError, factorize, b) <|end_body_0|> <|body_start_1|> cases = (-1, -10, -100) for b in cases: with self.subTest(x=b): self.assert...
TestFactorize
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestFactorize: def test_wrong_types_raise_exception(self): """типы float и str (значения 'string', 1.5) вызывают исключение TypeError""" <|body_0|> def test_negative(self): """для отрицательных чисел -1, -10 и -100 вызывается исключение ValueError""" <|body_1...
stack_v2_sparse_classes_36k_train_020554
2,337
no_license
[ { "docstring": "типы float и str (значения 'string', 1.5) вызывают исключение TypeError", "name": "test_wrong_types_raise_exception", "signature": "def test_wrong_types_raise_exception(self)" }, { "docstring": "для отрицательных чисел -1, -10 и -100 вызывается исключение ValueError", "name":...
6
stack_v2_sparse_classes_30k_train_015437
Implement the Python class `TestFactorize` described below. Class description: Implement the TestFactorize class. Method signatures and docstrings: - def test_wrong_types_raise_exception(self): типы float и str (значения 'string', 1.5) вызывают исключение TypeError - def test_negative(self): для отрицательных чисел -...
Implement the Python class `TestFactorize` described below. Class description: Implement the TestFactorize class. Method signatures and docstrings: - def test_wrong_types_raise_exception(self): типы float и str (значения 'string', 1.5) вызывают исключение TypeError - def test_negative(self): для отрицательных чисел -...
0ead3cf3f2fd7ec9a0234092a951328b98da899f
<|skeleton|> class TestFactorize: def test_wrong_types_raise_exception(self): """типы float и str (значения 'string', 1.5) вызывают исключение TypeError""" <|body_0|> def test_negative(self): """для отрицательных чисел -1, -10 и -100 вызывается исключение ValueError""" <|body_1...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestFactorize: def test_wrong_types_raise_exception(self): """типы float и str (значения 'string', 1.5) вызывают исключение TypeError""" cases = ('string', 1.5) for b in cases: with self.subTest(x=b): self.assertRaises(TypeError, factorize, b) def test_...
the_stack_v2_python_sparse
course2/week1/test_factorize.py
shereshevskiy/coursera_python_specialization
train
2
427a77aab7bee7ca1fc1aa9d8b5126cc4d11d290
[ "parser.add_argument('--player', nargs=1, help='Player')\nparser.add_argument('--contest', nargs=1, help='Contest ID', type=int)\nparser.add_argument('--after-date', nargs=1, help='After date', type=convert_to_date)", "players = Player.objects.all()\ncontest_id = None\nafter_date = None\nif 'player' in opts and o...
<|body_start_0|> parser.add_argument('--player', nargs=1, help='Player') parser.add_argument('--contest', nargs=1, help='Contest ID', type=int) parser.add_argument('--after-date', nargs=1, help='After date', type=convert_to_date) <|end_body_0|> <|body_start_1|> players = Player.objects....
A command which loads checkins for a player or many players for a given contest.
Command
[ "CC0-1.0", "LicenseRef-scancode-public-domain" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Command: """A command which loads checkins for a player or many players for a given contest.""" def add_arguments(self, parser): """There are three optional arguments for the command: --player: the user name of the player --contest: the Contest ID --after-date: The date after which t...
stack_v2_sparse_classes_36k_train_020555
2,490
permissive
[ { "docstring": "There are three optional arguments for the command: --player: the user name of the player --contest: the Contest ID --after-date: The date after which to filter the results", "name": "add_arguments", "signature": "def add_arguments(self, parser)" }, { "docstring": "Primarily call...
2
stack_v2_sparse_classes_30k_train_019609
Implement the Python class `Command` described below. Class description: A command which loads checkins for a player or many players for a given contest. Method signatures and docstrings: - def add_arguments(self, parser): There are three optional arguments for the command: --player: the user name of the player --con...
Implement the Python class `Command` described below. Class description: A command which loads checkins for a player or many players for a given contest. Method signatures and docstrings: - def add_arguments(self, parser): There are three optional arguments for the command: --player: the user name of the player --con...
96af46ad946e63736f9924cb3b966b0d597254f5
<|skeleton|> class Command: """A command which loads checkins for a player or many players for a given contest.""" def add_arguments(self, parser): """There are three optional arguments for the command: --player: the user name of the player --contest: the Contest ID --after-date: The date after which t...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Command: """A command which loads checkins for a player or many players for a given contest.""" def add_arguments(self, parser): """There are three optional arguments for the command: --player: the user name of the player --contest: the Contest ID --after-date: The date after which to filter the ...
the_stack_v2_python_sparse
beers/management/commands/load_checkins.py
nvembar/onehundredbeers
train
1
d8e3fedf0eec464df47b8c64cd88a591f96f8570
[ "self.ureg = UnitRegistry()\nself.ureg.define('degC = degK; offset: 273.15 = celsius')\nself.ureg.define('degCS = degK = celsius_step')\nself.ureg.define('degF = 5 / 9 * degK; offset: 255.372222 = fahrenheit')\nself.ureg.define('degFS = 5 / 9 * degK; offset: 0 = fahrenheit_step')\nself.ureg.define('hPa = 100 * Pa =...
<|body_start_0|> self.ureg = UnitRegistry() self.ureg.define('degC = degK; offset: 273.15 = celsius') self.ureg.define('degCS = degK = celsius_step') self.ureg.define('degF = 5 / 9 * degK; offset: 255.372222 = fahrenheit') self.ureg.define('degFS = 5 / 9 * degK; offset: 0 = fahre...
Conversion
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Conversion: def __init__(self): """Setup conversion properties""" <|body_0|> def convert(self, value_orig: float, unit_orig: str, unit_conv: str, step: bool=False): """Performs unit conversions on all values. :param value_orig: original sensor value :param unit_orig:...
stack_v2_sparse_classes_36k_train_020556
3,372
no_license
[ { "docstring": "Setup conversion properties", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Performs unit conversions on all values. :param value_orig: original sensor value :param unit_orig: original unit :param unit_conv: target unit :param step: ignore unit conversi...
2
stack_v2_sparse_classes_30k_train_003362
Implement the Python class `Conversion` described below. Class description: Implement the Conversion class. Method signatures and docstrings: - def __init__(self): Setup conversion properties - def convert(self, value_orig: float, unit_orig: str, unit_conv: str, step: bool=False): Performs unit conversions on all val...
Implement the Python class `Conversion` described below. Class description: Implement the Conversion class. Method signatures and docstrings: - def __init__(self): Setup conversion properties - def convert(self, value_orig: float, unit_orig: str, unit_conv: str, step: bool=False): Performs unit conversions on all val...
23ccfa2b39c0f6fdba5024804ee93dd3e8bc3055
<|skeleton|> class Conversion: def __init__(self): """Setup conversion properties""" <|body_0|> def convert(self, value_orig: float, unit_orig: str, unit_conv: str, step: bool=False): """Performs unit conversions on all values. :param value_orig: original sensor value :param unit_orig:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Conversion: def __init__(self): """Setup conversion properties""" self.ureg = UnitRegistry() self.ureg.define('degC = degK; offset: 273.15 = celsius') self.ureg.define('degCS = degK = celsius_step') self.ureg.define('degF = 5 / 9 * degK; offset: 255.372222 = fahrenheit'...
the_stack_v2_python_sparse
python3/shared/conversion.py
JRGInc/Aurora-Base-Station
train
0
18b8bb37d713cf9dd6a3f7916e23fb55d5a119e2
[ "super().__init__(app, pipeline, id=id, config=config)\nif isinstance(separator, str):\n separator = separator.encode('utf-8')\nself._separator = separator", "latch = None\nfor line in f:\n if line.startswith(self._separator) and latch is not None:\n await self.process(latch)\n latch = line\n ...
<|body_start_0|> super().__init__(app, pipeline, id=id, config=config) if isinstance(separator, str): separator = separator.encode('utf-8') self._separator = separator <|end_body_0|> <|body_start_1|> latch = None for line in f: if line.startswith(self._se...
Description: Read file line by line but try to join multi-line events by separator. Separator is a (fixed) pattern that should present at the begin of the line, if it is a new event. Example: <133>1 2018-03-24T02:37:01+00:00 machine program 22068 - Start of the multiline event 2nd line of the event 3rd line of the even...
FileMultiLineSource
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileMultiLineSource: """Description: Read file line by line but try to join multi-line events by separator. Separator is a (fixed) pattern that should present at the begin of the line, if it is a new event. Example: <133>1 2018-03-24T02:37:01+00:00 machine program 22068 - Start of the multiline e...
stack_v2_sparse_classes_36k_train_020557
2,375
permissive
[ { "docstring": "Description: **Parameters** app: Application Name of the `Application <https://asab.readthedocs.io/en/latest/asab/application.html>`_ pipeline : Pipeline Name of the Pipeline separator : id : ID, default = None config : JSON, default = None Configuration file with additional information", "n...
2
null
Implement the Python class `FileMultiLineSource` described below. Class description: Description: Read file line by line but try to join multi-line events by separator. Separator is a (fixed) pattern that should present at the begin of the line, if it is a new event. Example: <133>1 2018-03-24T02:37:01+00:00 machine p...
Implement the Python class `FileMultiLineSource` described below. Class description: Description: Read file line by line but try to join multi-line events by separator. Separator is a (fixed) pattern that should present at the begin of the line, if it is a new event. Example: <133>1 2018-03-24T02:37:01+00:00 machine p...
11ee3689d0ff6e9b662deeb3fc5e18bb0aabc8f2
<|skeleton|> class FileMultiLineSource: """Description: Read file line by line but try to join multi-line events by separator. Separator is a (fixed) pattern that should present at the begin of the line, if it is a new event. Example: <133>1 2018-03-24T02:37:01+00:00 machine program 22068 - Start of the multiline e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileMultiLineSource: """Description: Read file line by line but try to join multi-line events by separator. Separator is a (fixed) pattern that should present at the begin of the line, if it is a new event. Example: <133>1 2018-03-24T02:37:01+00:00 machine program 22068 - Start of the multiline event 2nd line...
the_stack_v2_python_sparse
bspump/file/filelinesource.py
LibertyAces/BitSwanPump
train
24
733c65661a0cd94f1881009a6c9f808f7d9a6c5f
[ "self.k = k\nself.nums = nums\nself.minheap = nums\nself.maxheap = []\nheapify(self.minheap)\nwhile len(self.minheap) > self.k:\n temp = heappop(self.minheap)\n heappush(self.maxheap, -temp)", "heappush(self.minheap, val)\nif len(self.minheap) == self.k:\n return self.minheap[0]\nelse:\n temp = heappo...
<|body_start_0|> self.k = k self.nums = nums self.minheap = nums self.maxheap = [] heapify(self.minheap) while len(self.minheap) > self.k: temp = heappop(self.minheap) heappush(self.maxheap, -temp) <|end_body_0|> <|body_start_1|> heappush(...
KthLargest
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KthLargest: def __init__(self, k, nums): """:type k: int :type nums: List[int]""" <|body_0|> def add(self, val): """:type val: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.k = k self.nums = nums self.minheap =...
stack_v2_sparse_classes_36k_train_020558
1,156
no_license
[ { "docstring": ":type k: int :type nums: List[int]", "name": "__init__", "signature": "def __init__(self, k, nums)" }, { "docstring": ":type val: int :rtype: int", "name": "add", "signature": "def add(self, val)" } ]
2
stack_v2_sparse_classes_30k_val_000300
Implement the Python class `KthLargest` described below. Class description: Implement the KthLargest class. Method signatures and docstrings: - def __init__(self, k, nums): :type k: int :type nums: List[int] - def add(self, val): :type val: int :rtype: int
Implement the Python class `KthLargest` described below. Class description: Implement the KthLargest class. Method signatures and docstrings: - def __init__(self, k, nums): :type k: int :type nums: List[int] - def add(self, val): :type val: int :rtype: int <|skeleton|> class KthLargest: def __init__(self, k, nu...
0bffe790e8b860e07dd972a4ce577c222bd6dd10
<|skeleton|> class KthLargest: def __init__(self, k, nums): """:type k: int :type nums: List[int]""" <|body_0|> def add(self, val): """:type val: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KthLargest: def __init__(self, k, nums): """:type k: int :type nums: List[int]""" self.k = k self.nums = nums self.minheap = nums self.maxheap = [] heapify(self.minheap) while len(self.minheap) > self.k: temp = heappop(self.minheap) ...
the_stack_v2_python_sparse
Heap/kth_largest_in_a_stream.py
zhenhuiguo1995/Leetcode
train
1
4eb38b61c274f70a4d176d5b732ce1a770e58cc2
[ "kwargs = {'model_admin': self, 'parent_pk': instance_pk}\nview_class = AddChildNodeViewClass\nreturn view_class.as_view(**kwargs)(request)", "urls = super().get_admin_urls_for_registration()\nadd_child_url = re_path(self.url_helper.get_action_url_pattern('add_child'), self.add_child_view, name=self.url_helper.ge...
<|body_start_0|> kwargs = {'model_admin': self, 'parent_pk': instance_pk} view_class = AddChildNodeViewClass return view_class.as_view(**kwargs)(request) <|end_body_0|> <|body_start_1|> urls = super().get_admin_urls_for_registration() add_child_url = re_path(self.url_helper.get_...
Class for presenting taxonomies in admin using modeladmin.
NodeAdmin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NodeAdmin: """Class for presenting taxonomies in admin using modeladmin.""" def add_child_view(self, request, instance_pk): """Generate a class-based view to provide 'add child' functionality.""" <|body_0|> def get_admin_urls_for_registration(self): """Add the ne...
stack_v2_sparse_classes_36k_train_020559
9,499
no_license
[ { "docstring": "Generate a class-based view to provide 'add child' functionality.", "name": "add_child_view", "signature": "def add_child_view(self, request, instance_pk)" }, { "docstring": "Add the new url for add child page to the registered URLs.", "name": "get_admin_urls_for_registration...
2
stack_v2_sparse_classes_30k_train_017059
Implement the Python class `NodeAdmin` described below. Class description: Class for presenting taxonomies in admin using modeladmin. Method signatures and docstrings: - def add_child_view(self, request, instance_pk): Generate a class-based view to provide 'add child' functionality. - def get_admin_urls_for_registrat...
Implement the Python class `NodeAdmin` described below. Class description: Class for presenting taxonomies in admin using modeladmin. Method signatures and docstrings: - def add_child_view(self, request, instance_pk): Generate a class-based view to provide 'add child' functionality. - def get_admin_urls_for_registrat...
b6bd6ecb85b281b03564eef4d7a6f74f59bbd31b
<|skeleton|> class NodeAdmin: """Class for presenting taxonomies in admin using modeladmin.""" def add_child_view(self, request, instance_pk): """Generate a class-based view to provide 'add child' functionality.""" <|body_0|> def get_admin_urls_for_registration(self): """Add the ne...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NodeAdmin: """Class for presenting taxonomies in admin using modeladmin.""" def add_child_view(self, request, instance_pk): """Generate a class-based view to provide 'add child' functionality.""" kwargs = {'model_admin': self, 'parent_pk': instance_pk} view_class = AddChildNodeVie...
the_stack_v2_python_sparse
taxonomy/models.py
fourfridays/umairabbasi.com
train
1
f3e3c7ee3c40be6de2a4ea5a58a5de658adb59c7
[ "if not I.PIL_INSTALLED:\n raise Exception('PIL is not installed. Please install with: pip install pillow>=9.0.1')\nsuper().__init__(device=device, quantize=False, min_transformers_version='4.12.3')\nself.model_name = model_name\nfrom transformers import AutoTokenizer, VisionEncoderDecoderModel, ViTFeatureExtrac...
<|body_start_0|> if not I.PIL_INSTALLED: raise Exception('PIL is not installed. Please install with: pip install pillow>=9.0.1') super().__init__(device=device, quantize=False, min_transformers_version='4.12.3') self.model_name = model_name from transformers import AutoTokeni...
interface to Image Captioner
ImageCaptioner
[ "Apache-2.0", "CC-BY-NC-4.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageCaptioner: """interface to Image Captioner""" def __init__(self, model_name='ydshieh/vit-gpt2-coco-en', device=None): """``` ImageCaptioner constructor Args: model_name(str): name of image captioning model device(str): device to use (e.g., 'cuda', 'cpu') ```""" <|body_0|...
stack_v2_sparse_classes_36k_train_020560
2,526
permissive
[ { "docstring": "``` ImageCaptioner constructor Args: model_name(str): name of image captioning model device(str): device to use (e.g., 'cuda', 'cpu') ```", "name": "__init__", "signature": "def __init__(self, model_name='ydshieh/vit-gpt2-coco-en', device=None)" }, { "docstring": "``` Performs im...
2
stack_v2_sparse_classes_30k_val_000435
Implement the Python class `ImageCaptioner` described below. Class description: interface to Image Captioner Method signatures and docstrings: - def __init__(self, model_name='ydshieh/vit-gpt2-coco-en', device=None): ``` ImageCaptioner constructor Args: model_name(str): name of image captioning model device(str): dev...
Implement the Python class `ImageCaptioner` described below. Class description: interface to Image Captioner Method signatures and docstrings: - def __init__(self, model_name='ydshieh/vit-gpt2-coco-en', device=None): ``` ImageCaptioner constructor Args: model_name(str): name of image captioning model device(str): dev...
ab03ae68053b727cb8907e08c35f265531d1cb3a
<|skeleton|> class ImageCaptioner: """interface to Image Captioner""" def __init__(self, model_name='ydshieh/vit-gpt2-coco-en', device=None): """``` ImageCaptioner constructor Args: model_name(str): name of image captioning model device(str): device to use (e.g., 'cuda', 'cpu') ```""" <|body_0|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImageCaptioner: """interface to Image Captioner""" def __init__(self, model_name='ydshieh/vit-gpt2-coco-en', device=None): """``` ImageCaptioner constructor Args: model_name(str): name of image captioning model device(str): device to use (e.g., 'cuda', 'cpu') ```""" if not I.PIL_INSTALLED...
the_stack_v2_python_sparse
ktrain/vision/caption/core.py
amaiya/ktrain
train
1,217
852e6293933abafe62758b5d62e7aca5ed145b4d
[ "self.SimulatorObj = Simulator(netlist)\nself.simul_timeout = self.SimulatorObj.simul_timeout\nself.netlist = self.SimulatorObj.netlist\npass", "self.assertIsInstance(self.simul_timeout, int)\nself.assertIsInstance(self.netlist, str)\npass" ]
<|body_start_0|> self.SimulatorObj = Simulator(netlist) self.simul_timeout = self.SimulatorObj.simul_timeout self.netlist = self.SimulatorObj.netlist pass <|end_body_0|> <|body_start_1|> self.assertIsInstance(self.simul_timeout, int) self.assertIsInstance(self.netlist, s...
TestSimulatorTypes
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestSimulatorTypes: def setUp(self): """Setup function TestTypes for class Simulator""" <|body_0|> def test_types(self): """Function to test data types for class Simulator""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.SimulatorObj = Simulator...
stack_v2_sparse_classes_36k_train_020561
823
permissive
[ { "docstring": "Setup function TestTypes for class Simulator", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Function to test data types for class Simulator", "name": "test_types", "signature": "def test_types(self)" } ]
2
stack_v2_sparse_classes_30k_train_000352
Implement the Python class `TestSimulatorTypes` described below. Class description: Implement the TestSimulatorTypes class. Method signatures and docstrings: - def setUp(self): Setup function TestTypes for class Simulator - def test_types(self): Function to test data types for class Simulator
Implement the Python class `TestSimulatorTypes` described below. Class description: Implement the TestSimulatorTypes class. Method signatures and docstrings: - def setUp(self): Setup function TestTypes for class Simulator - def test_types(self): Function to test data types for class Simulator <|skeleton|> class Test...
825a0eab64be709efe161b9a48eb54c4bc5c1bef
<|skeleton|> class TestSimulatorTypes: def setUp(self): """Setup function TestTypes for class Simulator""" <|body_0|> def test_types(self): """Function to test data types for class Simulator""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestSimulatorTypes: def setUp(self): """Setup function TestTypes for class Simulator""" self.SimulatorObj = Simulator(netlist) self.simul_timeout = self.SimulatorObj.simul_timeout self.netlist = self.SimulatorObj.netlist pass def test_types(self): """Functi...
the_stack_v2_python_sparse
VLC_devel/class_structure/__auto_gen__/test_Simulator.py
wenh81/vlc_simulator
train
0
62e60d22a69fdf46dd89ae54de6d03d550b1e42e
[ "ret = []\n\ndef helper(left_nums, k):\n if k <= 1:\n return [[num] for num in left_nums]\n left_ret = []\n for i in range(len(left_nums)):\n now_num = left_nums[i]\n nums_backup = [num for num in left_nums]\n left_nums.remove(now_num)\n for nums in helper(left_nums, k - ...
<|body_start_0|> ret = [] def helper(left_nums, k): if k <= 1: return [[num] for num in left_nums] left_ret = [] for i in range(len(left_nums)): now_num = left_nums[i] nums_backup = [num for num in left_nums] ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def combine1(self, n, k): """:type n: int :type k: int :rtype: List[List[int]]""" <|body_0|> def combine(self, n, k): """:type n: int :type k: int :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|> <|body_start_0|> ret = [] de...
stack_v2_sparse_classes_36k_train_020562
1,369
no_license
[ { "docstring": ":type n: int :type k: int :rtype: List[List[int]]", "name": "combine1", "signature": "def combine1(self, n, k)" }, { "docstring": ":type n: int :type k: int :rtype: List[List[int]]", "name": "combine", "signature": "def combine(self, n, k)" } ]
2
stack_v2_sparse_classes_30k_train_020895
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def combine1(self, n, k): :type n: int :type k: int :rtype: List[List[int]] - def combine(self, n, k): :type n: int :type k: int :rtype: List[List[int]]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def combine1(self, n, k): :type n: int :type k: int :rtype: List[List[int]] - def combine(self, n, k): :type n: int :type k: int :rtype: List[List[int]] <|skeleton|> class Solut...
22f208400cd7e13fcf2ebf189e61ccad7e22b098
<|skeleton|> class Solution: def combine1(self, n, k): """:type n: int :type k: int :rtype: List[List[int]]""" <|body_0|> def combine(self, n, k): """:type n: int :type k: int :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def combine1(self, n, k): """:type n: int :type k: int :rtype: List[List[int]]""" ret = [] def helper(left_nums, k): if k <= 1: return [[num] for num in left_nums] left_ret = [] for i in range(len(left_nums)): ...
the_stack_v2_python_sparse
previously_completed/77-Combinations.py
learnerjiahao/leetcode-solve
train
0
2f490cd0259de374ac4039d3c6f49e00d8239416
[ "if not clc.ALIAS:\n Account.GetAccounts()\nreturn clc.ALIAS", "if not clc.LOCATION:\n Account.GetAccounts()\nreturn clc.LOCATION", "if not alias:\n alias = Account.GetAlias()\nr = clc.v1.API.Call('post', 'Account/GetAccountDetails', {'AccountAlias': alias})\nif r['Success'] != True:\n if clc.args:\...
<|body_start_0|> if not clc.ALIAS: Account.GetAccounts() return clc.ALIAS <|end_body_0|> <|body_start_1|> if not clc.LOCATION: Account.GetAccounts() return clc.LOCATION <|end_body_1|> <|body_start_2|> if not alias: alias = Account.GetAlias() ...
Account
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Account: def GetAlias(): """Return specified alias or if none the alias associated with the provided credentials.""" <|body_0|> def GetLocation(): """Return specified location or if none the default location associated with the provided credentials and alias.""" ...
stack_v2_sparse_classes_36k_train_020563
2,685
permissive
[ { "docstring": "Return specified alias or if none the alias associated with the provided credentials.", "name": "GetAlias", "signature": "def GetAlias()" }, { "docstring": "Return specified location or if none the default location associated with the provided credentials and alias.", "name":...
5
stack_v2_sparse_classes_30k_test_000846
Implement the Python class `Account` described below. Class description: Implement the Account class. Method signatures and docstrings: - def GetAlias(): Return specified alias or if none the alias associated with the provided credentials. - def GetLocation(): Return specified location or if none the default location...
Implement the Python class `Account` described below. Class description: Implement the Account class. Method signatures and docstrings: - def GetAlias(): Return specified alias or if none the alias associated with the provided credentials. - def GetLocation(): Return specified location or if none the default location...
b1372d1916e1f21dcb30574a8eaf16239611c732
<|skeleton|> class Account: def GetAlias(): """Return specified alias or if none the alias associated with the provided credentials.""" <|body_0|> def GetLocation(): """Return specified location or if none the default location associated with the provided credentials and alias.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Account: def GetAlias(): """Return specified alias or if none the alias associated with the provided credentials.""" if not clc.ALIAS: Account.GetAccounts() return clc.ALIAS def GetLocation(): """Return specified location or if none the default location associa...
the_stack_v2_python_sparse
src/clc/APIv1/account.py
CenturyLinkCloud/clc-python-sdk
train
19
3f7722d18caafda79df57c30d09bcebcf97edc67
[ "self.chooser = Chooser()\nself.config_file = None\nself.config = ConfigObj()\nif config_file is not None:\n self.load(config_file)", "if self.config is not None and key in self.config:\n return self.config[key]\nelse:\n return None", "if key not in ['chooser', 'config_file', 'config']:\n if self.co...
<|body_start_0|> self.chooser = Chooser() self.config_file = None self.config = ConfigObj() if config_file is not None: self.load(config_file) <|end_body_0|> <|body_start_1|> if self.config is not None and key in self.config: return self.config[key] ...
Set Redux configuration. Configuration values are set as attributes of this object, so that they can be accessed as ``config.value``. If the value is not set in the configuration, None will be returned. Subclasses should set the chooser attribute as appropriate. If unset, this class will use the default `redux.Chooser`...
Configuration
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Configuration: """Set Redux configuration. Configuration values are set as attributes of this object, so that they can be accessed as ``config.value``. If the value is not set in the configuration, None will be returned. Subclasses should set the chooser attribute as appropriate. If unset, this c...
stack_v2_sparse_classes_36k_train_020564
4,871
permissive
[ { "docstring": "Initialize with an optional configuration file. Parameters ---------- config_file : str or dict-like, optional File path to an INI-format configuration file. May alternately be any object accepted by the ConfigObj constructor (e.g. a dictionary of configuration key-value pairs).", "name": "_...
6
null
Implement the Python class `Configuration` described below. Class description: Set Redux configuration. Configuration values are set as attributes of this object, so that they can be accessed as ``config.value``. If the value is not set in the configuration, None will be returned. Subclasses should set the chooser att...
Implement the Python class `Configuration` described below. Class description: Set Redux configuration. Configuration values are set as attributes of this object, so that they can be accessed as ``config.value``. If the value is not set in the configuration, None will be returned. Subclasses should set the chooser att...
493700340cd34d5f319af6f3a562a82135bb30dd
<|skeleton|> class Configuration: """Set Redux configuration. Configuration values are set as attributes of this object, so that they can be accessed as ``config.value``. If the value is not set in the configuration, None will be returned. Subclasses should set the chooser attribute as appropriate. If unset, this c...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Configuration: """Set Redux configuration. Configuration values are set as attributes of this object, so that they can be accessed as ``config.value``. If the value is not set in the configuration, None will be returned. Subclasses should set the chooser attribute as appropriate. If unset, this class will use...
the_stack_v2_python_sparse
sofia_redux/pipeline/configuration.py
SOFIA-USRA/sofia_redux
train
12
e93e366ca062494ce59a1196eb02a3ae4e63152c
[ "super(ReactorItterative, self).__init__(achem, mols)\nself.maxtime = 0.0\nself.time = 1.0\nif isinstance(rngseed, random.Random):\n self.rng = rngseed\nelse:\n self.rng = random.Random(rngseed)", "self.maxtime += time\nwhile self.time < self.maxtime:\n self.mols = tuple(self.rng.sample(self.mols, len(se...
<|body_start_0|> super(ReactorItterative, self).__init__(achem, mols) self.maxtime = 0.0 self.time = 1.0 if isinstance(rngseed, random.Random): self.rng = rngseed else: self.rng = random.Random(rngseed) <|end_body_0|> <|body_start_1|> self.maxtime...
Reactor object that proceeds one reaction at a time.
ReactorItterative
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReactorItterative: """Reactor object that proceeds one reaction at a time.""" def __init__(self, achem, mols, rngseed=None): """:param achem: :py:class:`achemkit.achem.AChem` object or equivalent. :param mols: Molecules to start from. :param rngseed: Instance of :py:class:`random.Ran...
stack_v2_sparse_classes_36k_train_020565
7,950
permissive
[ { "docstring": ":param achem: :py:class:`achemkit.achem.AChem` object or equivalent. :param mols: Molecules to start from. :param rngseed: Instance of :py:class:`random.Random` or seed for :py:class:`random.Random`", "name": "__init__", "signature": "def __init__(self, achem, mols, rngseed=None)" }, ...
2
stack_v2_sparse_classes_30k_val_000341
Implement the Python class `ReactorItterative` described below. Class description: Reactor object that proceeds one reaction at a time. Method signatures and docstrings: - def __init__(self, achem, mols, rngseed=None): :param achem: :py:class:`achemkit.achem.AChem` object or equivalent. :param mols: Molecules to star...
Implement the Python class `ReactorItterative` described below. Class description: Reactor object that proceeds one reaction at a time. Method signatures and docstrings: - def __init__(self, achem, mols, rngseed=None): :param achem: :py:class:`achemkit.achem.AChem` object or equivalent. :param mols: Molecules to star...
4800044693fdf8a228430eae5ee8b0283fde9920
<|skeleton|> class ReactorItterative: """Reactor object that proceeds one reaction at a time.""" def __init__(self, achem, mols, rngseed=None): """:param achem: :py:class:`achemkit.achem.AChem` object or equivalent. :param mols: Molecules to start from. :param rngseed: Instance of :py:class:`random.Ran...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ReactorItterative: """Reactor object that proceeds one reaction at a time.""" def __init__(self, achem, mols, rngseed=None): """:param achem: :py:class:`achemkit.achem.AChem` object or equivalent. :param mols: Molecules to start from. :param rngseed: Instance of :py:class:`random.Random` or seed ...
the_stack_v2_python_sparse
achemkit/sim/simple.py
afaulconbridge/PyAChemKit
train
2
4f05aec9c29fa42108bfd87b5fe24172e86b6f6d
[ "n = len(nums)\nmn = 10 ** 10\nfor j in range(n):\n mn = min(mn, nums[j])\n if mn == nums[j]:\n continue\n for k in range(n - 1, j, -1):\n if nums[k] > mn and nums[k] < nums[j]:\n return True\nreturn False", "n = len(nums)\nst = []\nthird = -10 ** 10\nfor i in range(n - 1, -1, -1...
<|body_start_0|> n = len(nums) mn = 10 ** 10 for j in range(n): mn = min(mn, nums[j]) if mn == nums[j]: continue for k in range(n - 1, j, -1): if nums[k] > mn and nums[k] < nums[j]: return True return...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def find132patternN2(self, nums): """:type nums: List[int] :rtype: bool""" <|body_0|> def find132pattern(self, nums): """:type nums: List[int] :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> n = len(nums) mn = 10 ** 10...
stack_v2_sparse_classes_36k_train_020566
2,493
no_license
[ { "docstring": ":type nums: List[int] :rtype: bool", "name": "find132patternN2", "signature": "def find132patternN2(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: bool", "name": "find132pattern", "signature": "def find132pattern(self, nums)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find132patternN2(self, nums): :type nums: List[int] :rtype: bool - def find132pattern(self, nums): :type nums: List[int] :rtype: bool
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find132patternN2(self, nums): :type nums: List[int] :rtype: bool - def find132pattern(self, nums): :type nums: List[int] :rtype: bool <|skeleton|> class Solution: def f...
810575368ecffa97677bdb51744d1f716140bbb1
<|skeleton|> class Solution: def find132patternN2(self, nums): """:type nums: List[int] :rtype: bool""" <|body_0|> def find132pattern(self, nums): """:type nums: List[int] :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def find132patternN2(self, nums): """:type nums: List[int] :rtype: bool""" n = len(nums) mn = 10 ** 10 for j in range(n): mn = min(mn, nums[j]) if mn == nums[j]: continue for k in range(n - 1, j, -1): ...
the_stack_v2_python_sparse
1/132Pattern.py
bssrdf/pyleet
train
2
980de806b394bb46849606d7e27fdf360354e87e
[ "url = reverse('api-supplier-part-list')\nresponse = self.get(url, {}, expected_code=200)\nself.assertEqual(len(response.data), SupplierPart.objects.count())\nfor supplier in Company.objects.filter(is_supplier=True):\n response = self.get(url, {'supplier': supplier.pk}, expected_code=200)\n self.assertEqual(l...
<|body_start_0|> url = reverse('api-supplier-part-list') response = self.get(url, {}, expected_code=200) self.assertEqual(len(response.data), SupplierPart.objects.count()) for supplier in Company.objects.filter(is_supplier=True): response = self.get(url, {'supplier': supplier...
Unit tests for the SupplierPart API endpoints
SupplierPartTest
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SupplierPartTest: """Unit tests for the SupplierPart API endpoints""" def test_supplier_part_list(self): """Test the SupplierPart API list functionality""" <|body_0|> def test_available(self): """Tests for updating the 'available' field""" <|body_1|> <|e...
stack_v2_sparse_classes_36k_train_020567
19,439
permissive
[ { "docstring": "Test the SupplierPart API list functionality", "name": "test_supplier_part_list", "signature": "def test_supplier_part_list(self)" }, { "docstring": "Tests for updating the 'available' field", "name": "test_available", "signature": "def test_available(self)" } ]
2
stack_v2_sparse_classes_30k_val_000681
Implement the Python class `SupplierPartTest` described below. Class description: Unit tests for the SupplierPart API endpoints Method signatures and docstrings: - def test_supplier_part_list(self): Test the SupplierPart API list functionality - def test_available(self): Tests for updating the 'available' field
Implement the Python class `SupplierPartTest` described below. Class description: Unit tests for the SupplierPart API endpoints Method signatures and docstrings: - def test_supplier_part_list(self): Test the SupplierPart API list functionality - def test_available(self): Tests for updating the 'available' field <|sk...
e88a8e99a5f0b201c67a95cba097c729f090d5e2
<|skeleton|> class SupplierPartTest: """Unit tests for the SupplierPart API endpoints""" def test_supplier_part_list(self): """Test the SupplierPart API list functionality""" <|body_0|> def test_available(self): """Tests for updating the 'available' field""" <|body_1|> <|e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SupplierPartTest: """Unit tests for the SupplierPart API endpoints""" def test_supplier_part_list(self): """Test the SupplierPart API list functionality""" url = reverse('api-supplier-part-list') response = self.get(url, {}, expected_code=200) self.assertEqual(len(response...
the_stack_v2_python_sparse
InvenTree/company/test_api.py
inventree/InvenTree
train
3,077
4da9a8d6b9a296b468d24675bdae85aa71eb0f92
[ "super().__init__(name, data)\nself.poly_deg = poly_deg\nself.spacing = np.diff(data)[0]\nif np.allclose(self.spacing, np.diff(data)) is not True:\n print('Error in computing spacing - points are not evenly spaced!')", "terms_dict = {self.name: self.data}\npoly_terms = self.generate_poly_terms()\nterms_dict.up...
<|body_start_0|> super().__init__(name, data) self.poly_deg = poly_deg self.spacing = np.diff(data)[0] if np.allclose(self.spacing, np.diff(data)) is not True: print('Error in computing spacing - points are not evenly spaced!') <|end_body_0|> <|body_start_1|> terms_d...
Define IndependentVariable class and utility functions.
IndependentVariable
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IndependentVariable: """Define IndependentVariable class and utility functions.""" def __init__(self, name: str, data: np.ndarray, poly_deg: int=3): """Initialize attributes for independent variables. Keyword arguments: name -- string used to generate descriptors for candidate fn lib...
stack_v2_sparse_classes_36k_train_020568
2,726
permissive
[ { "docstring": "Initialize attributes for independent variables. Keyword arguments: name -- string used to generate descriptors for candidate fn library data -- numpy array with relevant data for the dependent variable poly_deg -- maximum order polynomial term computed (e.g. a poly_deg of 3 means terms_dict wil...
3
stack_v2_sparse_classes_30k_train_019199
Implement the Python class `IndependentVariable` described below. Class description: Define IndependentVariable class and utility functions. Method signatures and docstrings: - def __init__(self, name: str, data: np.ndarray, poly_deg: int=3): Initialize attributes for independent variables. Keyword arguments: name --...
Implement the Python class `IndependentVariable` described below. Class description: Define IndependentVariable class and utility functions. Method signatures and docstrings: - def __init__(self, name: str, data: np.ndarray, poly_deg: int=3): Initialize attributes for independent variables. Keyword arguments: name --...
ac5b2bb4854bb311e4f6f26b180dde87cc10c13d
<|skeleton|> class IndependentVariable: """Define IndependentVariable class and utility functions.""" def __init__(self, name: str, data: np.ndarray, poly_deg: int=3): """Initialize attributes for independent variables. Keyword arguments: name -- string used to generate descriptors for candidate fn lib...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class IndependentVariable: """Define IndependentVariable class and utility functions.""" def __init__(self, name: str, data: np.ndarray, poly_deg: int=3): """Initialize attributes for independent variables. Keyword arguments: name -- string used to generate descriptors for candidate fn library data -- ...
the_stack_v2_python_sparse
sindy_bvp/variables/independent_variable.py
AI-and-ML/SINDy-BVP
train
0
b95b137089dccb01f0880d42a17391b41b191dca
[ "if server_ip == '' and server_port != 0 or (server_ip != '' and server_port == 0):\n raise Exception('server_ip和server_port必须同时指定')\nself._server_ip = server_ip\nself._server_port = server_port\nself._service_name = service_name\nself._host = host", "headers = {'org': org, 'user': user}\nroute_name = ''\nserv...
<|body_start_0|> if server_ip == '' and server_port != 0 or (server_ip != '' and server_port == 0): raise Exception('server_ip和server_port必须同时指定') self._server_ip = server_ip self._server_port = server_port self._service_name = service_name self._host = host <|end_bod...
DbclientClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DbclientClient: def __init__(self, server_ip='', server_port=0, service_name='', host=''): """初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和serv...
stack_v2_sparse_classes_36k_train_020569
8,137
permissive
[ { "docstring": "初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和service_name同时设置,server_ip优先级更高 :param host: 指定sdk请求服务的host名称, 如cmdb.easyops-only.com", "name": "__ini...
5
null
Implement the Python class `DbclientClient` described below. Class description: Implement the DbclientClient class. Method signatures and docstrings: - def __init__(self, server_ip='', server_port=0, service_name='', host=''): 初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server...
Implement the Python class `DbclientClient` described below. Class description: Implement the DbclientClient class. Method signatures and docstrings: - def __init__(self, server_ip='', server_port=0, service_name='', host=''): 初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server...
adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0
<|skeleton|> class DbclientClient: def __init__(self, server_ip='', server_port=0, service_name='', host=''): """初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和serv...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DbclientClient: def __init__(self, server_ip='', server_port=0, service_name='', host=''): """初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和service_name同时设置,s...
the_stack_v2_python_sparse
database_delivery_sdk/api/dbclient/dbclient_client.py
easyopsapis/easyops-api-python
train
5
a4527586dc3a0203a25b5cb9fc0ae3d4cb2b48cf
[ "super(BCPolicy, self).__init__(seed, brain, trainer_parameters)\nwith self.graph.as_default():\n with self.graph.as_default():\n self.model = BehavioralCloningModel(h_size=int(trainer_parameters['hidden_units']), lr=float(trainer_parameters['learning_rate']), n_layers=int(trainer_parameters['num_layers']...
<|body_start_0|> super(BCPolicy, self).__init__(seed, brain, trainer_parameters) with self.graph.as_default(): with self.graph.as_default(): self.model = BehavioralCloningModel(h_size=int(trainer_parameters['hidden_units']), lr=float(trainer_parameters['learning_rate']), n_la...
BCPolicy
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BCPolicy: def __init__(self, seed, brain, trainer_parameters, load): """:param seed: Random seed. :param brain: Assigned Brain object. :param trainer_parameters: Defined training parameters. :param load: Whether a pre-trained model will be loaded or a new one created.""" <|body_0...
stack_v2_sparse_classes_36k_train_020570
3,647
permissive
[ { "docstring": ":param seed: Random seed. :param brain: Assigned Brain object. :param trainer_parameters: Defined training parameters. :param load: Whether a pre-trained model will be loaded or a new one created.", "name": "__init__", "signature": "def __init__(self, seed, brain, trainer_parameters, loa...
3
null
Implement the Python class `BCPolicy` described below. Class description: Implement the BCPolicy class. Method signatures and docstrings: - def __init__(self, seed, brain, trainer_parameters, load): :param seed: Random seed. :param brain: Assigned Brain object. :param trainer_parameters: Defined training parameters. ...
Implement the Python class `BCPolicy` described below. Class description: Implement the BCPolicy class. Method signatures and docstrings: - def __init__(self, seed, brain, trainer_parameters, load): :param seed: Random seed. :param brain: Assigned Brain object. :param trainer_parameters: Defined training parameters. ...
334df1e8afbfff3544413ade46fb12f03556014b
<|skeleton|> class BCPolicy: def __init__(self, seed, brain, trainer_parameters, load): """:param seed: Random seed. :param brain: Assigned Brain object. :param trainer_parameters: Defined training parameters. :param load: Whether a pre-trained model will be loaded or a new one created.""" <|body_0...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BCPolicy: def __init__(self, seed, brain, trainer_parameters, load): """:param seed: Random seed. :param brain: Assigned Brain object. :param trainer_parameters: Defined training parameters. :param load: Whether a pre-trained model will be loaded or a new one created.""" super(BCPolicy, self)....
the_stack_v2_python_sparse
mlagents/trainers/bc/policy.py
Abluceli/HRG-SAC
train
7
e027a9183c2c149dd94aeeaa48900e5a483960bd
[ "super().__init__()\nself._img_size = config.get('img_size')\nself._input_channel = config.get('input_channel')\nself._filter_sizes = config.get('filter_size')\nself._kernel_size = config.get('kernel_size')\nself._padding = padding\nself._stride = stride\nself._dilation = dilation\nself._encoder_maxpool_count = con...
<|body_start_0|> super().__init__() self._img_size = config.get('img_size') self._input_channel = config.get('input_channel') self._filter_sizes = config.get('filter_size') self._kernel_size = config.get('kernel_size') self._padding = padding self._stride = stride...
Stochastic_Conv_Encoder
Stochastic_Conv_Encoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Stochastic_Conv_Encoder: """Stochastic_Conv_Encoder""" def __init__(self, config, padding=0, stride=2, dilation=1): """NP""" <|body_0|> def forward(self, inputs): """Args: input : imamges (num_tasks, num_points (way * shot), img_size, img_size) Return: output :""...
stack_v2_sparse_classes_36k_train_020571
18,202
no_license
[ { "docstring": "NP", "name": "__init__", "signature": "def __init__(self, config, padding=0, stride=2, dilation=1)" }, { "docstring": "Args: input : imamges (num_tasks, num_points (way * shot), img_size, img_size) Return: output :", "name": "forward", "signature": "def forward(self, inpu...
2
stack_v2_sparse_classes_30k_val_000261
Implement the Python class `Stochastic_Conv_Encoder` described below. Class description: Stochastic_Conv_Encoder Method signatures and docstrings: - def __init__(self, config, padding=0, stride=2, dilation=1): NP - def forward(self, inputs): Args: input : imamges (num_tasks, num_points (way * shot), img_size, img_siz...
Implement the Python class `Stochastic_Conv_Encoder` described below. Class description: Stochastic_Conv_Encoder Method signatures and docstrings: - def __init__(self, config, padding=0, stride=2, dilation=1): NP - def forward(self, inputs): Args: input : imamges (num_tasks, num_points (way * shot), img_size, img_siz...
c7e1bfb49ebaec6937ed7b186689227f95a43e0f
<|skeleton|> class Stochastic_Conv_Encoder: """Stochastic_Conv_Encoder""" def __init__(self, config, padding=0, stride=2, dilation=1): """NP""" <|body_0|> def forward(self, inputs): """Args: input : imamges (num_tasks, num_points (way * shot), img_size, img_size) Return: output :""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Stochastic_Conv_Encoder: """Stochastic_Conv_Encoder""" def __init__(self, config, padding=0, stride=2, dilation=1): """NP""" super().__init__() self._img_size = config.get('img_size') self._input_channel = config.get('input_channel') self._filter_sizes = config.get...
the_stack_v2_python_sparse
model/MAML/Part/encoder.py
MingyuKim87/MLwM
train
0
265d8e1b2f842eb1761661a7212ee27d8a02a985
[ "super().__init__(dev=dev, qubits=qubits, fluxlines_dict=fluxlines_dict, **kw)\nself.fluxlines_dict = fluxlines_dict\nroutines_utils.append_DCsources(self)\nself.results: Dict[str, ParkAndQubitSpectroscopyResults] = {}\nfor qb in self.qubits:\n flux, voltage = routines_utils.get_qubit_flux_and_voltage(qb=qb, flu...
<|body_start_0|> super().__init__(dev=dev, qubits=qubits, fluxlines_dict=fluxlines_dict, **kw) self.fluxlines_dict = fluxlines_dict routines_utils.append_DCsources(self) self.results: Dict[str, ParkAndQubitSpectroscopyResults] = {} for qb in self.qubits: flux, voltage...
AutomaticRoutine that parks a qubit at the specified spot where it performs an AdaptiveQubitSpectroscopy routine to find its ge_freq. The flux and voltage, together with initial and measured values for ge_freq, can be retrieved from the `results` attribute. In the case where the requested parking point is different fro...
ParkAndQubitSpectroscopy
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ParkAndQubitSpectroscopy: """AutomaticRoutine that parks a qubit at the specified spot where it performs an AdaptiveQubitSpectroscopy routine to find its ge_freq. The flux and voltage, together with initial and measured values for ge_freq, can be retrieved from the `results` attribute. In the cas...
stack_v2_sparse_classes_36k_train_020572
9,956
permissive
[ { "docstring": "Initializes the ParkAndQubitSpectroscopy routine. The fluxes and/or voltages at which the AdaptiveQubitSpectroscopies are run are specified with the settings of SetBiasVoltageAndFluxPulseAssistedReadOut. If no settings are specified there, it is possible to use the 'General' scope of ParkAndQubi...
3
stack_v2_sparse_classes_30k_train_009051
Implement the Python class `ParkAndQubitSpectroscopy` described below. Class description: AutomaticRoutine that parks a qubit at the specified spot where it performs an AdaptiveQubitSpectroscopy routine to find its ge_freq. The flux and voltage, together with initial and measured values for ge_freq, can be retrieved f...
Implement the Python class `ParkAndQubitSpectroscopy` described below. Class description: AutomaticRoutine that parks a qubit at the specified spot where it performs an AdaptiveQubitSpectroscopy routine to find its ge_freq. The flux and voltage, together with initial and measured values for ge_freq, can be retrieved f...
bc6733d774fe31a23f4c7e73e5eb0beed8d30e7d
<|skeleton|> class ParkAndQubitSpectroscopy: """AutomaticRoutine that parks a qubit at the specified spot where it performs an AdaptiveQubitSpectroscopy routine to find its ge_freq. The flux and voltage, together with initial and measured values for ge_freq, can be retrieved from the `results` attribute. In the cas...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ParkAndQubitSpectroscopy: """AutomaticRoutine that parks a qubit at the specified spot where it performs an AdaptiveQubitSpectroscopy routine to find its ge_freq. The flux and voltage, together with initial and measured values for ge_freq, can be retrieved from the `results` attribute. In the case where the r...
the_stack_v2_python_sparse
pycqed/measurement/calibration/automatic_calibration_routines/park_and_qubit_spectroscopy.py
QudevETH/PycQED_py3
train
8
9f88d859633b506dc00d9689f06b08a9846b075d
[ "self.author = Author.objects.create(name='Test Name', email='testemail@email.com', address='Test address', bio='Test bio')\nself.publisher = publisher = Publisher.objects.create(name='Test Name', address='Test address', email='testemail@email.com', publisher_url='http://testpublisherurl.com')\nself.book = Book.obj...
<|body_start_0|> self.author = Author.objects.create(name='Test Name', email='testemail@email.com', address='Test address', bio='Test bio') self.publisher = publisher = Publisher.objects.create(name='Test Name', address='Test address', email='testemail@email.com', publisher_url='http://testpublisherurl....
Test casees for the Book model
BookTestCase
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BookTestCase: """Test casees for the Book model""" def setUp(self): """Set up data to be used in test cases""" <|body_0|> def test_model_fields_with_correct_values(self): """Test the model fields with correct values.""" <|body_1|> def test_model_fiel...
stack_v2_sparse_classes_36k_train_020573
12,307
permissive
[ { "docstring": "Set up data to be used in test cases", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Test the model fields with correct values.", "name": "test_model_fields_with_correct_values", "signature": "def test_model_fields_with_correct_values(self)" }, { ...
6
stack_v2_sparse_classes_30k_train_007415
Implement the Python class `BookTestCase` described below. Class description: Test casees for the Book model Method signatures and docstrings: - def setUp(self): Set up data to be used in test cases - def test_model_fields_with_correct_values(self): Test the model fields with correct values. - def test_model_fields_w...
Implement the Python class `BookTestCase` described below. Class description: Test casees for the Book model Method signatures and docstrings: - def setUp(self): Set up data to be used in test cases - def test_model_fields_with_correct_values(self): Test the model fields with correct values. - def test_model_fields_w...
a364e9997c1c91b09f5db8a004deb4df305fa8cf
<|skeleton|> class BookTestCase: """Test casees for the Book model""" def setUp(self): """Set up data to be used in test cases""" <|body_0|> def test_model_fields_with_correct_values(self): """Test the model fields with correct values.""" <|body_1|> def test_model_fiel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BookTestCase: """Test casees for the Book model""" def setUp(self): """Set up data to be used in test cases""" self.author = Author.objects.create(name='Test Name', email='testemail@email.com', address='Test address', bio='Test bio') self.publisher = publisher = Publisher.objects....
the_stack_v2_python_sparse
libStash/books/tests.py
Dev-Rem/libStash
train
0
dd3a6d3378d1f21e072c9b0411a2059d9e429d9e
[ "self.device_tree = device_tree\nself.logical_volume_name = logical_volume_name\nself.logical_volume_uuid = logical_volume_uuid\nself.volume_group_name = volume_group_name\nself.volume_group_uuid = volume_group_uuid", "if dictionary is None:\n return None\ndevice_tree = cohesity_management_sdk.models.device_tr...
<|body_start_0|> self.device_tree = device_tree self.logical_volume_name = logical_volume_name self.logical_volume_uuid = logical_volume_uuid self.volume_group_name = volume_group_name self.volume_group_uuid = volume_group_uuid <|end_body_0|> <|body_start_1|> if dictiona...
Implementation of the 'VolumeInfo_LogicalVolumeInfo' model. This is extra attribute which uniquely identifies a logical volume in LVM or LDM. Attributes: device_tree (DeviceTree): The tree defining how to combine partitions to create this logical volume. logical_volume_name (string): Logical volume name. logical_volume...
VolumeInfo_LogicalVolumeInfo
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VolumeInfo_LogicalVolumeInfo: """Implementation of the 'VolumeInfo_LogicalVolumeInfo' model. This is extra attribute which uniquely identifies a logical volume in LVM or LDM. Attributes: device_tree (DeviceTree): The tree defining how to combine partitions to create this logical volume. logical_v...
stack_v2_sparse_classes_36k_train_020574
2,832
permissive
[ { "docstring": "Constructor for the VolumeInfo_LogicalVolumeInfo class", "name": "__init__", "signature": "def __init__(self, device_tree=None, logical_volume_name=None, logical_volume_uuid=None, volume_group_name=None, volume_group_uuid=None)" }, { "docstring": "Creates an instance of this mode...
2
stack_v2_sparse_classes_30k_train_002311
Implement the Python class `VolumeInfo_LogicalVolumeInfo` described below. Class description: Implementation of the 'VolumeInfo_LogicalVolumeInfo' model. This is extra attribute which uniquely identifies a logical volume in LVM or LDM. Attributes: device_tree (DeviceTree): The tree defining how to combine partitions t...
Implement the Python class `VolumeInfo_LogicalVolumeInfo` described below. Class description: Implementation of the 'VolumeInfo_LogicalVolumeInfo' model. This is extra attribute which uniquely identifies a logical volume in LVM or LDM. Attributes: device_tree (DeviceTree): The tree defining how to combine partitions t...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class VolumeInfo_LogicalVolumeInfo: """Implementation of the 'VolumeInfo_LogicalVolumeInfo' model. This is extra attribute which uniquely identifies a logical volume in LVM or LDM. Attributes: device_tree (DeviceTree): The tree defining how to combine partitions to create this logical volume. logical_v...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class VolumeInfo_LogicalVolumeInfo: """Implementation of the 'VolumeInfo_LogicalVolumeInfo' model. This is extra attribute which uniquely identifies a logical volume in LVM or LDM. Attributes: device_tree (DeviceTree): The tree defining how to combine partitions to create this logical volume. logical_volume_name (s...
the_stack_v2_python_sparse
cohesity_management_sdk/models/volume_info_logical_volume_info.py
cohesity/management-sdk-python
train
24
5517b21befbc475c798db26286b46a79e8f7b66b
[ "self.n = ZZ(n)\nself.m = m\nself.__i = 0\nself.K = IntegerModRing(q)\nself.FM = FreeModule(self.K, n)\nself.D = D\nself.secret_dist = secret_dist\nif secret_dist == 'uniform':\n self.__s = random_vector(self.K, self.n)\nelif secret_dist == 'noise':\n self.__s = vector(self.K, self.n, [self.D() for _ in range...
<|body_start_0|> self.n = ZZ(n) self.m = m self.__i = 0 self.K = IntegerModRing(q) self.FM = FreeModule(self.K, n) self.D = D self.secret_dist = secret_dist if secret_dist == 'uniform': self.__s = random_vector(self.K, self.n) elif secr...
Learning with Errors (LWE) oracle. .. automethod:: __init__ .. automethod:: __call__
LWE
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LWE: """Learning with Errors (LWE) oracle. .. automethod:: __init__ .. automethod:: __call__""" def __init__(self, n, q, D, secret_dist='uniform', m=None): """Construct an LWE oracle in dimension ``n`` over a ring of order ``q`` with noise distribution ``D``. INPUT: - ``n`` - dimensi...
stack_v2_sparse_classes_36k_train_020575
31,769
no_license
[ { "docstring": "Construct an LWE oracle in dimension ``n`` over a ring of order ``q`` with noise distribution ``D``. INPUT: - ``n`` - dimension (integer > 0) - ``q`` - modulus typically > n (integer > 0) - ``D`` - an error distribution such as an instance of :class:`DiscreteGaussianDistributionIntegerSampler` o...
3
stack_v2_sparse_classes_30k_train_011482
Implement the Python class `LWE` described below. Class description: Learning with Errors (LWE) oracle. .. automethod:: __init__ .. automethod:: __call__ Method signatures and docstrings: - def __init__(self, n, q, D, secret_dist='uniform', m=None): Construct an LWE oracle in dimension ``n`` over a ring of order ``q`...
Implement the Python class `LWE` described below. Class description: Learning with Errors (LWE) oracle. .. automethod:: __init__ .. automethod:: __call__ Method signatures and docstrings: - def __init__(self, n, q, D, secret_dist='uniform', m=None): Construct an LWE oracle in dimension ``n`` over a ring of order ``q`...
0d9eacbf74e2acffefde93e39f8bcbec745cdaba
<|skeleton|> class LWE: """Learning with Errors (LWE) oracle. .. automethod:: __init__ .. automethod:: __call__""" def __init__(self, n, q, D, secret_dist='uniform', m=None): """Construct an LWE oracle in dimension ``n`` over a ring of order ``q`` with noise distribution ``D``. INPUT: - ``n`` - dimensi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LWE: """Learning with Errors (LWE) oracle. .. automethod:: __init__ .. automethod:: __call__""" def __init__(self, n, q, D, secret_dist='uniform', m=None): """Construct an LWE oracle in dimension ``n`` over a ring of order ``q`` with noise distribution ``D``. INPUT: - ``n`` - dimension (integer >...
the_stack_v2_python_sparse
sage/src/sage/crypto/lwe.py
bopopescu/geosci
train
0
34bd14745ee405713abcf63a74837d4c52a05538
[ "if not email_messages:\n return\nself._lock.acquire()\ntry:\n try:\n stream_created = self.open()\n for message in email_messages:\n self.stream.write(message.body.encode('utf-8'))\n self.stream.flush()\n if stream_created:\n self.close()\n except:\n ...
<|body_start_0|> if not email_messages: return self._lock.acquire() try: try: stream_created = self.open() for message in email_messages: self.stream.write(message.body.encode('utf-8')) self.stream.fl...
EmailBackend
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EmailBackend: def send_messages(self, email_messages): """Write all messages to the stream in a thread-safe way.""" <|body_0|> def _get_filename(self): """Return a unique file name.""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not email_messag...
stack_v2_sparse_classes_36k_train_020576
1,336
no_license
[ { "docstring": "Write all messages to the stream in a thread-safe way.", "name": "send_messages", "signature": "def send_messages(self, email_messages)" }, { "docstring": "Return a unique file name.", "name": "_get_filename", "signature": "def _get_filename(self)" } ]
2
stack_v2_sparse_classes_30k_train_008145
Implement the Python class `EmailBackend` described below. Class description: Implement the EmailBackend class. Method signatures and docstrings: - def send_messages(self, email_messages): Write all messages to the stream in a thread-safe way. - def _get_filename(self): Return a unique file name.
Implement the Python class `EmailBackend` described below. Class description: Implement the EmailBackend class. Method signatures and docstrings: - def send_messages(self, email_messages): Write all messages to the stream in a thread-safe way. - def _get_filename(self): Return a unique file name. <|skeleton|> class ...
7c3acc39a24c38ae2ee06b71104a24cfbbde8453
<|skeleton|> class EmailBackend: def send_messages(self, email_messages): """Write all messages to the stream in a thread-safe way.""" <|body_0|> def _get_filename(self): """Return a unique file name.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EmailBackend: def send_messages(self, email_messages): """Write all messages to the stream in a thread-safe way.""" if not email_messages: return self._lock.acquire() try: try: stream_created = self.open() for message in e...
the_stack_v2_python_sparse
project/utils/mail/backends/htmlfiles.py
chrisblythe812/gamemine
train
1
76345358b76cfc3e09dde5d31927ab4f1ae17243
[ "EasyFrame.__init__(self, title='Button Demo')\nself.label = self.addLabel(text='Hello world!', row=0, column=0, columnspan=2, sticky='NSEW')\nself.clearBtn = self.addButton(text='Clear', row=1, column=0, command=self.clear)\nself.restoreBtn = self.addButton(text='Restore', row=1, column=1, command=self.restore, st...
<|body_start_0|> EasyFrame.__init__(self, title='Button Demo') self.label = self.addLabel(text='Hello world!', row=0, column=0, columnspan=2, sticky='NSEW') self.clearBtn = self.addButton(text='Clear', row=1, column=0, command=self.clear) self.restoreBtn = self.addButton(text='Restore', ...
Illustrates command buttons and user events.
ButtonDemo
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ButtonDemo: """Illustrates command buttons and user events.""" def __init__(self): """Sets up the window, label, and buttons.""" <|body_0|> def clear(self): """Resets the label to the empty string and the button states.""" <|body_1|> def restore(self...
stack_v2_sparse_classes_36k_train_020577
1,619
no_license
[ { "docstring": "Sets up the window, label, and buttons.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Resets the label to the empty string and the button states.", "name": "clear", "signature": "def clear(self)" }, { "docstring": "Resets the label to ...
3
null
Implement the Python class `ButtonDemo` described below. Class description: Illustrates command buttons and user events. Method signatures and docstrings: - def __init__(self): Sets up the window, label, and buttons. - def clear(self): Resets the label to the empty string and the button states. - def restore(self): R...
Implement the Python class `ButtonDemo` described below. Class description: Illustrates command buttons and user events. Method signatures and docstrings: - def __init__(self): Sets up the window, label, and buttons. - def clear(self): Resets the label to the empty string and the button states. - def restore(self): R...
30375264cf0103e3455fdf92c35a2c5c15b5d7ef
<|skeleton|> class ButtonDemo: """Illustrates command buttons and user events.""" def __init__(self): """Sets up the window, label, and buttons.""" <|body_0|> def clear(self): """Resets the label to the empty string and the button states.""" <|body_1|> def restore(self...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ButtonDemo: """Illustrates command buttons and user events.""" def __init__(self): """Sets up the window, label, and buttons.""" EasyFrame.__init__(self, title='Button Demo') self.label = self.addLabel(text='Hello world!', row=0, column=0, columnspan=2, sticky='NSEW') self...
the_stack_v2_python_sparse
Student_Files/ch_08_Student_Files/buttondemo.py
davelpat/Fundamentals_of_Python
train
1
183e355df6fd630d0c65ef9fac58ef286556ee20
[ "self.k_heap = []\nself.k = k\nfor i, x in enumerate(nums):\n if i < k:\n heapq.heappush(self.k_heap, x)\n elif self.k_heap[0] < x:\n heapq.heappop(self.k_heap)\n heapq.heappush(self.k_heap, x)", "if len(self.k_heap) < self.k:\n heapq.heappush(self.k_heap, val)\n return self.k_hea...
<|body_start_0|> self.k_heap = [] self.k = k for i, x in enumerate(nums): if i < k: heapq.heappush(self.k_heap, x) elif self.k_heap[0] < x: heapq.heappop(self.k_heap) heapq.heappush(self.k_heap, x) <|end_body_0|> <|body_sta...
KthLargest
[ "LicenseRef-scancode-warranty-disclaimer" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KthLargest: def __init__(self, k, nums): """:type k: int :type nums: List[int]""" <|body_0|> def add(self, val): """:type val: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.k_heap = [] self.k = k for i, x in en...
stack_v2_sparse_classes_36k_train_020578
932
no_license
[ { "docstring": ":type k: int :type nums: List[int]", "name": "__init__", "signature": "def __init__(self, k, nums)" }, { "docstring": ":type val: int :rtype: int", "name": "add", "signature": "def add(self, val)" } ]
2
stack_v2_sparse_classes_30k_train_019379
Implement the Python class `KthLargest` described below. Class description: Implement the KthLargest class. Method signatures and docstrings: - def __init__(self, k, nums): :type k: int :type nums: List[int] - def add(self, val): :type val: int :rtype: int
Implement the Python class `KthLargest` described below. Class description: Implement the KthLargest class. Method signatures and docstrings: - def __init__(self, k, nums): :type k: int :type nums: List[int] - def add(self, val): :type val: int :rtype: int <|skeleton|> class KthLargest: def __init__(self, k, nu...
1c273eadfbf4bef9323a0f386717ac8e7ad2ba71
<|skeleton|> class KthLargest: def __init__(self, k, nums): """:type k: int :type nums: List[int]""" <|body_0|> def add(self, val): """:type val: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KthLargest: def __init__(self, k, nums): """:type k: int :type nums: List[int]""" self.k_heap = [] self.k = k for i, x in enumerate(nums): if i < k: heapq.heappush(self.k_heap, x) elif self.k_heap[0] < x: heapq.heappop(sel...
the_stack_v2_python_sparse
Algorithm/streamKlagest.py
jackwang816/python_practice
train
0
f502e9991cd992172521f865a1ae6ce1d8409c11
[ "raw = cls.validate_payload(payload)\nweekday = (raw[0] & 224) >> 5\nhours = raw[0] & 31\nminutes = raw[1] & 63\nseconds = raw[2] & 63\nif not DPTTime._test_range(weekday, hours, minutes, seconds):\n raise ConversionError('Could not parse DPTTime', raw=raw)\ntry:\n if weekday == 0:\n weekday = 1\n e...
<|body_start_0|> raw = cls.validate_payload(payload) weekday = (raw[0] & 224) >> 5 hours = raw[0] & 31 minutes = raw[1] & 63 seconds = raw[2] & 63 if not DPTTime._test_range(weekday, hours, minutes, seconds): raise ConversionError('Could not parse DPTTime', ra...
Abstraction for KNX 3 Octet Time. DPT 10.001
DPTTime
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DPTTime: """Abstraction for KNX 3 Octet Time. DPT 10.001""" def from_knx(cls, payload: DPTArray | DPTBinary) -> time.struct_time: """Parse/deserialize from KNX/IP raw data.""" <|body_0|> def to_knx(cls, value: time.struct_time) -> DPTArray: """Serialize to KNX/IP...
stack_v2_sparse_classes_36k_train_020579
2,699
permissive
[ { "docstring": "Parse/deserialize from KNX/IP raw data.", "name": "from_knx", "signature": "def from_knx(cls, payload: DPTArray | DPTBinary) -> time.struct_time" }, { "docstring": "Serialize to KNX/IP raw data from dict with elements weekday,hours,minutes,seconds.", "name": "to_knx", "si...
3
stack_v2_sparse_classes_30k_train_012812
Implement the Python class `DPTTime` described below. Class description: Abstraction for KNX 3 Octet Time. DPT 10.001 Method signatures and docstrings: - def from_knx(cls, payload: DPTArray | DPTBinary) -> time.struct_time: Parse/deserialize from KNX/IP raw data. - def to_knx(cls, value: time.struct_time) -> DPTArray...
Implement the Python class `DPTTime` described below. Class description: Abstraction for KNX 3 Octet Time. DPT 10.001 Method signatures and docstrings: - def from_knx(cls, payload: DPTArray | DPTBinary) -> time.struct_time: Parse/deserialize from KNX/IP raw data. - def to_knx(cls, value: time.struct_time) -> DPTArray...
48d4e31365c15e632b275f0d129cd9f2b2b5717d
<|skeleton|> class DPTTime: """Abstraction for KNX 3 Octet Time. DPT 10.001""" def from_knx(cls, payload: DPTArray | DPTBinary) -> time.struct_time: """Parse/deserialize from KNX/IP raw data.""" <|body_0|> def to_knx(cls, value: time.struct_time) -> DPTArray: """Serialize to KNX/IP...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DPTTime: """Abstraction for KNX 3 Octet Time. DPT 10.001""" def from_knx(cls, payload: DPTArray | DPTBinary) -> time.struct_time: """Parse/deserialize from KNX/IP raw data.""" raw = cls.validate_payload(payload) weekday = (raw[0] & 224) >> 5 hours = raw[0] & 31 min...
the_stack_v2_python_sparse
xknx/dpt/dpt_time.py
XKNX/xknx
train
248
8a221680bbf4a99a22364a4f81a47af3fd59c1fc
[ "self.lineNos = [callAstNode.lineNo, funcLineNo]\nself.astNodes = [callAstNode, funcAstNode]\nself.errorType = errorType\nself.valid = False\nself.argNos = None\nself.expected = None\nself.provided = None", "if not self.valid:\n errPrint('\\nValidity check for FuncCallArgMatchError object failed.\\n')\n ass...
<|body_start_0|> self.lineNos = [callAstNode.lineNo, funcLineNo] self.astNodes = [callAstNode, funcAstNode] self.errorType = errorType self.valid = False self.argNos = None self.expected = None self.provided = None <|end_body_0|> <|body_start_1|> if not s...
Stores data used for error reporting when try to call a function but either have incorrect number of arguments or have mismatched arguments. It is good form to make a call to checkValid before trying to use internal fields, and after you think the object is completely constructed. See more documentation in init method'...
FuncCallArgMatchError
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FuncCallArgMatchError: """Stores data used for error reporting when try to call a function but either have incorrect number of arguments or have mismatched arguments. It is good form to make a call to checkValid before trying to use internal fields, and after you think the object is completely co...
stack_v2_sparse_classes_36k_train_020580
34,359
no_license
[ { "docstring": "@param {int} funcLineNo -- line where the actual function signature is declared. @param {AstNode} funcAstNode -- ast node corresponding to actual function. @param {int} errorType -- FUNC_CALL_ARG_MATCH_ERROR_NUM_ARGS_MISMATCH if error is mismatched number of arguments (in which case, creator of ...
4
null
Implement the Python class `FuncCallArgMatchError` described below. Class description: Stores data used for error reporting when try to call a function but either have incorrect number of arguments or have mismatched arguments. It is good form to make a call to checkValid before trying to use internal fields, and afte...
Implement the Python class `FuncCallArgMatchError` described below. Class description: Stores data used for error reporting when try to call a function but either have incorrect number of arguments or have mismatched arguments. It is good form to make a call to checkValid before trying to use internal fields, and afte...
729a51f04d540111af01c283b1c17ad1489b664a
<|skeleton|> class FuncCallArgMatchError: """Stores data used for error reporting when try to call a function but either have incorrect number of arguments or have mismatched arguments. It is good form to make a call to checkValid before trying to use internal fields, and after you think the object is completely co...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FuncCallArgMatchError: """Stores data used for error reporting when try to call a function but either have incorrect number of arguments or have mismatched arguments. It is good form to make a call to checkValid before trying to use internal fields, and after you think the object is completely constructed. Se...
the_stack_v2_python_sparse
waldo/parser/ast/typeCheck/astTypeCheckStack.py
bmistree/Waldo
train
0
972b41842c635a282c052e5701318ca91612f735
[ "self.result = ''\nself.time = datetime.now()\nself.timeout = timeout\nself.file = file", "def wrapper(*a, **k):\n if k.get('recache', 0):\n self.result = ''\n del k['recache']\n if self.timedout():\n self.result = ''\n if not self.result:\n self.result = fn(*a, **k)\n ...
<|body_start_0|> self.result = '' self.time = datetime.now() self.timeout = timeout self.file = file <|end_body_0|> <|body_start_1|> def wrapper(*a, **k): if k.get('recache', 0): self.result = '' del k['recache'] if self.ti...
a decorator
Cached
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Cached: """a decorator""" def __init__(self, timeout=0, file=''): """timeout: int seconds file='string path to store result'""" <|body_0|> def __call__(self, fn): """wrap our function""" <|body_1|> def timedout(self): """returns True if we ha...
stack_v2_sparse_classes_36k_train_020581
2,075
permissive
[ { "docstring": "timeout: int seconds file='string path to store result'", "name": "__init__", "signature": "def __init__(self, timeout=0, file='')" }, { "docstring": "wrap our function", "name": "__call__", "signature": "def __call__(self, fn)" }, { "docstring": "returns True if ...
3
stack_v2_sparse_classes_30k_train_005224
Implement the Python class `Cached` described below. Class description: a decorator Method signatures and docstrings: - def __init__(self, timeout=0, file=''): timeout: int seconds file='string path to store result' - def __call__(self, fn): wrap our function - def timedout(self): returns True if we have timed out
Implement the Python class `Cached` described below. Class description: a decorator Method signatures and docstrings: - def __init__(self, timeout=0, file=''): timeout: int seconds file='string path to store result' - def __call__(self, fn): wrap our function - def timedout(self): returns True if we have timed out <...
430d6dfd719f8c88a4c3de2b735f8736187ff19b
<|skeleton|> class Cached: """a decorator""" def __init__(self, timeout=0, file=''): """timeout: int seconds file='string path to store result'""" <|body_0|> def __call__(self, fn): """wrap our function""" <|body_1|> def timedout(self): """returns True if we ha...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Cached: """a decorator""" def __init__(self, timeout=0, file=''): """timeout: int seconds file='string path to store result'""" self.result = '' self.time = datetime.now() self.timeout = timeout self.file = file def __call__(self, fn): """wrap our func...
the_stack_v2_python_sparse
evoke/serve/cached.py
howiemac/evoke
train
0
e75302df942667cbcc8873ac4e9fa5213d9f3837
[ "self.enable_bf16 = enable_bf16\nif enable_bf16:\n ipex.enable_auto_mixed_precision(mixed_dtype=torch.bfloat16)\nsuper().__init__(accelerator=accelerator, precision_plugin=precision_plugin)", "super().setup(trainer)\ndtype = torch.bfloat16 if self.enable_bf16 else None\nif len(self.optimizers) == 0:\n ipex....
<|body_start_0|> self.enable_bf16 = enable_bf16 if enable_bf16: ipex.enable_auto_mixed_precision(mixed_dtype=torch.bfloat16) super().__init__(accelerator=accelerator, precision_plugin=precision_plugin) <|end_body_0|> <|body_start_1|> super().setup(trainer) dtype = to...
IPEX strategy.
IPEXStrategy
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IPEXStrategy: """IPEX strategy.""" def __init__(self, accelerator: Accelerator=IPEXAccelerator(), precision_plugin: PrecisionPlugin=PrecisionPlugin(), enable_bf16=False) -> None: """Create a IPEXStrategy. :param accelerator: the accelerator to handle hardware :param precision_plugin:...
stack_v2_sparse_classes_36k_train_020582
2,385
permissive
[ { "docstring": "Create a IPEXStrategy. :param accelerator: the accelerator to handle hardware :param precision_plugin: the plugin to handle precision-specific parts", "name": "__init__", "signature": "def __init__(self, accelerator: Accelerator=IPEXAccelerator(), precision_plugin: PrecisionPlugin=Precis...
2
stack_v2_sparse_classes_30k_train_012820
Implement the Python class `IPEXStrategy` described below. Class description: IPEX strategy. Method signatures and docstrings: - def __init__(self, accelerator: Accelerator=IPEXAccelerator(), precision_plugin: PrecisionPlugin=PrecisionPlugin(), enable_bf16=False) -> None: Create a IPEXStrategy. :param accelerator: th...
Implement the Python class `IPEXStrategy` described below. Class description: IPEX strategy. Method signatures and docstrings: - def __init__(self, accelerator: Accelerator=IPEXAccelerator(), precision_plugin: PrecisionPlugin=PrecisionPlugin(), enable_bf16=False) -> None: Create a IPEXStrategy. :param accelerator: th...
95f677ab34867f1d91df0ed8e1bc760ea610f791
<|skeleton|> class IPEXStrategy: """IPEX strategy.""" def __init__(self, accelerator: Accelerator=IPEXAccelerator(), precision_plugin: PrecisionPlugin=PrecisionPlugin(), enable_bf16=False) -> None: """Create a IPEXStrategy. :param accelerator: the accelerator to handle hardware :param precision_plugin:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class IPEXStrategy: """IPEX strategy.""" def __init__(self, accelerator: Accelerator=IPEXAccelerator(), precision_plugin: PrecisionPlugin=PrecisionPlugin(), enable_bf16=False) -> None: """Create a IPEXStrategy. :param accelerator: the accelerator to handle hardware :param precision_plugin: the plugin t...
the_stack_v2_python_sparse
python/nano/src/bigdl/nano/pytorch/strategies/ipex/ipex_strategy.py
helenlly/BigDL
train
0
78d0a8eb4aa680d4d5f833891129caddeb4eaa10
[ "self.orders = orders\nself.serials = serials\nself.licenses = licenses", "if dictionary is None:\n return None\norders = dictionary.get('orders')\nserials = dictionary.get('serials')\nlicenses = None\nif dictionary.get('licenses') != None:\n licenses = list()\n for structure in dictionary.get('licenses'...
<|body_start_0|> self.orders = orders self.serials = serials self.licenses = licenses <|end_body_0|> <|body_start_1|> if dictionary is None: return None orders = dictionary.get('orders') serials = dictionary.get('serials') licenses = None if d...
Implementation of the 'claimOrganization' model. TODO: type model description here. Attributes: orders (list of string): The numbers of the orders that should be claimed serials (list of string): The serials of the devices that should be claimed licenses (list of LicenseModel): The licenses that should be claimed
ClaimOrganizationModel
[ "MIT", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClaimOrganizationModel: """Implementation of the 'claimOrganization' model. TODO: type model description here. Attributes: orders (list of string): The numbers of the orders that should be claimed serials (list of string): The serials of the devices that should be claimed licenses (list of Licens...
stack_v2_sparse_classes_36k_train_020583
2,242
permissive
[ { "docstring": "Constructor for the ClaimOrganizationModel class", "name": "__init__", "signature": "def __init__(self, orders=None, serials=None, licenses=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of ...
2
null
Implement the Python class `ClaimOrganizationModel` described below. Class description: Implementation of the 'claimOrganization' model. TODO: type model description here. Attributes: orders (list of string): The numbers of the orders that should be claimed serials (list of string): The serials of the devices that sho...
Implement the Python class `ClaimOrganizationModel` described below. Class description: Implementation of the 'claimOrganization' model. TODO: type model description here. Attributes: orders (list of string): The numbers of the orders that should be claimed serials (list of string): The serials of the devices that sho...
9894089eb013318243ae48869cc5130eb37f80c0
<|skeleton|> class ClaimOrganizationModel: """Implementation of the 'claimOrganization' model. TODO: type model description here. Attributes: orders (list of string): The numbers of the orders that should be claimed serials (list of string): The serials of the devices that should be claimed licenses (list of Licens...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ClaimOrganizationModel: """Implementation of the 'claimOrganization' model. TODO: type model description here. Attributes: orders (list of string): The numbers of the orders that should be claimed serials (list of string): The serials of the devices that should be claimed licenses (list of LicenseModel): The ...
the_stack_v2_python_sparse
meraki_sdk/models/claim_organization_model.py
RaulCatalano/meraki-python-sdk
train
1
d1645e45b77fc87e06f1f88679fdc1b52741fd58
[ "if type(hidden) in (tuple, list):\n return (func(hidden[0], *func_args, **func_kwargs), func(hidden[1], *func_args, **func_kwargs))\nelse:\n return func(hidden, *func_args, **func_kwargs)", "if type(hidden) == tuple:\n return hidden[0]\nelse:\n return hidden" ]
<|body_start_0|> if type(hidden) in (tuple, list): return (func(hidden[0], *func_args, **func_kwargs), func(hidden[1], *func_args, **func_kwargs)) else: return func(hidden, *func_args, **func_kwargs) <|end_body_0|> <|body_start_1|> if type(hidden) == tuple: r...
Define the following operations on hidden variables with a single hidden state or hidden / cell state tuple: map: Apply a function to every every state. select: Only select the actual hidden state, discard the rest. scatter: Wrap every state inside another iterable.
RNNCompatabilityMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RNNCompatabilityMixin: """Define the following operations on hidden variables with a single hidden state or hidden / cell state tuple: map: Apply a function to every every state. select: Only select the actual hidden state, discard the rest. scatter: Wrap every state inside another iterable.""" ...
stack_v2_sparse_classes_36k_train_020584
2,240
no_license
[ { "docstring": "Ensure compatibility between GRU and LSTM RNNs by applying a function to both the hidden and cell state inside the hidden variable if necessary. Parameters ---------- hidden: AmbiguousHidden Either one hidden state or tuple of hidden and cell state. func: Callable Function being applied to hidde...
2
stack_v2_sparse_classes_30k_train_005251
Implement the Python class `RNNCompatabilityMixin` described below. Class description: Define the following operations on hidden variables with a single hidden state or hidden / cell state tuple: map: Apply a function to every every state. select: Only select the actual hidden state, discard the rest. scatter: Wrap ev...
Implement the Python class `RNNCompatabilityMixin` described below. Class description: Define the following operations on hidden variables with a single hidden state or hidden / cell state tuple: map: Apply a function to every every state. select: Only select the actual hidden state, discard the rest. scatter: Wrap ev...
6443bea8d325fa948e117b32a063e5383db2de14
<|skeleton|> class RNNCompatabilityMixin: """Define the following operations on hidden variables with a single hidden state or hidden / cell state tuple: map: Apply a function to every every state. select: Only select the actual hidden state, discard the rest. scatter: Wrap every state inside another iterable.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RNNCompatabilityMixin: """Define the following operations on hidden variables with a single hidden state or hidden / cell state tuple: map: Apply a function to every every state. select: Only select the actual hidden state, discard the rest. scatter: Wrap every state inside another iterable.""" def map(h...
the_stack_v2_python_sparse
src/utils/compatability.py
Kaleidophon/tenacious-toucan
train
0
24c6e5569ce73f43c9ba3df9237515c10dd2dac1
[ "if g.token and g.token['type'] == 'user':\n project = g.db.execute_one_dict('\\n SELECT p.id, p.name, p.type, p.public, co.role AS userrole\\n FROM project p\\n LEFT JOIN collaborator co ON p.id = co.project_id AND co.user_id = %s\\n WHERE p.id = %s\\n...
<|body_start_0|> if g.token and g.token['type'] == 'user': project = g.db.execute_one_dict('\n SELECT p.id, p.name, p.type, p.public, co.role AS userrole\n FROM project p\n LEFT JOIN collaborator co ON p.id = co.project_id AND co.user_id = %s\n ...
Project
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Project: def get(self, project_id): """Returns a project""" <|body_0|> def delete(self, project_id): """Delete a project""" <|body_1|> <|end_skeleton|> <|body_start_0|> if g.token and g.token['type'] == 'user': project = g.db.execute_one...
stack_v2_sparse_classes_36k_train_020585
12,239
permissive
[ { "docstring": "Returns a project", "name": "get", "signature": "def get(self, project_id)" }, { "docstring": "Delete a project", "name": "delete", "signature": "def delete(self, project_id)" } ]
2
null
Implement the Python class `Project` described below. Class description: Implement the Project class. Method signatures and docstrings: - def get(self, project_id): Returns a project - def delete(self, project_id): Delete a project
Implement the Python class `Project` described below. Class description: Implement the Project class. Method signatures and docstrings: - def get(self, project_id): Returns a project - def delete(self, project_id): Delete a project <|skeleton|> class Project: def get(self, project_id): """Returns a proj...
481f23d5fce7c9654bc0b0a5a54d4c77b728adf0
<|skeleton|> class Project: def get(self, project_id): """Returns a project""" <|body_0|> def delete(self, project_id): """Delete a project""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Project: def get(self, project_id): """Returns a project""" if g.token and g.token['type'] == 'user': project = g.db.execute_one_dict('\n SELECT p.id, p.name, p.type, p.public, co.role AS userrole\n FROM project p\n LEFT JOIN collaborato...
the_stack_v2_python_sparse
src/api/handlers/projects/projects.py
SAP/InfraBox
train
275
3c9ee908ab9cfb2f09e7b06ede3b71ff9bf89868
[ "if request.attempt_id:\n return mtt_messages.TestModuleResultList(results=self._GetTestModuleResults(request.attempt_id))\nif not request.test_run_id:\n raise endpoints.BadRequestException('Test run ID or attempt ID required')\ntest_run_id = request.test_run_id\ntest_run = ndb_models.TestRun.get_by_id(test_r...
<|body_start_0|> if request.attempt_id: return mtt_messages.TestModuleResultList(results=self._GetTestModuleResults(request.attempt_id)) if not request.test_run_id: raise endpoints.BadRequestException('Test run ID or attempt ID required') test_run_id = request.test_run_id...
Test results API handler.
TestResultApi
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestResultApi: """Test results API handler.""" def ListTestModuleResults(self, request): """Fetches a page of test module results. Incomplete modules are returned first, and results are then sorted by descending failure count. Parameters: attempt_id: Test run attempt ID test_run_id: ...
stack_v2_sparse_classes_36k_train_020586
6,699
permissive
[ { "docstring": "Fetches a page of test module results. Incomplete modules are returned first, and results are then sorted by descending failure count. Parameters: attempt_id: Test run attempt ID test_run_id: Test run ID (used if attempt_id not provided)", "name": "ListTestModuleResults", "signature": "d...
4
stack_v2_sparse_classes_30k_val_000627
Implement the Python class `TestResultApi` described below. Class description: Test results API handler. Method signatures and docstrings: - def ListTestModuleResults(self, request): Fetches a page of test module results. Incomplete modules are returned first, and results are then sorted by descending failure count. ...
Implement the Python class `TestResultApi` described below. Class description: Test results API handler. Method signatures and docstrings: - def ListTestModuleResults(self, request): Fetches a page of test module results. Incomplete modules are returned first, and results are then sorted by descending failure count. ...
5e10bed02089e4cf29ae4d9d67e127f77e8fb3c9
<|skeleton|> class TestResultApi: """Test results API handler.""" def ListTestModuleResults(self, request): """Fetches a page of test module results. Incomplete modules are returned first, and results are then sorted by descending failure count. Parameters: attempt_id: Test run attempt ID test_run_id: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestResultApi: """Test results API handler.""" def ListTestModuleResults(self, request): """Fetches a page of test module results. Incomplete modules are returned first, and results are then sorted by descending failure count. Parameters: attempt_id: Test run attempt ID test_run_id: Test run ID (...
the_stack_v2_python_sparse
multitest_transport/api/test_result_api.py
maksonlee/multitest_transport
train
0
a1f62f9554d8a41caffb18e10b9127c43dbecbe3
[ "for i in range(len(shifts) - 1)[::-1]:\n shifts[i] += shifts[i + 1]\nreturn ''.join([chr((ord(c) - 97 + s) % 26 + 97) for c, s in zip(S, shifts)])", "s = [ord(c) for c in S]\nfor i, shift in enumerate(shifts):\n for j in range(i + 1):\n s[j] += shift % 26\nreturn ''.join([chr((n - 97) % 26 + 97) for...
<|body_start_0|> for i in range(len(shifts) - 1)[::-1]: shifts[i] += shifts[i + 1] return ''.join([chr((ord(c) - 97 + s) % 26 + 97) for c, s in zip(S, shifts)]) <|end_body_0|> <|body_start_1|> s = [ord(c) for c in S] for i, shift in enumerate(shifts): for j in ra...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def shiftingLetters(self, S, shifts): """:type S: str :type shifts: List[int] :rtype: str""" <|body_0|> def shiftingLetters_TLE(self, S, shifts): """:type S: str :type shifts: List[int] :rtype: str""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_020587
2,168
no_license
[ { "docstring": ":type S: str :type shifts: List[int] :rtype: str", "name": "shiftingLetters", "signature": "def shiftingLetters(self, S, shifts)" }, { "docstring": ":type S: str :type shifts: List[int] :rtype: str", "name": "shiftingLetters_TLE", "signature": "def shiftingLetters_TLE(sel...
2
stack_v2_sparse_classes_30k_train_004597
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def shiftingLetters(self, S, shifts): :type S: str :type shifts: List[int] :rtype: str - def shiftingLetters_TLE(self, S, shifts): :type S: str :type shifts: List[int] :rtype: st...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def shiftingLetters(self, S, shifts): :type S: str :type shifts: List[int] :rtype: str - def shiftingLetters_TLE(self, S, shifts): :type S: str :type shifts: List[int] :rtype: st...
e60ba45fe2f2e5e3b3abfecec3db76f5ce1fde59
<|skeleton|> class Solution: def shiftingLetters(self, S, shifts): """:type S: str :type shifts: List[int] :rtype: str""" <|body_0|> def shiftingLetters_TLE(self, S, shifts): """:type S: str :type shifts: List[int] :rtype: str""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def shiftingLetters(self, S, shifts): """:type S: str :type shifts: List[int] :rtype: str""" for i in range(len(shifts) - 1)[::-1]: shifts[i] += shifts[i + 1] return ''.join([chr((ord(c) - 97 + s) % 26 + 97) for c, s in zip(S, shifts)]) def shiftingLetters_TL...
the_stack_v2_python_sparse
src/lt_848.py
oxhead/CodingYourWay
train
0
f06572cde52b17e6c8a437b5167c1e10bae1b851
[ "self._repo_root = os.path.abspath(repo_root)\nhelper = cts_utils.ChromiumRepoHelper(self._repo_root)\nself._repo_helper = helper\nself._cts_config_path = helper.rebase(cts_utils.TOOLS_DIR, cts_utils.CONFIG_FILE)\nself._CTSConfig = cts_utils.CTSConfig(self._cts_config_path)", "prefixes = [(platform, self._CTSConf...
<|body_start_0|> self._repo_root = os.path.abspath(repo_root) helper = cts_utils.ChromiumRepoHelper(self._repo_root) self._repo_helper = helper self._cts_config_path = helper.rebase(cts_utils.TOOLS_DIR, cts_utils.CONFIG_FILE) self._CTSConfig = cts_utils.CTSConfig(self._cts_config...
Updates CTS archive to a new version. Performs the following tasks to simplify the CTS test update process: (TODO(crbug/1420927): - Update the CTS versions in fetch.py / install.sh) - Update the CTS versions in webview_cts_gcs_path.json After these steps are completed, the user can commit and upload the CL to Chromium ...
UpdateCTS
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UpdateCTS: """Updates CTS archive to a new version. Performs the following tasks to simplify the CTS test update process: (TODO(crbug/1420927): - Update the CTS versions in fetch.py / install.sh) - Update the CTS versions in webview_cts_gcs_path.json After these steps are completed, the user can ...
stack_v2_sparse_classes_36k_train_020588
4,611
permissive
[ { "docstring": "Construct UpdateCTS instance. Args: repo_root: Repository root (e.g. /path/to/chromium/src) to base all configuration files", "name": "__init__", "signature": "def __init__(self, repo_root)" }, { "docstring": "Query for the latest cts versions per platform We can retrieve the new...
4
null
Implement the Python class `UpdateCTS` described below. Class description: Updates CTS archive to a new version. Performs the following tasks to simplify the CTS test update process: (TODO(crbug/1420927): - Update the CTS versions in fetch.py / install.sh) - Update the CTS versions in webview_cts_gcs_path.json After t...
Implement the Python class `UpdateCTS` described below. Class description: Updates CTS archive to a new version. Performs the following tasks to simplify the CTS test update process: (TODO(crbug/1420927): - Update the CTS versions in fetch.py / install.sh) - Update the CTS versions in webview_cts_gcs_path.json After t...
a401d6cf4f7bf0e2d2e964c512ebb923c3d8832c
<|skeleton|> class UpdateCTS: """Updates CTS archive to a new version. Performs the following tasks to simplify the CTS test update process: (TODO(crbug/1420927): - Update the CTS versions in fetch.py / install.sh) - Update the CTS versions in webview_cts_gcs_path.json After these steps are completed, the user can ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UpdateCTS: """Updates CTS archive to a new version. Performs the following tasks to simplify the CTS test update process: (TODO(crbug/1420927): - Update the CTS versions in fetch.py / install.sh) - Update the CTS versions in webview_cts_gcs_path.json After these steps are completed, the user can commit and up...
the_stack_v2_python_sparse
android_webview/tools/update_cts.py
chromium/chromium
train
17,408
f82e9296841f43adeadcc36a1c3e3c04cc910179
[ "with tempfile.NamedTemporaryFile(suffix='.ipynb') as tmp_notebook:\n args = ['jupyter', 'nbconvert', '--to', 'notebook', '--execute', '--ExecutePreprocessor.timeout=3600', '--output', tmp_notebook.name, path]\n subprocess.check_call(args)\n tmp_notebook.seek(0)\n return nbformat.read(tmp_notebook, nbfo...
<|body_start_0|> with tempfile.NamedTemporaryFile(suffix='.ipynb') as tmp_notebook: args = ['jupyter', 'nbconvert', '--to', 'notebook', '--execute', '--ExecutePreprocessor.timeout=3600', '--output', tmp_notebook.name, path] subprocess.check_call(args) tmp_notebook.seek(0) ...
TestNotebookConsistency
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestNotebookConsistency: def _execute_notebook(path): """Execute a Jupyter Notebook from scratch and convert it into another Jupyter Notebook. :returns a converted Jupyter Notebook""" <|body_0|> def _analise_notebook(notebook): """Analise notebook cell outputs. The f...
stack_v2_sparse_classes_36k_train_020589
3,437
permissive
[ { "docstring": "Execute a Jupyter Notebook from scratch and convert it into another Jupyter Notebook. :returns a converted Jupyter Notebook", "name": "_execute_notebook", "signature": "def _execute_notebook(path)" }, { "docstring": "Analise notebook cell outputs. The function goes through all ce...
3
stack_v2_sparse_classes_30k_train_001940
Implement the Python class `TestNotebookConsistency` described below. Class description: Implement the TestNotebookConsistency class. Method signatures and docstrings: - def _execute_notebook(path): Execute a Jupyter Notebook from scratch and convert it into another Jupyter Notebook. :returns a converted Jupyter Note...
Implement the Python class `TestNotebookConsistency` described below. Class description: Implement the TestNotebookConsistency class. Method signatures and docstrings: - def _execute_notebook(path): Execute a Jupyter Notebook from scratch and convert it into another Jupyter Notebook. :returns a converted Jupyter Note...
fc5ac51d5c4c7c313861b9f83a86239335b21ddc
<|skeleton|> class TestNotebookConsistency: def _execute_notebook(path): """Execute a Jupyter Notebook from scratch and convert it into another Jupyter Notebook. :returns a converted Jupyter Notebook""" <|body_0|> def _analise_notebook(notebook): """Analise notebook cell outputs. The f...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestNotebookConsistency: def _execute_notebook(path): """Execute a Jupyter Notebook from scratch and convert it into another Jupyter Notebook. :returns a converted Jupyter Notebook""" with tempfile.NamedTemporaryFile(suffix='.ipynb') as tmp_notebook: args = ['jupyter', 'nbconvert',...
the_stack_v2_python_sparse
quality_test.py
GuillaumeDufau/reco-gym
train
0
4a09955bf50cf4dc74b0b408f59d92df91784259
[ "p.control_pipeline_params.pipeline.parse_params(p.control_pipeline_params)\np.system_dynamics = p.control_pipeline_params.system_dynamics_params.system\np.dt = p.control_pipeline_params.system_dynamics_params.dt\np.planning_horizon = p.control_pipeline_params.planning_horizon\nreturn p", "obj_vals, data = self.e...
<|body_start_0|> p.control_pipeline_params.pipeline.parse_params(p.control_pipeline_params) p.system_dynamics = p.control_pipeline_params.system_dynamics_params.system p.dt = p.control_pipeline_params.system_dynamics_params.dt p.planning_horizon = p.control_pipeline_params.planning_horiz...
A planner which selects an optimal waypoint using a sampling based method. Given a fixed start_config, the planner 1. Uses a control pipeline to plan paths from start_config to a fixed set of waypoint configurations 2. Evaluates the objective function on the resulting trajectories 3. Returns the minimum cost waypoint a...
SamplingPlanner
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SamplingPlanner: """A planner which selects an optimal waypoint using a sampling based method. Given a fixed start_config, the planner 1. Uses a control pipeline to plan paths from start_config to a fixed set of waypoint configurations 2. Evaluates the objective function on the resulting trajecto...
stack_v2_sparse_classes_36k_train_020590
2,914
no_license
[ { "docstring": "Parse the parameters to add some additional helpful parameters.", "name": "parse_params", "signature": "def parse_params(p)" }, { "docstring": "Optimize the objective over a trajectory starting from start_config. 1. Uses a control pipeline to plan paths from start_config 2. Evalu...
2
null
Implement the Python class `SamplingPlanner` described below. Class description: A planner which selects an optimal waypoint using a sampling based method. Given a fixed start_config, the planner 1. Uses a control pipeline to plan paths from start_config to a fixed set of waypoint configurations 2. Evaluates the objec...
Implement the Python class `SamplingPlanner` described below. Class description: A planner which selects an optimal waypoint using a sampling based method. Given a fixed start_config, the planner 1. Uses a control pipeline to plan paths from start_config to a fixed set of waypoint configurations 2. Evaluates the objec...
4429e315242eae85df81fb3c5b0f3dd52ae434cf
<|skeleton|> class SamplingPlanner: """A planner which selects an optimal waypoint using a sampling based method. Given a fixed start_config, the planner 1. Uses a control pipeline to plan paths from start_config to a fixed set of waypoint configurations 2. Evaluates the objective function on the resulting trajecto...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SamplingPlanner: """A planner which selects an optimal waypoint using a sampling based method. Given a fixed start_config, the planner 1. Uses a control pipeline to plan paths from start_config to a fixed set of waypoint configurations 2. Evaluates the objective function on the resulting trajectories 3. Retur...
the_stack_v2_python_sparse
planners/sampling_planner.py
SFU-MARS/WayPtNav-reachability
train
4
e4cd54d4f19977fef53f7424053a3a8f9a862a5a
[ "if not isinstance(query, FetchQueryBuilder):\n raise ImapInvalidArgument('query', query)\nself.__fetch_query = query", "func = 'fetch'\nargs = self.__fetch_query.build()\nif self.__fetch_query.uids:\n func = 'uid'\n args = ('fetch',) + args\ntyp, data = getattr(imap_obj, func)(*args)\nself.check_respons...
<|body_start_0|> if not isinstance(query, FetchQueryBuilder): raise ImapInvalidArgument('query', query) self.__fetch_query = query <|end_body_0|> <|body_start_1|> func = 'fetch' args = self.__fetch_query.build() if self.__fetch_query.uids: func = 'uid' ...
Executes IMAP Fetch cammand
ImapFetchCommand
[ "WTFPL" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImapFetchCommand: """Executes IMAP Fetch cammand""" def __init__(self, query: FetchQueryBuilder): """Creates instance of Fetch IMAP command Raises: ImapRuntimeError - if :param query is not instance of FetchQueryBuilder :param query: FetchQueryBuilder :return:""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_020591
1,604
permissive
[ { "docstring": "Creates instance of Fetch IMAP command Raises: ImapRuntimeError - if :param query is not instance of FetchQueryBuilder :param query: FetchQueryBuilder :return:", "name": "__init__", "signature": "def __init__(self, query: FetchQueryBuilder)" }, { "docstring": "Executes IMAP fetch...
2
stack_v2_sparse_classes_30k_train_019463
Implement the Python class `ImapFetchCommand` described below. Class description: Executes IMAP Fetch cammand Method signatures and docstrings: - def __init__(self, query: FetchQueryBuilder): Creates instance of Fetch IMAP command Raises: ImapRuntimeError - if :param query is not instance of FetchQueryBuilder :param ...
Implement the Python class `ImapFetchCommand` described below. Class description: Executes IMAP Fetch cammand Method signatures and docstrings: - def __init__(self, query: FetchQueryBuilder): Creates instance of Fetch IMAP command Raises: ImapRuntimeError - if :param query is not instance of FetchQueryBuilder :param ...
002a916494591e31ec9a0c2dbef66427a72bc036
<|skeleton|> class ImapFetchCommand: """Executes IMAP Fetch cammand""" def __init__(self, query: FetchQueryBuilder): """Creates instance of Fetch IMAP command Raises: ImapRuntimeError - if :param query is not instance of FetchQueryBuilder :param query: FetchQueryBuilder :return:""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImapFetchCommand: """Executes IMAP Fetch cammand""" def __init__(self, query: FetchQueryBuilder): """Creates instance of Fetch IMAP command Raises: ImapRuntimeError - if :param query is not instance of FetchQueryBuilder :param query: FetchQueryBuilder :return:""" if not isinstance(query, ...
the_stack_v2_python_sparse
pymaillib/imap/commands/fetch.py
pussbb/pymaillib
train
0
638293bb91a64c81d1fa7ef98596fcd3257b48c5
[ "n = len(nums)\nif n == 0:\n return 0\ndp = [1] * len(nums)\nfor i in range(1, n):\n for j in range(0, i):\n if nums[i] > nums[j]:\n dp[i] = max(dp[j] + 1, dp[i])\nreturn max(dp)", "d = []\nfor n in nums:\n if not d or n > d[-1]:\n d.append(n)\n else:\n l, r = (0, len(d...
<|body_start_0|> n = len(nums) if n == 0: return 0 dp = [1] * len(nums) for i in range(1, n): for j in range(0, i): if nums[i] > nums[j]: dp[i] = max(dp[j] + 1, dp[i]) return max(dp) <|end_body_0|> <|body_start_1|> ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def lengthOfLIS_dp(self, nums): """1.定义dp[i]表示以第i个数字结尾的最长上升子序列的长度,注意 nums[i]必须被选取,最终答案为 max(dp) 2.定义dp[i]表示前i个数字中最长上升子序列的长度,注意 nums[i]不一定被选取,最终答案为 dp[-1] 以上有两种定义方式,这里选第一种: 在计算dp[i]之前,已经计算出 dp[0, 1, ……, i−1]的值,即考虑往dp[0, 1, ……, i−1]中最长的上升子序列后面再加一个 nums[i]. 由于dp[j]代表 nums[0, 1, ……...
stack_v2_sparse_classes_36k_train_020592
2,344
no_license
[ { "docstring": "1.定义dp[i]表示以第i个数字结尾的最长上升子序列的长度,注意 nums[i]必须被选取,最终答案为 max(dp) 2.定义dp[i]表示前i个数字中最长上升子序列的长度,注意 nums[i]不一定被选取,最终答案为 dp[-1] 以上有两种定义方式,这里选第一种: 在计算dp[i]之前,已经计算出 dp[0, 1, ……, i−1]的值,即考虑往dp[0, 1, ……, i−1]中最长的上升子序列后面再加一个 nums[i]. 由于dp[j]代表 nums[0, 1, ……, j]中以 nums[j]结尾的最长上升子序列, 所以如果能从 dp[j]状态转移到 dp[i], 那么...
2
stack_v2_sparse_classes_30k_train_020090
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLIS_dp(self, nums): 1.定义dp[i]表示以第i个数字结尾的最长上升子序列的长度,注意 nums[i]必须被选取,最终答案为 max(dp) 2.定义dp[i]表示前i个数字中最长上升子序列的长度,注意 nums[i]不一定被选取,最终答案为 dp[-1] 以上有两种定义方式,这里选第一种: 在计算dp[i]之...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLIS_dp(self, nums): 1.定义dp[i]表示以第i个数字结尾的最长上升子序列的长度,注意 nums[i]必须被选取,最终答案为 max(dp) 2.定义dp[i]表示前i个数字中最长上升子序列的长度,注意 nums[i]不一定被选取,最终答案为 dp[-1] 以上有两种定义方式,这里选第一种: 在计算dp[i]之...
7dbd6da4cf42e422f1425a9de134ab31da52792a
<|skeleton|> class Solution: def lengthOfLIS_dp(self, nums): """1.定义dp[i]表示以第i个数字结尾的最长上升子序列的长度,注意 nums[i]必须被选取,最终答案为 max(dp) 2.定义dp[i]表示前i个数字中最长上升子序列的长度,注意 nums[i]不一定被选取,最终答案为 dp[-1] 以上有两种定义方式,这里选第一种: 在计算dp[i]之前,已经计算出 dp[0, 1, ……, i−1]的值,即考虑往dp[0, 1, ……, i−1]中最长的上升子序列后面再加一个 nums[i]. 由于dp[j]代表 nums[0, 1, ……...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def lengthOfLIS_dp(self, nums): """1.定义dp[i]表示以第i个数字结尾的最长上升子序列的长度,注意 nums[i]必须被选取,最终答案为 max(dp) 2.定义dp[i]表示前i个数字中最长上升子序列的长度,注意 nums[i]不一定被选取,最终答案为 dp[-1] 以上有两种定义方式,这里选第一种: 在计算dp[i]之前,已经计算出 dp[0, 1, ……, i−1]的值,即考虑往dp[0, 1, ……, i−1]中最长的上升子序列后面再加一个 nums[i]. 由于dp[j]代表 nums[0, 1, ……, j]中以 nums[j]...
the_stack_v2_python_sparse
查找计算/最长上升子序列.py
VixeruntR/leetcode
train
1
dcb3401a9110b7c3383f2bb9d596bd8f0e54e97d
[ "outputs = sorted(StreamAlertOutput.get_all_outputs().keys())\nlist_parser = generate_subparser(subparser, 'list', description=cls.description, help=cls.description, subcommand=True)\nlist_parser.add_argument('--service', '-s', choices=outputs, default=outputs, nargs='*', metavar='SERVICE', help='Pass Services to l...
<|body_start_0|> outputs = sorted(StreamAlertOutput.get_all_outputs().keys()) list_parser = generate_subparser(subparser, 'list', description=cls.description, help=cls.description, subcommand=True) list_parser.add_argument('--service', '-s', choices=outputs, default=outputs, nargs='*', metavar='...
OutputListSubCommand
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OutputListSubCommand: def setup_subparser(cls, subparser): """Add the output list subparser: manage.py output list [options]""" <|body_0|> def handler(cls, options, config): """List configured outputs Args: options (argparse.Namespace): Basically a namedtuple with th...
stack_v2_sparse_classes_36k_train_020593
19,044
permissive
[ { "docstring": "Add the output list subparser: manage.py output list [options]", "name": "setup_subparser", "signature": "def setup_subparser(cls, subparser)" }, { "docstring": "List configured outputs Args: options (argparse.Namespace): Basically a namedtuple with the service setting config (St...
2
stack_v2_sparse_classes_30k_train_006840
Implement the Python class `OutputListSubCommand` described below. Class description: Implement the OutputListSubCommand class. Method signatures and docstrings: - def setup_subparser(cls, subparser): Add the output list subparser: manage.py output list [options] - def handler(cls, options, config): List configured o...
Implement the Python class `OutputListSubCommand` described below. Class description: Implement the OutputListSubCommand class. Method signatures and docstrings: - def setup_subparser(cls, subparser): Add the output list subparser: manage.py output list [options] - def handler(cls, options, config): List configured o...
75ba140d2e1aa6e903313d88326920adcb8bff45
<|skeleton|> class OutputListSubCommand: def setup_subparser(cls, subparser): """Add the output list subparser: manage.py output list [options]""" <|body_0|> def handler(cls, options, config): """List configured outputs Args: options (argparse.Namespace): Basically a namedtuple with th...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OutputListSubCommand: def setup_subparser(cls, subparser): """Add the output list subparser: manage.py output list [options]""" outputs = sorted(StreamAlertOutput.get_all_outputs().keys()) list_parser = generate_subparser(subparser, 'list', description=cls.description, help=cls.descrip...
the_stack_v2_python_sparse
streamalert_cli/outputs/handler.py
avmi/streamalert
train
0
dcbdb5c8a4aae1c6068f9271b7bfb63fe8172704
[ "self.read_only = read_only\nself.secret_name = secret_name\nself.share_name = share_name", "if dictionary is None:\n return None\nread_only = dictionary.get('readOnly')\nsecret_name = dictionary.get('secretName')\nshare_name = dictionary.get('shareName')\nreturn cls(read_only, secret_name, share_name)" ]
<|body_start_0|> self.read_only = read_only self.secret_name = secret_name self.share_name = share_name <|end_body_0|> <|body_start_1|> if dictionary is None: return None read_only = dictionary.get('readOnly') secret_name = dictionary.get('secretName') ...
Implementation of the 'PodInfo_PodSpec_VolumeInfo_AzureFile' model. TODO: type description here. Attributes: read_only (string): TODO: Type description here. secret_name (string): TODO: Type description here. share_name (string): TODO: Type description here.
PodInfo_PodSpec_VolumeInfo_AzureFile
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PodInfo_PodSpec_VolumeInfo_AzureFile: """Implementation of the 'PodInfo_PodSpec_VolumeInfo_AzureFile' model. TODO: type description here. Attributes: read_only (string): TODO: Type description here. secret_name (string): TODO: Type description here. share_name (string): TODO: Type description her...
stack_v2_sparse_classes_36k_train_020594
1,847
permissive
[ { "docstring": "Constructor for the PodInfo_PodSpec_VolumeInfo_AzureFile class", "name": "__init__", "signature": "def __init__(self, read_only=None, secret_name=None, share_name=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictio...
2
stack_v2_sparse_classes_30k_test_001171
Implement the Python class `PodInfo_PodSpec_VolumeInfo_AzureFile` described below. Class description: Implementation of the 'PodInfo_PodSpec_VolumeInfo_AzureFile' model. TODO: type description here. Attributes: read_only (string): TODO: Type description here. secret_name (string): TODO: Type description here. share_na...
Implement the Python class `PodInfo_PodSpec_VolumeInfo_AzureFile` described below. Class description: Implementation of the 'PodInfo_PodSpec_VolumeInfo_AzureFile' model. TODO: type description here. Attributes: read_only (string): TODO: Type description here. secret_name (string): TODO: Type description here. share_na...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class PodInfo_PodSpec_VolumeInfo_AzureFile: """Implementation of the 'PodInfo_PodSpec_VolumeInfo_AzureFile' model. TODO: type description here. Attributes: read_only (string): TODO: Type description here. secret_name (string): TODO: Type description here. share_name (string): TODO: Type description her...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PodInfo_PodSpec_VolumeInfo_AzureFile: """Implementation of the 'PodInfo_PodSpec_VolumeInfo_AzureFile' model. TODO: type description here. Attributes: read_only (string): TODO: Type description here. secret_name (string): TODO: Type description here. share_name (string): TODO: Type description here.""" de...
the_stack_v2_python_sparse
cohesity_management_sdk/models/pod_info_pod_spec_volume_info_azure_file.py
cohesity/management-sdk-python
train
24
dbd4309fe8f2c36556c78e6b3f46cbd7f99536b8
[ "mx = float('-inf')\ntable = [[0 for _ in range(len(nums))] for _ in range(len(nums))]\nfor i in range(len(nums)):\n table[0][i] = nums[i]\n mx = max(table[0][i], mx)\nfor length in range(1, len(nums)):\n for i in range(len(nums) - length):\n table[length][i] = table[length - 1][i] * nums[length + i...
<|body_start_0|> mx = float('-inf') table = [[0 for _ in range(len(nums))] for _ in range(len(nums))] for i in range(len(nums)): table[0][i] = nums[i] mx = max(table[0][i], mx) for length in range(1, len(nums)): for i in range(len(nums) - length): ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProduct(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def standard(self, nums): """这个是标准解析 :param nums: :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> mx = float('-inf') table = [[0 for _ in range...
stack_v2_sparse_classes_36k_train_020595
1,352
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "maxProduct", "signature": "def maxProduct(self, nums)" }, { "docstring": "这个是标准解析 :param nums: :return:", "name": "standard", "signature": "def standard(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_018211
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProduct(self, nums): :type nums: List[int] :rtype: int - def standard(self, nums): 这个是标准解析 :param nums: :return:
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProduct(self, nums): :type nums: List[int] :rtype: int - def standard(self, nums): 这个是标准解析 :param nums: :return: <|skeleton|> class Solution: def maxProduct(self, nu...
f3e81bc39e8c3723ef9a83dc6235a0abe2871833
<|skeleton|> class Solution: def maxProduct(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def standard(self, nums): """这个是标准解析 :param nums: :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxProduct(self, nums): """:type nums: List[int] :rtype: int""" mx = float('-inf') table = [[0 for _ in range(len(nums))] for _ in range(len(nums))] for i in range(len(nums)): table[0][i] = nums[i] mx = max(table[0][i], mx) for leng...
the_stack_v2_python_sparse
leetcode/乘机最大子序列.py
dahaihu/standard
train
0
4079728bc564e1f7068106050a7bd1ebf53a1fcc
[ "if len(indices) != len(set(indices)):\n raise ConstraintError(f'The constraint indices {indices} are not unique.')\nif 1 < len(indices) <= 4:\n if indices[0] < indices[-1]:\n return indices\n else:\n return tuple(reversed(indices))\nelif len(indices) > 4:\n return tuple(sorted(indices))\n...
<|body_start_0|> if len(indices) != len(set(indices)): raise ConstraintError(f'The constraint indices {indices} are not unique.') if 1 < len(indices) <= 4: if indices[0] < indices[-1]: return indices else: return tuple(reversed(indices)...
Constraint
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Constraint: def _order_and_check_indices(cls, indices: Tuple[int, ...]) -> Tuple[int, ...]: """Check all indices are unique and then order them to make comparisons between constraints easier.""" <|body_0|> def dict(self, *args, **kwargs): """Overwrite the dict method...
stack_v2_sparse_classes_36k_train_020596
8,547
permissive
[ { "docstring": "Check all indices are unique and then order them to make comparisons between constraints easier.", "name": "_order_and_check_indices", "signature": "def _order_and_check_indices(cls, indices: Tuple[int, ...]) -> Tuple[int, ...]" }, { "docstring": "Overwrite the dict method to mak...
2
stack_v2_sparse_classes_30k_train_008235
Implement the Python class `Constraint` described below. Class description: Implement the Constraint class. Method signatures and docstrings: - def _order_and_check_indices(cls, indices: Tuple[int, ...]) -> Tuple[int, ...]: Check all indices are unique and then order them to make comparisons between constraints easie...
Implement the Python class `Constraint` described below. Class description: Implement the Constraint class. Method signatures and docstrings: - def _order_and_check_indices(cls, indices: Tuple[int, ...]) -> Tuple[int, ...]: Check all indices are unique and then order them to make comparisons between constraints easie...
48943d8e7a5b6947001d29a9c629a65c4133dbd6
<|skeleton|> class Constraint: def _order_and_check_indices(cls, indices: Tuple[int, ...]) -> Tuple[int, ...]: """Check all indices are unique and then order them to make comparisons between constraints easier.""" <|body_0|> def dict(self, *args, **kwargs): """Overwrite the dict method...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Constraint: def _order_and_check_indices(cls, indices: Tuple[int, ...]) -> Tuple[int, ...]: """Check all indices are unique and then order them to make comparisons between constraints easier.""" if len(indices) != len(set(indices)): raise ConstraintError(f'The constraint indices {i...
the_stack_v2_python_sparse
openff/qcsubmit/constraints.py
openforcefield/openff-qcsubmit
train
15
d4fb7af2f12bafbd6483e031b62ade7ccf333eca
[ "stack, result = ([], [])\nnode = root\nwhile stack or node:\n if node:\n stack.append(node)\n result.append(str(node.val))\n node = node.left\n else:\n node = stack.pop().right\nreturn ','.join(result)", "def helper(ser, bound=float('inf')):\n if not ser:\n return None...
<|body_start_0|> stack, result = ([], []) node = root while stack or node: if node: stack.append(node) result.append(str(node.val)) node = node.left else: node = stack.pop().right return ','.join(resu...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" <|body_0|> def deserialize(self, data: str) -> TreeNode: """Decodes your encoded data to tree.""" <|body_1|> <|end_skeleton|> <|body_start_0|> stack, result ...
stack_v2_sparse_classes_36k_train_020597
1,871
no_license
[ { "docstring": "Encodes a tree to a single string.", "name": "serialize", "signature": "def serialize(self, root: TreeNode) -> str" }, { "docstring": "Decodes your encoded data to tree.", "name": "deserialize", "signature": "def deserialize(self, data: str) -> TreeNode" } ]
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: TreeNode) -> str: Encodes a tree to a single string. - def deserialize(self, data: str) -> TreeNode: Decodes your encoded data to tree.
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: TreeNode) -> str: Encodes a tree to a single string. - def deserialize(self, data: str) -> TreeNode: Decodes your encoded data to tree. <|skeleton|> class Co...
085d868ba0458fc8e6b5549aa00fa151c335fa7f
<|skeleton|> class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" <|body_0|> def deserialize(self, data: str) -> TreeNode: """Decodes your encoded data to tree.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" stack, result = ([], []) node = root while stack or node: if node: stack.append(node) result.append(str(node.val)) node = node...
the_stack_v2_python_sparse
449-Serialize_and_Deserialize_BST.py
chanyoonzhu/leetcode-python
train
0
9e02c52baeeaca2693b49b47dccc4fdb7b7f5638
[ "item_links = response.xpath(\"//a[@class='product-loop-title']/@href\").extract()\nyield from response.follow_all(item_links, callback=self.parse_details)\nnext_page = response.xpath(\"//a[@class='next page-numbers']/@href\").get()\nif next_page:\n yield response.follow(next_page, callback=self.parse)", "desc...
<|body_start_0|> item_links = response.xpath("//a[@class='product-loop-title']/@href").extract() yield from response.follow_all(item_links, callback=self.parse_details) next_page = response.xpath("//a[@class='next page-numbers']/@href").get() if next_page: yield response.foll...
SanteeSpider
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SanteeSpider: def parse(self, response, **kwargs): """This function should extract and loop item urls. @url https://www.santeecosmeticsusa.com/?s=&post_type=product&count=50 @request https://www.santeecosmeticsusa.com/product/9-palette-shimmer-eyeshadow/ @returns items 0 @returns request...
stack_v2_sparse_classes_36k_train_020598
2,863
no_license
[ { "docstring": "This function should extract and loop item urls. @url https://www.santeecosmeticsusa.com/?s=&post_type=product&count=50 @request https://www.santeecosmeticsusa.com/product/9-palette-shimmer-eyeshadow/ @returns items 0 @returns requests 1 51", "name": "parse", "signature": "def parse(self...
2
null
Implement the Python class `SanteeSpider` described below. Class description: Implement the SanteeSpider class. Method signatures and docstrings: - def parse(self, response, **kwargs): This function should extract and loop item urls. @url https://www.santeecosmeticsusa.com/?s=&post_type=product&count=50 @request http...
Implement the Python class `SanteeSpider` described below. Class description: Implement the SanteeSpider class. Method signatures and docstrings: - def parse(self, response, **kwargs): This function should extract and loop item urls. @url https://www.santeecosmeticsusa.com/?s=&post_type=product&count=50 @request http...
025babe4a03553d720806828f89929c6e773d683
<|skeleton|> class SanteeSpider: def parse(self, response, **kwargs): """This function should extract and loop item urls. @url https://www.santeecosmeticsusa.com/?s=&post_type=product&count=50 @request https://www.santeecosmeticsusa.com/product/9-palette-shimmer-eyeshadow/ @returns items 0 @returns request...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SanteeSpider: def parse(self, response, **kwargs): """This function should extract and loop item urls. @url https://www.santeecosmeticsusa.com/?s=&post_type=product&count=50 @request https://www.santeecosmeticsusa.com/product/9-palette-shimmer-eyeshadow/ @returns items 0 @returns requests 1 51""" ...
the_stack_v2_python_sparse
data_scraping/gmd/spiders/santee.py
panky2202/scrapy-dev
train
1
d5df93cc370d1ad9635344abb49ef97ef334ac73
[ "form = SponsorForm(self.request.form, config=self.config)\nif form.validate():\n f = form.data\n f['logo'] = f['image']\n del f['image']\n self.barcamp.sponsors.append(f)\n self.barcamp.put()\n self.flash('Neuen Sponsor angelegt', category='info')\nelse:\n self.flash('Leider enthielt das Formu...
<|body_start_0|> form = SponsorForm(self.request.form, config=self.config) if form.validate(): f = form.data f['logo'] = f['image'] del f['image'] self.barcamp.sponsors.append(f) self.barcamp.put() self.flash('Neuen Sponsor angelegt...
view for adding and deleting sponsors
BarcampSponsors
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BarcampSponsors: """view for adding and deleting sponsors""" def post(self, slug=None): """just add the sponsor and reload the page""" <|body_0|> def delete(self, slug=None): """delete a sponsor again and give the index via idx param""" <|body_1|> <|end_...
stack_v2_sparse_classes_36k_train_020599
2,903
permissive
[ { "docstring": "just add the sponsor and reload the page", "name": "post", "signature": "def post(self, slug=None)" }, { "docstring": "delete a sponsor again and give the index via idx param", "name": "delete", "signature": "def delete(self, slug=None)" } ]
2
stack_v2_sparse_classes_30k_train_009830
Implement the Python class `BarcampSponsors` described below. Class description: view for adding and deleting sponsors Method signatures and docstrings: - def post(self, slug=None): just add the sponsor and reload the page - def delete(self, slug=None): delete a sponsor again and give the index via idx param
Implement the Python class `BarcampSponsors` described below. Class description: view for adding and deleting sponsors Method signatures and docstrings: - def post(self, slug=None): just add the sponsor and reload the page - def delete(self, slug=None): delete a sponsor again and give the index via idx param <|skele...
9b45664e46c451b2cbe00bb55583b043e769083d
<|skeleton|> class BarcampSponsors: """view for adding and deleting sponsors""" def post(self, slug=None): """just add the sponsor and reload the page""" <|body_0|> def delete(self, slug=None): """delete a sponsor again and give the index via idx param""" <|body_1|> <|end_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BarcampSponsors: """view for adding and deleting sponsors""" def post(self, slug=None): """just add the sponsor and reload the page""" form = SponsorForm(self.request.form, config=self.config) if form.validate(): f = form.data f['logo'] = f['image'] ...
the_stack_v2_python_sparse
camper/barcamps/index.py
comlounge/camper
train
14