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
e8d059f09f073f9569871df34e88dae4a05e5a90
[ "self.pool = object()\nself.rcs = _FakeRCS()\nself.expected_kwargs = {'headers': headers('token'), 'pool': self.pool}", "self.expected_kwargs['params'] = {'limit': 10000}\ntreq = get_fake_treq(self, 'get', 'novaurl/servers/detail', ((), self.expected_kwargs), (Response(200), '{\"servers\": {}}'))\nd = nova.list_s...
<|body_start_0|> self.pool = object() self.rcs = _FakeRCS() self.expected_kwargs = {'headers': headers('token'), 'pool': self.pool} <|end_body_0|> <|body_start_1|> self.expected_kwargs['params'] = {'limit': 10000} treq = get_fake_treq(self, 'get', 'novaurl/servers/detail', ((), ...
Tests for multi-server api helpers in :mod:`otter.integration.lib.nova`.
NovaServerCollectionTestCase
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NovaServerCollectionTestCase: """Tests for multi-server api helpers in :mod:`otter.integration.lib.nova`.""" def setUp(self): """Set up fake pool, treq, responses, and RCS.""" <|body_0|> def test_list_servers(self): """Get all addresses with a particular name and...
stack_v2_sparse_classes_36k_train_028000
9,051
permissive
[ { "docstring": "Set up fake pool, treq, responses, and RCS.", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Get all addresses with a particular name and succeeds on 200.", "name": "test_list_servers", "signature": "def test_list_servers(self)" }, { "docstring...
3
null
Implement the Python class `NovaServerCollectionTestCase` described below. Class description: Tests for multi-server api helpers in :mod:`otter.integration.lib.nova`. Method signatures and docstrings: - def setUp(self): Set up fake pool, treq, responses, and RCS. - def test_list_servers(self): Get all addresses with ...
Implement the Python class `NovaServerCollectionTestCase` described below. Class description: Tests for multi-server api helpers in :mod:`otter.integration.lib.nova`. Method signatures and docstrings: - def setUp(self): Set up fake pool, treq, responses, and RCS. - def test_list_servers(self): Get all addresses with ...
7199cdd67255fe116dbcbedea660c13453671134
<|skeleton|> class NovaServerCollectionTestCase: """Tests for multi-server api helpers in :mod:`otter.integration.lib.nova`.""" def setUp(self): """Set up fake pool, treq, responses, and RCS.""" <|body_0|> def test_list_servers(self): """Get all addresses with a particular name and...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NovaServerCollectionTestCase: """Tests for multi-server api helpers in :mod:`otter.integration.lib.nova`.""" def setUp(self): """Set up fake pool, treq, responses, and RCS.""" self.pool = object() self.rcs = _FakeRCS() self.expected_kwargs = {'headers': headers('token'), '...
the_stack_v2_python_sparse
otter/integration/lib/test_nova.py
rackerlabs/otter
train
20
2ed00d6321641ba26d98df9508466cd849d80b7f
[ "sysmeta = req.get_container_info(self.app).get('sysmeta', {})\nelem = Element('VersioningConfiguration')\nif sysmeta.get('versions-enabled'):\n SubElement(elem, 'Status').text = 'Enabled' if config_true_value(sysmeta['versions-enabled']) else 'Suspended'\nbody = tostring(elem)\nreturn HTTPOk(body=body, content_...
<|body_start_0|> sysmeta = req.get_container_info(self.app).get('sysmeta', {}) elem = Element('VersioningConfiguration') if sysmeta.get('versions-enabled'): SubElement(elem, 'Status').text = 'Enabled' if config_true_value(sysmeta['versions-enabled']) else 'Suspended' body = t...
Handles the following APIs: * GET Bucket versioning * PUT Bucket versioning Those APIs are logged as VERSIONING operations in the S3 server log.
VersioningController
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VersioningController: """Handles the following APIs: * GET Bucket versioning * PUT Bucket versioning Those APIs are logged as VERSIONING operations in the S3 server log.""" def GET(self, req): """Handles GET Bucket versioning.""" <|body_0|> def PUT(self, req): ""...
stack_v2_sparse_classes_36k_train_028001
2,703
permissive
[ { "docstring": "Handles GET Bucket versioning.", "name": "GET", "signature": "def GET(self, req)" }, { "docstring": "Handles PUT Bucket versioning.", "name": "PUT", "signature": "def PUT(self, req)" } ]
2
null
Implement the Python class `VersioningController` described below. Class description: Handles the following APIs: * GET Bucket versioning * PUT Bucket versioning Those APIs are logged as VERSIONING operations in the S3 server log. Method signatures and docstrings: - def GET(self, req): Handles GET Bucket versioning. ...
Implement the Python class `VersioningController` described below. Class description: Handles the following APIs: * GET Bucket versioning * PUT Bucket versioning Those APIs are logged as VERSIONING operations in the S3 server log. Method signatures and docstrings: - def GET(self, req): Handles GET Bucket versioning. ...
f06e5369579599648cc78e4b556887bc6d978c2b
<|skeleton|> class VersioningController: """Handles the following APIs: * GET Bucket versioning * PUT Bucket versioning Those APIs are logged as VERSIONING operations in the S3 server log.""" def GET(self, req): """Handles GET Bucket versioning.""" <|body_0|> def PUT(self, req): ""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class VersioningController: """Handles the following APIs: * GET Bucket versioning * PUT Bucket versioning Those APIs are logged as VERSIONING operations in the S3 server log.""" def GET(self, req): """Handles GET Bucket versioning.""" sysmeta = req.get_container_info(self.app).get('sysmeta', {...
the_stack_v2_python_sparse
swift/common/middleware/s3api/controllers/versioning.py
openstack/swift
train
2,370
513a297965d3db04bdbaf65093dd086512482eb4
[ "if head is None:\n return None\nslow = head.next\nif slow is None:\n return None\nfast = slow.next\nwhile slow is not None and fast is not None:\n if slow == fast:\n return fast\n slow = slow.next\n fast = fast.next\n if fast is not None:\n fast = fast.next\nreturn None", "meet_no...
<|body_start_0|> if head is None: return None slow = head.next if slow is None: return None fast = slow.next while slow is not None and fast is not None: if slow == fast: return fast slow = slow.next fast...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def meeting_node(self, head): """在链表存在环的前提下找到一快一慢指针相遇的结点, :param head: 链表的头结点 :return:""" <|body_0|> def entry_node_of_loop(self, head): """找到环的入口结点 :param head: 链表头结点 :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> if head is Non...
stack_v2_sparse_classes_36k_train_028002
1,932
no_license
[ { "docstring": "在链表存在环的前提下找到一快一慢指针相遇的结点, :param head: 链表的头结点 :return:", "name": "meeting_node", "signature": "def meeting_node(self, head)" }, { "docstring": "找到环的入口结点 :param head: 链表头结点 :return:", "name": "entry_node_of_loop", "signature": "def entry_node_of_loop(self, head)" } ]
2
stack_v2_sparse_classes_30k_train_015521
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def meeting_node(self, head): 在链表存在环的前提下找到一快一慢指针相遇的结点, :param head: 链表的头结点 :return: - def entry_node_of_loop(self, head): 找到环的入口结点 :param head: 链表头结点 :return:
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def meeting_node(self, head): 在链表存在环的前提下找到一快一慢指针相遇的结点, :param head: 链表的头结点 :return: - def entry_node_of_loop(self, head): 找到环的入口结点 :param head: 链表头结点 :return: <|skeleton|> class...
51e6d72bfc631fa96e5a8ed6e4e55cd240ad47d9
<|skeleton|> class Solution: def meeting_node(self, head): """在链表存在环的前提下找到一快一慢指针相遇的结点, :param head: 链表的头结点 :return:""" <|body_0|> def entry_node_of_loop(self, head): """找到环的入口结点 :param head: 链表头结点 :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def meeting_node(self, head): """在链表存在环的前提下找到一快一慢指针相遇的结点, :param head: 链表的头结点 :return:""" if head is None: return None slow = head.next if slow is None: return None fast = slow.next while slow is not None and fast is not None: ...
the_stack_v2_python_sparse
剑指Offer/23.链表中环的入口结点.py
CodingBuye/PythonForNowcoder
train
2
20a82ab062812d265f4c94c173226f782d577adf
[ "s = self.create_series()\ni = self.create_instructor()\nresponse = self.client.get(reverse('substituteTeacherForm'))\nself.assertEqual(response.status_code, 302)\nself.client.login(username=self.superuser.username, password='pass')\nresponse = self.client.get(reverse('substituteTeacherForm'))\nself.assertEqual(res...
<|body_start_0|> s = self.create_series() i = self.create_instructor() response = self.client.get(reverse('substituteTeacherForm')) self.assertEqual(response.status_code, 302) self.client.login(username=self.superuser.username, password='pass') response = self.client.get(...
SubstituteTeacherTest
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SubstituteTeacherTest: def test_subform_access(self): """Test that the substitute teaching form can be accessed by a superuser but not an anonymous user, and that a new instructor can report substitute teaching for a new series""" <|body_0|> def test_subform_submission(self)...
stack_v2_sparse_classes_36k_train_028003
18,088
permissive
[ { "docstring": "Test that the substitute teaching form can be accessed by a superuser but not an anonymous user, and that a new instructor can report substitute teaching for a new series", "name": "test_subform_access", "signature": "def test_subform_access(self)" }, { "docstring": "Report subst...
2
null
Implement the Python class `SubstituteTeacherTest` described below. Class description: Implement the SubstituteTeacherTest class. Method signatures and docstrings: - def test_subform_access(self): Test that the substitute teaching form can be accessed by a superuser but not an anonymous user, and that a new instructo...
Implement the Python class `SubstituteTeacherTest` described below. Class description: Implement the SubstituteTeacherTest class. Method signatures and docstrings: - def test_subform_access(self): Test that the substitute teaching form can be accessed by a superuser but not an anonymous user, and that a new instructo...
19db3e83e76ea2002ee841989410d12d1e601023
<|skeleton|> class SubstituteTeacherTest: def test_subform_access(self): """Test that the substitute teaching form can be accessed by a superuser but not an anonymous user, and that a new instructor can report substitute teaching for a new series""" <|body_0|> def test_subform_submission(self)...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SubstituteTeacherTest: def test_subform_access(self): """Test that the substitute teaching form can be accessed by a superuser but not an anonymous user, and that a new instructor can report substitute teaching for a new series""" s = self.create_series() i = self.create_instructor() ...
the_stack_v2_python_sparse
danceschool/core/tests.py
django-danceschool/django-danceschool
train
40
091e2d516f68c17bda106148db12224b9bc4f2a3
[ "self.name = name\nself.active = active\nself.events = events\nself.config = config\nself.tags = tags\nself.additional_properties = additional_properties", "if dictionary is None:\n return None\nname = dictionary.get('name')\nactive = dictionary.get('active')\nevents = dictionary.get('events')\nconfig = idfy_r...
<|body_start_0|> self.name = name self.active = active self.events = events self.config = config self.tags = tags self.additional_properties = additional_properties <|end_body_0|> <|body_start_1|> if dictionary is None: return None name = dict...
Implementation of the 'WebhookUpdateDto' model. TODO: type model description here. Attributes: name (string): Display name of the webhook. active (bool): Determines whether the webhook is active or not. events (list of string): A list of events that the webhook triggers for. config (WebhookConfig): TODO: type descripti...
WebhookUpdateDto
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WebhookUpdateDto: """Implementation of the 'WebhookUpdateDto' model. TODO: type model description here. Attributes: name (string): Display name of the webhook. active (bool): Determines whether the webhook is active or not. events (list of string): A list of events that the webhook triggers for. ...
stack_v2_sparse_classes_36k_train_028004
2,903
permissive
[ { "docstring": "Constructor for the WebhookUpdateDto class", "name": "__init__", "signature": "def __init__(self, name=None, active=None, events=None, config=None, tags=None, additional_properties={})" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dicti...
2
null
Implement the Python class `WebhookUpdateDto` described below. Class description: Implementation of the 'WebhookUpdateDto' model. TODO: type model description here. Attributes: name (string): Display name of the webhook. active (bool): Determines whether the webhook is active or not. events (list of string): A list of...
Implement the Python class `WebhookUpdateDto` described below. Class description: Implementation of the 'WebhookUpdateDto' model. TODO: type model description here. Attributes: name (string): Display name of the webhook. active (bool): Determines whether the webhook is active or not. events (list of string): A list of...
fa3918a6c54ea0eedb9146578645b7eb1755b642
<|skeleton|> class WebhookUpdateDto: """Implementation of the 'WebhookUpdateDto' model. TODO: type model description here. Attributes: name (string): Display name of the webhook. active (bool): Determines whether the webhook is active or not. events (list of string): A list of events that the webhook triggers for. ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WebhookUpdateDto: """Implementation of the 'WebhookUpdateDto' model. TODO: type model description here. Attributes: name (string): Display name of the webhook. active (bool): Determines whether the webhook is active or not. events (list of string): A list of events that the webhook triggers for. config (Webho...
the_stack_v2_python_sparse
idfy_rest_client/models/webhook_update_dto.py
dealflowteam/Idfy
train
0
f91f5e32b7eaa2894e080c88b56abfb37a3eb7b7
[ "a = [x for x in sys_stdin]\na = [self.cast(x) for x in a[0].strip('[]\\n').split(',')]\no = TreeNode().convert(a)\nreturn o", "if x.lower() == 'null':\n return None\nelse:\n return int(x)" ]
<|body_start_0|> a = [x for x in sys_stdin] a = [self.cast(x) for x in a[0].strip('[]\n').split(',')] o = TreeNode().convert(a) return o <|end_body_0|> <|body_start_1|> if x.lower() == 'null': return None else: return int(x) <|end_body_1|>
Input
[ "Unlicense" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Input: def stdin(self, sys_stdin): """Imports standard input. :param _io.TextIOWrapper sys_stdin: standard input :return: head node of binary tree :rtype: TreeNode""" <|body_0|> def cast(self, x): """Converts string values to integer or None values. :param str x: str...
stack_v2_sparse_classes_36k_train_028005
2,443
permissive
[ { "docstring": "Imports standard input. :param _io.TextIOWrapper sys_stdin: standard input :return: head node of binary tree :rtype: TreeNode", "name": "stdin", "signature": "def stdin(self, sys_stdin)" }, { "docstring": "Converts string values to integer or None values. :param str x: string inp...
2
stack_v2_sparse_classes_30k_train_008038
Implement the Python class `Input` described below. Class description: Implement the Input class. Method signatures and docstrings: - def stdin(self, sys_stdin): Imports standard input. :param _io.TextIOWrapper sys_stdin: standard input :return: head node of binary tree :rtype: TreeNode - def cast(self, x): Converts ...
Implement the Python class `Input` described below. Class description: Implement the Input class. Method signatures and docstrings: - def stdin(self, sys_stdin): Imports standard input. :param _io.TextIOWrapper sys_stdin: standard input :return: head node of binary tree :rtype: TreeNode - def cast(self, x): Converts ...
69f90877c5466927e8b081c4268cbcda074813ec
<|skeleton|> class Input: def stdin(self, sys_stdin): """Imports standard input. :param _io.TextIOWrapper sys_stdin: standard input :return: head node of binary tree :rtype: TreeNode""" <|body_0|> def cast(self, x): """Converts string values to integer or None values. :param str x: str...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Input: def stdin(self, sys_stdin): """Imports standard input. :param _io.TextIOWrapper sys_stdin: standard input :return: head node of binary tree :rtype: TreeNode""" a = [x for x in sys_stdin] a = [self.cast(x) for x in a[0].strip('[]\n').split(',')] o = TreeNode().convert(a) ...
the_stack_v2_python_sparse
0199_binary_tree_right_side_view/python_source.py
arthurdysart/LeetCode
train
0
3350b8b3eaf7c7fc966c5d43d5392108e91dc28d
[ "super(LCPController, self).__init__(manager)\nself._logger = logging.getLogger(__name__)\nself._credential_factory = LCPCredentialFactory()\nself._lcp_server_factory = LCPServerFactory()", "self._logger.info('Started fetching an authenticated patron associated with the request')\npatron = self.authenticated_patr...
<|body_start_0|> super(LCPController, self).__init__(manager) self._logger = logging.getLogger(__name__) self._credential_factory = LCPCredentialFactory() self._lcp_server_factory = LCPServerFactory() <|end_body_0|> <|body_start_1|> self._logger.info('Started fetching an authent...
Contains API endpoints related to LCP workflow
LCPController
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LCPController: """Contains API endpoints related to LCP workflow""" def __init__(self, manager): """Initializes a new instance of LCPController class :param manager: CirculationManager object :type manager: CirculationManager""" <|body_0|> def _get_patron(self): ...
stack_v2_sparse_classes_36k_train_028006
4,383
permissive
[ { "docstring": "Initializes a new instance of LCPController class :param manager: CirculationManager object :type manager: CirculationManager", "name": "__init__", "signature": "def __init__(self, manager)" }, { "docstring": "Returns a patron associated with the request (if any) :return: Patron ...
6
null
Implement the Python class `LCPController` described below. Class description: Contains API endpoints related to LCP workflow Method signatures and docstrings: - def __init__(self, manager): Initializes a new instance of LCPController class :param manager: CirculationManager object :type manager: CirculationManager -...
Implement the Python class `LCPController` described below. Class description: Contains API endpoints related to LCP workflow Method signatures and docstrings: - def __init__(self, manager): Initializes a new instance of LCPController class :param manager: CirculationManager object :type manager: CirculationManager -...
662cc7e0721d0153857c8c17a37e2a6df86f8ce6
<|skeleton|> class LCPController: """Contains API endpoints related to LCP workflow""" def __init__(self, manager): """Initializes a new instance of LCPController class :param manager: CirculationManager object :type manager: CirculationManager""" <|body_0|> def _get_patron(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LCPController: """Contains API endpoints related to LCP workflow""" def __init__(self, manager): """Initializes a new instance of LCPController class :param manager: CirculationManager object :type manager: CirculationManager""" super(LCPController, self).__init__(manager) self._l...
the_stack_v2_python_sparse
api/lcp/controller.py
NYPL-Simplified/circulation
train
20
acd34188a2b7e1497881100fe4b1dd1bc8a89f55
[ "self.logger = stdlibLogging.getLogger(name)\nself.logger.findCaller = self._findCaller\nself.stackDepth = stackDepth", "f = currentframe(self.stackDepth)\nco = f.f_code\nif _PY3:\n extra = (None,)\nelse:\n extra = ()\nreturn (co.co_filename, f.f_lineno, co.co_name) + extra", "level = event.get('log_level...
<|body_start_0|> self.logger = stdlibLogging.getLogger(name) self.logger.findCaller = self._findCaller self.stackDepth = stackDepth <|end_body_0|> <|body_start_1|> f = currentframe(self.stackDepth) co = f.f_code if _PY3: extra = (None,) else: ...
Log observer that writes to the python standard library's C{logging} module. @note: Warning: specific logging configurations (example: network) can lead to this observer blocking. Nothing is done here to prevent that, so be sure to not to configure the standard library logging module to block when used in conjunction w...
STDLibLogObserver
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class STDLibLogObserver: """Log observer that writes to the python standard library's C{logging} module. @note: Warning: specific logging configurations (example: network) can lead to this observer blocking. Nothing is done here to prevent that, so be sure to not to configure the standard library loggi...
stack_v2_sparse_classes_36k_train_028007
4,611
permissive
[ { "docstring": "@param loggerName: logger identifier. @type loggerName: C{str} @param stackDepth: The depth of the stack to investigate for caller metadata. @type stackDepth: L{int}", "name": "__init__", "signature": "def __init__(self, name='twisted', stackDepth=defaultStackDepth)" }, { "docstr...
3
null
Implement the Python class `STDLibLogObserver` described below. Class description: Log observer that writes to the python standard library's C{logging} module. @note: Warning: specific logging configurations (example: network) can lead to this observer blocking. Nothing is done here to prevent that, so be sure to not ...
Implement the Python class `STDLibLogObserver` described below. Class description: Log observer that writes to the python standard library's C{logging} module. @note: Warning: specific logging configurations (example: network) can lead to this observer blocking. Nothing is done here to prevent that, so be sure to not ...
40861791ec4ed3bbd14b07875af25cc740f76920
<|skeleton|> class STDLibLogObserver: """Log observer that writes to the python standard library's C{logging} module. @note: Warning: specific logging configurations (example: network) can lead to this observer blocking. Nothing is done here to prevent that, so be sure to not to configure the standard library loggi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class STDLibLogObserver: """Log observer that writes to the python standard library's C{logging} module. @note: Warning: specific logging configurations (example: network) can lead to this observer blocking. Nothing is done here to prevent that, so be sure to not to configure the standard library logging module to ...
the_stack_v2_python_sparse
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/_stdlib.py
wistbean/learn_python3_spider
train
14,403
0e63f97b7092df89ea3aee68afbf12f336f4fe0f
[ "self.radius = radius\nself.x_center = x_center\nself.y_center = y_center", "r = self.radius * math.sqrt(random.random())\ntheta = random.uniform(0, 2 * math.pi)\nreturn [self.x_center + r * math.cos(theta), self.y_center + r * math.sin(theta)]" ]
<|body_start_0|> self.radius = radius self.x_center = x_center self.y_center = y_center <|end_body_0|> <|body_start_1|> r = self.radius * math.sqrt(random.random()) theta = random.uniform(0, 2 * math.pi) return [self.x_center + r * math.cos(theta), self.y_center + r * ma...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def __init__(self, radius, x_center, y_center): """:type radius: float :type x_center: float :type y_center: float""" <|body_0|> def randPoint(self): """:rtype: List[float]""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.radius = radi...
stack_v2_sparse_classes_36k_train_028008
717
permissive
[ { "docstring": ":type radius: float :type x_center: float :type y_center: float", "name": "__init__", "signature": "def __init__(self, radius, x_center, y_center)" }, { "docstring": ":rtype: List[float]", "name": "randPoint", "signature": "def randPoint(self)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, radius, x_center, y_center): :type radius: float :type x_center: float :type y_center: float - def randPoint(self): :rtype: List[float]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, radius, x_center, y_center): :type radius: float :type x_center: float :type y_center: float - def randPoint(self): :rtype: List[float] <|skeleton|> class Sol...
4ddea0a532fe7c5d053ffbd6870174ec99fc2d60
<|skeleton|> class Solution: def __init__(self, radius, x_center, y_center): """:type radius: float :type x_center: float :type y_center: float""" <|body_0|> def randPoint(self): """:rtype: List[float]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def __init__(self, radius, x_center, y_center): """:type radius: float :type x_center: float :type y_center: float""" self.radius = radius self.x_center = x_center self.y_center = y_center def randPoint(self): """:rtype: List[float]""" r = self.ra...
the_stack_v2_python_sparse
0401-0500/0478-Generate Random Point in a Circle/0478-Generate Random Point in a Circle.py
jiadaizhao/LeetCode
train
52
c14b5bfcb90f424a36f6bf86f206539c9f42933d
[ "self.certLocation = '~/.globus/usercert.pem' if 'X509_USER_CERT' not in os.environ else os.environ['X509_USER_CERT']\nself.keyLocation = '~/.globus/userkey.pem' if 'X509_USER_KEY' not in os.environ else os.environ['X509_USER_KEY']\nself.logger = logger\nself.timeleft = 0\nself.username = username", "cmd = 'expor...
<|body_start_0|> self.certLocation = '~/.globus/usercert.pem' if 'X509_USER_CERT' not in os.environ else os.environ['X509_USER_CERT'] self.keyLocation = '~/.globus/userkey.pem' if 'X509_USER_KEY' not in os.environ else os.environ['X509_USER_KEY'] self.logger = logger self.timeleft = 0 ...
an object to interact with myproxy-* commands
MyProxy
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyProxy: """an object to interact with myproxy-* commands""" def __init__(self, username=None, logger=None): """Constructor, sets sensible defaults for everything""" <|body_0|> def create(self, username=None, retrievers=None, validity=720): """creates a new crede...
stack_v2_sparse_classes_36k_train_028009
9,571
no_license
[ { "docstring": "Constructor, sets sensible defaults for everything", "name": "__init__", "signature": "def __init__(self, username=None, logger=None)" }, { "docstring": "creates a new credential in myproxy.cern.ch args: username: string: the username of the credential, usually the has of the use...
4
stack_v2_sparse_classes_30k_train_013623
Implement the Python class `MyProxy` described below. Class description: an object to interact with myproxy-* commands Method signatures and docstrings: - def __init__(self, username=None, logger=None): Constructor, sets sensible defaults for everything - def create(self, username=None, retrievers=None, validity=720)...
Implement the Python class `MyProxy` described below. Class description: an object to interact with myproxy-* commands Method signatures and docstrings: - def __init__(self, username=None, logger=None): Constructor, sets sensible defaults for everything - def create(self, username=None, retrievers=None, validity=720)...
549c4e3b6158e8344315437d1d128f2288551d47
<|skeleton|> class MyProxy: """an object to interact with myproxy-* commands""" def __init__(self, username=None, logger=None): """Constructor, sets sensible defaults for everything""" <|body_0|> def create(self, username=None, retrievers=None, validity=720): """creates a new crede...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MyProxy: """an object to interact with myproxy-* commands""" def __init__(self, username=None, logger=None): """Constructor, sets sensible defaults for everything""" self.certLocation = '~/.globus/usercert.pem' if 'X509_USER_CERT' not in os.environ else os.environ['X509_USER_CERT'] ...
the_stack_v2_python_sparse
src/python/CRABClient/ProxyInteractions.py
dmwm/CRABClient
train
12
d5b06d94c25bdedbfff84096f614512549328098
[ "merged_folder = os.path.abspath(f'{Global_var.DB.value}/{name}')\nif not os.path.isdir(merged_folder):\n os.mkdir(merged_folder)\nprotein_files = sorted(os.listdir(path_to_proteins))\nligand_files = sorted(os.listdir(path_to_ligands))\nunion_index = 0\ntry:\n assert len(protein_files) == len(ligand_files)\ne...
<|body_start_0|> merged_folder = os.path.abspath(f'{Global_var.DB.value}/{name}') if not os.path.isdir(merged_folder): os.mkdir(merged_folder) protein_files = sorted(os.listdir(path_to_proteins)) ligand_files = sorted(os.listdir(path_to_ligands)) union_index = 0 ...
Class provides the functions for making manipulations with folders containing protein-ligand complexes
FolderFunctions
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FolderFunctions: """Class provides the functions for making manipulations with folders containing protein-ligand complexes""" def merge_ligand_complexes_with_proteins(name='390', path_to_proteins=os.path.abspath(f'{Global_var.DB.value}/39_protein_pdb'), path_to_ligands=os.path.abspath('pdbbi...
stack_v2_sparse_classes_36k_train_028010
6,208
no_license
[ { "docstring": "Merging ligand complexes with proteins by putting them on the same folders param name: the final folder with proteins and ligands param path_to_proteins: the path to proteins param path_to_ligands: the path to ligands", "name": "merge_ligand_complexes_with_proteins", "signature": "def me...
4
stack_v2_sparse_classes_30k_train_014388
Implement the Python class `FolderFunctions` described below. Class description: Class provides the functions for making manipulations with folders containing protein-ligand complexes Method signatures and docstrings: - def merge_ligand_complexes_with_proteins(name='390', path_to_proteins=os.path.abspath(f'{Global_va...
Implement the Python class `FolderFunctions` described below. Class description: Class provides the functions for making manipulations with folders containing protein-ligand complexes Method signatures and docstrings: - def merge_ligand_complexes_with_proteins(name='390', path_to_proteins=os.path.abspath(f'{Global_va...
32d4a8c9ccdede1573c6dcd830664ab77e4697f7
<|skeleton|> class FolderFunctions: """Class provides the functions for making manipulations with folders containing protein-ligand complexes""" def merge_ligand_complexes_with_proteins(name='390', path_to_proteins=os.path.abspath(f'{Global_var.DB.value}/39_protein_pdb'), path_to_ligands=os.path.abspath('pdbbi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FolderFunctions: """Class provides the functions for making manipulations with folders containing protein-ligand complexes""" def merge_ligand_complexes_with_proteins(name='390', path_to_proteins=os.path.abspath(f'{Global_var.DB.value}/39_protein_pdb'), path_to_ligands=os.path.abspath('pdbbind_data_2018/...
the_stack_v2_python_sparse
structured/data_loader/preprocess/folder_functions.py
akezhanmussa/ProteinLigandPredictor
train
2
b2e50ec50004a832c0cce740402dac902f259189
[ "self.filename = filename\nif filename != '':\n f = open(self.filename, 'r')\n self.lines = f.read().splitlines()\n f.close()\n self.kpoints = self.read(self.lines)", "if lines[1] == '0':\n return self.get_mesh_kp(lines=lines)\nelif 'Reciprocal' in lines[2]:\n return self.get_ibz_kp(lines=lines)...
<|body_start_0|> self.filename = filename if filename != '': f = open(self.filename, 'r') self.lines = f.read().splitlines() f.close() self.kpoints = self.read(self.lines) <|end_body_0|> <|body_start_1|> if lines[1] == '0': return self...
Make VASP KPOINTS as object.
Kpoints
[ "NIST-PD" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Kpoints: """Make VASP KPOINTS as object.""" def __init__(self, filename=''): """Initialize Kpoints from filename else read from file-stream.""" <|body_0|> def read(self, lines): """Read from an open file.""" <|body_1|> def get_mesh_kp(lines=''): ...
stack_v2_sparse_classes_36k_train_028011
20,796
permissive
[ { "docstring": "Initialize Kpoints from filename else read from file-stream.", "name": "__init__", "signature": "def __init__(self, filename='')" }, { "docstring": "Read from an open file.", "name": "read", "signature": "def read(self, lines)" }, { "docstring": "Read Kpoints as g...
4
stack_v2_sparse_classes_30k_train_006615
Implement the Python class `Kpoints` described below. Class description: Make VASP KPOINTS as object. Method signatures and docstrings: - def __init__(self, filename=''): Initialize Kpoints from filename else read from file-stream. - def read(self, lines): Read from an open file. - def get_mesh_kp(lines=''): Read Kpo...
Implement the Python class `Kpoints` described below. Class description: Make VASP KPOINTS as object. Method signatures and docstrings: - def __init__(self, filename=''): Initialize Kpoints from filename else read from file-stream. - def read(self, lines): Read from an open file. - def get_mesh_kp(lines=''): Read Kpo...
1c44aba9e648b21744b0d306b1ea9b3c73a5b0fb
<|skeleton|> class Kpoints: """Make VASP KPOINTS as object.""" def __init__(self, filename=''): """Initialize Kpoints from filename else read from file-stream.""" <|body_0|> def read(self, lines): """Read from an open file.""" <|body_1|> def get_mesh_kp(lines=''): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Kpoints: """Make VASP KPOINTS as object.""" def __init__(self, filename=''): """Initialize Kpoints from filename else read from file-stream.""" self.filename = filename if filename != '': f = open(self.filename, 'r') self.lines = f.read().splitlines() ...
the_stack_v2_python_sparse
jarvis/io/vasp/inputs.py
tavazza/jarvis
train
0
cdc7363802e7654598d0114363f578ed7e48c8c1
[ "self.pool = pool\nself.project = project\nself.targetdir = targetdir\nself.callback = callback\nself.exc_hld = exc_hld", "_logger.info('Snapshotting %s under %s' % (self.project, self.targetdir))\nself.project.snapshot(self.targetdir, False)\n\ndef walk(dir_, targetdir):\n \"\"\"walkthrough the project hierar...
<|body_start_0|> self.pool = pool self.project = project self.targetdir = targetdir self.callback = callback self.exc_hld = exc_hld <|end_body_0|> <|body_start_1|> _logger.info('Snapshotting %s under %s' % (self.project, self.targetdir)) self.project.snapshot(sel...
Snapshot Job executed by the thread pool.
_FastSnapshot
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _FastSnapshot: """Snapshot Job executed by the thread pool.""" def __init__(self, pool, project, targetdir, callback, exc_hld): """Construtor, will store the parameter for the checkout.""" <|body_0|> def __call__(self): """Do the checkout, and then walkthrough th...
stack_v2_sparse_classes_36k_train_028012
15,149
no_license
[ { "docstring": "Construtor, will store the parameter for the checkout.", "name": "__init__", "signature": "def __init__(self, pool, project, targetdir, callback, exc_hld)" }, { "docstring": "Do the checkout, and then walkthrough the project hierarchy to find subproject to snapshot.", "name":...
2
null
Implement the Python class `_FastSnapshot` described below. Class description: Snapshot Job executed by the thread pool. Method signatures and docstrings: - def __init__(self, pool, project, targetdir, callback, exc_hld): Construtor, will store the parameter for the checkout. - def __call__(self): Do the checkout, an...
Implement the Python class `_FastSnapshot` described below. Class description: Snapshot Job executed by the thread pool. Method signatures and docstrings: - def __init__(self, pool, project, targetdir, callback, exc_hld): Construtor, will store the parameter for the checkout. - def __call__(self): Do the checkout, an...
f458a4ce83f74d603362fe6b71eaa647ccc62fee
<|skeleton|> class _FastSnapshot: """Snapshot Job executed by the thread pool.""" def __init__(self, pool, project, targetdir, callback, exc_hld): """Construtor, will store the parameter for the checkout.""" <|body_0|> def __call__(self): """Do the checkout, and then walkthrough th...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _FastSnapshot: """Snapshot Job executed by the thread pool.""" def __init__(self, pool, project, targetdir, callback, exc_hld): """Construtor, will store the parameter for the checkout.""" self.pool = pool self.project = project self.targetdir = targetdir self.call...
the_stack_v2_python_sparse
buildframework/helium/sf/python/pythoncore/lib/ccm/extra.py
anagovitsyn/oss.FCL.sftools.dev.build
train
0
24644bc5f431cba1d0ff807e16cd3a880a99781d
[ "test = application.orm.get_test(test_id)\ntest_schema = TestsSchema()\nif test is None:\n return fail_response('Test is not found', code=404)\nres = test_schema.dump(test)\nquestions = []\nquestions_schema = QuestionsSchema()\nfor question_id in res.data['questions_tests']:\n obj = application.orm.get_questi...
<|body_start_0|> test = application.orm.get_test(test_id) test_schema = TestsSchema() if test is None: return fail_response('Test is not found', code=404) res = test_schema.dump(test) questions = [] questions_schema = QuestionsSchema() for question_id ...
TestManagement
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestManagement: def get(self, test_id): """--- summary: Get test by id description: All test questions with test metainfo parameters: - in: path name: user_id schema: type: integer required: true description: Numeric ID of the user to get responses: 200: description: OK content: applicat...
stack_v2_sparse_classes_36k_train_028013
12,238
no_license
[ { "docstring": "--- summary: Get test by id description: All test questions with test metainfo parameters: - in: path name: user_id schema: type: integer required: true description: Numeric ID of the user to get responses: 200: description: OK content: application/json: schema: TestsSchema example: { \"archived...
3
stack_v2_sparse_classes_30k_train_004029
Implement the Python class `TestManagement` described below. Class description: Implement the TestManagement class. Method signatures and docstrings: - def get(self, test_id): --- summary: Get test by id description: All test questions with test metainfo parameters: - in: path name: user_id schema: type: integer requ...
Implement the Python class `TestManagement` described below. Class description: Implement the TestManagement class. Method signatures and docstrings: - def get(self, test_id): --- summary: Get test by id description: All test questions with test metainfo parameters: - in: path name: user_id schema: type: integer requ...
171f990754f1c89cefe2b416001d1b7e3a6a430d
<|skeleton|> class TestManagement: def get(self, test_id): """--- summary: Get test by id description: All test questions with test metainfo parameters: - in: path name: user_id schema: type: integer required: true description: Numeric ID of the user to get responses: 200: description: OK content: applicat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestManagement: def get(self, test_id): """--- summary: Get test by id description: All test questions with test metainfo parameters: - in: path name: user_id schema: type: integer required: true description: Numeric ID of the user to get responses: 200: description: OK content: application/json: sche...
the_stack_v2_python_sparse
backend/api/test.py
ssd-courseproject/adminssion-forms-backend
train
0
c2ada04b43ac6b8809c86914a506f66146c5cd0f
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn AccessReviewHistoryInstance()", "from .access_review_history_status import AccessReviewHistoryStatus\nfrom .entity import Entity\nfrom .access_review_history_status import AccessReviewHistoryStatus\nfrom .entity import Entity\nfields: ...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return AccessReviewHistoryInstance() <|end_body_0|> <|body_start_1|> from .access_review_history_status import AccessReviewHistoryStatus from .entity import Entity from .access_review_h...
AccessReviewHistoryInstance
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AccessReviewHistoryInstance: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AccessReviewHistoryInstance: """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 a...
stack_v2_sparse_classes_36k_train_028014
4,766
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: AccessReviewHistoryInstance", "name": "create_from_discriminator_value", "signature": "def create_from_discr...
3
stack_v2_sparse_classes_30k_train_004514
Implement the Python class `AccessReviewHistoryInstance` described below. Class description: Implement the AccessReviewHistoryInstance class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AccessReviewHistoryInstance: Creates a new instance of the appr...
Implement the Python class `AccessReviewHistoryInstance` described below. Class description: Implement the AccessReviewHistoryInstance class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AccessReviewHistoryInstance: Creates a new instance of the appr...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class AccessReviewHistoryInstance: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AccessReviewHistoryInstance: """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 a...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AccessReviewHistoryInstance: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AccessReviewHistoryInstance: """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 ...
the_stack_v2_python_sparse
msgraph/generated/models/access_review_history_instance.py
microsoftgraph/msgraph-sdk-python
train
135
b1ff2060acac96a8e9f2bc7cd650a942daa1ba20
[ "\"\"\"\n 解决方案:\n url:https://leetcode.com/problems/rle-iterator/discuss/176553/Python-simple-pointer-to-next-element\n 1. 不单独构建新的列表结构,只标记取数的位置,迭代读取返回结果\n url: https://leetcode.com/problems/rle-iterator/discuss/175683/Python-Binary-Search-Solution-beats-100\n 2. 组成取值列表和索引列表映射,next...
<|body_start_0|> """ 解决方案: url:https://leetcode.com/problems/rle-iterator/discuss/176553/Python-simple-pointer-to-next-element 1. 不单独构建新的列表结构,只标记取数的位置,迭代读取返回结果 url: https://leetcode.com/problems/rle-iterator/discuss/175683/Python-Binary-Search-Solu...
RLEIterator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RLEIterator: def __init__(self, A): """:type A: List[int]""" <|body_0|> def next(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> """ 解决方案: url:https://leetcode.com/problems/rle-it...
stack_v2_sparse_classes_36k_train_028015
1,523
no_license
[ { "docstring": ":type A: List[int]", "name": "__init__", "signature": "def __init__(self, A)" }, { "docstring": ":type n: int :rtype: int", "name": "next", "signature": "def next(self, n)" } ]
2
null
Implement the Python class `RLEIterator` described below. Class description: Implement the RLEIterator class. Method signatures and docstrings: - def __init__(self, A): :type A: List[int] - def next(self, n): :type n: int :rtype: int
Implement the Python class `RLEIterator` described below. Class description: Implement the RLEIterator class. Method signatures and docstrings: - def __init__(self, A): :type A: List[int] - def next(self, n): :type n: int :rtype: int <|skeleton|> class RLEIterator: def __init__(self, A): """:type A: Lis...
a39280ab6bbbf3b688a024a71ef952be5010d98e
<|skeleton|> class RLEIterator: def __init__(self, A): """:type A: List[int]""" <|body_0|> def next(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RLEIterator: def __init__(self, A): """:type A: List[int]""" """ 解决方案: url:https://leetcode.com/problems/rle-iterator/discuss/176553/Python-simple-pointer-to-next-element 1. 不单独构建新的列表结构,只标记取数的位置,迭代读取返回结果 url: https://leetcode.com/...
the_stack_v2_python_sparse
900_RLE_Iterator.py
MarcelArthur/leetcode_collection
train
0
578f25cf0f64c96b315aba529fc3c20b577734b6
[ "if len(np.shape(x_t)) > 1 and np.shape(x_t)[1] > 1:\n raise NotImplementedError()\nelse:\n x_next_mean_precision = x_t * self.parameters.A * self.parameters.Qinv + self.y_next * self.parameters.C * self.parameters.Rinv\n x_next_precision = self.parameters.Qinv + self.parameters.C ** 2 * self.parameters.Ri...
<|body_start_0|> if len(np.shape(x_t)) > 1 and np.shape(x_t)[1] > 1: raise NotImplementedError() else: x_next_mean_precision = x_t * self.parameters.A * self.parameters.Qinv + self.y_next * self.parameters.C * self.parameters.Rinv x_next_precision = self.parameters.Qi...
Optimal Instrumental Kernel for LGSSM K(x_{t+1} | x_t) = Pr(x_{t+1} | x_t, y_{t+1}, parameters)
LGSSMOptimalKernel
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LGSSMOptimalKernel: """Optimal Instrumental Kernel for LGSSM K(x_{t+1} | x_t) = Pr(x_{t+1} | x_t, y_{t+1}, parameters)""" def rv(self, x_t, **kwargs): """optimal Kernel for LGSSM Sample x_{t+1} ~ Pr(x_{t+1} | x_t, y_{t+1}, parameters) Args: x_t (ndarray): N by n, x_t Return: x_next (...
stack_v2_sparse_classes_36k_train_028016
7,345
permissive
[ { "docstring": "optimal Kernel for LGSSM Sample x_{t+1} ~ Pr(x_{t+1} | x_t, y_{t+1}, parameters) Args: x_t (ndarray): N by n, x_t Return: x_next (ndarray): N by n, x_{t+1}", "name": "rv", "signature": "def rv(self, x_t, **kwargs)" }, { "docstring": "Reweight function for Optimal Kernel for LGSSM...
2
stack_v2_sparse_classes_30k_train_010964
Implement the Python class `LGSSMOptimalKernel` described below. Class description: Optimal Instrumental Kernel for LGSSM K(x_{t+1} | x_t) = Pr(x_{t+1} | x_t, y_{t+1}, parameters) Method signatures and docstrings: - def rv(self, x_t, **kwargs): optimal Kernel for LGSSM Sample x_{t+1} ~ Pr(x_{t+1} | x_t, y_{t+1}, para...
Implement the Python class `LGSSMOptimalKernel` described below. Class description: Optimal Instrumental Kernel for LGSSM K(x_{t+1} | x_t) = Pr(x_{t+1} | x_t, y_{t+1}, parameters) Method signatures and docstrings: - def rv(self, x_t, **kwargs): optimal Kernel for LGSSM Sample x_{t+1} ~ Pr(x_{t+1} | x_t, y_{t+1}, para...
b4f04637165c13fd7b3e042b36ad9b77d2528733
<|skeleton|> class LGSSMOptimalKernel: """Optimal Instrumental Kernel for LGSSM K(x_{t+1} | x_t) = Pr(x_{t+1} | x_t, y_{t+1}, parameters)""" def rv(self, x_t, **kwargs): """optimal Kernel for LGSSM Sample x_{t+1} ~ Pr(x_{t+1} | x_t, y_{t+1}, parameters) Args: x_t (ndarray): N by n, x_t Return: x_next (...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LGSSMOptimalKernel: """Optimal Instrumental Kernel for LGSSM K(x_{t+1} | x_t) = Pr(x_{t+1} | x_t, y_{t+1}, parameters)""" def rv(self, x_t, **kwargs): """optimal Kernel for LGSSM Sample x_{t+1} ~ Pr(x_{t+1} | x_t, y_{t+1}, parameters) Args: x_t (ndarray): N by n, x_t Return: x_next (ndarray): N b...
the_stack_v2_python_sparse
sgmcmc_ssm/models/lgssm/kernels.py
PeiKaLunCi/sgmcmc_ssm_code
train
0
297ff7620da54b1c9ebd752947018bf34dec1ab7
[ "self.__k = k\nself.__min_heap = []\nfor n in nums:\n self.add(n)", "heapq.heappush(self.__min_heap, val)\nif len(self.__min_heap) > self.__k:\n heapq.heappop(self.__min_heap)\nreturn self.__min_heap[0]" ]
<|body_start_0|> self.__k = k self.__min_heap = [] for n in nums: self.add(n) <|end_body_0|> <|body_start_1|> heapq.heappush(self.__min_heap, val) if len(self.__min_heap) > self.__k: heapq.heappop(self.__min_heap) return self.__min_heap[0] <|end_b...
KthLargest
[ "MIT" ]
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.__min_heap = [] for n in...
stack_v2_sparse_classes_36k_train_028017
550
permissive
[ { "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
null
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...
4dc4e6642dc92f1983c13564cc0fd99917cab358
<|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.__min_heap = [] for n in nums: self.add(n) def add(self, val): """:type val: int :rtype: int""" heapq.heappush(self.__min_heap, val) if l...
the_stack_v2_python_sparse
Python/kth-largest-element-in-a-stream.py
kamyu104/LeetCode-Solutions
train
4,549
46cccd1719b72d748bd46616fe821bb94a116f3f
[ "self.init_successful = True\ntry:\n rospy.wait_for_service('pr2_etherCAT/halt_motors', 5)\n self.halt_motors_client = rospy.ServiceProxy('pr2_etherCAT/halt_motors', Empty)\n rospy.loginfo('Found halt motors service')\nexcept:\n rospy.logerr('Cannot find halt motors service')\n self.init_successful =...
<|body_start_0|> self.init_successful = True try: rospy.wait_for_service('pr2_etherCAT/halt_motors', 5) self.halt_motors_client = rospy.ServiceProxy('pr2_etherCAT/halt_motors', Empty) rospy.loginfo('Found halt motors service') except: rospy.logerr(...
Provide utility functions for starting/stopping PR2.
RunStop
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RunStop: """Provide utility functions for starting/stopping PR2.""" def __init__(self): """Establish service connections for motors, power board.""" <|body_0|> def stop(self): """Halt motors, place power board into standboy. Stops robot.""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_028018
4,841
no_license
[ { "docstring": "Establish service connections for motors, power board.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Halt motors, place power board into standboy. Stops robot.", "name": "stop", "signature": "def stop(self)" }, { "docstring": "Reset po...
5
null
Implement the Python class `RunStop` described below. Class description: Provide utility functions for starting/stopping PR2. Method signatures and docstrings: - def __init__(self): Establish service connections for motors, power board. - def stop(self): Halt motors, place power board into standboy. Stops robot. - de...
Implement the Python class `RunStop` described below. Class description: Provide utility functions for starting/stopping PR2. Method signatures and docstrings: - def __init__(self): Establish service connections for motors, power board. - def stop(self): Halt motors, place power board into standboy. Stops robot. - de...
b2cc6fc19c143ac6dc7f83af02a94c3833820b6e
<|skeleton|> class RunStop: """Provide utility functions for starting/stopping PR2.""" def __init__(self): """Establish service connections for motors, power board.""" <|body_0|> def stop(self): """Halt motors, place power board into standboy. Stops robot.""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RunStop: """Provide utility functions for starting/stopping PR2.""" def __init__(self): """Establish service connections for motors, power board.""" self.init_successful = True try: rospy.wait_for_service('pr2_etherCAT/halt_motors', 5) self.halt_motors_clie...
the_stack_v2_python_sparse
wouse/src/wouse/run_stop_server.py
wklharry/hrl
train
0
4575f69f4da7cc321dfa90dc66ae552bce6d4113
[ "startTime = datetime.datetime.now()\nclient = dml.pymongo.MongoClient()\nrepo = client.repo\nrepo.authenticate('hek_kquirk', 'hek_kquirk')\nrepo.dropCollection('hek_kquirk.district_income')\nrepo.createCollection('hek_kquirk.district_income')\nrepo.dropCollection('hek_kquirk.tmp_collection')\nrepo.createCollection...
<|body_start_0|> startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('hek_kquirk', 'hek_kquirk') repo.dropCollection('hek_kquirk.district_income') repo.createCollection('hek_kquirk.district_income') repo.drop...
districts_income
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class districts_income: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everyth...
stack_v2_sparse_classes_36k_train_028019
6,067
no_license
[ { "docstring": "Retrieve some data sets (not using the API here for the sake of simplicity).", "name": "execute", "signature": "def execute(trial=False)" }, { "docstring": "Create the provenance document describing everything happening in this script. Each run of the script will generate a new d...
2
null
Implement the Python class `districts_income` described below. Class description: Implement the districts_income class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=N...
Implement the Python class `districts_income` described below. Class description: Implement the districts_income class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=N...
90284cf3debbac36eead07b8d2339cdd191b86cf
<|skeleton|> class districts_income: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everyth...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class districts_income: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('hek_kquirk', 'hek_kquirk') ...
the_stack_v2_python_sparse
hek_kquirk/districts_income.py
maximega/course-2019-spr-proj
train
2
dc5b6da4e56a278aaff5306e40080edcfa1316cb
[ "env_params = lending_params.DelayedImpactParams(applicant_distribution=lending_params.two_group_credit_clusters(cluster_probabilities=self.cluster_probabilities, group_likelihoods=[self.group_0_prob, 1 - self.group_0_prob]), bank_starting_cash=self.bank_starting_cash, interest_rate=self.interest_rate, cluster_shif...
<|body_start_0|> env_params = lending_params.DelayedImpactParams(applicant_distribution=lending_params.two_group_credit_clusters(cluster_probabilities=self.cluster_probabilities, group_likelihoods=[self.group_0_prob, 1 - self.group_0_prob]), bank_starting_cash=self.bank_starting_cash, interest_rate=self.interes...
Specifies the parameters of an experiment to run.
Experiment
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Experiment: """Specifies the parameters of an experiment to run.""" def scenario_builder(self): """Returns an agent and environment pair.""" <|body_0|> def run(self): """Run a lending experiment. Returns: A json encoding of the experiment result.""" <|bod...
stack_v2_sparse_classes_36k_train_028020
5,635
permissive
[ { "docstring": "Returns an agent and environment pair.", "name": "scenario_builder", "signature": "def scenario_builder(self)" }, { "docstring": "Run a lending experiment. Returns: A json encoding of the experiment result.", "name": "run", "signature": "def run(self)" } ]
2
null
Implement the Python class `Experiment` described below. Class description: Specifies the parameters of an experiment to run. Method signatures and docstrings: - def scenario_builder(self): Returns an agent and environment pair. - def run(self): Run a lending experiment. Returns: A json encoding of the experiment res...
Implement the Python class `Experiment` described below. Class description: Specifies the parameters of an experiment to run. Method signatures and docstrings: - def scenario_builder(self): Returns an agent and environment pair. - def run(self): Run a lending experiment. Returns: A json encoding of the experiment res...
38eaf4514062892e0c3ce5d7cff4b4c1a7e49242
<|skeleton|> class Experiment: """Specifies the parameters of an experiment to run.""" def scenario_builder(self): """Returns an agent and environment pair.""" <|body_0|> def run(self): """Run a lending experiment. Returns: A json encoding of the experiment result.""" <|bod...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Experiment: """Specifies the parameters of an experiment to run.""" def scenario_builder(self): """Returns an agent and environment pair.""" env_params = lending_params.DelayedImpactParams(applicant_distribution=lending_params.two_group_credit_clusters(cluster_probabilities=self.cluster_p...
the_stack_v2_python_sparse
experiments/lending.py
google/ml-fairness-gym
train
310
42d2bb46f1628a1d199719b7c22d2cf37b2bb7cd
[ "super(ScaleProductAttention, self).__init__()\nself.decoder_att = nn.Linear(decoder_dim, encoder_dim)\nself.dk = encoder_dim\nself.softmax = nn.Softmax(dim=1)", "query = self.decoder_att(decoder_hidden).unsqueeze(1)\nscores = torch.matmul(query, encoder_out.transpose(-2, -1)) / math.sqrt(self.dk)\nscores = score...
<|body_start_0|> super(ScaleProductAttention, self).__init__() self.decoder_att = nn.Linear(decoder_dim, encoder_dim) self.dk = encoder_dim self.softmax = nn.Softmax(dim=1) <|end_body_0|> <|body_start_1|> query = self.decoder_att(decoder_hidden).unsqueeze(1) scores = tor...
Attention Network.
ScaleProductAttention
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ScaleProductAttention: """Attention Network.""" def __init__(self, encoder_dim, decoder_dim): """:param encoder_dim: feature size of encoded images :param decoder_dim: size of decoder's RNN :param attention_dim: size of the attention network""" <|body_0|> def forward(sel...
stack_v2_sparse_classes_36k_train_028021
8,469
no_license
[ { "docstring": ":param encoder_dim: feature size of encoded images :param decoder_dim: size of decoder's RNN :param attention_dim: size of the attention network", "name": "__init__", "signature": "def __init__(self, encoder_dim, decoder_dim)" }, { "docstring": "Forward propagation. :param encode...
2
stack_v2_sparse_classes_30k_test_001110
Implement the Python class `ScaleProductAttention` described below. Class description: Attention Network. Method signatures and docstrings: - def __init__(self, encoder_dim, decoder_dim): :param encoder_dim: feature size of encoded images :param decoder_dim: size of decoder's RNN :param attention_dim: size of the att...
Implement the Python class `ScaleProductAttention` described below. Class description: Attention Network. Method signatures and docstrings: - def __init__(self, encoder_dim, decoder_dim): :param encoder_dim: feature size of encoded images :param decoder_dim: size of decoder's RNN :param attention_dim: size of the att...
426d97b5d3688f6c52c51ef6e33872554d55751a
<|skeleton|> class ScaleProductAttention: """Attention Network.""" def __init__(self, encoder_dim, decoder_dim): """:param encoder_dim: feature size of encoded images :param decoder_dim: size of decoder's RNN :param attention_dim: size of the attention network""" <|body_0|> def forward(sel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ScaleProductAttention: """Attention Network.""" def __init__(self, encoder_dim, decoder_dim): """:param encoder_dim: feature size of encoded images :param decoder_dim: size of decoder's RNN :param attention_dim: size of the attention network""" super(ScaleProductAttention, self).__init__(...
the_stack_v2_python_sparse
src/models/basic_encoder_decoder_models/encoder_decoder_variants/attention_scale_product.py
RitaRamo/remote-sensing-images-caption
train
3
79234d2d23144a814a7d1e03bc28d91e9493b7bb
[ "self._cusip = cusip\nself._trade_dt = trade_dt\nself._mat_dt = matDate\nself._sec_type = secType", "ref_dt = self._mat_dt if not ref_dt else ref_dt\nif crv_type == 'tsy':\n crv = curve_funcs.loadTreasuryCurve(dflt=True)\nif interp == 'flat':\n return curve_funcs.flatInterp(ref_dt, crv)\nelif interp == 'lin...
<|body_start_0|> self._cusip = cusip self._trade_dt = trade_dt self._mat_dt = matDate self._sec_type = secType <|end_body_0|> <|body_start_1|> ref_dt = self._mat_dt if not ref_dt else ref_dt if crv_type == 'tsy': crv = curve_funcs.loadTreasuryCurve(dflt=True)...
Parent class for Bonds, holds all the generic information
Bond
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Bond: """Parent class for Bonds, holds all the generic information""" def __init__(self, cusip, trade_dt, matDate, secType): """Constructor Parameters ========== cusip : str cusip of this bond issueDate : str when bond was issued matDate : str maturity date of bond secType : str type...
stack_v2_sparse_classes_36k_train_028022
1,589
no_license
[ { "docstring": "Constructor Parameters ========== cusip : str cusip of this bond issueDate : str when bond was issued matDate : str maturity date of bond secType : str type of security Return ====== NONE", "name": "__init__", "signature": "def __init__(self, cusip, trade_dt, matDate, secType)" }, { ...
2
null
Implement the Python class `Bond` described below. Class description: Parent class for Bonds, holds all the generic information Method signatures and docstrings: - def __init__(self, cusip, trade_dt, matDate, secType): Constructor Parameters ========== cusip : str cusip of this bond issueDate : str when bond was issu...
Implement the Python class `Bond` described below. Class description: Parent class for Bonds, holds all the generic information Method signatures and docstrings: - def __init__(self, cusip, trade_dt, matDate, secType): Constructor Parameters ========== cusip : str cusip of this bond issueDate : str when bond was issu...
957c49300ae59571eda590ddf13e7e092fdd96aa
<|skeleton|> class Bond: """Parent class for Bonds, holds all the generic information""" def __init__(self, cusip, trade_dt, matDate, secType): """Constructor Parameters ========== cusip : str cusip of this bond issueDate : str when bond was issued matDate : str maturity date of bond secType : str type...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Bond: """Parent class for Bonds, holds all the generic information""" def __init__(self, cusip, trade_dt, matDate, secType): """Constructor Parameters ========== cusip : str cusip of this bond issueDate : str when bond was issued matDate : str maturity date of bond secType : str type of security ...
the_stack_v2_python_sparse
financial_lib/bond/bond.py
mccarvik/python_for_finance
train
3
b7e248ec616e33fc143d9315808a1e803ceea4b1
[ "with Database() as db:\n if id_person_requiring_assistance_type is None and is_active is None:\n data = db.query(Table).all()\n elif id_person_requiring_assistance_type is None:\n data = db.query(Table).filter(Table.is_active == is_active).all()\n else:\n data = db.query(Table).get(id...
<|body_start_0|> with Database() as db: if id_person_requiring_assistance_type is None and is_active is None: data = db.query(Table).all() elif id_person_requiring_assistance_type is None: data = db.query(Table).filter(Table.is_active == is_active).all() ...
PersonRequiringAssistanceType
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PersonRequiringAssistanceType: def get(self, id_person_requiring_assistance_type=None, is_active=None): """Return all person requiring assistance type information :param person_requiring_assistance_type: UUID :param is_active: BOOLEAN""" <|body_0|> def create(self, body): ...
stack_v2_sparse_classes_36k_train_028023
2,925
no_license
[ { "docstring": "Return all person requiring assistance type information :param person_requiring_assistance_type: UUID :param is_active: BOOLEAN", "name": "get", "signature": "def get(self, id_person_requiring_assistance_type=None, is_active=None)" }, { "docstring": "Create a new person requiring...
4
stack_v2_sparse_classes_30k_train_016577
Implement the Python class `PersonRequiringAssistanceType` described below. Class description: Implement the PersonRequiringAssistanceType class. Method signatures and docstrings: - def get(self, id_person_requiring_assistance_type=None, is_active=None): Return all person requiring assistance type information :param ...
Implement the Python class `PersonRequiringAssistanceType` described below. Class description: Implement the PersonRequiringAssistanceType class. Method signatures and docstrings: - def get(self, id_person_requiring_assistance_type=None, is_active=None): Return all person requiring assistance type information :param ...
43bd57c466a5cd3b133ddc437cb4a6b9f007d267
<|skeleton|> class PersonRequiringAssistanceType: def get(self, id_person_requiring_assistance_type=None, is_active=None): """Return all person requiring assistance type information :param person_requiring_assistance_type: UUID :param is_active: BOOLEAN""" <|body_0|> def create(self, body): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PersonRequiringAssistanceType: def get(self, id_person_requiring_assistance_type=None, is_active=None): """Return all person requiring assistance type information :param person_requiring_assistance_type: UUID :param is_active: BOOLEAN""" with Database() as db: if id_person_requirin...
the_stack_v2_python_sparse
resturls/personrequiringassistancetype.py
CAUCA-9-1-1/survip-api
train
1
5f33be7e326deec971fdc6499371cb9a538f03fc
[ "from collections import deque\ndeque = deque([root])\nres = []\nwhile deque:\n node = deque.popleft()\n if node:\n res.append(node.val)\n deque.append(node.left)\n deque.append(node.right)\n else:\n res.append('#')\nreturn res", "listTreeNode = []\nfor nodeVal in data:\n i...
<|body_start_0|> from collections import deque deque = deque([root]) res = [] while deque: node = deque.popleft() if node: res.append(node.val) deque.append(node.left) deque.append(node.right) else: ...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_028024
1,488
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
f08628e3ce639d1e3f35a2bd3af14cc2b67d7249
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" from collections import deque deque = deque([root]) res = [] while deque: node = deque.popleft() if node: res.append(node....
the_stack_v2_python_sparse
297.Codec.py
Aissen-Li/LeetCode
train
0
3aeb7e5b375d6ff2f7678e46f1fb5d37b6a07724
[ "if has_body:\n body = response.json()\n body = body[self.resources_key]\n for data in body:\n value = self.existing(**data)\n yield value", "if not self.allow_create:\n raise exceptions.MethodNotSupported(self, 'create')\nif self.put_create:\n request = self._prepare_request(requires...
<|body_start_0|> if has_body: body = response.json() body = body[self.resources_key] for data in body: value = self.existing(**data) yield value <|end_body_0|> <|body_start_1|> if not self.allow_create: raise exceptions.Met...
RecordSet
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RecordSet: def _translate_recordsets(self, response, has_body=True): """In order to handle the response. Response example: {"recordsets": [ {"id":"fcb86eb9-8f8d-4cfd-8309-9052236d75df", "zone_id":"d4f0ea0e-edb6-4bbb-aefd-2944457be234", "records":["203.0.143.22"], "ttl":3600,"name":"ns3.b...
stack_v2_sparse_classes_36k_train_028025
7,046
permissive
[ { "docstring": "In order to handle the response. Response example: {\"recordsets\": [ {\"id\":\"fcb86eb9-8f8d-4cfd-8309-9052236d75df\", \"zone_id\":\"d4f0ea0e-edb6-4bbb-aefd-2944457be234\", \"records\":[\"203.0.143.22\"], \"ttl\":3600,\"name\":\"ns3.base.co.jp.\", \"description\":null,\"type\":\"A\",\"version\"...
4
null
Implement the Python class `RecordSet` described below. Class description: Implement the RecordSet class. Method signatures and docstrings: - def _translate_recordsets(self, response, has_body=True): In order to handle the response. Response example: {"recordsets": [ {"id":"fcb86eb9-8f8d-4cfd-8309-9052236d75df", "zon...
Implement the Python class `RecordSet` described below. Class description: Implement the RecordSet class. Method signatures and docstrings: - def _translate_recordsets(self, response, has_body=True): In order to handle the response. Response example: {"recordsets": [ {"id":"fcb86eb9-8f8d-4cfd-8309-9052236d75df", "zon...
c2dafba850c4e6fb55b5e10de79257bbc9a01af3
<|skeleton|> class RecordSet: def _translate_recordsets(self, response, has_body=True): """In order to handle the response. Response example: {"recordsets": [ {"id":"fcb86eb9-8f8d-4cfd-8309-9052236d75df", "zone_id":"d4f0ea0e-edb6-4bbb-aefd-2944457be234", "records":["203.0.143.22"], "ttl":3600,"name":"ns3.b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RecordSet: def _translate_recordsets(self, response, has_body=True): """In order to handle the response. Response example: {"recordsets": [ {"id":"fcb86eb9-8f8d-4cfd-8309-9052236d75df", "zone_id":"d4f0ea0e-edb6-4bbb-aefd-2944457be234", "records":["203.0.143.22"], "ttl":3600,"name":"ns3.base.co.jp.", "...
the_stack_v2_python_sparse
ecl/dns/v2/recordset.py
nttcom/eclsdk
train
5
00dfefaa2e5862a770a21fca1ff2cf2270656e93
[ "dummy: ListNode = ListNode(0)\nlength: int = 0\ndummy.next = head\nfirst: ListNode = head\nwhile first != None:\n length += 1\n first = first.next\nlength -= n\nfirst = dummy\nwhile length > 0:\n length -= 1\n first = first.next\nfirst.next = first.next.next\nreturn dummy.next", "dummy: ListNode = Li...
<|body_start_0|> dummy: ListNode = ListNode(0) length: int = 0 dummy.next = head first: ListNode = head while first != None: length += 1 first = first.next length -= n first = dummy while length > 0: length -= 1 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode: """2 pass solution :param head: :param n: :return:""" <|body_0|> def removeNthFromEndOnePass(self, head: ListNode, n: int) -> ListNode: """1 pass solution :param head: :param n: :return:""" ...
stack_v2_sparse_classes_36k_train_028026
1,462
no_license
[ { "docstring": "2 pass solution :param head: :param n: :return:", "name": "removeNthFromEnd", "signature": "def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode" }, { "docstring": "1 pass solution :param head: :param n: :return:", "name": "removeNthFromEndOnePass", "signature":...
2
stack_v2_sparse_classes_30k_test_000311
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode: 2 pass solution :param head: :param n: :return: - def removeNthFromEndOnePass(self, head: ListNode, n: int) -> Lis...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode: 2 pass solution :param head: :param n: :return: - def removeNthFromEndOnePass(self, head: ListNode, n: int) -> Lis...
7138db92a5fabf2347ff669a77268083dfced8da
<|skeleton|> class Solution: def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode: """2 pass solution :param head: :param n: :return:""" <|body_0|> def removeNthFromEndOnePass(self, head: ListNode, n: int) -> ListNode: """1 pass solution :param head: :param n: :return:""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode: """2 pass solution :param head: :param n: :return:""" dummy: ListNode = ListNode(0) length: int = 0 dummy.next = head first: ListNode = head while first != None: length += 1 ...
the_stack_v2_python_sparse
leetcode/19_remove_Nth_node_from_end_of_list.py
Merical/education_ai
train
0
8819d780952b43f52093c7d3799ff708a2b246b7
[ "if instance is None:\n return self\nreturn list(instance._udf_resources)", "if not all((isinstance(u, UDFResource) for u in value)):\n raise ValueError('udf items must be UDFResource')\ninstance._udf_resources = tuple(value)" ]
<|body_start_0|> if instance is None: return self return list(instance._udf_resources) <|end_body_0|> <|body_start_1|> if not all((isinstance(u, UDFResource) for u in value)): raise ValueError('udf items must be UDFResource') instance._udf_resources = tuple(value...
Custom property type, holding :class:`UDFResource` instances.
UDFResourcesProperty
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UDFResourcesProperty: """Custom property type, holding :class:`UDFResource` instances.""" def __get__(self, instance, owner): """Descriptor protocol: accessor""" <|body_0|> def __set__(self, instance, value): """Descriptor protocol: mutator""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_028027
7,448
no_license
[ { "docstring": "Descriptor protocol: accessor", "name": "__get__", "signature": "def __get__(self, instance, owner)" }, { "docstring": "Descriptor protocol: mutator", "name": "__set__", "signature": "def __set__(self, instance, value)" } ]
2
stack_v2_sparse_classes_30k_train_009572
Implement the Python class `UDFResourcesProperty` described below. Class description: Custom property type, holding :class:`UDFResource` instances. Method signatures and docstrings: - def __get__(self, instance, owner): Descriptor protocol: accessor - def __set__(self, instance, value): Descriptor protocol: mutator
Implement the Python class `UDFResourcesProperty` described below. Class description: Custom property type, holding :class:`UDFResource` instances. Method signatures and docstrings: - def __get__(self, instance, owner): Descriptor protocol: accessor - def __set__(self, instance, value): Descriptor protocol: mutator ...
c97dd7b906e5ef3ec157581fd0bcadd3e3fc220e
<|skeleton|> class UDFResourcesProperty: """Custom property type, holding :class:`UDFResource` instances.""" def __get__(self, instance, owner): """Descriptor protocol: accessor""" <|body_0|> def __set__(self, instance, value): """Descriptor protocol: mutator""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UDFResourcesProperty: """Custom property type, holding :class:`UDFResource` instances.""" def __get__(self, instance, owner): """Descriptor protocol: accessor""" if instance is None: return self return list(instance._udf_resources) def __set__(self, instance, valu...
the_stack_v2_python_sparse
files/usr/tmp/pip-build-nyxh8e0k/google-cloud-bigquery/google/cloud/bigquery/_helpers.py
vo0doO/com.termux
train
2
3aeb877815f49077258d06a08324ea1f55f1f285
[ "try:\n data = get_requested_data()\n digest = get_digest_result(data['ledger_name'])\n return digest\nexcept Exception as e:\n logger.exception('Unable to get a ledger digest!')\n return fail_response('Unable to delete the ledger. Please try again.', HTTPStatus.UNPROCESSABLE_ENTITY)", "try:\n d...
<|body_start_0|> try: data = get_requested_data() digest = get_digest_result(data['ledger_name']) return digest except Exception as e: logger.exception('Unable to get a ledger digest!') return fail_response('Unable to delete the ledger. Please ...
VerifiableServices
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VerifiableServices: def get_digest_result(self): """Retrieving the digest of a particular ledger.""" <|body_0|> def verify_block(self): """Get a journal block from a QLDB ledger. After getting the block, we get the digest of the ledger and validate the proof returned...
stack_v2_sparse_classes_36k_train_028028
2,049
permissive
[ { "docstring": "Retrieving the digest of a particular ledger.", "name": "get_digest_result", "signature": "def get_digest_result(self)" }, { "docstring": "Get a journal block from a QLDB ledger. After getting the block, we get the digest of the ledger and validate the proof returned in the getBl...
2
stack_v2_sparse_classes_30k_test_000972
Implement the Python class `VerifiableServices` described below. Class description: Implement the VerifiableServices class. Method signatures and docstrings: - def get_digest_result(self): Retrieving the digest of a particular ledger. - def verify_block(self): Get a journal block from a QLDB ledger. After getting the...
Implement the Python class `VerifiableServices` described below. Class description: Implement the VerifiableServices class. Method signatures and docstrings: - def get_digest_result(self): Retrieving the digest of a particular ledger. - def verify_block(self): Get a journal block from a QLDB ledger. After getting the...
dff793c6981ae5d300bfdf8b6531ca459b484a12
<|skeleton|> class VerifiableServices: def get_digest_result(self): """Retrieving the digest of a particular ledger.""" <|body_0|> def verify_block(self): """Get a journal block from a QLDB ledger. After getting the block, we get the digest of the ledger and validate the proof returned...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class VerifiableServices: def get_digest_result(self): """Retrieving the digest of a particular ledger.""" try: data = get_requested_data() digest = get_digest_result(data['ledger_name']) return digest except Exception as e: logger.exception('U...
the_stack_v2_python_sparse
hash_chain/app/modules/ledger/verifiable/services.py
ledgerfoundation/flask-qldb-boilerplate
train
0
b38ace5c0202c2ca25f9f9f7b5ad2949fe212712
[ "theta, phi = param_util.cart2polar(x, y)\nf_ = 1.0 / 2 * kappa_ext * theta ** 2\nreturn f_", "f_x = kappa_ext * x\nf_y = kappa_ext * y\nreturn (f_x, f_y)", "gamma1 = 0\ngamma2 = 0\nkappa = kappa_ext\nf_xx = kappa + gamma1\nf_yy = kappa - gamma1\nf_xy = gamma2\nreturn (f_xx, f_yy, f_xy)" ]
<|body_start_0|> theta, phi = param_util.cart2polar(x, y) f_ = 1.0 / 2 * kappa_ext * theta ** 2 return f_ <|end_body_0|> <|body_start_1|> f_x = kappa_ext * x f_y = kappa_ext * y return (f_x, f_y) <|end_body_1|> <|body_start_2|> gamma1 = 0 gamma2 = 0 ...
a single mass sheet (external convergence)
MassSheet
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MassSheet: """a single mass sheet (external convergence)""" def function(self, x, y, kappa_ext): """lensing potential :param x: x-coordinate :param y: y-coordinate :param kappa_ext: external convergence :return: lensing potential""" <|body_0|> def derivatives(self, x, y,...
stack_v2_sparse_classes_36k_train_028029
1,428
permissive
[ { "docstring": "lensing potential :param x: x-coordinate :param y: y-coordinate :param kappa_ext: external convergence :return: lensing potential", "name": "function", "signature": "def function(self, x, y, kappa_ext)" }, { "docstring": "deflection angle :param x: x-coordinate :param y: y-coordi...
3
stack_v2_sparse_classes_30k_train_005145
Implement the Python class `MassSheet` described below. Class description: a single mass sheet (external convergence) Method signatures and docstrings: - def function(self, x, y, kappa_ext): lensing potential :param x: x-coordinate :param y: y-coordinate :param kappa_ext: external convergence :return: lensing potenti...
Implement the Python class `MassSheet` described below. Class description: a single mass sheet (external convergence) Method signatures and docstrings: - def function(self, x, y, kappa_ext): lensing potential :param x: x-coordinate :param y: y-coordinate :param kappa_ext: external convergence :return: lensing potenti...
dcdfc61ce5351ac94565228c822f1c94392c1ad6
<|skeleton|> class MassSheet: """a single mass sheet (external convergence)""" def function(self, x, y, kappa_ext): """lensing potential :param x: x-coordinate :param y: y-coordinate :param kappa_ext: external convergence :return: lensing potential""" <|body_0|> def derivatives(self, x, y,...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MassSheet: """a single mass sheet (external convergence)""" def function(self, x, y, kappa_ext): """lensing potential :param x: x-coordinate :param y: y-coordinate :param kappa_ext: external convergence :return: lensing potential""" theta, phi = param_util.cart2polar(x, y) f_ = 1....
the_stack_v2_python_sparse
lenstronomy/LensModel/Profiles/mass_sheet.py
guoxiaowhu/lenstronomy
train
1
274249474a90cf743e2ab9414cac17c62aa4f169
[ "assert dataset, 'Groundtruth should not be empty.'\nassert isinstance(dataset, dict), 'annotation file format {} not supported'.format(type(dataset))\nself.anns, self.cats, self.imgs = (dict(), dict(), dict())\nself.dataset = copy.deepcopy(dataset)\nself.createIndex()", "res = MaskCOCO()\nres.dataset['images'] =...
<|body_start_0|> assert dataset, 'Groundtruth should not be empty.' assert isinstance(dataset, dict), 'annotation file format {} not supported'.format(type(dataset)) self.anns, self.cats, self.imgs = (dict(), dict(), dict()) self.dataset = copy.deepcopy(dataset) self.createIndex(...
COCO object for mask evaluation.
MaskCOCO
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MaskCOCO: """COCO object for mask evaluation.""" def reset(self, dataset): """Reset the dataset and groundtruth data index in this object. Args: dataset: dict of groundtruth data. It should has similar structure as the COCO groundtruth JSON file. Must contains three keys: {'images', ...
stack_v2_sparse_classes_36k_train_028030
14,113
permissive
[ { "docstring": "Reset the dataset and groundtruth data index in this object. Args: dataset: dict of groundtruth data. It should has similar structure as the COCO groundtruth JSON file. Must contains three keys: {'images', 'annotations', 'categories'}. 'images': list of image information dictionary. Required key...
3
stack_v2_sparse_classes_30k_train_011850
Implement the Python class `MaskCOCO` described below. Class description: COCO object for mask evaluation. Method signatures and docstrings: - def reset(self, dataset): Reset the dataset and groundtruth data index in this object. Args: dataset: dict of groundtruth data. It should has similar structure as the COCO gro...
Implement the Python class `MaskCOCO` described below. Class description: COCO object for mask evaluation. Method signatures and docstrings: - def reset(self, dataset): Reset the dataset and groundtruth data index in this object. Args: dataset: dict of groundtruth data. It should has similar structure as the COCO gro...
a5388a45f71a949639b35cc5b990bd130d2d8164
<|skeleton|> class MaskCOCO: """COCO object for mask evaluation.""" def reset(self, dataset): """Reset the dataset and groundtruth data index in this object. Args: dataset: dict of groundtruth data. It should has similar structure as the COCO groundtruth JSON file. Must contains three keys: {'images', ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MaskCOCO: """COCO object for mask evaluation.""" def reset(self, dataset): """Reset the dataset and groundtruth data index in this object. Args: dataset: dict of groundtruth data. It should has similar structure as the COCO groundtruth JSON file. Must contains three keys: {'images', 'annotations'...
the_stack_v2_python_sparse
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/utils/coco_metric.py
NVIDIA/DeepLearningExamples
train
11,838
25e6bca6d987e023b87c232451ec8798cb7468fb
[ "self.description = description\nself.destination_guid = destination_guid\nself.display_name = display_name\nself.distinguished_name = distinguished_name\nself.error_message = error_message\nself.object_class = object_class\nself.search_result_flags = search_result_flags\nself.source_guid = source_guid", "if dict...
<|body_start_0|> self.description = description self.destination_guid = destination_guid self.display_name = display_name self.distinguished_name = distinguished_name self.error_message = error_message self.object_class = object_class self.search_result_flags = se...
Implementation of the 'ADObject' model. Represents the details about an AD object. Attributes: description (string): Specifies the 'description' of an AD object. destination_guid (string): Specifies the guid of object in the Production AD which is equivalent to the object in the Snapshot AD. display_name (string): Spec...
ADObject
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ADObject: """Implementation of the 'ADObject' model. Represents the details about an AD object. Attributes: description (string): Specifies the 'description' of an AD object. destination_guid (string): Specifies the guid of object in the Production AD which is equivalent to the object in the Snap...
stack_v2_sparse_classes_36k_train_028031
4,321
permissive
[ { "docstring": "Constructor for the ADObject class", "name": "__init__", "signature": "def __init__(self, description=None, destination_guid=None, display_name=None, distinguished_name=None, error_message=None, object_class=None, search_result_flags=None, source_guid=None)" }, { "docstring": "Cr...
2
null
Implement the Python class `ADObject` described below. Class description: Implementation of the 'ADObject' model. Represents the details about an AD object. Attributes: description (string): Specifies the 'description' of an AD object. destination_guid (string): Specifies the guid of object in the Production AD which ...
Implement the Python class `ADObject` described below. Class description: Implementation of the 'ADObject' model. Represents the details about an AD object. Attributes: description (string): Specifies the 'description' of an AD object. destination_guid (string): Specifies the guid of object in the Production AD which ...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class ADObject: """Implementation of the 'ADObject' model. Represents the details about an AD object. Attributes: description (string): Specifies the 'description' of an AD object. destination_guid (string): Specifies the guid of object in the Production AD which is equivalent to the object in the Snap...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ADObject: """Implementation of the 'ADObject' model. Represents the details about an AD object. Attributes: description (string): Specifies the 'description' of an AD object. destination_guid (string): Specifies the guid of object in the Production AD which is equivalent to the object in the Snapshot AD. disp...
the_stack_v2_python_sparse
cohesity_management_sdk/models/ad_object.py
cohesity/management-sdk-python
train
24
0c3c1d313039885d916b11af7b2de1063b38f102
[ "if not root:\n return ''\nres = []\nqueue = [root]\nwhile queue:\n size = len(queue)\n for _ in range(size):\n node = queue.pop(0)\n res.append(str(node.val) if node else str(node))\n if node is None:\n continue\n queue.append(node.left)\n queue.append(node.ri...
<|body_start_0|> if not root: return '' res = [] queue = [root] while queue: size = len(queue) for _ in range(size): node = queue.pop(0) res.append(str(node.val) if node else str(node)) if node is None: ...
广度优先收缩BFS实现
Codec2
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec2: """广度优先收缩BFS实现""" def serialize(root): """序列化 :param root: (TreeNode) :return: (str)""" <|body_0|> def deserialize(data): """反序列化 :param data: (str) :return: (TreeNode)""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not root: ...
stack_v2_sparse_classes_36k_train_028032
5,822
no_license
[ { "docstring": "序列化 :param root: (TreeNode) :return: (str)", "name": "serialize", "signature": "def serialize(root)" }, { "docstring": "反序列化 :param data: (str) :return: (TreeNode)", "name": "deserialize", "signature": "def deserialize(data)" } ]
2
stack_v2_sparse_classes_30k_train_003868
Implement the Python class `Codec2` described below. Class description: 广度优先收缩BFS实现 Method signatures and docstrings: - def serialize(root): 序列化 :param root: (TreeNode) :return: (str) - def deserialize(data): 反序列化 :param data: (str) :return: (TreeNode)
Implement the Python class `Codec2` described below. Class description: 广度优先收缩BFS实现 Method signatures and docstrings: - def serialize(root): 序列化 :param root: (TreeNode) :return: (str) - def deserialize(data): 反序列化 :param data: (str) :return: (TreeNode) <|skeleton|> class Codec2: """广度优先收缩BFS实现""" def serial...
497c9717d783bb9f2d2675a3b254ec406582d849
<|skeleton|> class Codec2: """广度优先收缩BFS实现""" def serialize(root): """序列化 :param root: (TreeNode) :return: (str)""" <|body_0|> def deserialize(data): """反序列化 :param data: (str) :return: (TreeNode)""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec2: """广度优先收缩BFS实现""" def serialize(root): """序列化 :param root: (TreeNode) :return: (str)""" if not root: return '' res = [] queue = [root] while queue: size = len(queue) for _ in range(size): node = queue.pop(...
the_stack_v2_python_sparse
297.二叉树的序列化与反序列化/Codec.py
boyshen/leetcode_Algorithm_problem
train
0
15a006c12b580155cded0191999f722a6bd2191d
[ "na = len(zs)\nself.na = na\nself.zs = zs\nself.coords = coords\nself.cell = np.array(cell)\nself.coords_f = np.linalg.solve(self.cell.T, coords.T).T\nls = np.linalg.norm(cell, axis=0)\nself.ls = ls\nself.a = ls[0]\nself.b = ls[1]\nself.c = ls[2]\nself.ias = np.arange(na)\nself.rcut = rcut", "i, j, k = idx\nif i ...
<|body_start_0|> na = len(zs) self.na = na self.zs = zs self.coords = coords self.cell = np.array(cell) self.coords_f = np.linalg.solve(self.cell.T, coords.T).T ls = np.linalg.norm(cell, axis=0) self.ls = ls self.a = ls[0] self.b = ls[1] ...
MolPBC
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MolPBC: def __init__(self, zs, coords, cell, rcut=9.0): """a mol obj with pbc""" <|body_0|> def get_ext_cell(self, idx): """get a new extended cell with index `idx""" <|body_1|> def get_nmax(self, ia, axis, sign): """Get maximal num of cells to b...
stack_v2_sparse_classes_36k_train_028033
4,133
permissive
[ { "docstring": "a mol obj with pbc", "name": "__init__", "signature": "def __init__(self, zs, coords, cell, rcut=9.0)" }, { "docstring": "get a new extended cell with index `idx", "name": "get_ext_cell", "signature": "def get_ext_cell(self, idx)" }, { "docstring": "Get maximal nu...
4
stack_v2_sparse_classes_30k_train_020641
Implement the Python class `MolPBC` described below. Class description: Implement the MolPBC class. Method signatures and docstrings: - def __init__(self, zs, coords, cell, rcut=9.0): a mol obj with pbc - def get_ext_cell(self, idx): get a new extended cell with index `idx - def get_nmax(self, ia, axis, sign): Get ma...
Implement the Python class `MolPBC` described below. Class description: Implement the MolPBC class. Method signatures and docstrings: - def __init__(self, zs, coords, cell, rcut=9.0): a mol obj with pbc - def get_ext_cell(self, idx): get a new extended cell with index `idx - def get_nmax(self, ia, axis, sign): Get ma...
b8632885c52f307fedc62a81ef4c9b88cc51edfa
<|skeleton|> class MolPBC: def __init__(self, zs, coords, cell, rcut=9.0): """a mol obj with pbc""" <|body_0|> def get_ext_cell(self, idx): """get a new extended cell with index `idx""" <|body_1|> def get_nmax(self, ia, axis, sign): """Get maximal num of cells to b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MolPBC: def __init__(self, zs, coords, cell, rcut=9.0): """a mol obj with pbc""" na = len(zs) self.na = na self.zs = zs self.coords = coords self.cell = np.array(cell) self.coords_f = np.linalg.solve(self.cell.T, coords.T).T ls = np.linalg.norm(c...
the_stack_v2_python_sparse
coreml/cml/molext.py
binghuang2018/aqml
train
31
dac80dbed2c2661c42470f54a1080f20ac234a3a
[ "self.post_reqparser = reqparse.RequestParser()\nself.post_reqparser.add_argument('email', required=True, help='email field is required', location=['form', 'json'], store_missing=False)\nself.post_reqparser.add_argument('fullname', required=False, location=['form', 'json'], store_missing=False)\nself.post_reqparser...
<|body_start_0|> self.post_reqparser = reqparse.RequestParser() self.post_reqparser.add_argument('email', required=True, help='email field is required', location=['form', 'json'], store_missing=False) self.post_reqparser.add_argument('fullname', required=False, location=['form', 'json'], store_m...
EditUser
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EditUser: def __init__(self) -> None: """Initialises the edit user end point""" <|body_0|> def post(self) -> (str, int): """POST request that allows user to change their credentials in the Users table. A valid access JWT is required where the admin claim has to be Tr...
stack_v2_sparse_classes_36k_train_028034
3,274
permissive
[ { "docstring": "Initialises the edit user end point", "name": "__init__", "signature": "def __init__(self) -> None" }, { "docstring": "POST request that allows user to change their credentials in the Users table. A valid access JWT is required where the admin claim has to be True Parameters can ...
2
stack_v2_sparse_classes_30k_train_005473
Implement the Python class `EditUser` described below. Class description: Implement the EditUser class. Method signatures and docstrings: - def __init__(self) -> None: Initialises the edit user end point - def post(self) -> (str, int): POST request that allows user to change their credentials in the Users table. A va...
Implement the Python class `EditUser` described below. Class description: Implement the EditUser class. Method signatures and docstrings: - def __init__(self) -> None: Initialises the edit user end point - def post(self) -> (str, int): POST request that allows user to change their credentials in the Users table. A va...
5d123691d1f25d0b85e20e4e8293266bf23c9f8a
<|skeleton|> class EditUser: def __init__(self) -> None: """Initialises the edit user end point""" <|body_0|> def post(self) -> (str, int): """POST request that allows user to change their credentials in the Users table. A valid access JWT is required where the admin claim has to be Tr...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EditUser: def __init__(self) -> None: """Initialises the edit user end point""" self.post_reqparser = reqparse.RequestParser() self.post_reqparser.add_argument('email', required=True, help='email field is required', location=['form', 'json'], store_missing=False) self.post_reqp...
the_stack_v2_python_sparse
Analytics/resources/admin/edit_user.py
thanosbnt/SharingCitiesDashboard
train
0
21eb7295a2f7bd804c180a5a3c7ac25c3c75b09b
[ "if activation == 'logistic':\n self.activation = logistic\n self.activation_deriv = logistic_deriv\nelse:\n self.activation = tanh\n self.activation_deriv = tanh_deriv\nself.weights = list()\nfor i in range(1, len(layers) - 1):\n self.weights.append((2 * np.random.random((layers[i - 1] + 1, layers[i...
<|body_start_0|> if activation == 'logistic': self.activation = logistic self.activation_deriv = logistic_deriv else: self.activation = tanh self.activation_deriv = tanh_deriv self.weights = list() for i in range(1, len(layers) - 1): ...
定义一个神经网路类
NeuralNetwork
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NeuralNetwork: """定义一个神经网路类""" def __init__(self, layers, activation='tanh'): """初始化""" <|body_0|> def fit(self, X, y, learning_rate=0.2, epochs=10000): """训练更新权重""" <|body_1|> def predict(self, x): """预测""" <|body_2|> <|end_skeleton...
stack_v2_sparse_classes_36k_train_028035
2,884
no_license
[ { "docstring": "初始化", "name": "__init__", "signature": "def __init__(self, layers, activation='tanh')" }, { "docstring": "训练更新权重", "name": "fit", "signature": "def fit(self, X, y, learning_rate=0.2, epochs=10000)" }, { "docstring": "预测", "name": "predict", "signature": "d...
3
stack_v2_sparse_classes_30k_train_003454
Implement the Python class `NeuralNetwork` described below. Class description: 定义一个神经网路类 Method signatures and docstrings: - def __init__(self, layers, activation='tanh'): 初始化 - def fit(self, X, y, learning_rate=0.2, epochs=10000): 训练更新权重 - def predict(self, x): 预测
Implement the Python class `NeuralNetwork` described below. Class description: 定义一个神经网路类 Method signatures and docstrings: - def __init__(self, layers, activation='tanh'): 初始化 - def fit(self, X, y, learning_rate=0.2, epochs=10000): 训练更新权重 - def predict(self, x): 预测 <|skeleton|> class NeuralNetwork: """定义一个神经网路类"...
7e42ae34ce704958a2a5a47bdd0312371cc3cb5e
<|skeleton|> class NeuralNetwork: """定义一个神经网路类""" def __init__(self, layers, activation='tanh'): """初始化""" <|body_0|> def fit(self, X, y, learning_rate=0.2, epochs=10000): """训练更新权重""" <|body_1|> def predict(self, x): """预测""" <|body_2|> <|end_skeleton...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NeuralNetwork: """定义一个神经网路类""" def __init__(self, layers, activation='tanh'): """初始化""" if activation == 'logistic': self.activation = logistic self.activation_deriv = logistic_deriv else: self.activation = tanh self.activation_deriv...
the_stack_v2_python_sparse
NN/NeuralNetwork.py
jameszlj/Deep_Learning
train
1
5cb6a38077d96992c9d3954dfdcced388d019f47
[ "params = self.get_set_params(locals())\nresponse = await self.api.request('status.get', params)\nmodel = status.GetResponse\nreturn model(**response).response", "params = self.get_set_params(locals())\nresponse = await self.api.request('status.set', params)\nmodel = base.OkResponse\nreturn model(**response).resp...
<|body_start_0|> params = self.get_set_params(locals()) response = await self.api.request('status.get', params) model = status.GetResponse return model(**response).response <|end_body_0|> <|body_start_1|> params = self.get_set_params(locals()) response = await self.api.r...
StatusCategory
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StatusCategory: async def get(self, user_id: Optional[int]=None, group_id: Optional[int]=None, **kwargs) -> status.GetResponseModel: """Returns data required to show the status of a user or community. :param user_id: User ID or community ID. Use a negative value to designate a community ...
stack_v2_sparse_classes_36k_train_028036
1,141
permissive
[ { "docstring": "Returns data required to show the status of a user or community. :param user_id: User ID or community ID. Use a negative value to designate a community ID. :param group_id:", "name": "get", "signature": "async def get(self, user_id: Optional[int]=None, group_id: Optional[int]=None, **kwa...
2
null
Implement the Python class `StatusCategory` described below. Class description: Implement the StatusCategory class. Method signatures and docstrings: - async def get(self, user_id: Optional[int]=None, group_id: Optional[int]=None, **kwargs) -> status.GetResponseModel: Returns data required to show the status of a use...
Implement the Python class `StatusCategory` described below. Class description: Implement the StatusCategory class. Method signatures and docstrings: - async def get(self, user_id: Optional[int]=None, group_id: Optional[int]=None, **kwargs) -> status.GetResponseModel: Returns data required to show the status of a use...
dfcedd4023aa170dd7f802ac662f0e2ed9033904
<|skeleton|> class StatusCategory: async def get(self, user_id: Optional[int]=None, group_id: Optional[int]=None, **kwargs) -> status.GetResponseModel: """Returns data required to show the status of a user or community. :param user_id: User ID or community ID. Use a negative value to designate a community ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StatusCategory: async def get(self, user_id: Optional[int]=None, group_id: Optional[int]=None, **kwargs) -> status.GetResponseModel: """Returns data required to show the status of a user or community. :param user_id: User ID or community ID. Use a negative value to designate a community ID. :param gro...
the_stack_v2_python_sparse
codegen/results/methods/status.py
ScriptHound/vkbottle-types
train
0
2e648863358d28b6e51b02c889f552470b3591d0
[ "assert bins_dict.keys() == spacing_dict.keys()\nself.bins = bins_dict\nself.spacing = spacing_dict\nself.bins1 = {}\nself.bins2 = {}\nself.binsc = {}\nself.nbins = {}\nfor key in self.bins.keys():\n self._add_bin_edges(key)\n self.nbins[key] = len(self.bins1[key])\nds = xr.Dataset(coords=self.binsc)\nfor sbi...
<|body_start_0|> assert bins_dict.keys() == spacing_dict.keys() self.bins = bins_dict self.spacing = spacing_dict self.bins1 = {} self.bins2 = {} self.binsc = {} self.nbins = {} for key in self.bins.keys(): self._add_bin_edges(key) ...
Grid This object creates grids used to compute occurrence and completeness
Grid
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Grid: """Grid This object creates grids used to compute occurrence and completeness""" def __init__(self, bins_dict, spacing_dict): """Lay down grid for computing occurrence Args: bins_dict (dict): Dictionary of lists defining bins. e.g.: {'per': [5,10,20], 'prad': [1,2,4], 'smet': [...
stack_v2_sparse_classes_36k_train_028037
2,239
permissive
[ { "docstring": "Lay down grid for computing occurrence Args: bins_dict (dict): Dictionary of lists defining bins. e.g.: {'per': [5,10,20], 'prad': [1,2,4], 'smet': [-0.4,0.0,0.4]} spacing_dict (dict): Specify linear or log spacing e.g.: {'per': 'log', 'prad': 'log', 'smet': 'linear'}", "name": "__init__", ...
2
stack_v2_sparse_classes_30k_train_001375
Implement the Python class `Grid` described below. Class description: Grid This object creates grids used to compute occurrence and completeness Method signatures and docstrings: - def __init__(self, bins_dict, spacing_dict): Lay down grid for computing occurrence Args: bins_dict (dict): Dictionary of lists defining ...
Implement the Python class `Grid` described below. Class description: Grid This object creates grids used to compute occurrence and completeness Method signatures and docstrings: - def __init__(self, bins_dict, spacing_dict): Lay down grid for computing occurrence Args: bins_dict (dict): Dictionary of lists defining ...
744ec6c6f332a47467b853de4b526fdd6a00727a
<|skeleton|> class Grid: """Grid This object creates grids used to compute occurrence and completeness""" def __init__(self, bins_dict, spacing_dict): """Lay down grid for computing occurrence Args: bins_dict (dict): Dictionary of lists defining bins. e.g.: {'per': [5,10,20], 'prad': [1,2,4], 'smet': [...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Grid: """Grid This object creates grids used to compute occurrence and completeness""" def __init__(self, bins_dict, spacing_dict): """Lay down grid for computing occurrence Args: bins_dict (dict): Dictionary of lists defining bins. e.g.: {'per': [5,10,20], 'prad': [1,2,4], 'smet': [-0.4,0.0,0.4]...
the_stack_v2_python_sparse
ckscool/grid.py
petigura/CKS-Cool
train
1
1b3c49cc7d392ec6c2a1d37c07be2f44a9ec2fcc
[ "self.integration_cls = integration_cls\nmanager = self.get_integration_manager()\ntry:\n manager.register_integration_class(self.integration_cls)\nexcept IntegrationError as e:\n logging.exception('%s could not register integration class %s with %s: %s', self.extension.__class__.__name__, self.__class__.__na...
<|body_start_0|> self.integration_cls = integration_cls manager = self.get_integration_manager() try: manager.register_integration_class(self.integration_cls) except IntegrationError as e: logging.exception('%s could not register integration class %s with %s: %s',...
Base class for an extension hook for integration management. Integrations enable any supporting application to connect with third-party services in specialized ways. This class makes it easy to register new integrations on an extension, binding their lifecycles to that of the extension. This is not intended to be used ...
BaseIntegrationHook
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseIntegrationHook: """Base class for an extension hook for integration management. Integrations enable any supporting application to connect with third-party services in specialized ways. This class makes it easy to register new integrations on an extension, binding their lifecycles to that of ...
stack_v2_sparse_classes_36k_train_028038
2,775
no_license
[ { "docstring": "Initialize the hook. The provided integration will be registered with the integration manager. Args: integration_cls (type): The integration class to register.", "name": "initialize", "signature": "def initialize(self, integration_cls: Type[Integration]) -> None" }, { "docstring"...
2
null
Implement the Python class `BaseIntegrationHook` described below. Class description: Base class for an extension hook for integration management. Integrations enable any supporting application to connect with third-party services in specialized ways. This class makes it easy to register new integrations on an extensio...
Implement the Python class `BaseIntegrationHook` described below. Class description: Base class for an extension hook for integration management. Integrations enable any supporting application to connect with third-party services in specialized ways. This class makes it easy to register new integrations on an extensio...
99ea69d80a3a393b0da4da3152ef26e808dd8487
<|skeleton|> class BaseIntegrationHook: """Base class for an extension hook for integration management. Integrations enable any supporting application to connect with third-party services in specialized ways. This class makes it easy to register new integrations on an extension, binding their lifecycles to that of ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseIntegrationHook: """Base class for an extension hook for integration management. Integrations enable any supporting application to connect with third-party services in specialized ways. This class makes it easy to register new integrations on an extension, binding their lifecycles to that of the extension...
the_stack_v2_python_sparse
djblets/integrations/hooks.py
chipx86/djblets
train
2
e09e2e34347d63da2de0e4dd69f6d337ab35bd83
[ "self._extra_text = extra_text\nshell.ShellCommand.__init__(self, **kw)\nself.addFactoryArguments(extra_text=extra_text)", "if cmd.rc == 0 and self._extra_text:\n name, url = self._extra_text\n self.addURL(self.build.render(name), self.build.render(url))" ]
<|body_start_0|> self._extra_text = extra_text shell.ShellCommand.__init__(self, **kw) self.addFactoryArguments(extra_text=extra_text) <|end_body_0|> <|body_start_1|> if cmd.rc == 0 and self._extra_text: name, url = self._extra_text self.addURL(self.build.render(...
A ShellCommand subclass that adorns its build status with a URL on success.
_UrlStatusCommand
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _UrlStatusCommand: """A ShellCommand subclass that adorns its build status with a URL on success.""" def __init__(self, extra_text=None, **kw): """Initialize the buildstep. Args: extra_text: a tuple of (name, url) to pass to addUrl on successful completion.""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_028039
7,138
no_license
[ { "docstring": "Initialize the buildstep. Args: extra_text: a tuple of (name, url) to pass to addUrl on successful completion.", "name": "__init__", "signature": "def __init__(self, extra_text=None, **kw)" }, { "docstring": "On success, add the URL provided to our status.", "name": "commandC...
2
null
Implement the Python class `_UrlStatusCommand` described below. Class description: A ShellCommand subclass that adorns its build status with a URL on success. Method signatures and docstrings: - def __init__(self, extra_text=None, **kw): Initialize the buildstep. Args: extra_text: a tuple of (name, url) to pass to ad...
Implement the Python class `_UrlStatusCommand` described below. Class description: A ShellCommand subclass that adorns its build status with a URL on success. Method signatures and docstrings: - def __init__(self, extra_text=None, **kw): Initialize the buildstep. Args: extra_text: a tuple of (name, url) to pass to ad...
516718f9b7b95c4280257b2d319638d4728a90e1
<|skeleton|> class _UrlStatusCommand: """A ShellCommand subclass that adorns its build status with a URL on success.""" def __init__(self, extra_text=None, **kw): """Initialize the buildstep. Args: extra_text: a tuple of (name, url) to pass to addUrl on successful completion.""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _UrlStatusCommand: """A ShellCommand subclass that adorns its build status with a URL on success.""" def __init__(self, extra_text=None, **kw): """Initialize the buildstep. Args: extra_text: a tuple of (name, url) to pass to addUrl on successful completion.""" self._extra_text = extra_tex...
the_stack_v2_python_sparse
build/scripts/master/factory/syzygy_commands.py
mhcchang/chromium30
train
0
ad5481e9b26a8ea9f9d56a19ed369ce6fad3ce59
[ "user = request.user\ncheck_user_status(user)\nuser_id = user.id\nvalidate(instance=request.data, schema=schemas.food_insert_edit_schema)\nbody = request.data\nPendingFood.field_validate(body)\nrestaurant = PendingRestaurant.get_by_owner(user_id)\ndish = PendingFood.edit_dish(dish_id, body, restaurant._id)\nreturn ...
<|body_start_0|> user = request.user check_user_status(user) user_id = user.id validate(instance=request.data, schema=schemas.food_insert_edit_schema) body = request.data PendingFood.field_validate(body) restaurant = PendingRestaurant.get_by_owner(user_id) ...
PendingDish view for updating or deleting
PendingDishModifyDeleteView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PendingDishModifyDeleteView: """PendingDish view for updating or deleting""" def put(self, request, dish_id): """Updates dish data""" <|body_0|> def delete(self, request, dish_id): """Deletes dish from database""" <|body_1|> <|end_skeleton|> <|body_star...
stack_v2_sparse_classes_36k_train_028040
19,356
no_license
[ { "docstring": "Updates dish data", "name": "put", "signature": "def put(self, request, dish_id)" }, { "docstring": "Deletes dish from database", "name": "delete", "signature": "def delete(self, request, dish_id)" } ]
2
stack_v2_sparse_classes_30k_train_003338
Implement the Python class `PendingDishModifyDeleteView` described below. Class description: PendingDish view for updating or deleting Method signatures and docstrings: - def put(self, request, dish_id): Updates dish data - def delete(self, request, dish_id): Deletes dish from database
Implement the Python class `PendingDishModifyDeleteView` described below. Class description: PendingDish view for updating or deleting Method signatures and docstrings: - def put(self, request, dish_id): Updates dish data - def delete(self, request, dish_id): Deletes dish from database <|skeleton|> class PendingDish...
2707062c9a9a8bb4baca955e8a60ba08cc9f8953
<|skeleton|> class PendingDishModifyDeleteView: """PendingDish view for updating or deleting""" def put(self, request, dish_id): """Updates dish data""" <|body_0|> def delete(self, request, dish_id): """Deletes dish from database""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PendingDishModifyDeleteView: """PendingDish view for updating or deleting""" def put(self, request, dish_id): """Updates dish data""" user = request.user check_user_status(user) user_id = user.id validate(instance=request.data, schema=schemas.food_insert_edit_schem...
the_stack_v2_python_sparse
backend/restaurant/views.py
MochiTarts/Find-Dining-The-Bridge
train
1
574a8c24c6bb07ec132dbe769645484988ee4f9a
[ "if num == 0:\n return 0\nreturn num % 9 if num % 9 != 0 else 9", "sum, temp = (0, num)\nwhile True:\n while True:\n sum += temp % 10\n temp //= 10\n if temp == 0:\n break\n if sum < 10:\n break\n temp, sum = (sum, 0)\nreturn sum" ]
<|body_start_0|> if num == 0: return 0 return num % 9 if num % 9 != 0 else 9 <|end_body_0|> <|body_start_1|> sum, temp = (0, num) while True: while True: sum += temp % 10 temp //= 10 if temp == 0: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def addDigits(self, num): """:type num: int :rtype: int""" <|body_0|> def addDigits_work(self, num): """:type num: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if num == 0: return 0 return num % 9 if ...
stack_v2_sparse_classes_36k_train_028041
1,486
no_license
[ { "docstring": ":type num: int :rtype: int", "name": "addDigits", "signature": "def addDigits(self, num)" }, { "docstring": ":type num: int :rtype: int", "name": "addDigits_work", "signature": "def addDigits_work(self, num)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def addDigits(self, num): :type num: int :rtype: int - def addDigits_work(self, num): :type num: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def addDigits(self, num): :type num: int :rtype: int - def addDigits_work(self, num): :type num: int :rtype: int <|skeleton|> class Solution: def addDigits(self, num): ...
3f0ffd519404165fd1a735441b212c801fd1ad1e
<|skeleton|> class Solution: def addDigits(self, num): """:type num: int :rtype: int""" <|body_0|> def addDigits_work(self, num): """:type num: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def addDigits(self, num): """:type num: int :rtype: int""" if num == 0: return 0 return num % 9 if num % 9 != 0 else 9 def addDigits_work(self, num): """:type num: int :rtype: int""" sum, temp = (0, num) while True: while T...
the_stack_v2_python_sparse
Problems/0200_0299/0258_Add_Digits/Project_Python3/Add_Digits.py
NobuyukiInoue/LeetCode
train
0
c2e8fd24cab06b5e51fa1c979bcd40a34d721e21
[ "for i, target in enumerate(targets):\n for key in ('Index', 'Min Value', 'Max Value'):\n assert key in target, f'Target {i} is missing key \"{key}\".'\nself._targets = targets", "replaced_parameters = parameters.clone().detach()\nfor i, target in enumerate(self._targets):\n index = target['Index']\n...
<|body_start_0|> for i, target in enumerate(targets): for key in ('Index', 'Min Value', 'Max Value'): assert key in target, f'Target {i} is missing key "{key}".' self._targets = targets <|end_body_0|> <|body_start_1|> replaced_parameters = parameters.clone().detach()...
The SubstitutionTransform class replaces a set of SVBRDF parameter maps with random fields.
SubstitutionTransform
[ "MIT", "CC-BY-4.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SubstitutionTransform: """The SubstitutionTransform class replaces a set of SVBRDF parameter maps with random fields.""" def __init__(self, targets: List[Dict]) -> None: """Constructs a new SubstitutionTransform with the given list of SVBRDF parameter map targets. Args: targets: SVBR...
stack_v2_sparse_classes_36k_train_028042
5,164
permissive
[ { "docstring": "Constructs a new SubstitutionTransform with the given list of SVBRDF parameter map targets. Args: targets: SVBRDF parameter map targets.", "name": "__init__", "signature": "def __init__(self, targets: List[Dict]) -> None" }, { "docstring": "See Transform.apply().", "name": "a...
2
stack_v2_sparse_classes_30k_train_019977
Implement the Python class `SubstitutionTransform` described below. Class description: The SubstitutionTransform class replaces a set of SVBRDF parameter maps with random fields. Method signatures and docstrings: - def __init__(self, targets: List[Dict]) -> None: Constructs a new SubstitutionTransform with the given ...
Implement the Python class `SubstitutionTransform` described below. Class description: The SubstitutionTransform class replaces a set of SVBRDF parameter maps with random fields. Method signatures and docstrings: - def __init__(self, targets: List[Dict]) -> None: Constructs a new SubstitutionTransform with the given ...
7e7282698befd53383cbd6566039340babb0a289
<|skeleton|> class SubstitutionTransform: """The SubstitutionTransform class replaces a set of SVBRDF parameter maps with random fields.""" def __init__(self, targets: List[Dict]) -> None: """Constructs a new SubstitutionTransform with the given list of SVBRDF parameter map targets. Args: targets: SVBR...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SubstitutionTransform: """The SubstitutionTransform class replaces a set of SVBRDF parameter maps with random fields.""" def __init__(self, targets: List[Dict]) -> None: """Constructs a new SubstitutionTransform with the given list of SVBRDF parameter map targets. Args: targets: SVBRDF parameter ...
the_stack_v2_python_sparse
project/transform.py
Mandrenkov/SVBRDF-Texture-Synthesis
train
3
39b2110306ffbf176b3fc00fee4e37696b58f44c
[ "heads, tails = data\ntest_stat = abs(heads - tails)\nreturn test_stat", "heads, tails = self.data\nn = heads + tails\nsample = [random.choice('HT') for _ in range(n)]\nhist = thinkstats2.Hist(sample)\ndata = (hist['H'], hist['T'])\nreturn data" ]
<|body_start_0|> heads, tails = data test_stat = abs(heads - tails) return test_stat <|end_body_0|> <|body_start_1|> heads, tails = self.data n = heads + tails sample = [random.choice('HT') for _ in range(n)] hist = thinkstats2.Hist(sample) data = (hist['...
Tests the hypothesis that a coin is fair.
CoinTest
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CoinTest: """Tests the hypothesis that a coin is fair.""" def TestStatistic(self, data): """Computes the test statistic. data: data in whatever form is relevant""" <|body_0|> def RunModel(self): """Run the model of the null hypothesis. returns: simulated data""" ...
stack_v2_sparse_classes_36k_train_028043
10,162
permissive
[ { "docstring": "Computes the test statistic. data: data in whatever form is relevant", "name": "TestStatistic", "signature": "def TestStatistic(self, data)" }, { "docstring": "Run the model of the null hypothesis. returns: simulated data", "name": "RunModel", "signature": "def RunModel(s...
2
stack_v2_sparse_classes_30k_train_020007
Implement the Python class `CoinTest` described below. Class description: Tests the hypothesis that a coin is fair. Method signatures and docstrings: - def TestStatistic(self, data): Computes the test statistic. data: data in whatever form is relevant - def RunModel(self): Run the model of the null hypothesis. return...
Implement the Python class `CoinTest` described below. Class description: Tests the hypothesis that a coin is fair. Method signatures and docstrings: - def TestStatistic(self, data): Computes the test statistic. data: data in whatever form is relevant - def RunModel(self): Run the model of the null hypothesis. return...
30a85d5137db95e01461ad21519bc1bdf294044b
<|skeleton|> class CoinTest: """Tests the hypothesis that a coin is fair.""" def TestStatistic(self, data): """Computes the test statistic. data: data in whatever form is relevant""" <|body_0|> def RunModel(self): """Run the model of the null hypothesis. returns: simulated data""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CoinTest: """Tests the hypothesis that a coin is fair.""" def TestStatistic(self, data): """Computes the test statistic. data: data in whatever form is relevant""" heads, tails = data test_stat = abs(heads - tails) return test_stat def RunModel(self): """Run t...
the_stack_v2_python_sparse
CompStats/hypothesis.py
sunny2309/scipy_conf_notebooks
train
2
41f8c7ff6393be932c3033fddd821c8b11a77842
[ "course_run = CourseRunFactory.create(course__program__financial_aid_availability=True, course__program__live=True)\ncourse = course_run.course\nProgramEnrollment.objects.create(program=course.program, user=user)\ncoupon1_auto = CouponFactory.create(coupon_type=Coupon.DISCOUNTED_PREVIOUS_COURSE, content_object=cour...
<|body_start_0|> course_run = CourseRunFactory.create(course__program__financial_aid_availability=True, course__program__live=True) course = course_run.course ProgramEnrollment.objects.create(program=course.program, user=user) coupon1_auto = CouponFactory.create(coupon_type=Coupon.DISCOU...
Tests for pick_coupon
PickCouponTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PickCouponTests: """Tests for pick_coupon""" def _create_coupons(cls, user): """Create some coupons""" <|body_0|> def setUpTestData(cls): """Set up some coupons""" <|body_1|> def test_pick_coupon(self): """Tests for happy case""" <|bo...
stack_v2_sparse_classes_36k_train_028044
41,111
permissive
[ { "docstring": "Create some coupons", "name": "_create_coupons", "signature": "def _create_coupons(cls, user)" }, { "docstring": "Set up some coupons", "name": "setUpTestData", "signature": "def setUpTestData(cls)" }, { "docstring": "Tests for happy case", "name": "test_pick_...
5
null
Implement the Python class `PickCouponTests` described below. Class description: Tests for pick_coupon Method signatures and docstrings: - def _create_coupons(cls, user): Create some coupons - def setUpTestData(cls): Set up some coupons - def test_pick_coupon(self): Tests for happy case - def test_attached_to_other_u...
Implement the Python class `PickCouponTests` described below. Class description: Tests for pick_coupon Method signatures and docstrings: - def _create_coupons(cls, user): Create some coupons - def setUpTestData(cls): Set up some coupons - def test_pick_coupon(self): Tests for happy case - def test_attached_to_other_u...
d6564caca0b7bbfd31e67a751564107fd17d6eb0
<|skeleton|> class PickCouponTests: """Tests for pick_coupon""" def _create_coupons(cls, user): """Create some coupons""" <|body_0|> def setUpTestData(cls): """Set up some coupons""" <|body_1|> def test_pick_coupon(self): """Tests for happy case""" <|bo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PickCouponTests: """Tests for pick_coupon""" def _create_coupons(cls, user): """Create some coupons""" course_run = CourseRunFactory.create(course__program__financial_aid_availability=True, course__program__live=True) course = course_run.course ProgramEnrollment.objects.cr...
the_stack_v2_python_sparse
ecommerce/api_test.py
mitodl/micromasters
train
35
73a08a944039b4fc8c0b18c7f70d89221dee9841
[ "_id = request.args.get('id', None)\nif not _id:\n return ({'msg': 'params error !'}, 400)\ntry:\n result = mongo_algo.db.algo_info.find_one({'_id': bson.ObjectId(_id)}, {'algo_weakness': 1})\n if not result:\n return ({'msg': 'id is not exist !'}, 200)\nexcept Exception as e:\n logging.error(e, ...
<|body_start_0|> _id = request.args.get('id', None) if not _id: return ({'msg': 'params error !'}, 400) try: result = mongo_algo.db.algo_info.find_one({'_id': bson.ObjectId(_id)}, {'algo_weakness': 1}) if not result: return ({'msg': 'id is not ...
AlgoWeaknessViews
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AlgoWeaknessViews: def get(self): """get one algo weakness through id :return:""" <|body_0|> def post(self): """add an algo weakness record :return:""" <|body_1|> def put(self): """update algo weakness record :return:""" <|body_2|> <|end...
stack_v2_sparse_classes_36k_train_028045
20,183
no_license
[ { "docstring": "get one algo weakness through id :return:", "name": "get", "signature": "def get(self)" }, { "docstring": "add an algo weakness record :return:", "name": "post", "signature": "def post(self)" }, { "docstring": "update algo weakness record :return:", "name": "p...
3
stack_v2_sparse_classes_30k_train_003469
Implement the Python class `AlgoWeaknessViews` described below. Class description: Implement the AlgoWeaknessViews class. Method signatures and docstrings: - def get(self): get one algo weakness through id :return: - def post(self): add an algo weakness record :return: - def put(self): update algo weakness record :re...
Implement the Python class `AlgoWeaknessViews` described below. Class description: Implement the AlgoWeaknessViews class. Method signatures and docstrings: - def get(self): get one algo weakness through id :return: - def post(self): add an algo weakness record :return: - def put(self): update algo weakness record :re...
054324b50e807d6f4e98f4a1b67afac9a0653b06
<|skeleton|> class AlgoWeaknessViews: def get(self): """get one algo weakness through id :return:""" <|body_0|> def post(self): """add an algo weakness record :return:""" <|body_1|> def put(self): """update algo weakness record :return:""" <|body_2|> <|end...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AlgoWeaknessViews: def get(self): """get one algo weakness through id :return:""" _id = request.args.get('id', None) if not _id: return ({'msg': 'params error !'}, 400) try: result = mongo_algo.db.algo_info.find_one({'_id': bson.ObjectId(_id)}, {'algo_we...
the_stack_v2_python_sparse
services/AlgoVersion/views.py
condilin/DMS
train
0
7f48e77790dac742ac97cb74d9eb4a7b17f2cfcb
[ "self.client_id = client_id\nself.is_worm_enabled = is_worm_enabled\nself.storage_access_key = storage_access_key\nself.storage_account_name = storage_account_name\nself.tier_type = tier_type\nself.tiers = tiers", "if dictionary is None:\n return None\nclient_id = dictionary.get('clientId')\nis_worm_enabled = ...
<|body_start_0|> self.client_id = client_id self.is_worm_enabled = is_worm_enabled self.storage_access_key = storage_access_key self.storage_account_name = storage_account_name self.tier_type = tier_type self.tiers = tiers <|end_body_0|> <|body_start_1|> if dicti...
Implementation of the 'AzureCloudCredentials' model. Specifies the cloud credentials to connect to a Microsoft Azure service account. Attributes: client_id (string): Specifies the client id of the managed identity assigned to the cluster. This is used only for clusters running as Azure VMs where authentication is done ...
AzureCloudCredentials
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AzureCloudCredentials: """Implementation of the 'AzureCloudCredentials' model. Specifies the cloud credentials to connect to a Microsoft Azure service account. Attributes: client_id (string): Specifies the client id of the managed identity assigned to the cluster. This is used only for clusters r...
stack_v2_sparse_classes_36k_train_028046
3,634
permissive
[ { "docstring": "Constructor for the AzureCloudCredentials class", "name": "__init__", "signature": "def __init__(self, client_id=None, is_worm_enabled=None, storage_access_key=None, storage_account_name=None, tier_type=None, tiers=None)" }, { "docstring": "Creates an instance of this model from ...
2
stack_v2_sparse_classes_30k_train_003634
Implement the Python class `AzureCloudCredentials` described below. Class description: Implementation of the 'AzureCloudCredentials' model. Specifies the cloud credentials to connect to a Microsoft Azure service account. Attributes: client_id (string): Specifies the client id of the managed identity assigned to the cl...
Implement the Python class `AzureCloudCredentials` described below. Class description: Implementation of the 'AzureCloudCredentials' model. Specifies the cloud credentials to connect to a Microsoft Azure service account. Attributes: client_id (string): Specifies the client id of the managed identity assigned to the cl...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class AzureCloudCredentials: """Implementation of the 'AzureCloudCredentials' model. Specifies the cloud credentials to connect to a Microsoft Azure service account. Attributes: client_id (string): Specifies the client id of the managed identity assigned to the cluster. This is used only for clusters r...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AzureCloudCredentials: """Implementation of the 'AzureCloudCredentials' model. Specifies the cloud credentials to connect to a Microsoft Azure service account. Attributes: client_id (string): Specifies the client id of the managed identity assigned to the cluster. This is used only for clusters running as Azu...
the_stack_v2_python_sparse
cohesity_management_sdk/models/azure_cloud_credentials.py
cohesity/management-sdk-python
train
24
0c537649fc89f3a6db7c05b8ef1c75265fe7524d
[ "selection = ~reflection_table.get_flags(reflection_table.flags.bad_for_scaling, all=False)\nreflection_table = reflection_table.select(selection)\nlogger.info('Selected %d scaled reflections', reflection_table.size())\nassert 'inverse_scale_factor' in reflection_table\nselection = reflection_table['inverse_scale_f...
<|body_start_0|> selection = ~reflection_table.get_flags(reflection_table.flags.bad_for_scaling, all=False) reflection_table = reflection_table.select(selection) logger.info('Selected %d scaled reflections', reflection_table.size()) assert 'inverse_scale_factor' in reflection_table ...
Reduction methods for data with sum intensities.
ScaleIntensityReducer
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ScaleIntensityReducer: """Reduction methods for data with sum intensities.""" def reduce_on_intensities(reflection_table): """Select intensities used for scaling and remove scaling outliers.""" <|body_0|> def apply_scaling_factors(reflection_table): """Apply the ...
stack_v2_sparse_classes_36k_train_028047
38,270
permissive
[ { "docstring": "Select intensities used for scaling and remove scaling outliers.", "name": "reduce_on_intensities", "signature": "def reduce_on_intensities(reflection_table)" }, { "docstring": "Apply the inverse scale factor to the scale intensities.", "name": "apply_scaling_factors", "s...
2
null
Implement the Python class `ScaleIntensityReducer` described below. Class description: Reduction methods for data with sum intensities. Method signatures and docstrings: - def reduce_on_intensities(reflection_table): Select intensities used for scaling and remove scaling outliers. - def apply_scaling_factors(reflecti...
Implement the Python class `ScaleIntensityReducer` described below. Class description: Reduction methods for data with sum intensities. Method signatures and docstrings: - def reduce_on_intensities(reflection_table): Select intensities used for scaling and remove scaling outliers. - def apply_scaling_factors(reflecti...
88bf7f7c5ac44defc046ebf0719cde748092cfff
<|skeleton|> class ScaleIntensityReducer: """Reduction methods for data with sum intensities.""" def reduce_on_intensities(reflection_table): """Select intensities used for scaling and remove scaling outliers.""" <|body_0|> def apply_scaling_factors(reflection_table): """Apply the ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ScaleIntensityReducer: """Reduction methods for data with sum intensities.""" def reduce_on_intensities(reflection_table): """Select intensities used for scaling and remove scaling outliers.""" selection = ~reflection_table.get_flags(reflection_table.flags.bad_for_scaling, all=False) ...
the_stack_v2_python_sparse
src/dials/util/filter_reflections.py
dials/dials
train
71
33cacae84e47139775a2407ea61b72fd141fa657
[ "k = k % len(nums)\nfor i in range(k):\n n = nums.pop(-1)\n print(n)\n nums.insert(0, n)", "k = k % len(nums)\nl = len(nums) - k\nnums[:l] = nums[:-k][::-1]\nnums[l:] = nums[l:][::-1]\nnums[:] = nums[::-1]" ]
<|body_start_0|> k = k % len(nums) for i in range(k): n = nums.pop(-1) print(n) nums.insert(0, n) <|end_body_0|> <|body_start_1|> k = k % len(nums) l = len(nums) - k nums[:l] = nums[:-k][::-1] nums[l:] = nums[l:][::-1] nums[:] ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def rotate(self, nums, k): """:type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place instead.""" <|body_0|> def rotate2(self, nums, k): """:type nums: List[int] :type k: int :rtype: void Do not return anything, modify n...
stack_v2_sparse_classes_36k_train_028048
821
no_license
[ { "docstring": ":type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place instead.", "name": "rotate", "signature": "def rotate(self, nums, k)" }, { "docstring": ":type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place inste...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def rotate(self, nums, k): :type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place instead. - def rotate2(self, nums, k): :type nums: List[in...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def rotate(self, nums, k): :type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place instead. - def rotate2(self, nums, k): :type nums: List[in...
0fc4c7af59246e3064db41989a45d9db413a624b
<|skeleton|> class Solution: def rotate(self, nums, k): """:type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place instead.""" <|body_0|> def rotate2(self, nums, k): """:type nums: List[int] :type k: int :rtype: void Do not return anything, modify n...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def rotate(self, nums, k): """:type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place instead.""" k = k % len(nums) for i in range(k): n = nums.pop(-1) print(n) nums.insert(0, n) def rotate2(self, n...
the_stack_v2_python_sparse
189. Rotate Array/rotate.py
Macielyoung/LeetCode
train
1
e6e8b3178b0e07708afd0621074e604acc4bcd66
[ "maxd = 0\nn = len(height)\nleft = 0\nright = n - 1\nwhile left != right:\n maxd = max(maxd, (right - left) * min(height[left], height[right]))\n if height[left] < height[right]:\n left = left + 1\n else:\n right = right - 1", "maxd = 0\nmaxi = 0\nn = len(height)\nfor i in range(0, n - 1):\...
<|body_start_0|> maxd = 0 n = len(height) left = 0 right = n - 1 while left != right: maxd = max(maxd, (right - left) * min(height[left], height[right])) if height[left] < height[right]: left = left + 1 else: rig...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxArea(self, height): """:type height: List[int] :rtype: int""" <|body_0|> def maxArea2(self, height): """:type height: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> maxd = 0 n = len(height) lef...
stack_v2_sparse_classes_36k_train_028049
950
no_license
[ { "docstring": ":type height: List[int] :rtype: int", "name": "maxArea", "signature": "def maxArea(self, height)" }, { "docstring": ":type height: List[int] :rtype: int", "name": "maxArea2", "signature": "def maxArea2(self, height)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxArea(self, height): :type height: List[int] :rtype: int - def maxArea2(self, height): :type height: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxArea(self, height): :type height: List[int] :rtype: int - def maxArea2(self, height): :type height: List[int] :rtype: int <|skeleton|> class Solution: def maxArea(se...
94b46e6c89d254d9dafc504f14c60136403b7ae8
<|skeleton|> class Solution: def maxArea(self, height): """:type height: List[int] :rtype: int""" <|body_0|> def maxArea2(self, height): """:type height: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxArea(self, height): """:type height: List[int] :rtype: int""" maxd = 0 n = len(height) left = 0 right = n - 1 while left != right: maxd = max(maxd, (right - left) * min(height[left], height[right])) if height[left] < heig...
the_stack_v2_python_sparse
leetcode_maxArea.py
lp2016/New_Algorithm
train
0
226588d33a552c740343051bd913df90dc4ff76e
[ "if len(nums) == 0:\n return 0\nans = 1\ncnt = 1\nfor i in range(len(nums) - 1):\n if nums[i + 1] > nums[i]:\n cnt += 1\n else:\n ans = max(ans, cnt)\n cnt = 1\nreturn max(ans, cnt)", "if len(nums) == 0:\n return 0\nans = 1\ncnt = 1\nfor i in range(len(nums) - 1):\n if nums[i +...
<|body_start_0|> if len(nums) == 0: return 0 ans = 1 cnt = 1 for i in range(len(nums) - 1): if nums[i + 1] > nums[i]: cnt += 1 else: ans = max(ans, cnt) cnt = 1 return max(ans, cnt) <|end_body_0|>...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findLengthOfLCIS(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findLengthOfLCIS(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def findLengthOfLCIS(self, nums): """:type nums: List[int] :rtype:...
stack_v2_sparse_classes_36k_train_028050
1,330
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "findLengthOfLCIS", "signature": "def findLengthOfLCIS(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "findLengthOfLCIS", "signature": "def findLengthOfLCIS(self, nums)" }, { "docstring": ":t...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findLengthOfLCIS(self, nums): :type nums: List[int] :rtype: int - def findLengthOfLCIS(self, nums): :type nums: List[int] :rtype: int - def findLengthOfLCIS(self, nums): :typ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findLengthOfLCIS(self, nums): :type nums: List[int] :rtype: int - def findLengthOfLCIS(self, nums): :type nums: List[int] :rtype: int - def findLengthOfLCIS(self, nums): :typ...
a509b383a42f54313970168d9faa11f088f18708
<|skeleton|> class Solution: def findLengthOfLCIS(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findLengthOfLCIS(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def findLengthOfLCIS(self, nums): """:type nums: List[int] :rtype:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findLengthOfLCIS(self, nums): """:type nums: List[int] :rtype: int""" if len(nums) == 0: return 0 ans = 1 cnt = 1 for i in range(len(nums) - 1): if nums[i + 1] > nums[i]: cnt += 1 else: an...
the_stack_v2_python_sparse
0674_Longest_Continuous_Increasing_Subsequence.py
bingli8802/leetcode
train
0
6b723ca5b76215f0ff4561982dea69962aef9f0a
[ "if not string:\n return Strings.EMPTY\nif not isinstance(string, str):\n string = str(string)\nstring = string.strip().lower()\nif string.startswith(('a ', 'an ')):\n return Strings.EMPTY\nif Strings.is_vowel(string[0]):\n return 'an'\nreturn 'a'", "intensifiers = ['', 'rather', 'slightly', 'very', '...
<|body_start_0|> if not string: return Strings.EMPTY if not isinstance(string, str): string = str(string) string = string.strip().lower() if string.startswith(('a ', 'an ')): return Strings.EMPTY if Strings.is_vowel(string[0]): retu...
Class docstring.
Utils
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Utils: """Class docstring.""" def article_for(cls, string): """Method docstring.""" <|body_0|> def random_intensifier(cls, uniform=False): """Method docstring.""" <|body_1|> def scan_for_values_with_key(cls, obj, key): """Method docstring."""...
stack_v2_sparse_classes_36k_train_028051
1,557
no_license
[ { "docstring": "Method docstring.", "name": "article_for", "signature": "def article_for(cls, string)" }, { "docstring": "Method docstring.", "name": "random_intensifier", "signature": "def random_intensifier(cls, uniform=False)" }, { "docstring": "Method docstring.", "name":...
3
stack_v2_sparse_classes_30k_train_014346
Implement the Python class `Utils` described below. Class description: Class docstring. Method signatures and docstrings: - def article_for(cls, string): Method docstring. - def random_intensifier(cls, uniform=False): Method docstring. - def scan_for_values_with_key(cls, obj, key): Method docstring.
Implement the Python class `Utils` described below. Class description: Class docstring. Method signatures and docstrings: - def article_for(cls, string): Method docstring. - def random_intensifier(cls, uniform=False): Method docstring. - def scan_for_values_with_key(cls, obj, key): Method docstring. <|skeleton|> cla...
f4c2533cd4543717b57743b8dabd783fa7cfcd60
<|skeleton|> class Utils: """Class docstring.""" def article_for(cls, string): """Method docstring.""" <|body_0|> def random_intensifier(cls, uniform=False): """Method docstring.""" <|body_1|> def scan_for_values_with_key(cls, obj, key): """Method docstring."""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Utils: """Class docstring.""" def article_for(cls, string): """Method docstring.""" if not string: return Strings.EMPTY if not isinstance(string, str): string = str(string) string = string.strip().lower() if string.startswith(('a ', 'an ')):...
the_stack_v2_python_sparse
rng/helpers/utils.py
janvanoverwalle/random-npc-generator
train
0
3240599a6d7020ad76f4dbee420a104a4627ae5f
[ "if len(nums) == 0:\n return 0\nelif len(nums) < 2:\n return max(nums[0], nums[-1])\nmoney = [0] * len(nums)\nmoney[0], money[1] = (nums[0], max(nums[0], nums[1]))\nfor i in range(2, len(nums)):\n money[i] = max(nums[i] + money[i - 2], money[i - 1])\nreturn money[len(nums) - 1]", "last, now = (0, 0)\nfor...
<|body_start_0|> if len(nums) == 0: return 0 elif len(nums) < 2: return max(nums[0], nums[-1]) money = [0] * len(nums) money[0], money[1] = (nums[0], max(nums[0], nums[1])) for i in range(2, len(nums)): money[i] = max(nums[i] + money[i - 2], mo...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def rob(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def rob_2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if len(nums) == 0: return 0 elif len(nu...
stack_v2_sparse_classes_36k_train_028052
1,466
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "rob", "signature": "def rob(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "rob_2", "signature": "def rob_2(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_001652
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def rob(self, nums): :type nums: List[int] :rtype: int - def rob_2(self, nums): :type nums: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def rob(self, nums): :type nums: List[int] :rtype: int - def rob_2(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: def rob(self, nums): ...
6bb1cf5f5a2c21a3a23198f179b0a608fcb5dbfc
<|skeleton|> class Solution: def rob(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def rob_2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def rob(self, nums): """:type nums: List[int] :rtype: int""" if len(nums) == 0: return 0 elif len(nums) < 2: return max(nums[0], nums[-1]) money = [0] * len(nums) money[0], money[1] = (nums[0], max(nums[0], nums[1])) for i in ra...
the_stack_v2_python_sparse
House Robber.py
zq13xw24/leetcode
train
0
e73f6f03de31540061c0dbab0caf0f7c9f09522c
[ "filename = base_utils.getFileName(file)\nresource = f'/inspection/api/v1/content/{id}'\nresponse = item_fixture.request('POST', resource, files={'file': (filename, open(file, 'rb'), fileType)})\nreturn response", "resource = f'/inspection/api/v1/formInstances/{id}/document'\nresponse = item_fixture.request('GET'...
<|body_start_0|> filename = base_utils.getFileName(file) resource = f'/inspection/api/v1/content/{id}' response = item_fixture.request('POST', resource, files={'file': (filename, open(file, 'rb'), fileType)}) return response <|end_body_0|> <|body_start_1|> resource = f'/inspecti...
文档
Content
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Content: """文档""" def contentPOST(self, item_fixture, id, file, fileType=None): """上次表单""" <|body_0|> def contentGET(self, item_fixture, id): """获取表单""" <|body_1|> def downcontentGET(self, item_fixture, id): """下载表单附件""" <|body_2|> ...
stack_v2_sparse_classes_36k_train_028053
2,417
no_license
[ { "docstring": "上次表单", "name": "contentPOST", "signature": "def contentPOST(self, item_fixture, id, file, fileType=None)" }, { "docstring": "获取表单", "name": "contentGET", "signature": "def contentGET(self, item_fixture, id)" }, { "docstring": "下载表单附件", "name": "downcontentGET"...
5
stack_v2_sparse_classes_30k_test_000253
Implement the Python class `Content` described below. Class description: 文档 Method signatures and docstrings: - def contentPOST(self, item_fixture, id, file, fileType=None): 上次表单 - def contentGET(self, item_fixture, id): 获取表单 - def downcontentGET(self, item_fixture, id): 下载表单附件 - def documentsPOST(self, item_fixture,...
Implement the Python class `Content` described below. Class description: 文档 Method signatures and docstrings: - def contentPOST(self, item_fixture, id, file, fileType=None): 上次表单 - def contentGET(self, item_fixture, id): 获取表单 - def downcontentGET(self, item_fixture, id): 下载表单附件 - def documentsPOST(self, item_fixture,...
f875de62f7f505c596ea5567e1fc2c8a64010f87
<|skeleton|> class Content: """文档""" def contentPOST(self, item_fixture, id, file, fileType=None): """上次表单""" <|body_0|> def contentGET(self, item_fixture, id): """获取表单""" <|body_1|> def downcontentGET(self, item_fixture, id): """下载表单附件""" <|body_2|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Content: """文档""" def contentPOST(self, item_fixture, id, file, fileType=None): """上次表单""" filename = base_utils.getFileName(file) resource = f'/inspection/api/v1/content/{id}' response = item_fixture.request('POST', resource, files={'file': (filename, open(file, 'rb'), fi...
the_stack_v2_python_sparse
swagger/api/inspection/content.py
zhangjingwen198817/pytest-api-allure
train
1
a561a2e51230978c04ed1465f1a80268798cc7c2
[ "self.id = id\nself.business_name = business_name\nself.category_id = category_id\nself.business_address = business_address\nself.contact = contact\nself.receiving_method = receiving_method\nself.created_at = APIHelper.RFC3339DateTime(created_at) if created_at else None\nself.status = status", "if dictionary is N...
<|body_start_0|> self.id = id self.business_name = business_name self.category_id = category_id self.business_address = business_address self.contact = contact self.receiving_method = receiving_method self.created_at = APIHelper.RFC3339DateTime(created_at) if crea...
Implementation of the 'Recipient' model. TODO: type model description here. Attributes: id (uuid|string): TODO: type description here. business_name (string): TODO: type description here. category_id (uuid|string): TODO: type description here. business_address (RecipientAddress): TODO: type description here. contact (C...
Recipient
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Recipient: """Implementation of the 'Recipient' model. TODO: type model description here. Attributes: id (uuid|string): TODO: type description here. business_name (string): TODO: type description here. category_id (uuid|string): TODO: type description here. business_address (RecipientAddress): TO...
stack_v2_sparse_classes_36k_train_028054
3,665
permissive
[ { "docstring": "Constructor for the Recipient class", "name": "__init__", "signature": "def __init__(self, id=None, business_name=None, category_id=None, business_address=None, contact=None, receiving_method=None, created_at=None, status=None)" }, { "docstring": "Creates an instance of this mode...
2
stack_v2_sparse_classes_30k_train_003412
Implement the Python class `Recipient` described below. Class description: Implementation of the 'Recipient' model. TODO: type model description here. Attributes: id (uuid|string): TODO: type description here. business_name (string): TODO: type description here. category_id (uuid|string): TODO: type description here. ...
Implement the Python class `Recipient` described below. Class description: Implementation of the 'Recipient' model. TODO: type model description here. Attributes: id (uuid|string): TODO: type description here. business_name (string): TODO: type description here. category_id (uuid|string): TODO: type description here. ...
e1ca52116aabfcdb2f36c24ebd866cf00bb5c6c9
<|skeleton|> class Recipient: """Implementation of the 'Recipient' model. TODO: type model description here. Attributes: id (uuid|string): TODO: type description here. business_name (string): TODO: type description here. category_id (uuid|string): TODO: type description here. business_address (RecipientAddress): TO...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Recipient: """Implementation of the 'Recipient' model. TODO: type model description here. Attributes: id (uuid|string): TODO: type description here. business_name (string): TODO: type description here. category_id (uuid|string): TODO: type description here. business_address (RecipientAddress): TODO: type desc...
the_stack_v2_python_sparse
plastiqpublicapi/models/recipient.py
jeffkynaston/sdk-spike-python-apimatic
train
0
ce4274fcd44bc68f02b6ba636e5a10a230af5341
[ "if control is not None:\n control = format.control(control)\nself.update_attributes({'workflowId': workflow_id, 'control': control, 'runId': run_id})", "if input is not None:\n input = format.input(input)\nif control is not None:\n control = format.control(control)\nself.update_attributes({'signalName':...
<|body_start_0|> if control is not None: control = format.control(control) self.update_attributes({'workflowId': workflow_id, 'control': control, 'runId': run_id}) <|end_body_0|> <|body_start_1|> if input is not None: input = format.input(input) if control is not...
ExternalWorkflowExecutionDecision
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ExternalWorkflowExecutionDecision: def request_cancel(self, workflow_id: str, control: dict[str, Any] | None=None, run_id: str | None=None) -> None: """External workflow execution decision builder :param workflow_id: id of the external workflow execution to cancel :param control: data at...
stack_v2_sparse_classes_36k_train_028055
7,634
permissive
[ { "docstring": "External workflow execution decision builder :param workflow_id: id of the external workflow execution to cancel :param control: data attached to the event that can be used by the decider in subsequent workflow tasks :param run_id: run id of the external workflow execution to cancel", "name"...
2
null
Implement the Python class `ExternalWorkflowExecutionDecision` described below. Class description: Implement the ExternalWorkflowExecutionDecision class. Method signatures and docstrings: - def request_cancel(self, workflow_id: str, control: dict[str, Any] | None=None, run_id: str | None=None) -> None: External workf...
Implement the Python class `ExternalWorkflowExecutionDecision` described below. Class description: Implement the ExternalWorkflowExecutionDecision class. Method signatures and docstrings: - def request_cancel(self, workflow_id: str, control: dict[str, Any] | None=None, run_id: str | None=None) -> None: External workf...
9e2b3186e109723862555fe0779394ae318d8380
<|skeleton|> class ExternalWorkflowExecutionDecision: def request_cancel(self, workflow_id: str, control: dict[str, Any] | None=None, run_id: str | None=None) -> None: """External workflow execution decision builder :param workflow_id: id of the external workflow execution to cancel :param control: data at...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ExternalWorkflowExecutionDecision: def request_cancel(self, workflow_id: str, control: dict[str, Any] | None=None, run_id: str | None=None) -> None: """External workflow execution decision builder :param workflow_id: id of the external workflow execution to cancel :param control: data attached to the ...
the_stack_v2_python_sparse
swf/models/decision/workflow.py
botify-labs/simpleflow
train
72
fc486c7c98e826d1fde31d12455cfc483350108e
[ "self.arr = vec2d\nself.outer_pointer = 0\nself.inner_pointer = 0", "if self.hasNext():\n v = self.arr[self.outer_pointer][self.inner_pointer]\n self.inner_pointer += 1\n return v", "while self.outer_pointer < len(self.arr):\n if self.inner_pointer < len(self.arr[self.outer_pointer]):\n retur...
<|body_start_0|> self.arr = vec2d self.outer_pointer = 0 self.inner_pointer = 0 <|end_body_0|> <|body_start_1|> if self.hasNext(): v = self.arr[self.outer_pointer][self.inner_pointer] self.inner_pointer += 1 return v <|end_body_1|> <|body_start_2|> ...
Vector2D
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Vector2D: def __init__(self, vec2d): """Initialize your data structure here. :type vec2d: List[List[int]]""" <|body_0|> def next(self): """:rtype: int""" <|body_1|> def hasNext(self): """:rtype: bool""" <|body_2|> <|end_skeleton|> <|bod...
stack_v2_sparse_classes_36k_train_028056
960
no_license
[ { "docstring": "Initialize your data structure here. :type vec2d: List[List[int]]", "name": "__init__", "signature": "def __init__(self, vec2d)" }, { "docstring": ":rtype: int", "name": "next", "signature": "def next(self)" }, { "docstring": ":rtype: bool", "name": "hasNext",...
3
null
Implement the Python class `Vector2D` described below. Class description: Implement the Vector2D class. Method signatures and docstrings: - def __init__(self, vec2d): Initialize your data structure here. :type vec2d: List[List[int]] - def next(self): :rtype: int - def hasNext(self): :rtype: bool
Implement the Python class `Vector2D` described below. Class description: Implement the Vector2D class. Method signatures and docstrings: - def __init__(self, vec2d): Initialize your data structure here. :type vec2d: List[List[int]] - def next(self): :rtype: int - def hasNext(self): :rtype: bool <|skeleton|> class V...
490c38a9478838ff23c9f910cc950633b1e3f994
<|skeleton|> class Vector2D: def __init__(self, vec2d): """Initialize your data structure here. :type vec2d: List[List[int]]""" <|body_0|> def next(self): """:rtype: int""" <|body_1|> def hasNext(self): """:rtype: bool""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Vector2D: def __init__(self, vec2d): """Initialize your data structure here. :type vec2d: List[List[int]]""" self.arr = vec2d self.outer_pointer = 0 self.inner_pointer = 0 def next(self): """:rtype: int""" if self.hasNext(): v = self.arr[self.ou...
the_stack_v2_python_sparse
Flatten 2D Vector/solution.py
normanyahq/LeetCodeSolution
train
0
d2584a376812fc29eef7e5777707c81ae348b5bf
[ "max_1 = 0\nl = len(s)\ndp = [[-1] * l for _ in range(l)]\nfor i in range(l):\n if s[i] == ')':\n dp[i][i] = -1\n continue\n else:\n dp[i][i] = 1\n for j in range(i + 1, l):\n if s[j] == '(':\n dp[i][j] = dp[i][j - 1] + 1\n else:\n dp[i][j] = dp[i][j...
<|body_start_0|> max_1 = 0 l = len(s) dp = [[-1] * l for _ in range(l)] for i in range(l): if s[i] == ')': dp[i][i] = -1 continue else: dp[i][i] = 1 for j in range(i + 1, l): if s[j] == '(...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longestValidParentheses(self, s): """:type s: str :rtype: int time_limit_over""" <|body_0|> def longestValidParentheses_1(self, s): """79ms :param s: :return:""" <|body_1|> def longestValidParentheses_2(self, s): """:type s: str :rt...
stack_v2_sparse_classes_36k_train_028057
3,220
no_license
[ { "docstring": ":type s: str :rtype: int time_limit_over", "name": "longestValidParentheses", "signature": "def longestValidParentheses(self, s)" }, { "docstring": "79ms :param s: :return:", "name": "longestValidParentheses_1", "signature": "def longestValidParentheses_1(self, s)" }, ...
4
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestValidParentheses(self, s): :type s: str :rtype: int time_limit_over - def longestValidParentheses_1(self, s): 79ms :param s: :return: - def longestValidParentheses_2(s...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestValidParentheses(self, s): :type s: str :rtype: int time_limit_over - def longestValidParentheses_1(self, s): 79ms :param s: :return: - def longestValidParentheses_2(s...
679a2b246b8b6bb7fc55ed1c8096d3047d6d4461
<|skeleton|> class Solution: def longestValidParentheses(self, s): """:type s: str :rtype: int time_limit_over""" <|body_0|> def longestValidParentheses_1(self, s): """79ms :param s: :return:""" <|body_1|> def longestValidParentheses_2(self, s): """:type s: str :rt...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def longestValidParentheses(self, s): """:type s: str :rtype: int time_limit_over""" max_1 = 0 l = len(s) dp = [[-1] * l for _ in range(l)] for i in range(l): if s[i] == ')': dp[i][i] = -1 continue else: ...
the_stack_v2_python_sparse
LongestValidParentheses_HARD_32.py
953250587/leetcode-python
train
2
b289e1fb8cb63905a33774a47eabdd4b8ad2a4f5
[ "qs = super().get_queryset()\nqs = qs.filter(goal__state='published')\nreturn qs.filter(**kwargs).distinct()", "if kwargs.pop('published', False):\n kwargs['goal__state'] = 'published'\nkwargs['completed'] = False\nqs = self.get_queryset().filter(**kwargs)\nseq = qs.aggregate(Min('goal__sequence_order'))\nseq ...
<|body_start_0|> qs = super().get_queryset() qs = qs.filter(goal__state='published') return qs.filter(**kwargs).distinct() <|end_body_0|> <|body_start_1|> if kwargs.pop('published', False): kwargs['goal__state'] = 'published' kwargs['completed'] = False qs = ...
UserGoalManager
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserGoalManager: def published(self, *args, **kwargs): """Return a QuerySet of UserGoal objects with at least one published Goal.""" <|body_0|> def next_in_sequence(self, **kwargs): """Return a queryset of UserGoals that are: - not completed, - the next in the sequen...
stack_v2_sparse_classes_36k_train_028058
21,796
permissive
[ { "docstring": "Return a QuerySet of UserGoal objects with at least one published Goal.", "name": "published", "signature": "def published(self, *args, **kwargs)" }, { "docstring": "Return a queryset of UserGoals that are: - not completed, - the next in the sequence (based on sequence_order)", ...
4
null
Implement the Python class `UserGoalManager` described below. Class description: Implement the UserGoalManager class. Method signatures and docstrings: - def published(self, *args, **kwargs): Return a QuerySet of UserGoal objects with at least one published Goal. - def next_in_sequence(self, **kwargs): Return a query...
Implement the Python class `UserGoalManager` described below. Class description: Implement the UserGoalManager class. Method signatures and docstrings: - def published(self, *args, **kwargs): Return a QuerySet of UserGoal objects with at least one published Goal. - def next_in_sequence(self, **kwargs): Return a query...
3d22179c581ab3da18900483930d5ecc0a5fca73
<|skeleton|> class UserGoalManager: def published(self, *args, **kwargs): """Return a QuerySet of UserGoal objects with at least one published Goal.""" <|body_0|> def next_in_sequence(self, **kwargs): """Return a queryset of UserGoals that are: - not completed, - the next in the sequen...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserGoalManager: def published(self, *args, **kwargs): """Return a QuerySet of UserGoal objects with at least one published Goal.""" qs = super().get_queryset() qs = qs.filter(goal__state='published') return qs.filter(**kwargs).distinct() def next_in_sequence(self, **kwarg...
the_stack_v2_python_sparse
tndata_backend/goals/managers.py
tndatacommons/tndata_backend
train
1
0ad1674af08cd5adbeb25bf78a127cefd04d437a
[ "global saccList, fixList\nsaccList = []\nfixList = []\nglobal trialId\nself.waitForSacc = False\nself.saccOnset = None\nself.stimTime = None\ntrialDict['saccLat'] = trialDict['xCoG'] = trialDict['xCoGMask'] = trialDict['yCoG'] = trialDict['yCoGMask'] = trialDict['rtFromStim'] = trialDict['endX'] = trialDict['endXC...
<|body_start_0|> global saccList, fixList saccList = [] fixList = [] global trialId self.waitForSacc = False self.saccOnset = None self.stimTime = None trialDict['saccLat'] = trialDict['xCoG'] = trialDict['xCoGMask'] = trialDict['yCoG'] = trialDict['yCoGMa...
MyReader
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyReader: def initTrial(self, trialDict): """Initialize a trial: Arguments: trialDict -- a trial dictionary""" <|body_0|> def finishTrial(self, trialDict): """Finalizes the trial. Arguments: trialDict -- a trial dictionary""" <|body_1|> def parseLine(sel...
stack_v2_sparse_classes_36k_train_028059
9,558
no_license
[ { "docstring": "Initialize a trial: Arguments: trialDict -- a trial dictionary", "name": "initTrial", "signature": "def initTrial(self, trialDict)" }, { "docstring": "Finalizes the trial. Arguments: trialDict -- a trial dictionary", "name": "finishTrial", "signature": "def finishTrial(se...
4
null
Implement the Python class `MyReader` described below. Class description: Implement the MyReader class. Method signatures and docstrings: - def initTrial(self, trialDict): Initialize a trial: Arguments: trialDict -- a trial dictionary - def finishTrial(self, trialDict): Finalizes the trial. Arguments: trialDict -- a ...
Implement the Python class `MyReader` described below. Class description: Implement the MyReader class. Method signatures and docstrings: - def initTrial(self, trialDict): Initialize a trial: Arguments: trialDict -- a trial dictionary - def finishTrial(self, trialDict): Finalizes the trial. Arguments: trialDict -- a ...
a114d422756f926c3a1256dc796c8f39d34d8078
<|skeleton|> class MyReader: def initTrial(self, trialDict): """Initialize a trial: Arguments: trialDict -- a trial dictionary""" <|body_0|> def finishTrial(self, trialDict): """Finalizes the trial. Arguments: trialDict -- a trial dictionary""" <|body_1|> def parseLine(sel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MyReader: def initTrial(self, trialDict): """Initialize a trial: Arguments: trialDict -- a trial dictionary""" global saccList, fixList saccList = [] fixList = [] global trialId self.waitForSacc = False self.saccOnset = None self.stimTime = None ...
the_stack_v2_python_sparse
004B/bckp/backup .⁄studies._004/parseAsc.py
lvanderlinden/004
train
0
3f586f162ea9b68216b9478d9f3be64c92f6737b
[ "self.matrix = matrix8x8\nself.iterations = 0\nself.fib1 = 1\nself.fib2 = 1\nself.fib3 = 2", "self.iterations = 0\nself.fib1 = 1\nself.fib2 = 1\nself.fib3 = 2\nself.matrix.set_brightness(BRIGHTNESS)", "time.sleep(UPDATE_RATE_SECONDS)\nfor ypixel in range(0, 8):\n for xpixel in range(0, 8):\n self.iter...
<|body_start_0|> self.matrix = matrix8x8 self.iterations = 0 self.fib1 = 1 self.fib2 = 1 self.fib3 = 2 <|end_body_0|> <|body_start_1|> self.iterations = 0 self.fib1 = 1 self.fib2 = 1 self.fib3 = 2 self.matrix.set_brightness(BRIGHTNESS) <|e...
fibinocci pattern from 1 to largest 64 bit representation
Led8x8Fibonacci
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Led8x8Fibonacci: """fibinocci pattern from 1 to largest 64 bit representation""" def __init__(self, matrix8x8): """create initial conditions and saving display and I2C lock""" <|body_0|> def reset(self): """initialize to starting state and set brightness""" ...
stack_v2_sparse_classes_36k_train_028060
1,724
permissive
[ { "docstring": "create initial conditions and saving display and I2C lock", "name": "__init__", "signature": "def __init__(self, matrix8x8)" }, { "docstring": "initialize to starting state and set brightness", "name": "reset", "signature": "def reset(self)" }, { "docstring": "dis...
3
stack_v2_sparse_classes_30k_train_004953
Implement the Python class `Led8x8Fibonacci` described below. Class description: fibinocci pattern from 1 to largest 64 bit representation Method signatures and docstrings: - def __init__(self, matrix8x8): create initial conditions and saving display and I2C lock - def reset(self): initialize to starting state and se...
Implement the Python class `Led8x8Fibonacci` described below. Class description: fibinocci pattern from 1 to largest 64 bit representation Method signatures and docstrings: - def __init__(self, matrix8x8): create initial conditions and saving display and I2C lock - def reset(self): initialize to starting state and se...
6937b4f64a1a2526bc9888c119371d72bacbdfaa
<|skeleton|> class Led8x8Fibonacci: """fibinocci pattern from 1 to largest 64 bit representation""" def __init__(self, matrix8x8): """create initial conditions and saving display and I2C lock""" <|body_0|> def reset(self): """initialize to starting state and set brightness""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Led8x8Fibonacci: """fibinocci pattern from 1 to largest 64 bit representation""" def __init__(self, matrix8x8): """create initial conditions and saving display and I2C lock""" self.matrix = matrix8x8 self.iterations = 0 self.fib1 = 1 self.fib2 = 1 self.fib3...
the_stack_v2_python_sparse
led8x8fibonacci.py
parttimehacker/diyclock
train
0
90f8cdfe86610dee7bfa2914e5a9744d2505d6cf
[ "from h2o.expr import ExprNode\nresult = ExprNode('tree.update.weights', self, frame, weights_column)._eval_driver('scalar')._cache._data\nif result != 'OK':\n warn(result)", "from h2o.expr import ExprNode\nresult = ExprNode('set.calibration.model', self, calibration_model)._eval_driver('scalar')._cache._data\...
<|body_start_0|> from h2o.expr import ExprNode result = ExprNode('tree.update.weights', self, frame, weights_column)._eval_driver('scalar')._cache._data if result != 'OK': warn(result) <|end_body_0|> <|body_start_1|> from h2o.expr import ExprNode result = ExprNode('s...
SupervisedTrees
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SupervisedTrees: def _update_tree_weights(self, frame, weights_column): """Re-calculates tree-node weights based on provided dataset. Modifying node weights will affect how contribution predictions (Shapley values) are calculated. This can be used to explain the model on a curated sub-po...
stack_v2_sparse_classes_36k_train_028061
2,355
permissive
[ { "docstring": "Re-calculates tree-node weights based on provided dataset. Modifying node weights will affect how contribution predictions (Shapley values) are calculated. This can be used to explain the model on a curated sub-population of the training dataset. :param frame: frame that will be used to re-popul...
2
stack_v2_sparse_classes_30k_train_008765
Implement the Python class `SupervisedTrees` described below. Class description: Implement the SupervisedTrees class. Method signatures and docstrings: - def _update_tree_weights(self, frame, weights_column): Re-calculates tree-node weights based on provided dataset. Modifying node weights will affect how contributio...
Implement the Python class `SupervisedTrees` described below. Class description: Implement the SupervisedTrees class. Method signatures and docstrings: - def _update_tree_weights(self, frame, weights_column): Re-calculates tree-node weights based on provided dataset. Modifying node weights will affect how contributio...
d817ab90c8c47f6787604a0b9639b66234158228
<|skeleton|> class SupervisedTrees: def _update_tree_weights(self, frame, weights_column): """Re-calculates tree-node weights based on provided dataset. Modifying node weights will affect how contribution predictions (Shapley values) are calculated. This can be used to explain the model on a curated sub-po...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SupervisedTrees: def _update_tree_weights(self, frame, weights_column): """Re-calculates tree-node weights based on provided dataset. Modifying node weights will affect how contribution predictions (Shapley values) are calculated. This can be used to explain the model on a curated sub-population of th...
the_stack_v2_python_sparse
h2o-py/h2o/model/extensions/supervised_trees.py
h2oai/h2o-3
train
6,872
71ac6e9debfe67d31456d98c384332719e0bc816
[ "parser = subparsers.add_parser('assign', help=textwrap.fill('Assign contents of pattoo DB.', width=width))\nself.subparsers = parser.add_subparsers(dest='qualifier')\nfor name in dir(self):\n attribute = getattr(self, name)\n if ismethod(attribute):\n if name.startswith('_'):\n continue\n ...
<|body_start_0|> parser = subparsers.add_parser('assign', help=textwrap.fill('Assign contents of pattoo DB.', width=width)) self.subparsers = parser.add_subparsers(dest='qualifier') for name in dir(self): attribute = getattr(self, name) if ismethod(attribute): ...
Class gathers all CLI 'assign' information.
_Assign
[ "GPL-3.0-only" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _Assign: """Class gathers all CLI 'assign' information.""" def __init__(self, subparsers, width=80): """Intialize the class.""" <|body_0|> def agent(self, width=80): """Process assign agents CLI commands. Args: width: Width of the help text string to STDIO before...
stack_v2_sparse_classes_36k_train_028062
14,703
permissive
[ { "docstring": "Intialize the class.", "name": "__init__", "signature": "def __init__(self, subparsers, width=80)" }, { "docstring": "Process assign agents CLI commands. Args: width: Width of the help text string to STDIO before wrapping Returns: None", "name": "agent", "signature": "def...
2
stack_v2_sparse_classes_30k_train_018252
Implement the Python class `_Assign` described below. Class description: Class gathers all CLI 'assign' information. Method signatures and docstrings: - def __init__(self, subparsers, width=80): Intialize the class. - def agent(self, width=80): Process assign agents CLI commands. Args: width: Width of the help text s...
Implement the Python class `_Assign` described below. Class description: Class gathers all CLI 'assign' information. Method signatures and docstrings: - def __init__(self, subparsers, width=80): Intialize the class. - def agent(self, width=80): Process assign agents CLI commands. Args: width: Width of the help text s...
57bd3e82e49d51e3426b13ad53ed8326a735ce29
<|skeleton|> class _Assign: """Class gathers all CLI 'assign' information.""" def __init__(self, subparsers, width=80): """Intialize the class.""" <|body_0|> def agent(self, width=80): """Process assign agents CLI commands. Args: width: Width of the help text string to STDIO before...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _Assign: """Class gathers all CLI 'assign' information.""" def __init__(self, subparsers, width=80): """Intialize the class.""" parser = subparsers.add_parser('assign', help=textwrap.fill('Assign contents of pattoo DB.', width=width)) self.subparsers = parser.add_subparsers(dest='...
the_stack_v2_python_sparse
pattoo/cli/cli.py
palisadoes/pattoo
train
0
b89fece19e44aee640af154aa0da149f7fcc66c8
[ "index = len(nums) - 1\nif nums == [0]:\n return True\nwhile index >= 0:\n while index >= 0 and nums[index] != 0:\n index -= 1\n if index < 0:\n return True\n if index == len(nums) - 1:\n last = True\n else:\n last = False\n offset = 1\n if last:\n while index...
<|body_start_0|> index = len(nums) - 1 if nums == [0]: return True while index >= 0: while index >= 0 and nums[index] != 0: index -= 1 if index < 0: return True if index == len(nums) - 1: last = True ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def canJump1(self, nums): """:type nums: List[int] :rtype: bool""" <|body_0|> def canJump(self, nums): """:type nums: List[int] :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> index = len(nums) - 1 if nums == [0]: ...
stack_v2_sparse_classes_36k_train_028063
2,672
no_license
[ { "docstring": ":type nums: List[int] :rtype: bool", "name": "canJump1", "signature": "def canJump1(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: bool", "name": "canJump", "signature": "def canJump(self, nums)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canJump1(self, nums): :type nums: List[int] :rtype: bool - def canJump(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 canJump1(self, nums): :type nums: List[int] :rtype: bool - def canJump(self, nums): :type nums: List[int] :rtype: bool <|skeleton|> class Solution: def canJump1(self, n...
4a1747b6497305f3821612d9c358a6795b1690da
<|skeleton|> class Solution: def canJump1(self, nums): """:type nums: List[int] :rtype: bool""" <|body_0|> def canJump(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 canJump1(self, nums): """:type nums: List[int] :rtype: bool""" index = len(nums) - 1 if nums == [0]: return True while index >= 0: while index >= 0 and nums[index] != 0: index -= 1 if index < 0: r...
the_stack_v2_python_sparse
Greedy/q055_jump_game.py
sevenhe716/LeetCode
train
0
e2d10fbfdd10c12530c652c04eef12e2b21cc23c
[ "self.task = task\nself.results = results\nself.analysis_path = cwd('storage', 'analyses', '%s' % task['id'])", "try:\n current = module()\nexcept:\n log.exception('Failed to load the reporting module: %s', module, extra={'task_id': self.task['id']})\n return\nmodule_name = inspect.getmodule(current).__n...
<|body_start_0|> self.task = task self.results = results self.analysis_path = cwd('storage', 'analyses', '%s' % task['id']) <|end_body_0|> <|body_start_1|> try: current = module() except: log.exception('Failed to load the reporting module: %s', module, ex...
Reporting Engine. This class handles the loading and execution of the enabled reporting modules. It receives the analysis results dictionary from the Processing Engine and pass it over to the reporting modules before executing them.
RunReporting
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RunReporting: """Reporting Engine. This class handles the loading and execution of the enabled reporting modules. It receives the analysis results dictionary from the Processing Engine and pass it over to the reporting modules before executing them.""" def __init__(self, task, results): ...
stack_v2_sparse_classes_36k_train_028064
23,903
no_license
[ { "docstring": "@param analysis_path: analysis folder path.", "name": "__init__", "signature": "def __init__(self, task, results)" }, { "docstring": "Run a single reporting module. @param module: reporting module. @param results: results results from analysis.", "name": "process", "signa...
3
stack_v2_sparse_classes_30k_train_001529
Implement the Python class `RunReporting` described below. Class description: Reporting Engine. This class handles the loading and execution of the enabled reporting modules. It receives the analysis results dictionary from the Processing Engine and pass it over to the reporting modules before executing them. Method ...
Implement the Python class `RunReporting` described below. Class description: Reporting Engine. This class handles the loading and execution of the enabled reporting modules. It receives the analysis results dictionary from the Processing Engine and pass it over to the reporting modules before executing them. Method ...
d2f342f128ea1d8c69fa481775362b3fee5757f8
<|skeleton|> class RunReporting: """Reporting Engine. This class handles the loading and execution of the enabled reporting modules. It receives the analysis results dictionary from the Processing Engine and pass it over to the reporting modules before executing them.""" def __init__(self, task, results): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RunReporting: """Reporting Engine. This class handles the loading and execution of the enabled reporting modules. It receives the analysis results dictionary from the Processing Engine and pass it over to the reporting modules before executing them.""" def __init__(self, task, results): """@param...
the_stack_v2_python_sparse
core/plugins.py
SNDBOXLTD/cuckoo
train
3
035657c6b6c9e1d0e365009106411ebd00015572
[ "u_name = data_utils.rand_name('user')\nu_email = u_name + '@testmail.tm'\nu_password = data_utils.rand_password()\nself.assertRaises(lib_exc.NotFound, self.users_client.create_user, name=u_name, password=u_password, email=u_email, domain_id=data_utils.rand_uuid_hex())", "password = data_utils.rand_password()\nus...
<|body_start_0|> u_name = data_utils.rand_name('user') u_email = u_name + '@testmail.tm' u_password = data_utils.rand_password() self.assertRaises(lib_exc.NotFound, self.users_client.create_user, name=u_name, password=u_password, email=u_email, domain_id=data_utils.rand_uuid_hex()) <|end...
Negative tests of keystone users
UsersNegativeTest
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UsersNegativeTest: """Negative tests of keystone users""" def test_create_user_for_non_existent_domain(self): """Attempt to create a user in a non-existent domain should fail""" <|body_0|> def test_authentication_for_disabled_user(self): """Attempt to authenticat...
stack_v2_sparse_classes_36k_train_028065
2,185
permissive
[ { "docstring": "Attempt to create a user in a non-existent domain should fail", "name": "test_create_user_for_non_existent_domain", "signature": "def test_create_user_for_non_existent_domain(self)" }, { "docstring": "Attempt to authenticate for disabled user should fail", "name": "test_authe...
2
null
Implement the Python class `UsersNegativeTest` described below. Class description: Negative tests of keystone users Method signatures and docstrings: - def test_create_user_for_non_existent_domain(self): Attempt to create a user in a non-existent domain should fail - def test_authentication_for_disabled_user(self): A...
Implement the Python class `UsersNegativeTest` described below. Class description: Negative tests of keystone users Method signatures and docstrings: - def test_create_user_for_non_existent_domain(self): Attempt to create a user in a non-existent domain should fail - def test_authentication_for_disabled_user(self): A...
3932a799e620a20d7abf7b89e21b520683a1809b
<|skeleton|> class UsersNegativeTest: """Negative tests of keystone users""" def test_create_user_for_non_existent_domain(self): """Attempt to create a user in a non-existent domain should fail""" <|body_0|> def test_authentication_for_disabled_user(self): """Attempt to authenticat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UsersNegativeTest: """Negative tests of keystone users""" def test_create_user_for_non_existent_domain(self): """Attempt to create a user in a non-existent domain should fail""" u_name = data_utils.rand_name('user') u_email = u_name + '@testmail.tm' u_password = data_utils...
the_stack_v2_python_sparse
tempest/api/identity/admin/v3/test_users_negative.py
openstack/tempest
train
270
ca98cbf87e45af62a2542746b773aa86a94bf9f7
[ "super().__init__()\nself.screen = screen\nself.screen_rect = screen.get_rect()\nself.ui_settings = ui_settings\nself.stats = stats\nself.text_color = (30, 30, 30)\nself.font = pygame.font.SysFont(None, 48)\nself.prep_score()\nself.prep_high_score()\nself.prep_ships()", "round_score = int(round(self.stats.score, ...
<|body_start_0|> super().__init__() self.screen = screen self.screen_rect = screen.get_rect() self.ui_settings = ui_settings self.stats = stats self.text_color = (30, 30, 30) self.font = pygame.font.SysFont(None, 48) self.prep_score() self.prep_hig...
Scoreboard
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Scoreboard: def __init__(self, ui_settings, screen, stats): """初始化""" <|body_0|> def prep_score(self): """显示得分的图像""" <|body_1|> def show_score(self): """绘制得分""" <|body_2|> def prep_high_score(self): """记录最高得分""" <|bod...
stack_v2_sparse_classes_36k_train_028066
2,181
no_license
[ { "docstring": "初始化", "name": "__init__", "signature": "def __init__(self, ui_settings, screen, stats)" }, { "docstring": "显示得分的图像", "name": "prep_score", "signature": "def prep_score(self)" }, { "docstring": "绘制得分", "name": "show_score", "signature": "def show_score(self...
5
stack_v2_sparse_classes_30k_train_011640
Implement the Python class `Scoreboard` described below. Class description: Implement the Scoreboard class. Method signatures and docstrings: - def __init__(self, ui_settings, screen, stats): 初始化 - def prep_score(self): 显示得分的图像 - def show_score(self): 绘制得分 - def prep_high_score(self): 记录最高得分 - def prep_ships(self): 显...
Implement the Python class `Scoreboard` described below. Class description: Implement the Scoreboard class. Method signatures and docstrings: - def __init__(self, ui_settings, screen, stats): 初始化 - def prep_score(self): 显示得分的图像 - def show_score(self): 绘制得分 - def prep_high_score(self): 记录最高得分 - def prep_ships(self): 显...
114bf86a071317d592cff2ba2ce92360b87cd48a
<|skeleton|> class Scoreboard: def __init__(self, ui_settings, screen, stats): """初始化""" <|body_0|> def prep_score(self): """显示得分的图像""" <|body_1|> def show_score(self): """绘制得分""" <|body_2|> def prep_high_score(self): """记录最高得分""" <|bod...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Scoreboard: def __init__(self, ui_settings, screen, stats): """初始化""" super().__init__() self.screen = screen self.screen_rect = screen.get_rect() self.ui_settings = ui_settings self.stats = stats self.text_color = (30, 30, 30) self.font = pygame...
the_stack_v2_python_sparse
python实战项目/pygame_applications/shotGame/scoreboard.py
iceAcmen/whole-Python
train
0
00f9e85aafb17690211fd1d756a8fb0bf0aeeec0
[ "status = ErrorCode.SUCCESS\ntry:\n terminals = self.db.query('SELECT tt.mobile, tt.owner_mobile FROM T_TERMINAL_INFO as tt, T_GROUP as tg, T_CORP as tc WHERE tt.service_status = 1 AND tc.cid = %s AND tc.cid = tg.corp_id AND tt.group_id = tg.id', self.current_user.cid)\n mobiles = []\n for terminal i...
<|body_start_0|> status = ErrorCode.SUCCESS try: terminals = self.db.query('SELECT tt.mobile, tt.owner_mobile FROM T_TERMINAL_INFO as tt, T_GROUP as tg, T_CORP as tc WHERE tt.service_status = 1 AND tc.cid = %s AND tc.cid = tg.corp_id AND tt.group_id = tg.id', self.current_user.cid) ...
SMSOption: login/powerlow/poweroff/illegalmove/sos/heartbeat_lost/region_enter/region_out 1: send 0: not send
SMSOptionCorpHandler
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SMSOptionCorpHandler: """SMSOption: login/powerlow/poweroff/illegalmove/sos/heartbeat_lost/region_enter/region_out 1: send 0: not send""" def get(self): """Display smsoption of current user.""" <|body_0|> def put(self): """Modify smsoptions for the given owner_mo...
stack_v2_sparse_classes_36k_train_028067
6,583
no_license
[ { "docstring": "Display smsoption of current user.", "name": "get", "signature": "def get(self)" }, { "docstring": "Modify smsoptions for the given owner_mobile.", "name": "put", "signature": "def put(self)" } ]
2
null
Implement the Python class `SMSOptionCorpHandler` described below. Class description: SMSOption: login/powerlow/poweroff/illegalmove/sos/heartbeat_lost/region_enter/region_out 1: send 0: not send Method signatures and docstrings: - def get(self): Display smsoption of current user. - def put(self): Modify smsoptions f...
Implement the Python class `SMSOptionCorpHandler` described below. Class description: SMSOption: login/powerlow/poweroff/illegalmove/sos/heartbeat_lost/region_enter/region_out 1: send 0: not send Method signatures and docstrings: - def get(self): Display smsoption of current user. - def put(self): Modify smsoptions f...
3b095a325581b1fc48497c234f0ad55e928586a1
<|skeleton|> class SMSOptionCorpHandler: """SMSOption: login/powerlow/poweroff/illegalmove/sos/heartbeat_lost/region_enter/region_out 1: send 0: not send""" def get(self): """Display smsoption of current user.""" <|body_0|> def put(self): """Modify smsoptions for the given owner_mo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SMSOptionCorpHandler: """SMSOption: login/powerlow/poweroff/illegalmove/sos/heartbeat_lost/region_enter/region_out 1: send 0: not send""" def get(self): """Display smsoption of current user.""" status = ErrorCode.SUCCESS try: terminals = self.db.query('SELECT tt.mobile...
the_stack_v2_python_sparse
apps/uweb/handlers/smsoption.py
jcsy521/ydws
train
0
98924f5c72a5847e63ff40f81863eb488107c6eb
[ "self.primary_cluster_id = primary_cluster_id\nself.primary_cluster_user_sid = primary_cluster_user_sid\nself.primary_cluster_username = primary_cluster_username", "if dictionary is None:\n return None\nprimary_cluster_id = dictionary.get('PrimaryClusterId')\nprimary_cluster_user_sid = dictionary.get('PrimaryC...
<|body_start_0|> self.primary_cluster_id = primary_cluster_id self.primary_cluster_user_sid = primary_cluster_user_sid self.primary_cluster_username = primary_cluster_username <|end_body_0|> <|body_start_1|> if dictionary is None: return None primary_cluster_id = dic...
Implementation of the 'SpogContext' model. SpogContext specifies all of the information about the user and cluster which is performing action on this cluster. Attributes: primary_cluster_id (long|int): Specifies the ID of the remote cluster which is accessing this cluster via SPOG. primary_cluster_user_sid (string): Sp...
SpogContext
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SpogContext: """Implementation of the 'SpogContext' model. SpogContext specifies all of the information about the user and cluster which is performing action on this cluster. Attributes: primary_cluster_id (long|int): Specifies the ID of the remote cluster which is accessing this cluster via SPOG...
stack_v2_sparse_classes_36k_train_028068
2,356
permissive
[ { "docstring": "Constructor for the SpogContext class", "name": "__init__", "signature": "def __init__(self, primary_cluster_id=None, primary_cluster_user_sid=None, primary_cluster_username=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary...
2
null
Implement the Python class `SpogContext` described below. Class description: Implementation of the 'SpogContext' model. SpogContext specifies all of the information about the user and cluster which is performing action on this cluster. Attributes: primary_cluster_id (long|int): Specifies the ID of the remote cluster w...
Implement the Python class `SpogContext` described below. Class description: Implementation of the 'SpogContext' model. SpogContext specifies all of the information about the user and cluster which is performing action on this cluster. Attributes: primary_cluster_id (long|int): Specifies the ID of the remote cluster w...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class SpogContext: """Implementation of the 'SpogContext' model. SpogContext specifies all of the information about the user and cluster which is performing action on this cluster. Attributes: primary_cluster_id (long|int): Specifies the ID of the remote cluster which is accessing this cluster via SPOG...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SpogContext: """Implementation of the 'SpogContext' model. SpogContext specifies all of the information about the user and cluster which is performing action on this cluster. Attributes: primary_cluster_id (long|int): Specifies the ID of the remote cluster which is accessing this cluster via SPOG. primary_clu...
the_stack_v2_python_sparse
cohesity_management_sdk/models/spog_context.py
cohesity/management-sdk-python
train
24
66712910f2a7ddcff9b41962edf300287642a804
[ "self.car = car\nself.date = date\nself.odometer = odometer\nself.bill = bill", "self.car.view_info()\nprint('\\tServiced on : {}'.format(self.date))\nprint('\\tOdometer : {} km'.format(self.odometer))\nprint('\\tBill Amount : Rs. {}'.format(self.bill))" ]
<|body_start_0|> self.car = car self.date = date self.odometer = odometer self.bill = bill <|end_body_0|> <|body_start_1|> self.car.view_info() print('\tServiced on : {}'.format(self.date)) print('\tOdometer : {} km'.format(self.odometer)) print('\tBil...
a model for a service performed
Service
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Service: """a model for a service performed""" def __init__(self, car, date, odometer, bill): """initialise service details""" <|body_0|> def view_details(self): """print details about the car""" <|body_1|> <|end_skeleton|> <|body_start_0|> self...
stack_v2_sparse_classes_36k_train_028069
2,336
no_license
[ { "docstring": "initialise service details", "name": "__init__", "signature": "def __init__(self, car, date, odometer, bill)" }, { "docstring": "print details about the car", "name": "view_details", "signature": "def view_details(self)" } ]
2
stack_v2_sparse_classes_30k_train_008448
Implement the Python class `Service` described below. Class description: a model for a service performed Method signatures and docstrings: - def __init__(self, car, date, odometer, bill): initialise service details - def view_details(self): print details about the car
Implement the Python class `Service` described below. Class description: a model for a service performed Method signatures and docstrings: - def __init__(self, car, date, odometer, bill): initialise service details - def view_details(self): print details about the car <|skeleton|> class Service: """a model for a...
9ab69e5d0e1d78915ef9bf4287ebc58f24f0658f
<|skeleton|> class Service: """a model for a service performed""" def __init__(self, car, date, odometer, bill): """initialise service details""" <|body_0|> def view_details(self): """print details about the car""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Service: """a model for a service performed""" def __init__(self, car, date, odometer, bill): """initialise service details""" self.car = car self.date = date self.odometer = odometer self.bill = bill def view_details(self): """print details about the ...
the_stack_v2_python_sparse
session6_object_oriented/17.py
ramkishorem/pythonic
train
0
e14fb2ebb78c03a4eb8537354783e35d94008f83
[ "super(Cell, self).__init__()\nself.reduction = reduction\nself.reduction_prev = reduction_prev\nself.num_nodes = num_nodes\nself.multiplier = multiplier\nself.layers = nn.ModuleList()\nfor i in range(self.num_nodes):\n for j in range(2 + i):\n stride = 2 if reduction and j < 2 else 1\n layer = Mix...
<|body_start_0|> super(Cell, self).__init__() self.reduction = reduction self.reduction_prev = reduction_prev self.num_nodes = num_nodes self.multiplier = multiplier self.layers = nn.ModuleList() for i in range(self.num_nodes): for j in range(2 + i): ...
Cell
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Cell: def __init__(self, num_nodes, multiplier, cpp, cp, c, reduction, reduction_prev): """:param steps: 4, number of layers inside a cell :param multiplier: 4 :param cpp: 48 :param cp: 48 :param c: 16 :param reduction: indicates whether to reduce the output maps width :param reduction_p...
stack_v2_sparse_classes_36k_train_028070
1,887
permissive
[ { "docstring": ":param steps: 4, number of layers inside a cell :param multiplier: 4 :param cpp: 48 :param cp: 48 :param c: 16 :param reduction: indicates whether to reduce the output maps width :param reduction_prev: when previous cell reduced width, s1_d = s0_d//2 in order to keep same shape between s1 and s0...
2
stack_v2_sparse_classes_30k_train_015937
Implement the Python class `Cell` described below. Class description: Implement the Cell class. Method signatures and docstrings: - def __init__(self, num_nodes, multiplier, cpp, cp, c, reduction, reduction_prev): :param steps: 4, number of layers inside a cell :param multiplier: 4 :param cpp: 48 :param cp: 48 :param...
Implement the Python class `Cell` described below. Class description: Implement the Cell class. Method signatures and docstrings: - def __init__(self, num_nodes, multiplier, cpp, cp, c, reduction, reduction_prev): :param steps: 4, number of layers inside a cell :param multiplier: 4 :param cpp: 48 :param cp: 48 :param...
f6a3da8818308c9edcd9fedbcf831dd5968efcdd
<|skeleton|> class Cell: def __init__(self, num_nodes, multiplier, cpp, cp, c, reduction, reduction_prev): """:param steps: 4, number of layers inside a cell :param multiplier: 4 :param cpp: 48 :param cp: 48 :param c: 16 :param reduction: indicates whether to reduce the output maps width :param reduction_p...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Cell: def __init__(self, num_nodes, multiplier, cpp, cp, c, reduction, reduction_prev): """:param steps: 4, number of layers inside a cell :param multiplier: 4 :param cpp: 48 :param cp: 48 :param c: 16 :param reduction: indicates whether to reduce the output maps width :param reduction_prev: when prev...
the_stack_v2_python_sparse
common/darts/modules/linear/cell.py
ECP-CANDLE/Benchmarks
train
65
f4d8b32220926433d2d1a23a2e1371ff284c648b
[ "super(PatchMerging, self).__init__()\nself.normalization: nn.Module = nn.LayerNorm(normalized_shape=4 * in_channels)\nself.linear_mapping: nn.Module = nn.Linear(in_features=4 * in_channels, out_features=2 * in_channels, bias=False)", "batch_size, channels, height, width = input.shape\ninput: torch.Tensor = bchw_...
<|body_start_0|> super(PatchMerging, self).__init__() self.normalization: nn.Module = nn.LayerNorm(normalized_shape=4 * in_channels) self.linear_mapping: nn.Module = nn.Linear(in_features=4 * in_channels, out_features=2 * in_channels, bias=False) <|end_body_0|> <|body_start_1|> batch_si...
This class implements the patch merging approach which is essential a strided convolution with normalization before
PatchMerging
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PatchMerging: """This class implements the patch merging approach which is essential a strided convolution with normalization before""" def __init__(self, in_channels: int) -> None: """Constructor method :param in_channels: (int) Number of input channels""" <|body_0|> de...
stack_v2_sparse_classes_36k_train_028071
41,159
no_license
[ { "docstring": "Constructor method :param in_channels: (int) Number of input channels", "name": "__init__", "signature": "def __init__(self, in_channels: int) -> None" }, { "docstring": "Forward pass :param input: (torch.Tensor) Input tensor of the shape [batch size, in channels, height, width] ...
2
stack_v2_sparse_classes_30k_train_007343
Implement the Python class `PatchMerging` described below. Class description: This class implements the patch merging approach which is essential a strided convolution with normalization before Method signatures and docstrings: - def __init__(self, in_channels: int) -> None: Constructor method :param in_channels: (in...
Implement the Python class `PatchMerging` described below. Class description: This class implements the patch merging approach which is essential a strided convolution with normalization before Method signatures and docstrings: - def __init__(self, in_channels: int) -> None: Constructor method :param in_channels: (in...
7e55a422588c1d1e00f35a3d3a3ff896cce59e18
<|skeleton|> class PatchMerging: """This class implements the patch merging approach which is essential a strided convolution with normalization before""" def __init__(self, in_channels: int) -> None: """Constructor method :param in_channels: (int) Number of input channels""" <|body_0|> de...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PatchMerging: """This class implements the patch merging approach which is essential a strided convolution with normalization before""" def __init__(self, in_channels: int) -> None: """Constructor method :param in_channels: (int) Number of input channels""" super(PatchMerging, self).__ini...
the_stack_v2_python_sparse
generated/test_ChristophReich1996_Swin_Transformer_V2.py
jansel/pytorch-jit-paritybench
train
35
4f63c3fac3e53319b2fe3e8ca84e76be02d7d6bd
[ "self.perms = perms\nself.reverse_filter = reverse_filter\nself.filter_param = filter_param\nself.require_all = require_all", "def wrapped_f(*args, **kwargs):\n request = args[0]\n if not request.user.is_authenticated:\n if not request.is_ajax():\n url = reverse('home') + '?next=%s' % requ...
<|body_start_0|> self.perms = perms self.reverse_filter = reverse_filter self.filter_param = filter_param self.require_all = require_all <|end_body_0|> <|body_start_1|> def wrapped_f(*args, **kwargs): request = args[0] if not request.user.is_authenticated...
generic_permission_decorator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class generic_permission_decorator: def __init__(self, perms, reverse_filter, filter_param, require_all=True): """If there are decorator arguments, the function to be decorated is not passed to the constructor!""" <|body_0|> def __call__(self, f): """If there are decorator...
stack_v2_sparse_classes_36k_train_028072
5,101
no_license
[ { "docstring": "If there are decorator arguments, the function to be decorated is not passed to the constructor!", "name": "__init__", "signature": "def __init__(self, perms, reverse_filter, filter_param, require_all=True)" }, { "docstring": "If there are decorator arguments, __call__() is only ...
2
stack_v2_sparse_classes_30k_train_018415
Implement the Python class `generic_permission_decorator` described below. Class description: Implement the generic_permission_decorator class. Method signatures and docstrings: - def __init__(self, perms, reverse_filter, filter_param, require_all=True): If there are decorator arguments, the function to be decorated ...
Implement the Python class `generic_permission_decorator` described below. Class description: Implement the generic_permission_decorator class. Method signatures and docstrings: - def __init__(self, perms, reverse_filter, filter_param, require_all=True): If there are decorator arguments, the function to be decorated ...
3862986f908e3d2dd4c4b9a485cd9ebfdcafcd1b
<|skeleton|> class generic_permission_decorator: def __init__(self, perms, reverse_filter, filter_param, require_all=True): """If there are decorator arguments, the function to be decorated is not passed to the constructor!""" <|body_0|> def __call__(self, f): """If there are decorator...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class generic_permission_decorator: def __init__(self, perms, reverse_filter, filter_param, require_all=True): """If there are decorator arguments, the function to be decorated is not passed to the constructor!""" self.perms = perms self.reverse_filter = reverse_filter self.filter_pa...
the_stack_v2_python_sparse
ezreg/decorators.py
amschaal/django-ezreg
train
5
258d4ca6708b129c3c5368422e04d5a5bfa7dd9d
[ "if not costs:\n return 0\nn = len(costs)\nk = len(costs[0])\ndp = [[0] * k for _ in range(n)]\ndp[0] = costs[0]\nfor i in range(1, n):\n for j in range(k):\n dp[i][j] = costs[i][j] + min((dp[i - 1][k] for k in range(k) if k != j))\nreturn min((dp[n - 1][j] for j in range(k)))", "n = len(costs)\nif n...
<|body_start_0|> if not costs: return 0 n = len(costs) k = len(costs[0]) dp = [[0] * k for _ in range(n)] dp[0] = costs[0] for i in range(1, n): for j in range(k): dp[i][j] = costs[i][j] + min((dp[i - 1][k] for k in range(k) if k !=...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def minCostII(self, costs): """:type costs: List[List[int]] :rtype: int""" <|body_0|> def minCostII(self, costs): """:type costs: List[List[int]] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not costs: return ...
stack_v2_sparse_classes_36k_train_028073
3,301
no_license
[ { "docstring": ":type costs: List[List[int]] :rtype: int", "name": "minCostII", "signature": "def minCostII(self, costs)" }, { "docstring": ":type costs: List[List[int]] :rtype: int", "name": "minCostII", "signature": "def minCostII(self, costs)" } ]
2
stack_v2_sparse_classes_30k_train_003954
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minCostII(self, costs): :type costs: List[List[int]] :rtype: int - def minCostII(self, costs): :type costs: List[List[int]] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minCostII(self, costs): :type costs: List[List[int]] :rtype: int - def minCostII(self, costs): :type costs: List[List[int]] :rtype: int <|skeleton|> class Solution: def...
d953abe2c9680f636563e76287d2f907e90ced63
<|skeleton|> class Solution: def minCostII(self, costs): """:type costs: List[List[int]] :rtype: int""" <|body_0|> def minCostII(self, costs): """:type costs: List[List[int]] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def minCostII(self, costs): """:type costs: List[List[int]] :rtype: int""" if not costs: return 0 n = len(costs) k = len(costs[0]) dp = [[0] * k for _ in range(n)] dp[0] = costs[0] for i in range(1, n): for j in range(k)...
the_stack_v2_python_sparse
python_leetcode_2020/Python_Leetcode_2020/265_paint_house.py
xiangcao/Leetcode
train
0
6e37b1348c1be40e545799b6bc4e433b804de5af
[ "self.__author__ = 'GodSaveTheDoge'\nself.selector = '#mw-content-text li , p'\nself.url = 'https://{}.wikipedia.org/wiki/{}'\nself.apiurl = 'https://en.wikipedia.org/w/api.php?action=query&titles={}&format=json'", "if '-1' in requests.get(self.apiurl.format(page)).json()['query']['pages']:\n return False\nret...
<|body_start_0|> self.__author__ = 'GodSaveTheDoge' self.selector = '#mw-content-text li , p' self.url = 'https://{}.wikipedia.org/wiki/{}' self.apiurl = 'https://en.wikipedia.org/w/api.php?action=query&titles={}&format=json' <|end_body_0|> <|body_start_1|> if '-1' in requests.g...
Wikipedia
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Wikipedia: def __init__(self) -> None: """You can use this class to look up a page on wikipedia""" <|body_0|> def exists(self, page: str) -> bool: """Check if a page exists :param page: url of the page :return:""" <|body_1|> def getpage(self, page: str, ...
stack_v2_sparse_classes_36k_train_028074
1,240
no_license
[ { "docstring": "You can use this class to look up a page on wikipedia", "name": "__init__", "signature": "def __init__(self) -> None" }, { "docstring": "Check if a page exists :param page: url of the page :return:", "name": "exists", "signature": "def exists(self, page: str) -> bool" }...
3
stack_v2_sparse_classes_30k_train_007428
Implement the Python class `Wikipedia` described below. Class description: Implement the Wikipedia class. Method signatures and docstrings: - def __init__(self) -> None: You can use this class to look up a page on wikipedia - def exists(self, page: str) -> bool: Check if a page exists :param page: url of the page :re...
Implement the Python class `Wikipedia` described below. Class description: Implement the Wikipedia class. Method signatures and docstrings: - def __init__(self) -> None: You can use this class to look up a page on wikipedia - def exists(self, page: str) -> bool: Check if a page exists :param page: url of the page :re...
cc0db796c5516b36e82ef6f70c5649902366df62
<|skeleton|> class Wikipedia: def __init__(self) -> None: """You can use this class to look up a page on wikipedia""" <|body_0|> def exists(self, page: str) -> bool: """Check if a page exists :param page: url of the page :return:""" <|body_1|> def getpage(self, page: str, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Wikipedia: def __init__(self) -> None: """You can use this class to look up a page on wikipedia""" self.__author__ = 'GodSaveTheDoge' self.selector = '#mw-content-text li , p' self.url = 'https://{}.wikipedia.org/wiki/{}' self.apiurl = 'https://en.wikipedia.org/w/api.ph...
the_stack_v2_python_sparse
methods/Wiki.py
ankit-sinha-18/MultiUserbot
train
0
15afe0eb8a932195d4ad132f5f13fa3d5c20229e
[ "self.name = 'runtime'\nsuper(RuntimeTable, self).__init__(results, best_results, options, group_dir, pp_locations, table_name)\nself.has_pp = True\nself.pp_filenames = [os.path.relpath(self.pp_locations[1], group_dir)]", "abs_value = {}\nrel_value = {}\nfor key, value in results_dict.items():\n abs_value[key]...
<|body_start_0|> self.name = 'runtime' super(RuntimeTable, self).__init__(results, best_results, options, group_dir, pp_locations, table_name) self.has_pp = True self.pp_filenames = [os.path.relpath(self.pp_locations[1], group_dir)] <|end_body_0|> <|body_start_1|> abs_value = {}...
The timing results are calculated from an average using the `timeit <https://docs.python.org/2/library/timeit.html>`_ module in python. The number of runtimes can be set in :ref:`options`.
RuntimeTable
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RuntimeTable: """The timing results are calculated from an average using the `timeit <https://docs.python.org/2/library/timeit.html>`_ module in python. The number of runtimes can be set in :ref:`options`.""" def __init__(self, results, best_results, options, group_dir, pp_locations, table_n...
stack_v2_sparse_classes_36k_train_028075
2,532
permissive
[ { "docstring": "Initialise the runtime table which shows the average runtime results :param results: results nested array of objects :type results: list of list of fitbenchmarking.utils.fitbm_result.FittingResult :param best_results: best result for each problem :type best_results: list of fitbenchmarking.utils...
2
stack_v2_sparse_classes_30k_train_020236
Implement the Python class `RuntimeTable` described below. Class description: The timing results are calculated from an average using the `timeit <https://docs.python.org/2/library/timeit.html>`_ module in python. The number of runtimes can be set in :ref:`options`. Method signatures and docstrings: - def __init__(se...
Implement the Python class `RuntimeTable` described below. Class description: The timing results are calculated from an average using the `timeit <https://docs.python.org/2/library/timeit.html>`_ module in python. The number of runtimes can be set in :ref:`options`. Method signatures and docstrings: - def __init__(se...
edae46c0361568bc537de2425d603e7b271eabe7
<|skeleton|> class RuntimeTable: """The timing results are calculated from an average using the `timeit <https://docs.python.org/2/library/timeit.html>`_ module in python. The number of runtimes can be set in :ref:`options`.""" def __init__(self, results, best_results, options, group_dir, pp_locations, table_n...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RuntimeTable: """The timing results are calculated from an average using the `timeit <https://docs.python.org/2/library/timeit.html>`_ module in python. The number of runtimes can be set in :ref:`options`.""" def __init__(self, results, best_results, options, group_dir, pp_locations, table_name): ...
the_stack_v2_python_sparse
fitbenchmarking/results_processing/runtime_table.py
dsotiropoulos/fitbenchmarking
train
0
3ff7f330123f71e7f7aef30cd8cc0712cb1a2cea
[ "self.source_view_id = source_view_id\nself.use_same_view_name = use_same_view_name\nself.view_name = view_name", "if dictionary is None:\n return None\nsource_view_id = dictionary.get('sourceViewId')\nuse_same_view_name = dictionary.get('useSameViewName')\nview_name = dictionary.get('viewName')\nreturn cls(so...
<|body_start_0|> self.source_view_id = source_view_id self.use_same_view_name = use_same_view_name self.view_name = view_name <|end_body_0|> <|body_start_1|> if dictionary is None: return None source_view_id = dictionary.get('sourceViewId') use_same_view_name...
Implementation of the 'RemoteViewConfig' model. Specifies the remote view config for a view protected in a view job. This field is only used when the view job has a replication policy. Attributes: source_view_id (long|int): Specifies the view Id of the view protected by the view protection job. use_same_view_name (bool...
RemoteViewConfig
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RemoteViewConfig: """Implementation of the 'RemoteViewConfig' model. Specifies the remote view config for a view protected in a view job. This field is only used when the view job has a replication policy. Attributes: source_view_id (long|int): Specifies the view Id of the view protected by the v...
stack_v2_sparse_classes_36k_train_028076
2,406
permissive
[ { "docstring": "Constructor for the RemoteViewConfig class", "name": "__init__", "signature": "def __init__(self, source_view_id=None, use_same_view_name=None, view_name=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary repr...
2
null
Implement the Python class `RemoteViewConfig` described below. Class description: Implementation of the 'RemoteViewConfig' model. Specifies the remote view config for a view protected in a view job. This field is only used when the view job has a replication policy. Attributes: source_view_id (long|int): Specifies the...
Implement the Python class `RemoteViewConfig` described below. Class description: Implementation of the 'RemoteViewConfig' model. Specifies the remote view config for a view protected in a view job. This field is only used when the view job has a replication policy. Attributes: source_view_id (long|int): Specifies the...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class RemoteViewConfig: """Implementation of the 'RemoteViewConfig' model. Specifies the remote view config for a view protected in a view job. This field is only used when the view job has a replication policy. Attributes: source_view_id (long|int): Specifies the view Id of the view protected by the v...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RemoteViewConfig: """Implementation of the 'RemoteViewConfig' model. Specifies the remote view config for a view protected in a view job. This field is only used when the view job has a replication policy. Attributes: source_view_id (long|int): Specifies the view Id of the view protected by the view protectio...
the_stack_v2_python_sparse
cohesity_management_sdk/models/remote_view_config.py
cohesity/management-sdk-python
train
24
92de31b90bc9be51484fb47937c498d945e2746d
[ "client = get_client(client_id)\nif client.status == 'deleted':\n abort(http_client.NOT_FOUND)\nreturn client", "client = get_client(client_id)\nnow = utcnow()\nheartbeat_period = current_app.config.get('heartbeat_period', DEFAULT_HEARTBEAT_PERIOD)\nheartbeat_timeout = current_app.config.get('heartbeat_timeout...
<|body_start_0|> client = get_client(client_id) if client.status == 'deleted': abort(http_client.NOT_FOUND) return client <|end_body_0|> <|body_start_1|> client = get_client(client_id) now = utcnow() heartbeat_period = current_app.config.get('heartbeat_period...
Client API. This is used by the game clients to register themselves as connected-to-the-backend and to heartbeat to let the backend know that they are still connected.
ClientAPI
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClientAPI: """Client API. This is used by the game clients to register themselves as connected-to-the-backend and to heartbeat to let the backend know that they are still connected.""" def get(self, client_id): """Find client by ID Get information about a single client. Just dumps ou...
stack_v2_sparse_classes_36k_train_028077
13,103
permissive
[ { "docstring": "Find client by ID Get information about a single client. Just dumps out the DB row as json", "name": "get", "signature": "def get(self, client_id)" }, { "docstring": "Client heartbeat Heartbeat for client registration.", "name": "put", "signature": "def put(self, client_i...
3
null
Implement the Python class `ClientAPI` described below. Class description: Client API. This is used by the game clients to register themselves as connected-to-the-backend and to heartbeat to let the backend know that they are still connected. Method signatures and docstrings: - def get(self, client_id): Find client b...
Implement the Python class `ClientAPI` described below. Class description: Client API. This is used by the game clients to register themselves as connected-to-the-backend and to heartbeat to let the backend know that they are still connected. Method signatures and docstrings: - def get(self, client_id): Find client b...
9825cb22b26b577b715f2ce95453363bf90ecc7e
<|skeleton|> class ClientAPI: """Client API. This is used by the game clients to register themselves as connected-to-the-backend and to heartbeat to let the backend know that they are still connected.""" def get(self, client_id): """Find client by ID Get information about a single client. Just dumps ou...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ClientAPI: """Client API. This is used by the game clients to register themselves as connected-to-the-backend and to heartbeat to let the backend know that they are still connected.""" def get(self, client_id): """Find client by ID Get information about a single client. Just dumps out the DB row ...
the_stack_v2_python_sparse
driftbase/api/clients.py
dgnorth/drift-base
train
1
204168768d426654543e79e1a369e672217912de
[ "super().__init__(*args, **kwargs)\nif kwargs.get('initial', {}).get('provision', False):\n self.fields['username'].required = False\n self.fields['password'].required = False", "if self.cleaned_data.get('provision'):\n return self.cleaned_data\nelse:\n return super(SAMLLinkUserForm, self).clean()" ]
<|body_start_0|> super().__init__(*args, **kwargs) if kwargs.get('initial', {}).get('provision', False): self.fields['username'].required = False self.fields['password'].required = False <|end_body_0|> <|body_start_1|> if self.cleaned_data.get('provision'): r...
Form for linking existing user accounts after SAML authentication. Version Added: 5.0
SAMLLinkUserForm
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SAMLLinkUserForm: """Form for linking existing user accounts after SAML authentication. Version Added: 5.0""" def __init__(self, *args, **kwargs): """Initialize the form. Args: *args (tuple): Positional arguments to pass through to the parent class. **kwargs (dict): Keyword arguments...
stack_v2_sparse_classes_36k_train_028078
7,428
permissive
[ { "docstring": "Initialize the form. Args: *args (tuple): Positional arguments to pass through to the parent class. **kwargs (dict): Keyword arguments to pass through to the parent class.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Run validation o...
2
null
Implement the Python class `SAMLLinkUserForm` described below. Class description: Form for linking existing user accounts after SAML authentication. Version Added: 5.0 Method signatures and docstrings: - def __init__(self, *args, **kwargs): Initialize the form. Args: *args (tuple): Positional arguments to pass throug...
Implement the Python class `SAMLLinkUserForm` described below. Class description: Form for linking existing user accounts after SAML authentication. Version Added: 5.0 Method signatures and docstrings: - def __init__(self, *args, **kwargs): Initialize the form. Args: *args (tuple): Positional arguments to pass throug...
c3a991f1e9d7682239a1ab0e8661cee6da01d537
<|skeleton|> class SAMLLinkUserForm: """Form for linking existing user accounts after SAML authentication. Version Added: 5.0""" def __init__(self, *args, **kwargs): """Initialize the form. Args: *args (tuple): Positional arguments to pass through to the parent class. **kwargs (dict): Keyword arguments...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SAMLLinkUserForm: """Form for linking existing user accounts after SAML authentication. Version Added: 5.0""" def __init__(self, *args, **kwargs): """Initialize the form. Args: *args (tuple): Positional arguments to pass through to the parent class. **kwargs (dict): Keyword arguments to pass thro...
the_stack_v2_python_sparse
reviewboard/accounts/sso/backends/saml/forms.py
reviewboard/reviewboard
train
1,141
9ca075134549cf6f023d31e33da5331a65ec296a
[ "res = []\n\ndef pre_order(root):\n if not root:\n return None\n res.append(root.val)\n pre_order(root.left)\n pre_order(root.right)\npre_order(root)\nreturn ' '.join(map(str, res))", "res = deque((int(v) for v in data.split()))\n\ndef build(low_bound, high_bound):\n if res and low_bound < r...
<|body_start_0|> res = [] def pre_order(root): if not root: return None res.append(root.val) pre_order(root.left) pre_order(root.right) pre_order(root) return ' '.join(map(str, res)) <|end_body_0|> <|body_start_1|> ...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_028079
1,292
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
stack_v2_sparse_classes_30k_train_002086
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
ba6b2500b86489cc34852ff73ba0915e57aa0275
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" res = [] def pre_order(root): if not root: return None res.append(root.val) pre_order(root.left) pre_order(root.r...
the_stack_v2_python_sparse
algo/first/p449_serialize_and_deserialize_bst.py
thinkreed/lc.py
train
3
9256aaf71d39a729fad56dae23f3920f04d663f4
[ "if ledger_api.identifier == EthereumApi.identifier:\n nonce = ledger_api.api.eth.getTransactionCount(oracle_address)\n instance = cls.get_instance(ledger_api, contract_address)\n oracle_role = keccak256(ORACLE_ROLE.encode('utf-8'))\n tx = instance.functions.grantRole(oracle_role, oracle_address).buildT...
<|body_start_0|> if ledger_api.identifier == EthereumApi.identifier: nonce = ledger_api.api.eth.getTransactionCount(oracle_address) instance = cls.get_instance(ledger_api, contract_address) oracle_role = keccak256(ORACLE_ROLE.encode('utf-8')) tx = instance.functio...
The Fetch oracle contract.
FetchOracleContract
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FetchOracleContract: """The Fetch oracle contract.""" def get_grant_role_transaction(cls, ledger_api: LedgerApi, contract_address: Address, oracle_address: Address, gas: int=0, tx_fee: int=0) -> JSONLike: """Get transaction to grant oracle role to recipient_address :param ledger_api:...
stack_v2_sparse_classes_36k_train_028080
5,228
permissive
[ { "docstring": "Get transaction to grant oracle role to recipient_address :param ledger_api: the ledger API :param contract_address: the contract address :param oracle_address: the address of the oracle :param gas: the gas limit :param tx_fee: the transaction fee :return: the transaction object", "name": "g...
2
null
Implement the Python class `FetchOracleContract` described below. Class description: The Fetch oracle contract. Method signatures and docstrings: - def get_grant_role_transaction(cls, ledger_api: LedgerApi, contract_address: Address, oracle_address: Address, gas: int=0, tx_fee: int=0) -> JSONLike: Get transaction to ...
Implement the Python class `FetchOracleContract` described below. Class description: The Fetch oracle contract. Method signatures and docstrings: - def get_grant_role_transaction(cls, ledger_api: LedgerApi, contract_address: Address, oracle_address: Address, gas: int=0, tx_fee: int=0) -> JSONLike: Get transaction to ...
bec49adaeba661d8d0f03ac9935dc89f39d95a0d
<|skeleton|> class FetchOracleContract: """The Fetch oracle contract.""" def get_grant_role_transaction(cls, ledger_api: LedgerApi, contract_address: Address, oracle_address: Address, gas: int=0, tx_fee: int=0) -> JSONLike: """Get transaction to grant oracle role to recipient_address :param ledger_api:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FetchOracleContract: """The Fetch oracle contract.""" def get_grant_role_transaction(cls, ledger_api: LedgerApi, contract_address: Address, oracle_address: Address, gas: int=0, tx_fee: int=0) -> JSONLike: """Get transaction to grant oracle role to recipient_address :param ledger_api: the ledger A...
the_stack_v2_python_sparse
packages/fetchai/contracts/oracle/contract.py
fetchai/agents-aea
train
192
3ce597e3152c1182e3141e2370e04f1e61f2f2ad
[ "super(MessagePassing, self).__init__(options, is_training)\nif not isinstance(options, graph_network_pb2.MessagePassing):\n raise ValueError('Options has to be an MessagePassing proto.')\nself.use_reverse_edges = options.use_reverse_edges\nself.add_bi_directional_edges = options.add_bi_directional_edges\nself.a...
<|body_start_0|> super(MessagePassing, self).__init__(options, is_training) if not isinstance(options, graph_network_pb2.MessagePassing): raise ValueError('Options has to be an MessagePassing proto.') self.use_reverse_edges = options.use_reverse_edges self.add_bi_directional_...
Self attention model using a RNN cell.
MessagePassing
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MessagePassing: """Self attention model using a RNN cell.""" def __init__(self, options, is_training=False): """Initializes the graph network. Args: options: proto to store the configs. is_training: if True, build the training graph.""" <|body_0|> def _build_graph(self, ...
stack_v2_sparse_classes_36k_train_028081
18,418
permissive
[ { "docstring": "Initializes the graph network. Args: options: proto to store the configs. is_training: if True, build the training graph.", "name": "__init__", "signature": "def __init__(self, options, is_training=False)" }, { "docstring": "Builds graph network. Args: graphs_tuple: A GraphTuple ...
2
stack_v2_sparse_classes_30k_train_001047
Implement the Python class `MessagePassing` described below. Class description: Self attention model using a RNN cell. Method signatures and docstrings: - def __init__(self, options, is_training=False): Initializes the graph network. Args: options: proto to store the configs. is_training: if True, build the training ...
Implement the Python class `MessagePassing` described below. Class description: Self attention model using a RNN cell. Method signatures and docstrings: - def __init__(self, options, is_training=False): Initializes the graph network. Args: options: proto to store the configs. is_training: if True, build the training ...
4d20dadffe7584ac2c7f26419960512380b8d06e
<|skeleton|> class MessagePassing: """Self attention model using a RNN cell.""" def __init__(self, options, is_training=False): """Initializes the graph network. Args: options: proto to store the configs. is_training: if True, build the training graph.""" <|body_0|> def _build_graph(self, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MessagePassing: """Self attention model using a RNN cell.""" def __init__(self, options, is_training=False): """Initializes the graph network. Args: options: proto to store the configs. is_training: if True, build the training graph.""" super(MessagePassing, self).__init__(options, is_tra...
the_stack_v2_python_sparse
modeling/modules/graph_networks.py
yekeren/WSSGG
train
40
8fed59678ddeabe8b7060bdccc4745817cd442ab
[ "self.expression_data = expression_data\nself.calculator = calculator\nself.rm_outliers = rm_outliers", "data = None\nif isinstance(measurments, dict):\n data = measurments\n measurments = list(measurments.values())\nmeasurments = np.array(measurments)\nupper_quartile = np.percentile(measurments, 75)\nlower...
<|body_start_0|> self.expression_data = expression_data self.calculator = calculator self.rm_outliers = rm_outliers <|end_body_0|> <|body_start_1|> data = None if isinstance(measurments, dict): data = measurments measurments = list(measurments.values()) ...
Base class for navigation of similarity calculation between specified genes.
SimilarityCalculatorNavigator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SimilarityCalculatorNavigator: """Base class for navigation of similarity calculation between specified genes.""" def __init__(self, expression_data: GeneExpression, calculator: SimilarityCalculator, rm_outliers: bool=True): """:param expression_data: Data for all genes :param calcul...
stack_v2_sparse_classes_36k_train_028082
43,977
no_license
[ { "docstring": ":param expression_data: Data for all genes :param calculator: SimilarityCalculator used in all calculations :param rm_outliers: should outliers be removed before similarity statistics calculation", "name": "__init__", "signature": "def __init__(self, expression_data: GeneExpression, calc...
2
stack_v2_sparse_classes_30k_train_016497
Implement the Python class `SimilarityCalculatorNavigator` described below. Class description: Base class for navigation of similarity calculation between specified genes. Method signatures and docstrings: - def __init__(self, expression_data: GeneExpression, calculator: SimilarityCalculator, rm_outliers: bool=True):...
Implement the Python class `SimilarityCalculatorNavigator` described below. Class description: Base class for navigation of similarity calculation between specified genes. Method signatures and docstrings: - def __init__(self, expression_data: GeneExpression, calculator: SimilarityCalculator, rm_outliers: bool=True):...
6d11df5e8ca37e53e048d261ac287f859ba6e9b9
<|skeleton|> class SimilarityCalculatorNavigator: """Base class for navigation of similarity calculation between specified genes.""" def __init__(self, expression_data: GeneExpression, calculator: SimilarityCalculator, rm_outliers: bool=True): """:param expression_data: Data for all genes :param calcul...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SimilarityCalculatorNavigator: """Base class for navigation of similarity calculation between specified genes.""" def __init__(self, expression_data: GeneExpression, calculator: SimilarityCalculator, rm_outliers: bool=True): """:param expression_data: Data for all genes :param calculator: Similar...
the_stack_v2_python_sparse
correlation_enrichment/library_correlation_enrichment.py
biolab/baylor-dicty
train
0
bf39ff7a8923716007dba8836708fa272d543c38
[ "this = cls()\nfor key, value in data.items():\n this[key] = [val['value'] for val in value]\nreturn this", "norm_data = {}\nfor key, values in data.items():\n if isinstance(values, list):\n strings = []\n for value in values:\n if isinstance(value, str):\n strings.ap...
<|body_start_0|> this = cls() for key, value in data.items(): this[key] = [val['value'] for val in value] return this <|end_body_0|> <|body_start_1|> norm_data = {} for key, values in data.items(): if isinstance(values, list): strings = []...
A structure holding aliases for a Wikibase entity. It is a mapping from a language to a list of strings.
AliasesDict
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AliasesDict: """A structure holding aliases for a Wikibase entity. It is a mapping from a language to a list of strings.""" def fromJSON(cls, data, repo=None): """Construct a new AliasesDict from JSON.""" <|body_0|> def normalizeData(cls, data: dict) -> dict: """...
stack_v2_sparse_classes_36k_train_028083
18,327
permissive
[ { "docstring": "Construct a new AliasesDict from JSON.", "name": "fromJSON", "signature": "def fromJSON(cls, data, repo=None)" }, { "docstring": "Helper function to expand data into the Wikibase API structure. .. versionchanged:: 7.7 raises TypeError if *data* value is not a list. :param data: D...
3
null
Implement the Python class `AliasesDict` described below. Class description: A structure holding aliases for a Wikibase entity. It is a mapping from a language to a list of strings. Method signatures and docstrings: - def fromJSON(cls, data, repo=None): Construct a new AliasesDict from JSON. - def normalizeData(cls, ...
Implement the Python class `AliasesDict` described below. Class description: A structure holding aliases for a Wikibase entity. It is a mapping from a language to a list of strings. Method signatures and docstrings: - def fromJSON(cls, data, repo=None): Construct a new AliasesDict from JSON. - def normalizeData(cls, ...
5c01e6bfcd328bc6eae643e661f1a0ae57612808
<|skeleton|> class AliasesDict: """A structure holding aliases for a Wikibase entity. It is a mapping from a language to a list of strings.""" def fromJSON(cls, data, repo=None): """Construct a new AliasesDict from JSON.""" <|body_0|> def normalizeData(cls, data: dict) -> dict: """...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AliasesDict: """A structure holding aliases for a Wikibase entity. It is a mapping from a language to a list of strings.""" def fromJSON(cls, data, repo=None): """Construct a new AliasesDict from JSON.""" this = cls() for key, value in data.items(): this[key] = [val['v...
the_stack_v2_python_sparse
pywikibot/page/_collections.py
wikimedia/pywikibot
train
432
97b2ba3de09fe1975cbba11a4e8bc609f6a23c5f
[ "self.max_atoms = max_atoms\nself.flatten = flatten\nself.scm: Any = None", "if 'struct' in kwargs and datapoint is None:\n datapoint = kwargs.get('struct')\n raise DeprecationWarning('Struct is being phased out as a parameter, please pass \"datapoint\" instead.')\nif self.scm is None:\n try:\n fr...
<|body_start_0|> self.max_atoms = max_atoms self.flatten = flatten self.scm: Any = None <|end_body_0|> <|body_start_1|> if 'struct' in kwargs and datapoint is None: datapoint = kwargs.get('struct') raise DeprecationWarning('Struct is being phased out as a paramet...
Calculate sine Coulomb matrix for crystals. A variant of Coulomb matrix for periodic crystals. The sine Coulomb matrix is identical to the Coulomb matrix, except that the inverse distance function is replaced by the inverse of sin**2 of the vector between sites which are periodic in the dimensions of the crystal lattic...
SineCoulombMatrix
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SineCoulombMatrix: """Calculate sine Coulomb matrix for crystals. A variant of Coulomb matrix for periodic crystals. The sine Coulomb matrix is identical to the Coulomb matrix, except that the inverse distance function is replaced by the inverse of sin**2 of the vector between sites which are per...
stack_v2_sparse_classes_36k_train_028084
3,823
permissive
[ { "docstring": "Parameters ---------- max_atoms: int (default 100) Maximum number of atoms for any crystal in the dataset. Used to pad the Coulomb matrix. flatten: bool (default True) Return flattened vector of matrix eigenvalues.", "name": "__init__", "signature": "def __init__(self, max_atoms: int=100...
2
stack_v2_sparse_classes_30k_train_005725
Implement the Python class `SineCoulombMatrix` described below. Class description: Calculate sine Coulomb matrix for crystals. A variant of Coulomb matrix for periodic crystals. The sine Coulomb matrix is identical to the Coulomb matrix, except that the inverse distance function is replaced by the inverse of sin**2 of...
Implement the Python class `SineCoulombMatrix` described below. Class description: Calculate sine Coulomb matrix for crystals. A variant of Coulomb matrix for periodic crystals. The sine Coulomb matrix is identical to the Coulomb matrix, except that the inverse distance function is replaced by the inverse of sin**2 of...
ee6e67ebcf7bf04259cf13aff6388e2b791fea3d
<|skeleton|> class SineCoulombMatrix: """Calculate sine Coulomb matrix for crystals. A variant of Coulomb matrix for periodic crystals. The sine Coulomb matrix is identical to the Coulomb matrix, except that the inverse distance function is replaced by the inverse of sin**2 of the vector between sites which are per...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SineCoulombMatrix: """Calculate sine Coulomb matrix for crystals. A variant of Coulomb matrix for periodic crystals. The sine Coulomb matrix is identical to the Coulomb matrix, except that the inverse distance function is replaced by the inverse of sin**2 of the vector between sites which are periodic in the ...
the_stack_v2_python_sparse
deepchem/feat/material_featurizers/sine_coulomb_matrix.py
deepchem/deepchem
train
4,876
35aab647286e2fe337274fd92a4fbd27d61f91ed
[ "self.telephone = [(), ('*',), ('a', 'b', 'c'), ('d', 'e', 'f'), ('g', 'h', 'i'), ('j', 'k', 'l'), ('m', 'n', 'o'), ('p', 'q', 'r', 's'), ('t', 'u', 'v'), ('w', 'x', 'y', 'z')]\nif len(digits) == 0:\n return []\nelif len(digits) == 1:\n return list(self.telephone[int(digits[0])])\nelse:\n return self.dfs(0...
<|body_start_0|> self.telephone = [(), ('*',), ('a', 'b', 'c'), ('d', 'e', 'f'), ('g', 'h', 'i'), ('j', 'k', 'l'), ('m', 'n', 'o'), ('p', 'q', 'r', 's'), ('t', 'u', 'v'), ('w', 'x', 'y', 'z')] if len(digits) == 0: return [] elif len(digits) == 1: return list(self.telephon...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def letterCombinations(self, digits): """:type digits: str :rtype: List[str]""" <|body_0|> def dfs(self, i, digits): """:type i: int :type digits: str""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.telephone = [(), ('*',), ('a', 'b',...
stack_v2_sparse_classes_36k_train_028085
1,585
no_license
[ { "docstring": ":type digits: str :rtype: List[str]", "name": "letterCombinations", "signature": "def letterCombinations(self, digits)" }, { "docstring": ":type i: int :type digits: str", "name": "dfs", "signature": "def dfs(self, i, digits)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def letterCombinations(self, digits): :type digits: str :rtype: List[str] - def dfs(self, i, digits): :type i: int :type digits: str
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def letterCombinations(self, digits): :type digits: str :rtype: List[str] - def dfs(self, i, digits): :type i: int :type digits: str <|skeleton|> class Solution: def letter...
f832227c4d0e0b1c0cc326561187004ef24e2a68
<|skeleton|> class Solution: def letterCombinations(self, digits): """:type digits: str :rtype: List[str]""" <|body_0|> def dfs(self, i, digits): """:type i: int :type digits: str""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def letterCombinations(self, digits): """:type digits: str :rtype: List[str]""" self.telephone = [(), ('*',), ('a', 'b', 'c'), ('d', 'e', 'f'), ('g', 'h', 'i'), ('j', 'k', 'l'), ('m', 'n', 'o'), ('p', 'q', 'r', 's'), ('t', 'u', 'v'), ('w', 'x', 'y', 'z')] if len(digits) == 0:...
the_stack_v2_python_sparse
17.py
Gackle/leetcode_practice
train
0
0d74c185629f7b137635e2be126a5fdb46c83b73
[ "model = from_state.apps.get_model(app_label, self.name)\nif self.allow_migrate_model(schema_editor.connection.alias, model):\n schema_editor.delete_materialized_view_model(model)", "model = to_state.apps.get_model(app_label, self.name)\nif self.allow_migrate_model(schema_editor.connection.alias, model):\n ...
<|body_start_0|> model = from_state.apps.get_model(app_label, self.name) if self.allow_migrate_model(schema_editor.connection.alias, model): schema_editor.delete_materialized_view_model(model) <|end_body_0|> <|body_start_1|> model = to_state.apps.get_model(app_label, self.name) ...
Deletes the specified materialized view model.
PostgresDeleteMaterializedViewModel
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PostgresDeleteMaterializedViewModel: """Deletes the specified materialized view model.""" def database_forwards(self, app_label, schema_editor, from_state, to_state): """Apply this migration operation forwards.""" <|body_0|> def database_backwards(self, app_label, schema...
stack_v2_sparse_classes_36k_train_028086
1,116
permissive
[ { "docstring": "Apply this migration operation forwards.", "name": "database_forwards", "signature": "def database_forwards(self, app_label, schema_editor, from_state, to_state)" }, { "docstring": "Apply this migration operation backwards.", "name": "database_backwards", "signature": "de...
3
stack_v2_sparse_classes_30k_val_000492
Implement the Python class `PostgresDeleteMaterializedViewModel` described below. Class description: Deletes the specified materialized view model. Method signatures and docstrings: - def database_forwards(self, app_label, schema_editor, from_state, to_state): Apply this migration operation forwards. - def database_b...
Implement the Python class `PostgresDeleteMaterializedViewModel` described below. Class description: Deletes the specified materialized view model. Method signatures and docstrings: - def database_forwards(self, app_label, schema_editor, from_state, to_state): Apply this migration operation forwards. - def database_b...
e5503cb3f3c1b7959bd55253d3a79296f4c8f0ef
<|skeleton|> class PostgresDeleteMaterializedViewModel: """Deletes the specified materialized view model.""" def database_forwards(self, app_label, schema_editor, from_state, to_state): """Apply this migration operation forwards.""" <|body_0|> def database_backwards(self, app_label, schema...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PostgresDeleteMaterializedViewModel: """Deletes the specified materialized view model.""" def database_forwards(self, app_label, schema_editor, from_state, to_state): """Apply this migration operation forwards.""" model = from_state.apps.get_model(app_label, self.name) if self.all...
the_stack_v2_python_sparse
psqlextra/backend/migrations/operations/delete_materialized_view_model.py
SectorLabs/django-postgres-extra
train
645
019a7ca02bfe5ca7c1893edeebaa1e3d50302e42
[ "config = check_config(config, catalogue.data)\nobsmax, obsmaxsig = _get_observed_mmax(catalogue.data, config)\nmmin = config['input_mmin']\nbeta = config['b-value'] * np.log(10.0)\nneq, mmin = _get_magnitude_vector_properties(catalogue.data, config)\nmmax = np.copy(obsmax)\nd_t = np.inf\niterator = 0\nprint(mmin, ...
<|body_start_0|> config = check_config(config, catalogue.data) obsmax, obsmaxsig = _get_observed_mmax(catalogue.data, config) mmin = config['input_mmin'] beta = config['b-value'] * np.log(10.0) neq, mmin = _get_magnitude_vector_properties(catalogue.data, config) mmax = np...
Implements Kijko and Sellevol estimator for maximim magnitude assuming a fixed b-value. Coded from description in Kijko (2004): Kijko, A. (2004), ..., Pure & Applied Geophysics,
KijkoSellevolFixedb
[ "AGPL-3.0-only", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KijkoSellevolFixedb: """Implements Kijko and Sellevol estimator for maximim magnitude assuming a fixed b-value. Coded from description in Kijko (2004): Kijko, A. (2004), ..., Pure & Applied Geophysics,""" def get_mmax(self, catalogue, config): """Calculates Maximum magnitude :param c...
stack_v2_sparse_classes_36k_train_028087
6,333
permissive
[ { "docstring": "Calculates Maximum magnitude :param catalogue: Earthquake catalogue as instance of :class: openquake.hmtk.seismicity.catalogue.Catalogue :param dict config: Configuration file for algorithm, contains the attributes: * 'b-value': b-value (positive float) * 'input_mmin': Minimum magnitude for inte...
2
stack_v2_sparse_classes_30k_train_011699
Implement the Python class `KijkoSellevolFixedb` described below. Class description: Implements Kijko and Sellevol estimator for maximim magnitude assuming a fixed b-value. Coded from description in Kijko (2004): Kijko, A. (2004), ..., Pure & Applied Geophysics, Method signatures and docstrings: - def get_mmax(self, ...
Implement the Python class `KijkoSellevolFixedb` described below. Class description: Implements Kijko and Sellevol estimator for maximim magnitude assuming a fixed b-value. Coded from description in Kijko (2004): Kijko, A. (2004), ..., Pure & Applied Geophysics, Method signatures and docstrings: - def get_mmax(self, ...
0da9ba5a575360081715e8b90c71d4b16c6687c8
<|skeleton|> class KijkoSellevolFixedb: """Implements Kijko and Sellevol estimator for maximim magnitude assuming a fixed b-value. Coded from description in Kijko (2004): Kijko, A. (2004), ..., Pure & Applied Geophysics,""" def get_mmax(self, catalogue, config): """Calculates Maximum magnitude :param c...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KijkoSellevolFixedb: """Implements Kijko and Sellevol estimator for maximim magnitude assuming a fixed b-value. Coded from description in Kijko (2004): Kijko, A. (2004), ..., Pure & Applied Geophysics,""" def get_mmax(self, catalogue, config): """Calculates Maximum magnitude :param catalogue: Ear...
the_stack_v2_python_sparse
openquake/hmtk/seismicity/max_magnitude/kijko_sellevol_fixed_b.py
GFZ-Centre-for-Early-Warning/shakyground
train
1
ee2408bf1306adf0bfd8ff0824bb9d4f08e60d39
[ "word_exists = set(words)\nlen_words = sorted([(-len(w), w) for w in words])\nfor l, w in len_words:\n if all((w[:i + 1] in word_exists for i in range(-l - 1))):\n return w\nreturn ''", "max_len, res_w = (0, '')\nword_exists = set(words)\nfor w in word_exists:\n cond = True\n for i in range(len(w)...
<|body_start_0|> word_exists = set(words) len_words = sorted([(-len(w), w) for w in words]) for l, w in len_words: if all((w[:i + 1] in word_exists for i in range(-l - 1))): return w return '' <|end_body_0|> <|body_start_1|> max_len, res_w = (0, '') ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longestWord_generator(self, words): """:type words: List[str] :rtype: str""" <|body_0|> def longestWord(self, words): """:type words: List[str] :rtype: str""" <|body_1|> <|end_skeleton|> <|body_start_0|> word_exists = set(words) ...
stack_v2_sparse_classes_36k_train_028088
1,517
no_license
[ { "docstring": ":type words: List[str] :rtype: str", "name": "longestWord_generator", "signature": "def longestWord_generator(self, words)" }, { "docstring": ":type words: List[str] :rtype: str", "name": "longestWord", "signature": "def longestWord(self, words)" } ]
2
stack_v2_sparse_classes_30k_train_008546
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestWord_generator(self, words): :type words: List[str] :rtype: str - def longestWord(self, words): :type words: List[str] :rtype: str
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestWord_generator(self, words): :type words: List[str] :rtype: str - def longestWord(self, words): :type words: List[str] :rtype: str <|skeleton|> class Solution: d...
b3a2013d1c3c7a5a16727dbc2ecbc934a01a3979
<|skeleton|> class Solution: def longestWord_generator(self, words): """:type words: List[str] :rtype: str""" <|body_0|> def longestWord(self, words): """:type words: List[str] :rtype: str""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def longestWord_generator(self, words): """:type words: List[str] :rtype: str""" word_exists = set(words) len_words = sorted([(-len(w), w) for w in words]) for l, w in len_words: if all((w[:i + 1] in word_exists for i in range(-l - 1))): re...
the_stack_v2_python_sparse
LeetcodePython/LongestWordinDictionary720.py
DianaLuca/Algorithms
train
1
b377908820641d4aed3e4e8637c0843966ef90ab
[ "logging.debug('Server started')\nself.__host = '127.0.0.1'\nself.__port = 65432\nthread = threading.Thread(target=self.run, args=())\nthread.daemon = True\nthread.start()", "logging.debug('Starting Reaper Com Server')\nwith socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n s.bind((self.__host, self.__...
<|body_start_0|> logging.debug('Server started') self.__host = '127.0.0.1' self.__port = 65432 thread = threading.Thread(target=self.run, args=()) thread.daemon = True thread.start() <|end_body_0|> <|body_start_1|> logging.debug('Starting Reaper Com Server') ...
reaper_server. TCP/IP server waiting for commands from Reaper Methods ------- init: init class run: start server and wait for messages Properties ---------- host: host address port: TCP port to listen
reaper_server
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class reaper_server: """reaper_server. TCP/IP server waiting for commands from Reaper Methods ------- init: init class run: start server and wait for messages Properties ---------- host: host address port: TCP port to listen""" def __init__(self): """Init. Set TCP settings in class""" ...
stack_v2_sparse_classes_36k_train_028089
2,320
permissive
[ { "docstring": "Init. Set TCP settings in class", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Run. Run server", "name": "run", "signature": "def run(self)" } ]
2
stack_v2_sparse_classes_30k_train_011756
Implement the Python class `reaper_server` described below. Class description: reaper_server. TCP/IP server waiting for commands from Reaper Methods ------- init: init class run: start server and wait for messages Properties ---------- host: host address port: TCP port to listen Method signatures and docstrings: - de...
Implement the Python class `reaper_server` described below. Class description: reaper_server. TCP/IP server waiting for commands from Reaper Methods ------- init: init class run: start server and wait for messages Properties ---------- host: host address port: TCP port to listen Method signatures and docstrings: - de...
96003eeaf0ce830691eba11cd85137495c721cdb
<|skeleton|> class reaper_server: """reaper_server. TCP/IP server waiting for commands from Reaper Methods ------- init: init class run: start server and wait for messages Properties ---------- host: host address port: TCP port to listen""" def __init__(self): """Init. Set TCP settings in class""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class reaper_server: """reaper_server. TCP/IP server waiting for commands from Reaper Methods ------- init: init class run: start server and wait for messages Properties ---------- host: host address port: TCP port to listen""" def __init__(self): """Init. Set TCP settings in class""" logging.d...
the_stack_v2_python_sparse
PresetManager/reaper/server.py
brummbrum/PresetManager
train
0
ab37d62206bd8e777d9b3da96330308b7d607907
[ "super().__init__(artificial_noise_ADV, artificial_noise_CR, multiclasshandler)\nself.artificial_noise_CR = artificial_noise_CR\nself.n_updates = 0\nself.subcampaignHandlers = []\nfor s in range(n_subcamp):\n self.subcampaignHandlers.append(Normal_SubCampaignHandler(list(classes_config.keys())[s], self.bids, sel...
<|body_start_0|> super().__init__(artificial_noise_ADV, artificial_noise_CR, multiclasshandler) self.artificial_noise_CR = artificial_noise_CR self.n_updates = 0 self.subcampaignHandlers = [] for s in range(n_subcamp): self.subcampaignHandlers.append(Normal_SubCampaig...
Normal_FixedPriceBudgetAllocator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Normal_FixedPriceBudgetAllocator: def __init__(self, artificial_noise_ADV, artificial_noise_CR, multiclasshandler): """@param artificial_noise_ADV: how much exploration on the advertising learners @param artificial_noise_CR: how much exploration on the conversion rates learners @param mu...
stack_v2_sparse_classes_36k_train_028090
1,788
no_license
[ { "docstring": "@param artificial_noise_ADV: how much exploration on the advertising learners @param artificial_noise_CR: how much exploration on the conversion rates learners @param multiclasshandler: classes information", "name": "__init__", "signature": "def __init__(self, artificial_noise_ADV, artif...
2
stack_v2_sparse_classes_30k_train_000594
Implement the Python class `Normal_FixedPriceBudgetAllocator` described below. Class description: Implement the Normal_FixedPriceBudgetAllocator class. Method signatures and docstrings: - def __init__(self, artificial_noise_ADV, artificial_noise_CR, multiclasshandler): @param artificial_noise_ADV: how much exploratio...
Implement the Python class `Normal_FixedPriceBudgetAllocator` described below. Class description: Implement the Normal_FixedPriceBudgetAllocator class. Method signatures and docstrings: - def __init__(self, artificial_noise_ADV, artificial_noise_CR, multiclasshandler): @param artificial_noise_ADV: how much exploratio...
125147257fb8d7bbbe0deef070b0c3c0bddeffe0
<|skeleton|> class Normal_FixedPriceBudgetAllocator: def __init__(self, artificial_noise_ADV, artificial_noise_CR, multiclasshandler): """@param artificial_noise_ADV: how much exploration on the advertising learners @param artificial_noise_CR: how much exploration on the conversion rates learners @param mu...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Normal_FixedPriceBudgetAllocator: def __init__(self, artificial_noise_ADV, artificial_noise_CR, multiclasshandler): """@param artificial_noise_ADV: how much exploration on the advertising learners @param artificial_noise_CR: how much exploration on the conversion rates learners @param multiclasshandle...
the_stack_v2_python_sparse
project/part_7/part_7_normal/Normal_FixedPriceBudgetAllocator.py
damiano1996/DataIntelligenceApplications
train
0
c6b61b1ccc655e553605ee2fb68683d9add0b6f2
[ "self.availability_zone_id = availability_zone_id\nself.db_instance_id = db_instance_id\nself.db_option_group_id = db_option_group_id\nself.db_parameter_group_id = db_parameter_group_id\nself.db_port = db_port\nself.enable_auto_minor_version_upgrade = enable_auto_minor_version_upgrade\nself.enable_copy_tags_to_snap...
<|body_start_0|> self.availability_zone_id = availability_zone_id self.db_instance_id = db_instance_id self.db_option_group_id = db_option_group_id self.db_parameter_group_id = db_parameter_group_id self.db_port = db_port self.enable_auto_minor_version_upgrade = enable_au...
Implementation of the 'RdsParams' model. Specifies rds params for the restore operation. Attributes: availability_zone_id (long|int): Entity representing the availability zone to use while restoring the DB. db_instance_id (string, required): The DB instance identifier to use for the restored DB. This field is required....
RdsParams
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RdsParams: """Implementation of the 'RdsParams' model. Specifies rds params for the restore operation. Attributes: availability_zone_id (long|int): Entity representing the availability zone to use while restoring the DB. db_instance_id (string, required): The DB instance identifier to use for the...
stack_v2_sparse_classes_36k_train_028091
4,883
permissive
[ { "docstring": "Constructor for the RdsParams class", "name": "__init__", "signature": "def __init__(self, availability_zone_id=None, db_instance_id=None, db_option_group_id=None, db_parameter_group_id=None, db_port=None, enable_auto_minor_version_upgrade=None, enable_copy_tags_to_snapshots=None, enable...
2
stack_v2_sparse_classes_30k_train_001541
Implement the Python class `RdsParams` described below. Class description: Implementation of the 'RdsParams' model. Specifies rds params for the restore operation. Attributes: availability_zone_id (long|int): Entity representing the availability zone to use while restoring the DB. db_instance_id (string, required): Th...
Implement the Python class `RdsParams` described below. Class description: Implementation of the 'RdsParams' model. Specifies rds params for the restore operation. Attributes: availability_zone_id (long|int): Entity representing the availability zone to use while restoring the DB. db_instance_id (string, required): Th...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class RdsParams: """Implementation of the 'RdsParams' model. Specifies rds params for the restore operation. Attributes: availability_zone_id (long|int): Entity representing the availability zone to use while restoring the DB. db_instance_id (string, required): The DB instance identifier to use for the...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RdsParams: """Implementation of the 'RdsParams' model. Specifies rds params for the restore operation. Attributes: availability_zone_id (long|int): Entity representing the availability zone to use while restoring the DB. db_instance_id (string, required): The DB instance identifier to use for the restored DB....
the_stack_v2_python_sparse
cohesity_management_sdk/models/rds_params.py
cohesity/management-sdk-python
train
24
d40d60aa8544335a6ff99a90a85800a8a2f3e24d
[ "self.create_and_verify_stack('single/basic_api')\nfirst_dep_ids = self.get_stack_deployment_ids()\nself.assertEqual(len(first_dep_ids), 1)\nself.set_template_resource_property('MyApi', 'DefinitionUri', self.get_s3_uri('swagger2.json'))\nself.update_stack()\nsecond_dep_ids = self.get_stack_deployment_ids()\nself.as...
<|body_start_0|> self.create_and_verify_stack('single/basic_api') first_dep_ids = self.get_stack_deployment_ids() self.assertEqual(len(first_dep_ids), 1) self.set_template_resource_property('MyApi', 'DefinitionUri', self.get_s3_uri('swagger2.json')) self.update_stack() se...
Basic AWS::Serverless::Api tests
TestBasicApi
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestBasicApi: """Basic AWS::Serverless::Api tests""" def test_basic_api(self): """Creates an API and updates its DefinitionUri""" <|body_0|> def test_basic_api_with_mode(self): """Creates an API and updates its DefinitionUri""" <|body_1|> def test_ba...
stack_v2_sparse_classes_36k_train_028092
5,166
permissive
[ { "docstring": "Creates an API and updates its DefinitionUri", "name": "test_basic_api", "signature": "def test_basic_api(self)" }, { "docstring": "Creates an API and updates its DefinitionUri", "name": "test_basic_api_with_mode", "signature": "def test_basic_api_with_mode(self)" }, ...
6
stack_v2_sparse_classes_30k_train_018246
Implement the Python class `TestBasicApi` described below. Class description: Basic AWS::Serverless::Api tests Method signatures and docstrings: - def test_basic_api(self): Creates an API and updates its DefinitionUri - def test_basic_api_with_mode(self): Creates an API and updates its DefinitionUri - def test_basic_...
Implement the Python class `TestBasicApi` described below. Class description: Basic AWS::Serverless::Api tests Method signatures and docstrings: - def test_basic_api(self): Creates an API and updates its DefinitionUri - def test_basic_api_with_mode(self): Creates an API and updates its DefinitionUri - def test_basic_...
0bb862ea715a4aafbb7984b407a81856b3ae19c4
<|skeleton|> class TestBasicApi: """Basic AWS::Serverless::Api tests""" def test_basic_api(self): """Creates an API and updates its DefinitionUri""" <|body_0|> def test_basic_api_with_mode(self): """Creates an API and updates its DefinitionUri""" <|body_1|> def test_ba...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestBasicApi: """Basic AWS::Serverless::Api tests""" def test_basic_api(self): """Creates an API and updates its DefinitionUri""" self.create_and_verify_stack('single/basic_api') first_dep_ids = self.get_stack_deployment_ids() self.assertEqual(len(first_dep_ids), 1) ...
the_stack_v2_python_sparse
integration/single/test_basic_api.py
aws/serverless-application-model
train
2,055
561471ab045e389d791bab7bf4968b71143294b6
[ "super().__init__()\nif not components:\n raise ValueError('At least one (weight, loss_function) pair must be supplied.')\nself.components = components", "result = None\nfor weight, loss_function in self.components:\n loss = weight * loss_function(output, target, **kwargs)\n if result is None:\n r...
<|body_start_0|> super().__init__() if not components: raise ValueError('At least one (weight, loss_function) pair must be supplied.') self.components = components <|end_body_0|> <|body_start_1|> result = None for weight, loss_function in self.components: ...
MixtureLoss
[ "MIT", "LicenseRef-scancode-generic-cla" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MixtureLoss: def __init__(self, components: List[Tuple[float, SupervisedLearningCriterion]]): """Loss function defined as a weighted mixture (interpolation) of other loss functions. :param components: a non-empty list of weights and loss function instances.""" <|body_0|> def...
stack_v2_sparse_classes_36k_train_028093
1,825
permissive
[ { "docstring": "Loss function defined as a weighted mixture (interpolation) of other loss functions. :param components: a non-empty list of weights and loss function instances.", "name": "__init__", "signature": "def __init__(self, components: List[Tuple[float, SupervisedLearningCriterion]])" }, { ...
2
stack_v2_sparse_classes_30k_train_006862
Implement the Python class `MixtureLoss` described below. Class description: Implement the MixtureLoss class. Method signatures and docstrings: - def __init__(self, components: List[Tuple[float, SupervisedLearningCriterion]]): Loss function defined as a weighted mixture (interpolation) of other loss functions. :param...
Implement the Python class `MixtureLoss` described below. Class description: Implement the MixtureLoss class. Method signatures and docstrings: - def __init__(self, components: List[Tuple[float, SupervisedLearningCriterion]]): Loss function defined as a weighted mixture (interpolation) of other loss functions. :param...
2877002d50d3a34d80f647c18cb561025d9066cc
<|skeleton|> class MixtureLoss: def __init__(self, components: List[Tuple[float, SupervisedLearningCriterion]]): """Loss function defined as a weighted mixture (interpolation) of other loss functions. :param components: a non-empty list of weights and loss function instances.""" <|body_0|> def...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MixtureLoss: def __init__(self, components: List[Tuple[float, SupervisedLearningCriterion]]): """Loss function defined as a weighted mixture (interpolation) of other loss functions. :param components: a non-empty list of weights and loss function instances.""" super().__init__() if not...
the_stack_v2_python_sparse
InnerEye/ML/models/losses/mixture.py
microsoft/InnerEye-DeepLearning
train
511
f0fa262e96ddae6b6d882a564768e2f3114d6b09
[ "assert entity_type in BlueprintEntity.entity_classification, 'Unknown entity type {}'.format(entity_type)\nclass_list_sorted = sorted(BlueprintEntity.entity_classification[entity_type].keys())\nreturn class_list_sorted[0]", "assert entity_type in BlueprintEntity.entity_classification\nif entity_classification is...
<|body_start_0|> assert entity_type in BlueprintEntity.entity_classification, 'Unknown entity type {}'.format(entity_type) class_list_sorted = sorted(BlueprintEntity.entity_classification[entity_type].keys()) return class_list_sorted[0] <|end_body_0|> <|body_start_1|> assert entity_type...
@type entity_classification: dict[int, dict[int, str]]
BlueprintEntity
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BlueprintEntity: """@type entity_classification: dict[int, dict[int, str]]""" def get_entity_classification_default(entity_type): """Return name of entity classification @param entity_type: @type entity_type: int @rtype: str""" <|body_0|> def get_entity_classification_na...
stack_v2_sparse_classes_36k_train_028094
2,637
no_license
[ { "docstring": "Return name of entity classification @param entity_type: @type entity_type: int @rtype: str", "name": "get_entity_classification_default", "signature": "def get_entity_classification_default(entity_type)" }, { "docstring": "Return name of entity classification @param entity_type:...
2
stack_v2_sparse_classes_30k_train_007691
Implement the Python class `BlueprintEntity` described below. Class description: @type entity_classification: dict[int, dict[int, str]] Method signatures and docstrings: - def get_entity_classification_default(entity_type): Return name of entity classification @param entity_type: @type entity_type: int @rtype: str - ...
Implement the Python class `BlueprintEntity` described below. Class description: @type entity_classification: dict[int, dict[int, str]] Method signatures and docstrings: - def get_entity_classification_default(entity_type): Return name of entity classification @param entity_type: @type entity_type: int @rtype: str - ...
12fe1b39513cf0d1ca8edd9adb6c11269c58fbb5
<|skeleton|> class BlueprintEntity: """@type entity_classification: dict[int, dict[int, str]]""" def get_entity_classification_default(entity_type): """Return name of entity classification @param entity_type: @type entity_type: int @rtype: str""" <|body_0|> def get_entity_classification_na...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BlueprintEntity: """@type entity_classification: dict[int, dict[int, str]]""" def get_entity_classification_default(entity_type): """Return name of entity classification @param entity_type: @type entity_type: int @rtype: str""" assert entity_type in BlueprintEntity.entity_classification, ...
the_stack_v2_python_sparse
smlib/utils/blueprintentity.py
p-hofmann/SMBEdit
train
6
a6c784bae4053d08de3b26943c37f9876833ce81
[ "if n < 2:\n return 0\nif n == 2:\n return 1\nif n == 3:\n return 2\nresult = [0] * (n + 1)\nresult[1], result[2], result[3] = (1, 2, 3)\nfor i in range(4, n + 1):\n maxVal = i\n for j in range(1, (i + 2) // 2):\n temp = result[j] * result[i - j]\n if temp > maxVal:\n maxVal ...
<|body_start_0|> if n < 2: return 0 if n == 2: return 1 if n == 3: return 2 result = [0] * (n + 1) result[1], result[2], result[3] = (1, 2, 3) for i in range(4, n + 1): maxVal = i for j in range(1, (i + 2) // 2):...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def cutRope1(self, n): """:type n:int :rtype:int""" <|body_0|> def cutRope2(self, n): """:type n:int :rtype:int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if n < 2: return 0 if n == 2: return 1 ...
stack_v2_sparse_classes_36k_train_028095
1,422
no_license
[ { "docstring": ":type n:int :rtype:int", "name": "cutRope1", "signature": "def cutRope1(self, n)" }, { "docstring": ":type n:int :rtype:int", "name": "cutRope2", "signature": "def cutRope2(self, n)" } ]
2
stack_v2_sparse_classes_30k_train_009950
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def cutRope1(self, n): :type n:int :rtype:int - def cutRope2(self, n): :type n:int :rtype:int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def cutRope1(self, n): :type n:int :rtype:int - def cutRope2(self, n): :type n:int :rtype:int <|skeleton|> class Solution: def cutRope1(self, n): """:type n:int :rt...
42a15943394ae533dcd0d5bbf52e4366ab0756ab
<|skeleton|> class Solution: def cutRope1(self, n): """:type n:int :rtype:int""" <|body_0|> def cutRope2(self, n): """:type n:int :rtype:int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def cutRope1(self, n): """:type n:int :rtype:int""" if n < 2: return 0 if n == 2: return 1 if n == 3: return 2 result = [0] * (n + 1) result[1], result[2], result[3] = (1, 2, 3) for i in range(4, n + 1): ...
the_stack_v2_python_sparse
test14.py
nihao-hit/jianzhiOffer
train
0
d5a107d3f06b0f0ed33cda4810e159f50dcdee47
[ "values = self.shift_data.getlist('ids', self.key_type)\nif not values:\n return Response(status=status.HTTP_200_OK)\nfield = self.shift_data.get('field')\nif field not in self.batch_set_fields:\n raise exceptions.PermissionDenied()\nfilter_config = self.batch_set_fields[field]\nallow_null = False\nif isinsta...
<|body_start_0|> values = self.shift_data.getlist('ids', self.key_type) if not values: return Response(status=status.HTTP_200_OK) field = self.shift_data.get('field') if field not in self.batch_set_fields: raise exceptions.PermissionDenied() filter_config ...
批量设置字段值混入类
BatchSetModelMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BatchSetModelMixin: """批量设置字段值混入类""" def batch_set(self, request): """批量设置字段通用api :param request: 请求对象 :return: 响应对象""" <|body_0|> def perform_batch_set(self, queryset, field, value): """批量设置字段通用更新 :param queryset: 更新的queryset :param field: 字段名称 :param value: 更新后...
stack_v2_sparse_classes_36k_train_028096
11,301
no_license
[ { "docstring": "批量设置字段通用api :param request: 请求对象 :return: 响应对象", "name": "batch_set", "signature": "def batch_set(self, request)" }, { "docstring": "批量设置字段通用更新 :param queryset: 更新的queryset :param field: 字段名称 :param value: 更新后的值 :return: 是否有更新", "name": "perform_batch_set", "signature": "...
2
stack_v2_sparse_classes_30k_train_016178
Implement the Python class `BatchSetModelMixin` described below. Class description: 批量设置字段值混入类 Method signatures and docstrings: - def batch_set(self, request): 批量设置字段通用api :param request: 请求对象 :return: 响应对象 - def perform_batch_set(self, queryset, field, value): 批量设置字段通用更新 :param queryset: 更新的queryset :param field: 字...
Implement the Python class `BatchSetModelMixin` described below. Class description: 批量设置字段值混入类 Method signatures and docstrings: - def batch_set(self, request): 批量设置字段通用api :param request: 请求对象 :return: 响应对象 - def perform_batch_set(self, queryset, field, value): 批量设置字段通用更新 :param queryset: 更新的queryset :param field: 字...
a4502d14652c6a926e74be6d0f53b2b50ada9c3c
<|skeleton|> class BatchSetModelMixin: """批量设置字段值混入类""" def batch_set(self, request): """批量设置字段通用api :param request: 请求对象 :return: 响应对象""" <|body_0|> def perform_batch_set(self, queryset, field, value): """批量设置字段通用更新 :param queryset: 更新的queryset :param field: 字段名称 :param value: 更新后...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BatchSetModelMixin: """批量设置字段值混入类""" def batch_set(self, request): """批量设置字段通用api :param request: 请求对象 :return: 响应对象""" values = self.shift_data.getlist('ids', self.key_type) if not values: return Response(status=status.HTTP_200_OK) field = self.shift_data.get(...
the_stack_v2_python_sparse
sv/sv_base/extensions/rest/mixins.py
xianzhishenqie/project_template
train
1
bfb4b0b420cdab0bf2790938bf1e8281a3e94938
[ "super().__init__(fl_model, data_handler, hyperparams, **kwargs)\nself.curr_seed = 0\nself.permute_secret = 0\nif not kwargs:\n raise InvalidConfigurationException('No local_training info given at runtime')\nseed_file = get_seed_filename(kwargs)\nself.permute_secret = get_seed(seed_file)", "allw = model_update...
<|body_start_0|> super().__init__(fl_model, data_handler, hyperparams, **kwargs) self.curr_seed = 0 self.permute_secret = 0 if not kwargs: raise InvalidConfigurationException('No local_training info given at runtime') seed_file = get_seed_filename(kwargs) self...
ShuffleLocalTrainingHandler
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ShuffleLocalTrainingHandler: def __init__(self, fl_model, data_handler, hyperparams=None, **kwargs): """Initialize LocalTrainingHandler with fl_model, data_handler :param fl_model: model to be trained :type fl_model: `model.FLModel` :param data_handler: data handler that will be used to ...
stack_v2_sparse_classes_36k_train_028097
6,140
permissive
[ { "docstring": "Initialize LocalTrainingHandler with fl_model, data_handler :param fl_model: model to be trained :type fl_model: `model.FLModel` :param data_handler: data handler that will be used to obtain data :type data_handler: `DataHandler` :param hyperparams: Hyperparameters used for training. :type hyper...
6
stack_v2_sparse_classes_30k_train_013630
Implement the Python class `ShuffleLocalTrainingHandler` described below. Class description: Implement the ShuffleLocalTrainingHandler class. Method signatures and docstrings: - def __init__(self, fl_model, data_handler, hyperparams=None, **kwargs): Initialize LocalTrainingHandler with fl_model, data_handler :param f...
Implement the Python class `ShuffleLocalTrainingHandler` described below. Class description: Implement the ShuffleLocalTrainingHandler class. Method signatures and docstrings: - def __init__(self, fl_model, data_handler, hyperparams=None, **kwargs): Initialize LocalTrainingHandler with fl_model, data_handler :param f...
64ffa2ee2e906b1bd6b3dd6aabcf6fc3de862608
<|skeleton|> class ShuffleLocalTrainingHandler: def __init__(self, fl_model, data_handler, hyperparams=None, **kwargs): """Initialize LocalTrainingHandler with fl_model, data_handler :param fl_model: model to be trained :type fl_model: `model.FLModel` :param data_handler: data handler that will be used to ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ShuffleLocalTrainingHandler: def __init__(self, fl_model, data_handler, hyperparams=None, **kwargs): """Initialize LocalTrainingHandler with fl_model, data_handler :param fl_model: model to be trained :type fl_model: `model.FLModel` :param data_handler: data handler that will be used to obtain data :t...
the_stack_v2_python_sparse
debugging-constructs/ibmfl/party/training/shuffle_local_training_handler.py
SEED-VT/FedDebug
train
8
33019cffc8cf1a595802092b51ad871607d19d78
[ "std_value = registry_key.GetValueByName('Std')\nif std_value:\n localized_name = std_value.GetDataAsObject()\nelse:\n localized_name = registry_key.name\nmui_std_value = registry_key.GetValueByName('MUI_Std')\nif mui_std_value:\n mui_form = mui_std_value.GetDataAsObject()\nelse:\n mui_form = None\ntzi_...
<|body_start_0|> std_value = registry_key.GetValueByName('Std') if std_value: localized_name = std_value.GetDataAsObject() else: localized_name = registry_key.name mui_std_value = registry_key.GetValueByName('MUI_Std') if mui_std_value: mui_for...
The Windows available time zones plugin.
WindowsAvailableTimeZonesPlugin
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WindowsAvailableTimeZonesPlugin: """The Windows available time zones plugin.""" def _ParseKey(self, mediator, registry_key, value_name): """Parses a Windows Registry key for a preprocessing attribute. Args: mediator (PreprocessMediator): mediates interactions between preprocess plugi...
stack_v2_sparse_classes_36k_train_028098
34,521
permissive
[ { "docstring": "Parses a Windows Registry key for a preprocessing attribute. Args: mediator (PreprocessMediator): mediates interactions between preprocess plugins and other components, such as storage. registry_key (dfwinreg.WinRegistryKey): Windows Registry key. value_name (str): name of the Windows Registry v...
2
null
Implement the Python class `WindowsAvailableTimeZonesPlugin` described below. Class description: The Windows available time zones plugin. Method signatures and docstrings: - def _ParseKey(self, mediator, registry_key, value_name): Parses a Windows Registry key for a preprocessing attribute. Args: mediator (Preprocess...
Implement the Python class `WindowsAvailableTimeZonesPlugin` described below. Class description: The Windows available time zones plugin. Method signatures and docstrings: - def _ParseKey(self, mediator, registry_key, value_name): Parses a Windows Registry key for a preprocessing attribute. Args: mediator (Preprocess...
d6022f8cfebfddf2d08ab2d300a41b61f3349933
<|skeleton|> class WindowsAvailableTimeZonesPlugin: """The Windows available time zones plugin.""" def _ParseKey(self, mediator, registry_key, value_name): """Parses a Windows Registry key for a preprocessing attribute. Args: mediator (PreprocessMediator): mediates interactions between preprocess plugi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WindowsAvailableTimeZonesPlugin: """The Windows available time zones plugin.""" def _ParseKey(self, mediator, registry_key, value_name): """Parses a Windows Registry key for a preprocessing attribute. Args: mediator (PreprocessMediator): mediates interactions between preprocess plugins and other ...
the_stack_v2_python_sparse
plaso/preprocessors/windows.py
log2timeline/plaso
train
1,506
25c8b638be29ad7f9e06a034492bff3d322efe89
[ "i = 0\ntryAgain = True\nwhile tryAgain and i < Parameters.MAX_SEND_TRY:\n try:\n serializedMessage = Params.CODEC.encode(message)\n params = {Parameters.POST_MESSAGE_KEYWORD: serializedMessage}\n params = urllib.parse.urlencode(params, doseq=True, encoding=Parameters.POST_MESSAGE_ENCODING)\...
<|body_start_0|> i = 0 tryAgain = True while tryAgain and i < Parameters.MAX_SEND_TRY: try: serializedMessage = Params.CODEC.encode(message) params = {Parameters.POST_MESSAGE_KEYWORD: serializedMessage} params = urllib.parse.urlencode(p...
HTTP request maker Uses http.client request method to create outgoing requests
Sender
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Sender: """HTTP request maker Uses http.client request method to create outgoing requests""" def send(connection, message): """Send the message via http on given connection :param message: message to send :param connection: connection to use to send the message""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_028099
8,302
no_license
[ { "docstring": "Send the message via http on given connection :param message: message to send :param connection: connection to use to send the message", "name": "send", "signature": "def send(connection, message)" }, { "docstring": "Request list of probes on given connection :param connection: c...
3
stack_v2_sparse_classes_30k_train_003306
Implement the Python class `Sender` described below. Class description: HTTP request maker Uses http.client request method to create outgoing requests Method signatures and docstrings: - def send(connection, message): Send the message via http on given connection :param message: message to send :param connection: con...
Implement the Python class `Sender` described below. Class description: HTTP request maker Uses http.client request method to create outgoing requests Method signatures and docstrings: - def send(connection, message): Send the message via http on given connection :param message: message to send :param connection: con...
ca59600c973fb63ec974fa4a3b03784784f30a31
<|skeleton|> class Sender: """HTTP request maker Uses http.client request method to create outgoing requests""" def send(connection, message): """Send the message via http on given connection :param message: message to send :param connection: connection to use to send the message""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Sender: """HTTP request maker Uses http.client request method to create outgoing requests""" def send(connection, message): """Send the message via http on given connection :param message: message to send :param connection: connection to use to send the message""" i = 0 tryAgain =...
the_stack_v2_python_sparse
app/common/protocols/http.py
netixx/NetProbes
train
2