blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
7.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
378
8.64k
id
stringlengths
44
44
length_bytes
int64
505
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.88k
prompted_full_text
stringlengths
565
12.5k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
5.05k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
snapshot_total_rows
int64
75.8k
75.8k
solution
stringlengths
242
8.3k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
b37ab6cdd367b1fa60d12ce33cc234d7a42c1eab
[ "if head == None:\n return False\np = head\nq = head.next\nwhile q != None:\n if p == q:\n return True\n p = p.next\n if q.next != None:\n q = q.next.next\n else:\n return False\nreturn False", "while head:\n if head.val == 'bjfuvth':\n return True\n else:\n ...
<|body_start_0|> if head == None: return False p = head q = head.next while q != None: if p == q: return True p = p.next if q.next != None: q = q.next.next else: return False ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def hasCycle1(self, head): """:type head: ListNode :rtype: bool""" <|body_0|> def hasCycle(self, head): """:type head: ListNode :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> if head == None: return False ...
stack_v2_sparse_classes_75kplus_train_072000
1,291
no_license
[ { "docstring": ":type head: ListNode :rtype: bool", "name": "hasCycle1", "signature": "def hasCycle1(self, head)" }, { "docstring": ":type head: ListNode :rtype: bool", "name": "hasCycle", "signature": "def hasCycle(self, head)" } ]
2
stack_v2_sparse_classes_30k_train_001671
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def hasCycle1(self, head): :type head: ListNode :rtype: bool - def hasCycle(self, head): :type head: ListNode :rtype: bool
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def hasCycle1(self, head): :type head: ListNode :rtype: bool - def hasCycle(self, head): :type head: ListNode :rtype: bool <|skeleton|> class Solution: def hasCycle1(self, ...
48b43999fb7e2ed82d922e1f64ac76f8fabe4baa
<|skeleton|> class Solution: def hasCycle1(self, head): """:type head: ListNode :rtype: bool""" <|body_0|> def hasCycle(self, head): """:type head: ListNode :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def hasCycle1(self, head): """:type head: ListNode :rtype: bool""" if head == None: return False p = head q = head.next while q != None: if p == q: return True p = p.next if q.next != None: ...
the_stack_v2_python_sparse
141.py
saleed/LeetCode
train
2
913e981121b692fffedb3087e5ab995373a885c0
[ "pipeline_config_path = os.path.join(self.get_temp_dir(), 'pipeline.config')\npipeline_config = pipeline_pb2.TrainEvalPipelineConfig()\npipeline_config.model.ssd.num_classes = 10\npipeline_config.train_config.batch_size = 32\npipeline_config.train_input_reader.label_map_path = 'path/to/label_map'\npipeline_config.e...
<|body_start_0|> pipeline_config_path = os.path.join(self.get_temp_dir(), 'pipeline.config') pipeline_config = pipeline_pb2.TrainEvalPipelineConfig() pipeline_config.model.ssd.num_classes = 10 pipeline_config.train_config.batch_size = 32 pipeline_config.train_input_reader.label_m...
ConfigUtilTest
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConfigUtilTest: def test_get_configs_from_pipeline_file(self): """Test that proto configs can be read from pipeline config file.""" <|body_0|> def test_create_pipeline_proto_from_configs(self): """Tests that proto can be reconstructed from configs dictionary.""" ...
stack_v2_sparse_classes_75kplus_train_072001
3,986
permissive
[ { "docstring": "Test that proto configs can be read from pipeline config file.", "name": "test_get_configs_from_pipeline_file", "signature": "def test_get_configs_from_pipeline_file(self)" }, { "docstring": "Tests that proto can be reconstructed from configs dictionary.", "name": "test_creat...
2
stack_v2_sparse_classes_30k_train_000358
Implement the Python class `ConfigUtilTest` described below. Class description: Implement the ConfigUtilTest class. Method signatures and docstrings: - def test_get_configs_from_pipeline_file(self): Test that proto configs can be read from pipeline config file. - def test_create_pipeline_proto_from_configs(self): Tes...
Implement the Python class `ConfigUtilTest` described below. Class description: Implement the ConfigUtilTest class. Method signatures and docstrings: - def test_get_configs_from_pipeline_file(self): Test that proto configs can be read from pipeline config file. - def test_create_pipeline_proto_from_configs(self): Tes...
a115d918f6894a69586174653172be0b5d1de952
<|skeleton|> class ConfigUtilTest: def test_get_configs_from_pipeline_file(self): """Test that proto configs can be read from pipeline config file.""" <|body_0|> def test_create_pipeline_proto_from_configs(self): """Tests that proto can be reconstructed from configs dictionary.""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ConfigUtilTest: def test_get_configs_from_pipeline_file(self): """Test that proto configs can be read from pipeline config file.""" pipeline_config_path = os.path.join(self.get_temp_dir(), 'pipeline.config') pipeline_config = pipeline_pb2.TrainEvalPipelineConfig() pipeline_conf...
the_stack_v2_python_sparse
models/research/lstm_object_detection/utils/config_util_test.py
finnickniu/tensorflow_object_detection_tflite
train
60
d7646ad0985c17aecf1ff81ccd4dbdf737c456db
[ "resource_models = gm_core.DataResource('deepseg_gm_models')\nfor model_name in gm_model.MODELS.keys():\n model_path, metadata_path = gm_model.MODELS[model_name]\n metadata_abs_path = resource_models.get_file_path(metadata_path)\n assert os.path.isfile(metadata_abs_path)", "dummy_img = np.ones((203, 202)...
<|body_start_0|> resource_models = gm_core.DataResource('deepseg_gm_models') for model_name in gm_model.MODELS.keys(): model_path, metadata_path = gm_model.MODELS[model_name] metadata_abs_path = resource_models.get_file_path(metadata_path) assert os.path.isfile(metada...
TestCore
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestCore: def test_data_resource(self): """Test the DataResource manager, and check if files exists.""" <|body_0|> def test_crop_center(self): """Test the cropping method, with even and odd sizes.""" <|body_1|> def test_thresholding(self): """Tes...
stack_v2_sparse_classes_75kplus_train_072002
4,860
permissive
[ { "docstring": "Test the DataResource manager, and check if files exists.", "name": "test_data_resource", "signature": "def test_data_resource(self)" }, { "docstring": "Test the cropping method, with even and odd sizes.", "name": "test_crop_center", "signature": "def test_crop_center(sel...
6
stack_v2_sparse_classes_30k_train_030737
Implement the Python class `TestCore` described below. Class description: Implement the TestCore class. Method signatures and docstrings: - def test_data_resource(self): Test the DataResource manager, and check if files exists. - def test_crop_center(self): Test the cropping method, with even and odd sizes. - def tes...
Implement the Python class `TestCore` described below. Class description: Implement the TestCore class. Method signatures and docstrings: - def test_data_resource(self): Test the DataResource manager, and check if files exists. - def test_crop_center(self): Test the cropping method, with even and odd sizes. - def tes...
81ebad505180ab18270eb926cca4a134996f8c45
<|skeleton|> class TestCore: def test_data_resource(self): """Test the DataResource manager, and check if files exists.""" <|body_0|> def test_crop_center(self): """Test the cropping method, with even and odd sizes.""" <|body_1|> def test_thresholding(self): """Tes...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestCore: def test_data_resource(self): """Test the DataResource manager, and check if files exists.""" resource_models = gm_core.DataResource('deepseg_gm_models') for model_name in gm_model.MODELS.keys(): model_path, metadata_path = gm_model.MODELS[model_name] ...
the_stack_v2_python_sparse
unit_testing/test_deepseg_gm.py
PaulBautin/spinalcordtoolbox
train
1
5d63d54f7d2ce60f80baaaa4dd43e96bf1c23ac9
[ "max_product, current_max, current_min = (float('-inf'), 1, 1)\nfor n in nums:\n current_max, current_min = (max(current_max * n, current_min * n, n), min(current_min * n, current_max * n, n))\n max_product = max(max_product, current_max)\nreturn max_product", "if not nums or len(nums) < 1:\n return 0\nc...
<|body_start_0|> max_product, current_max, current_min = (float('-inf'), 1, 1) for n in nums: current_max, current_min = (max(current_max * n, current_min * n, n), min(current_min * n, current_max * n, n)) max_product = max(max_product, current_max) return max_product <|e...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProduct(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def maxProduct_v2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> max_product, current_max, current_min = (flo...
stack_v2_sparse_classes_75kplus_train_072003
1,834
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "maxProduct", "signature": "def maxProduct(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "maxProduct_v2", "signature": "def maxProduct_v2(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_043332
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProduct(self, nums): :type nums: List[int] :rtype: int - def maxProduct_v2(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 maxProduct(self, nums): :type nums: List[int] :rtype: int - def maxProduct_v2(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: def maxProduct...
e60ba45fe2f2e5e3b3abfecec3db76f5ce1fde59
<|skeleton|> class Solution: def maxProduct(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def maxProduct_v2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def maxProduct(self, nums): """:type nums: List[int] :rtype: int""" max_product, current_max, current_min = (float('-inf'), 1, 1) for n in nums: current_max, current_min = (max(current_max * n, current_min * n, n), min(current_min * n, current_max * n, n)) ...
the_stack_v2_python_sparse
src/lt_152.py
oxhead/CodingYourWay
train
0
5174bc0645046c4eb5cd85a37f053c1de3c42ef7
[ "queue = [root]\nres = []\nwhile queue:\n popItem = queue.pop(0)\n if not popItem:\n res.append('None')\n continue\n else:\n res.append(str(popItem.val))\n queue.append(popItem.left)\n queue.append(popItem.right)\nreturn ','.join(res)", "data = data.split(',')\nif data[0] == 'N...
<|body_start_0|> queue = [root] res = [] while queue: popItem = queue.pop(0) if not popItem: res.append('None') continue else: res.append(str(popItem.val)) queue.append(popItem.left) queue...
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_75kplus_train_072004
2,714
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:...
d4215451f1cad3ab6dfb4b082f4fd694fe0d31b4
<|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_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" queue = [root] res = [] while queue: popItem = queue.pop(0) if not popItem: res.append('None') continue ...
the_stack_v2_python_sparse
leetcode/探索中级算法/7设计问题/二叉树的序列化与反序列化.py
FishRedLeaf/my_code
train
3
c156c8f898a8c5574ecf63a41c97e214e537f5c6
[ "tf.random.set_seed(42)\ndtype = np.float64\ninstant_forward_rate_fn_1 = lambda t: 2 * [0.2]\nprocess_1 = tff.models.hull_white.VectorHullWhiteModel(dim=2, mean_reversion=[0.1, 0.2], volatility=[0.1, 0.2], initial_discount_rate_fn=instant_forward_rate_fn_1, dtype=dtype)\ninstant_forward_rate_fn_2 = lambda t: 3 * [0...
<|body_start_0|> tf.random.set_seed(42) dtype = np.float64 instant_forward_rate_fn_1 = lambda t: 2 * [0.2] process_1 = tff.models.hull_white.VectorHullWhiteModel(dim=2, mean_reversion=[0.1, 0.2], volatility=[0.1, 0.2], initial_discount_rate_fn=instant_forward_rate_fn_1, dtype=dtype) ...
JoinedItoProcessTest
[ "Apache-2.0", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JoinedItoProcessTest: def test_join_hull_white(self): """Tests that join of Hull White is the same as VectorHullWhite.""" <|body_0|> def test_invalid_processes(self): """Tests that all processes should be `ItoProcess`es.""" <|body_1|> def test_inconsiste...
stack_v2_sparse_classes_75kplus_train_072005
4,200
permissive
[ { "docstring": "Tests that join of Hull White is the same as VectorHullWhite.", "name": "test_join_hull_white", "signature": "def test_join_hull_white(self)" }, { "docstring": "Tests that all processes should be `ItoProcess`es.", "name": "test_invalid_processes", "signature": "def test_i...
3
stack_v2_sparse_classes_30k_train_027222
Implement the Python class `JoinedItoProcessTest` described below. Class description: Implement the JoinedItoProcessTest class. Method signatures and docstrings: - def test_join_hull_white(self): Tests that join of Hull White is the same as VectorHullWhite. - def test_invalid_processes(self): Tests that all processes...
Implement the Python class `JoinedItoProcessTest` described below. Class description: Implement the JoinedItoProcessTest class. Method signatures and docstrings: - def test_join_hull_white(self): Tests that join of Hull White is the same as VectorHullWhite. - def test_invalid_processes(self): Tests that all processes...
0d3a2193c0f2d320b65e602cf01d7a617da484df
<|skeleton|> class JoinedItoProcessTest: def test_join_hull_white(self): """Tests that join of Hull White is the same as VectorHullWhite.""" <|body_0|> def test_invalid_processes(self): """Tests that all processes should be `ItoProcess`es.""" <|body_1|> def test_inconsiste...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class JoinedItoProcessTest: def test_join_hull_white(self): """Tests that join of Hull White is the same as VectorHullWhite.""" tf.random.set_seed(42) dtype = np.float64 instant_forward_rate_fn_1 = lambda t: 2 * [0.2] process_1 = tff.models.hull_white.VectorHullWhiteModel(dim...
the_stack_v2_python_sparse
tf_quant_finance/models/joined_ito_process_test.py
google/tf-quant-finance
train
4,165
b2eab501eb2b86e44dae85dc8fb2d8ca9589633f
[ "entity_id = provider.issuer\nslo_url = request.build_absolute_uri(reverse('passbook_providers_saml:saml-logout', kwargs={'application': provider.application.slug}))\nsso_post_url = request.build_absolute_uri(reverse('passbook_providers_saml:saml-login', kwargs={'application': provider.application.slug}))\npubkey =...
<|body_start_0|> entity_id = provider.issuer slo_url = request.build_absolute_uri(reverse('passbook_providers_saml:saml-logout', kwargs={'application': provider.application.slug})) sso_post_url = request.build_absolute_uri(reverse('passbook_providers_saml:saml-login', kwargs={'application': prov...
Replies with the XML Metadata IDSSODescriptor.
DescriptorDownloadView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DescriptorDownloadView: """Replies with the XML Metadata IDSSODescriptor.""" def get_metadata(request: HttpRequest, provider: SAMLProvider) -> str: """Return rendered XML Metadata""" <|body_0|> def get(self, request: HttpRequest, application: str) -> HttpResponse: ...
stack_v2_sparse_classes_75kplus_train_072006
11,940
permissive
[ { "docstring": "Return rendered XML Metadata", "name": "get_metadata", "signature": "def get_metadata(request: HttpRequest, provider: SAMLProvider) -> str" }, { "docstring": "Replies with the XML Metadata IDSSODescriptor.", "name": "get", "signature": "def get(self, request: HttpRequest,...
2
null
Implement the Python class `DescriptorDownloadView` described below. Class description: Replies with the XML Metadata IDSSODescriptor. Method signatures and docstrings: - def get_metadata(request: HttpRequest, provider: SAMLProvider) -> str: Return rendered XML Metadata - def get(self, request: HttpRequest, applicati...
Implement the Python class `DescriptorDownloadView` described below. Class description: Replies with the XML Metadata IDSSODescriptor. Method signatures and docstrings: - def get_metadata(request: HttpRequest, provider: SAMLProvider) -> str: Return rendered XML Metadata - def get(self, request: HttpRequest, applicati...
cba17f6659404445ac3025f11657d89368cc8b4f
<|skeleton|> class DescriptorDownloadView: """Replies with the XML Metadata IDSSODescriptor.""" def get_metadata(request: HttpRequest, provider: SAMLProvider) -> str: """Return rendered XML Metadata""" <|body_0|> def get(self, request: HttpRequest, application: str) -> HttpResponse: ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DescriptorDownloadView: """Replies with the XML Metadata IDSSODescriptor.""" def get_metadata(request: HttpRequest, provider: SAMLProvider) -> str: """Return rendered XML Metadata""" entity_id = provider.issuer slo_url = request.build_absolute_uri(reverse('passbook_providers_saml:...
the_stack_v2_python_sparse
passbook/providers/saml/views.py
fossabot/passbook
train
0
709e92c810d43af66641165e8ebdea96c7f4a067
[ "self.location = location\nself.ipversion = ipversion\nself.directory = Directory()\nself.hosts = gocept.net.dhcp.Hosts()\nself.networks = {}", "vlans = self.directory.lookup_networks_details(self.location, self.ipversion)\nfor vlan, networks in vlans.items():\n self.networks[vlan] = gocept.net.dhcp.SharedNetw...
<|body_start_0|> self.location = location self.ipversion = ipversion self.directory = Directory() self.hosts = gocept.net.dhcp.Hosts() self.networks = {} <|end_body_0|> <|body_start_1|> vlans = self.directory.lookup_networks_details(self.location, self.ipversion) ...
dhcpd.conf generator. This class retrieves information about configured hosts from the directory and creates a dhcpd.conf part that represents that information. This part can optionally be merged with one or more static includes to assemble a complete dhcpd.conf file.
DHCPd
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DHCPd: """dhcpd.conf generator. This class retrieves information about configured hosts from the directory and creates a dhcpd.conf part that represents that information. This part can optionally be merged with one or more static includes to assemble a complete dhcpd.conf file.""" def __init...
stack_v2_sparse_classes_75kplus_train_072007
10,904
no_license
[ { "docstring": "Initialize instance with location, vlan, and ipversion defaults.", "name": "__init__", "signature": "def __init__(self, location, ipversion=4)" }, { "docstring": "Retrieve networks and hosts from directory and add them to subnets.", "name": "query_directory", "signature":...
3
null
Implement the Python class `DHCPd` described below. Class description: dhcpd.conf generator. This class retrieves information about configured hosts from the directory and creates a dhcpd.conf part that represents that information. This part can optionally be merged with one or more static includes to assemble a compl...
Implement the Python class `DHCPd` described below. Class description: dhcpd.conf generator. This class retrieves information about configured hosts from the directory and creates a dhcpd.conf part that represents that information. This part can optionally be merged with one or more static includes to assemble a compl...
be47660631f72e134a0d873df7bc069439cbacdb
<|skeleton|> class DHCPd: """dhcpd.conf generator. This class retrieves information about configured hosts from the directory and creates a dhcpd.conf part that represents that information. This part can optionally be merged with one or more static includes to assemble a complete dhcpd.conf file.""" def __init...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DHCPd: """dhcpd.conf generator. This class retrieves information about configured hosts from the directory and creates a dhcpd.conf part that represents that information. This part can optionally be merged with one or more static includes to assemble a complete dhcpd.conf file.""" def __init__(self, loca...
the_stack_v2_python_sparse
src/gocept/net/configure/dhcpd.py
flyingcircusio/fc.agent
train
0
a6489cd60d6902b6bbd014ce5508f25107fea124
[ "res = super(AccountInvoiceLine, self).onchange_invoice_product_id(product_id, invoice)\nif isinstance(product_id, int):\n product_id = self.env['product.product'].browse(product_id)\nsuppinfo = False\nfiscal_position = invoice.fiscal_position_id\nif product_id:\n if product_id.purchase_ok and invoice.type in...
<|body_start_0|> res = super(AccountInvoiceLine, self).onchange_invoice_product_id(product_id, invoice) if isinstance(product_id, int): product_id = self.env['product.product'].browse(product_id) suppinfo = False fiscal_position = invoice.fiscal_position_id if product...
AccountInvoiceLine
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AccountInvoiceLine: def onchange_invoice_product_id(self, product_id, invoice): """Récupération des infos du produit et du supplierinfo""" <|body_0|> def _onchange_sec_uom_qty(self): """Au changement de la qty, changement des autres qty""" <|body_1|> def...
stack_v2_sparse_classes_75kplus_train_072008
14,763
no_license
[ { "docstring": "Récupération des infos du produit et du supplierinfo", "name": "onchange_invoice_product_id", "signature": "def onchange_invoice_product_id(self, product_id, invoice)" }, { "docstring": "Au changement de la qty, changement des autres qty", "name": "_onchange_sec_uom_qty", ...
3
stack_v2_sparse_classes_30k_train_005164
Implement the Python class `AccountInvoiceLine` described below. Class description: Implement the AccountInvoiceLine class. Method signatures and docstrings: - def onchange_invoice_product_id(self, product_id, invoice): Récupération des infos du produit et du supplierinfo - def _onchange_sec_uom_qty(self): Au changem...
Implement the Python class `AccountInvoiceLine` described below. Class description: Implement the AccountInvoiceLine class. Method signatures and docstrings: - def onchange_invoice_product_id(self, product_id, invoice): Récupération des infos du produit et du supplierinfo - def _onchange_sec_uom_qty(self): Au changem...
eb394e1f79ba1995da2dcd81adfdd511c22caff9
<|skeleton|> class AccountInvoiceLine: def onchange_invoice_product_id(self, product_id, invoice): """Récupération des infos du produit et du supplierinfo""" <|body_0|> def _onchange_sec_uom_qty(self): """Au changement de la qty, changement des autres qty""" <|body_1|> def...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AccountInvoiceLine: def onchange_invoice_product_id(self, product_id, invoice): """Récupération des infos du produit et du supplierinfo""" res = super(AccountInvoiceLine, self).onchange_invoice_product_id(product_id, invoice) if isinstance(product_id, int): product_id = sel...
the_stack_v2_python_sparse
OpenPROD/openprod-addons/purchase/account_invoice.py
kazacube-mziouadi/ceci
train
0
b6c9b93c5f37b81f09f14ed995acbaa3151081e4
[ "self.is_file_like = is_file_like(path)\nif not self.is_file_like:\n self.lock_path = path + '.lock'\n self._fhandle = None", "if self.is_file_like:\n return\nself._fhandle = open(self.lock_path, 'wb+')\nif sys.platform.startswith('win'):\n locked = False\n while not locked:\n try:\n ...
<|body_start_0|> self.is_file_like = is_file_like(path) if not self.is_file_like: self.lock_path = path + '.lock' self._fhandle = None <|end_body_0|> <|body_start_1|> if self.is_file_like: return self._fhandle = open(self.lock_path, 'wb+') if ...
Context manager that locks a file for exclusive access. Has no effect for file-like objects.
LockFile
[ "Apache-2.0", "BSD-3-Clause", "MIT", "ISC", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LockFile: """Context manager that locks a file for exclusive access. Has no effect for file-like objects.""" def __init__(self, path): """Args: path (str): The path to the file.""" <|body_0|> def __enter__(self): """Locks the file by creating a temporary `.lock` ...
stack_v2_sparse_classes_75kplus_train_072009
32,552
permissive
[ { "docstring": "Args: path (str): The path to the file.", "name": "__init__", "signature": "def __init__(self, path)" }, { "docstring": "Locks the file by creating a temporary `.lock` file and acquiring exclusive access to it. Returns: file-like: The open file object.", "name": "__enter__", ...
3
stack_v2_sparse_classes_30k_train_021020
Implement the Python class `LockFile` described below. Class description: Context manager that locks a file for exclusive access. Has no effect for file-like objects. Method signatures and docstrings: - def __init__(self, path): Args: path (str): The path to the file. - def __enter__(self): Locks the file by creating...
Implement the Python class `LockFile` described below. Class description: Context manager that locks a file for exclusive access. Has no effect for file-like objects. Method signatures and docstrings: - def __init__(self, path): Args: path (str): The path to the file. - def __enter__(self): Locks the file by creating...
a167852705d74bcc619d8fad0af4b9e4d84472fc
<|skeleton|> class LockFile: """Context manager that locks a file for exclusive access. Has no effect for file-like objects.""" def __init__(self, path): """Args: path (str): The path to the file.""" <|body_0|> def __enter__(self): """Locks the file by creating a temporary `.lock` ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LockFile: """Context manager that locks a file for exclusive access. Has no effect for file-like objects.""" def __init__(self, path): """Args: path (str): The path to the file.""" self.is_file_like = is_file_like(path) if not self.is_file_like: self.lock_path = path +...
the_stack_v2_python_sparse
tools/Polygraphy/polygraphy/util/util.py
NVIDIA/TensorRT
train
8,026
f128e0c6b367f85e005a274cda3023d9873401ba
[ "self.__base_output_dir = base_output_dir\nself.__satellite_tle = satellite_tle\nself.__ground_station = ground_station\nself.__tz = tz\nself.__report_timezone = tz.tzname(datetime.now())\nself.__start_day = start_day\nself.__end_day = end_day\nself.__out = sys.stdout", "end = start = datetime.now()\nstart = star...
<|body_start_0|> self.__base_output_dir = base_output_dir self.__satellite_tle = satellite_tle self.__ground_station = ground_station self.__tz = tz self.__report_timezone = tz.tzname(datetime.now()) self.__start_day = start_day self.__end_day = end_day se...
Class to create a list of inviews report for a given satellite and ground station for a specific time period
InviewListReportGenerator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class InviewListReportGenerator: """Class to create a list of inviews report for a given satellite and ground station for a specific time period""" def __init__(self, base_output_dir, satellite_tle, ground_station, tz, start_day=0, end_day=0): """Constructor""" <|body_0|> def ...
stack_v2_sparse_classes_75kplus_train_072010
2,403
no_license
[ { "docstring": "Constructor", "name": "__init__", "signature": "def __init__(self, base_output_dir, satellite_tle, ground_station, tz, start_day=0, end_day=0)" }, { "docstring": "Method to generate the inview report", "name": "generate_report", "signature": "def generate_report(self)" ...
2
stack_v2_sparse_classes_30k_train_038712
Implement the Python class `InviewListReportGenerator` described below. Class description: Class to create a list of inviews report for a given satellite and ground station for a specific time period Method signatures and docstrings: - def __init__(self, base_output_dir, satellite_tle, ground_station, tz, start_day=0...
Implement the Python class `InviewListReportGenerator` described below. Class description: Class to create a list of inviews report for a given satellite and ground station for a specific time period Method signatures and docstrings: - def __init__(self, base_output_dir, satellite_tle, ground_station, tz, start_day=0...
0eed643eeaa9bcc35020b0b38399c25b616421c2
<|skeleton|> class InviewListReportGenerator: """Class to create a list of inviews report for a given satellite and ground station for a specific time period""" def __init__(self, base_output_dir, satellite_tle, ground_station, tz, start_day=0, end_day=0): """Constructor""" <|body_0|> def ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class InviewListReportGenerator: """Class to create a list of inviews report for a given satellite and ground station for a specific time period""" def __init__(self, base_output_dir, satellite_tle, ground_station, tz, start_day=0, end_day=0): """Constructor""" self.__base_output_dir = base_out...
the_stack_v2_python_sparse
scripts/inview_list_report_generator.py
nasa-itc/OrbitInviewPowerPrediction
train
0
3bce24aa669609dbf40955b70ee6340e20bdf00a
[ "version_url = self._get_base_version_url()\nresp, body = self.raw_request(version_url, 'GET')\nself._error_checker(resp, body)\nbody = json.loads(body)\nself.validate_response(schema.list_versions, resp, body)\nreturn rest_client.ResponseBody(resp, body)", "version_url = urljoin(self._get_base_version_url(), ver...
<|body_start_0|> version_url = self._get_base_version_url() resp, body = self.raw_request(version_url, 'GET') self._error_checker(resp, body) body = json.loads(body) self.validate_response(schema.list_versions, resp, body) return rest_client.ResponseBody(resp, body) <|end...
VersionsClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VersionsClient: def list_versions(self): """List API versions For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/block-storage/v3/#list-all-api-versions""" <|body_0|> def show_version(self, version): ...
stack_v2_sparse_classes_75kplus_train_072011
2,524
permissive
[ { "docstring": "List API versions For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/block-storage/v3/#list-all-api-versions", "name": "list_versions", "signature": "def list_versions(self)" }, { "docstring": "Show API version ...
2
stack_v2_sparse_classes_30k_train_053707
Implement the Python class `VersionsClient` described below. Class description: Implement the VersionsClient class. Method signatures and docstrings: - def list_versions(self): List API versions For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/blo...
Implement the Python class `VersionsClient` described below. Class description: Implement the VersionsClient class. Method signatures and docstrings: - def list_versions(self): List API versions For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/blo...
3932a799e620a20d7abf7b89e21b520683a1809b
<|skeleton|> class VersionsClient: def list_versions(self): """List API versions For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/block-storage/v3/#list-all-api-versions""" <|body_0|> def show_version(self, version): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class VersionsClient: def list_versions(self): """List API versions For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/block-storage/v3/#list-all-api-versions""" version_url = self._get_base_version_url() resp, body = self....
the_stack_v2_python_sparse
tempest/lib/services/volume/v3/versions_client.py
openstack/tempest
train
270
0d6309c20137340972ab4833703a9c67f7de943b
[ "self.u0 = u0.copy()\nself.t0 = 0.0\nself.dt = dt\nself.h = h\nself.lbnd = lbnd\nself.ubnd = ubnd\nself.g = g\nself.d = g * dt / h ** 2\nd = self.d\nm = len(u0)\nself.A = 2 * (1 + d) * np.eye(m) - d * np.eye(m, k=1) - d * np.eye(m, k=-1)", "h = self.h\ndt = self.dt\nlbnd = self.lbnd\nubnd = self.ubnd\nd = self.d\...
<|body_start_0|> self.u0 = u0.copy() self.t0 = 0.0 self.dt = dt self.h = h self.lbnd = lbnd self.ubnd = ubnd self.g = g self.d = g * dt / h ** 2 d = self.d m = len(u0) self.A = 2 * (1 + d) * np.eye(m) - d * np.eye(m, k=1) - d * np.e...
線形拡散方程式のソルバ(1d) 支配方程式: ∂u/∂t = g * ∂/∂x(∂u/∂x) 手法: Crank–Nicolson 法 Attributes ---------- u0 : ndarray, shape (m,) 初期条件.u(x, t_0) を意味する。 t0 : float イテレーション開始時刻を保持する. h : float 空間の刻み幅 dt : float 時間の刻み幅 lbnd : float 境界条件.u(x_0, t) の値.Dirichlet 境界条件において定数が与えられた場合に対応する. ubnd : float 境界条件.u(x_1, t) の値.lbnd と同様. g : float 拡散...
Diffusion1d
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Diffusion1d: """線形拡散方程式のソルバ(1d) 支配方程式: ∂u/∂t = g * ∂/∂x(∂u/∂x) 手法: Crank–Nicolson 法 Attributes ---------- u0 : ndarray, shape (m,) 初期条件.u(x, t_0) を意味する。 t0 : float イテレーション開始時刻を保持する. h : float 空間の刻み幅 dt : float 時間の刻み幅 lbnd : float 境界条件.u(x_0, t) の値.Dirichlet 境界条件において定数が与えられた場合に対応する. ubnd : float 境...
stack_v2_sparse_classes_75kplus_train_072012
3,258
no_license
[ { "docstring": "Parameters ---------- u0 : ndarray, shape (n,) 初期条件.u(x, t_0) を意味する。 h : float 空間の刻み幅 dt : float 時間の刻み幅 lbnd : float 境界条件.u(x_0, t) の値.Dirichlet 境界条件において定数が与えられた場合に対応する. ubnd : float 境界条件.u(x_1, t) の値.lbnd と同様. g : float 拡散係数", "name": "__init__", "signature": "def __init__(self, u0, h, ...
2
stack_v2_sparse_classes_30k_train_046913
Implement the Python class `Diffusion1d` described below. Class description: 線形拡散方程式のソルバ(1d) 支配方程式: ∂u/∂t = g * ∂/∂x(∂u/∂x) 手法: Crank–Nicolson 法 Attributes ---------- u0 : ndarray, shape (m,) 初期条件.u(x, t_0) を意味する。 t0 : float イテレーション開始時刻を保持する. h : float 空間の刻み幅 dt : float 時間の刻み幅 lbnd : float 境界条件.u(x_0, t) の値.Dirichlet ...
Implement the Python class `Diffusion1d` described below. Class description: 線形拡散方程式のソルバ(1d) 支配方程式: ∂u/∂t = g * ∂/∂x(∂u/∂x) 手法: Crank–Nicolson 法 Attributes ---------- u0 : ndarray, shape (m,) 初期条件.u(x, t_0) を意味する。 t0 : float イテレーション開始時刻を保持する. h : float 空間の刻み幅 dt : float 時間の刻み幅 lbnd : float 境界条件.u(x_0, t) の値.Dirichlet ...
b989fea731be95b67e8bba9f57aeeb503c4a7ee3
<|skeleton|> class Diffusion1d: """線形拡散方程式のソルバ(1d) 支配方程式: ∂u/∂t = g * ∂/∂x(∂u/∂x) 手法: Crank–Nicolson 法 Attributes ---------- u0 : ndarray, shape (m,) 初期条件.u(x, t_0) を意味する。 t0 : float イテレーション開始時刻を保持する. h : float 空間の刻み幅 dt : float 時間の刻み幅 lbnd : float 境界条件.u(x_0, t) の値.Dirichlet 境界条件において定数が与えられた場合に対応する. ubnd : float 境...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Diffusion1d: """線形拡散方程式のソルバ(1d) 支配方程式: ∂u/∂t = g * ∂/∂x(∂u/∂x) 手法: Crank–Nicolson 法 Attributes ---------- u0 : ndarray, shape (m,) 初期条件.u(x, t_0) を意味する。 t0 : float イテレーション開始時刻を保持する. h : float 空間の刻み幅 dt : float 時間の刻み幅 lbnd : float 境界条件.u(x_0, t) の値.Dirichlet 境界条件において定数が与えられた場合に対応する. ubnd : float 境界条件.u(x_1, t)...
the_stack_v2_python_sparse
numerical/pde/diffusion_1d.py
kotoji/numerical
train
0
04e2071b8ed8d96c1baaa8e0968d1ca1fb01af4e
[ "nr = len(matrix)\nif nr == 0:\n self.mat = []\n return\nnc = len(matrix[0])\nif nc == 0:\n self.mat = []\n return\nself.mat = [[0] * nc for _ in range(nr)]\nself.mat[0][0] = matrix[0][0]\nfor r in range(1, nr):\n self.mat[r][0] = self.mat[r - 1][0] + matrix[r][0]\nfor c in range(1, nc):\n self.ma...
<|body_start_0|> nr = len(matrix) if nr == 0: self.mat = [] return nc = len(matrix[0]) if nc == 0: self.mat = [] return self.mat = [[0] * nc for _ in range(nr)] self.mat[0][0] = matrix[0][0] for r in range(1, nr): ...
NumMatrix
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" <|body_0|> def sumRegion(self, row1, col1, row2, col2): """:type row1: int :type col1: int :type row2: int :type col2: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|>...
stack_v2_sparse_classes_75kplus_train_072013
1,767
no_license
[ { "docstring": ":type matrix: List[List[int]]", "name": "__init__", "signature": "def __init__(self, matrix)" }, { "docstring": ":type row1: int :type col1: int :type row2: int :type col2: int :rtype: int", "name": "sumRegion", "signature": "def sumRegion(self, row1, col1, row2, col2)" ...
2
stack_v2_sparse_classes_30k_train_026433
Implement the Python class `NumMatrix` described below. Class description: Implement the NumMatrix class. Method signatures and docstrings: - def __init__(self, matrix): :type matrix: List[List[int]] - def sumRegion(self, row1, col1, row2, col2): :type row1: int :type col1: int :type row2: int :type col2: int :rtype:...
Implement the Python class `NumMatrix` described below. Class description: Implement the NumMatrix class. Method signatures and docstrings: - def __init__(self, matrix): :type matrix: List[List[int]] - def sumRegion(self, row1, col1, row2, col2): :type row1: int :type col1: int :type row2: int :type col2: int :rtype:...
0b0911851bad871b1da66fa5b8731b96bf9c313a
<|skeleton|> class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" <|body_0|> def sumRegion(self, row1, col1, row2, col2): """:type row1: int :type col1: int :type row2: int :type col2: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" nr = len(matrix) if nr == 0: self.mat = [] return nc = len(matrix[0]) if nc == 0: self.mat = [] return self.mat = [[0] * nc for _ in range(...
the_stack_v2_python_sparse
304. Range Sum Query 2D - Immutable/Solution1.py
ChenPH0522/LeetCode
train
0
37d253a8a5378f92a7885a3e9d7312a73c94ab25
[ "current_dir = os.path.dirname(os.path.abspath(__file__))\nself.test_dir = current_dir + '/component_test/'\ncomp = component_main.Component()\nrandom_num = int(random.random() * 1000)\nself.tmp_dir = '/tmp/test_{{}}_{{}}/'.format(comp.component_name, random_num)\nos.mkdir(self.tmp_dir)", "component = component_m...
<|body_start_0|> current_dir = os.path.dirname(os.path.abspath(__file__)) self.test_dir = current_dir + '/component_test/' comp = component_main.Component() random_num = int(random.random() * 1000) self.tmp_dir = '/tmp/test_{{}}_{{}}/'.format(comp.component_name, random_num) ...
Test the seed by running it with some sample data and comparing the output with what's expected. The functions in component_main are tested as well.
TestSeed
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestSeed: """Test the seed by running it with some sample data and comparing the output with what's expected. The functions in component_main are tested as well.""" def setUp(self): """Set a few common variables.""" <|body_0|> def setup_component(self, args): """...
stack_v2_sparse_classes_75kplus_train_072014
5,068
no_license
[ { "docstring": "Set a few common variables.", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Create uniform Component instances.", "name": "setup_component", "signature": "def setup_component(self, args)" }, { "docstring": "Build and run commands based on cmd ...
4
null
Implement the Python class `TestSeed` described below. Class description: Test the seed by running it with some sample data and comparing the output with what's expected. The functions in component_main are tested as well. Method signatures and docstrings: - def setUp(self): Set a few common variables. - def setup_co...
Implement the Python class `TestSeed` described below. Class description: Test the seed by running it with some sample data and comparing the output with what's expected. The functions in component_main are tested as well. Method signatures and docstrings: - def setUp(self): Set a few common variables. - def setup_co...
77639a138e520506e4395cade8ca27b4e6a377c6
<|skeleton|> class TestSeed: """Test the seed by running it with some sample data and comparing the output with what's expected. The functions in component_main are tested as well.""" def setUp(self): """Set a few common variables.""" <|body_0|> def setup_component(self, args): """...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestSeed: """Test the seed by running it with some sample data and comparing the output with what's expected. The functions in component_main are tested as well.""" def setUp(self): """Set a few common variables.""" current_dir = os.path.dirname(os.path.abspath(__file__)) self.tes...
the_stack_v2_python_sparse
automake_component/component_template/component_test.py
morinlab/lab_scripts
train
6
cd3edbaa5672c8653dba9d4566009a9b61f5d5e3
[ "if not settings.DEBUG:\n return {}\nreturn {'athlete': {'name': 'Domen Blenkuš', 'age': '28', 'weight': 74.5}, 'measurements': [{'time': 180, 'power': 443}, {'time': 300, 'power': 386}, {'time': 720, 'power': 347}]}", "with transaction.atomic():\n athlete = forms['athlete'].save(contributor=self.request.us...
<|body_start_0|> if not settings.DEBUG: return {} return {'athlete': {'name': 'Domen Blenkuš', 'age': '28', 'weight': 74.5}, 'measurements': [{'time': 180, 'power': 443}, {'time': 300, 'power': 386}, {'time': 720, 'power': 347}]} <|end_body_0|> <|body_start_1|> with transaction.atom...
Critical Power Test view.
CriticalPowerTestView
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CriticalPowerTestView: """Critical Power Test view.""" def get_initial(self): """Return initial values if ``DEBUG`` setting is set to ``True``.""" <|body_0|> def _save_data(self, forms): """Save data.""" <|body_1|> def forms_valid(self, forms): ...
stack_v2_sparse_classes_75kplus_train_072015
2,682
permissive
[ { "docstring": "Return initial values if ``DEBUG`` setting is set to ``True``.", "name": "get_initial", "signature": "def get_initial(self)" }, { "docstring": "Save data.", "name": "_save_data", "signature": "def _save_data(self, forms)" }, { "docstring": "Save data, make report ...
3
stack_v2_sparse_classes_30k_train_034471
Implement the Python class `CriticalPowerTestView` described below. Class description: Critical Power Test view. Method signatures and docstrings: - def get_initial(self): Return initial values if ``DEBUG`` setting is set to ``True``. - def _save_data(self, forms): Save data. - def forms_valid(self, forms): Save data...
Implement the Python class `CriticalPowerTestView` described below. Class description: Critical Power Test view. Method signatures and docstrings: - def get_initial(self): Return initial values if ``DEBUG`` setting is set to ``True``. - def _save_data(self, forms): Save data. - def forms_valid(self, forms): Save data...
bae6105812c2f2414d0c10ddd465bf589503f61a
<|skeleton|> class CriticalPowerTestView: """Critical Power Test view.""" def get_initial(self): """Return initial values if ``DEBUG`` setting is set to ``True``.""" <|body_0|> def _save_data(self, forms): """Save data.""" <|body_1|> def forms_valid(self, forms): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CriticalPowerTestView: """Critical Power Test view.""" def get_initial(self): """Return initial values if ``DEBUG`` setting is set to ``True``.""" if not settings.DEBUG: return {} return {'athlete': {'name': 'Domen Blenkuš', 'age': '28', 'weight': 74.5}, 'measurements'...
the_stack_v2_python_sparse
src/lactolyse/views/critical_power.py
dblenkus/lactolyse
train
2
ecde8275229eb326b3b62dec9e27fd0dc93220ec
[ "shared_weight_names = []\nfor shared_weight_name, repeated_node_list in GlobalContext().repeated_weights.items():\n if node.onnx_name in repeated_node_list:\n shared_weight_names.append(shared_weight_name)\nreturn shared_weight_names", "default_weight_name = f'passthrough_w_{module_to_be_registered.sha...
<|body_start_0|> shared_weight_names = [] for shared_weight_name, repeated_node_list in GlobalContext().repeated_weights.items(): if node.onnx_name in repeated_node_list: shared_weight_names.append(shared_weight_name) return shared_weight_names <|end_body_0|> <|body_...
Helper function to process shared weights.
SharedWeightHelper
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SharedWeightHelper: """Helper function to process shared weights.""" def check_node_has_shared_weight(node: NodeStruct): """Check the node has shared weight and return all of them. Args: node (NodeStruct): NodeStruct instance. Returns: list, a list of shared weight onnx names""" ...
stack_v2_sparse_classes_75kplus_train_072016
4,646
permissive
[ { "docstring": "Check the node has shared weight and return all of them. Args: node (NodeStruct): NodeStruct instance. Returns: list, a list of shared weight onnx names", "name": "check_node_has_shared_weight", "signature": "def check_node_has_shared_weight(node: NodeStruct)" }, { "docstring": "...
5
stack_v2_sparse_classes_30k_train_026181
Implement the Python class `SharedWeightHelper` described below. Class description: Helper function to process shared weights. Method signatures and docstrings: - def check_node_has_shared_weight(node: NodeStruct): Check the node has shared weight and return all of them. Args: node (NodeStruct): NodeStruct instance. ...
Implement the Python class `SharedWeightHelper` described below. Class description: Helper function to process shared weights. Method signatures and docstrings: - def check_node_has_shared_weight(node: NodeStruct): Check the node has shared weight and return all of them. Args: node (NodeStruct): NodeStruct instance. ...
9073ef36d7f750c72262c87779e77e7c3602dd83
<|skeleton|> class SharedWeightHelper: """Helper function to process shared weights.""" def check_node_has_shared_weight(node: NodeStruct): """Check the node has shared weight and return all of them. Args: node (NodeStruct): NodeStruct instance. Returns: list, a list of shared weight onnx names""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SharedWeightHelper: """Helper function to process shared weights.""" def check_node_has_shared_weight(node: NodeStruct): """Check the node has shared weight and return all of them. Args: node (NodeStruct): NodeStruct instance. Returns: list, a list of shared weight onnx names""" shared_we...
the_stack_v2_python_sparse
mindinsight/mindconverter/graph_based_converter/generator/shared_weights.py
nimengliusha/mindinsight
train
0
0a8ac351d92f30d2694341ff6977d3a26435cef4
[ "q1 = [node]\nans = Node(node.val, [])\nq2 = [ans]\nvisited = set()\nwhile q1:\n cur1 = q1.pop()\n cur2 = q2.pop()\n visited.add(cur1)\n for neighbor in cur1.neighbors:\n if neighbor in visited:\n continue\n if neighbor not in q1:\n q1.append(neighbor)\n ne...
<|body_start_0|> q1 = [node] ans = Node(node.val, []) q2 = [ans] visited = set() while q1: cur1 = q1.pop() cur2 = q2.pop() visited.add(cur1) for neighbor in cur1.neighbors: if neighbor in visited: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def cloneGraph(self, node: 'Node') -> 'Node': """bfs""" <|body_0|> def cloneGraph1(self, node: 'Node') -> 'Node': """dfs""" <|body_1|> def cloneGraph2(self, node: 'Node') -> 'Node': """非递归 dfs""" <|body_2|> def cloneGraph3(...
stack_v2_sparse_classes_75kplus_train_072017
2,567
no_license
[ { "docstring": "bfs", "name": "cloneGraph", "signature": "def cloneGraph(self, node: 'Node') -> 'Node'" }, { "docstring": "dfs", "name": "cloneGraph1", "signature": "def cloneGraph1(self, node: 'Node') -> 'Node'" }, { "docstring": "非递归 dfs", "name": "cloneGraph2", "signat...
4
stack_v2_sparse_classes_30k_train_026037
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def cloneGraph(self, node: 'Node') -> 'Node': bfs - def cloneGraph1(self, node: 'Node') -> 'Node': dfs - def cloneGraph2(self, node: 'Node') -> 'Node': 非递归 dfs - def cloneGraph3(...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def cloneGraph(self, node: 'Node') -> 'Node': bfs - def cloneGraph1(self, node: 'Node') -> 'Node': dfs - def cloneGraph2(self, node: 'Node') -> 'Node': 非递归 dfs - def cloneGraph3(...
e2fecd266bfced6208694b19a2d81182b13dacd6
<|skeleton|> class Solution: def cloneGraph(self, node: 'Node') -> 'Node': """bfs""" <|body_0|> def cloneGraph1(self, node: 'Node') -> 'Node': """dfs""" <|body_1|> def cloneGraph2(self, node: 'Node') -> 'Node': """非递归 dfs""" <|body_2|> def cloneGraph3(...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def cloneGraph(self, node: 'Node') -> 'Node': """bfs""" q1 = [node] ans = Node(node.val, []) q2 = [ans] visited = set() while q1: cur1 = q1.pop() cur2 = q2.pop() visited.add(cur1) for neighbor in cur1.nei...
the_stack_v2_python_sparse
cloneGraph.py
HuipengXu/leetcode
train
0
6e335cccb6810cbf73e3b5f7183abf12f4069640
[ "for project_id, forwarding_rules in resource_from_api.iteritems():\n for rule in forwarding_rules:\n yield {'project_id': project_id, 'id': rule.get('id'), 'creation_timestamp': parser.format_timestamp(rule.get('creationTimestamp'), self.MYSQL_DATETIME_FORMAT), 'name': rule.get('name'), 'description': ru...
<|body_start_0|> for project_id, forwarding_rules in resource_from_api.iteritems(): for rule in forwarding_rules: yield {'project_id': project_id, 'id': rule.get('id'), 'creation_timestamp': parser.format_timestamp(rule.get('creationTimestamp'), self.MYSQL_DATETIME_FORMAT), 'name': r...
Load compute forwarding rules for all projects.
LoadForwardingRulesPipeline
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoadForwardingRulesPipeline: """Load compute forwarding rules for all projects.""" def _transform(self, resource_from_api): """Create an iterator of forwarding rules to load into database. TODO: truncate the region and target. Args: resource_from_api: A dict of forwarding rules, keye...
stack_v2_sparse_classes_75kplus_train_072018
4,005
permissive
[ { "docstring": "Create an iterator of forwarding rules to load into database. TODO: truncate the region and target. Args: resource_from_api: A dict of forwarding rules, keyed by project id, from GCP API. Yields: Iterator of forwarding rule properties in a dict.", "name": "_transform", "signature": "def ...
3
null
Implement the Python class `LoadForwardingRulesPipeline` described below. Class description: Load compute forwarding rules for all projects. Method signatures and docstrings: - def _transform(self, resource_from_api): Create an iterator of forwarding rules to load into database. TODO: truncate the region and target. ...
Implement the Python class `LoadForwardingRulesPipeline` described below. Class description: Load compute forwarding rules for all projects. Method signatures and docstrings: - def _transform(self, resource_from_api): Create an iterator of forwarding rules to load into database. TODO: truncate the region and target. ...
a6a1aa7464cda2ad5948e3e8876eb8dded5e2514
<|skeleton|> class LoadForwardingRulesPipeline: """Load compute forwarding rules for all projects.""" def _transform(self, resource_from_api): """Create an iterator of forwarding rules to load into database. TODO: truncate the region and target. Args: resource_from_api: A dict of forwarding rules, keye...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LoadForwardingRulesPipeline: """Load compute forwarding rules for all projects.""" def _transform(self, resource_from_api): """Create an iterator of forwarding rules to load into database. TODO: truncate the region and target. Args: resource_from_api: A dict of forwarding rules, keyed by project ...
the_stack_v2_python_sparse
google/cloud/security/inventory/pipelines/load_forwarding_rules_pipeline.py
shimizu19691210/forseti-security
train
1
08feff8ded758a44575a959bc56bbd3ea17d3ebb
[ "super(Worker, self).__init__(name='Worker-%d' % next(self._counter))\nself._queue = jobs_queue\nself._job = None", "logger.debug('%s started.', self.name)\nwhile True:\n self._job = self._queue.get()\n logger.info('%s picked up %s', self.name, self._job)\n try:\n if self._job == KILL_WORKER:\n ...
<|body_start_0|> super(Worker, self).__init__(name='Worker-%d' % next(self._counter)) self._queue = jobs_queue self._job = None <|end_body_0|> <|body_start_1|> logger.debug('%s started.', self.name) while True: self._job = self._queue.get() logger.info('%...
Worker
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Worker: def __init__(self, jobs_queue): """:param jobs_queue: queue with the jobs to execute :type jobs_queue: queue.Queue[LocalCommand]""" <|body_0|> def run(self): """Runs Worker thread which polls queue for commands and starts them.""" <|body_1|> <|end_sk...
stack_v2_sparse_classes_75kplus_train_072019
21,767
no_license
[ { "docstring": ":param jobs_queue: queue with the jobs to execute :type jobs_queue: queue.Queue[LocalCommand]", "name": "__init__", "signature": "def __init__(self, jobs_queue)" }, { "docstring": "Runs Worker thread which polls queue for commands and starts them.", "name": "run", "signat...
2
stack_v2_sparse_classes_30k_train_013928
Implement the Python class `Worker` described below. Class description: Implement the Worker class. Method signatures and docstrings: - def __init__(self, jobs_queue): :param jobs_queue: queue with the jobs to execute :type jobs_queue: queue.Queue[LocalCommand] - def run(self): Runs Worker thread which polls queue fo...
Implement the Python class `Worker` described below. Class description: Implement the Worker class. Method signatures and docstrings: - def __init__(self, jobs_queue): :param jobs_queue: queue with the jobs to execute :type jobs_queue: queue.Queue[LocalCommand] - def run(self): Runs Worker thread which polls queue fo...
20bcc179792c4f975eeeb0924a9f234599453090
<|skeleton|> class Worker: def __init__(self, jobs_queue): """:param jobs_queue: queue with the jobs to execute :type jobs_queue: queue.Queue[LocalCommand]""" <|body_0|> def run(self): """Runs Worker thread which polls queue for commands and starts them.""" <|body_1|> <|end_sk...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Worker: def __init__(self, jobs_queue): """:param jobs_queue: queue with the jobs to execute :type jobs_queue: queue.Queue[LocalCommand]""" super(Worker, self).__init__(name='Worker-%d' % next(self._counter)) self._queue = jobs_queue self._job = None def run(self): ...
the_stack_v2_python_sparse
slivka/scheduler/task_queue.py
stuartmac/Slivka
train
0
bbb3646e1a330727d0865249c26952ef6940a00e
[ "errors = {}\nif user_input is not None:\n self._async_abort_entries_match({CONF_HOST: user_input[CONF_HOST], CONF_NAME: user_input[CONF_NAME]})\n if not (error := (await self._async_try_connect(user_input[CONF_HOST]))):\n return self.async_create_entry(title=user_input[CONF_NAME], data=user_input)\n ...
<|body_start_0|> errors = {} if user_input is not None: self._async_abort_entries_match({CONF_HOST: user_input[CONF_HOST], CONF_NAME: user_input[CONF_NAME]}) if not (error := (await self._async_try_connect(user_input[CONF_HOST]))): return self.async_create_entry(t...
Handle a config flow for NFAndroidTV.
NFAndroidTVFlowHandler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NFAndroidTVFlowHandler: """Handle a config flow for NFAndroidTV.""" async def async_step_user(self, user_input: dict[str, Any] | None=None) -> FlowResult: """Handle a flow initiated by the user.""" <|body_0|> async def _async_try_connect(self, host: str) -> str | None: ...
stack_v2_sparse_classes_75kplus_train_072020
2,017
permissive
[ { "docstring": "Handle a flow initiated by the user.", "name": "async_step_user", "signature": "async def async_step_user(self, user_input: dict[str, Any] | None=None) -> FlowResult" }, { "docstring": "Try connecting to Android TV / Fire TV.", "name": "_async_try_connect", "signature": "...
2
stack_v2_sparse_classes_30k_train_014943
Implement the Python class `NFAndroidTVFlowHandler` described below. Class description: Handle a config flow for NFAndroidTV. Method signatures and docstrings: - async def async_step_user(self, user_input: dict[str, Any] | None=None) -> FlowResult: Handle a flow initiated by the user. - async def _async_try_connect(s...
Implement the Python class `NFAndroidTVFlowHandler` described below. Class description: Handle a config flow for NFAndroidTV. Method signatures and docstrings: - async def async_step_user(self, user_input: dict[str, Any] | None=None) -> FlowResult: Handle a flow initiated by the user. - async def _async_try_connect(s...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class NFAndroidTVFlowHandler: """Handle a config flow for NFAndroidTV.""" async def async_step_user(self, user_input: dict[str, Any] | None=None) -> FlowResult: """Handle a flow initiated by the user.""" <|body_0|> async def _async_try_connect(self, host: str) -> str | None: ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class NFAndroidTVFlowHandler: """Handle a config flow for NFAndroidTV.""" async def async_step_user(self, user_input: dict[str, Any] | None=None) -> FlowResult: """Handle a flow initiated by the user.""" errors = {} if user_input is not None: self._async_abort_entries_match(...
the_stack_v2_python_sparse
homeassistant/components/nfandroidtv/config_flow.py
home-assistant/core
train
35,501
b974d59bff93105082247195cb430080e94c99df
[ "mac_addr = self.parameter_value('mac_address', kwargs)\nif mac_addr:\n return self.new_query(nic.NIC).get(mac_addr)", "value = self.fetch_nic(kwargs)\nif not value:\n return self.set_status(404)\nLOGGER.warning('Deleting nic %s', value.id)\nself.database.delete(value)\nself.database.commit()\nself.set_stat...
<|body_start_0|> mac_addr = self.parameter_value('mac_address', kwargs) if mac_addr: return self.new_query(nic.NIC).get(mac_addr) <|end_body_0|> <|body_start_1|> value = self.fetch_nic(kwargs) if not value: return self.set_status(404) LOGGER.warning('Dele...
API interface for managing nic data
NIC
[ "BSD-3-Clause", "CC-BY-3.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NIC: """API interface for managing nic data""" def fetch_nic(self, kwargs): """Get a single nic from the database. :param dict kwargs: Keyword arguments from the request :rtype: apiary.mappers.nic.NIC""" <|body_0|> def delete(self, *args, **kwargs): """Delete a n...
stack_v2_sparse_classes_75kplus_train_072021
2,795
permissive
[ { "docstring": "Get a single nic from the database. :param dict kwargs: Keyword arguments from the request :rtype: apiary.mappers.nic.NIC", "name": "fetch_nic", "signature": "def fetch_nic(self, kwargs)" }, { "docstring": "Delete a nic from the nic. Accepts nic_id as a query parameter or in the ...
4
stack_v2_sparse_classes_30k_train_037054
Implement the Python class `NIC` described below. Class description: API interface for managing nic data Method signatures and docstrings: - def fetch_nic(self, kwargs): Get a single nic from the database. :param dict kwargs: Keyword arguments from the request :rtype: apiary.mappers.nic.NIC - def delete(self, *args, ...
Implement the Python class `NIC` described below. Class description: API interface for managing nic data Method signatures and docstrings: - def fetch_nic(self, kwargs): Get a single nic from the database. :param dict kwargs: Keyword arguments from the request :rtype: apiary.mappers.nic.NIC - def delete(self, *args, ...
0acd513b2bcbc9bb5f7c5a657b41ed6601fcd002
<|skeleton|> class NIC: """API interface for managing nic data""" def fetch_nic(self, kwargs): """Get a single nic from the database. :param dict kwargs: Keyword arguments from the request :rtype: apiary.mappers.nic.NIC""" <|body_0|> def delete(self, *args, **kwargs): """Delete a n...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class NIC: """API interface for managing nic data""" def fetch_nic(self, kwargs): """Get a single nic from the database. :param dict kwargs: Keyword arguments from the request :rtype: apiary.mappers.nic.NIC""" mac_addr = self.parameter_value('mac_address', kwargs) if mac_addr: ...
the_stack_v2_python_sparse
apiary/api/nics.py
gmr/apiary
train
0
2d2e7d354b77bc8a70f985e56aca6ca31f096873
[ "super(MyCriterion, self).__init__()\nself.m = m\nself.t = t", "distances = distances.reshape(-1)\nlabels1 = labels1.reshape(-1)\nlabels2 = labels2.reshape(-1)\nsize = distances.shape[0]\ny = torch.eq(labels1, labels2).long()\na = distances.clamp_min(self.t)\nb = (-distances + self.m).clamp_min(0)\nloss = y * a +...
<|body_start_0|> super(MyCriterion, self).__init__() self.m = m self.t = t <|end_body_0|> <|body_start_1|> distances = distances.reshape(-1) labels1 = labels1.reshape(-1) labels2 = labels2.reshape(-1) size = distances.shape[0] y = torch.eq(labels1, labels...
MyCriterion
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyCriterion: def __init__(self, m=0.8, t=0.05): """:param m: margin :param t: threshold""" <|body_0|> def forward(self, distances, labels1, labels2): """Loss = y * max(d, t) + (1 - y) * max(0, m - d) y = 1 if same labels; y = 0 if different labels :param distances: s...
stack_v2_sparse_classes_75kplus_train_072022
4,642
no_license
[ { "docstring": ":param m: margin :param t: threshold", "name": "__init__", "signature": "def __init__(self, m=0.8, t=0.05)" }, { "docstring": "Loss = y * max(d, t) + (1 - y) * max(0, m - d) y = 1 if same labels; y = 0 if different labels :param distances: shape: [b] :param labels1: shape: [b * 1...
2
stack_v2_sparse_classes_30k_train_015431
Implement the Python class `MyCriterion` described below. Class description: Implement the MyCriterion class. Method signatures and docstrings: - def __init__(self, m=0.8, t=0.05): :param m: margin :param t: threshold - def forward(self, distances, labels1, labels2): Loss = y * max(d, t) + (1 - y) * max(0, m - d) y =...
Implement the Python class `MyCriterion` described below. Class description: Implement the MyCriterion class. Method signatures and docstrings: - def __init__(self, m=0.8, t=0.05): :param m: margin :param t: threshold - def forward(self, distances, labels1, labels2): Loss = y * max(d, t) + (1 - y) * max(0, m - d) y =...
5bc05bb4c4fac9165a9f3edbad1cbfd836cbbb21
<|skeleton|> class MyCriterion: def __init__(self, m=0.8, t=0.05): """:param m: margin :param t: threshold""" <|body_0|> def forward(self, distances, labels1, labels2): """Loss = y * max(d, t) + (1 - y) * max(0, m - d) y = 1 if same labels; y = 0 if different labels :param distances: s...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MyCriterion: def __init__(self, m=0.8, t=0.05): """:param m: margin :param t: threshold""" super(MyCriterion, self).__init__() self.m = m self.t = t def forward(self, distances, labels1, labels2): """Loss = y * max(d, t) + (1 - y) * max(0, m - d) y = 1 if same labe...
the_stack_v2_python_sparse
metric.py
Jasolicon/Maha_Siamese_FSN
train
0
c96189ebfce94d6fc0409fb3207e1527e83bbc29
[ "self.__trie = np.zeros([200000, 26], dtype=np.int)\nself.__end = np.zeros(200000, dtype=np.int)\nself.__k = 1", "p = 0\nfor w in word:\n c = ord(w) - 97\n if not self.__trie[p][c]:\n self.__trie[p][c] = self.__k\n self.__k += 1\n p = self.__trie[p][c]\nself.__end[p] = 1", "p = 0\nfor w i...
<|body_start_0|> self.__trie = np.zeros([200000, 26], dtype=np.int) self.__end = np.zeros(200000, dtype=np.int) self.__k = 1 <|end_body_0|> <|body_start_1|> p = 0 for w in word: c = ord(w) - 97 if not self.__trie[p][c]: self.__trie[p][c] =...
Trie
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Trie: def __init__(self): """Initialize your data structure here.""" <|body_0|> def insert(self, word): """Inserts a word into the trie. :type word: str :rtype: None""" <|body_1|> def search(self, word): """Returns if the word is in the trie. :ty...
stack_v2_sparse_classes_75kplus_train_072023
1,603
no_license
[ { "docstring": "Initialize your data structure here.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Inserts a word into the trie. :type word: str :rtype: None", "name": "insert", "signature": "def insert(self, word)" }, { "docstring": "Returns if the w...
4
null
Implement the Python class `Trie` described below. Class description: Implement the Trie class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def insert(self, word): Inserts a word into the trie. :type word: str :rtype: None - def search(self, word): Returns if the wor...
Implement the Python class `Trie` described below. Class description: Implement the Trie class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def insert(self, word): Inserts a word into the trie. :type word: str :rtype: None - def search(self, word): Returns if the wor...
3bf3209791b902ec9086e230a3e3316aaced4a5f
<|skeleton|> class Trie: def __init__(self): """Initialize your data structure here.""" <|body_0|> def insert(self, word): """Inserts a word into the trie. :type word: str :rtype: None""" <|body_1|> def search(self, word): """Returns if the word is in the trie. :ty...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Trie: def __init__(self): """Initialize your data structure here.""" self.__trie = np.zeros([200000, 26], dtype=np.int) self.__end = np.zeros(200000, dtype=np.int) self.__k = 1 def insert(self, word): """Inserts a word into the trie. :type word: str :rtype: None"""...
the_stack_v2_python_sparse
LeetCode/208.py
yaoMYZ/LeetCode
train
0
1d398b6aad9a1c4400e3bc8d302806ad821363bf
[ "QtGui.QFrame.__init__(self, args[0])\nself.setObjectName(args[1])\nself.orientation = kwargs.get('orientation', 'horizontal')\nself.execution_mode = kwargs.get('executionMode', False)\nself.setFixedSize(-1)\nif self.orientation == 'horizontal':\n self.main_layout = QtGui.QHBoxLayout()\nelse:\n self.main_layo...
<|body_start_0|> QtGui.QFrame.__init__(self, args[0]) self.setObjectName(args[1]) self.orientation = kwargs.get('orientation', 'horizontal') self.execution_mode = kwargs.get('executionMode', False) self.setFixedSize(-1) if self.orientation == 'horizontal': sel...
Descript. :
Spacer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Spacer: """Descript. :""" def __init__(self, *args, **kwargs): """Descript. :""" <|body_0|> def setFixedSize(self, fixed_size): """Descript. :""" <|body_1|> def paintEvent(self, event): """Descript. :""" <|body_2|> <|end_skeleton|> ...
stack_v2_sparse_classes_75kplus_train_072024
46,303
no_license
[ { "docstring": "Descript. :", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Descript. :", "name": "setFixedSize", "signature": "def setFixedSize(self, fixed_size)" }, { "docstring": "Descript. :", "name": "paintEvent", "signatur...
3
stack_v2_sparse_classes_30k_train_013751
Implement the Python class `Spacer` described below. Class description: Descript. : Method signatures and docstrings: - def __init__(self, *args, **kwargs): Descript. : - def setFixedSize(self, fixed_size): Descript. : - def paintEvent(self, event): Descript. :
Implement the Python class `Spacer` described below. Class description: Descript. : Method signatures and docstrings: - def __init__(self, *args, **kwargs): Descript. : - def setFixedSize(self, fixed_size): Descript. : - def paintEvent(self, event): Descript. : <|skeleton|> class Spacer: """Descript. :""" d...
11486d6c91fc0077e967cb2321743466a7c1aa8b
<|skeleton|> class Spacer: """Descript. :""" def __init__(self, *args, **kwargs): """Descript. :""" <|body_0|> def setFixedSize(self, fixed_size): """Descript. :""" <|body_1|> def paintEvent(self, event): """Descript. :""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Spacer: """Descript. :""" def __init__(self, *args, **kwargs): """Descript. :""" QtGui.QFrame.__init__(self, args[0]) self.setObjectName(args[1]) self.orientation = kwargs.get('orientation', 'horizontal') self.execution_mode = kwargs.get('executionMode', False) ...
the_stack_v2_python_sparse
Utils/Qt4_GUIDisplay.py
douglasbeniz/BlissFramework
train
0
857984cd57a0a5d74f78c58258a87f1d0446673d
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "conte...
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
Missing associated documentation comment in .proto file.
TeacherOutServicer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TeacherOutServicer: """Missing associated documentation comment in .proto file.""" def CreateTeacher(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def ReadTeacher(self, request, context): """Missing associated ...
stack_v2_sparse_classes_75kplus_train_072025
9,337
no_license
[ { "docstring": "Missing associated documentation comment in .proto file.", "name": "CreateTeacher", "signature": "def CreateTeacher(self, request, context)" }, { "docstring": "Missing associated documentation comment in .proto file.", "name": "ReadTeacher", "signature": "def ReadTeacher(...
5
stack_v2_sparse_classes_30k_val_000132
Implement the Python class `TeacherOutServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def CreateTeacher(self, request, context): Missing associated documentation comment in .proto file. - def ReadTeacher(self, request, context)...
Implement the Python class `TeacherOutServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def CreateTeacher(self, request, context): Missing associated documentation comment in .proto file. - def ReadTeacher(self, request, context)...
de7bc0fa1dc299473e2e63dab58c1d49fde7df2f
<|skeleton|> class TeacherOutServicer: """Missing associated documentation comment in .proto file.""" def CreateTeacher(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def ReadTeacher(self, request, context): """Missing associated ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TeacherOutServicer: """Missing associated documentation comment in .proto file.""" def CreateTeacher(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!...
the_stack_v2_python_sparse
gateway/src/logic/protogen/outgoing/teacher_out_pb2_grpc.py
Mutestock/mini-project-loner-edition
train
0
fd2a58323f79b60005c9c24dec367e247843cdac
[ "if not isinstance(data, np.ndarray):\n data = np.array(data)\nif len(data.shape) == 1:\n data = data.reshape(-1, 1)\nself.data = data\nself.N, self.d = self.data.shape", "if not isinstance(new_data, np.ndarray):\n new_data = np.array(new_data)\nif len(new_data.shape) == 1:\n new_data = new_data.resha...
<|body_start_0|> if not isinstance(data, np.ndarray): data = np.array(data) if len(data.shape) == 1: data = data.reshape(-1, 1) self.data = data self.N, self.d = self.data.shape <|end_body_0|> <|body_start_1|> if not isinstance(new_data, np.ndarray): ...
This is a class of evaluating the histogram intersection kernel function. Attributes ---------- data : numpy.ndarray The array at which the histogram intersection kernel function is to evaluated. N, d : int, int The shape of data array. Methods ------- kernel_matrix(new_data) Evaluates the histogram intersection kernel...
HistogramIntersection
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HistogramIntersection: """This is a class of evaluating the histogram intersection kernel function. Attributes ---------- data : numpy.ndarray The array at which the histogram intersection kernel function is to evaluated. N, d : int, int The shape of data array. Methods ------- kernel_matrix(new_...
stack_v2_sparse_classes_75kplus_train_072026
3,589
no_license
[ { "docstring": "Parameters ---------- data : numpy.ndarray The array at which the histogram intersection kernel function is to evaluated.", "name": "__init__", "signature": "def __init__(self, data)" }, { "docstring": "Evaluates the histogram intersection kernel function at new_data. Each entry ...
3
stack_v2_sparse_classes_30k_train_017978
Implement the Python class `HistogramIntersection` described below. Class description: This is a class of evaluating the histogram intersection kernel function. Attributes ---------- data : numpy.ndarray The array at which the histogram intersection kernel function is to evaluated. N, d : int, int The shape of data ar...
Implement the Python class `HistogramIntersection` described below. Class description: This is a class of evaluating the histogram intersection kernel function. Attributes ---------- data : numpy.ndarray The array at which the histogram intersection kernel function is to evaluated. N, d : int, int The shape of data ar...
33193676029a9be8ca67a1272960f2111ea7d2e4
<|skeleton|> class HistogramIntersection: """This is a class of evaluating the histogram intersection kernel function. Attributes ---------- data : numpy.ndarray The array at which the histogram intersection kernel function is to evaluated. N, d : int, int The shape of data array. Methods ------- kernel_matrix(new_...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class HistogramIntersection: """This is a class of evaluating the histogram intersection kernel function. Attributes ---------- data : numpy.ndarray The array at which the histogram intersection kernel function is to evaluated. N, d : int, int The shape of data array. Methods ------- kernel_matrix(new_data) Evaluat...
the_stack_v2_python_sparse
histointersection.py
zhou-chenxi/kerneleval
train
0
86a23761fe225c0ed5b4ff994425ba711939678e
[ "self.name = 'ext_regularize_post_grad'\nself.weight_norm = weight_norm\nself.param_name = tolist(param_name)\nself.is_vector = is_vector", "for k, p in mainloop.updates.items():\n for pname in self.param_name:\n if pname in str(k):\n updated_W = mainloop.updates[k]\n if self.is_ve...
<|body_start_0|> self.name = 'ext_regularize_post_grad' self.weight_norm = weight_norm self.param_name = tolist(param_name) self.is_vector = is_vector <|end_body_0|> <|body_start_1|> for k, p in mainloop.updates.items(): for pname in self.param_name: ...
WeightNorm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WeightNorm: def __init__(self, is_vector=1, weight_norm=1.9365, param_name=['W']): """.. todo:: WRITEME""" <|body_0|> def exe(self, mainloop): """.. todo:: WRITEME""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.name = 'ext_regularize_post_grad...
stack_v2_sparse_classes_75kplus_train_072027
8,905
no_license
[ { "docstring": ".. todo:: WRITEME", "name": "__init__", "signature": "def __init__(self, is_vector=1, weight_norm=1.9365, param_name=['W'])" }, { "docstring": ".. todo:: WRITEME", "name": "exe", "signature": "def exe(self, mainloop)" } ]
2
stack_v2_sparse_classes_30k_train_035386
Implement the Python class `WeightNorm` described below. Class description: Implement the WeightNorm class. Method signatures and docstrings: - def __init__(self, is_vector=1, weight_norm=1.9365, param_name=['W']): .. todo:: WRITEME - def exe(self, mainloop): .. todo:: WRITEME
Implement the Python class `WeightNorm` described below. Class description: Implement the WeightNorm class. Method signatures and docstrings: - def __init__(self, is_vector=1, weight_norm=1.9365, param_name=['W']): .. todo:: WRITEME - def exe(self, mainloop): .. todo:: WRITEME <|skeleton|> class WeightNorm: def...
94fe4208f6450d603d37e5a376dc85d988c9f639
<|skeleton|> class WeightNorm: def __init__(self, is_vector=1, weight_norm=1.9365, param_name=['W']): """.. todo:: WRITEME""" <|body_0|> def exe(self, mainloop): """.. todo:: WRITEME""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class WeightNorm: def __init__(self, is_vector=1, weight_norm=1.9365, param_name=['W']): """.. todo:: WRITEME""" self.name = 'ext_regularize_post_grad' self.weight_norm = weight_norm self.param_name = tolist(param_name) self.is_vector = is_vector def exe(self, mainloop):...
the_stack_v2_python_sparse
cle/train/ext.py
kyunghyuncho/cle
train
1
12a0ddf1864c113bcc0eb160dc1a3e901977faba
[ "super().__init__(name=name)\nself.activation = activation\nself.normalize_final = normalize_final\nlayers = []\nfor index, output_size in enumerate(output_sizes):\n layers.append(hk.Linear(output_size=output_size, name='linear_%d' % index))\nself.layers = tuple(layers)", "num_layers = len(self.layers)\nout = ...
<|body_start_0|> super().__init__(name=name) self.activation = activation self.normalize_final = normalize_final layers = [] for index, output_size in enumerate(output_sizes): layers.append(hk.Linear(output_size=output_size, name='linear_%d' % index)) self.lay...
A multi-layer perceptron module. Mostly copy-pasted from hk.nets.Mlp.
MlpWithActivations
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MlpWithActivations: """A multi-layer perceptron module. Mostly copy-pasted from hk.nets.Mlp.""" def __init__(self, output_sizes: Iterable[int], activation: Callable[[jnp.ndarray], jnp.ndarray]=jax.nn.relu, normalize_final: int=Normalization.during_training, name: Optional[str]=None): ...
stack_v2_sparse_classes_75kplus_train_072028
9,442
permissive
[ { "docstring": "Constructs an MLP where the last layer activation is available. Args: output_sizes: Sequence of layer sizes. activation: Activation function to apply between :class:`~haiku.Linear` layers. Defaults to ReLU. normalize_final: How to normalize the activations of the penultimate layer. name: Optiona...
2
null
Implement the Python class `MlpWithActivations` described below. Class description: A multi-layer perceptron module. Mostly copy-pasted from hk.nets.Mlp. Method signatures and docstrings: - def __init__(self, output_sizes: Iterable[int], activation: Callable[[jnp.ndarray], jnp.ndarray]=jax.nn.relu, normalize_final: i...
Implement the Python class `MlpWithActivations` described below. Class description: A multi-layer perceptron module. Mostly copy-pasted from hk.nets.Mlp. Method signatures and docstrings: - def __init__(self, output_sizes: Iterable[int], activation: Callable[[jnp.ndarray], jnp.ndarray]=jax.nn.relu, normalize_final: i...
cc2e3de49c29f29852c8cd5885ab54fb6e664e2e
<|skeleton|> class MlpWithActivations: """A multi-layer perceptron module. Mostly copy-pasted from hk.nets.Mlp.""" def __init__(self, output_sizes: Iterable[int], activation: Callable[[jnp.ndarray], jnp.ndarray]=jax.nn.relu, normalize_final: int=Normalization.during_training, name: Optional[str]=None): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MlpWithActivations: """A multi-layer perceptron module. Mostly copy-pasted from hk.nets.Mlp.""" def __init__(self, output_sizes: Iterable[int], activation: Callable[[jnp.ndarray], jnp.ndarray]=jax.nn.relu, normalize_final: int=Normalization.during_training, name: Optional[str]=None): """Construct...
the_stack_v2_python_sparse
neural_testbed/agents/factories/deep_kernel.py
Aakanksha-Rana/neural_testbed
train
0
c44bbb1f7d75577a6f97aab7bd339f626d5445b5
[ "pygame.init()\npygame.joystick.init()\nself.controller = pygame.joystick.Joystick(0)\nself.controller.init()\nself.ps4_speed = 0", "if not self.axis_data:\n self.axis_data = {}\nif not self.button_data:\n self.button_data = {}\n for i in range(self.controller.get_numbuttons()):\n self.button_data...
<|body_start_0|> pygame.init() pygame.joystick.init() self.controller = pygame.joystick.Joystick(0) self.controller.init() self.ps4_speed = 0 <|end_body_0|> <|body_start_1|> if not self.axis_data: self.axis_data = {} if not self.button_data: ...
Class representing the PS4 controller. Pretty straightforward functionality.
PS4Controller
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PS4Controller: """Class representing the PS4 controller. Pretty straightforward functionality.""" def __init__(self): """Initialize the joystick components""" <|body_0|> def listen(self): """Listen for events to happen""" <|body_1|> <|end_skeleton|> <|b...
stack_v2_sparse_classes_75kplus_train_072029
1,800
no_license
[ { "docstring": "Initialize the joystick components", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Listen for events to happen", "name": "listen", "signature": "def listen(self)" } ]
2
stack_v2_sparse_classes_30k_train_013235
Implement the Python class `PS4Controller` described below. Class description: Class representing the PS4 controller. Pretty straightforward functionality. Method signatures and docstrings: - def __init__(self): Initialize the joystick components - def listen(self): Listen for events to happen
Implement the Python class `PS4Controller` described below. Class description: Class representing the PS4 controller. Pretty straightforward functionality. Method signatures and docstrings: - def __init__(self): Initialize the joystick components - def listen(self): Listen for events to happen <|skeleton|> class PS4...
3b692da60226340e3e1337c9216b60acd9540250
<|skeleton|> class PS4Controller: """Class representing the PS4 controller. Pretty straightforward functionality.""" def __init__(self): """Initialize the joystick components""" <|body_0|> def listen(self): """Listen for events to happen""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PS4Controller: """Class representing the PS4 controller. Pretty straightforward functionality.""" def __init__(self): """Initialize the joystick components""" pygame.init() pygame.joystick.init() self.controller = pygame.joystick.Joystick(0) self.controller.init() ...
the_stack_v2_python_sparse
COPY/ps4_test.py
MitchVeenendaal/smarterdam
train
0
f8c77f184a20988fcb965264a7e9b5d44220bd56
[ "super().__init__(coordinator)\nself.entity_description = sensor_description\ndevice_name = data.name.title()\nself._attr_unique_id = f'{unique_id}_{sensor_description.key}'\nself._attr_device_info = DeviceInfo(identifiers={(DOMAIN, unique_id)}, name=device_name)\nself._attr_device_info.update(_get_nut_device_info(...
<|body_start_0|> super().__init__(coordinator) self.entity_description = sensor_description device_name = data.name.title() self._attr_unique_id = f'{unique_id}_{sensor_description.key}' self._attr_device_info = DeviceInfo(identifiers={(DOMAIN, unique_id)}, name=device_name) ...
Representation of a sensor entity for NUT status values.
NUTSensor
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NUTSensor: """Representation of a sensor entity for NUT status values.""" def __init__(self, coordinator: DataUpdateCoordinator[dict[str, str]], sensor_description: SensorEntityDescription, data: PyNUTData, unique_id: str) -> None: """Initialize the sensor.""" <|body_0|> ...
stack_v2_sparse_classes_75kplus_train_072030
29,032
permissive
[ { "docstring": "Initialize the sensor.", "name": "__init__", "signature": "def __init__(self, coordinator: DataUpdateCoordinator[dict[str, str]], sensor_description: SensorEntityDescription, data: PyNUTData, unique_id: str) -> None" }, { "docstring": "Return entity state from ups.", "name": ...
2
stack_v2_sparse_classes_30k_val_000400
Implement the Python class `NUTSensor` described below. Class description: Representation of a sensor entity for NUT status values. Method signatures and docstrings: - def __init__(self, coordinator: DataUpdateCoordinator[dict[str, str]], sensor_description: SensorEntityDescription, data: PyNUTData, unique_id: str) -...
Implement the Python class `NUTSensor` described below. Class description: Representation of a sensor entity for NUT status values. Method signatures and docstrings: - def __init__(self, coordinator: DataUpdateCoordinator[dict[str, str]], sensor_description: SensorEntityDescription, data: PyNUTData, unique_id: str) -...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class NUTSensor: """Representation of a sensor entity for NUT status values.""" def __init__(self, coordinator: DataUpdateCoordinator[dict[str, str]], sensor_description: SensorEntityDescription, data: PyNUTData, unique_id: str) -> None: """Initialize the sensor.""" <|body_0|> ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class NUTSensor: """Representation of a sensor entity for NUT status values.""" def __init__(self, coordinator: DataUpdateCoordinator[dict[str, str]], sensor_description: SensorEntityDescription, data: PyNUTData, unique_id: str) -> None: """Initialize the sensor.""" super().__init__(coordinator...
the_stack_v2_python_sparse
homeassistant/components/nut/sensor.py
home-assistant/core
train
35,501
e23c611eef6184227698000f33da0114c9df3191
[ "try:\n\n def generate(vo):\n for subscription in list_subscriptions(name=name, account=account, vo=vo):\n yield (render_json(**subscription) + '\\n')\n return try_stream(generate(vo=request.environ.get('vo')))\nexcept SubscriptionNotFound as error:\n return generate_http_error_flask(404,...
<|body_start_0|> try: def generate(vo): for subscription in list_subscriptions(name=name, account=account, vo=vo): yield (render_json(**subscription) + '\n') return try_stream(generate(vo=request.environ.get('vo'))) except SubscriptionNotFound...
REST APIs for subscriptions.
Subscription
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Subscription: """REST APIs for subscriptions.""" def get(self, account=None, name=None): """--- summary: Get Subscription description: Retrieve a subscription. tags: - Replicas parameters: - name: account in: path description: The account name. schema: type: string style: simple - na...
stack_v2_sparse_classes_75kplus_train_072031
24,180
permissive
[ { "docstring": "--- summary: Get Subscription description: Retrieve a subscription. tags: - Replicas parameters: - name: account in: path description: The account name. schema: type: string style: simple - name: name in: path description: The subscription name. schema: type: string style: simple responses: 200:...
3
stack_v2_sparse_classes_30k_train_039467
Implement the Python class `Subscription` described below. Class description: REST APIs for subscriptions. Method signatures and docstrings: - def get(self, account=None, name=None): --- summary: Get Subscription description: Retrieve a subscription. tags: - Replicas parameters: - name: account in: path description: ...
Implement the Python class `Subscription` described below. Class description: REST APIs for subscriptions. Method signatures and docstrings: - def get(self, account=None, name=None): --- summary: Get Subscription description: Retrieve a subscription. tags: - Replicas parameters: - name: account in: path description: ...
7f0d229ac0b3bc7dec12c6e158bea2b82d414a3b
<|skeleton|> class Subscription: """REST APIs for subscriptions.""" def get(self, account=None, name=None): """--- summary: Get Subscription description: Retrieve a subscription. tags: - Replicas parameters: - name: account in: path description: The account name. schema: type: string style: simple - na...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Subscription: """REST APIs for subscriptions.""" def get(self, account=None, name=None): """--- summary: Get Subscription description: Retrieve a subscription. tags: - Replicas parameters: - name: account in: path description: The account name. schema: type: string style: simple - name: name in: ...
the_stack_v2_python_sparse
lib/rucio/web/rest/flaskapi/v1/subscriptions.py
rucio/rucio
train
232
2b5ae912190d192c9800f906ef4ce1e338138b5b
[ "if value is self.field.missing_value:\n return []\nwidget = self.widget\nif widget.terms is None:\n widget.updateTerms()\nvalues = []\nfor entry in value:\n try:\n values.append(widget.terms.getTerm(entry).token)\n except LookupError:\n pass\nreturn values", "widget = self.widget\nif wi...
<|body_start_0|> if value is self.field.missing_value: return [] widget = self.widget if widget.terms is None: widget.updateTerms() values = [] for entry in value: try: values.append(widget.terms.getTerm(entry).token) ...
A special converter between collections and sequence widgets.
CollectionSequenceDataConverter
[ "ZPL-2.1" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CollectionSequenceDataConverter: """A special converter between collections and sequence widgets.""" def toWidgetValue(self, value): """Convert from Python bool to HTML representation.""" <|body_0|> def toFieldValue(self, value): """See interfaces.IDataConverter"...
stack_v2_sparse_classes_75kplus_train_072032
15,934
permissive
[ { "docstring": "Convert from Python bool to HTML representation.", "name": "toWidgetValue", "signature": "def toWidgetValue(self, value)" }, { "docstring": "See interfaces.IDataConverter", "name": "toFieldValue", "signature": "def toFieldValue(self, value)" } ]
2
stack_v2_sparse_classes_30k_train_001219
Implement the Python class `CollectionSequenceDataConverter` described below. Class description: A special converter between collections and sequence widgets. Method signatures and docstrings: - def toWidgetValue(self, value): Convert from Python bool to HTML representation. - def toFieldValue(self, value): See inter...
Implement the Python class `CollectionSequenceDataConverter` described below. Class description: A special converter between collections and sequence widgets. Method signatures and docstrings: - def toWidgetValue(self, value): Convert from Python bool to HTML representation. - def toFieldValue(self, value): See inter...
aa47e9b109ad2d7de600fc1d4ea7359d8144f356
<|skeleton|> class CollectionSequenceDataConverter: """A special converter between collections and sequence widgets.""" def toWidgetValue(self, value): """Convert from Python bool to HTML representation.""" <|body_0|> def toFieldValue(self, value): """See interfaces.IDataConverter"...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CollectionSequenceDataConverter: """A special converter between collections and sequence widgets.""" def toWidgetValue(self, value): """Convert from Python bool to HTML representation.""" if value is self.field.missing_value: return [] widget = self.widget if w...
the_stack_v2_python_sparse
src/z3c/form/converter.py
zopefoundation/z3c.form
train
6
3743d81693706e1fe6b1c34ebaaea9dde08d6fa8
[ "if pat == None:\n pat = 'S\\\\d{2}E\\\\d{2}'\nfor old_name in os.listdir(path):\n mid = re.findall(pat, old_name)[0]\n end = old_name.split('.')[-1]\n new_name = head + '-' + mid + '.' + end\n os.rename(path + old_name, path + new_name)\nprint('NumPat: {};\\nPath: {};'.format(pat, path))", "with o...
<|body_start_0|> if pat == None: pat = 'S\\d{2}E\\d{2}' for old_name in os.listdir(path): mid = re.findall(pat, old_name)[0] end = old_name.split('.')[-1] new_name = head + '-' + mid + '.' + end os.rename(path + old_name, path + new_name) ...
整理文件名(字幕/视频);整理文件内容(字幕)
TvShow
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TvShow: """整理文件名(字幕/视频);整理文件内容(字幕)""" def renames(self, path, head, pat=None): """文件名批量命名""" <|body_0|> def to_tidy_txt(self, file): """去掉字幕文件的冗余信息""" <|body_1|> def to_audio_from_video(self, video_path='F:\\Miranda\\-S01E04.mp4', audio_ext='.mp3'): ...
stack_v2_sparse_classes_75kplus_train_072033
48,309
no_license
[ { "docstring": "文件名批量命名", "name": "renames", "signature": "def renames(self, path, head, pat=None)" }, { "docstring": "去掉字幕文件的冗余信息", "name": "to_tidy_txt", "signature": "def to_tidy_txt(self, file)" }, { "docstring": "将一个视频转化为音频", "name": "to_audio_from_video", "signature...
3
stack_v2_sparse_classes_30k_train_026934
Implement the Python class `TvShow` described below. Class description: 整理文件名(字幕/视频);整理文件内容(字幕) Method signatures and docstrings: - def renames(self, path, head, pat=None): 文件名批量命名 - def to_tidy_txt(self, file): 去掉字幕文件的冗余信息 - def to_audio_from_video(self, video_path='F:\\Miranda\\-S01E04.mp4', audio_ext='.mp3'): 将一个视...
Implement the Python class `TvShow` described below. Class description: 整理文件名(字幕/视频);整理文件内容(字幕) Method signatures and docstrings: - def renames(self, path, head, pat=None): 文件名批量命名 - def to_tidy_txt(self, file): 去掉字幕文件的冗余信息 - def to_audio_from_video(self, video_path='F:\\Miranda\\-S01E04.mp4', audio_ext='.mp3'): 将一个视...
b6f6897721adc616d31059f703a494bba0834b74
<|skeleton|> class TvShow: """整理文件名(字幕/视频);整理文件内容(字幕)""" def renames(self, path, head, pat=None): """文件名批量命名""" <|body_0|> def to_tidy_txt(self, file): """去掉字幕文件的冗余信息""" <|body_1|> def to_audio_from_video(self, video_path='F:\\Miranda\\-S01E04.mp4', audio_ext='.mp3'): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TvShow: """整理文件名(字幕/视频);整理文件内容(字幕)""" def renames(self, path, head, pat=None): """文件名批量命名""" if pat == None: pat = 'S\\d{2}E\\d{2}' for old_name in os.listdir(path): mid = re.findall(pat, old_name)[0] end = old_name.split('.')[-1] ne...
the_stack_v2_python_sparse
code-drop/english.2020_5_8.py
y2sinx/dyslexia
train
0
43a31e87b594998ade7e47ed46988efbcc7e0c2c
[ "if value is not None:\n return base36.loads(value)\nreturn value", "if value is None:\n return value\nreturn base36.dumps(value)", "if not value:\n return value\nreturn base36.dumps(value)" ]
<|body_start_0|> if value is not None: return base36.loads(value) return value <|end_body_0|> <|body_start_1|> if value is None: return value return base36.dumps(value) <|end_body_1|> <|body_start_2|> if not value: return value return...
Handles a Reddit base36 encoded string id which is stored as a base10 integer
Base36IntegerField
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Base36IntegerField: """Handles a Reddit base36 encoded string id which is stored as a base10 integer""" def get_prep_value(self, value): """Converts from base36 to base10 for the DB""" <|body_0|> def from_db_value(self, value, expression, connection): """Converts...
stack_v2_sparse_classes_75kplus_train_072034
12,355
permissive
[ { "docstring": "Converts from base36 to base10 for the DB", "name": "get_prep_value", "signature": "def get_prep_value(self, value)" }, { "docstring": "Converts from base10 to base36 for application", "name": "from_db_value", "signature": "def from_db_value(self, value, expression, conne...
3
stack_v2_sparse_classes_30k_train_020070
Implement the Python class `Base36IntegerField` described below. Class description: Handles a Reddit base36 encoded string id which is stored as a base10 integer Method signatures and docstrings: - def get_prep_value(self, value): Converts from base36 to base10 for the DB - def from_db_value(self, value, expression, ...
Implement the Python class `Base36IntegerField` described below. Class description: Handles a Reddit base36 encoded string id which is stored as a base10 integer Method signatures and docstrings: - def get_prep_value(self, value): Converts from base36 to base10 for the DB - def from_db_value(self, value, expression, ...
ba7442482da97d463302658c0aac989567ee1241
<|skeleton|> class Base36IntegerField: """Handles a Reddit base36 encoded string id which is stored as a base10 integer""" def get_prep_value(self, value): """Converts from base36 to base10 for the DB""" <|body_0|> def from_db_value(self, value, expression, connection): """Converts...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Base36IntegerField: """Handles a Reddit base36 encoded string id which is stored as a base10 integer""" def get_prep_value(self, value): """Converts from base36 to base10 for the DB""" if value is not None: return base36.loads(value) return value def from_db_value...
the_stack_v2_python_sparse
channels/models.py
mitodl/open-discussions
train
13
9d52212325aa33fbb5bf27b8a52e40044c708227
[ "user_name = data_utils.rand_name(name='user')\nuser_password = data_utils.rand_password()\ntenant = self.setup_test_tenant()\nuser = self.create_test_user(name=user_name, password=user_password, tenantId=tenant['id'], email='')\nbody = self.token_client.auth(user_name, user_password, tenant['name'])\nself.assertEq...
<|body_start_0|> user_name = data_utils.rand_name(name='user') user_password = data_utils.rand_password() tenant = self.setup_test_tenant() user = self.create_test_user(name=user_name, password=user_password, tenantId=tenant['id'], email='') body = self.token_client.auth(user_nam...
Test keystone tokens via v2 API
TokensTestJSON
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TokensTestJSON: """Test keystone tokens via v2 API""" def test_create_check_get_delete_token(self): """Test getting create/check/get/delete token for user via v2 API""" <|body_0|> def test_rescope_token(self): """Test an unscoped token can be requested via v2 API...
stack_v2_sparse_classes_75kplus_train_072035
6,002
permissive
[ { "docstring": "Test getting create/check/get/delete token for user via v2 API", "name": "test_create_check_get_delete_token", "signature": "def test_create_check_get_delete_token(self)" }, { "docstring": "Test an unscoped token can be requested via v2 API That token can be used to request a sco...
3
null
Implement the Python class `TokensTestJSON` described below. Class description: Test keystone tokens via v2 API Method signatures and docstrings: - def test_create_check_get_delete_token(self): Test getting create/check/get/delete token for user via v2 API - def test_rescope_token(self): Test an unscoped token can be...
Implement the Python class `TokensTestJSON` described below. Class description: Test keystone tokens via v2 API Method signatures and docstrings: - def test_create_check_get_delete_token(self): Test getting create/check/get/delete token for user via v2 API - def test_rescope_token(self): Test an unscoped token can be...
3932a799e620a20d7abf7b89e21b520683a1809b
<|skeleton|> class TokensTestJSON: """Test keystone tokens via v2 API""" def test_create_check_get_delete_token(self): """Test getting create/check/get/delete token for user via v2 API""" <|body_0|> def test_rescope_token(self): """Test an unscoped token can be requested via v2 API...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TokensTestJSON: """Test keystone tokens via v2 API""" def test_create_check_get_delete_token(self): """Test getting create/check/get/delete token for user via v2 API""" user_name = data_utils.rand_name(name='user') user_password = data_utils.rand_password() tenant = self.s...
the_stack_v2_python_sparse
tempest/api/identity/admin/v2/test_tokens.py
openstack/tempest
train
270
07565e7a7081f8856862b6478fe0dec958f4aed8
[ "if isinstance(config, dict):\n config = LambdaConfig.parse_obj(config)\nconfig = cast(LambdaConfig, config)\nsuper().__init__(config)\nself.blocking_features = config.blocking_features\nself.mylambda = config.Lambda\nself.bf_len = config.bloom_filter_length\nself.num_hash_function = config.number_of_hash_functi...
<|body_start_0|> if isinstance(config, dict): config = LambdaConfig.parse_obj(config) config = cast(LambdaConfig, config) super().__init__(config) self.blocking_features = config.blocking_features self.mylambda = config.Lambda self.bf_len = config.bloom_filter...
Class that implements the PPRL indexing technique: An LSH-Based Blocking Approach with a Homomorphic Matching Technique for Privacy-Preserving Record Linkage. This class includes an implementation of Lambda-fold redundant blocking method.
PPRLIndexLambdaFold
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PPRLIndexLambdaFold: """Class that implements the PPRL indexing technique: An LSH-Based Blocking Approach with a Homomorphic Matching Technique for Privacy-Preserving Record Linkage. This class includes an implementation of Lambda-fold redundant blocking method.""" def __init__(self, config:...
stack_v2_sparse_classes_75kplus_train_072036
3,639
permissive
[ { "docstring": "Initialize the class and set the required parameters. :param config: Configuration for P-Sig reverted index.", "name": "__init__", "signature": "def __init__(self, config: Union[LambdaConfig, Dict])" }, { "docstring": "Convert a record to list of bigrams and then map to a bloom f...
3
stack_v2_sparse_classes_30k_train_033126
Implement the Python class `PPRLIndexLambdaFold` described below. Class description: Class that implements the PPRL indexing technique: An LSH-Based Blocking Approach with a Homomorphic Matching Technique for Privacy-Preserving Record Linkage. This class includes an implementation of Lambda-fold redundant blocking met...
Implement the Python class `PPRLIndexLambdaFold` described below. Class description: Class that implements the PPRL indexing technique: An LSH-Based Blocking Approach with a Homomorphic Matching Technique for Privacy-Preserving Record Linkage. This class includes an implementation of Lambda-fold redundant blocking met...
edfd26fbef398b48f464f68453b815ea442a5cdd
<|skeleton|> class PPRLIndexLambdaFold: """Class that implements the PPRL indexing technique: An LSH-Based Blocking Approach with a Homomorphic Matching Technique for Privacy-Preserving Record Linkage. This class includes an implementation of Lambda-fold redundant blocking method.""" def __init__(self, config:...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PPRLIndexLambdaFold: """Class that implements the PPRL indexing technique: An LSH-Based Blocking Approach with a Homomorphic Matching Technique for Privacy-Preserving Record Linkage. This class includes an implementation of Lambda-fold redundant blocking method.""" def __init__(self, config: Union[Lambda...
the_stack_v2_python_sparse
blocklib/pprllambdafold.py
data61/blocklib
train
21
53992927fe6eb73804e80aa779ebd4fdb6d75074
[ "r = Buda.get_orderbook(market)\nlast_orders = []\nif r is not None:\n for elem in r['order_book'][ordertype][0:n]:\n last_orders.append({'price': elem[0], 'amount': elem[1]})\nreturn last_orders", "if re.match('^\\\\w{6}\\\\Z', market):\n market = market[0:3] + '-' + market[3:]\nurl = 'https://www.b...
<|body_start_0|> r = Buda.get_orderbook(market) last_orders = [] if r is not None: for elem in r['order_book'][ordertype][0:n]: last_orders.append({'price': elem[0], 'amount': elem[1]}) return last_orders <|end_body_0|> <|body_start_1|> if re.match('^...
Buda
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Buda: def get_n_last_orders(ordertype, market, n): """:param ordertype: <str> 'bids' or 'asks' :param market: <str> e.g. 'etheur' or 'eth-eur' :return: <list> e.g. [{'amount': '0.067', 'price': '400.1'},...]""" <|body_0|> def get_orderbook(market): """returns the ord...
stack_v2_sparse_classes_75kplus_train_072037
2,245
no_license
[ { "docstring": ":param ordertype: <str> 'bids' or 'asks' :param market: <str> e.g. 'etheur' or 'eth-eur' :return: <list> e.g. [{'amount': '0.067', 'price': '400.1'},...]", "name": "get_n_last_orders", "signature": "def get_n_last_orders(ordertype, market, n)" }, { "docstring": "returns the order...
3
null
Implement the Python class `Buda` described below. Class description: Implement the Buda class. Method signatures and docstrings: - def get_n_last_orders(ordertype, market, n): :param ordertype: <str> 'bids' or 'asks' :param market: <str> e.g. 'etheur' or 'eth-eur' :return: <list> e.g. [{'amount': '0.067', 'price': '...
Implement the Python class `Buda` described below. Class description: Implement the Buda class. Method signatures and docstrings: - def get_n_last_orders(ordertype, market, n): :param ordertype: <str> 'bids' or 'asks' :param market: <str> e.g. 'etheur' or 'eth-eur' :return: <list> e.g. [{'amount': '0.067', 'price': '...
c7d6a9bc550e05c84260ef5b9a2b74d91124bf3b
<|skeleton|> class Buda: def get_n_last_orders(ordertype, market, n): """:param ordertype: <str> 'bids' or 'asks' :param market: <str> e.g. 'etheur' or 'eth-eur' :return: <list> e.g. [{'amount': '0.067', 'price': '400.1'},...]""" <|body_0|> def get_orderbook(market): """returns the ord...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Buda: def get_n_last_orders(ordertype, market, n): """:param ordertype: <str> 'bids' or 'asks' :param market: <str> e.g. 'etheur' or 'eth-eur' :return: <list> e.g. [{'amount': '0.067', 'price': '400.1'},...]""" r = Buda.get_orderbook(market) last_orders = [] if r is not None: ...
the_stack_v2_python_sparse
pyarboto/buda.py
chainimpact/arboto
train
0
39a28c3ba2951ce701802a4fd2c8d0f43ec6cc15
[ "if adjacent_route_func is None:\n adjacent_route_func = adjacent_route_tail\nif merge_func is None:\n merge_func = merge_tail\nself.warehouse = warehouse\nself.adjacent_route = adjacent_route_func\nself.merge = merge_func", "savings = pairs_of_savings(self.warehouse, matrix)\nsavings.sort_values(by='saving...
<|body_start_0|> if adjacent_route_func is None: adjacent_route_func = adjacent_route_tail if merge_func is None: merge_func = merge_tail self.warehouse = warehouse self.adjacent_route = adjacent_route_func self.merge = merge_func <|end_body_0|> <|body_st...
SequentialClarkeWright
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SequentialClarkeWright: def __init__(self, warehouse, adjacent_route_func=None, merge_func=None): """Sequential Clarke Wright Savings Method. Clarke G & Wright JW, 1964, Scheduling of vehicles from a central depot to a number of delivery points, Operations Research, 12(4), pp. 568–581 An...
stack_v2_sparse_classes_75kplus_train_072038
15,158
permissive
[ { "docstring": "Sequential Clarke Wright Savings Method. Clarke G & Wright JW, 1964, Scheduling of vehicles from a central depot to a number of delivery points, Operations Research, 12(4), pp. 568–581 Another useful paper by Graham Rand: Life and times of the savings method... https://www.ajol.info/index.php/or...
3
null
Implement the Python class `SequentialClarkeWright` described below. Class description: Implement the SequentialClarkeWright class. Method signatures and docstrings: - def __init__(self, warehouse, adjacent_route_func=None, merge_func=None): Sequential Clarke Wright Savings Method. Clarke G & Wright JW, 1964, Schedul...
Implement the Python class `SequentialClarkeWright` described below. Class description: Implement the SequentialClarkeWright class. Method signatures and docstrings: - def __init__(self, warehouse, adjacent_route_func=None, merge_func=None): Sequential Clarke Wright Savings Method. Clarke G & Wright JW, 1964, Schedul...
62c6842fc14acee07aee12ac2f238cbd1c3881d6
<|skeleton|> class SequentialClarkeWright: def __init__(self, warehouse, adjacent_route_func=None, merge_func=None): """Sequential Clarke Wright Savings Method. Clarke G & Wright JW, 1964, Scheduling of vehicles from a central depot to a number of delivery points, Operations Research, 12(4), pp. 568–581 An...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SequentialClarkeWright: def __init__(self, warehouse, adjacent_route_func=None, merge_func=None): """Sequential Clarke Wright Savings Method. Clarke G & Wright JW, 1964, Scheduling of vehicles from a central depot to a number of delivery points, Operations Research, 12(4), pp. 568–581 Another useful p...
the_stack_v2_python_sparse
vrp/constructive.py
MichaelAllen1966/2004_covid_dialysis
train
0
aaf5a36c22382fc73520a02bdf40a8aac91c9bef
[ "distributions = []\ndenominator = 0\nfor i in range(2, n + 1):\n denominator += 1 / (i * (i - 1)) - a / 2\nnumerator = 0\nfor i in range(2, n + 1):\n numerator += 1 / (i * (i - 1)) - a / 2\n distributions.append((i, numerator / denominator))\nreturn distributions", "distribution_list = Distribution.crea...
<|body_start_0|> distributions = [] denominator = 0 for i in range(2, n + 1): denominator += 1 / (i * (i - 1)) - a / 2 numerator = 0 for i in range(2, n + 1): numerator += 1 / (i * (i - 1)) - a / 2 distributions.append((i, numerator / denominat...
Distribution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Distribution: def create_aloha_style_distribution(a, n): """Creates a probability distribution based off the ALOHA style research methods. Args: a: The weighting factor of the algorithm. n: The size of maximum hashes as a subset of M Returns: list[int]: A list of weights whose sum is 1."...
stack_v2_sparse_classes_75kplus_train_072039
12,172
no_license
[ { "docstring": "Creates a probability distribution based off the ALOHA style research methods. Args: a: The weighting factor of the algorithm. n: The size of maximum hashes as a subset of M Returns: list[int]: A list of weights whose sum is 1.", "name": "create_aloha_style_distribution", "signature": "d...
2
stack_v2_sparse_classes_30k_train_049840
Implement the Python class `Distribution` described below. Class description: Implement the Distribution class. Method signatures and docstrings: - def create_aloha_style_distribution(a, n): Creates a probability distribution based off the ALOHA style research methods. Args: a: The weighting factor of the algorithm. ...
Implement the Python class `Distribution` described below. Class description: Implement the Distribution class. Method signatures and docstrings: - def create_aloha_style_distribution(a, n): Creates a probability distribution based off the ALOHA style research methods. Args: a: The weighting factor of the algorithm. ...
7e16341c7d64f3497e6296eef37883e151f6dbe6
<|skeleton|> class Distribution: def create_aloha_style_distribution(a, n): """Creates a probability distribution based off the ALOHA style research methods. Args: a: The weighting factor of the algorithm. n: The size of maximum hashes as a subset of M Returns: list[int]: A list of weights whose sum is 1."...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Distribution: def create_aloha_style_distribution(a, n): """Creates a probability distribution based off the ALOHA style research methods. Args: a: The weighting factor of the algorithm. n: The size of maximum hashes as a subset of M Returns: list[int]: A list of weights whose sum is 1.""" dis...
the_stack_v2_python_sparse
ALOHA_IBLT/aloha_iblt.py
hupsuni/BloomFilters
train
0
e12040f1c72cb019c7c0c271fd67dbf23254dea3
[ "_query_builder = Configuration.get_base_uri()\n_query_builder += '/text/language-sets'\n_query_url = APIHelper.clean_url(_query_builder)\n_headers = {'accept': 'application/json', 'content-type': 'application/json; charset=utf-8'}\n_request = self.http_client.post(_query_url, headers=_headers, parameters=APIHelper...
<|body_start_0|> _query_builder = Configuration.get_base_uri() _query_builder += '/text/language-sets' _query_url = APIHelper.clean_url(_query_builder) _headers = {'accept': 'application/json', 'content-type': 'application/json; charset=utf-8'} _request = self.http_client.post(_q...
A Controller to access Endpoints in the idfy_rest_client API.
LanguageSetsController
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LanguageSetsController: """A Controller to access Endpoints in the idfy_rest_client API.""" def create_language_set(self, new_language_set=None): """Does a POST request to /text/language-sets. Creates a new language set. Args: new_language_set (LanguageSetCreateDTO, optional): TODO: ...
stack_v2_sparse_classes_75kplus_train_072040
7,674
permissive
[ { "docstring": "Does a POST request to /text/language-sets. Creates a new language set. Args: new_language_set (LanguageSetCreateDTO, optional): TODO: type description here. Example: Returns: LanguageSetDTO: Response from the API. Success Raises: APIException: When an error occurs while fetching the data from t...
5
stack_v2_sparse_classes_30k_test_000431
Implement the Python class `LanguageSetsController` described below. Class description: A Controller to access Endpoints in the idfy_rest_client API. Method signatures and docstrings: - def create_language_set(self, new_language_set=None): Does a POST request to /text/language-sets. Creates a new language set. Args: ...
Implement the Python class `LanguageSetsController` described below. Class description: A Controller to access Endpoints in the idfy_rest_client API. Method signatures and docstrings: - def create_language_set(self, new_language_set=None): Does a POST request to /text/language-sets. Creates a new language set. Args: ...
fa3918a6c54ea0eedb9146578645b7eb1755b642
<|skeleton|> class LanguageSetsController: """A Controller to access Endpoints in the idfy_rest_client API.""" def create_language_set(self, new_language_set=None): """Does a POST request to /text/language-sets. Creates a new language set. Args: new_language_set (LanguageSetCreateDTO, optional): TODO: ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LanguageSetsController: """A Controller to access Endpoints in the idfy_rest_client API.""" def create_language_set(self, new_language_set=None): """Does a POST request to /text/language-sets. Creates a new language set. Args: new_language_set (LanguageSetCreateDTO, optional): TODO: type descript...
the_stack_v2_python_sparse
idfy_rest_client/controllers/language_sets_controller.py
dealflowteam/Idfy
train
0
385fdd792d113196087f866a21210f5a5f7a582d
[ "self.data_shape = data_shape\nself.discriminator = None\nself.generator = None\nself.adversarial = None\nself.define_gan()\nself.noise_maker = NoiseMaker(shape=self.data_shape, noise_type='s&p')\nself.performance_output_path = 'performance/siamese_dn_gan_' + str(datetime.now().date())", "self.generator = build_g...
<|body_start_0|> self.data_shape = data_shape self.discriminator = None self.generator = None self.adversarial = None self.define_gan() self.noise_maker = NoiseMaker(shape=self.data_shape, noise_type='s&p') self.performance_output_path = 'performance/siamese_dn_ga...
SiameseDenoiseGAN
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SiameseDenoiseGAN: def __init__(self, data_shape): """Initialize SiDN-GAN""" <|body_0|> def define_gan(self): """Build Models Generative model Discriminative model Adversarial model""" <|body_1|> def train(self, dataset, epochs=20, batch_size=64): ...
stack_v2_sparse_classes_75kplus_train_072041
8,319
no_license
[ { "docstring": "Initialize SiDN-GAN", "name": "__init__", "signature": "def __init__(self, data_shape)" }, { "docstring": "Build Models Generative model Discriminative model Adversarial model", "name": "define_gan", "signature": "def define_gan(self)" }, { "docstring": "Train mod...
5
null
Implement the Python class `SiameseDenoiseGAN` described below. Class description: Implement the SiameseDenoiseGAN class. Method signatures and docstrings: - def __init__(self, data_shape): Initialize SiDN-GAN - def define_gan(self): Build Models Generative model Discriminative model Adversarial model - def train(sel...
Implement the Python class `SiameseDenoiseGAN` described below. Class description: Implement the SiameseDenoiseGAN class. Method signatures and docstrings: - def __init__(self, data_shape): Initialize SiDN-GAN - def define_gan(self): Build Models Generative model Discriminative model Adversarial model - def train(sel...
b1d07d0ff6e3a2fa1a0dc6b2b77cb0f281121131
<|skeleton|> class SiameseDenoiseGAN: def __init__(self, data_shape): """Initialize SiDN-GAN""" <|body_0|> def define_gan(self): """Build Models Generative model Discriminative model Adversarial model""" <|body_1|> def train(self, dataset, epochs=20, batch_size=64): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SiameseDenoiseGAN: def __init__(self, data_shape): """Initialize SiDN-GAN""" self.data_shape = data_shape self.discriminator = None self.generator = None self.adversarial = None self.define_gan() self.noise_maker = NoiseMaker(shape=self.data_shape, noise...
the_stack_v2_python_sparse
siamese_dn_gan.py
sahinomer/NeuralNetworks-GAN
train
0
ffa73563cefefdeadd23fa784a4e0436bddc0d1e
[ "ftp_status = {'status': -1, 'message': ''}\ncmd = 'service vsftpd status |grep running'\ncode, result_MSG = commands.getstatusoutput(cmd)\nif code == 0:\n ftp_status['status'] = 1\nelse:\n ftp_status['status'] = 0\n ftp_status['message'] = result_MSG\nreturn Response(ftp_status, status=status.HTTP_200_OK)...
<|body_start_0|> ftp_status = {'status': -1, 'message': ''} cmd = 'service vsftpd status |grep running' code, result_MSG = commands.getstatusoutput(cmd) if code == 0: ftp_status['status'] = 1 else: ftp_status['status'] = 0 ftp_status['message']...
VsftpdStatus
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VsftpdStatus: def get(self, request): """Query the state of the FTP.""" <|body_0|> def put(self, request): """Modify the state of the FTP.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ftp_status = {'status': -1, 'message': ''} cmd = 'serv...
stack_v2_sparse_classes_75kplus_train_072042
31,166
no_license
[ { "docstring": "Query the state of the FTP.", "name": "get", "signature": "def get(self, request)" }, { "docstring": "Modify the state of the FTP.", "name": "put", "signature": "def put(self, request)" } ]
2
stack_v2_sparse_classes_30k_train_015176
Implement the Python class `VsftpdStatus` described below. Class description: Implement the VsftpdStatus class. Method signatures and docstrings: - def get(self, request): Query the state of the FTP. - def put(self, request): Modify the state of the FTP.
Implement the Python class `VsftpdStatus` described below. Class description: Implement the VsftpdStatus class. Method signatures and docstrings: - def get(self, request): Query the state of the FTP. - def put(self, request): Modify the state of the FTP. <|skeleton|> class VsftpdStatus: def get(self, request): ...
7f801a569a396a27371d0831752595877c224a6b
<|skeleton|> class VsftpdStatus: def get(self, request): """Query the state of the FTP.""" <|body_0|> def put(self, request): """Modify the state of the FTP.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class VsftpdStatus: def get(self, request): """Query the state of the FTP.""" ftp_status = {'status': -1, 'message': ''} cmd = 'service vsftpd status |grep running' code, result_MSG = commands.getstatusoutput(cmd) if code == 0: ftp_status['status'] = 1 els...
the_stack_v2_python_sparse
Python_projects/flask_projects/unicorn_project/ftp/views.py
sdtimothy8/Coding
train
0
ec8c816392bf503aab623ed2e3234e7e0d20136e
[ "if 'scraped_items' not in spider.state:\n spider.state['scraped_items'] = []\nspider.state['scraped_items'].append(item)\nreturn item", "source = get_or_create_source(spider)\ndb_items = source.rides.filter(is_expired=False)\nfor db_item in db_items:\n if spider.is_expired(db_item, spider.state['scraped_it...
<|body_start_0|> if 'scraped_items' not in spider.state: spider.state['scraped_items'] = [] spider.state['scraped_items'].append(item) return item <|end_body_0|> <|body_start_1|> source = get_or_create_source(spider) db_items = source.rides.filter(is_expired=False) ...
CheckExpiredPipeline
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CheckExpiredPipeline: def process_item(self, item, spider): """Save original ad url of each scraped item""" <|body_0|> def close_spider(self, spider): """Mark expired ads of particular ad source (spider).""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_75kplus_train_072043
3,164
no_license
[ { "docstring": "Save original ad url of each scraped item", "name": "process_item", "signature": "def process_item(self, item, spider)" }, { "docstring": "Mark expired ads of particular ad source (spider).", "name": "close_spider", "signature": "def close_spider(self, spider)" } ]
2
stack_v2_sparse_classes_30k_train_006322
Implement the Python class `CheckExpiredPipeline` described below. Class description: Implement the CheckExpiredPipeline class. Method signatures and docstrings: - def process_item(self, item, spider): Save original ad url of each scraped item - def close_spider(self, spider): Mark expired ads of particular ad source...
Implement the Python class `CheckExpiredPipeline` described below. Class description: Implement the CheckExpiredPipeline class. Method signatures and docstrings: - def process_item(self, item, spider): Save original ad url of each scraped item - def close_spider(self, spider): Mark expired ads of particular ad source...
3d6c82e18ad51db5f8b58f1f258e0f64248fccc9
<|skeleton|> class CheckExpiredPipeline: def process_item(self, item, spider): """Save original ad url of each scraped item""" <|body_0|> def close_spider(self, spider): """Mark expired ads of particular ad source (spider).""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CheckExpiredPipeline: def process_item(self, item, spider): """Save original ad url of each scraped item""" if 'scraped_items' not in spider.state: spider.state['scraped_items'] = [] spider.state['scraped_items'].append(item) return item def close_spider(self, ...
the_stack_v2_python_sparse
carpool_news/ride_scraper/ride_scraper/pipelines.py
tomasra/carpool_news
train
0
fb2c453c65c2f841524a88762455289022a9871e
[ "if 'userid' in kwargs:\n self.userid = kwargs.pop('userid')\nsuper(UserCreateForm, self).__init__(*args, **kwargs)\nfor fieldname in ['username', 'email', 'password1', 'password2']:\n self.fields[fieldname].help_text = None\n self.fields[fieldname].error_messages = errors\n self.fields[fieldname].requi...
<|body_start_0|> if 'userid' in kwargs: self.userid = kwargs.pop('userid') super(UserCreateForm, self).__init__(*args, **kwargs) for fieldname in ['username', 'email', 'password1', 'password2']: self.fields[fieldname].help_text = None self.fields[fieldname].er...
User creation form class. Creates and handles form for creating new users
UserCreateForm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserCreateForm: """User creation form class. Creates and handles form for creating new users""" def __init__(self, *args, **kwargs): """Override init method of djangos build-in UserCreationForm to disable help texts and set custom labels :param args: args :param kwargs: kwargs""" ...
stack_v2_sparse_classes_75kplus_train_072044
7,625
no_license
[ { "docstring": "Override init method of djangos build-in UserCreationForm to disable help texts and set custom labels :param args: args :param kwargs: kwargs", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Override clean method to make custom validatio...
4
stack_v2_sparse_classes_30k_train_002587
Implement the Python class `UserCreateForm` described below. Class description: User creation form class. Creates and handles form for creating new users Method signatures and docstrings: - def __init__(self, *args, **kwargs): Override init method of djangos build-in UserCreationForm to disable help texts and set cus...
Implement the Python class `UserCreateForm` described below. Class description: User creation form class. Creates and handles form for creating new users Method signatures and docstrings: - def __init__(self, *args, **kwargs): Override init method of djangos build-in UserCreationForm to disable help texts and set cus...
ad28229e8c066e8f825097d12d159b444e5b2ccd
<|skeleton|> class UserCreateForm: """User creation form class. Creates and handles form for creating new users""" def __init__(self, *args, **kwargs): """Override init method of djangos build-in UserCreationForm to disable help texts and set custom labels :param args: args :param kwargs: kwargs""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class UserCreateForm: """User creation form class. Creates and handles form for creating new users""" def __init__(self, *args, **kwargs): """Override init method of djangos build-in UserCreationForm to disable help texts and set custom labels :param args: args :param kwargs: kwargs""" if 'user...
the_stack_v2_python_sparse
main/forms.py
MrTrulsen/StudEval
train
0
e3ede257f882ebdd7d2420fd4520c6f46e7371c7
[ "data = dict()\ndata['north'] = game.north\ndata['east'] = game.east\ndata['south'] = game.south\ndata['west'] = game.west\ndata['northUrl'] = game.north_url\ndata['eastUrl'] = game.east_url\ndata['southUrl'] = game.south_url\ndata['westUrl'] = game.west_url\ndata['northId'] = game.north_id\ndata['eastId'] = game.e...
<|body_start_0|> data = dict() data['north'] = game.north data['east'] = game.east data['south'] = game.south data['west'] = game.west data['northUrl'] = game.north_url data['eastUrl'] = game.east_url data['southUrl'] = game.south_url data['westUrl...
Class for generation of the dict/json representation of a game (Game) and vice versa.
GameSerializer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GameSerializer: """Class for generation of the dict/json representation of a game (Game) and vice versa.""" def game_to_dict(game: Game) -> dict: """Generate dict for the game that corresponds to the json description. RoundGenerator is used to generate the rounds for the game. Args: ...
stack_v2_sparse_classes_75kplus_train_072045
2,604
no_license
[ { "docstring": "Generate dict for the game that corresponds to the json description. RoundGenerator is used to generate the rounds for the game. Args: game: the game to convert Returns: dict representation of the game that can be converted to json", "name": "game_to_dict", "signature": "def game_to_dict...
2
stack_v2_sparse_classes_30k_train_014170
Implement the Python class `GameSerializer` described below. Class description: Class for generation of the dict/json representation of a game (Game) and vice versa. Method signatures and docstrings: - def game_to_dict(game: Game) -> dict: Generate dict for the game that corresponds to the json description. RoundGene...
Implement the Python class `GameSerializer` described below. Class description: Class for generation of the dict/json representation of a game (Game) and vice versa. Method signatures and docstrings: - def game_to_dict(game: Game) -> dict: Generate dict for the game that corresponds to the json description. RoundGene...
73b59f773f138e390951849f982de865d4f667b5
<|skeleton|> class GameSerializer: """Class for generation of the dict/json representation of a game (Game) and vice versa.""" def game_to_dict(game: Game) -> dict: """Generate dict for the game that corresponds to the json description. RoundGenerator is used to generate the rounds for the game. Args: ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GameSerializer: """Class for generation of the dict/json representation of a game (Game) and vice versa.""" def game_to_dict(game: Game) -> dict: """Generate dict for the game that corresponds to the json description. RoundGenerator is used to generate the rounds for the game. Args: game: the gam...
the_stack_v2_python_sparse
source/jass/ion/game_serializer.py
FAIKUE/DL4G
train
0
edbba839b2fcb8f25dd6cb4b0fa637d64f0384c8
[ "super(SelfAttention, self).__init__()\nself.W = tf.keras.layers.Dense(units)\nself.U = tf.keras.layers.Dense(units)\nself.V = tf.keras.layers.Dense(1)", "prev = self.W(tf.expand_dims(s_prev, 1))\nenc = self.U(hidden_states)\ne = self.V(tf.tanh(prev + enc))\nw = tf.nn.softmax(e, 1)\ncontext = w * hidden_states\nr...
<|body_start_0|> super(SelfAttention, self).__init__() self.W = tf.keras.layers.Dense(units) self.U = tf.keras.layers.Dense(units) self.V = tf.keras.layers.Dense(1) <|end_body_0|> <|body_start_1|> prev = self.W(tf.expand_dims(s_prev, 1)) enc = self.U(hidden_states) ...
Self Attention
SelfAttention
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SelfAttention: """Self Attention""" def __init__(self, units): """Class constructor - units is an integer representing the number of hidden units in the alignment model public instance attributes: W - a Dense layer with units units, to be applied to the previous decoder hidden state ...
stack_v2_sparse_classes_75kplus_train_072046
1,773
no_license
[ { "docstring": "Class constructor - units is an integer representing the number of hidden units in the alignment model public instance attributes: W - a Dense layer with units units, to be applied to the previous decoder hidden state U - a Dense layer with units units, to be applied to the encoder hidden states...
2
stack_v2_sparse_classes_30k_train_006286
Implement the Python class `SelfAttention` described below. Class description: Self Attention Method signatures and docstrings: - def __init__(self, units): Class constructor - units is an integer representing the number of hidden units in the alignment model public instance attributes: W - a Dense layer with units u...
Implement the Python class `SelfAttention` described below. Class description: Self Attention Method signatures and docstrings: - def __init__(self, units): Class constructor - units is an integer representing the number of hidden units in the alignment model public instance attributes: W - a Dense layer with units u...
fe8fe88a43b7a86f0c4b05540751847e7c1c418b
<|skeleton|> class SelfAttention: """Self Attention""" def __init__(self, units): """Class constructor - units is an integer representing the number of hidden units in the alignment model public instance attributes: W - a Dense layer with units units, to be applied to the previous decoder hidden state ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SelfAttention: """Self Attention""" def __init__(self, units): """Class constructor - units is an integer representing the number of hidden units in the alignment model public instance attributes: W - a Dense layer with units units, to be applied to the previous decoder hidden state U - a Dense l...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/1-self_attention.py
Viiic98/holbertonschool-machine_learning
train
0
e2102c8b12d07505bba1a538198dc2624663b616
[ "super().__init__(sdc_values=sdc_values, version=version, properties=properties, inputs=inputs, category=category, subcategory=subcategory)\nself.name: str = name or 'ONAP-test-PNF'\nself.vendor: Vendor = vendor\nself.vsp: Vsp = vsp", "if not self.vsp and (not self.vendor):\n raise ParameterError('Neither Vsp ...
<|body_start_0|> super().__init__(sdc_values=sdc_values, version=version, properties=properties, inputs=inputs, category=category, subcategory=subcategory) self.name: str = name or 'ONAP-test-PNF' self.vendor: Vendor = vendor self.vsp: Vsp = vsp <|end_body_0|> <|body_start_1|> i...
ONAP PNF Object used for SDC operations. Attributes: name (str): the name of the pnf. Defaults to "ONAP-test-PNF". identifier (str): the unique ID of the pnf from SDC. status (str): the status of the pnf from SDC. version (str): the version ID of the vendor from SDC. uuid (str): the UUID of the PNF (which is different ...
Pnf
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Pnf: """ONAP PNF Object used for SDC operations. Attributes: name (str): the name of the pnf. Defaults to "ONAP-test-PNF". identifier (str): the unique ID of the pnf from SDC. status (str): the status of the pnf from SDC. version (str): the version ID of the vendor from SDC. uuid (str): the UUID ...
stack_v2_sparse_classes_75kplus_train_072047
2,481
permissive
[ { "docstring": "Initialize pnf object. Args: name (optional): the name of the pnf version (str, optional): the version of a PNF object", "name": "__init__", "signature": "def __init__(self, name: str=None, version: str=None, vendor: Vendor=None, sdc_values: Dict[str, str]=None, vsp: Vsp=None, properties...
3
stack_v2_sparse_classes_30k_train_006368
Implement the Python class `Pnf` described below. Class description: ONAP PNF Object used for SDC operations. Attributes: name (str): the name of the pnf. Defaults to "ONAP-test-PNF". identifier (str): the unique ID of the pnf from SDC. status (str): the status of the pnf from SDC. version (str): the version ID of the...
Implement the Python class `Pnf` described below. Class description: ONAP PNF Object used for SDC operations. Attributes: name (str): the name of the pnf. Defaults to "ONAP-test-PNF". identifier (str): the unique ID of the pnf from SDC. status (str): the status of the pnf from SDC. version (str): the version ID of the...
b204aa63043825290d4c0a940edd7e9241f6c0ee
<|skeleton|> class Pnf: """ONAP PNF Object used for SDC operations. Attributes: name (str): the name of the pnf. Defaults to "ONAP-test-PNF". identifier (str): the unique ID of the pnf from SDC. status (str): the status of the pnf from SDC. version (str): the version ID of the vendor from SDC. uuid (str): the UUID ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Pnf: """ONAP PNF Object used for SDC operations. Attributes: name (str): the name of the pnf. Defaults to "ONAP-test-PNF". identifier (str): the unique ID of the pnf from SDC. status (str): the status of the pnf from SDC. version (str): the version ID of the vendor from SDC. uuid (str): the UUID of the PNF (w...
the_stack_v2_python_sparse
src/onapsdk/sdc/pnf.py
Orange-OpenSource/python-onapsdk
train
4
5f17bcc03a21dd9ff488551d3b47693f9857236a
[ "query = Q()\nif key_words:\n if key_words.isdigit():\n query = Q(deal_id=key_words)\n else:\n query = Q(client=key_words) | Q(provider=key_words)\nquery = Deal.objects(query).order_by('-deal_id')\nresult = mongo_paginator(query, page_index, page_size)\nresult['objects'] = [info.to_dict(only_fie...
<|body_start_0|> query = Q() if key_words: if key_words.isdigit(): query = Q(deal_id=key_words) else: query = Q(client=key_words) | Q(provider=key_words) query = Deal.objects(query).order_by('-deal_id') result = mongo_paginator(quer...
订单服务
DealService
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DealService: """订单服务""" def get_deal_list(cls, key_words=None, page_index=1, page_size=20): """获取订单列表 :param key_words: :param page_index: :param page_size: :return:""" <|body_0|> def get_deal_info(cls, deal_id): """获取订单详情 :param deal_id: :return:""" <|bo...
stack_v2_sparse_classes_75kplus_train_072048
1,558
no_license
[ { "docstring": "获取订单列表 :param key_words: :param page_index: :param page_size: :return:", "name": "get_deal_list", "signature": "def get_deal_list(cls, key_words=None, page_index=1, page_size=20)" }, { "docstring": "获取订单详情 :param deal_id: :return:", "name": "get_deal_info", "signature": "...
2
null
Implement the Python class `DealService` described below. Class description: 订单服务 Method signatures and docstrings: - def get_deal_list(cls, key_words=None, page_index=1, page_size=20): 获取订单列表 :param key_words: :param page_index: :param page_size: :return: - def get_deal_info(cls, deal_id): 获取订单详情 :param deal_id: :re...
Implement the Python class `DealService` described below. Class description: 订单服务 Method signatures and docstrings: - def get_deal_list(cls, key_words=None, page_index=1, page_size=20): 获取订单列表 :param key_words: :param page_index: :param page_size: :return: - def get_deal_info(cls, deal_id): 获取订单详情 :param deal_id: :re...
8454e25e5d874353de22bc73d3e6a9a78112657f
<|skeleton|> class DealService: """订单服务""" def get_deal_list(cls, key_words=None, page_index=1, page_size=20): """获取订单列表 :param key_words: :param page_index: :param page_size: :return:""" <|body_0|> def get_deal_info(cls, deal_id): """获取订单详情 :param deal_id: :return:""" <|bo...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DealService: """订单服务""" def get_deal_list(cls, key_words=None, page_index=1, page_size=20): """获取订单列表 :param key_words: :param page_index: :param page_size: :return:""" query = Q() if key_words: if key_words.isdigit(): query = Q(deal_id=key_words) ...
the_stack_v2_python_sparse
explorer/services/deal.py
wanxiang-blockchain/2021Wanxiang-Blockchain-Hackathon-Athena
train
0
5b69ba32324090721245589dcb0ff9b040faf898
[ "these_high_indices, these_low_indices = model_activation.get_hilo_activation_examples(storm_activations=STORM_ACTIVATIONS, num_low_activation_examples=NUM_LOW_ACTIVATION_EXAMPLES_FEW, num_high_activation_examples=NUM_HIGH_ACTIVATION_EXAMPLES_FEW)\nself.assertTrue(numpy.array_equal(these_high_indices, HIGH_INDICES_...
<|body_start_0|> these_high_indices, these_low_indices = model_activation.get_hilo_activation_examples(storm_activations=STORM_ACTIVATIONS, num_low_activation_examples=NUM_LOW_ACTIVATION_EXAMPLES_FEW, num_high_activation_examples=NUM_HIGH_ACTIVATION_EXAMPLES_FEW) self.assertTrue(numpy.array_equal(these_...
Unit tests for model_activation.py.
ModelActivationTests
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ModelActivationTests: """Unit tests for model_activation.py.""" def test_get_hilo_activation_examples_few(self): """Ensures correct output from _get_hilo_activation_examples. In this case, only few examples are returned.""" <|body_0|> def test_get_hilo_activation_example...
stack_v2_sparse_classes_75kplus_train_072049
5,396
permissive
[ { "docstring": "Ensures correct output from _get_hilo_activation_examples. In this case, only few examples are returned.", "name": "test_get_hilo_activation_examples_few", "signature": "def test_get_hilo_activation_examples_few(self)" }, { "docstring": "Ensures correct output from _get_hilo_acti...
4
stack_v2_sparse_classes_30k_train_033526
Implement the Python class `ModelActivationTests` described below. Class description: Unit tests for model_activation.py. Method signatures and docstrings: - def test_get_hilo_activation_examples_few(self): Ensures correct output from _get_hilo_activation_examples. In this case, only few examples are returned. - def ...
Implement the Python class `ModelActivationTests` described below. Class description: Unit tests for model_activation.py. Method signatures and docstrings: - def test_get_hilo_activation_examples_few(self): Ensures correct output from _get_hilo_activation_examples. In this case, only few examples are returned. - def ...
699b995b1b90344022b1644d4b758e790402894e
<|skeleton|> class ModelActivationTests: """Unit tests for model_activation.py.""" def test_get_hilo_activation_examples_few(self): """Ensures correct output from _get_hilo_activation_examples. In this case, only few examples are returned.""" <|body_0|> def test_get_hilo_activation_example...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ModelActivationTests: """Unit tests for model_activation.py.""" def test_get_hilo_activation_examples_few(self): """Ensures correct output from _get_hilo_activation_examples. In this case, only few examples are returned.""" these_high_indices, these_low_indices = model_activation.get_hilo...
the_stack_v2_python_sparse
gewittergefahr/deep_learning/model_activation_test.py
cil0834/GewitterGefahr
train
0
aa8e640e78b3314d2df0cdb2c0228830056cab9d
[ "if isinstance(x, valid_type):\n pass\nelse:\n raise TypeError(f'Expected type of {x} is an instance of {valid_type}, but got ``{type(x)}``.')", "if x in valid_value:\n pass\nelse:\n raise ValueError(f'Expected `x` is one of {valid_value}, but got ``{x}``.')", "out = []\nfor each in args:\n if is...
<|body_start_0|> if isinstance(x, valid_type): pass else: raise TypeError(f'Expected type of {x} is an instance of {valid_type}, but got ``{type(x)}``.') <|end_body_0|> <|body_start_1|> if x in valid_value: pass else: raise ValueError(f'Ex...
A class for Parameters Validation Check whether the parameters are valid, including parameter types and parameter values.
Validation
[ "Apache-2.0", "BSD-3-Clause", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Validation: """A class for Parameters Validation Check whether the parameters are valid, including parameter types and parameter values.""" def validate_type(x, valid_type): """Check whether an object is an instance of `valid_type`. Parameters ---------- x: object object to be verifi...
stack_v2_sparse_classes_75kplus_train_072050
3,049
permissive
[ { "docstring": "Check whether an object is an instance of `valid_type`. Parameters ---------- x: object object to be verified valid_type: type or tuple of type A tuple, as in ``validate_type(x, (A, B, ...))``, may be given as the target to check against. This is equivalent to ``validate_type(x, A) or validate_t...
3
stack_v2_sparse_classes_30k_train_049177
Implement the Python class `Validation` described below. Class description: A class for Parameters Validation Check whether the parameters are valid, including parameter types and parameter values. Method signatures and docstrings: - def validate_type(x, valid_type): Check whether an object is an instance of `valid_t...
Implement the Python class `Validation` described below. Class description: A class for Parameters Validation Check whether the parameters are valid, including parameter types and parameter values. Method signatures and docstrings: - def validate_type(x, valid_type): Check whether an object is an instance of `valid_t...
238cbc41865ddf629bb6ae92c2e1445be27f98b8
<|skeleton|> class Validation: """A class for Parameters Validation Check whether the parameters are valid, including parameter types and parameter values.""" def validate_type(x, valid_type): """Check whether an object is an instance of `valid_type`. Parameters ---------- x: object object to be verifi...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Validation: """A class for Parameters Validation Check whether the parameters are valid, including parameter types and parameter values.""" def validate_type(x, valid_type): """Check whether an object is an instance of `valid_type`. Parameters ---------- x: object object to be verified valid_type...
the_stack_v2_python_sparse
gcastle/castle/algorithms/gradient/corl/torch/utils/validation.py
huawei-noah/trustworthyAI
train
832
a49e0b2b67f292072ec9fac47b5072eec35aeda6
[ "self.response.headers['Content-Type'] = 'text/html'\nvalues = {'username': '', 'password': '', 'verify': '', 'email': ''}\nvalidation = UserSignupValidation()\nvalidationMsgs = validation.initialize_messages_dict()\nvalues.update(validationMsgs)\npath = os.path.join(os.path.dirname(__file__), 'usersignup.html')\ns...
<|body_start_0|> self.response.headers['Content-Type'] = 'text/html' values = {'username': '', 'password': '', 'verify': '', 'email': ''} validation = UserSignupValidation() validationMsgs = validation.initialize_messages_dict() values.update(validationMsgs) path = os.pat...
Handles the user signup page
UserSignupPage
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserSignupPage: """Handles the user signup page""" def get(self): """Handles initial get request""" <|body_0|> def post(self): """Handles post requests""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.response.headers['Content-Type'] = 'text...
stack_v2_sparse_classes_75kplus_train_072051
6,815
permissive
[ { "docstring": "Handles initial get request", "name": "get", "signature": "def get(self)" }, { "docstring": "Handles post requests", "name": "post", "signature": "def post(self)" } ]
2
stack_v2_sparse_classes_30k_train_004897
Implement the Python class `UserSignupPage` described below. Class description: Handles the user signup page Method signatures and docstrings: - def get(self): Handles initial get request - def post(self): Handles post requests
Implement the Python class `UserSignupPage` described below. Class description: Handles the user signup page Method signatures and docstrings: - def get(self): Handles initial get request - def post(self): Handles post requests <|skeleton|> class UserSignupPage: """Handles the user signup page""" def get(se...
87cf5dd5d0e06ee745d3aba058d96fa46f2aeb6b
<|skeleton|> class UserSignupPage: """Handles the user signup page""" def get(self): """Handles initial get request""" <|body_0|> def post(self): """Handles post requests""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class UserSignupPage: """Handles the user signup page""" def get(self): """Handles initial get request""" self.response.headers['Content-Type'] = 'text/html' values = {'username': '', 'password': '', 'verify': '', 'email': ''} validation = UserSignupValidation() validati...
the_stack_v2_python_sparse
src/unit5/registration/usersignup_main.py
cdoremus/udacity-python_web_development-cs253
train
0
aac27b3a29827db8bae05d7ca6fc2ce24f68a4f3
[ "if root == None:\n return 0\nreturn max(self.max_depth(root.left), self.max_depth(root.right)) + 1", "stack = []\nif root:\n stack.append((root, 1))\ndepth = 0\nwhile stack:\n current = stack.pop()\n root, current_depth = (current[0], current[1])\n if root:\n depth = max(depth, current_dept...
<|body_start_0|> if root == None: return 0 return max(self.max_depth(root.left), self.max_depth(root.right)) + 1 <|end_body_0|> <|body_start_1|> stack = [] if root: stack.append((root, 1)) depth = 0 while stack: current = stack.pop() ...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def max_depth(self, root: TreeNode) -> int: """最大深度 Args: root:根节点 Returns: 最大深度""" <|body_0|> def max_depth_2(self, root: TreeNode) -> int: """最大深度 Args: root:根节点 Returns: 最大深度""" <|body_1|> <|end_skeleton|> <|body_start_0|> if root == No...
stack_v2_sparse_classes_75kplus_train_072052
2,289
permissive
[ { "docstring": "最大深度 Args: root:根节点 Returns: 最大深度", "name": "max_depth", "signature": "def max_depth(self, root: TreeNode) -> int" }, { "docstring": "最大深度 Args: root:根节点 Returns: 最大深度", "name": "max_depth_2", "signature": "def max_depth_2(self, root: TreeNode) -> int" } ]
2
stack_v2_sparse_classes_30k_train_048049
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def max_depth(self, root: TreeNode) -> int: 最大深度 Args: root:根节点 Returns: 最大深度 - def max_depth_2(self, root: TreeNode) -> int: 最大深度 Args: root:根节点 Returns: 最大深度
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def max_depth(self, root: TreeNode) -> int: 最大深度 Args: root:根节点 Returns: 最大深度 - def max_depth_2(self, root: TreeNode) -> int: 最大深度 Args: root:根节点 Returns: 最大深度 <|skeleton|> clas...
50f35eef6a0ad63173efed10df3c835b1dceaa3f
<|skeleton|> class Solution: def max_depth(self, root: TreeNode) -> int: """最大深度 Args: root:根节点 Returns: 最大深度""" <|body_0|> def max_depth_2(self, root: TreeNode) -> int: """最大深度 Args: root:根节点 Returns: 最大深度""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def max_depth(self, root: TreeNode) -> int: """最大深度 Args: root:根节点 Returns: 最大深度""" if root == None: return 0 return max(self.max_depth(root.left), self.max_depth(root.right)) + 1 def max_depth_2(self, root: TreeNode) -> int: """最大深度 Args: root:根节点 Re...
the_stack_v2_python_sparse
src/leetcodepython/tree/maximum_depth_binary_tree_104.py
zhangyu345293721/leetcode
train
101
cd53676714d2a0786986abfc8454c325f43b6803
[ "gtk.Frame.__init__(self)\nself.contents = contents\nself.contentBox = gtk.VBox()\nself.contentBox.pack_start(self.contents, True, True, 0)\nself.add(self.contentBox)\nframeWidget = gtk.Expander(title)\nframeWidget.connect('notify::expanded', self._toggle_content_box)\nself.set_label_widget(frameWidget)\nself.show_...
<|body_start_0|> gtk.Frame.__init__(self) self.contents = contents self.contentBox = gtk.VBox() self.contentBox.pack_start(self.contents, True, True, 0) self.add(self.contentBox) frameWidget = gtk.Expander(title) frameWidget.connect('notify::expanded', self._toggl...
A frame with a toggle button and a title that can show or hide its contents
OptionalToggleFrame
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OptionalToggleFrame: """A frame with a toggle button and a title that can show or hide its contents""" def __init__(self, contents, title=None, startHidden=True): """contents should be a container of some sort to be packed into the frame @param title: the frame title of course @type ...
stack_v2_sparse_classes_75kplus_train_072053
1,230
no_license
[ { "docstring": "contents should be a container of some sort to be packed into the frame @param title: the frame title of course @type title: string", "name": "__init__", "signature": "def __init__(self, contents, title=None, startHidden=True)" }, { "docstring": "shows or hides the contents", ...
2
stack_v2_sparse_classes_30k_train_016143
Implement the Python class `OptionalToggleFrame` described below. Class description: A frame with a toggle button and a title that can show or hide its contents Method signatures and docstrings: - def __init__(self, contents, title=None, startHidden=True): contents should be a container of some sort to be packed into...
Implement the Python class `OptionalToggleFrame` described below. Class description: A frame with a toggle button and a title that can show or hide its contents Method signatures and docstrings: - def __init__(self, contents, title=None, startHidden=True): contents should be a container of some sort to be packed into...
a47152d558081a9ebeb5630acfe5f46a49ab4246
<|skeleton|> class OptionalToggleFrame: """A frame with a toggle button and a title that can show or hide its contents""" def __init__(self, contents, title=None, startHidden=True): """contents should be a container of some sort to be packed into the frame @param title: the frame title of course @type ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class OptionalToggleFrame: """A frame with a toggle button and a title that can show or hide its contents""" def __init__(self, contents, title=None, startHidden=True): """contents should be a container of some sort to be packed into the frame @param title: the frame title of course @type title: string...
the_stack_v2_python_sparse
client/gui/gtk/widget/OptionalToggleFrame.py
clawplach/BitBlinder
train
0
eac34677b256ce5527eb4b12698be65fa4ca9717
[ "super(SparseGraphAttentionLayer, self).__init__()\nself.output_dim = output_dim\nself.W = nn.Parameter(torch.Tensor(input_dim, output_dim))\nself.a = nn.Parameter(torch.Tensor(2 * output_dim, 1))\nif bias:\n self.bias = nn.Parameter(torch.FloatTensor(output_dim))\nelse:\n self.register_parameter('bias', None...
<|body_start_0|> super(SparseGraphAttentionLayer, self).__init__() self.output_dim = output_dim self.W = nn.Parameter(torch.Tensor(input_dim, output_dim)) self.a = nn.Parameter(torch.Tensor(2 * output_dim, 1)) if bias: self.bias = nn.Parameter(torch.FloatTensor(output...
Graph Attention层 (sparse input)
SparseGraphAttentionLayer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SparseGraphAttentionLayer: """Graph Attention层 (sparse input)""" def __init__(self, input_dim, output_dim, dropout, alpha, bias=True): """Graph Attention层 (sparse input) Inputs: ------- input_dim: int, 输入维度 outut_dim: int, 输出维度 dropout: float, dropout比例 alpha: float, LeakyReLU负数部分斜率 ...
stack_v2_sparse_classes_75kplus_train_072054
6,215
permissive
[ { "docstring": "Graph Attention层 (sparse input) Inputs: ------- input_dim: int, 输入维度 outut_dim: int, 输出维度 dropout: float, dropout比例 alpha: float, LeakyReLU负数部分斜率 bias: boolean, 是否使用偏置", "name": "__init__", "signature": "def __init__(self, input_dim, output_dim, dropout, alpha, bias=True)" }, { "...
5
stack_v2_sparse_classes_30k_train_022149
Implement the Python class `SparseGraphAttentionLayer` described below. Class description: Graph Attention层 (sparse input) Method signatures and docstrings: - def __init__(self, input_dim, output_dim, dropout, alpha, bias=True): Graph Attention层 (sparse input) Inputs: ------- input_dim: int, 输入维度 outut_dim: int, 输出维度...
Implement the Python class `SparseGraphAttentionLayer` described below. Class description: Graph Attention层 (sparse input) Method signatures and docstrings: - def __init__(self, input_dim, output_dim, dropout, alpha, bias=True): Graph Attention层 (sparse input) Inputs: ------- input_dim: int, 输入维度 outut_dim: int, 输出维度...
ee16c37fd065ba4c732138096f715f04c0ad6fcf
<|skeleton|> class SparseGraphAttentionLayer: """Graph Attention层 (sparse input)""" def __init__(self, input_dim, output_dim, dropout, alpha, bias=True): """Graph Attention层 (sparse input) Inputs: ------- input_dim: int, 输入维度 outut_dim: int, 输出维度 dropout: float, dropout比例 alpha: float, LeakyReLU负数部分斜率 ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SparseGraphAttentionLayer: """Graph Attention层 (sparse input)""" def __init__(self, input_dim, output_dim, dropout, alpha, bias=True): """Graph Attention层 (sparse input) Inputs: ------- input_dim: int, 输入维度 outut_dim: int, 输出维度 dropout: float, dropout比例 alpha: float, LeakyReLU负数部分斜率 bias: boolean...
the_stack_v2_python_sparse
Node/GAT/script/layers.py
robbinc91/GNN-Pytorch
train
0
e0ec70e7d2e2f3b88f9ce3c8ab009b605feeb003
[ "self.host = host\nself.port = port\nself.timeout = timeout\nself._current_info = {}\nself._last_hash = ''\nself.alive = False\nself._agent_scope = agent_scope\nself._not_ready_sleep = not_ready_sleep\nself._client = ZmqClient(host=self.host, port=self.port, timeout=self.timeout, serializer=U.serialize, deserialize...
<|body_start_0|> self.host = host self.port = port self.timeout = timeout self._current_info = {} self._last_hash = '' self.alive = False self._agent_scope = agent_scope self._not_ready_sleep = not_ready_sleep self._client = ZmqClient(host=self.hos...
On agent side, sends requests to parameter servers to fetch the latest parameters.
ParameterClient
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ParameterClient: """On agent side, sends requests to parameter servers to fetch the latest parameters.""" def __init__(self, host, port, agent_scope, timeout=2, not_ready_sleep=2): """Args: host: parameter server host port: parameter server port timeout: how long should the the clien...
stack_v2_sparse_classes_75kplus_train_072055
12,187
no_license
[ { "docstring": "Args: host: parameter server host port: parameter server port timeout: how long should the the client wait if the parameter server is not available", "name": "__init__", "signature": "def __init__(self, host, port, agent_scope, timeout=2, not_ready_sleep=2)" }, { "docstring": "Ke...
6
null
Implement the Python class `ParameterClient` described below. Class description: On agent side, sends requests to parameter servers to fetch the latest parameters. Method signatures and docstrings: - def __init__(self, host, port, agent_scope, timeout=2, not_ready_sleep=2): Args: host: parameter server host port: par...
Implement the Python class `ParameterClient` described below. Class description: On agent side, sends requests to parameter servers to fetch the latest parameters. Method signatures and docstrings: - def __init__(self, host, port, agent_scope, timeout=2, not_ready_sleep=2): Args: host: parameter server host port: par...
21a497bd67d82aab27cb883386601db0a062c9d1
<|skeleton|> class ParameterClient: """On agent side, sends requests to parameter servers to fetch the latest parameters.""" def __init__(self, host, port, agent_scope, timeout=2, not_ready_sleep=2): """Args: host: parameter server host port: parameter server port timeout: how long should the the clien...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ParameterClient: """On agent side, sends requests to parameter servers to fetch the latest parameters.""" def __init__(self, host, port, agent_scope, timeout=2, not_ready_sleep=2): """Args: host: parameter server host port: parameter server port timeout: how long should the the client wait if the...
the_stack_v2_python_sparse
liaison/distributed/parameter_server.py
aravic/liaison
train
0
595945ef852de1a3b4bb01045509608416a962d1
[ "categories = []\nfor category in category_names.split(','):\n if cls.check_category(category):\n try:\n category = Category.objects.get(name=category)\n except (Category.DoesNotExist, ObjectDoesNotExist):\n try:\n category = Category.objects.create(name=categor...
<|body_start_0|> categories = [] for category in category_names.split(','): if cls.check_category(category): try: category = Category.objects.get(name=category) except (Category.DoesNotExist, ObjectDoesNotExist): try: ...
Create categories and update the product categories field.
CategoriesHandler
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CategoriesHandler: """Create categories and update the product categories field.""" def create_categories(cls, category_names): """Create and returns the categories.""" <|body_0|> def check_category(cls, category): """Filter the category.""" <|body_1|> <...
stack_v2_sparse_classes_75kplus_train_072056
4,792
permissive
[ { "docstring": "Create and returns the categories.", "name": "create_categories", "signature": "def create_categories(cls, category_names)" }, { "docstring": "Filter the category.", "name": "check_category", "signature": "def check_category(cls, category)" } ]
2
null
Implement the Python class `CategoriesHandler` described below. Class description: Create categories and update the product categories field. Method signatures and docstrings: - def create_categories(cls, category_names): Create and returns the categories. - def check_category(cls, category): Filter the category.
Implement the Python class `CategoriesHandler` described below. Class description: Create categories and update the product categories field. Method signatures and docstrings: - def create_categories(cls, category_names): Create and returns the categories. - def check_category(cls, category): Filter the category. <|...
9e930f52a5f2c4c6c25a0a52b247f7b61fc7ffe8
<|skeleton|> class CategoriesHandler: """Create categories and update the product categories field.""" def create_categories(cls, category_names): """Create and returns the categories.""" <|body_0|> def check_category(cls, category): """Filter the category.""" <|body_1|> <...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CategoriesHandler: """Create categories and update the product categories field.""" def create_categories(cls, category_names): """Create and returns the categories.""" categories = [] for category in category_names.split(','): if cls.check_category(category): ...
the_stack_v2_python_sparse
apps/products/tasks.py
8area8/p8__pur-beurre
train
0
544c10643bdcebd2dc744863b20c45806962afe7
[ "while p != self.id[p]:\n p = self.id[p]\nreturn p", "pRoot = self.find(p)\nqRoot = self.find(q)\nif pRoot == qRoot:\n return\nself.id[pRoot] = qRoot\nself.count -= 1" ]
<|body_start_0|> while p != self.id[p]: p = self.id[p] return p <|end_body_0|> <|body_start_1|> pRoot = self.find(p) qRoot = self.find(q) if pRoot == qRoot: return self.id[pRoot] = qRoot self.count -= 1 <|end_body_1|>
QuickUnion
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class QuickUnion: def find(self, p): """获取所属集合""" <|body_0|> def union(self, p, q): """连接两个集合""" <|body_1|> <|end_skeleton|> <|body_start_0|> while p != self.id[p]: p = self.id[p] return p <|end_body_0|> <|body_start_1|> pRoot...
stack_v2_sparse_classes_75kplus_train_072057
984
no_license
[ { "docstring": "获取所属集合", "name": "find", "signature": "def find(self, p)" }, { "docstring": "连接两个集合", "name": "union", "signature": "def union(self, p, q)" } ]
2
stack_v2_sparse_classes_30k_train_027681
Implement the Python class `QuickUnion` described below. Class description: Implement the QuickUnion class. Method signatures and docstrings: - def find(self, p): 获取所属集合 - def union(self, p, q): 连接两个集合
Implement the Python class `QuickUnion` described below. Class description: Implement the QuickUnion class. Method signatures and docstrings: - def find(self, p): 获取所属集合 - def union(self, p, q): 连接两个集合 <|skeleton|> class QuickUnion: def find(self, p): """获取所属集合""" <|body_0|> def union(self,...
44ae15211514dbc982c668522320389fc90c5c9c
<|skeleton|> class QuickUnion: def find(self, p): """获取所属集合""" <|body_0|> def union(self, p, q): """连接两个集合""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class QuickUnion: def find(self, p): """获取所属集合""" while p != self.id[p]: p = self.id[p] return p def union(self, p, q): """连接两个集合""" pRoot = self.find(p) qRoot = self.find(q) if pRoot == qRoot: return self.id[pRoot] = qRoot...
the_stack_v2_python_sparse
python/algorithms算法/fundamentals/uf_quickunion.py
ZhangShuaiyi/myTest
train
0
723628b68bee3512a809c1cdb715d71fc593e5b8
[ "super(Decoder, self).__init__()\nself.N = N\nself.dm = dm\nself.embedding = tf.keras.layers.Embedding(target_vocab, self.dm)\nself.positional_encoding = positional_encoding(max_seq_len, self.dm)\nself.blocks = [DecoderBlock(self.dm, h, hidden, drop_rate) for n in range(self.N)]\nself.dropout = tf.keras.layers.Drop...
<|body_start_0|> super(Decoder, self).__init__() self.N = N self.dm = dm self.embedding = tf.keras.layers.Embedding(target_vocab, self.dm) self.positional_encoding = positional_encoding(max_seq_len, self.dm) self.blocks = [DecoderBlock(self.dm, h, hidden, drop_rate) for n...
Perform encoder part of the transformer
Decoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Decoder: """Perform encoder part of the transformer""" def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): """initialized the variables Arg: - N: the number of blocks in the encoder - dm: integer representing the dimensionality of the model - h: integer re...
stack_v2_sparse_classes_75kplus_train_072058
2,995
no_license
[ { "docstring": "initialized the variables Arg: - N: the number of blocks in the encoder - dm: integer representing the dimensionality of the model - h: integer representing the number of heads - hidden: the number of hidden units in the fully connected layer - target_vocab: the size of the target vocabulary - m...
2
stack_v2_sparse_classes_30k_train_017197
Implement the Python class `Decoder` described below. Class description: Perform encoder part of the transformer Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): initialized the variables Arg: - N: the number of blocks in the encoder - dm: integer rep...
Implement the Python class `Decoder` described below. Class description: Perform encoder part of the transformer Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): initialized the variables Arg: - N: the number of blocks in the encoder - dm: integer rep...
1d86c9606371697854878b833b810d73c9af7ee7
<|skeleton|> class Decoder: """Perform encoder part of the transformer""" def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): """initialized the variables Arg: - N: the number of blocks in the encoder - dm: integer representing the dimensionality of the model - h: integer re...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Decoder: """Perform encoder part of the transformer""" def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): """initialized the variables Arg: - N: the number of blocks in the encoder - dm: integer representing the dimensionality of the model - h: integer representing th...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/10-transformer_decoder.py
macoyulloa/holbertonschool-machine_learning
train
0
c0d6d78684b6939d2a5782ed7631cee4e471df98
[ "if s is not None and t is not None and (abs(len(s) - len(t)) == 1):\n dic = {}\n for i, x in enumerate(s):\n if x not in dic:\n dic[x] = [i]\n else:\n dic[x].append(i)\n other_dic = {}\n for j, y in enumerate(t):\n if y not in dic:\n return y\n ...
<|body_start_0|> if s is not None and t is not None and (abs(len(s) - len(t)) == 1): dic = {} for i, x in enumerate(s): if x not in dic: dic[x] = [i] else: dic[x].append(i) other_dic = {} for ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def find_diff_non_sorted(self, s, t): """worst case: if the extra character is one of the duplicate values complexity: O(n) + O(m) + O(distinct characters in t): n => len(s), m => len(t) O(m)""" <|body_0|> def findTheDifference(self, s, t): """:type s: str ...
stack_v2_sparse_classes_75kplus_train_072059
2,381
no_license
[ { "docstring": "worst case: if the extra character is one of the duplicate values complexity: O(n) + O(m) + O(distinct characters in t): n => len(s), m => len(t) O(m)", "name": "find_diff_non_sorted", "signature": "def find_diff_non_sorted(self, s, t)" }, { "docstring": ":type s: str :type t: st...
2
stack_v2_sparse_classes_30k_train_029402
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find_diff_non_sorted(self, s, t): worst case: if the extra character is one of the duplicate values complexity: O(n) + O(m) + O(distinct characters in t): n => len(s), m => l...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find_diff_non_sorted(self, s, t): worst case: if the extra character is one of the duplicate values complexity: O(n) + O(m) + O(distinct characters in t): n => len(s), m => l...
d551b46c949e12c373250d88959a83f995b80ed9
<|skeleton|> class Solution: def find_diff_non_sorted(self, s, t): """worst case: if the extra character is one of the duplicate values complexity: O(n) + O(m) + O(distinct characters in t): n => len(s), m => len(t) O(m)""" <|body_0|> def findTheDifference(self, s, t): """:type s: str ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def find_diff_non_sorted(self, s, t): """worst case: if the extra character is one of the duplicate values complexity: O(n) + O(m) + O(distinct characters in t): n => len(s), m => len(t) O(m)""" if s is not None and t is not None and (abs(len(s) - len(t)) == 1): dic = {} ...
the_stack_v2_python_sparse
oj/leet_code/leet-code-389.py
PollobAtGit/python-101
train
0
92bfb1ec0c9a799cc901d6d5d94aedbecbed5902
[ "self.bidsInterface = BidsInterface(dataRemote=False)\nself.wsRemoteService = WsRemoteService(args, webSocketChannelName)\nself.wsRemoteService.addHandlerClass(BidsInterface, self.bidsInterface)", "self.recvThread = threading.Thread(name='recvThread', target=self.wsRemoteService.runForever)\nself.recvThread.setDa...
<|body_start_0|> self.bidsInterface = BidsInterface(dataRemote=False) self.wsRemoteService = WsRemoteService(args, webSocketChannelName) self.wsRemoteService.addHandlerClass(BidsInterface, self.bidsInterface) <|end_body_0|> <|body_start_1|> self.recvThread = threading.Thread(name='recvT...
A class that implements the OpenNeuroService by instantiating a BidsInterface, connecting to the remote projectServer and servicing requests to the BidsInterface.
OpenNeuroService
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OpenNeuroService: """A class that implements the OpenNeuroService by instantiating a BidsInterface, connecting to the remote projectServer and servicing requests to the BidsInterface.""" def __init__(self, args, webSocketChannelName='wsData'): """Uses the WsRemoteService framework to...
stack_v2_sparse_classes_75kplus_train_072060
2,981
permissive
[ { "docstring": "Uses the WsRemoteService framework to parse connection-related args and establish a connection to a remote projectServer. Instantiates a local version of BidsInterface to handle client requests coming from the projectServer connection. Args: args: Argparse args related to connecting to the remot...
2
stack_v2_sparse_classes_30k_train_029939
Implement the Python class `OpenNeuroService` described below. Class description: A class that implements the OpenNeuroService by instantiating a BidsInterface, connecting to the remote projectServer and servicing requests to the BidsInterface. Method signatures and docstrings: - def __init__(self, args, webSocketCha...
Implement the Python class `OpenNeuroService` described below. Class description: A class that implements the OpenNeuroService by instantiating a BidsInterface, connecting to the remote projectServer and servicing requests to the BidsInterface. Method signatures and docstrings: - def __init__(self, args, webSocketCha...
3eb181152e173d5e8e5e46c2d2faeab25f11f564
<|skeleton|> class OpenNeuroService: """A class that implements the OpenNeuroService by instantiating a BidsInterface, connecting to the remote projectServer and servicing requests to the BidsInterface.""" def __init__(self, args, webSocketChannelName='wsData'): """Uses the WsRemoteService framework to...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class OpenNeuroService: """A class that implements the OpenNeuroService by instantiating a BidsInterface, connecting to the remote projectServer and servicing requests to the BidsInterface.""" def __init__(self, args, webSocketChannelName='wsData'): """Uses the WsRemoteService framework to parse connec...
the_stack_v2_python_sparse
rtCommon/openNeuroService.py
brainiak/rt-cloud
train
13
2724fd1e7bc09a955f1e5d13e87b1a834e4566ac
[ "super().__init__()\nself.norm = nn.InstanceNorm1D(in_channels, momentum=0.1, data_format='NCL', weight_attr=False, bias_attr=False)\nself.aux_conv = nn.Sequential(nn.Conv1D(aux_channels, in_channels, kernel_size, 1, bias_attr=bias, padding=(kernel_size - 1) // 2))\nself.gated_conv = nn.Sequential(nn.Conv1D(in_chan...
<|body_start_0|> super().__init__() self.norm = nn.InstanceNorm1D(in_channels, momentum=0.1, data_format='NCL', weight_attr=False, bias_attr=False) self.aux_conv = nn.Sequential(nn.Conv1D(aux_channels, in_channels, kernel_size, 1, bias_attr=bias, padding=(kernel_size - 1) // 2)) self.gat...
TADE Layer module.
TADELayer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TADELayer: """TADE Layer module.""" def __init__(self, in_channels: int=64, aux_channels: int=80, kernel_size: int=9, bias: bool=True, upsample_factor: int=2, upsample_mode: str='nearest'): """Initilize TADE layer.""" <|body_0|> def forward(self, x, c): """Calcul...
stack_v2_sparse_classes_75kplus_train_072061
5,634
permissive
[ { "docstring": "Initilize TADE layer.", "name": "__init__", "signature": "def __init__(self, in_channels: int=64, aux_channels: int=80, kernel_size: int=9, bias: bool=True, upsample_factor: int=2, upsample_mode: str='nearest')" }, { "docstring": "Calculate forward propagation. Args: x (Tensor): ...
2
stack_v2_sparse_classes_30k_train_002506
Implement the Python class `TADELayer` described below. Class description: TADE Layer module. Method signatures and docstrings: - def __init__(self, in_channels: int=64, aux_channels: int=80, kernel_size: int=9, bias: bool=True, upsample_factor: int=2, upsample_mode: str='nearest'): Initilize TADE layer. - def forwar...
Implement the Python class `TADELayer` described below. Class description: TADE Layer module. Method signatures and docstrings: - def __init__(self, in_channels: int=64, aux_channels: int=80, kernel_size: int=9, bias: bool=True, upsample_factor: int=2, upsample_mode: str='nearest'): Initilize TADE layer. - def forwar...
17854a04d43c231eff66bfed9d6aa55e94a29e79
<|skeleton|> class TADELayer: """TADE Layer module.""" def __init__(self, in_channels: int=64, aux_channels: int=80, kernel_size: int=9, bias: bool=True, upsample_factor: int=2, upsample_mode: str='nearest'): """Initilize TADE layer.""" <|body_0|> def forward(self, x, c): """Calcul...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TADELayer: """TADE Layer module.""" def __init__(self, in_channels: int=64, aux_channels: int=80, kernel_size: int=9, bias: bool=True, upsample_factor: int=2, upsample_mode: str='nearest'): """Initilize TADE layer.""" super().__init__() self.norm = nn.InstanceNorm1D(in_channels, m...
the_stack_v2_python_sparse
paddlespeech/t2s/modules/tade_res_block.py
anniyanvr/DeepSpeech-1
train
0
f19032621de0adcda0d20dde66c25b1d3b09c91c
[ "self.code = code\nself.message = message\nself.token = token\nself.position = position\nif token:\n self.start_index = token.start_index\nelse:\n self.start_index = 0\nself.fix_data = fix_data\nif self.position:\n self.start_index += self.position.start", "line_diff = a.token.line_number - b.token.line_...
<|body_start_0|> self.code = code self.message = message self.token = token self.position = position if token: self.start_index = token.start_index else: self.start_index = 0 self.fix_data = fix_data if self.position: se...
Object representing a style error.
Error
[ "Apache-2.0", "BSD-3-Clause", "X11", "MIT", "GPL-2.0-only" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Error: """Object representing a style error.""" def __init__(self, code, message, token, position, fix_data): """Initialize the error object. Args: code: The numeric error code. message: The error message string. token: The tokens.Token where the error occurred. position: The positio...
stack_v2_sparse_classes_75kplus_train_072062
2,070
permissive
[ { "docstring": "Initialize the error object. Args: code: The numeric error code. message: The error message string. token: The tokens.Token where the error occurred. position: The position of the error within the token. fix_data: Data to be used in autofixing. Codes with fix_data are: GOOG_REQUIRES_NOT_ALPHABET...
2
null
Implement the Python class `Error` described below. Class description: Object representing a style error. Method signatures and docstrings: - def __init__(self, code, message, token, position, fix_data): Initialize the error object. Args: code: The numeric error code. message: The error message string. token: The tok...
Implement the Python class `Error` described below. Class description: Object representing a style error. Method signatures and docstrings: - def __init__(self, code, message, token, position, fix_data): Initialize the error object. Args: code: The numeric error code. message: The error message string. token: The tok...
8ea819b082201fb9a8c7c158dfe0945be4ff03f8
<|skeleton|> class Error: """Object representing a style error.""" def __init__(self, code, message, token, position, fix_data): """Initialize the error object. Args: code: The numeric error code. message: The error message string. token: The tokens.Token where the error occurred. position: The positio...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Error: """Object representing a style error.""" def __init__(self, code, message, token, position, fix_data): """Initialize the error object. Args: code: The numeric error code. message: The error message string. token: The tokens.Token where the error occurred. position: The position of the erro...
the_stack_v2_python_sparse
lib/extern/closure-linter/closure_linter/common/error.py
cloudkick/cast
train
110
aff37f6c081fd90494bba0996de2d664e56a4044
[ "for parser in parsers:\n if parser.media_type in SCIM_CONTENT_TYPES:\n return parser", "for renderer in renderers:\n if renderer.media_type in SCIM_CONTENT_TYPES:\n return (renderer, renderer.media_type)" ]
<|body_start_0|> for parser in parsers: if parser.media_type in SCIM_CONTENT_TYPES: return parser <|end_body_0|> <|body_start_1|> for renderer in renderers: if renderer.media_type in SCIM_CONTENT_TYPES: return (renderer, renderer.media_type) <|end...
SCIMClientNegotiation
[ "Apache-2.0", "BUSL-1.1" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SCIMClientNegotiation: def select_parser(self, request: Request, parsers): """Select the first parser in the `.parser_classes` list.""" <|body_0|> def select_renderer(self, request: Request, renderers, format_suffix): """Select the first renderer in the `.renderer_cl...
stack_v2_sparse_classes_75kplus_train_072063
7,038
permissive
[ { "docstring": "Select the first parser in the `.parser_classes` list.", "name": "select_parser", "signature": "def select_parser(self, request: Request, parsers)" }, { "docstring": "Select the first renderer in the `.renderer_classes` list.", "name": "select_renderer", "signature": "def...
2
stack_v2_sparse_classes_30k_train_021611
Implement the Python class `SCIMClientNegotiation` described below. Class description: Implement the SCIMClientNegotiation class. Method signatures and docstrings: - def select_parser(self, request: Request, parsers): Select the first parser in the `.parser_classes` list. - def select_renderer(self, request: Request,...
Implement the Python class `SCIMClientNegotiation` described below. Class description: Implement the SCIMClientNegotiation class. Method signatures and docstrings: - def select_parser(self, request: Request, parsers): Select the first parser in the `.parser_classes` list. - def select_renderer(self, request: Request,...
d9dd4f382f96b5c4576b64cbf015db651556c18b
<|skeleton|> class SCIMClientNegotiation: def select_parser(self, request: Request, parsers): """Select the first parser in the `.parser_classes` list.""" <|body_0|> def select_renderer(self, request: Request, renderers, format_suffix): """Select the first renderer in the `.renderer_cl...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SCIMClientNegotiation: def select_parser(self, request: Request, parsers): """Select the first parser in the `.parser_classes` list.""" for parser in parsers: if parser.media_type in SCIM_CONTENT_TYPES: return parser def select_renderer(self, request: Request, ...
the_stack_v2_python_sparse
src/sentry/scim/endpoints/utils.py
nagyist/sentry
train
0
cf80295ad90c6d8a6dd5580fd49418cd612d4fc7
[ "super(PinPos, self).__init__()\nself.pin_offset_x = pin_offset_x\nself.pin_offset_y = pin_offset_y\nself.pin2node_map = pin2node_map.long()\nself.flat_node2pin_map = flat_node2pin_map\nself.flat_node2pin_start_map = flat_node2pin_start_map\nself.num_physical_nodes = num_physical_nodes\nself.algorithm = algorithm",...
<|body_start_0|> super(PinPos, self).__init__() self.pin_offset_x = pin_offset_x self.pin_offset_y = pin_offset_y self.pin2node_map = pin2node_map.long() self.flat_node2pin_map = flat_node2pin_map self.flat_node2pin_start_map = flat_node2pin_start_map self.num_phy...
@brief Given cell locations, compute pin locations. Different from torch.index_add which computes x[index[i]] += t[i], the forward function compute x[i] += t[index[i]]
PinPos
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PinPos: """@brief Given cell locations, compute pin locations. Different from torch.index_add which computes x[index[i]] += t[i], the forward function compute x[i] += t[index[i]]""" def __init__(self, pin_offset_x, pin_offset_y, pin2node_map, flat_node2pin_map, flat_node2pin_start_map, num_p...
stack_v2_sparse_classes_75kplus_train_072064
6,045
permissive
[ { "docstring": "@brief initialization @param pin_offset pin offset in x or y direction, only computes one direction @param algorithm segment|node-by-node", "name": "__init__", "signature": "def __init__(self, pin_offset_x, pin_offset_y, pin2node_map, flat_node2pin_map, flat_node2pin_start_map, num_physi...
2
stack_v2_sparse_classes_30k_train_024697
Implement the Python class `PinPos` described below. Class description: @brief Given cell locations, compute pin locations. Different from torch.index_add which computes x[index[i]] += t[i], the forward function compute x[i] += t[index[i]] Method signatures and docstrings: - def __init__(self, pin_offset_x, pin_offse...
Implement the Python class `PinPos` described below. Class description: @brief Given cell locations, compute pin locations. Different from torch.index_add which computes x[index[i]] += t[i], the forward function compute x[i] += t[index[i]] Method signatures and docstrings: - def __init__(self, pin_offset_x, pin_offse...
f59ebfa4831573d3db38642f4b2d2e2108bd6e3e
<|skeleton|> class PinPos: """@brief Given cell locations, compute pin locations. Different from torch.index_add which computes x[index[i]] += t[i], the forward function compute x[i] += t[index[i]]""" def __init__(self, pin_offset_x, pin_offset_y, pin2node_map, flat_node2pin_map, flat_node2pin_start_map, num_p...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PinPos: """@brief Given cell locations, compute pin locations. Different from torch.index_add which computes x[index[i]] += t[i], the forward function compute x[i] += t[index[i]]""" def __init__(self, pin_offset_x, pin_offset_y, pin2node_map, flat_node2pin_map, flat_node2pin_start_map, num_physical_nodes...
the_stack_v2_python_sparse
dreamplace/ops/pin_pos/pin_pos.py
limbo018/DREAMPlace
train
539
4d620b8a55919ed2257ee6eaca57727c67c037ec
[ "if not root:\n return 'null,'\nstack = [root]\nss = [str(root.val) + ',']\ns = ''\nwhile stack:\n p = stack.pop()\n s += ss.pop()\n if p:\n if p.right:\n stack.append(p.right)\n ss.append(str(p.right.val) + ',')\n else:\n stack.append(None)\n ss...
<|body_start_0|> if not root: return 'null,' stack = [root] ss = [str(root.val) + ','] s = '' while stack: p = stack.pop() s += ss.pop() if p: if p.right: stack.append(p.right) ...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" <|body_0|> def deserialize(self, data: str) -> TreeNode: """Decodes your encoded data to tree.""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not root: ...
stack_v2_sparse_classes_75kplus_train_072065
2,873
no_license
[ { "docstring": "Encodes a tree to a single string.", "name": "serialize", "signature": "def serialize(self, root: TreeNode) -> str" }, { "docstring": "Decodes your encoded data to tree.", "name": "deserialize", "signature": "def deserialize(self, data: str) -> TreeNode" } ]
2
stack_v2_sparse_classes_30k_train_047087
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: TreeNode) -> str: Encodes a tree to a single string. - def deserialize(self, data: str) -> TreeNode: Decodes your encoded data to tree.
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: TreeNode) -> str: Encodes a tree to a single string. - def deserialize(self, data: str) -> TreeNode: Decodes your encoded data to tree. <|skeleton|> class Co...
276d2137a929e41120c2e8a3a8e4d09023a2abd5
<|skeleton|> class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" <|body_0|> def deserialize(self, data: str) -> TreeNode: """Decodes your encoded data to tree.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" if not root: return 'null,' stack = [root] ss = [str(root.val) + ','] s = '' while stack: p = stack.pop() s += ss.pop() if...
the_stack_v2_python_sparse
449.序列化和反序列化二叉搜索树.py
kangkang59812/LeetCode-python
train
0
69eee2f6ea0c11bac67ef5ed050b3775e51ebaf2
[ "BaseGanglia.__init__(self)\nself.manager_ip = '127.0.0.1'\nself.cps_home = config_parser.get('manager', 'CONPAAS_HOME')", "BaseGanglia.configure(self)\nsrc = open(os.path.join(self.cps_home, 'config', 'ganglia', 'ganglia-gmetad.tmpl')).read()\ntmpl = Template(src, {'clusterName': self.cluster_name})\nopen(self.G...
<|body_start_0|> BaseGanglia.__init__(self) self.manager_ip = '127.0.0.1' self.cps_home = config_parser.get('manager', 'CONPAAS_HOME') <|end_body_0|> <|body_start_1|> BaseGanglia.configure(self) src = open(os.path.join(self.cps_home, 'config', 'ganglia', 'ganglia-gmetad.tmpl'))....
ManagerGanglia
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ManagerGanglia: def __init__(self, config_parser): """Same as for the base case, but with localhost as manager_ip""" <|body_0|> def configure(self): """Here we also need to configure gmetad and the ganglia frontend""" <|body_1|> def start(self): ...
stack_v2_sparse_classes_75kplus_train_072066
5,134
permissive
[ { "docstring": "Same as for the base case, but with localhost as manager_ip", "name": "__init__", "signature": "def __init__(self, config_parser)" }, { "docstring": "Here we also need to configure gmetad and the ganglia frontend", "name": "configure", "signature": "def configure(self)" ...
3
null
Implement the Python class `ManagerGanglia` described below. Class description: Implement the ManagerGanglia class. Method signatures and docstrings: - def __init__(self, config_parser): Same as for the base case, but with localhost as manager_ip - def configure(self): Here we also need to configure gmetad and the ga...
Implement the Python class `ManagerGanglia` described below. Class description: Implement the ManagerGanglia class. Method signatures and docstrings: - def __init__(self, config_parser): Same as for the base case, but with localhost as manager_ip - def configure(self): Here we also need to configure gmetad and the ga...
0141a11b67b14757f445b44613ea79819b9c2eaf
<|skeleton|> class ManagerGanglia: def __init__(self, config_parser): """Same as for the base case, but with localhost as manager_ip""" <|body_0|> def configure(self): """Here we also need to configure gmetad and the ganglia frontend""" <|body_1|> def start(self): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ManagerGanglia: def __init__(self, config_parser): """Same as for the base case, but with localhost as manager_ip""" BaseGanglia.__init__(self) self.manager_ip = '127.0.0.1' self.cps_home = config_parser.get('manager', 'CONPAAS_HOME') def configure(self): """Here w...
the_stack_v2_python_sparse
conpaas-services/src/conpaas/core/ganglia.py
ConPaaS-team/conpaas
train
5
9be4760076178743ad2adb72cc7f77d524475289
[ "ip = readConfig.ip\ni_port = readConfig.i_port\nurl = 'http://' + ip + ':' + i_port + '/backend/capacity/maintain/siteInfo'\nheader = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0', 'X-Requested-With': 'XMLHttpRequest', 'Connection': 'keep-alive'}\npar = {'userCode': use...
<|body_start_0|> ip = readConfig.ip i_port = readConfig.i_port url = 'http://' + ip + ':' + i_port + '/backend/capacity/maintain/siteInfo' header = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0', 'X-Requested-With': 'XMLHttpRequest', 'Connectio...
站长站点信息接口
Maintain_siteinfo
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Maintain_siteinfo: """站长站点信息接口""" def siteinfo(self, userCode): """一个参数: 登录用户code(工号):userCode""" <|body_0|> def test_siteinfo1(self): """测试站长站点信息接口:请求参数正确""" <|body_1|> def test_siteinfo2(self): """测试站长站点信息接口:登录用户code(工号)不存在""" <|bod...
stack_v2_sparse_classes_75kplus_train_072067
2,994
no_license
[ { "docstring": "一个参数: 登录用户code(工号):userCode", "name": "siteinfo", "signature": "def siteinfo(self, userCode)" }, { "docstring": "测试站长站点信息接口:请求参数正确", "name": "test_siteinfo1", "signature": "def test_siteinfo1(self)" }, { "docstring": "测试站长站点信息接口:登录用户code(工号)不存在", "name": "test...
4
stack_v2_sparse_classes_30k_train_044922
Implement the Python class `Maintain_siteinfo` described below. Class description: 站长站点信息接口 Method signatures and docstrings: - def siteinfo(self, userCode): 一个参数: 登录用户code(工号):userCode - def test_siteinfo1(self): 测试站长站点信息接口:请求参数正确 - def test_siteinfo2(self): 测试站长站点信息接口:登录用户code(工号)不存在 - def test_siteinfo3(self): 测试站...
Implement the Python class `Maintain_siteinfo` described below. Class description: 站长站点信息接口 Method signatures and docstrings: - def siteinfo(self, userCode): 一个参数: 登录用户code(工号):userCode - def test_siteinfo1(self): 测试站长站点信息接口:请求参数正确 - def test_siteinfo2(self): 测试站长站点信息接口:登录用户code(工号)不存在 - def test_siteinfo3(self): 测试站...
f581f7e3f558fa8aa69b92f99ee32c2c77afc770
<|skeleton|> class Maintain_siteinfo: """站长站点信息接口""" def siteinfo(self, userCode): """一个参数: 登录用户code(工号):userCode""" <|body_0|> def test_siteinfo1(self): """测试站长站点信息接口:请求参数正确""" <|body_1|> def test_siteinfo2(self): """测试站长站点信息接口:登录用户code(工号)不存在""" <|bod...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Maintain_siteinfo: """站长站点信息接口""" def siteinfo(self, userCode): """一个参数: 登录用户code(工号):userCode""" ip = readConfig.ip i_port = readConfig.i_port url = 'http://' + ip + ':' + i_port + '/backend/capacity/maintain/siteInfo' header = {'User-Agent': 'Mozilla/5.0 (Windows...
the_stack_v2_python_sparse
case/test_maintain_siteInfo.py
jasnPackage/zhandian_jiekou
train
0
0ab62ea7287244fe54b99b9a064cc63707c803bd
[ "if geonameid == None:\n resp = jsonify({'data': [element.to_json() for element in Content.query.all()]})\n resp.status_code = 200\n return resp\nelse:\n data = Content.query.filter_by(geonameid=geonameid).first()\n if not data:\n resp = jsonify({'status': 'fail', 'message': 'geonameid not fou...
<|body_start_0|> if geonameid == None: resp = jsonify({'data': [element.to_json() for element in Content.query.all()]}) resp.status_code = 200 return resp else: data = Content.query.filter_by(geonameid=geonameid).first() if not data: ...
Ressource pourla manipulation des données
Data
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Data: """Ressource pourla manipulation des données""" def get(self, current_user, geonameid=None): """Gère l'accès aux données en lecture""" <|body_0|> def put(self, current_user, geonameid=None): """Ajoute des données""" <|body_1|> def post(self, cu...
stack_v2_sparse_classes_75kplus_train_072068
7,799
no_license
[ { "docstring": "Gère l'accès aux données en lecture", "name": "get", "signature": "def get(self, current_user, geonameid=None)" }, { "docstring": "Ajoute des données", "name": "put", "signature": "def put(self, current_user, geonameid=None)" }, { "docstring": "Modifie les données...
4
stack_v2_sparse_classes_30k_train_017536
Implement the Python class `Data` described below. Class description: Ressource pourla manipulation des données Method signatures and docstrings: - def get(self, current_user, geonameid=None): Gère l'accès aux données en lecture - def put(self, current_user, geonameid=None): Ajoute des données - def post(self, curren...
Implement the Python class `Data` described below. Class description: Ressource pourla manipulation des données Method signatures and docstrings: - def get(self, current_user, geonameid=None): Gère l'accès aux données en lecture - def put(self, current_user, geonameid=None): Ajoute des données - def post(self, curren...
3b8318e4d783d85257b5bef9a447aa55fbf38643
<|skeleton|> class Data: """Ressource pourla manipulation des données""" def get(self, current_user, geonameid=None): """Gère l'accès aux données en lecture""" <|body_0|> def put(self, current_user, geonameid=None): """Ajoute des données""" <|body_1|> def post(self, cu...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Data: """Ressource pourla manipulation des données""" def get(self, current_user, geonameid=None): """Gère l'accès aux données en lecture""" if geonameid == None: resp = jsonify({'data': [element.to_json() for element in Content.query.all()]}) resp.status_code = 20...
the_stack_v2_python_sparse
backend/resources/data.py
camille-rey-taffin/projet_tecweb_1
train
0
0d60b7b8526aa669ba65b13104a262556c82576a
[ "if keys is None:\n keys = ['ymin', 'xmin', 'ymax', 'xmax']\nelif len(keys) != 4:\n raise ValueError('BoundingBox expects 4 keys but got {}'.format(len(keys)))\nself._prefix = prefix\nself._keys = keys\nself._full_keys = [prefix + k for k in keys]\nsuper(BoundingBox, self).__init__(self._full_keys)", "sides...
<|body_start_0|> if keys is None: keys = ['ymin', 'xmin', 'ymax', 'xmax'] elif len(keys) != 4: raise ValueError('BoundingBox expects 4 keys but got {}'.format(len(keys))) self._prefix = prefix self._keys = keys self._full_keys = [prefix + k for k in keys] ...
An ItemHandler that concatenates a set of parsed Tensors to Bounding Boxes.
BoundingBox
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BoundingBox: """An ItemHandler that concatenates a set of parsed Tensors to Bounding Boxes.""" def __init__(self, keys=None, prefix=None): """Initialize the bounding box handler. Args: keys: A list of four key names representing the ymin, xmin, ymax, mmax prefix: An optional prefix f...
stack_v2_sparse_classes_75kplus_train_072069
15,383
permissive
[ { "docstring": "Initialize the bounding box handler. Args: keys: A list of four key names representing the ymin, xmin, ymax, mmax prefix: An optional prefix for each of the bounding box keys. If provided, `prefix` is appended to each key in `keys`. Raises: ValueError: if keys is not `None` and also not a list o...
2
stack_v2_sparse_classes_30k_val_002077
Implement the Python class `BoundingBox` described below. Class description: An ItemHandler that concatenates a set of parsed Tensors to Bounding Boxes. Method signatures and docstrings: - def __init__(self, keys=None, prefix=None): Initialize the bounding box handler. Args: keys: A list of four key names representin...
Implement the Python class `BoundingBox` described below. Class description: An ItemHandler that concatenates a set of parsed Tensors to Bounding Boxes. Method signatures and docstrings: - def __init__(self, keys=None, prefix=None): Initialize the bounding box handler. Args: keys: A list of four key names representin...
cabf6e4f1970dc14302f87414f170de19944bac2
<|skeleton|> class BoundingBox: """An ItemHandler that concatenates a set of parsed Tensors to Bounding Boxes.""" def __init__(self, keys=None, prefix=None): """Initialize the bounding box handler. Args: keys: A list of four key names representing the ymin, xmin, ymax, mmax prefix: An optional prefix f...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BoundingBox: """An ItemHandler that concatenates a set of parsed Tensors to Bounding Boxes.""" def __init__(self, keys=None, prefix=None): """Initialize the bounding box handler. Args: keys: A list of four key names representing the ymin, xmin, ymax, mmax prefix: An optional prefix for each of th...
the_stack_v2_python_sparse
Tensorflow_OpenCV_Nightly/source/tensorflow/contrib/slim/python/slim/data/tfexample_decoder.py
ryfeus/lambda-packs
train
1,283
890f860c2394aafc4cd78bae4b8ae3ba933e3ccb
[ "heapq.heapify(nodes)\nwhile len(nodes) > 1:\n left = heapq.heappop(nodes)\n right = heapq.heappop(nodes)\n node = self._merge(left, right)\n heapq.heappush(nodes, node)\nself.root = node", "symbol = left._symbol + right._symbol\nweight = left._weight + right._weight\nnode = Node(symbol, weight, left,...
<|body_start_0|> heapq.heapify(nodes) while len(nodes) > 1: left = heapq.heappop(nodes) right = heapq.heappop(nodes) node = self._merge(left, right) heapq.heappush(nodes, node) self.root = node <|end_body_0|> <|body_start_1|> symbol = left...
HuffmanTree
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HuffmanTree: def build(self, nodes): """Build a Huffman Tree with given nodes.""" <|body_0|> def _merge(self, left, right): """Merge the given two nodes and return a new one.""" <|body_1|> def _depth(self, node): """Return the depth of a given no...
stack_v2_sparse_classes_75kplus_train_072070
2,759
no_license
[ { "docstring": "Build a Huffman Tree with given nodes.", "name": "build", "signature": "def build(self, nodes)" }, { "docstring": "Merge the given two nodes and return a new one.", "name": "_merge", "signature": "def _merge(self, left, right)" }, { "docstring": "Return the depth ...
4
stack_v2_sparse_classes_30k_train_044280
Implement the Python class `HuffmanTree` described below. Class description: Implement the HuffmanTree class. Method signatures and docstrings: - def build(self, nodes): Build a Huffman Tree with given nodes. - def _merge(self, left, right): Merge the given two nodes and return a new one. - def _depth(self, node): Re...
Implement the Python class `HuffmanTree` described below. Class description: Implement the HuffmanTree class. Method signatures and docstrings: - def build(self, nodes): Build a Huffman Tree with given nodes. - def _merge(self, left, right): Merge the given two nodes and return a new one. - def _depth(self, node): Re...
222ee034fe2943c2e5ee1a9e642d108b046b2f2a
<|skeleton|> class HuffmanTree: def build(self, nodes): """Build a Huffman Tree with given nodes.""" <|body_0|> def _merge(self, left, right): """Merge the given two nodes and return a new one.""" <|body_1|> def _depth(self, node): """Return the depth of a given no...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class HuffmanTree: def build(self, nodes): """Build a Huffman Tree with given nodes.""" heapq.heapify(nodes) while len(nodes) > 1: left = heapq.heappop(nodes) right = heapq.heappop(nodes) node = self._merge(left, right) heapq.heappush(nodes, no...
the_stack_v2_python_sparse
03 Greedy Algorithms, Minimum Spanning Trees, and Dynamic Programming/algo3assignments/Programming Assignment #3/Huffman.py
peng00bo00/Coursera-Algorithms
train
0
973e304fd5ef03b113b8f4783c71f906fe8811b6
[ "self.sess = sess\nself.net = localNetwork\nself.global_step = global_step\nself.global_step_next = global_step_next\nself.settings = settings\nself.progbar = progbar\nself.writer = writer\nself.MODEL_PATH = MODEL_PATH\nself.saver = saver", "while not COORD.should_stop() and self.sess.run(self.global_step) < self...
<|body_start_0|> self.sess = sess self.net = localNetwork self.global_step = global_step self.global_step_next = global_step_next self.settings = settings self.progbar = progbar self.writer = writer self.MODEL_PATH = MODEL_PATH self.saver = saver <...
WorkerMaster
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WorkerMaster: def __init__(self, localNetwork, sess, global_step, global_step_next, settings, progbar, writer, MODEL_PATH, saver): """Creates a worker that is used to gather smaples to update the main network. Inputs: name - Unique name for the worker actor-critic environmnet. sess - Ses...
stack_v2_sparse_classes_75kplus_train_072071
29,749
permissive
[ { "docstring": "Creates a worker that is used to gather smaples to update the main network. Inputs: name - Unique name for the worker actor-critic environmnet. sess - Session Name globalAC - Name of the Global actor-critic which the updates are based around.", "name": "__init__", "signature": "def __ini...
2
null
Implement the Python class `WorkerMaster` described below. Class description: Implement the WorkerMaster class. Method signatures and docstrings: - def __init__(self, localNetwork, sess, global_step, global_step_next, settings, progbar, writer, MODEL_PATH, saver): Creates a worker that is used to gather smaples to up...
Implement the Python class `WorkerMaster` described below. Class description: Implement the WorkerMaster class. Method signatures and docstrings: - def __init__(self, localNetwork, sess, global_step, global_step_next, settings, progbar, writer, MODEL_PATH, saver): Creates a worker that is used to gather smaples to up...
0e971e40e063b17918460e19728f95d7924af8db
<|skeleton|> class WorkerMaster: def __init__(self, localNetwork, sess, global_step, global_step_next, settings, progbar, writer, MODEL_PATH, saver): """Creates a worker that is used to gather smaples to update the main network. Inputs: name - Unique name for the worker actor-critic environmnet. sess - Ses...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class WorkerMaster: def __init__(self, localNetwork, sess, global_step, global_step_next, settings, progbar, writer, MODEL_PATH, saver): """Creates a worker that is used to gather smaples to update the main network. Inputs: name - Unique name for the worker actor-critic environmnet. sess - Session Name glob...
the_stack_v2_python_sparse
methods/Agent57.py
vanstrn/RL_public
train
1
2fcf8f3b55e12e72373ee6396d09eb29d73db305
[ "super().__init__()\nself.cls_token = config['cls_token']\nif self.cls_token:\n self.pooling_type = 'cls'\n self.cls_param = nn.Parameter(torch.randn(config.hidden_size))\nelse:\n self.pooling_type = config['pooling_type']\nself.l1 = nn.Linear(in_features=n_features, out_features=config.hidden_size)\nself....
<|body_start_0|> super().__init__() self.cls_token = config['cls_token'] if self.cls_token: self.pooling_type = 'cls' self.cls_param = nn.Parameter(torch.randn(config.hidden_size)) else: self.pooling_type = config['pooling_type'] self.l1 = nn.L...
BERT decoder module. Args: n_features (int): Number of features in the input. num_class (int): Number of class for classification. config (dict): Configuration set for BERT layer.
BERT
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BERT: """BERT decoder module. Args: n_features (int): Number of features in the input. num_class (int): Number of class for classification. config (dict): Configuration set for BERT layer.""" def __init__(self, n_features, num_class, config): """pooling_type -> ["max","avg","att","cl...
stack_v2_sparse_classes_75kplus_train_072072
3,476
permissive
[ { "docstring": "pooling_type -> [\"max\",\"avg\",\"att\",\"cls\"]", "name": "__init__", "signature": "def __init__(self, n_features, num_class, config)" }, { "docstring": "Args: x (torch.Tensor): Input tensor of shape: (batch_size, T, n_features) returns: torch.Tensor: logits for classification....
2
null
Implement the Python class `BERT` described below. Class description: BERT decoder module. Args: n_features (int): Number of features in the input. num_class (int): Number of class for classification. config (dict): Configuration set for BERT layer. Method signatures and docstrings: - def __init__(self, n_features, n...
Implement the Python class `BERT` described below. Class description: BERT decoder module. Args: n_features (int): Number of features in the input. num_class (int): Number of class for classification. config (dict): Configuration set for BERT layer. Method signatures and docstrings: - def __init__(self, n_features, n...
b9ccf9eaf2a71301fc4601a64a6af06fdef04c9b
<|skeleton|> class BERT: """BERT decoder module. Args: n_features (int): Number of features in the input. num_class (int): Number of class for classification. config (dict): Configuration set for BERT layer.""" def __init__(self, n_features, num_class, config): """pooling_type -> ["max","avg","att","cl...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BERT: """BERT decoder module. Args: n_features (int): Number of features in the input. num_class (int): Number of class for classification. config (dict): Configuration set for BERT layer.""" def __init__(self, n_features, num_class, config): """pooling_type -> ["max","avg","att","cls"]""" ...
the_stack_v2_python_sparse
openhands/models/decoder/bert_hf.py
AI4Bharat/OpenHands
train
73
d6c1dbb26e8c7a51be805bcc464623902acc146d
[ "self.hosts = []\nself.host_urls = []\nself.patterns = []\nself.hosts.append(rapidshare_com())\nself.hosts.append(hotfile_com())\nself.hosts.append(fileserve_com())\nself.hosts.append(wupload_com())\nself.hosts.append(oron_com())\nself.hosts.append(easy_share_com())\nfor host in self.hosts:\n host.init()\n se...
<|body_start_0|> self.hosts = [] self.host_urls = [] self.patterns = [] self.hosts.append(rapidshare_com()) self.hosts.append(hotfile_com()) self.hosts.append(fileserve_com()) self.hosts.append(wupload_com()) self.hosts.append(oron_com()) self.host...
linkchecker
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class linkchecker: def __init__(self): """Initialize the link checker. This will load all of the hosts, and compile all of the regular expressions""" <|body_0|> def parse(self, text): """Parses the text and returns a list of links.""" <|body_1|> def check(self...
stack_v2_sparse_classes_75kplus_train_072073
1,797
no_license
[ { "docstring": "Initialize the link checker. This will load all of the hosts, and compile all of the regular expressions", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Parses the text and returns a list of links.", "name": "parse", "signature": "def parse(self...
3
stack_v2_sparse_classes_30k_test_001953
Implement the Python class `linkchecker` described below. Class description: Implement the linkchecker class. Method signatures and docstrings: - def __init__(self): Initialize the link checker. This will load all of the hosts, and compile all of the regular expressions - def parse(self, text): Parses the text and re...
Implement the Python class `linkchecker` described below. Class description: Implement the linkchecker class. Method signatures and docstrings: - def __init__(self): Initialize the link checker. This will load all of the hosts, and compile all of the regular expressions - def parse(self, text): Parses the text and re...
7c1a97c9f5bc8c246315737489db7e60c0135a1d
<|skeleton|> class linkchecker: def __init__(self): """Initialize the link checker. This will load all of the hosts, and compile all of the regular expressions""" <|body_0|> def parse(self, text): """Parses the text and returns a list of links.""" <|body_1|> def check(self...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class linkchecker: def __init__(self): """Initialize the link checker. This will load all of the hosts, and compile all of the regular expressions""" self.hosts = [] self.host_urls = [] self.patterns = [] self.hosts.append(rapidshare_com()) self.hosts.append(hotfile_c...
the_stack_v2_python_sparse
linkchecker.py
bheesham/PyLinkChecker
train
2
56707e053eb99c55a1d3ff79d03f75e669f887c8
[ "if 'title' not in validated_data:\n raise ValidationError({'title': ['This field is required.']})\nquestion = Question.create(validated_data['title'], validated_data['user'], keywords=validated_data.get('keywords', None))\nif 'answer' in validated_data and validated_data['answer'] != '':\n Answer.create(vali...
<|body_start_0|> if 'title' not in validated_data: raise ValidationError({'title': ['This field is required.']}) question = Question.create(validated_data['title'], validated_data['user'], keywords=validated_data.get('keywords', None)) if 'answer' in validated_data and validated_data...
Serialize question
QuestionSerializer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class QuestionSerializer: """Serialize question""" def create(self, validated_data): """Create new question from validated_data""" <|body_0|> def update(self, instance, validated_data): """Update existing question by validated_data""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_75kplus_train_072074
7,932
no_license
[ { "docstring": "Create new question from validated_data", "name": "create", "signature": "def create(self, validated_data)" }, { "docstring": "Update existing question by validated_data", "name": "update", "signature": "def update(self, instance, validated_data)" } ]
2
stack_v2_sparse_classes_30k_train_038119
Implement the Python class `QuestionSerializer` described below. Class description: Serialize question Method signatures and docstrings: - def create(self, validated_data): Create new question from validated_data - def update(self, instance, validated_data): Update existing question by validated_data
Implement the Python class `QuestionSerializer` described below. Class description: Serialize question Method signatures and docstrings: - def create(self, validated_data): Create new question from validated_data - def update(self, instance, validated_data): Update existing question by validated_data <|skeleton|> cl...
670752a3b48619eeba2fa9f2cf133e6050737a73
<|skeleton|> class QuestionSerializer: """Serialize question""" def create(self, validated_data): """Create new question from validated_data""" <|body_0|> def update(self, instance, validated_data): """Update existing question by validated_data""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class QuestionSerializer: """Serialize question""" def create(self, validated_data): """Create new question from validated_data""" if 'title' not in validated_data: raise ValidationError({'title': ['This field is required.']}) question = Question.create(validated_data['title...
the_stack_v2_python_sparse
controller/src/api/serializers.py
Sapunov/qua
train
1
aef4684aa0a78c136e357c62ad0a1623a244d660
[ "with tables(db.engine, 'vcfs') as (con, runs):\n q = select(runs.c).order_by(desc(runs.c.id))\n return [dict(r) for r in q.execute().fetchall()]", "run = request.validated_body\ntry:\n expect_one_of(request.validated_body, 'project_name', 'project_id')\nexcept voluptuous.MultipleInvalid as e:\n error...
<|body_start_0|> with tables(db.engine, 'vcfs') as (con, runs): q = select(runs.c).order_by(desc(runs.c.id)) return [dict(r) for r in q.execute().fetchall()] <|end_body_0|> <|body_start_1|> run = request.validated_body try: expect_one_of(request.validated_bod...
RunList
[ "Apache-2.0", "CC-BY-3.0", "CC-BY-4.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RunList: def get(self): """Get list of all runs in order of recency.""" <|body_0|> def post(self): """Create a new run. This will import the VCF's genotypes into the database in a worker, as well as annotate it with gene names.""" <|body_1|> <|end_skeleton|>...
stack_v2_sparse_classes_75kplus_train_072075
7,342
permissive
[ { "docstring": "Get list of all runs in order of recency.", "name": "get", "signature": "def get(self)" }, { "docstring": "Create a new run. This will import the VCF's genotypes into the database in a worker, as well as annotate it with gene names.", "name": "post", "signature": "def pos...
2
stack_v2_sparse_classes_30k_train_039085
Implement the Python class `RunList` described below. Class description: Implement the RunList class. Method signatures and docstrings: - def get(self): Get list of all runs in order of recency. - def post(self): Create a new run. This will import the VCF's genotypes into the database in a worker, as well as annotate...
Implement the Python class `RunList` described below. Class description: Implement the RunList class. Method signatures and docstrings: - def get(self): Get list of all runs in order of recency. - def post(self): Create a new run. This will import the VCF's genotypes into the database in a worker, as well as annotate...
a436c4fc212e4429fb5196a9a4d36c37bd050c52
<|skeleton|> class RunList: def get(self): """Get list of all runs in order of recency.""" <|body_0|> def post(self): """Create a new run. This will import the VCF's genotypes into the database in a worker, as well as annotate it with gene names.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class RunList: def get(self): """Get list of all runs in order of recency.""" with tables(db.engine, 'vcfs') as (con, runs): q = select(runs.c).order_by(desc(runs.c.id)) return [dict(r) for r in q.execute().fetchall()] def post(self): """Create a new run. This wi...
the_stack_v2_python_sparse
cycledash/api/runs.py
haoziyeung/cycledash
train
0
2822258ad3dccb64dc073fe6e0f7bf4607e5c595
[ "context = super().get_context_data(**kwargs)\ncontext['sidenav_band'] = 'sidenav_band'\nreturn context", "band = form.save(commit=False)\nband.updated_by = self.request.user\nband.updated_at = timezone.now()\nband.save()\nmessages.success(self.request, ' Les données du groupe ont été mises à jour ! ')\nreturn re...
<|body_start_0|> context = super().get_context_data(**kwargs) context['sidenav_band'] = 'sidenav_band' return context <|end_body_0|> <|body_start_1|> band = form.save(commit=False) band.updated_by = self.request.user band.updated_at = timezone.now() band.save() ...
BandUpdateView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BandUpdateView: def get_context_data(self, **kwargs): """To launch sidenav band""" <|body_0|> def form_valid(self, form): """to track the user who does the update for history page""" <|body_1|> <|end_skeleton|> <|body_start_0|> context = super().get...
stack_v2_sparse_classes_75kplus_train_072076
8,151
no_license
[ { "docstring": "To launch sidenav band", "name": "get_context_data", "signature": "def get_context_data(self, **kwargs)" }, { "docstring": "to track the user who does the update for history page", "name": "form_valid", "signature": "def form_valid(self, form)" } ]
2
null
Implement the Python class `BandUpdateView` described below. Class description: Implement the BandUpdateView class. Method signatures and docstrings: - def get_context_data(self, **kwargs): To launch sidenav band - def form_valid(self, form): to track the user who does the update for history page
Implement the Python class `BandUpdateView` described below. Class description: Implement the BandUpdateView class. Method signatures and docstrings: - def get_context_data(self, **kwargs): To launch sidenav band - def form_valid(self, form): to track the user who does the update for history page <|skeleton|> class ...
05c0f6a6f8d0941e638f46827e4f1d444710835a
<|skeleton|> class BandUpdateView: def get_context_data(self, **kwargs): """To launch sidenav band""" <|body_0|> def form_valid(self, form): """to track the user who does the update for history page""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BandUpdateView: def get_context_data(self, **kwargs): """To launch sidenav band""" context = super().get_context_data(**kwargs) context['sidenav_band'] = 'sidenav_band' return context def form_valid(self, form): """to track the user who does the update for history ...
the_stack_v2_python_sparse
band/views.py
horlas/MyFirstBand
train
0
22c8885b8c2db9ce65e0d8454cb7fd7a7ab4ad18
[ "self.dgate_shape = dgate.get('shape')\nself.dgate_dtype = dgate.get('dtype')\nself.w_shape = input_weight.get('shape')\nself.w_dtype = input_weight.get('dtype')\nif dropout_mask:\n self.dropout_mask_shape = dropout_mask.get('shape')\n self.dropout_mask_dtype = dropout_mask.get('dtype')\nelse:\n self.dropo...
<|body_start_0|> self.dgate_shape = dgate.get('shape') self.dgate_dtype = dgate.get('dtype') self.w_shape = input_weight.get('shape') self.w_dtype = input_weight.get('dtype') if dropout_mask: self.dropout_mask_shape = dropout_mask.get('shape') self.dropout...
Class: use to store LstmCellGradInput input parameters Modify : 2019-12-28
LstmCellGradInput
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LstmCellGradInput: """Class: use to store LstmCellGradInput input parameters Modify : 2019-12-28""" def __init__(self, dgate, input_weight, dropout_mask, dxt, dht, keep_prob, kernel_name): """init LstmCellGradInput base parameters Parameters ---------- dgate: dict the gradient of fou...
stack_v2_sparse_classes_75kplus_train_072077
19,409
no_license
[ { "docstring": "init LstmCellGradInput base parameters Parameters ---------- dgate: dict the gradient of four gate input_weight: dict weight dropout_mask: dict the mask of dropout keep_prob: dict the keep prob kernel_name: str op kernel name Returns ------- None", "name": "__init__", "signature": "def _...
3
stack_v2_sparse_classes_30k_train_008557
Implement the Python class `LstmCellGradInput` described below. Class description: Class: use to store LstmCellGradInput input parameters Modify : 2019-12-28 Method signatures and docstrings: - def __init__(self, dgate, input_weight, dropout_mask, dxt, dht, keep_prob, kernel_name): init LstmCellGradInput base paramet...
Implement the Python class `LstmCellGradInput` described below. Class description: Class: use to store LstmCellGradInput input parameters Modify : 2019-12-28 Method signatures and docstrings: - def __init__(self, dgate, input_weight, dropout_mask, dxt, dht, keep_prob, kernel_name): init LstmCellGradInput base paramet...
148511a31bfd195df889291946c43bb585acb546
<|skeleton|> class LstmCellGradInput: """Class: use to store LstmCellGradInput input parameters Modify : 2019-12-28""" def __init__(self, dgate, input_weight, dropout_mask, dxt, dht, keep_prob, kernel_name): """init LstmCellGradInput base parameters Parameters ---------- dgate: dict the gradient of fou...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LstmCellGradInput: """Class: use to store LstmCellGradInput input parameters Modify : 2019-12-28""" def __init__(self, dgate, input_weight, dropout_mask, dxt, dht, keep_prob, kernel_name): """init LstmCellGradInput base parameters Parameters ---------- dgate: dict the gradient of four gate input_...
the_stack_v2_python_sparse
convertor/huawei/impl/basic_lstm_cell_input_grad.py
jizhuoran/caffe-huawei-atlas-convertor
train
4
ae279c9d675ba8797d58e5186309fcd1c49d400a
[ "super(BaseComponent, self).__init__()\ninput_dict = {standard_component_specs.VIZ_CONFUSION_MATRIX_DICT: confusion_matrix_dict, standard_component_specs.VIZ_TEST_ACCURACY: test_accuracy, standard_component_specs.VIZ_MARKDOWN: markdown}\noutput_dict = {}\nexec_properties = {standard_component_specs.VIZ_MLPIPELINE_U...
<|body_start_0|> super(BaseComponent, self).__init__() input_dict = {standard_component_specs.VIZ_CONFUSION_MATRIX_DICT: confusion_matrix_dict, standard_component_specs.VIZ_TEST_ACCURACY: test_accuracy, standard_component_specs.VIZ_MARKDOWN: markdown} output_dict = {} exec_properties = {...
Visualization Component Class.
Visualization
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Visualization: """Visualization Component Class.""" def __init__(self, mlpipeline_ui_metadata=None, mlpipeline_metrics=None, confusion_matrix_dict=None, test_accuracy=None, markdown=None): """Initializes the Visualization component. Args: mlpipeline_ui_metadata : path to save ui meta...
stack_v2_sparse_classes_75kplus_train_072078
3,977
permissive
[ { "docstring": "Initializes the Visualization component. Args: mlpipeline_ui_metadata : path to save ui metadata mlpipeline_metrics : metrics to be uploaded confusion_metrics_dict : dict for the confusion metrics test_accuracy : test accuracy of the model markdown : markdown dictionary", "name": "__init__",...
3
stack_v2_sparse_classes_30k_train_021891
Implement the Python class `Visualization` described below. Class description: Visualization Component Class. Method signatures and docstrings: - def __init__(self, mlpipeline_ui_metadata=None, mlpipeline_metrics=None, confusion_matrix_dict=None, test_accuracy=None, markdown=None): Initializes the Visualization compo...
Implement the Python class `Visualization` described below. Class description: Visualization Component Class. Method signatures and docstrings: - def __init__(self, mlpipeline_ui_metadata=None, mlpipeline_metrics=None, confusion_matrix_dict=None, test_accuracy=None, markdown=None): Initializes the Visualization compo...
3fb199658f68e7debf4906d9ce32a9a307e39243
<|skeleton|> class Visualization: """Visualization Component Class.""" def __init__(self, mlpipeline_ui_metadata=None, mlpipeline_metrics=None, confusion_matrix_dict=None, test_accuracy=None, markdown=None): """Initializes the Visualization component. Args: mlpipeline_ui_metadata : path to save ui meta...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Visualization: """Visualization Component Class.""" def __init__(self, mlpipeline_ui_metadata=None, mlpipeline_metrics=None, confusion_matrix_dict=None, test_accuracy=None, markdown=None): """Initializes the Visualization component. Args: mlpipeline_ui_metadata : path to save ui metadata mlpipeli...
the_stack_v2_python_sparse
components/PyTorch/pytorch-kfp-components/pytorch_kfp_components/components/visualization/component.py
kubeflow/pipelines
train
3,434
2a0f4c5cb475a8861c8564158531d8a211415176
[ "paginator = client.get_paginator('describe_load_balancers')\nload_balancers = {}\nfor resp in paginator.paginate():\n for lb in resp.get('LoadBalancers', []):\n resource_arn = lb['LoadBalancerArn']\n try:\n lb_attrs = cls.get_lb_attrs(client, resource_arn)\n lb.update(lb_attr...
<|body_start_0|> paginator = client.get_paginator('describe_load_balancers') load_balancers = {} for resp in paginator.paginate(): for lb in resp.get('LoadBalancers', []): resource_arn = lb['LoadBalancerArn'] try: lb_attrs = cls.get...
Resource for load balancer
LoadBalancerResourceSpec
[ "MIT", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoadBalancerResourceSpec: """Resource for load balancer""" def list_from_aws(cls: Type['LoadBalancerResourceSpec'], client: BaseClient, account_id: str, region: str) -> ListFromAWSResult: """Return a dict of dicts of the format: {'lb_1_arn': {lb_1_dict}, 'lb_2_arn': {lb_2_dict}, ...}...
stack_v2_sparse_classes_75kplus_train_072079
4,379
permissive
[ { "docstring": "Return a dict of dicts of the format: {'lb_1_arn': {lb_1_dict}, 'lb_2_arn': {lb_2_dict}, ...} Where the dicts represent results from describe_load_balancers.", "name": "list_from_aws", "signature": "def list_from_aws(cls: Type['LoadBalancerResourceSpec'], client: BaseClient, account_id: ...
2
stack_v2_sparse_classes_30k_train_040123
Implement the Python class `LoadBalancerResourceSpec` described below. Class description: Resource for load balancer Method signatures and docstrings: - def list_from_aws(cls: Type['LoadBalancerResourceSpec'], client: BaseClient, account_id: str, region: str) -> ListFromAWSResult: Return a dict of dicts of the format...
Implement the Python class `LoadBalancerResourceSpec` described below. Class description: Resource for load balancer Method signatures and docstrings: - def list_from_aws(cls: Type['LoadBalancerResourceSpec'], client: BaseClient, account_id: str, region: str) -> ListFromAWSResult: Return a dict of dicts of the format...
eb7d5d18f3d177973c4105c21be9d251250ca8d6
<|skeleton|> class LoadBalancerResourceSpec: """Resource for load balancer""" def list_from_aws(cls: Type['LoadBalancerResourceSpec'], client: BaseClient, account_id: str, region: str) -> ListFromAWSResult: """Return a dict of dicts of the format: {'lb_1_arn': {lb_1_dict}, 'lb_2_arn': {lb_2_dict}, ...}...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LoadBalancerResourceSpec: """Resource for load balancer""" def list_from_aws(cls: Type['LoadBalancerResourceSpec'], client: BaseClient, account_id: str, region: str) -> ListFromAWSResult: """Return a dict of dicts of the format: {'lb_1_arn': {lb_1_dict}, 'lb_2_arn': {lb_2_dict}, ...} Where the di...
the_stack_v2_python_sparse
altimeter/aws/resource/elbv2/load_balancer.py
tableau/altimeter
train
75
d67c0d08824077f711ed373145700a33fa62b0a6
[ "self.size = capacity\nself.map = {}\nself.list = DoubleLinkedList()\nself.count = 0", "if key in self.map:\n self.list.deleteNode(self.map[key])\n self.list.insert(self.map[key])\n return self.map[key].val\nreturn -1", "if key in self.map:\n self.list.deleteNode(self.map[key])\n del self.map[key...
<|body_start_0|> self.size = capacity self.map = {} self.list = DoubleLinkedList() self.count = 0 <|end_body_0|> <|body_start_1|> if key in self.map: self.list.deleteNode(self.map[key]) self.list.insert(self.map[key]) return self.map[key].val ...
LRUCache
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: None""" <|body_2|> <|end_s...
stack_v2_sparse_classes_75kplus_train_072080
1,958
no_license
[ { "docstring": ":type capacity: int", "name": "__init__", "signature": "def __init__(self, capacity)" }, { "docstring": ":type key: int :rtype: int", "name": "get", "signature": "def get(self, key)" }, { "docstring": ":type key: int :type value: int :rtype: None", "name": "pu...
3
null
Implement the Python class `LRUCache` described below. Class description: Implement the LRUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: None
Implement the Python class `LRUCache` described below. Class description: Implement the LRUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: None <|sk...
e5ab6f55bec17fe19c34891a835bc091f1e3f8bc
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: None""" <|body_2|> <|end_s...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LRUCache: def __init__(self, capacity): """:type capacity: int""" self.size = capacity self.map = {} self.list = DoubleLinkedList() self.count = 0 def get(self, key): """:type key: int :rtype: int""" if key in self.map: self.list.deleteN...
the_stack_v2_python_sparse
LRUCache/LRU_Cache_DoublyLinkedList.py
girishgupta211/algorithms
train
1
fe72523285a44710ad3cf91c7d8a08c4c54dc432
[ "from collections import OrderedDict\nself.container = OrderedDict()\nself.limit = capacity", "if key not in self.container:\n return -1\nval = self.container[key] = self.container.pop(key)\nreturn val", "if key in self.container:\n self.container.pop(key)\nelif len(self.container) == self.limit:\n sel...
<|body_start_0|> from collections import OrderedDict self.container = OrderedDict() self.limit = capacity <|end_body_0|> <|body_start_1|> if key not in self.container: return -1 val = self.container[key] = self.container.pop(key) return val <|end_body_1|> <|...
LRUCache
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: None""" <|body_2|> <|end_s...
stack_v2_sparse_classes_75kplus_train_072081
1,074
no_license
[ { "docstring": ":type capacity: int", "name": "__init__", "signature": "def __init__(self, capacity)" }, { "docstring": ":type key: int :rtype: int", "name": "get", "signature": "def get(self, key)" }, { "docstring": ":type key: int :type value: int :rtype: None", "name": "pu...
3
stack_v2_sparse_classes_30k_train_050272
Implement the Python class `LRUCache` described below. Class description: Implement the LRUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: None
Implement the Python class `LRUCache` described below. Class description: Implement the LRUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: None <|sk...
cd998e5fdb7d2d5b03ef1d65f30b140be4de6fb9
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: None""" <|body_2|> <|end_s...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LRUCache: def __init__(self, capacity): """:type capacity: int""" from collections import OrderedDict self.container = OrderedDict() self.limit = capacity def get(self, key): """:type key: int :rtype: int""" if key not in self.container: return ...
the_stack_v2_python_sparse
Week4_Day24_LRU_Cache.py
zecookiez/30-Day-LeetCoding-Challenge
train
3
809fd1e2a96d786edd4aa2f720e6f4f099e5a623
[ "self.a = np.array(list(product(range(-32, 33, 16), range(-32, 33, 16))))\nself.min = np.array([0.0, 0.0])\nself.value = 0.0\nself.domain = np.array([[-65.536, 65.536], [-65.536, 65.536]])\nself.n = 2\nself.smooth = True\nself.info = [True, False, False]\nself.latex_name = 'De Jong No. 5'\nself.latex_type = 'Steep'...
<|body_start_0|> self.a = np.array(list(product(range(-32, 33, 16), range(-32, 33, 16)))) self.min = np.array([0.0, 0.0]) self.value = 0.0 self.domain = np.array([[-65.536, 65.536], [-65.536, 65.536]]) self.n = 2 self.smooth = True self.info = [True, False, False]...
De Jong No. 5 Function.
DeJong5
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DeJong5: """De Jong No. 5 Function.""" def __init__(self): """Constructor.""" <|body_0|> def cost(self, x): """Cost function.""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.a = np.array(list(product(range(-32, 33, 16), range(-32, 33, 16)))...
stack_v2_sparse_classes_75kplus_train_072082
1,249
no_license
[ { "docstring": "Constructor.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Cost function.", "name": "cost", "signature": "def cost(self, x)" } ]
2
stack_v2_sparse_classes_30k_train_013462
Implement the Python class `DeJong5` described below. Class description: De Jong No. 5 Function. Method signatures and docstrings: - def __init__(self): Constructor. - def cost(self, x): Cost function.
Implement the Python class `DeJong5` described below. Class description: De Jong No. 5 Function. Method signatures and docstrings: - def __init__(self): Constructor. - def cost(self, x): Cost function. <|skeleton|> class DeJong5: """De Jong No. 5 Function.""" def __init__(self): """Constructor.""" ...
f2a74df3ab01ac35ea8d80569da909ffa1e86af3
<|skeleton|> class DeJong5: """De Jong No. 5 Function.""" def __init__(self): """Constructor.""" <|body_0|> def cost(self, x): """Cost function.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DeJong5: """De Jong No. 5 Function.""" def __init__(self): """Constructor.""" self.a = np.array(list(product(range(-32, 33, 16), range(-32, 33, 16)))) self.min = np.array([0.0, 0.0]) self.value = 0.0 self.domain = np.array([[-65.536, 65.536], [-65.536, 65.536]]) ...
the_stack_v2_python_sparse
ctf/functions2d/de_jong_5.py
cntaylor/ctf
train
1
77083dd974c78be3daf2458088c7adc21127226c
[ "scaled = self.sun * scale + self.bbn * (1 - scale)\nif scale > 1.0:\n jj, = np.argwhere(scaled.iso == isotope.ion('He4'))\n bbn = self.sun * 0 + self.bbn\n for j in np.argwhere(scaled.abu < self.sun.abu).flat:\n scaled.abu[jj] += scaled.abu[j]\n scaled.abu[j] = self.sun.abu[j] * np.exp((scal...
<|body_start_0|> scaled = self.sun * scale + self.bbn * (1 - scale) if scale > 1.0: jj, = np.argwhere(scaled.iso == isotope.ion('He4')) bbn = self.sun * 0 + self.bbn for j in np.argwhere(scaled.abu < self.sun.abu).flat: scaled.abu[jj] += scaled.abu[j] ...
Special abundance set created from scaled solar abundance set.
ScaledSolar
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ScaledSolar: """Special abundance set created from scaled solar abundance set.""" def _abu_massfrac_raw(self, scale): """Raw scaled solar abundances""" <|body_0|> def __init__(self, scale=1, Z=None, **kw): """Create abundance from set name. Use simple algorithm: ...
stack_v2_sparse_classes_75kplus_train_072083
14,741
permissive
[ { "docstring": "Raw scaled solar abundances", "name": "_abu_massfrac_raw", "signature": "def _abu_massfrac_raw(self, scale)" }, { "docstring": "Create abundance from set name. Use simple algorithm: X = X_sun * scale + X_BBN * (1 - scale) If Z is provided, overwrite scale by Z/Zsun. For stuff tha...
2
stack_v2_sparse_classes_30k_train_016899
Implement the Python class `ScaledSolar` described below. Class description: Special abundance set created from scaled solar abundance set. Method signatures and docstrings: - def _abu_massfrac_raw(self, scale): Raw scaled solar abundances - def __init__(self, scale=1, Z=None, **kw): Create abundance from set name. U...
Implement the Python class `ScaledSolar` described below. Class description: Special abundance set created from scaled solar abundance set. Method signatures and docstrings: - def _abu_massfrac_raw(self, scale): Raw scaled solar abundances - def __init__(self, scale=1, Z=None, **kw): Create abundance from set name. U...
98fc181bab054619d12ffa4173ad5c469803c2ec
<|skeleton|> class ScaledSolar: """Special abundance set created from scaled solar abundance set.""" def _abu_massfrac_raw(self, scale): """Raw scaled solar abundances""" <|body_0|> def __init__(self, scale=1, Z=None, **kw): """Create abundance from set name. Use simple algorithm: ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ScaledSolar: """Special abundance set created from scaled solar abundance set.""" def _abu_massfrac_raw(self, scale): """Raw scaled solar abundances""" scaled = self.sun * scale + self.bbn * (1 - scale) if scale > 1.0: jj, = np.argwhere(scaled.iso == isotope.ion('He4')...
the_stack_v2_python_sparse
kepler_python_packages/python_scripts/abusets.py
adam-m-jcbs/xrb-sens-datashare
train
1
fdd8aab538aa0ece5ef5adcf2b84f8669dbc69b8
[ "self.num_points = num_points\n'Generate list of data starting from 0'\nself.x_axis = [0]\nself.y_axis = [0]", "\"\"\"Keep the loop until we have 5000 walking points\"\"\"\nwhile len(self.x_axis) <= self.num_points:\n x_side = choice([1, -1])\n x_range = choice([0, 1, 2, 3, 4])\n x_step = x_side * x_rang...
<|body_start_0|> self.num_points = num_points 'Generate list of data starting from 0' self.x_axis = [0] self.y_axis = [0] <|end_body_0|> <|body_start_1|> """Keep the loop until we have 5000 walking points""" while len(self.x_axis) <= self.num_points: x_side =...
A class to generate random walk
RandomWalk
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RandomWalk: """A class to generate random walk""" def __init__(self, num_points=5000): """Initiate some of the variables""" <|body_0|> def fill_walk(self): """Calculate all the points in the walk""" <|body_1|> <|end_skeleton|> <|body_start_0|> s...
stack_v2_sparse_classes_75kplus_train_072084
1,500
no_license
[ { "docstring": "Initiate some of the variables", "name": "__init__", "signature": "def __init__(self, num_points=5000)" }, { "docstring": "Calculate all the points in the walk", "name": "fill_walk", "signature": "def fill_walk(self)" } ]
2
stack_v2_sparse_classes_30k_train_040906
Implement the Python class `RandomWalk` described below. Class description: A class to generate random walk Method signatures and docstrings: - def __init__(self, num_points=5000): Initiate some of the variables - def fill_walk(self): Calculate all the points in the walk
Implement the Python class `RandomWalk` described below. Class description: A class to generate random walk Method signatures and docstrings: - def __init__(self, num_points=5000): Initiate some of the variables - def fill_walk(self): Calculate all the points in the walk <|skeleton|> class RandomWalk: """A class...
0714c7f50e842e6fb0095695dde5f68cefe87ede
<|skeleton|> class RandomWalk: """A class to generate random walk""" def __init__(self, num_points=5000): """Initiate some of the variables""" <|body_0|> def fill_walk(self): """Calculate all the points in the walk""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class RandomWalk: """A class to generate random walk""" def __init__(self, num_points=5000): """Initiate some of the variables""" self.num_points = num_points 'Generate list of data starting from 0' self.x_axis = [0] self.y_axis = [0] def fill_walk(self): ""...
the_stack_v2_python_sparse
Script1/randomWalk.py
DrakeChow3/Stupid-stuff
train
0
21c703ebdc5d1bfac40c91a1982bcf23150bb7fb
[ "assert isinstance(code, str), 'Invalid code %s' % code\nassert isinstance(isSuccess, bool), 'Invalid success flag %s' % isSuccess\nself.code = code\nself.isSuccess = isSuccess", "assert isinstance(context, Coded), 'Invalid context %s' % context\ncontext.code = self.code\ncontext.isSuccess = self.isSuccess" ]
<|body_start_0|> assert isinstance(code, str), 'Invalid code %s' % code assert isinstance(isSuccess, bool), 'Invalid success flag %s' % isSuccess self.code = code self.isSuccess = isSuccess <|end_body_0|> <|body_start_1|> assert isinstance(context, Coded), 'Invalid context %s' %...
Contains the response code.
Code
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Code: """Contains the response code.""" def __init__(self, code, isSuccess): """Constructs the code. @param code: string The code text corresponding to this code. @param isSuccess: boolean Flag indicating if the code is a fail or success code.""" <|body_0|> def set(self,...
stack_v2_sparse_classes_75kplus_train_072085
2,468
no_license
[ { "docstring": "Constructs the code. @param code: string The code text corresponding to this code. @param isSuccess: boolean Flag indicating if the code is a fail or success code.", "name": "__init__", "signature": "def __init__(self, code, isSuccess)" }, { "docstring": "Set the code on the prov...
2
stack_v2_sparse_classes_30k_train_045134
Implement the Python class `Code` described below. Class description: Contains the response code. Method signatures and docstrings: - def __init__(self, code, isSuccess): Constructs the code. @param code: string The code text corresponding to this code. @param isSuccess: boolean Flag indicating if the code is a fail ...
Implement the Python class `Code` described below. Class description: Contains the response code. Method signatures and docstrings: - def __init__(self, code, isSuccess): Constructs the code. @param code: string The code text corresponding to this code. @param isSuccess: boolean Flag indicating if the code is a fail ...
e0b3466b34d31548996d57be4a9dac134d904380
<|skeleton|> class Code: """Contains the response code.""" def __init__(self, code, isSuccess): """Constructs the code. @param code: string The code text corresponding to this code. @param isSuccess: boolean Flag indicating if the code is a fail or success code.""" <|body_0|> def set(self,...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Code: """Contains the response code.""" def __init__(self, code, isSuccess): """Constructs the code. @param code: string The code text corresponding to this code. @param isSuccess: boolean Flag indicating if the code is a fail or success code.""" assert isinstance(code, str), 'Invalid cod...
the_stack_v2_python_sparse
components/ally-core/ally/core/spec/codes.py
cristidomsa/Ally-Py
train
0
1fda2c26cdc871a51ae395fe9811437846a40b28
[ "skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.craft_plugins.speed.html', self)\nself.fileNameInput = settings.FileNameInput().getFromFileName(fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Speed', self, '')\nself.openWikiManualHelpPage = set...
<|body_start_0|> skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.craft_plugins.speed.html', self) self.fileNameInput = settings.FileNameInput().getFromFileName(fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Speed', self, '') ...
A class to handle the speed settings.
SpeedRepository
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SpeedRepository: """A class to handle the speed settings.""" def __init__(self): """Set the default settings, execute title & settings fileName.""" <|body_0|> def execute(self): """Speed button has been clicked.""" <|body_1|> <|end_skeleton|> <|body_sta...
stack_v2_sparse_classes_75kplus_train_072086
13,492
no_license
[ { "docstring": "Set the default settings, execute title & settings fileName.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Speed button has been clicked.", "name": "execute", "signature": "def execute(self)" } ]
2
stack_v2_sparse_classes_30k_train_029657
Implement the Python class `SpeedRepository` described below. Class description: A class to handle the speed settings. Method signatures and docstrings: - def __init__(self): Set the default settings, execute title & settings fileName. - def execute(self): Speed button has been clicked.
Implement the Python class `SpeedRepository` described below. Class description: A class to handle the speed settings. Method signatures and docstrings: - def __init__(self): Set the default settings, execute title & settings fileName. - def execute(self): Speed button has been clicked. <|skeleton|> class SpeedRepos...
c1b00a76f1550df2cbb457248205159e51fd4308
<|skeleton|> class SpeedRepository: """A class to handle the speed settings.""" def __init__(self): """Set the default settings, execute title & settings fileName.""" <|body_0|> def execute(self): """Speed button has been clicked.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SpeedRepository: """A class to handle the speed settings.""" def __init__(self): """Set the default settings, execute title & settings fileName.""" skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.craft_plugins.speed.html', self) self.fil...
the_stack_v2_python_sparse
skeinforge_application/skeinforge_plugins/craft_plugins/speed.py
amsler/skeinforge
train
10
87400f0b889db400d6b567e4d6a87240b59e270d
[ "if not isinstance(stage, (encoding_stage.EncodingStageInterface, encoding_stage.AdaptiveEncodingStageInterface)):\n raise TypeError('The input argument is %s but must be an instance of EncodingStageInterface or of AdaptiveEncodingStageInterface' % type(stage))\nself._stage = stage\nself._children = {}\nsuper(En...
<|body_start_0|> if not isinstance(stage, (encoding_stage.EncodingStageInterface, encoding_stage.AdaptiveEncodingStageInterface)): raise TypeError('The input argument is %s but must be an instance of EncodingStageInterface or of AdaptiveEncodingStageInterface' % type(stage)) self._stage = st...
Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be used for encoding. The `make` method converts this object to an `Encoder`, which e...
EncoderComposer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EncoderComposer: """Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be used for encoding. The `make` method co...
stack_v2_sparse_classes_75kplus_train_072087
26,759
permissive
[ { "docstring": "Constructor for the `EncoderComposer`. Args: stage: An `EncodingStageInterface` or an `AdaptiveEncodingStageInterface`.", "name": "__init__", "signature": "def __init__(self, stage)" }, { "docstring": "Adds a child node. Args: stage: An `EncodingStageInterface` or an `AdaptiveEnc...
4
stack_v2_sparse_classes_30k_train_032613
Implement the Python class `EncoderComposer` described below. Class description: Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be ...
Implement the Python class `EncoderComposer` described below. Class description: Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be ...
4733c85f21d1eb570fd575ea201cb211a485bfb0
<|skeleton|> class EncoderComposer: """Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be used for encoding. The `make` method co...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class EncoderComposer: """Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be used for encoding. The `make` method converts this o...
the_stack_v2_python_sparse
tensorflow_model_optimization/python/core/internal/tensor_encoding/core/core_encoder.py
tensorflow/model-optimization
train
1,550
ac5cddcdd3ecb4888504c235c14fadcd0a79de9a
[ "ret = await self.db.grids.find(projection={'_id': False}).to_list(1000)\nself.write({row['grid_id']: row for row in ret})\nself.finish()", "data = json.loads(self.request.body)\nreq_fields = {'host': str, 'queues': dict, 'version': str}\nfor k in req_fields:\n if k not in data:\n raise tornado.web.HTTP...
<|body_start_0|> ret = await self.db.grids.find(projection={'_id': False}).to_list(1000) self.write({row['grid_id']: row for row in ret}) self.finish() <|end_body_0|> <|body_start_1|> data = json.loads(self.request.body) req_fields = {'host': str, 'queues': dict, 'version': str}...
Handle multi grids requests.
MultiGridsHandler
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiGridsHandler: """Handle multi grids requests.""" async def get(self): """Get grid entries. Returns: dict: {'uuid': {grid_data}}""" <|body_0|> async def post(self): """Create a grid entry. Body should contain the grid data. Returns: dict: {'result': <grid_id>...
stack_v2_sparse_classes_75kplus_train_072088
3,804
permissive
[ { "docstring": "Get grid entries. Returns: dict: {'uuid': {grid_data}}", "name": "get", "signature": "async def get(self)" }, { "docstring": "Create a grid entry. Body should contain the grid data. Returns: dict: {'result': <grid_id>}", "name": "post", "signature": "async def post(self)"...
2
stack_v2_sparse_classes_30k_train_000540
Implement the Python class `MultiGridsHandler` described below. Class description: Handle multi grids requests. Method signatures and docstrings: - async def get(self): Get grid entries. Returns: dict: {'uuid': {grid_data}} - async def post(self): Create a grid entry. Body should contain the grid data. Returns: dict:...
Implement the Python class `MultiGridsHandler` described below. Class description: Handle multi grids requests. Method signatures and docstrings: - async def get(self): Get grid entries. Returns: dict: {'uuid': {grid_data}} - async def post(self): Create a grid entry. Body should contain the grid data. Returns: dict:...
b66c35bb1072f835bc84ea01fce169989323c4b9
<|skeleton|> class MultiGridsHandler: """Handle multi grids requests.""" async def get(self): """Get grid entries. Returns: dict: {'uuid': {grid_data}}""" <|body_0|> async def post(self): """Create a grid entry. Body should contain the grid data. Returns: dict: {'result': <grid_id>...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MultiGridsHandler: """Handle multi grids requests.""" async def get(self): """Get grid entries. Returns: dict: {'uuid': {grid_data}}""" ret = await self.db.grids.find(projection={'_id': False}).to_list(1000) self.write({row['grid_id']: row for row in ret}) self.finish() ...
the_stack_v2_python_sparse
iceprod/rest/handlers/grids.py
WIPACrepo/iceprod
train
5
d588aa76e6abacd044c38036a98d0974d9634855
[ "def dfs(target):\n if target == 0:\n self.ans += 1\n for i in range(len(nums)):\n if nums[i] <= target:\n dfs(target - nums[i])\nnums.sort()\nself.ans = 0\ndfs(target)\nreturn self.ans", "nums.sort()\ndp = [1]\ni = 1\nwhile i <= target:\n count = 0\n for n in nums:\n i...
<|body_start_0|> def dfs(target): if target == 0: self.ans += 1 for i in range(len(nums)): if nums[i] <= target: dfs(target - nums[i]) nums.sort() self.ans = 0 dfs(target) return self.ans <|end_body_0|> ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def combinationSum4dfs(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def combinationSum4(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_75kplus_train_072089
962
no_license
[ { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "combinationSum4dfs", "signature": "def combinationSum4dfs(self, nums, target)" }, { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "combinationSum4", "signature": "def combinationS...
2
stack_v2_sparse_classes_30k_train_002348
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def combinationSum4dfs(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def combinationSum4(self, nums, target): :type nums: List[int] :type target: int...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def combinationSum4dfs(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def combinationSum4(self, nums, target): :type nums: List[int] :type target: int...
ab49373ff3fc306a03a90de02e1801b8cbe520d7
<|skeleton|> class Solution: def combinationSum4dfs(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def combinationSum4(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def combinationSum4dfs(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" def dfs(target): if target == 0: self.ans += 1 for i in range(len(nums)): if nums[i] <= target: dfs(target...
the_stack_v2_python_sparse
finished/377.py
yiguid/LeetCodePractise
train
0
3b93fb4262fe57699deb6a87e13b7f7b0e6e3069
[ "if not email:\n raise ValueError('Users must have an email address')\nuser = self.model(email=self.normalize_email(email), first_name=first_name, last_name=last_name, company=company, title=title, personal_phone=personal_phone, office_phone=office_phone, fax=fax, role=role)\nuser.set_password(password)\nuser.sa...
<|body_start_0|> if not email: raise ValueError('Users must have an email address') user = self.model(email=self.normalize_email(email), first_name=first_name, last_name=last_name, company=company, title=title, personal_phone=personal_phone, office_phone=office_phone, fax=fax, role=role) ...
ContactManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ContactManager: def create_user(self, email, first_name, last_name, password, company, title=None, personal_phone=None, office_phone=None, fax=None, role=None): """Creates and saves a User with the given email, date of birth and password.""" <|body_0|> def create_superuser(s...
stack_v2_sparse_classes_75kplus_train_072090
6,388
no_license
[ { "docstring": "Creates and saves a User with the given email, date of birth and password.", "name": "create_user", "signature": "def create_user(self, email, first_name, last_name, password, company, title=None, personal_phone=None, office_phone=None, fax=None, role=None)" }, { "docstring": "Cr...
2
stack_v2_sparse_classes_30k_train_024979
Implement the Python class `ContactManager` described below. Class description: Implement the ContactManager class. Method signatures and docstrings: - def create_user(self, email, first_name, last_name, password, company, title=None, personal_phone=None, office_phone=None, fax=None, role=None): Creates and saves a U...
Implement the Python class `ContactManager` described below. Class description: Implement the ContactManager class. Method signatures and docstrings: - def create_user(self, email, first_name, last_name, password, company, title=None, personal_phone=None, office_phone=None, fax=None, role=None): Creates and saves a U...
17a341332f6908c75ce060f55a145a76c9db48f7
<|skeleton|> class ContactManager: def create_user(self, email, first_name, last_name, password, company, title=None, personal_phone=None, office_phone=None, fax=None, role=None): """Creates and saves a User with the given email, date of birth and password.""" <|body_0|> def create_superuser(s...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ContactManager: def create_user(self, email, first_name, last_name, password, company, title=None, personal_phone=None, office_phone=None, fax=None, role=None): """Creates and saves a User with the given email, date of birth and password.""" if not email: raise ValueError('Users mu...
the_stack_v2_python_sparse
supportportal/apps/contacts/models.py
bensnyde/django-csa
train
0
6505308f864b11153b0161cdbe3b2c0d9474e889
[ "self.neuron = neuron\nself.input_dim = input_dim\nself.activation_func = activation\nself.weight = np.random.uniform(-0.5, 0.5, (self.input_dim, self.neuron))\nself.bias = np.random.uniform(-0.5, 0.5, self.neuron)\nif initialize_WeightBias:\n self.init_WeightBias()", "scale_factor = 0.7 * self.neuron ** (1 / ...
<|body_start_0|> self.neuron = neuron self.input_dim = input_dim self.activation_func = activation self.weight = np.random.uniform(-0.5, 0.5, (self.input_dim, self.neuron)) self.bias = np.random.uniform(-0.5, 0.5, self.neuron) if initialize_WeightBias: self.in...
Layer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Layer: def __init__(self, neuron, input_dim=None, activation='binary sigmoid', initialize_WeightBias=False): """Inisialisasi class (constructor) Arguments: neuron {int} -- jumlah neuron pada layer sekarang Keyword Arguments: input_dim {int} -- jumlah neuron pada layer sebelumnya (default...
stack_v2_sparse_classes_75kplus_train_072091
36,491
no_license
[ { "docstring": "Inisialisasi class (constructor) Arguments: neuron {int} -- jumlah neuron pada layer sekarang Keyword Arguments: input_dim {int} -- jumlah neuron pada layer sebelumnya (default: {None}) activation {str} -- fungsi aktivasi yang akan digunakan (default: {'binary sigmoid'}) initialize_WeightBias {b...
2
null
Implement the Python class `Layer` described below. Class description: Implement the Layer class. Method signatures and docstrings: - def __init__(self, neuron, input_dim=None, activation='binary sigmoid', initialize_WeightBias=False): Inisialisasi class (constructor) Arguments: neuron {int} -- jumlah neuron pada lay...
Implement the Python class `Layer` described below. Class description: Implement the Layer class. Method signatures and docstrings: - def __init__(self, neuron, input_dim=None, activation='binary sigmoid', initialize_WeightBias=False): Inisialisasi class (constructor) Arguments: neuron {int} -- jumlah neuron pada lay...
25188166962b02487c19c2aff5d17e06a9a8909a
<|skeleton|> class Layer: def __init__(self, neuron, input_dim=None, activation='binary sigmoid', initialize_WeightBias=False): """Inisialisasi class (constructor) Arguments: neuron {int} -- jumlah neuron pada layer sekarang Keyword Arguments: input_dim {int} -- jumlah neuron pada layer sebelumnya (default...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Layer: def __init__(self, neuron, input_dim=None, activation='binary sigmoid', initialize_WeightBias=False): """Inisialisasi class (constructor) Arguments: neuron {int} -- jumlah neuron pada layer sekarang Keyword Arguments: input_dim {int} -- jumlah neuron pada layer sebelumnya (default: {None}) acti...
the_stack_v2_python_sparse
Deep Learning/WildanNN.py
abuwildanm/Python-Machine-Learning
train
0
76f32816b81a2645b48c5f143d13198f86ec11e7
[ "if isinstance(value, (str, unicode)):\n try:\n value = int(value)\n except (ValueError, TypeError) as err:\n if value.lower() == 'true':\n value = True\n elif value.lower() == 'false':\n value = False\nif value:\n return 1\nelse:\n return 0", "if value in (0...
<|body_start_0|> if isinstance(value, (str, unicode)): try: value = int(value) except (ValueError, TypeError) as err: if value.lower() == 'true': value = True elif value.lower() == 'false': value = Fa...
SFBool field/event type base-class
_SFBool
[ "GPL-1.0-or-later", "MIT", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-other-copyleft", "LGPL-2.1-or-later", "GPL-3.0-only", "LGPL-2.0-or-later", "GPL-3.0-or-later" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _SFBool: """SFBool field/event type base-class""" def coerce(self, value): """Coerce the given value to our type Allowable types: any object with true/false protocol""" <|body_0|> def check(self, value): """Check that the given value is of exactly expected type""...
stack_v2_sparse_classes_75kplus_train_072092
34,853
permissive
[ { "docstring": "Coerce the given value to our type Allowable types: any object with true/false protocol", "name": "coerce", "signature": "def coerce(self, value)" }, { "docstring": "Check that the given value is of exactly expected type", "name": "check", "signature": "def check(self, va...
3
stack_v2_sparse_classes_30k_train_042233
Implement the Python class `_SFBool` described below. Class description: SFBool field/event type base-class Method signatures and docstrings: - def coerce(self, value): Coerce the given value to our type Allowable types: any object with true/false protocol - def check(self, value): Check that the given value is of ex...
Implement the Python class `_SFBool` described below. Class description: SFBool field/event type base-class Method signatures and docstrings: - def coerce(self, value): Coerce the given value to our type Allowable types: any object with true/false protocol - def check(self, value): Check that the given value is of ex...
7f600ad153270feff12aa7aa86d7ed0a49ebc71c
<|skeleton|> class _SFBool: """SFBool field/event type base-class""" def coerce(self, value): """Coerce the given value to our type Allowable types: any object with true/false protocol""" <|body_0|> def check(self, value): """Check that the given value is of exactly expected type""...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class _SFBool: """SFBool field/event type base-class""" def coerce(self, value): """Coerce the given value to our type Allowable types: any object with true/false protocol""" if isinstance(value, (str, unicode)): try: value = int(value) except (ValueError...
the_stack_v2_python_sparse
pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/vrml/fieldtypes.py
alexus37/AugmentedRealityChess
train
1
d5d8539e20ea5a921e65fe99128ebd74e9361a11
[ "self.Whf = np.random.normal(size=(i + h, h))\nself.Whb = np.random.normal(size=(i + h, h))\nself.Wy = np.random.normal(size=(2 * h, o))\nself.bhf = np.zeros((1, h))\nself.bhb = np.zeros((1, h))\nself.by = np.zeros((1, o))", "x_concat = np.concatenate((h_prev, x_t), axis=1)\nh_next = np.matmul(x_concat, self.Whf)...
<|body_start_0|> self.Whf = np.random.normal(size=(i + h, h)) self.Whb = np.random.normal(size=(i + h, h)) self.Wy = np.random.normal(size=(2 * h, o)) self.bhf = np.zeros((1, h)) self.bhb = np.zeros((1, h)) self.by = np.zeros((1, o)) <|end_body_0|> <|body_start_1|> ...
Represents a bidirectional cell of an RNN
BidirectionalCell
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BidirectionalCell: """Represents a bidirectional cell of an RNN""" def __init__(self, i, h, o): """:param i: the dimensionality of the data :param h: the dimensionality of the hidden state :param o: the dimensionality of the outputs""" <|body_0|> def forward(self, h_prev...
stack_v2_sparse_classes_75kplus_train_072093
1,867
no_license
[ { "docstring": ":param i: the dimensionality of the data :param h: the dimensionality of the hidden state :param o: the dimensionality of the outputs", "name": "__init__", "signature": "def __init__(self, i, h, o)" }, { "docstring": "Performs forward propagation for one time step :return: h_next...
4
stack_v2_sparse_classes_30k_train_001845
Implement the Python class `BidirectionalCell` described below. Class description: Represents a bidirectional cell of an RNN Method signatures and docstrings: - def __init__(self, i, h, o): :param i: the dimensionality of the data :param h: the dimensionality of the hidden state :param o: the dimensionality of the ou...
Implement the Python class `BidirectionalCell` described below. Class description: Represents a bidirectional cell of an RNN Method signatures and docstrings: - def __init__(self, i, h, o): :param i: the dimensionality of the data :param h: the dimensionality of the hidden state :param o: the dimensionality of the ou...
a51fbcb76dae9281ff34ace0fb762ef899b4c380
<|skeleton|> class BidirectionalCell: """Represents a bidirectional cell of an RNN""" def __init__(self, i, h, o): """:param i: the dimensionality of the data :param h: the dimensionality of the hidden state :param o: the dimensionality of the outputs""" <|body_0|> def forward(self, h_prev...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BidirectionalCell: """Represents a bidirectional cell of an RNN""" def __init__(self, i, h, o): """:param i: the dimensionality of the data :param h: the dimensionality of the hidden state :param o: the dimensionality of the outputs""" self.Whf = np.random.normal(size=(i + h, h)) ...
the_stack_v2_python_sparse
supervised_learning/0x0D-RNNs/7-bi_output.py
Diegokernel/holbertonschool-machine_learning
train
0
4cffeb0d276b0d2a7af1024b43a3109c2962d901
[ "json_state = json.loads(state_string)\nself.tick = json_state['tick']\nself.is_finished = json_state['isFinished']\nself.bombs = [Bomb(bomb_json) for bomb_json in json_state['bombs'].values()]\nself.bonuses = [Bonus(bonus_json) for bonus_json in json_state['bonuses'].values()]\nself.bounds = Bounds(json_state['wid...
<|body_start_0|> json_state = json.loads(state_string) self.tick = json_state['tick'] self.is_finished = json_state['isFinished'] self.bombs = [Bomb(bomb_json) for bomb_json in json_state['bombs'].values()] self.bonuses = [Bonus(bonus_json) for bonus_json in json_state['bonuses']...
The complete game representation. Game Attributes: tiles: Represents the map in a numpy array. You can access any Tile with state.tiles[x, y] tick: The current game tick is_finished: whether or not the game is finished players: A list with all players in the game bombs: A list with all bombs in the game bonuses: A list...
State
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class State: """The complete game representation. Game Attributes: tiles: Represents the map in a numpy array. You can access any Tile with state.tiles[x, y] tick: The current game tick is_finished: whether or not the game is finished players: A list with all players in the game bombs: A list with all ...
stack_v2_sparse_classes_75kplus_train_072094
2,465
permissive
[ { "docstring": ":param state_string: A json string representing the state :param current_player_id: The id of the current player", "name": "__init__", "signature": "def __init__(self, state_string, current_player_id)" }, { "docstring": "A numpy array is not JSON serializable so we force it to a ...
2
stack_v2_sparse_classes_30k_train_048903
Implement the Python class `State` described below. Class description: The complete game representation. Game Attributes: tiles: Represents the map in a numpy array. You can access any Tile with state.tiles[x, y] tick: The current game tick is_finished: whether or not the game is finished players: A list with all play...
Implement the Python class `State` described below. Class description: The complete game representation. Game Attributes: tiles: Represents the map in a numpy array. You can access any Tile with state.tiles[x, y] tick: The current game tick is_finished: whether or not the game is finished players: A list with all play...
2d7bc38575031e1d5595d9a7070655115db9899b
<|skeleton|> class State: """The complete game representation. Game Attributes: tiles: Represents the map in a numpy array. You can access any Tile with state.tiles[x, y] tick: The current game tick is_finished: whether or not the game is finished players: A list with all players in the game bombs: A list with all ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class State: """The complete game representation. Game Attributes: tiles: Represents the map in a numpy array. You can access any Tile with state.tiles[x, y] tick: The current game tick is_finished: whether or not the game is finished players: A list with all players in the game bombs: A list with all bombs in the ...
the_stack_v2_python_sparse
bot/models/state.py
Guillaume-Docquier/bomberjam-bot
train
0
d93a172e4dee56bff84c7ea048bcc6e8b75a42fb
[ "self.assertEquals(0, puzzle8.count_chars('\"\"'))\nself.assertEquals(3, puzzle8.count_chars('\"abc\"'))\nself.assertEquals(7, puzzle8.count_chars('aaa\\\\\"aaa'))\nself.assertEquals(1, puzzle8.count_chars('\\\\x27'))", "self.assertEquals('\"\\\\\"\\\\\"\"', puzzle8.encode('\"\"'))\nself.assertEquals('\"\\\\\"abc...
<|body_start_0|> self.assertEquals(0, puzzle8.count_chars('""')) self.assertEquals(3, puzzle8.count_chars('"abc"')) self.assertEquals(7, puzzle8.count_chars('aaa\\"aaa')) self.assertEquals(1, puzzle8.count_chars('\\x27')) <|end_body_0|> <|body_start_1|> self.assertEquals('"\\"\\...
Tests for puzzle 8.
TestPuzzle8
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestPuzzle8: """Tests for puzzle 8.""" def test_count_chars(self): """Tests for puzzle 8, part 1.""" <|body_0|> def test_encode_chars(self): """Tests for puzzle 8, part 2.""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.assertEquals(0, puzz...
stack_v2_sparse_classes_75kplus_train_072095
848
no_license
[ { "docstring": "Tests for puzzle 8, part 1.", "name": "test_count_chars", "signature": "def test_count_chars(self)" }, { "docstring": "Tests for puzzle 8, part 2.", "name": "test_encode_chars", "signature": "def test_encode_chars(self)" } ]
2
stack_v2_sparse_classes_30k_train_026137
Implement the Python class `TestPuzzle8` described below. Class description: Tests for puzzle 8. Method signatures and docstrings: - def test_count_chars(self): Tests for puzzle 8, part 1. - def test_encode_chars(self): Tests for puzzle 8, part 2.
Implement the Python class `TestPuzzle8` described below. Class description: Tests for puzzle 8. Method signatures and docstrings: - def test_count_chars(self): Tests for puzzle 8, part 1. - def test_encode_chars(self): Tests for puzzle 8, part 2. <|skeleton|> class TestPuzzle8: """Tests for puzzle 8.""" de...
99d1f68ddf92b989ff775c270d315eb8df4dbd55
<|skeleton|> class TestPuzzle8: """Tests for puzzle 8.""" def test_count_chars(self): """Tests for puzzle 8, part 1.""" <|body_0|> def test_encode_chars(self): """Tests for puzzle 8, part 2.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestPuzzle8: """Tests for puzzle 8.""" def test_count_chars(self): """Tests for puzzle 8, part 1.""" self.assertEquals(0, puzzle8.count_chars('""')) self.assertEquals(3, puzzle8.count_chars('"abc"')) self.assertEquals(7, puzzle8.count_chars('aaa\\"aaa')) self.asser...
the_stack_v2_python_sparse
puzzle8/python/test_puzzle8.py
jramaswami/Advent-Of-Code-2015
train
0
5c6daeb6480f2a5390889fe3728589b75eccd8d9
[ "if self._user_selection is None:\n return None\nreturn self.option(self._user_selection)", "if attribute == 'options' and isinstance(value, list):\n value = [PollOption(self._reddit, option) for option in value]\nelif attribute == 'user_selection':\n attribute = '_user_selection'\nsuper().__setattr__(at...
<|body_start_0|> if self._user_selection is None: return None return self.option(self._user_selection) <|end_body_0|> <|body_start_1|> if attribute == 'options' and isinstance(value, list): value = [PollOption(self._reddit, option) for option in value] elif attri...
Class to represent poll data on a poll submission. If ``submission`` is a poll :class:`.Submission`, access the poll data like so: .. code-block:: python poll_data = submission.poll_data print(f"There are {poll_data.total_vote_count} votes total.") print("The options are:") for option in poll_data.options: print(f"{opt...
PollData
[ "GPL-3.0-only", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PollData: """Class to represent poll data on a poll submission. If ``submission`` is a poll :class:`.Submission`, access the poll data like so: .. code-block:: python poll_data = submission.poll_data print(f"There are {poll_data.total_vote_count} votes total.") print("The options are:") for optio...
stack_v2_sparse_classes_75kplus_train_072096
3,874
permissive
[ { "docstring": "Get the user's selection in this poll, if any. :returns: The user's selection as a :class:`.PollOption`, or ``None`` if there is no choice.", "name": "user_selection", "signature": "def user_selection(self) -> PollOption | None" }, { "docstring": "Objectify the options attribute,...
3
null
Implement the Python class `PollData` described below. Class description: Class to represent poll data on a poll submission. If ``submission`` is a poll :class:`.Submission`, access the poll data like so: .. code-block:: python poll_data = submission.poll_data print(f"There are {poll_data.total_vote_count} votes total...
Implement the Python class `PollData` described below. Class description: Class to represent poll data on a poll submission. If ``submission`` is a poll :class:`.Submission`, access the poll data like so: .. code-block:: python poll_data = submission.poll_data print(f"There are {poll_data.total_vote_count} votes total...
f1d5506b7a3df240f748e1b7749fd5636aa67b32
<|skeleton|> class PollData: """Class to represent poll data on a poll submission. If ``submission`` is a poll :class:`.Submission`, access the poll data like so: .. code-block:: python poll_data = submission.poll_data print(f"There are {poll_data.total_vote_count} votes total.") print("The options are:") for optio...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PollData: """Class to represent poll data on a poll submission. If ``submission`` is a poll :class:`.Submission`, access the poll data like so: .. code-block:: python poll_data = submission.poll_data print(f"There are {poll_data.total_vote_count} votes total.") print("The options are:") for option in poll_dat...
the_stack_v2_python_sparse
praw/models/reddit/poll.py
praw-dev/praw
train
2,825
8c9f904e160cccc19ef719a4ee421f0c1221e6f8
[ "if self.runner.output is not None:\n self.runner.output.Set(self.runner.output.Schema.DESCRIPTION('GetProcessesBinariesRekall binaries (regex: %s) ' % self.args.filename_regex or 'None'))\nself.CallFlow('ArtifactCollectorFlow', artifact_list=['FullVADBinaryList'], store_results_in_aff4=False, next_state='FetchB...
<|body_start_0|> if self.runner.output is not None: self.runner.output.Set(self.runner.output.Schema.DESCRIPTION('GetProcessesBinariesRekall binaries (regex: %s) ' % self.args.filename_regex or 'None')) self.CallFlow('ArtifactCollectorFlow', artifact_list=['FullVADBinaryList'], store_results...
Get list of all running binaries from Rekall, (optionally) fetch them. This flow executes the "vad" Rekall plugin to get the list of all currently running binaries (including dynamic libraries). Then if fetch_binaries option is set to True, it fetches all the binaries it has found. There is a caveat regarding using the...
ListVADBinaries
[ "Apache-2.0", "DOC" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ListVADBinaries: """Get list of all running binaries from Rekall, (optionally) fetch them. This flow executes the "vad" Rekall plugin to get the list of all currently running binaries (including dynamic libraries). Then if fetch_binaries option is set to True, it fetches all the binaries it has f...
stack_v2_sparse_classes_75kplus_train_072097
34,719
permissive
[ { "docstring": "Request VAD data.", "name": "Start", "signature": "def Start(self)" }, { "docstring": "Parses the Rekall response and initiates FileFinder flows.", "name": "FetchBinaries", "signature": "def FetchBinaries(self, responses)" }, { "docstring": "Handle success/failure...
3
stack_v2_sparse_classes_30k_train_004944
Implement the Python class `ListVADBinaries` described below. Class description: Get list of all running binaries from Rekall, (optionally) fetch them. This flow executes the "vad" Rekall plugin to get the list of all currently running binaries (including dynamic libraries). Then if fetch_binaries option is set to Tru...
Implement the Python class `ListVADBinaries` described below. Class description: Get list of all running binaries from Rekall, (optionally) fetch them. This flow executes the "vad" Rekall plugin to get the list of all currently running binaries (including dynamic libraries). Then if fetch_binaries option is set to Tru...
ba1648b97a76f844ffb8e1891cc9e2680f9b1c6e
<|skeleton|> class ListVADBinaries: """Get list of all running binaries from Rekall, (optionally) fetch them. This flow executes the "vad" Rekall plugin to get the list of all currently running binaries (including dynamic libraries). Then if fetch_binaries option is set to True, it fetches all the binaries it has f...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ListVADBinaries: """Get list of all running binaries from Rekall, (optionally) fetch them. This flow executes the "vad" Rekall plugin to get the list of all currently running binaries (including dynamic libraries). Then if fetch_binaries option is set to True, it fetches all the binaries it has found. There i...
the_stack_v2_python_sparse
lib/flows/general/memory.py
defaultnamehere/grr
train
3
8d2b110d45f9d8433a79947811574d3b02871e41
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')" ]
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
Missing associated documentation comment in .proto file.
TextRecognitionAsyncServiceServicer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TextRecognitionAsyncServiceServicer: """Missing associated documentation comment in .proto file.""" def Recognize(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def GetRecognition(self, request, context): """Mis...
stack_v2_sparse_classes_75kplus_train_072098
7,612
permissive
[ { "docstring": "Missing associated documentation comment in .proto file.", "name": "Recognize", "signature": "def Recognize(self, request, context)" }, { "docstring": "Missing associated documentation comment in .proto file.", "name": "GetRecognition", "signature": "def GetRecognition(se...
2
stack_v2_sparse_classes_30k_train_000611
Implement the Python class `TextRecognitionAsyncServiceServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def Recognize(self, request, context): Missing associated documentation comment in .proto file. - def GetRecognition(self, r...
Implement the Python class `TextRecognitionAsyncServiceServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def Recognize(self, request, context): Missing associated documentation comment in .proto file. - def GetRecognition(self, r...
b906a014dd893e2697864e1e48e814a8d9fbc48c
<|skeleton|> class TextRecognitionAsyncServiceServicer: """Missing associated documentation comment in .proto file.""" def Recognize(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def GetRecognition(self, request, context): """Mis...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TextRecognitionAsyncServiceServicer: """Missing associated documentation comment in .proto file.""" def Recognize(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not...
the_stack_v2_python_sparse
yandex/cloud/ai/ocr/v1/ocr_service_pb2_grpc.py
yandex-cloud/python-sdk
train
63
4f236bcb1c4a1071c549ac271fb7184ebb8bea5a
[ "super().__init__(grad=grad, **kwargs)\nself.keys = keys\nself.prob = prob\nif not isinstance(dims, DiscreteParameter):\n if len(dims) > 2:\n dims = list(combinations(dims, 2))\n else:\n dims = (dims,)\n dims = DiscreteParameter(dims)\nself.register_sampler('dims', dims)\nself.register_sample...
<|body_start_0|> super().__init__(grad=grad, **kwargs) self.keys = keys self.prob = prob if not isinstance(dims, DiscreteParameter): if len(dims) > 2: dims = list(combinations(dims, 2)) else: dims = (dims,) dims = Discre...
Rotate 90 degree around dims
Rot90
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Rot90: """Rotate 90 degree around dims""" def __init__(self, dims: Union[Sequence[int], DiscreteParameter], keys: Sequence[str]=('data',), num_rots: Sequence[int]=(0, 1, 2, 3), prob: float=0.5, grad: bool=False, **kwargs): """Args: dims: dims/axis ro rotate. If more than two dims are...
stack_v2_sparse_classes_75kplus_train_072099
11,105
permissive
[ { "docstring": "Args: dims: dims/axis ro rotate. If more than two dims are provided, 2 dimensions are randomly chosen at each call keys: keys which should be rotated num_rots: possible values for number of rotations prob: probability for rotation grad: enable gradient computation inside transformation kwargs: k...
2
stack_v2_sparse_classes_30k_train_050242
Implement the Python class `Rot90` described below. Class description: Rotate 90 degree around dims Method signatures and docstrings: - def __init__(self, dims: Union[Sequence[int], DiscreteParameter], keys: Sequence[str]=('data',), num_rots: Sequence[int]=(0, 1, 2, 3), prob: float=0.5, grad: bool=False, **kwargs): A...
Implement the Python class `Rot90` described below. Class description: Rotate 90 degree around dims Method signatures and docstrings: - def __init__(self, dims: Union[Sequence[int], DiscreteParameter], keys: Sequence[str]=('data',), num_rots: Sequence[int]=(0, 1, 2, 3), prob: float=0.5, grad: bool=False, **kwargs): A...
ab6fbcfe7215c2a5b8e401b70909f6a32d0d167b
<|skeleton|> class Rot90: """Rotate 90 degree around dims""" def __init__(self, dims: Union[Sequence[int], DiscreteParameter], keys: Sequence[str]=('data',), num_rots: Sequence[int]=(0, 1, 2, 3), prob: float=0.5, grad: bool=False, **kwargs): """Args: dims: dims/axis ro rotate. If more than two dims are...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Rot90: """Rotate 90 degree around dims""" def __init__(self, dims: Union[Sequence[int], DiscreteParameter], keys: Sequence[str]=('data',), num_rots: Sequence[int]=(0, 1, 2, 3), prob: float=0.5, grad: bool=False, **kwargs): """Args: dims: dims/axis ro rotate. If more than two dims are provided, 2 ...
the_stack_v2_python_sparse
rising/transforms/spatial.py
PhoenixDL/rising
train
318