blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
6.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
438
7.52k
id
stringlengths
40
40
length_bytes
int64
506
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.25k
prompted_full_text
stringlengths
645
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.34k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
302
7.33k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
8490fd537ed5d3c28cd597e45f54b5668d6934b4
[ "super().__init__()\nself.lstm = nn.LSTM(dim_in, hidden_dim, batch_first=True, dropout=dropout, bidirectional=bidirectional)\nself.lstm.flatten_parameters()\nself.output_dim = 2 * hidden_dim if bidirectional else hidden_dim\nself.bidirectional = bidirectional", "assert data.dim() == 3\nb, t = (data.shape[0], data...
<|body_start_0|> super().__init__() self.lstm = nn.LSTM(dim_in, hidden_dim, batch_first=True, dropout=dropout, bidirectional=bidirectional) self.lstm.flatten_parameters() self.output_dim = 2 * hidden_dim if bidirectional else hidden_dim self.bidirectional = bidirectional <|end_bo...
Wrapper for torch.nn.LSTM that handles masked inputs.
LSTM
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LSTM: """Wrapper for torch.nn.LSTM that handles masked inputs.""" def __init__(self, dim_in: int, hidden_dim: int, dropout: float=0.0, bidirectional: bool=False): """Args: dim_in (int): input feature dimension hidden_dim (int): hidden dimesion of lstm layer dropout (float): dropout r...
stack_v2_sparse_classes_36k_train_008500
13,032
permissive
[ { "docstring": "Args: dim_in (int): input feature dimension hidden_dim (int): hidden dimesion of lstm layer dropout (float): dropout rate - 0.0 if no dropout bidirectional (bool): bidirectional or forward only", "name": "__init__", "signature": "def __init__(self, dim_in: int, hidden_dim: int, dropout: ...
2
stack_v2_sparse_classes_30k_train_018889
Implement the Python class `LSTM` described below. Class description: Wrapper for torch.nn.LSTM that handles masked inputs. Method signatures and docstrings: - def __init__(self, dim_in: int, hidden_dim: int, dropout: float=0.0, bidirectional: bool=False): Args: dim_in (int): input feature dimension hidden_dim (int):...
Implement the Python class `LSTM` described below. Class description: Wrapper for torch.nn.LSTM that handles masked inputs. Method signatures and docstrings: - def __init__(self, dim_in: int, hidden_dim: int, dropout: float=0.0, bidirectional: bool=False): Args: dim_in (int): input feature dimension hidden_dim (int):...
16f2abf2f8aa174915316007622bbb260215dee8
<|skeleton|> class LSTM: """Wrapper for torch.nn.LSTM that handles masked inputs.""" def __init__(self, dim_in: int, hidden_dim: int, dropout: float=0.0, bidirectional: bool=False): """Args: dim_in (int): input feature dimension hidden_dim (int): hidden dimesion of lstm layer dropout (float): dropout r...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LSTM: """Wrapper for torch.nn.LSTM that handles masked inputs.""" def __init__(self, dim_in: int, hidden_dim: int, dropout: float=0.0, bidirectional: bool=False): """Args: dim_in (int): input feature dimension hidden_dim (int): hidden dimesion of lstm layer dropout (float): dropout rate - 0.0 if ...
the_stack_v2_python_sparse
pytorchvideo/models/masked_multistream.py
xchani/pytorchvideo
train
0
674a200c9a860fc2f4141392e3ede2a365799fd7
[ "fmt = determine_format(request, self._meta.serializer, default_format=self._meta.default_format)\nif fmt == 'text/html' and 'format' not in request:\n fmt = 'application/json'\nreturn fmt", "for f in mandatory_fields:\n if f not in bundle.data.keys():\n raise ImmediateHttpResponse(HttpBadRequest('%s...
<|body_start_0|> fmt = determine_format(request, self._meta.serializer, default_format=self._meta.default_format) if fmt == 'text/html' and 'format' not in request: fmt = 'application/json' return fmt <|end_body_0|> <|body_start_1|> for f in mandatory_fields: if ...
All resourses are inheriting this resource, it have all functions which is commonly using to all classes
CustomBaseResource
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomBaseResource: """All resourses are inheriting this resource, it have all functions which is commonly using to all classes""" def determine_format(self, request): """return application/json as the default format""" <|body_0|> def check_mandatory_fields(self, bundle,...
stack_v2_sparse_classes_36k_train_008501
4,830
no_license
[ { "docstring": "return application/json as the default format", "name": "determine_format", "signature": "def determine_format(self, request)" }, { "docstring": "For given mandatory fields it will check from bundle. raise error if not present", "name": "check_mandatory_fields", "signatur...
2
null
Implement the Python class `CustomBaseResource` described below. Class description: All resourses are inheriting this resource, it have all functions which is commonly using to all classes Method signatures and docstrings: - def determine_format(self, request): return application/json as the default format - def chec...
Implement the Python class `CustomBaseResource` described below. Class description: All resourses are inheriting this resource, it have all functions which is commonly using to all classes Method signatures and docstrings: - def determine_format(self, request): return application/json as the default format - def chec...
ec9e7896f0b005002111cdf26a375813a388cf53
<|skeleton|> class CustomBaseResource: """All resourses are inheriting this resource, it have all functions which is commonly using to all classes""" def determine_format(self, request): """return application/json as the default format""" <|body_0|> def check_mandatory_fields(self, bundle,...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomBaseResource: """All resourses are inheriting this resource, it have all functions which is commonly using to all classes""" def determine_format(self, request): """return application/json as the default format""" fmt = determine_format(request, self._meta.serializer, default_format...
the_stack_v2_python_sparse
src/gladminds/core/apis/base_apis.py
ashish-srivastava92/GladmindsAshish
train
0
fbd4f259eb05a05b195ed671144c69d02b491f3e
[ "functions = {'MD5': hashlib.md5, 'SHA1': hashlib.sha1, 'SHA224': hashlib.sha224, 'SHA256': hashlib.sha256, 'SHA384': hashlib.sha384, 'SHA512': hashlib.sha512}\nself.hash_function = functions[selected_hash]\nself.splitter = splitter", "hash_function = self.hash_function()\nhash_function.update(block)\nreturn hash...
<|body_start_0|> functions = {'MD5': hashlib.md5, 'SHA1': hashlib.sha1, 'SHA224': hashlib.sha224, 'SHA256': hashlib.sha256, 'SHA384': hashlib.sha384, 'SHA512': hashlib.sha512} self.hash_function = functions[selected_hash] self.splitter = splitter <|end_body_0|> <|body_start_1|> hash_fun...
Class used to encrypt and genereate digest of a block. This Encryption guarantess privacy and integraty
HashedSplitterDriver
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HashedSplitterDriver: """Class used to encrypt and genereate digest of a block. This Encryption guarantess privacy and integraty""" def __init__(self, splitter, selected_hash): """Consctor of a HashedXorDriver. keyword arguments: n_blocks -- number of blocks to generate selected_hash...
stack_v2_sparse_classes_36k_train_008502
2,436
permissive
[ { "docstring": "Consctor of a HashedXorDriver. keyword arguments: n_blocks -- number of blocks to generate selected_hash -- hash function used to create a digest of a block.", "name": "__init__", "signature": "def __init__(self, splitter, selected_hash)" }, { "docstring": "Private function to cr...
4
stack_v2_sparse_classes_30k_train_004815
Implement the Python class `HashedSplitterDriver` described below. Class description: Class used to encrypt and genereate digest of a block. This Encryption guarantess privacy and integraty Method signatures and docstrings: - def __init__(self, splitter, selected_hash): Consctor of a HashedXorDriver. keyword argument...
Implement the Python class `HashedSplitterDriver` described below. Class description: Class used to encrypt and genereate digest of a block. This Encryption guarantess privacy and integraty Method signatures and docstrings: - def __init__(self, splitter, selected_hash): Consctor of a HashedXorDriver. keyword argument...
e9138580594569cbbc7d325e8cd4b1740667edac
<|skeleton|> class HashedSplitterDriver: """Class used to encrypt and genereate digest of a block. This Encryption guarantess privacy and integraty""" def __init__(self, splitter, selected_hash): """Consctor of a HashedXorDriver. keyword arguments: n_blocks -- number of blocks to generate selected_hash...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HashedSplitterDriver: """Class used to encrypt and genereate digest of a block. This Encryption guarantess privacy and integraty""" def __init__(self, splitter, selected_hash): """Consctor of a HashedXorDriver. keyword arguments: n_blocks -- number of blocks to generate selected_hash -- hash func...
the_stack_v2_python_sparse
pyproxy/pyproxy/coder/safestore/hashed_splitter_driver.py
safecloud-project/recast
train
0
f43647b1fd412382b395f84bb9b2fc91df018883
[ "if not nums or len(nums) == 0:\n return\nself.total_sum = [0 for _ in range(len(nums))]\nself.total_sum[0] = nums[0]\nif len(self.total_sum) == 1:\n return\nfor idx in range(1, len(nums)):\n self.total_sum[idx] = self.total_sum[idx - 1] + nums[idx]", "if i == 0:\n return self.total_sum[j]\nelse:\n ...
<|body_start_0|> if not nums or len(nums) == 0: return self.total_sum = [0 for _ in range(len(nums))] self.total_sum[0] = nums[0] if len(self.total_sum) == 1: return for idx in range(1, len(nums)): self.total_sum[idx] = self.total_sum[idx - 1] ...
NumArray
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumArray: def __init__(self, nums): """:type nums: List[int]""" <|body_0|> def sumRange(self, i, j): """:type i: int :type j: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not nums or len(nums) == 0: return s...
stack_v2_sparse_classes_36k_train_008503
1,218
permissive
[ { "docstring": ":type nums: List[int]", "name": "__init__", "signature": "def __init__(self, nums)" }, { "docstring": ":type i: int :type j: int :rtype: int", "name": "sumRange", "signature": "def sumRange(self, i, j)" } ]
2
null
Implement the Python class `NumArray` described below. Class description: Implement the NumArray class. Method signatures and docstrings: - def __init__(self, nums): :type nums: List[int] - def sumRange(self, i, j): :type i: int :type j: int :rtype: int
Implement the Python class `NumArray` described below. Class description: Implement the NumArray class. Method signatures and docstrings: - def __init__(self, nums): :type nums: List[int] - def sumRange(self, i, j): :type i: int :type j: int :rtype: int <|skeleton|> class NumArray: def __init__(self, nums): ...
5097f69bb0050d963c784d6bc0e88a7e871568ed
<|skeleton|> class NumArray: def __init__(self, nums): """:type nums: List[int]""" <|body_0|> def sumRange(self, i, j): """:type i: int :type j: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NumArray: def __init__(self, nums): """:type nums: List[int]""" if not nums or len(nums) == 0: return self.total_sum = [0 for _ in range(len(nums))] self.total_sum[0] = nums[0] if len(self.total_sum) == 1: return for idx in range(1, len(n...
the_stack_v2_python_sparse
300-/303.py
yshshadow/Leetcode
train
0
de5bdcf5a8363ba879073aee8e66ce7485141306
[ "prefix = nums[:]\nfor i in range(1, len(prefix)):\n prefix[i] += prefix[i - 1]\nself.prefix = prefix", "if i == 0:\n return self.prefix[j]\nelse:\n return self.prefix[j] - self.prefix[i - 1]" ]
<|body_start_0|> prefix = nums[:] for i in range(1, len(prefix)): prefix[i] += prefix[i - 1] self.prefix = prefix <|end_body_0|> <|body_start_1|> if i == 0: return self.prefix[j] else: return self.prefix[j] - self.prefix[i - 1] <|end_body_1|>
NumArray
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumArray: def __init__(self, nums): """:type nums: List[int]""" <|body_0|> def sumRange(self, i, j): """:type i: int :type j: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> prefix = nums[:] for i in range(1, len(prefix)): ...
stack_v2_sparse_classes_36k_train_008504
586
no_license
[ { "docstring": ":type nums: List[int]", "name": "__init__", "signature": "def __init__(self, nums)" }, { "docstring": ":type i: int :type j: int :rtype: int", "name": "sumRange", "signature": "def sumRange(self, i, j)" } ]
2
stack_v2_sparse_classes_30k_train_012214
Implement the Python class `NumArray` described below. Class description: Implement the NumArray class. Method signatures and docstrings: - def __init__(self, nums): :type nums: List[int] - def sumRange(self, i, j): :type i: int :type j: int :rtype: int
Implement the Python class `NumArray` described below. Class description: Implement the NumArray class. Method signatures and docstrings: - def __init__(self, nums): :type nums: List[int] - def sumRange(self, i, j): :type i: int :type j: int :rtype: int <|skeleton|> class NumArray: def __init__(self, nums): ...
0e35e4cc87bd41144b8e34302aafe776fec1b356
<|skeleton|> class NumArray: def __init__(self, nums): """:type nums: List[int]""" <|body_0|> def sumRange(self, i, j): """:type i: int :type j: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NumArray: def __init__(self, nums): """:type nums: List[int]""" prefix = nums[:] for i in range(1, len(prefix)): prefix[i] += prefix[i - 1] self.prefix = prefix def sumRange(self, i, j): """:type i: int :type j: int :rtype: int""" if i == 0: ...
the_stack_v2_python_sparse
LeetCode/303-range_sum_query_immutable.py
davll/practical-algorithms
train
0
d7eeb73e4b61324a3ce88c5b7c42284923b15b2d
[ "login_page.LoginPage(self.driver).login()\nsleep(3)\nlandlord_nav_page.LandlordNavPage(self.driver).Iamlandlord()\nsleep(3)\nlandlord_nav_page.LandlordNavPage(self.driver).close_weiChat()\nsleep(3)\nlandlord_nav_page.LandlordNavPage(self.driver).roommanager()\nsleep(3)\npo = landlord_read_page.LandlordReadPage(sel...
<|body_start_0|> login_page.LoginPage(self.driver).login() sleep(3) landlord_nav_page.LandlordNavPage(self.driver).Iamlandlord() sleep(3) landlord_nav_page.LandlordNavPage(self.driver).close_weiChat() sleep(3) landlord_nav_page.LandlordNavPage(self.driver).roomman...
房源管理-房东必读
TestLandlordRead
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestLandlordRead: """房源管理-房东必读""" def test_agreement(self): """服务协议""" <|body_0|> def test_landlord_read(self): """房东规则""" <|body_1|> def test_tenant_rule(self): """房客规则""" <|body_2|> def test_roomauditrule(self): """房间审核...
stack_v2_sparse_classes_36k_train_008505
4,003
permissive
[ { "docstring": "服务协议", "name": "test_agreement", "signature": "def test_agreement(self)" }, { "docstring": "房东规则", "name": "test_landlord_read", "signature": "def test_landlord_read(self)" }, { "docstring": "房客规则", "name": "test_tenant_rule", "signature": "def test_tenant...
6
stack_v2_sparse_classes_30k_train_011707
Implement the Python class `TestLandlordRead` described below. Class description: 房源管理-房东必读 Method signatures and docstrings: - def test_agreement(self): 服务协议 - def test_landlord_read(self): 房东规则 - def test_tenant_rule(self): 房客规则 - def test_roomauditrule(self): 房间审核规范 - def test_privacypolicy(self): 隐私条款 - def test_...
Implement the Python class `TestLandlordRead` described below. Class description: 房源管理-房东必读 Method signatures and docstrings: - def test_agreement(self): 服务协议 - def test_landlord_read(self): 房东规则 - def test_tenant_rule(self): 房客规则 - def test_roomauditrule(self): 房间审核规范 - def test_privacypolicy(self): 隐私条款 - def test_...
192c70c49a8e9e072b9d0d0136f02c653c589410
<|skeleton|> class TestLandlordRead: """房源管理-房东必读""" def test_agreement(self): """服务协议""" <|body_0|> def test_landlord_read(self): """房东规则""" <|body_1|> def test_tenant_rule(self): """房客规则""" <|body_2|> def test_roomauditrule(self): """房间审核...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestLandlordRead: """房源管理-房东必读""" def test_agreement(self): """服务协议""" login_page.LoginPage(self.driver).login() sleep(3) landlord_nav_page.LandlordNavPage(self.driver).Iamlandlord() sleep(3) landlord_nav_page.LandlordNavPage(self.driver).close_weiChat() ...
the_stack_v2_python_sparse
mayi/test_case/test_landlord_read.py
18701016443/mayi
train
0
ac53cfcd3a64493e0ae54c879ed11c122106dcc9
[ "if self.memory:\n return str(self.data)\nwith helpers.ensure_open(self):\n return self.text_stream.read(size)", "resource = target\nif not isinstance(resource, Resource):\n resource = TextResource(**options)\nif not isinstance(resource, TextResource):\n raise FrictionlessException('target must be a t...
<|body_start_0|> if self.memory: return str(self.data) with helpers.ensure_open(self): return self.text_stream.read(size) <|end_body_0|> <|body_start_1|> resource = target if not isinstance(resource, Resource): resource = TextResource(**options) ...
TextResource
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TextResource: def read_text(self, *, size: Optional[int]=None) -> str: """Read text into memory Returns: str: resource text""" <|body_0|> def write_text(self, target: Optional[Union[TextResource, Any]]=None, **options: Any): """Write text data to the target""" ...
stack_v2_sparse_classes_36k_train_008506
1,414
permissive
[ { "docstring": "Read text into memory Returns: str: resource text", "name": "read_text", "signature": "def read_text(self, *, size: Optional[int]=None) -> str" }, { "docstring": "Write text data to the target", "name": "write_text", "signature": "def write_text(self, target: Optional[Uni...
2
stack_v2_sparse_classes_30k_train_011764
Implement the Python class `TextResource` described below. Class description: Implement the TextResource class. Method signatures and docstrings: - def read_text(self, *, size: Optional[int]=None) -> str: Read text into memory Returns: str: resource text - def write_text(self, target: Optional[Union[TextResource, Any...
Implement the Python class `TextResource` described below. Class description: Implement the TextResource class. Method signatures and docstrings: - def read_text(self, *, size: Optional[int]=None) -> str: Read text into memory Returns: str: resource text - def write_text(self, target: Optional[Union[TextResource, Any...
740319edeee58f12cc6956a53356f3065ff18cbb
<|skeleton|> class TextResource: def read_text(self, *, size: Optional[int]=None) -> str: """Read text into memory Returns: str: resource text""" <|body_0|> def write_text(self, target: Optional[Union[TextResource, Any]]=None, **options: Any): """Write text data to the target""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TextResource: def read_text(self, *, size: Optional[int]=None) -> str: """Read text into memory Returns: str: resource text""" if self.memory: return str(self.data) with helpers.ensure_open(self): return self.text_stream.read(size) def write_text(self, targ...
the_stack_v2_python_sparse
frictionless/resources/text.py
frictionlessdata/frictionless-py
train
295
6d893bdd9c23dae4a8e214c517b4a1d2764e53f7
[ "self.foods = []\nfor fx, fy in food:\n self.foods.append((fx, fy))\nself.food_index = 0\nself.width = width\nself.height = height\nself.body = [[0, 0]]", "head_x, head_y = self.body[0]\nnext_x = head_x\nnext_y = head_y\nif direction == 'U':\n next_x -= 1\nelif direction == 'L':\n next_y -= 1\nelif direc...
<|body_start_0|> self.foods = [] for fx, fy in food: self.foods.append((fx, fy)) self.food_index = 0 self.width = width self.height = height self.body = [[0, 0]] <|end_body_0|> <|body_start_1|> head_x, head_y = self.body[0] next_x = head_x ...
SnakeGame
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SnakeGame: def __init__(self, width, height, food): """Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. :typ...
stack_v2_sparse_classes_36k_train_008507
1,998
no_license
[ { "docstring": "Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. :type width: int :type height: int :type food: List[List[int]]", ...
2
null
Implement the Python class `SnakeGame` described below. Class description: Implement the SnakeGame class. Method signatures and docstrings: - def __init__(self, width, height, food): Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E...
Implement the Python class `SnakeGame` described below. Class description: Implement the SnakeGame class. Method signatures and docstrings: - def __init__(self, width, height, food): Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E...
696a25f8597e2a5bc5ab788924418d6423160af1
<|skeleton|> class SnakeGame: def __init__(self, width, height, food): """Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. :typ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SnakeGame: def __init__(self, width, height, food): """Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. :type width: int :...
the_stack_v2_python_sparse
353_design_snake_game.py
tooyoungtoosimplesometimesnaive/probable-octo-potato
train
0
dbf772f49fad5a963043fb4b09419134b64eda40
[ "coord = torch.stack(data_samples.metainfo['coord']).to(inputs)\ncell = torch.stack(data_samples.metainfo['cell']).to(inputs)\nfeats = self.generator(inputs, coord, cell, **kwargs)\nreturn feats", "feats = self.forward_tensor(inputs, data_samples, test_mode=True)\nih, iw = inputs.shape[-2:]\ncoord_count = data_sa...
<|body_start_0|> coord = torch.stack(data_samples.metainfo['coord']).to(inputs) cell = torch.stack(data_samples.metainfo['cell']).to(inputs) feats = self.generator(inputs, coord, cell, **kwargs) return feats <|end_body_0|> <|body_start_1|> feats = self.forward_tensor(inputs, dat...
LIIF model for single image super-resolution. Paper: Learning Continuous Image Representation with Local Implicit Image Function Args: generator (dict): Config for the generator. pixel_loss (dict): Config for the pixel loss. pretrained (str): Path for pretrained model. Default: None. data_preprocessor (dict, optional):...
LIIF
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LIIF: """LIIF model for single image super-resolution. Paper: Learning Continuous Image Representation with Local Implicit Image Function Args: generator (dict): Config for the generator. pixel_loss (dict): Config for the pixel loss. pretrained (str): Path for pretrained model. Default: None. dat...
stack_v2_sparse_classes_36k_train_008508
2,572
permissive
[ { "docstring": "Forward tensor. Returns result of simple forward. Args: inputs (torch.Tensor): batch input tensor collated by :attr:`data_preprocessor`. data_samples (List[BaseDataElement], optional): data samples collated by :attr:`data_preprocessor`. Returns: Tensor: result of simple forward.", "name": "f...
2
null
Implement the Python class `LIIF` described below. Class description: LIIF model for single image super-resolution. Paper: Learning Continuous Image Representation with Local Implicit Image Function Args: generator (dict): Config for the generator. pixel_loss (dict): Config for the pixel loss. pretrained (str): Path f...
Implement the Python class `LIIF` described below. Class description: LIIF model for single image super-resolution. Paper: Learning Continuous Image Representation with Local Implicit Image Function Args: generator (dict): Config for the generator. pixel_loss (dict): Config for the pixel loss. pretrained (str): Path f...
a382f143c0fd20d227e1e5524831ba26a568190d
<|skeleton|> class LIIF: """LIIF model for single image super-resolution. Paper: Learning Continuous Image Representation with Local Implicit Image Function Args: generator (dict): Config for the generator. pixel_loss (dict): Config for the pixel loss. pretrained (str): Path for pretrained model. Default: None. dat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LIIF: """LIIF model for single image super-resolution. Paper: Learning Continuous Image Representation with Local Implicit Image Function Args: generator (dict): Config for the generator. pixel_loss (dict): Config for the pixel loss. pretrained (str): Path for pretrained model. Default: None. data_preprocesso...
the_stack_v2_python_sparse
mmagic/models/editors/liif/liif.py
open-mmlab/mmagic
train
1,370
ac80d0fb8db7912b1ab79e8838a1b257a2b8ac03
[ "m1, m2 = (sys.maxsize, sys.maxsize)\nfor i in nums:\n if m1 >= i:\n m1 = i\n elif m2 >= i:\n m2 = i\n else:\n return True\nreturn False", "n = len(nums)\nif n < 3:\n return False\nf = [nums[0]] * n\nb = [nums[-1]] * n\nfor i in range(1, n):\n f[i] = min(f[i - 1], nums[i])\nfor...
<|body_start_0|> m1, m2 = (sys.maxsize, sys.maxsize) for i in nums: if m1 >= i: m1 = i elif m2 >= i: m2 = i else: return True return False <|end_body_0|> <|body_start_1|> n = len(nums) if n < 3: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def increasingTriplet(self, nums): """:type nums: List[int] :rtype: bool""" <|body_0|> def increasingTripletO1Space(self, nums): """:type nums: List[int] :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> m1, m2 = (sys.maxsize, s...
stack_v2_sparse_classes_36k_train_008509
1,715
no_license
[ { "docstring": ":type nums: List[int] :rtype: bool", "name": "increasingTriplet", "signature": "def increasingTriplet(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: bool", "name": "increasingTripletO1Space", "signature": "def increasingTripletO1Space(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_013697
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def increasingTriplet(self, nums): :type nums: List[int] :rtype: bool - def increasingTripletO1Space(self, nums): :type nums: List[int] :rtype: bool
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def increasingTriplet(self, nums): :type nums: List[int] :rtype: bool - def increasingTripletO1Space(self, nums): :type nums: List[int] :rtype: bool <|skeleton|> class Solution:...
810575368ecffa97677bdb51744d1f716140bbb1
<|skeleton|> class Solution: def increasingTriplet(self, nums): """:type nums: List[int] :rtype: bool""" <|body_0|> def increasingTripletO1Space(self, nums): """:type nums: List[int] :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def increasingTriplet(self, nums): """:type nums: List[int] :rtype: bool""" m1, m2 = (sys.maxsize, sys.maxsize) for i in nums: if m1 >= i: m1 = i elif m2 >= i: m2 = i else: return True ...
the_stack_v2_python_sparse
I/IncreasingTripletSubsequence.py
bssrdf/pyleet
train
2
d3afad4242879ffdf9cbb34934755f24a0b54f99
[ "self.open(base_url + '/logout')\nself.open(base_url + '/login')\nself.type('#password', generate_password_hash('test_password'))\nself.click('input[type=\"submit\"]')\nself.assert_element('#message')\nself.assert_text('Email format incorrect: Cannot be empty', '#message')", "self.open(base_url + '/logout')\nself...
<|body_start_0|> self.open(base_url + '/logout') self.open(base_url + '/login') self.type('#password', generate_password_hash('test_password')) self.click('input[type="submit"]') self.assert_element('#message') self.assert_text('Email format incorrect: Cannot be empty', '...
FrontEndLoginR1
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FrontEndLoginR1: def test_loginFormEmailEmpty(self, *_): """This function tests that the user form cannot be empty, if email is empty the message warns the user with an error message""" <|body_0|> def test_loginFormPassEmpty(self, *_): """This function tests that the...
stack_v2_sparse_classes_36k_train_008510
1,752
permissive
[ { "docstring": "This function tests that the user form cannot be empty, if email is empty the message warns the user with an error message", "name": "test_loginFormEmailEmpty", "signature": "def test_loginFormEmailEmpty(self, *_)" }, { "docstring": "This function tests that the user form cannot ...
2
stack_v2_sparse_classes_30k_train_007934
Implement the Python class `FrontEndLoginR1` described below. Class description: Implement the FrontEndLoginR1 class. Method signatures and docstrings: - def test_loginFormEmailEmpty(self, *_): This function tests that the user form cannot be empty, if email is empty the message warns the user with an error message -...
Implement the Python class `FrontEndLoginR1` described below. Class description: Implement the FrontEndLoginR1 class. Method signatures and docstrings: - def test_loginFormEmailEmpty(self, *_): This function tests that the user form cannot be empty, if email is empty the message warns the user with an error message -...
582e00a4c16016e545fedcbb14a745d125db94e0
<|skeleton|> class FrontEndLoginR1: def test_loginFormEmailEmpty(self, *_): """This function tests that the user form cannot be empty, if email is empty the message warns the user with an error message""" <|body_0|> def test_loginFormPassEmpty(self, *_): """This function tests that the...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FrontEndLoginR1: def test_loginFormEmailEmpty(self, *_): """This function tests that the user form cannot be empty, if email is empty the message warns the user with an error message""" self.open(base_url + '/logout') self.open(base_url + '/login') self.type('#password', genera...
the_stack_v2_python_sparse
qa327_test/frontend/login/test_R1_6.py
GraemeBadley/QA-Project
train
0
6e89f90a25df44a9580d8a73c8b9d2592759872d
[ "department = get_department(id_dept)\nif department:\n resp = jsonify(department)\n resp.status_code = 200\n return resp\nelse:\n resp = jsonify({'message': f'department #{id_dept} does not exist'})\n return resp", "deleted = del_department(id_dept)\nif deleted:\n resp = jsonify({'message': f'd...
<|body_start_0|> department = get_department(id_dept) if department: resp = jsonify(department) resp.status_code = 200 return resp else: resp = jsonify({'message': f'department #{id_dept} does not exist'}) return resp <|end_body_0|> <|...
DepartmentItem
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DepartmentItem: def get(self, id_dept): """Method get department id from url and gets corresponding department :param dept_id: department id :return: if success -> department info, if not -> message': department with id does not exist""" <|body_0|> def delete(self, id_dept):...
stack_v2_sparse_classes_36k_train_008511
3,115
no_license
[ { "docstring": "Method get department id from url and gets corresponding department :param dept_id: department id :return: if success -> department info, if not -> message': department with id does not exist", "name": "get", "signature": "def get(self, id_dept)" }, { "docstring": "Method get dep...
3
stack_v2_sparse_classes_30k_train_021687
Implement the Python class `DepartmentItem` described below. Class description: Implement the DepartmentItem class. Method signatures and docstrings: - def get(self, id_dept): Method get department id from url and gets corresponding department :param dept_id: department id :return: if success -> department info, if n...
Implement the Python class `DepartmentItem` described below. Class description: Implement the DepartmentItem class. Method signatures and docstrings: - def get(self, id_dept): Method get department id from url and gets corresponding department :param dept_id: department id :return: if success -> department info, if n...
8452b3671afce50b733379f278d1adf89e6e2ec9
<|skeleton|> class DepartmentItem: def get(self, id_dept): """Method get department id from url and gets corresponding department :param dept_id: department id :return: if success -> department info, if not -> message': department with id does not exist""" <|body_0|> def delete(self, id_dept):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DepartmentItem: def get(self, id_dept): """Method get department id from url and gets corresponding department :param dept_id: department id :return: if success -> department info, if not -> message': department with id does not exist""" department = get_department(id_dept) if departme...
the_stack_v2_python_sparse
department-app/rest/rest_departments.py
dgiart/final05_python_2021
train
0
2903cc2bb853e9170eb33c9b9d040dadc0381b0a
[ "super().__init__()\nself.rel_pos_emb = torch.nn.Parameter(torch.randn(2 * seq_len - 1, int(dim_head)))\nself.rel_pos = calc_rel_pos(seq_len)", "content_lambda = torch.einsum('bnk,bnv->bkv', torch.softmax(k, dim=-1), v)\ncontent_output = torch.einsum('bnk,bkv->bnv', q, content_lambda)\nrel_pos_emb = self.rel_pos_...
<|body_start_0|> super().__init__() self.rel_pos_emb = torch.nn.Parameter(torch.randn(2 * seq_len - 1, int(dim_head))) self.rel_pos = calc_rel_pos(seq_len) <|end_body_0|> <|body_start_1|> content_lambda = torch.einsum('bnk,bnv->bkv', torch.softmax(k, dim=-1), v) content_output =...
LambdaLayer
[ "BSD-2-Clause", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LambdaLayer: def __init__(self, seq_len: int, dim_head: int, *_, **__): """Attention approximation using Lambda layers, from "Lambda networks: modeling long-range interactions without attention.", Bello, I. (2021).""" <|body_0|> def forward(self, q: torch.Tensor, k: torch.Te...
stack_v2_sparse_classes_36k_train_008512
2,479
permissive
[ { "docstring": "Attention approximation using Lambda layers, from \"Lambda networks: modeling long-range interactions without attention.\", Bello, I. (2021).", "name": "__init__", "signature": "def __init__(self, seq_len: int, dim_head: int, *_, **__)" }, { "docstring": "..NOTE: We're reusing th...
2
stack_v2_sparse_classes_30k_train_009314
Implement the Python class `LambdaLayer` described below. Class description: Implement the LambdaLayer class. Method signatures and docstrings: - def __init__(self, seq_len: int, dim_head: int, *_, **__): Attention approximation using Lambda layers, from "Lambda networks: modeling long-range interactions without atte...
Implement the Python class `LambdaLayer` described below. Class description: Implement the LambdaLayer class. Method signatures and docstrings: - def __init__(self, seq_len: int, dim_head: int, *_, **__): Attention approximation using Lambda layers, from "Lambda networks: modeling long-range interactions without atte...
71bab94cb954e6e291ca93d3bce5dffadab4286d
<|skeleton|> class LambdaLayer: def __init__(self, seq_len: int, dim_head: int, *_, **__): """Attention approximation using Lambda layers, from "Lambda networks: modeling long-range interactions without attention.", Bello, I. (2021).""" <|body_0|> def forward(self, q: torch.Tensor, k: torch.Te...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LambdaLayer: def __init__(self, seq_len: int, dim_head: int, *_, **__): """Attention approximation using Lambda layers, from "Lambda networks: modeling long-range interactions without attention.", Bello, I. (2021).""" super().__init__() self.rel_pos_emb = torch.nn.Parameter(torch.randn...
the_stack_v2_python_sparse
xformers/components/attention/lambda_layer.py
hercules261188/xformers
train
1
12fc61b52c2bc0b426d2172e3d70c5d27fe95d99
[ "if per_channel:\n return np.array(list(self.samples())).mean(axis=(0, 1, 2))\nreturn np.array(list(self.samples())).mean()", "if per_channel:\n return np.array(list(self.samples())).std(axis=(0, 1, 2))\nreturn np.array(list(self.samples())).std()" ]
<|body_start_0|> if per_channel: return np.array(list(self.samples())).mean(axis=(0, 1, 2)) return np.array(list(self.samples())).mean() <|end_body_0|> <|body_start_1|> if per_channel: return np.array(list(self.samples())).std(axis=(0, 1, 2)) return np.array(list...
A dataset, consisting of multiple samples/images and corresponding class labels.
ImageDataset
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageDataset: """A dataset, consisting of multiple samples/images and corresponding class labels.""" def get_mean(self, per_channel=False): """Get the global mean of this dataset. The result value is cached.""" <|body_0|> def get_stddev(self, per_channel=False): ...
stack_v2_sparse_classes_36k_train_008513
818
no_license
[ { "docstring": "Get the global mean of this dataset. The result value is cached.", "name": "get_mean", "signature": "def get_mean(self, per_channel=False)" }, { "docstring": "Get the global stddev of this dataset. The result value is cached.", "name": "get_stddev", "signature": "def get_...
2
stack_v2_sparse_classes_30k_train_001162
Implement the Python class `ImageDataset` described below. Class description: A dataset, consisting of multiple samples/images and corresponding class labels. Method signatures and docstrings: - def get_mean(self, per_channel=False): Get the global mean of this dataset. The result value is cached. - def get_stddev(se...
Implement the Python class `ImageDataset` described below. Class description: A dataset, consisting of multiple samples/images and corresponding class labels. Method signatures and docstrings: - def get_mean(self, per_channel=False): Get the global mean of this dataset. The result value is cached. - def get_stddev(se...
bed2b189340be52723aa4d53b4d51ad289a4a265
<|skeleton|> class ImageDataset: """A dataset, consisting of multiple samples/images and corresponding class labels.""" def get_mean(self, per_channel=False): """Get the global mean of this dataset. The result value is cached.""" <|body_0|> def get_stddev(self, per_channel=False): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImageDataset: """A dataset, consisting of multiple samples/images and corresponding class labels.""" def get_mean(self, per_channel=False): """Get the global mean of this dataset. The result value is cached.""" if per_channel: return np.array(list(self.samples())).mean(axis=(0...
the_stack_v2_python_sparse
cnn-keras/dataset/ImageDataset.py
chaosmail/cvsp-age-gender-classification-16
train
2
f58aaa66a860ff7b50683f7d8ec80a8e9b9ae155
[ "\"\"\":field\n The object ID.\n \"\"\"\nself.object_id: int = object_id\nself._solver_id: int = solver_id\nself._object_index: int = object_index\n':field\\n The positions of each particle as a numpy array.\\n '\nself.positions: np.ndarray = np.array([], dtype=np.float32)\n':field\\n ...
<|body_start_0|> """:field The object ID. """ self.object_id: int = object_id self._solver_id: int = solver_id self._object_index: int = object_index ':field\n The positions of each particle as a numpy array.\n ' self.position...
Data for an Obi actor.
ObiActor
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ObiActor: """Data for an Obi actor.""" def __init__(self, object_id: int, solver_id: int, object_index: int): """:param object_id: The object ID. :param solver_id: The ID of the object's Obi solver. :param object_index: The index of the object in the `ObiParticles` output data.""" ...
stack_v2_sparse_classes_36k_train_008514
1,831
permissive
[ { "docstring": ":param object_id: The object ID. :param solver_id: The ID of the object's Obi solver. :param object_index: The index of the object in the `ObiParticles` output data.", "name": "__init__", "signature": "def __init__(self, object_id: int, solver_id: int, object_index: int)" }, { "d...
2
stack_v2_sparse_classes_30k_train_009295
Implement the Python class `ObiActor` described below. Class description: Data for an Obi actor. Method signatures and docstrings: - def __init__(self, object_id: int, solver_id: int, object_index: int): :param object_id: The object ID. :param solver_id: The ID of the object's Obi solver. :param object_index: The ind...
Implement the Python class `ObiActor` described below. Class description: Data for an Obi actor. Method signatures and docstrings: - def __init__(self, object_id: int, solver_id: int, object_index: int): :param object_id: The object ID. :param solver_id: The ID of the object's Obi solver. :param object_index: The ind...
9df96fba455b327bb360d8dd5886d8754046c690
<|skeleton|> class ObiActor: """Data for an Obi actor.""" def __init__(self, object_id: int, solver_id: int, object_index: int): """:param object_id: The object ID. :param solver_id: The ID of the object's Obi solver. :param object_index: The index of the object in the `ObiParticles` output data.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ObiActor: """Data for an Obi actor.""" def __init__(self, object_id: int, solver_id: int, object_index: int): """:param object_id: The object ID. :param solver_id: The ID of the object's Obi solver. :param object_index: The index of the object in the `ObiParticles` output data.""" """:fie...
the_stack_v2_python_sparse
Python/tdw/obi_data/obi_actor.py
threedworld-mit/tdw
train
427
9cbfd96b4dc7501a093b5abc5eb58486428739cf
[ "print('student__iter__')\nself.value = 5\nreturn self", "print('student__next__')\nif self.value >= 0:\n self.value -= 1\n return self.value\nelse:\n raise StopIteration" ]
<|body_start_0|> print('student__iter__') self.value = 5 return self <|end_body_0|> <|body_start_1|> print('student__next__') if self.value >= 0: self.value -= 1 return self.value else: raise StopIteration <|end_body_1|>
Color
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Color: def __iter__(self): """遍历对象开始时,先调用这个函数""" <|body_0|> def __next__(self): """每循环一次,便调用一次,一直到发生了StopIteration异常为""" <|body_1|> <|end_skeleton|> <|body_start_0|> print('student__iter__') self.value = 5 return self <|end_body_0|> ...
stack_v2_sparse_classes_36k_train_008515
761
no_license
[ { "docstring": "遍历对象开始时,先调用这个函数", "name": "__iter__", "signature": "def __iter__(self)" }, { "docstring": "每循环一次,便调用一次,一直到发生了StopIteration异常为", "name": "__next__", "signature": "def __next__(self)" } ]
2
stack_v2_sparse_classes_30k_val_000388
Implement the Python class `Color` described below. Class description: Implement the Color class. Method signatures and docstrings: - def __iter__(self): 遍历对象开始时,先调用这个函数 - def __next__(self): 每循环一次,便调用一次,一直到发生了StopIteration异常为
Implement the Python class `Color` described below. Class description: Implement the Color class. Method signatures and docstrings: - def __iter__(self): 遍历对象开始时,先调用这个函数 - def __next__(self): 每循环一次,便调用一次,一直到发生了StopIteration异常为 <|skeleton|> class Color: def __iter__(self): """遍历对象开始时,先调用这个函数""" <...
5e404417289ffd7fa564425c9d34513a0c08b860
<|skeleton|> class Color: def __iter__(self): """遍历对象开始时,先调用这个函数""" <|body_0|> def __next__(self): """每循环一次,便调用一次,一直到发生了StopIteration异常为""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Color: def __iter__(self): """遍历对象开始时,先调用这个函数""" print('student__iter__') self.value = 5 return self def __next__(self): """每循环一次,便调用一次,一直到发生了StopIteration异常为""" print('student__next__') if self.value >= 0: self.value -= 1 re...
the_stack_v2_python_sparse
day002/07_魔法函数_e_遍历.py
miaoshihu/learn_python
train
0
cb9b2dcfc5fc879ca9be2761faae15f1cf69b628
[ "book = get_object_or_404(models.Edition, id=book_id)\nform = forms.ReadThroughForm()\ndata = {'form': form, 'book': book}\nif readthrough_id:\n data['readthrough'] = get_object_or_404(models.ReadThrough, id=readthrough_id)\nreturn TemplateResponse(request, 'readthrough/readthrough.html', data)", "book_id = re...
<|body_start_0|> book = get_object_or_404(models.Edition, id=book_id) form = forms.ReadThroughForm() data = {'form': form, 'book': book} if readthrough_id: data['readthrough'] = get_object_or_404(models.ReadThrough, id=readthrough_id) return TemplateResponse(request, ...
Add new read dates
ReadThrough
[ "LicenseRef-scancode-warranty-disclaimer" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReadThrough: """Add new read dates""" def get(self, request, book_id, readthrough_id=None): """standalone form in case of errors""" <|body_0|> def post(self, request): """can't use the form normally because the dates are too finnicky""" <|body_1|> <|end_...
stack_v2_sparse_classes_36k_train_008516
8,188
no_license
[ { "docstring": "standalone form in case of errors", "name": "get", "signature": "def get(self, request, book_id, readthrough_id=None)" }, { "docstring": "can't use the form normally because the dates are too finnicky", "name": "post", "signature": "def post(self, request)" } ]
2
null
Implement the Python class `ReadThrough` described below. Class description: Add new read dates Method signatures and docstrings: - def get(self, request, book_id, readthrough_id=None): standalone form in case of errors - def post(self, request): can't use the form normally because the dates are too finnicky
Implement the Python class `ReadThrough` described below. Class description: Add new read dates Method signatures and docstrings: - def get(self, request, book_id, readthrough_id=None): standalone form in case of errors - def post(self, request): can't use the form normally because the dates are too finnicky <|skele...
0f8da5b738047f3c34d60d93f59bdedd8f797224
<|skeleton|> class ReadThrough: """Add new read dates""" def get(self, request, book_id, readthrough_id=None): """standalone form in case of errors""" <|body_0|> def post(self, request): """can't use the form normally because the dates are too finnicky""" <|body_1|> <|end_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ReadThrough: """Add new read dates""" def get(self, request, book_id, readthrough_id=None): """standalone form in case of errors""" book = get_object_or_404(models.Edition, id=book_id) form = forms.ReadThroughForm() data = {'form': form, 'book': book} if readthroug...
the_stack_v2_python_sparse
bookwyrm/views/reading.py
bookwyrm-social/bookwyrm
train
1,398
3fdb029283a1a664f8a6e0d3a973069fb07cc16e
[ "l, r = (0, len(nums) - 1)\nif nums[l] < nums[r] or len(nums) == 1:\n return nums[l]\nif len(nums) == 2:\n return min(nums[0], nums[1])\nwhile l < r:\n m = (l + r) // 2\n if m + 1 < len(nums) and nums[m] > nums[m + 1]:\n return nums[m + 1]\n if m - 1 >= 0 and nums[m - 1] > nums[m]:\n re...
<|body_start_0|> l, r = (0, len(nums) - 1) if nums[l] < nums[r] or len(nums) == 1: return nums[l] if len(nums) == 2: return min(nums[0], nums[1]) while l < r: m = (l + r) // 2 if m + 1 < len(nums) and nums[m] > nums[m + 1]: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findMin(self, nums): """:type nums: List[int] :rtype: int [3,4,5,5,5,6,6,1,1,2,3,3] [3,3,3,1] [1] [1,1] [2,2,2,0,1,2] [10,1,10,10,10]""" <|body_0|> def findMin2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <...
stack_v2_sparse_classes_36k_train_008517
2,046
no_license
[ { "docstring": ":type nums: List[int] :rtype: int [3,4,5,5,5,6,6,1,1,2,3,3] [3,3,3,1] [1] [1,1] [2,2,2,0,1,2] [10,1,10,10,10]", "name": "findMin", "signature": "def findMin(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "findMin2", "signature": "def findMin2(...
2
stack_v2_sparse_classes_30k_train_002938
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findMin(self, nums): :type nums: List[int] :rtype: int [3,4,5,5,5,6,6,1,1,2,3,3] [3,3,3,1] [1] [1,1] [2,2,2,0,1,2] [10,1,10,10,10] - def findMin2(self, nums): :type nums: Lis...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findMin(self, nums): :type nums: List[int] :rtype: int [3,4,5,5,5,6,6,1,1,2,3,3] [3,3,3,1] [1] [1,1] [2,2,2,0,1,2] [10,1,10,10,10] - def findMin2(self, nums): :type nums: Lis...
85128e7d26157b3c36eb43868269de42ea2fcb98
<|skeleton|> class Solution: def findMin(self, nums): """:type nums: List[int] :rtype: int [3,4,5,5,5,6,6,1,1,2,3,3] [3,3,3,1] [1] [1,1] [2,2,2,0,1,2] [10,1,10,10,10]""" <|body_0|> def findMin2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findMin(self, nums): """:type nums: List[int] :rtype: int [3,4,5,5,5,6,6,1,1,2,3,3] [3,3,3,1] [1] [1,1] [2,2,2,0,1,2] [10,1,10,10,10]""" l, r = (0, len(nums) - 1) if nums[l] < nums[r] or len(nums) == 1: return nums[l] if len(nums) == 2: ret...
the_stack_v2_python_sparse
src/Find Minimum in Rotated Sorted Array II.py
jsdiuf/leetcode
train
1
89fda9895a6eca166b978d46ec7ff15cc158b24b
[ "self.shards = shards\nself.id_col = schema['id_col']\nself.dt_col = schema['dt_col']\nself.feature_col = schema['feature_col'].copy()\nself.target_col = schema['target_col'].copy()\nself.numpy_shards = None\nself._id_list = list(shards[self.id_col].unique())", "_check_type(shards, 'shards', SparkXShards)\ntarget...
<|body_start_0|> self.shards = shards self.id_col = schema['id_col'] self.dt_col = schema['dt_col'] self.feature_col = schema['feature_col'].copy() self.target_col = schema['target_col'].copy() self.numpy_shards = None self._id_list = list(shards[self.id_col].uniq...
XShardsTSDataset
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class XShardsTSDataset: def __init__(self, shards, **schema): """XShardTSDataset is an abstract of time series dataset with distributed fashion. Cascade call is supported for most of the transform methods. XShardTSDataset will partition the dataset by id_col, which is experimental.""" ...
stack_v2_sparse_classes_36k_train_008518
8,833
permissive
[ { "docstring": "XShardTSDataset is an abstract of time series dataset with distributed fashion. Cascade call is supported for most of the transform methods. XShardTSDataset will partition the dataset by id_col, which is experimental.", "name": "__init__", "signature": "def __init__(self, shards, **schem...
4
stack_v2_sparse_classes_30k_train_014263
Implement the Python class `XShardsTSDataset` described below. Class description: Implement the XShardsTSDataset class. Method signatures and docstrings: - def __init__(self, shards, **schema): XShardTSDataset is an abstract of time series dataset with distributed fashion. Cascade call is supported for most of the tr...
Implement the Python class `XShardsTSDataset` described below. Class description: Implement the XShardsTSDataset class. Method signatures and docstrings: - def __init__(self, shards, **schema): XShardTSDataset is an abstract of time series dataset with distributed fashion. Cascade call is supported for most of the tr...
7cc3e2849057d6429d03b1af0db13caae57960a5
<|skeleton|> class XShardsTSDataset: def __init__(self, shards, **schema): """XShardTSDataset is an abstract of time series dataset with distributed fashion. Cascade call is supported for most of the transform methods. XShardTSDataset will partition the dataset by id_col, which is experimental.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class XShardsTSDataset: def __init__(self, shards, **schema): """XShardTSDataset is an abstract of time series dataset with distributed fashion. Cascade call is supported for most of the transform methods. XShardTSDataset will partition the dataset by id_col, which is experimental.""" self.shards = ...
the_stack_v2_python_sparse
pyzoo/zoo/chronos/data/experimental/xshards_tsdataset.py
intel-analytics/analytics-zoo
train
3,104
8af36d333b5e6d20ca9350e733056ffe0f295f9d
[ "n = len(arr)\nfor i in range(n - 2):\n if all((j % 2 == 1 for j in arr[i:i + 3])):\n return True\nreturn False", "n = len(arr)\nfor i in range(n - 2):\n if arr[i] & 1 and arr[i + 1] & 1 and arr[i + 2] & 1:\n return True\nreturn False" ]
<|body_start_0|> n = len(arr) for i in range(n - 2): if all((j % 2 == 1 for j in arr[i:i + 3])): return True return False <|end_body_0|> <|body_start_1|> n = len(arr) for i in range(n - 2): if arr[i] & 1 and arr[i + 1] & 1 and arr[i + 2] &...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def threeConsecutiveOdds(self, arr): """:type arr: List[int] :rtype: bool""" <|body_0|> def threeConsecutiveOdds(self, arr): """:type arr: List[int] :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> n = len(arr) for i in...
stack_v2_sparse_classes_36k_train_008519
628
no_license
[ { "docstring": ":type arr: List[int] :rtype: bool", "name": "threeConsecutiveOdds", "signature": "def threeConsecutiveOdds(self, arr)" }, { "docstring": ":type arr: List[int] :rtype: bool", "name": "threeConsecutiveOdds", "signature": "def threeConsecutiveOdds(self, arr)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def threeConsecutiveOdds(self, arr): :type arr: List[int] :rtype: bool - def threeConsecutiveOdds(self, arr): :type arr: List[int] :rtype: bool
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def threeConsecutiveOdds(self, arr): :type arr: List[int] :rtype: bool - def threeConsecutiveOdds(self, arr): :type arr: List[int] :rtype: bool <|skeleton|> class Solution: ...
a509b383a42f54313970168d9faa11f088f18708
<|skeleton|> class Solution: def threeConsecutiveOdds(self, arr): """:type arr: List[int] :rtype: bool""" <|body_0|> def threeConsecutiveOdds(self, arr): """:type arr: List[int] :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def threeConsecutiveOdds(self, arr): """:type arr: List[int] :rtype: bool""" n = len(arr) for i in range(n - 2): if all((j % 2 == 1 for j in arr[i:i + 3])): return True return False def threeConsecutiveOdds(self, arr): """:type...
the_stack_v2_python_sparse
1550_Three_Consecutive_Odds.py
bingli8802/leetcode
train
0
61f61444cc0309097ced00faefc503d3a7bd51c2
[ "self.vehtype = vehtype\nself.speed = speed\nself.acce = acce\nself.weight = weight\nself.space = space\nself.datetime = datetime\nif lane == 1:\n self.x = 90\n self.y = 720\nelse:\n self.x = 960 - 90 - 345\n self.y = -100\nself.color = (255, 255, 255)", "self.str1 = u'车型: {0}轴车 时间: {1}'.format(self.v...
<|body_start_0|> self.vehtype = vehtype self.speed = speed self.acce = acce self.weight = weight self.space = space self.datetime = datetime if lane == 1: self.x = 90 self.y = 720 else: self.x = 960 - 90 - 345 ...
Veh class, each will print a veh's info
Veh
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Veh: """Veh class, each will print a veh's info""" def __init__(self, vehtype, speed, acce, lane, weight, space, datetime): """Init object A para's expamle: vehtype: 1 (int) speed: 65 (int) acce: 939 (int) lane: 1 (int) weight: (790, 770) (tuple of int) space: 2564 (int) datetime: (a...
stack_v2_sparse_classes_36k_train_008520
3,873
no_license
[ { "docstring": "Init object A para's expamle: vehtype: 1 (int) speed: 65 (int) acce: 939 (int) lane: 1 (int) weight: (790, 770) (tuple of int) space: 2564 (int) datetime: (a standard datetime object)", "name": "__init__", "signature": "def __init__(self, vehtype, speed, acce, lane, weight, space, dateti...
5
stack_v2_sparse_classes_30k_train_003698
Implement the Python class `Veh` described below. Class description: Veh class, each will print a veh's info Method signatures and docstrings: - def __init__(self, vehtype, speed, acce, lane, weight, space, datetime): Init object A para's expamle: vehtype: 1 (int) speed: 65 (int) acce: 939 (int) lane: 1 (int) weight:...
Implement the Python class `Veh` described below. Class description: Veh class, each will print a veh's info Method signatures and docstrings: - def __init__(self, vehtype, speed, acce, lane, weight, space, datetime): Init object A para's expamle: vehtype: 1 (int) speed: 65 (int) acce: 939 (int) lane: 1 (int) weight:...
038497eb9b2119769ecb85e023156eeff375d0e3
<|skeleton|> class Veh: """Veh class, each will print a veh's info""" def __init__(self, vehtype, speed, acce, lane, weight, space, datetime): """Init object A para's expamle: vehtype: 1 (int) speed: 65 (int) acce: 939 (int) lane: 1 (int) weight: (790, 770) (tuple of int) space: 2564 (int) datetime: (a...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Veh: """Veh class, each will print a veh's info""" def __init__(self, vehtype, speed, acce, lane, weight, space, datetime): """Init object A para's expamle: vehtype: 1 (int) speed: 65 (int) acce: 939 (int) lane: 1 (int) weight: (790, 770) (tuple of int) space: 2564 (int) datetime: (a standard dat...
the_stack_v2_python_sparse
Veh.py
MatheMatrix/realtimewatcher
train
1
b75166d9eb907de085925242fdeab40c0b0a4a8a
[ "super().__init__()\nself.feat_channels = feat_channels\nself.gate_channels = gate_channels\nself.int_channels = int_channels\nself.gate_conv = nn.Conv2d(gate_channels, int_channels, kernel_size=1, bias=False)\nself.gate_bn = nn.BatchNorm2d(int_channels)\nself.feat_conv = nn.Conv2d(feat_channels, int_channels, kern...
<|body_start_0|> super().__init__() self.feat_channels = feat_channels self.gate_channels = gate_channels self.int_channels = int_channels self.gate_conv = nn.Conv2d(gate_channels, int_channels, kernel_size=1, bias=False) self.gate_bn = nn.BatchNorm2d(int_channels) ...
Attention gate for (skip) connections. Produces the attention coefficient :math:`alpha`. See "Attention U-Net:Learning Where to Look for the Pancreas" https://arxiv.org/pdf/1804.03999.pdf
AttentionGate
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AttentionGate: """Attention gate for (skip) connections. Produces the attention coefficient :math:`alpha`. See "Attention U-Net:Learning Where to Look for the Pancreas" https://arxiv.org/pdf/1804.03999.pdf""" def __init__(self, gate_channels, feat_channels, int_channels): """Paramete...
stack_v2_sparse_classes_36k_train_008521
9,610
no_license
[ { "docstring": "Parameters ---------- gate_channels : int No. of feature-maps in gate vector. feat_channels : int No. of feature-maps in lower-level feature vector (e.g. skip connection). int_channels : int No. of intermediate channels for the attention module.", "name": "__init__", "signature": "def __...
2
stack_v2_sparse_classes_30k_train_019000
Implement the Python class `AttentionGate` described below. Class description: Attention gate for (skip) connections. Produces the attention coefficient :math:`alpha`. See "Attention U-Net:Learning Where to Look for the Pancreas" https://arxiv.org/pdf/1804.03999.pdf Method signatures and docstrings: - def __init__(se...
Implement the Python class `AttentionGate` described below. Class description: Attention gate for (skip) connections. Produces the attention coefficient :math:`alpha`. See "Attention U-Net:Learning Where to Look for the Pancreas" https://arxiv.org/pdf/1804.03999.pdf Method signatures and docstrings: - def __init__(se...
6fe259cd15ca31b4a238f700d3993b48e44a73fe
<|skeleton|> class AttentionGate: """Attention gate for (skip) connections. Produces the attention coefficient :math:`alpha`. See "Attention U-Net:Learning Where to Look for the Pancreas" https://arxiv.org/pdf/1804.03999.pdf""" def __init__(self, gate_channels, feat_channels, int_channels): """Paramete...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AttentionGate: """Attention gate for (skip) connections. Produces the attention coefficient :math:`alpha`. See "Attention U-Net:Learning Where to Look for the Pancreas" https://arxiv.org/pdf/1804.03999.pdf""" def __init__(self, gate_channels, feat_channels, int_channels): """Parameters ----------...
the_stack_v2_python_sparse
nets/unet.py
medical-projects/dlmi-project
train
0
679c21bc3ef9abc4d2078782b050e4be1419fabe
[ "self.seq = []\nself.count = []\ni = 0\nwhile i < len(A):\n self.seq.append(A[i + 1])\n self.count.append(A[i])\n i += 2", "while len(self.count) > 0 and self.count[0] < n:\n self.seq.pop(0)\n count = self.count.pop(0)\n n -= count\nif len(self.count) == 0:\n return -1\nif self.count[0] == n:...
<|body_start_0|> self.seq = [] self.count = [] i = 0 while i < len(A): self.seq.append(A[i + 1]) self.count.append(A[i]) i += 2 <|end_body_0|> <|body_start_1|> while len(self.count) > 0 and self.count[0] < n: self.seq.pop(0) ...
RLEIterator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RLEIterator: def __init__(self, A): """:type A: List[int]""" <|body_0|> def next(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.seq = [] self.count = [] i = 0 while i < len(A): ...
stack_v2_sparse_classes_36k_train_008522
3,178
no_license
[ { "docstring": ":type A: List[int]", "name": "__init__", "signature": "def __init__(self, A)" }, { "docstring": ":type n: int :rtype: int", "name": "next", "signature": "def next(self, n)" } ]
2
null
Implement the Python class `RLEIterator` described below. Class description: Implement the RLEIterator class. Method signatures and docstrings: - def __init__(self, A): :type A: List[int] - def next(self, n): :type n: int :rtype: int
Implement the Python class `RLEIterator` described below. Class description: Implement the RLEIterator class. Method signatures and docstrings: - def __init__(self, A): :type A: List[int] - def next(self, n): :type n: int :rtype: int <|skeleton|> class RLEIterator: def __init__(self, A): """:type A: Lis...
7a459e9742958e63be8886874904e5ab2489411a
<|skeleton|> class RLEIterator: def __init__(self, A): """:type A: List[int]""" <|body_0|> def next(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RLEIterator: def __init__(self, A): """:type A: List[int]""" self.seq = [] self.count = [] i = 0 while i < len(A): self.seq.append(A[i + 1]) self.count.append(A[i]) i += 2 def next(self, n): """:type n: int :rtype: int"""...
the_stack_v2_python_sparse
Medium/900.py
Hellofafar/Leetcode
train
6
403be96503a385caaa78bd3a4ca276ca7332e01d
[ "self.name = kwargs.get('name')\nself.active = kwargs.get('active', True)\nself.created_by = kwargs.get('created_by')\nself.updated_by = kwargs.get('updated_by')", "db.session.add(self)\nif commit is True:\n db.session.commit()", "self.permissions.append(permission)\ndb.session.add(self)\nif commit is True:\...
<|body_start_0|> self.name = kwargs.get('name') self.active = kwargs.get('active', True) self.created_by = kwargs.get('created_by') self.updated_by = kwargs.get('updated_by') <|end_body_0|> <|body_start_1|> db.session.add(self) if commit is True: db.session.c...
Description for role model
Role
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Role: """Description for role model""" def __init__(self, **kwargs): """Initialization for role model""" <|body_0|> def save(self, commit=True): """Save data for role model""" <|body_1|> def save_role_permission(self, permission, commit=True): ...
stack_v2_sparse_classes_36k_train_008523
4,260
no_license
[ { "docstring": "Initialization for role model", "name": "__init__", "signature": "def __init__(self, **kwargs)" }, { "docstring": "Save data for role model", "name": "save", "signature": "def save(self, commit=True)" }, { "docstring": "Relationship between role and permission", ...
5
stack_v2_sparse_classes_30k_train_008131
Implement the Python class `Role` described below. Class description: Description for role model Method signatures and docstrings: - def __init__(self, **kwargs): Initialization for role model - def save(self, commit=True): Save data for role model - def save_role_permission(self, permission, commit=True): Relationsh...
Implement the Python class `Role` described below. Class description: Description for role model Method signatures and docstrings: - def __init__(self, **kwargs): Initialization for role model - def save(self, commit=True): Save data for role model - def save_role_permission(self, permission, commit=True): Relationsh...
4dc5f5e816e3c461b8a60c5f61c7eafc08050579
<|skeleton|> class Role: """Description for role model""" def __init__(self, **kwargs): """Initialization for role model""" <|body_0|> def save(self, commit=True): """Save data for role model""" <|body_1|> def save_role_permission(self, permission, commit=True): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Role: """Description for role model""" def __init__(self, **kwargs): """Initialization for role model""" self.name = kwargs.get('name') self.active = kwargs.get('active', True) self.created_by = kwargs.get('created_by') self.updated_by = kwargs.get('updated_by') ...
the_stack_v2_python_sparse
app/models/role.py
ekramulmostafa/ms-auth
train
0
0659a6fb0933cb63584222011d3e7ee28f055f2f
[ "self._GC_TAG = 'GC'\nself._WORKFLOW_TAG = 'WORKFLOW'\nif not ctx or not hasattr(ctx, self._GC_TAG):\n self.ctx = DataContext(None, self._GC_TAG)\n self.ctx.update_context(None, self._WORKFLOW_TAG)\nself.wf_context = getattr(self.ctx, self._WORKFLOW_TAG)\nself.gc_context = getattr(self.ctx, self._GC_TAG)", ...
<|body_start_0|> self._GC_TAG = 'GC' self._WORKFLOW_TAG = 'WORKFLOW' if not ctx or not hasattr(ctx, self._GC_TAG): self.ctx = DataContext(None, self._GC_TAG) self.ctx.update_context(None, self._WORKFLOW_TAG) self.wf_context = getattr(self.ctx, self._WORKFLOW_TAG) ...
In this class we are defining all procedures that can be commonly used for all services
BaseWorkflowRunSaltStateNVerify
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseWorkflowRunSaltStateNVerify: """In this class we are defining all procedures that can be commonly used for all services""" def __init__(self, ctx=None): """Step 1: Create variables for both global and local yaml files to store data Step 2: Passes the variables names to DataContex...
stack_v2_sparse_classes_36k_train_008524
2,236
no_license
[ { "docstring": "Step 1: Create variables for both global and local yaml files to store data Step 2: Passes the variables names to DataContext process to assign values Args: :param ctx:", "name": "__init__", "signature": "def __init__(self, ctx=None)" }, { "docstring": "Description: At the end of...
3
null
Implement the Python class `BaseWorkflowRunSaltStateNVerify` described below. Class description: In this class we are defining all procedures that can be commonly used for all services Method signatures and docstrings: - def __init__(self, ctx=None): Step 1: Create variables for both global and local yaml files to st...
Implement the Python class `BaseWorkflowRunSaltStateNVerify` described below. Class description: In this class we are defining all procedures that can be commonly used for all services Method signatures and docstrings: - def __init__(self, ctx=None): Step 1: Create variables for both global and local yaml files to st...
93dd6d14ae4b0856aa7c6f059904cc1f13800e5f
<|skeleton|> class BaseWorkflowRunSaltStateNVerify: """In this class we are defining all procedures that can be commonly used for all services""" def __init__(self, ctx=None): """Step 1: Create variables for both global and local yaml files to store data Step 2: Passes the variables names to DataContex...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseWorkflowRunSaltStateNVerify: """In this class we are defining all procedures that can be commonly used for all services""" def __init__(self, ctx=None): """Step 1: Create variables for both global and local yaml files to store data Step 2: Passes the variables names to DataContext process to ...
the_stack_v2_python_sparse
automation_framework/workflow/baseworkflow_run_salt_state_n_verify.py
vijaymaddukuri/python_repo
train
0
18f251e5f82ae248088262ae8e08940622db4918
[ "self.spi = spi\nself.cs_pin = cs_pin\nself.buf4 = bytearray(4)", "try:\n retry = 0\n while True:\n retry += 1\n self.cs_pin.value(0)\n try:\n self.spi.readinto(self.buf4)\n except:\n pass\n self.cs_pin.value(1)\n val = self.buf4[0] << 8 | self...
<|body_start_0|> self.spi = spi self.cs_pin = cs_pin self.buf4 = bytearray(4) <|end_body_0|> <|body_start_1|> try: retry = 0 while True: retry += 1 self.cs_pin.value(0) try: self.spi.readinto(sel...
Read the data from MAX31855 thermocouple amplifier
MAX31855
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MAX31855: """Read the data from MAX31855 thermocouple amplifier""" def __init__(self, spi, cs_pin): """constructor. :param spi: must be initialized (in SPI in mode0 -> polarity=0, phase=0) and baudrate=5000000 :param cs_pin: output pin for SPI transaction. Must be initialized HIGH. :...
stack_v2_sparse_classes_36k_train_008525
2,358
no_license
[ { "docstring": "constructor. :param spi: must be initialized (in SPI in mode0 -> polarity=0, phase=0) and baudrate=5000000 :param cs_pin: output pin for SPI transaction. Must be initialized HIGH. :param mclk freq: freq of the source clock (eg: 25000000 for 25 Mhz).", "name": "__init__", "signature": "de...
2
null
Implement the Python class `MAX31855` described below. Class description: Read the data from MAX31855 thermocouple amplifier Method signatures and docstrings: - def __init__(self, spi, cs_pin): constructor. :param spi: must be initialized (in SPI in mode0 -> polarity=0, phase=0) and baudrate=5000000 :param cs_pin: ou...
Implement the Python class `MAX31855` described below. Class description: Read the data from MAX31855 thermocouple amplifier Method signatures and docstrings: - def __init__(self, spi, cs_pin): constructor. :param spi: must be initialized (in SPI in mode0 -> polarity=0, phase=0) and baudrate=5000000 :param cs_pin: ou...
75184da49e8578315a26bc42d9c3816ae5d5afe8
<|skeleton|> class MAX31855: """Read the data from MAX31855 thermocouple amplifier""" def __init__(self, spi, cs_pin): """constructor. :param spi: must be initialized (in SPI in mode0 -> polarity=0, phase=0) and baudrate=5000000 :param cs_pin: output pin for SPI transaction. Must be initialized HIGH. :...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MAX31855: """Read the data from MAX31855 thermocouple amplifier""" def __init__(self, spi, cs_pin): """constructor. :param spi: must be initialized (in SPI in mode0 -> polarity=0, phase=0) and baudrate=5000000 :param cs_pin: output pin for SPI transaction. Must be initialized HIGH. :param mclk fr...
the_stack_v2_python_sparse
max31855/lib/max31855.py
mchobby/esp8266-upy
train
47
20e621f8f2aff42e89d3868eb5afcdaa5f840ebd
[ "if not email:\n raise ValueError('Users must have an email address')\nuser = self.model(email=self.normalize_email(email), name=name, avatar=kwargs.get('avatar'))\nuser.set_password(password)\nuser.save(using=self._db)\nreturn user", "user = self.create_user(email, password=password, name=name)\nuser.is_admin...
<|body_start_0|> if not email: raise ValueError('Users must have an email address') user = self.model(email=self.normalize_email(email), name=name, avatar=kwargs.get('avatar')) user.set_password(password) user.save(using=self._db) return user <|end_body_0|> <|body_st...
这里是管网处复制修改的
MyUserManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyUserManager: """这里是管网处复制修改的""" def create_user(self, email, name, password=None, **kwargs): """Creates and saves a User with the given email, date of birth and password.""" <|body_0|> def create_superuser(self, email, name, password): """Creates and saves a sup...
stack_v2_sparse_classes_36k_train_008526
5,562
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, name, password=None, **kwargs)" }, { "docstring": "Creates and saves a superuser with the given email, date of birth and password.", ...
2
stack_v2_sparse_classes_30k_train_003218
Implement the Python class `MyUserManager` described below. Class description: 这里是管网处复制修改的 Method signatures and docstrings: - def create_user(self, email, name, password=None, **kwargs): Creates and saves a User with the given email, date of birth and password. - def create_superuser(self, email, name, password): Cr...
Implement the Python class `MyUserManager` described below. Class description: 这里是管网处复制修改的 Method signatures and docstrings: - def create_user(self, email, name, password=None, **kwargs): Creates and saves a User with the given email, date of birth and password. - def create_superuser(self, email, name, password): Cr...
8017a63631b994e67d3aaa342a7ea6e60fe6fe9c
<|skeleton|> class MyUserManager: """这里是管网处复制修改的""" def create_user(self, email, name, password=None, **kwargs): """Creates and saves a User with the given email, date of birth and password.""" <|body_0|> def create_superuser(self, email, name, password): """Creates and saves a sup...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MyUserManager: """这里是管网处复制修改的""" def create_user(self, email, name, password=None, **kwargs): """Creates and saves a User with the given email, date of birth and password.""" if not email: raise ValueError('Users must have an email address') user = self.model(email=sel...
the_stack_v2_python_sparse
CMDB/web/models.py
Mrs-wang1/python-test
train
0
58d8c2271fb423f8309143ccf3d44b10f145e02b
[ "print(data)\nmin_date = timezone.now() + timedelta(minutes=10)\nif data <= min_date:\n raise serializers.ValidationError('Departure time must be at least pass the next 20 minutes window')\nreturn data", "if self.context['request'].user != data['offered_by']:\n raise serializer.ValidationError('Ride offered...
<|body_start_0|> print(data) min_date = timezone.now() + timedelta(minutes=10) if data <= min_date: raise serializers.ValidationError('Departure time must be at least pass the next 20 minutes window') return data <|end_body_0|> <|body_start_1|> if self.context['reque...
Create ride serializer
CreateRideSerialier
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CreateRideSerialier: """Create ride serializer""" def validate_departure_date(self, data): """Verify date is not in the past""" <|body_0|> def validate(self, data): """Validate Verify that the person who offers the ride is member and also the same user making the...
stack_v2_sparse_classes_36k_train_008527
7,953
no_license
[ { "docstring": "Verify date is not in the past", "name": "validate_departure_date", "signature": "def validate_departure_date(self, data)" }, { "docstring": "Validate Verify that the person who offers the ride is member and also the same user making the request", "name": "validate", "sig...
3
stack_v2_sparse_classes_30k_train_008124
Implement the Python class `CreateRideSerialier` described below. Class description: Create ride serializer Method signatures and docstrings: - def validate_departure_date(self, data): Verify date is not in the past - def validate(self, data): Validate Verify that the person who offers the ride is member and also the...
Implement the Python class `CreateRideSerialier` described below. Class description: Create ride serializer Method signatures and docstrings: - def validate_departure_date(self, data): Verify date is not in the past - def validate(self, data): Validate Verify that the person who offers the ride is member and also the...
0cede53169041667bd40bbce3c4774af84ffc2fa
<|skeleton|> class CreateRideSerialier: """Create ride serializer""" def validate_departure_date(self, data): """Verify date is not in the past""" <|body_0|> def validate(self, data): """Validate Verify that the person who offers the ride is member and also the same user making the...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CreateRideSerialier: """Create ride serializer""" def validate_departure_date(self, data): """Verify date is not in the past""" print(data) min_date = timezone.now() + timedelta(minutes=10) if data <= min_date: raise serializers.ValidationError('Departure time ...
the_stack_v2_python_sparse
rides/serializers/rides.py
KrystellCR/DjangoRF
train
0
984d4a8105560eb8aef5cd6f922c3c2ac02e3dea
[ "self.funcs = funcs\nself.argmax = argmax\nself.maxval = maxval\nself.argmin = argmin\nself.minval = minval\nexperiment_caller = self._get_experiment_caller()\nsuper(MultiFunctionCaller, self).__init__(experiment_caller, domain, descr, *args, noise_type=noise_type, noise_scale=noise_scale, fidel_space=fidel_space, ...
<|body_start_0|> self.funcs = funcs self.argmax = argmax self.maxval = maxval self.argmin = argmin self.minval = minval experiment_caller = self._get_experiment_caller() super(MultiFunctionCaller, self).__init__(experiment_caller, domain, descr, *args, noise_type=...
An Experiment Caller specifically for evaluating a collection of functions.
MultiFunctionCaller
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiFunctionCaller: """An Experiment Caller specifically for evaluating a collection of functions.""" def __init__(self, funcs, domain, descr='', argmax=None, maxval=None, argmin=None, minval=None, noise_type='no_noise', noise_scale=None, fidel_space=None, fidel_cost_func=None, fidel_to_opt...
stack_v2_sparse_classes_36k_train_008528
28,947
permissive
[ { "docstring": "Constructor.", "name": "__init__", "signature": "def __init__(self, funcs, domain, descr='', argmax=None, maxval=None, argmin=None, minval=None, noise_type='no_noise', noise_scale=None, fidel_space=None, fidel_cost_func=None, fidel_to_opt=None, *args, **kwargs)" }, { "docstring":...
4
stack_v2_sparse_classes_30k_train_021224
Implement the Python class `MultiFunctionCaller` described below. Class description: An Experiment Caller specifically for evaluating a collection of functions. Method signatures and docstrings: - def __init__(self, funcs, domain, descr='', argmax=None, maxval=None, argmin=None, minval=None, noise_type='no_noise', no...
Implement the Python class `MultiFunctionCaller` described below. Class description: An Experiment Caller specifically for evaluating a collection of functions. Method signatures and docstrings: - def __init__(self, funcs, domain, descr='', argmax=None, maxval=None, argmin=None, minval=None, noise_type='no_noise', no...
3eef7d30bcc2e56f2221a624bd8ec7f933f81e40
<|skeleton|> class MultiFunctionCaller: """An Experiment Caller specifically for evaluating a collection of functions.""" def __init__(self, funcs, domain, descr='', argmax=None, maxval=None, argmin=None, minval=None, noise_type='no_noise', noise_scale=None, fidel_space=None, fidel_cost_func=None, fidel_to_opt...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MultiFunctionCaller: """An Experiment Caller specifically for evaluating a collection of functions.""" def __init__(self, funcs, domain, descr='', argmax=None, maxval=None, argmin=None, minval=None, noise_type='no_noise', noise_scale=None, fidel_space=None, fidel_cost_func=None, fidel_to_opt=None, *args,...
the_stack_v2_python_sparse
dragonfly/exd/experiment_caller.py
dragonfly/dragonfly
train
868
e72364f2b5e48f2fbe13ad14984cce83583f5013
[ "\"\"\" use a `default dictionary` to map each node to its child nodes.\n https://docs.python.org/3/library/collections.html#collections.defaultdict\n\n defaulting to a `list` makes it easier to iterate over\n child nodes in later stages of the algorithm\n \"\"\"\nroutes = co...
<|body_start_0|> """ use a `default dictionary` to map each node to its child nodes. https://docs.python.org/3/library/collections.html#collections.defaultdict defaulting to a `list` makes it easier to iterate over child nodes in later stages of the a...
BinaryTree
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BinaryTree: def minTimeTree(self, n: int, edges: List[List[int]], hasApple: List[bool]) -> int: """below solution assumes a specific order of the nodes --> [parent, child]. it fails when a node is represented as [child, parent].""" <|body_0|> def minTimeGraph(self, n: int, e...
stack_v2_sparse_classes_36k_train_008529
3,051
permissive
[ { "docstring": "below solution assumes a specific order of the nodes --> [parent, child]. it fails when a node is represented as [child, parent].", "name": "minTimeTree", "signature": "def minTimeTree(self, n: int, edges: List[List[int]], hasApple: List[bool]) -> int" }, { "docstring": "works fo...
2
null
Implement the Python class `BinaryTree` described below. Class description: Implement the BinaryTree class. Method signatures and docstrings: - def minTimeTree(self, n: int, edges: List[List[int]], hasApple: List[bool]) -> int: below solution assumes a specific order of the nodes --> [parent, child]. it fails when a ...
Implement the Python class `BinaryTree` described below. Class description: Implement the BinaryTree class. Method signatures and docstrings: - def minTimeTree(self, n: int, edges: List[List[int]], hasApple: List[bool]) -> int: below solution assumes a specific order of the nodes --> [parent, child]. it fails when a ...
14356c6adb1946417482eaaf6f42dde4b8351d2f
<|skeleton|> class BinaryTree: def minTimeTree(self, n: int, edges: List[List[int]], hasApple: List[bool]) -> int: """below solution assumes a specific order of the nodes --> [parent, child]. it fails when a node is represented as [child, parent].""" <|body_0|> def minTimeGraph(self, n: int, e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BinaryTree: def minTimeTree(self, n: int, edges: List[List[int]], hasApple: List[bool]) -> int: """below solution assumes a specific order of the nodes --> [parent, child]. it fails when a node is represented as [child, parent].""" """ use a `default dictionary` to map each node to its child n...
the_stack_v2_python_sparse
binary_tree/m_min_time_apple.py
dhrubach/python-code-recipes
train
1
84b9a5c876ad3590cd4cb6e91908d2c2655861d5
[ "self.printTag = 'MOOSE_PARSER'\nself.inputFile = inputFile\nself.roots = self.loadInput(inputFile)", "if not os.path.exists(inputFile):\n raise IOError('MOOSE input file not found: \"{}\"'.format(inputFile))\nwith open(inputFile, 'r') as f:\n roots = MooseInputParser.getpotToInputTree(f)\nreturn roots", ...
<|body_start_0|> self.printTag = 'MOOSE_PARSER' self.inputFile = inputFile self.roots = self.loadInput(inputFile) <|end_body_0|> <|body_start_1|> if not os.path.exists(inputFile): raise IOError('MOOSE input file not found: "{}"'.format(inputFile)) with open(inputFile...
Import the MOOSE input as xml tree, provide methods to add/change entries and print it back
MOOSEparser
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "BSD-2-Clause", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MOOSEparser: """Import the MOOSE input as xml tree, provide methods to add/change entries and print it back""" def __init__(self, inputFile): """Constructor @ In, inputFile, string, input file name @ Out, None""" <|body_0|> def loadInput(self, inputFile): """Read...
stack_v2_sparse_classes_36k_train_008530
5,231
permissive
[ { "docstring": "Constructor @ In, inputFile, string, input file name @ Out, None", "name": "__init__", "signature": "def __init__(self, inputFile)" }, { "docstring": "Reads the input to class members. @ In, inputFile, string, name of input file @ Out, roots, list, root nodes of input file as uti...
6
null
Implement the Python class `MOOSEparser` described below. Class description: Import the MOOSE input as xml tree, provide methods to add/change entries and print it back Method signatures and docstrings: - def __init__(self, inputFile): Constructor @ In, inputFile, string, input file name @ Out, None - def loadInput(s...
Implement the Python class `MOOSEparser` described below. Class description: Import the MOOSE input as xml tree, provide methods to add/change entries and print it back Method signatures and docstrings: - def __init__(self, inputFile): Constructor @ In, inputFile, string, input file name @ Out, None - def loadInput(s...
2b16e7aa3325fe84cab2477947a951414c635381
<|skeleton|> class MOOSEparser: """Import the MOOSE input as xml tree, provide methods to add/change entries and print it back""" def __init__(self, inputFile): """Constructor @ In, inputFile, string, input file name @ Out, None""" <|body_0|> def loadInput(self, inputFile): """Read...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MOOSEparser: """Import the MOOSE input as xml tree, provide methods to add/change entries and print it back""" def __init__(self, inputFile): """Constructor @ In, inputFile, string, input file name @ Out, None""" self.printTag = 'MOOSE_PARSER' self.inputFile = inputFile se...
the_stack_v2_python_sparse
ravenframework/CodeInterfaceClasses/MooseBasedApp/MOOSEparser.py
idaholab/raven
train
201
75b58288cdf1656448282d23ab7466480cd104a9
[ "super().__init__()\nself.x = x\nself.y = y\nself.width = width\nself.height = height\nassert self.x >= 0\nassert self.y >= 0\nassert self.width > 0\nassert self.height > 0", "if len(inputs.shape) >= 4:\n return inputs[:, self.y:self.y + self.height, self.x:self.x + self.width]\nelse:\n return inputs[self.y...
<|body_start_0|> super().__init__() self.x = x self.y = y self.width = width self.height = height assert self.x >= 0 assert self.y >= 0 assert self.width > 0 assert self.height > 0 <|end_body_0|> <|body_start_1|> if len(inputs.shape) >= 4:...
Crops one or more images to a new size without touching the color channel.
ImageCrop
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageCrop: """Crops one or more images to a new size without touching the color channel.""" def __init__(self, x=0, y=0, width=0, height=0): """Args: x (int): Start x coordinate. y (int): Start y coordinate. width (int): Width of resulting image. height (int): Height of resulting ima...
stack_v2_sparse_classes_36k_train_008531
1,949
permissive
[ { "docstring": "Args: x (int): Start x coordinate. y (int): Start y coordinate. width (int): Width of resulting image. height (int): Height of resulting image.", "name": "__init__", "signature": "def __init__(self, x=0, y=0, width=0, height=0)" }, { "docstring": "Images come in with either a bat...
2
stack_v2_sparse_classes_30k_train_009246
Implement the Python class `ImageCrop` described below. Class description: Crops one or more images to a new size without touching the color channel. Method signatures and docstrings: - def __init__(self, x=0, y=0, width=0, height=0): Args: x (int): Start x coordinate. y (int): Start y coordinate. width (int): Width ...
Implement the Python class `ImageCrop` described below. Class description: Crops one or more images to a new size without touching the color channel. Method signatures and docstrings: - def __init__(self, x=0, y=0, width=0, height=0): Args: x (int): Start x coordinate. y (int): Start y coordinate. width (int): Width ...
8abfb18538340d50146c9c44f5ecb8a1e7d89ac3
<|skeleton|> class ImageCrop: """Crops one or more images to a new size without touching the color channel.""" def __init__(self, x=0, y=0, width=0, height=0): """Args: x (int): Start x coordinate. y (int): Start y coordinate. width (int): Width of resulting image. height (int): Height of resulting ima...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImageCrop: """Crops one or more images to a new size without touching the color channel.""" def __init__(self, x=0, y=0, width=0, height=0): """Args: x (int): Start x coordinate. y (int): Start y coordinate. width (int): Width of resulting image. height (int): Height of resulting image.""" ...
the_stack_v2_python_sparse
surreal/components/preprocessors/image_crop.py
ducandu/surreal
train
6
7ff8e097472b962a5b4b417aadf93881b30ef9eb
[ "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.
DropboxStorageServiceServicer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DropboxStorageServiceServicer: """Missing associated documentation comment in .proto file.""" def listDropboxStorage(self, request, context): """Storage""" <|body_0|> def getDropboxStorage(self, request, context): """Missing associated documentation comment in .p...
stack_v2_sparse_classes_36k_train_008532
10,219
permissive
[ { "docstring": "Storage", "name": "listDropboxStorage", "signature": "def listDropboxStorage(self, request, context)" }, { "docstring": "Missing associated documentation comment in .proto file.", "name": "getDropboxStorage", "signature": "def getDropboxStorage(self, request, context)" ...
5
stack_v2_sparse_classes_30k_train_001588
Implement the Python class `DropboxStorageServiceServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def listDropboxStorage(self, request, context): Storage - def getDropboxStorage(self, request, context): Missing associated docume...
Implement the Python class `DropboxStorageServiceServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def listDropboxStorage(self, request, context): Storage - def getDropboxStorage(self, request, context): Missing associated docume...
c69e14b409add099d151434b9add711e41f41b20
<|skeleton|> class DropboxStorageServiceServicer: """Missing associated documentation comment in .proto file.""" def listDropboxStorage(self, request, context): """Storage""" <|body_0|> def getDropboxStorage(self, request, context): """Missing associated documentation comment in .p...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DropboxStorageServiceServicer: """Missing associated documentation comment in .proto file.""" def listDropboxStorage(self, request, context): """Storage""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedEr...
the_stack_v2_python_sparse
python-sdk/src/airavata_mft_sdk/dropbox/DropboxStorageService_pb2_grpc.py
apache/airavata-mft
train
23
18d146c8b8dbbf07705a148a40d56ea3cff14151
[ "dic = {}\ntimes = len(nums) // 2\nprint('times:', times)\nfor index, item in enumerate(nums):\n if item in dic:\n dic[item] += 1\n if dic[item] > times:\n return item\n else:\n dic[item] = 1\nprint(dic)\nreturn max(dic, key=dic.get)", "if not nums:\n return None\nif len(n...
<|body_start_0|> dic = {} times = len(nums) // 2 print('times:', times) for index, item in enumerate(nums): if item in dic: dic[item] += 1 if dic[item] > times: return item else: dic[item] = 1 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def majorityElement(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def majorityElement2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> dic = {} times = len(nums) /...
stack_v2_sparse_classes_36k_train_008533
1,379
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "majorityElement", "signature": "def majorityElement(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "majorityElement2", "signature": "def majorityElement2(self, nums)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def majorityElement(self, nums): :type nums: List[int] :rtype: int - def majorityElement2(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 majorityElement(self, nums): :type nums: List[int] :rtype: int - def majorityElement2(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: def ma...
6be4e77f659e80c853e58dceec88990c4065f9de
<|skeleton|> class Solution: def majorityElement(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def majorityElement2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def majorityElement(self, nums): """:type nums: List[int] :rtype: int""" dic = {} times = len(nums) // 2 print('times:', times) for index, item in enumerate(nums): if item in dic: dic[item] += 1 if dic[item] > times:...
the_stack_v2_python_sparse
169_Majority_Element.py
Lobo2008/LeetCode
train
0
0cc31e4d001e8ca87d2950a65047dce6fef1ac7a
[ "label_map = LabelMap.create_label_map(app_path, train_pattern)\nresource_loader = ResourceLoader.create_resource_loader(app_path)\ntrain_query_list = resource_loader.get_flattened_label_set(label_set=train_pattern)\nif TuneLevel.ENTITY.value in tuning_level:\n label_map.entity2id = LabelMap._get_entity_mappings...
<|body_start_0|> label_map = LabelMap.create_label_map(app_path, train_pattern) resource_loader = ResourceLoader.create_resource_loader(app_path) train_query_list = resource_loader.get_flattened_label_set(label_set=train_pattern) if TuneLevel.ENTITY.value in tuning_level: lab...
Class to generate the initial data for experimentation. (Seed Queries, Remaining Queries, and Test Queries). Handles initial sampling and data split based on configuation details.
DataBucketFactory
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DataBucketFactory: """Class to generate the initial data for experimentation. (Seed Queries, Remaining Queries, and Test Queries). Handles initial sampling and data split based on configuation details.""" def get_data_bucket_for_strategy_tuning(app_path: str, tuning_level: list, train_patter...
stack_v2_sparse_classes_36k_train_008534
20,702
permissive
[ { "docstring": "Creates a DataBucket to be used for strategy tuning. Args: app_path (str): Path to MindMeld application tuning_level (list): The hierarchy levels to tune (\"domain\", \"intent\" or \"entity\") train_pattern (str): Regex pattern to match train files. (\".*train.*.txt\") test_pattern (str): Regex ...
2
stack_v2_sparse_classes_30k_train_005173
Implement the Python class `DataBucketFactory` described below. Class description: Class to generate the initial data for experimentation. (Seed Queries, Remaining Queries, and Test Queries). Handles initial sampling and data split based on configuation details. Method signatures and docstrings: - def get_data_bucket...
Implement the Python class `DataBucketFactory` described below. Class description: Class to generate the initial data for experimentation. (Seed Queries, Remaining Queries, and Test Queries). Handles initial sampling and data split based on configuation details. Method signatures and docstrings: - def get_data_bucket...
bd3547d5c1bd092dbd4a64a90528dfc2e2b3844a
<|skeleton|> class DataBucketFactory: """Class to generate the initial data for experimentation. (Seed Queries, Remaining Queries, and Test Queries). Handles initial sampling and data split based on configuation details.""" def get_data_bucket_for_strategy_tuning(app_path: str, tuning_level: list, train_patter...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DataBucketFactory: """Class to generate the initial data for experimentation. (Seed Queries, Remaining Queries, and Test Queries). Handles initial sampling and data split based on configuation details.""" def get_data_bucket_for_strategy_tuning(app_path: str, tuning_level: list, train_pattern: str, test_...
the_stack_v2_python_sparse
mindmeld/active_learning/data_loading.py
cisco/mindmeld
train
671
78972ff408306570ac5e4a6af7fa578c5d420361
[ "batch_size = 100\npred_illum_rgb = np.random.rand(batch_size, 3)\ntrue_illum_rgb = np.random.rand(batch_size, 3)\nexpected_angle = 180.0 / math.pi * np.arccos(np.sum(_normalized(true_illum_rgb / pred_illum_rgb) * _normalized(np.ones(shape=(1, 3))), axis=1))\nself.assertAllClose(losses.reproduction_error(tf.constan...
<|body_start_0|> batch_size = 100 pred_illum_rgb = np.random.rand(batch_size, 3) true_illum_rgb = np.random.rand(batch_size, 3) expected_angle = 180.0 / math.pi * np.arccos(np.sum(_normalized(true_illum_rgb / pred_illum_rgb) * _normalized(np.ones(shape=(1, 3))), axis=1)) self.ass...
Tests losses.reproduction_error.
ReproductionErrorTest
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReproductionErrorTest: """Tests losses.reproduction_error.""" def testAgainstRefImpl(self): """Tests against reference implementation.""" <|body_0|> def testWhiteIlluminant(self): """Tests against white (neutral gray) illuminants.""" <|body_1|> def t...
stack_v2_sparse_classes_36k_train_008535
17,094
permissive
[ { "docstring": "Tests against reference implementation.", "name": "testAgainstRefImpl", "signature": "def testAgainstRefImpl(self)" }, { "docstring": "Tests against white (neutral gray) illuminants.", "name": "testWhiteIlluminant", "signature": "def testWhiteIlluminant(self)" }, { ...
3
stack_v2_sparse_classes_30k_train_021067
Implement the Python class `ReproductionErrorTest` described below. Class description: Tests losses.reproduction_error. Method signatures and docstrings: - def testAgainstRefImpl(self): Tests against reference implementation. - def testWhiteIlluminant(self): Tests against white (neutral gray) illuminants. - def testT...
Implement the Python class `ReproductionErrorTest` described below. Class description: Tests losses.reproduction_error. Method signatures and docstrings: - def testAgainstRefImpl(self): Tests against reference implementation. - def testWhiteIlluminant(self): Tests against white (neutral gray) illuminants. - def testT...
c52b225082327ea34bed80357dbff004fc9926ba
<|skeleton|> class ReproductionErrorTest: """Tests losses.reproduction_error.""" def testAgainstRefImpl(self): """Tests against reference implementation.""" <|body_0|> def testWhiteIlluminant(self): """Tests against white (neutral gray) illuminants.""" <|body_1|> def t...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ReproductionErrorTest: """Tests losses.reproduction_error.""" def testAgainstRefImpl(self): """Tests against reference implementation.""" batch_size = 100 pred_illum_rgb = np.random.rand(batch_size, 3) true_illum_rgb = np.random.rand(batch_size, 3) expected_angle =...
the_stack_v2_python_sparse
python/losses_test.py
mahmoudnafifi/ffcc
train
1
1ecba3b803f18e740eb13291702c6f5237f01ab5
[ "super().__init__(name=name, verbose=verbose)\nassert 0 <= clip_fraction <= 1\nself.levels_path = levels_path\nself.mip = int(mip)\nself.clip_fraction = float(clip_fraction)\nself.minval = minval\nself.maxval = maxval", "assert chunk.ndim == 3\nimage = np.transpose(chunk).astype(np.float32)\noffset = Vec(*chunk.g...
<|body_start_0|> super().__init__(name=name, verbose=verbose) assert 0 <= clip_fraction <= 1 self.levels_path = levels_path self.mip = int(mip) self.clip_fraction = float(clip_fraction) self.minval = minval self.maxval = maxval <|end_body_0|> <|body_start_1|> ...
Contrast Correction based on LuminanceLevelsTask output. Note that this operator was modified from Will's ContrastNormalizationTask in igneous: https://github.com/seung-lab/igneous/blob/master/igneous/tasks.py#L735
NormalizeSectionContrastOperator
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NormalizeSectionContrastOperator: """Contrast Correction based on LuminanceLevelsTask output. Note that this operator was modified from Will's ContrastNormalizationTask in igneous: https://github.com/seung-lab/igneous/blob/master/igneous/tasks.py#L735""" def __init__(self, levels_path: str, ...
stack_v2_sparse_classes_36k_train_008536
4,858
permissive
[ { "docstring": "levels_path: (str) path of section histogram files. mip: (int) the mip level of section histogram. clip_fraction: (float) the fraction of intensity to be clamped. minval: (float)", "name": "__init__", "signature": "def __init__(self, levels_path: str, mip: int, clip_fraction: float, minv...
4
stack_v2_sparse_classes_30k_train_009567
Implement the Python class `NormalizeSectionContrastOperator` described below. Class description: Contrast Correction based on LuminanceLevelsTask output. Note that this operator was modified from Will's ContrastNormalizationTask in igneous: https://github.com/seung-lab/igneous/blob/master/igneous/tasks.py#L735 Metho...
Implement the Python class `NormalizeSectionContrastOperator` described below. Class description: Contrast Correction based on LuminanceLevelsTask output. Note that this operator was modified from Will's ContrastNormalizationTask in igneous: https://github.com/seung-lab/igneous/blob/master/igneous/tasks.py#L735 Metho...
c7e78eb9798e88e398e6f56469a00ff26cff9232
<|skeleton|> class NormalizeSectionContrastOperator: """Contrast Correction based on LuminanceLevelsTask output. Note that this operator was modified from Will's ContrastNormalizationTask in igneous: https://github.com/seung-lab/igneous/blob/master/igneous/tasks.py#L735""" def __init__(self, levels_path: str, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NormalizeSectionContrastOperator: """Contrast Correction based on LuminanceLevelsTask output. Note that this operator was modified from Will's ContrastNormalizationTask in igneous: https://github.com/seung-lab/igneous/blob/master/igneous/tasks.py#L735""" def __init__(self, levels_path: str, mip: int, cli...
the_stack_v2_python_sparse
chunkflow/flow/normalize_section_contrast.py
aixioma/chunkflow
train
0
ccd76485925a4b693b312575c44683f60bcafc01
[ "future_seq = self.image_group_future_seq(image_seq, **kwargs)\nindex_group_seq = self.future_result_seq(future_seq)\nfor _, group in sorted(index_group_seq):\n for image in group:\n yield image", "future_list = list(future_seq)\nfuture_seq = as_completed(future_list)\nfor future in future_seq:\n yie...
<|body_start_0|> future_seq = self.image_group_future_seq(image_seq, **kwargs) index_group_seq = self.future_result_seq(future_seq) for _, group in sorted(index_group_seq): for image in group: yield image <|end_body_0|> <|body_start_1|> future_list = list(fut...
It helps only with long videos WARNING: remember that sending data from process to another has its own costs!
ParallelExtractor
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ParallelExtractor: """It helps only with long videos WARNING: remember that sending data from process to another has its own costs!""" def transform_frame_images(self, image_seq, **kwargs): """:param image_seq: :param kwargs: :return:""" <|body_0|> def future_result_seq(...
stack_v2_sparse_classes_36k_train_008537
3,728
permissive
[ { "docstring": ":param image_seq: :param kwargs: :return:", "name": "transform_frame_images", "signature": "def transform_frame_images(self, image_seq, **kwargs)" }, { "docstring": ":param future_seq: :return:", "name": "future_result_seq", "signature": "def future_result_seq(future_seq)...
5
stack_v2_sparse_classes_30k_train_001188
Implement the Python class `ParallelExtractor` described below. Class description: It helps only with long videos WARNING: remember that sending data from process to another has its own costs! Method signatures and docstrings: - def transform_frame_images(self, image_seq, **kwargs): :param image_seq: :param kwargs: :...
Implement the Python class `ParallelExtractor` described below. Class description: It helps only with long videos WARNING: remember that sending data from process to another has its own costs! Method signatures and docstrings: - def transform_frame_images(self, image_seq, **kwargs): :param image_seq: :param kwargs: :...
617ff45c9c3c96bbd9a975aef15f1b2697282b9c
<|skeleton|> class ParallelExtractor: """It helps only with long videos WARNING: remember that sending data from process to another has its own costs!""" def transform_frame_images(self, image_seq, **kwargs): """:param image_seq: :param kwargs: :return:""" <|body_0|> def future_result_seq(...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ParallelExtractor: """It helps only with long videos WARNING: remember that sending data from process to another has its own costs!""" def transform_frame_images(self, image_seq, **kwargs): """:param image_seq: :param kwargs: :return:""" future_seq = self.image_group_future_seq(image_seq,...
the_stack_v2_python_sparse
shot_detector/features/extractors/parallel_extractor.py
w495/python-video-shot-detector
train
20
20fa88941344e2835fa8e175a61cf16ba8c14d00
[ "self.porosity = 0.92\nself.k_matrix = 0.0058\nself.PPI = 10.0\nself.K = 2e-07\nself.Nu_D", "self.Re_K = self.velocity * self.K ** 0.5 / self.nu\nself.f = 1.0 / self.Re_K + 0.55\nself.k = self.k_matrix\nself.deltaP = self.f * self.perimeter * self.node_length / self.flow_area * (0.5 * self.rho * self.velocity ** ...
<|body_start_0|> self.porosity = 0.92 self.k_matrix = 0.0058 self.PPI = 10.0 self.K = 2e-07 self.Nu_D <|end_body_0|> <|body_start_1|> self.Re_K = self.velocity * self.K ** 0.5 / self.nu self.f = 1.0 / self.Re_K + 0.55 self.k = self.k_matrix self.d...
Class for porous media according to the book of Bejan. Bejan, A. “Designed Porous Media: Maximal Heat Transfer Density at Decreasing Length Scales.” International Journal of Heat and Mass Transfer 47, no. 14 (2004): 3073–3083. Methods: __init__ solve_enh
BejanPorous
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BejanPorous: """Class for porous media according to the book of Bejan. Bejan, A. “Designed Porous Media: Maximal Heat Transfer Density at Decreasing Length Scales.” International Journal of Heat and Mass Transfer 47, no. 14 (2004): 3073–3083. Methods: __init__ solve_enh""" def __init__(self)...
stack_v2_sparse_classes_36k_train_008538
15,856
no_license
[ { "docstring": "Initializes a bunch of constants.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Solves for convection parameters with enhancement.", "name": "solve_enh", "signature": "def solve_enh(self)" } ]
2
null
Implement the Python class `BejanPorous` described below. Class description: Class for porous media according to the book of Bejan. Bejan, A. “Designed Porous Media: Maximal Heat Transfer Density at Decreasing Length Scales.” International Journal of Heat and Mass Transfer 47, no. 14 (2004): 3073–3083. Methods: __init...
Implement the Python class `BejanPorous` described below. Class description: Class for porous media according to the book of Bejan. Bejan, A. “Designed Porous Media: Maximal Heat Transfer Density at Decreasing Length Scales.” International Journal of Heat and Mass Transfer 47, no. 14 (2004): 3073–3083. Methods: __init...
d619b66b1f16557e06c94eee1c16d4ee2a9e896a
<|skeleton|> class BejanPorous: """Class for porous media according to the book of Bejan. Bejan, A. “Designed Porous Media: Maximal Heat Transfer Density at Decreasing Length Scales.” International Journal of Heat and Mass Transfer 47, no. 14 (2004): 3073–3083. Methods: __init__ solve_enh""" def __init__(self)...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BejanPorous: """Class for porous media according to the book of Bejan. Bejan, A. “Designed Porous Media: Maximal Heat Transfer Density at Decreasing Length Scales.” International Journal of Heat and Mass Transfer 47, no. 14 (2004): 3073–3083. Methods: __init__ solve_enh""" def __init__(self): """...
the_stack_v2_python_sparse
Modules/enhancement.py
hfateh/TE_Model-1
train
0
473092687bcdd4c502a6e854288b87750ed91b34
[ "self.intersection_meter = AverageMeter()\nself.union_meter = AverageMeter()\nself.target_meter = AverageMeter()\nself.accuracy = 0", "intersection, union, target = iou_utils.intersectionAndUnion(pred, target, num_classes)\nself.intersection_meter.update(intersection)\nself.union_meter.update(union)\nself.target_...
<|body_start_0|> self.intersection_meter = AverageMeter() self.union_meter = AverageMeter() self.target_meter = AverageMeter() self.accuracy = 0 <|end_body_0|> <|body_start_1|> intersection, union, target = iou_utils.intersectionAndUnion(pred, target, num_classes) self.i...
An AverageMeter designed specifically for evaluating segmentation results.
SegmentationAverageMeter
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SegmentationAverageMeter: """An AverageMeter designed specifically for evaluating segmentation results.""" def __init__(self) -> None: """Initialize object.""" <|body_0|> def update_metrics_cpu(self, pred: np.ndarray, target: np.ndarray, num_classes: int) -> None: ...
stack_v2_sparse_classes_36k_train_008539
3,630
permissive
[ { "docstring": "Initialize object.", "name": "__init__", "signature": "def __init__(self) -> None" }, { "docstring": "Args: pred target classes", "name": "update_metrics_cpu", "signature": "def update_metrics_cpu(self, pred: np.ndarray, target: np.ndarray, num_classes: int) -> None" },...
4
stack_v2_sparse_classes_30k_train_005209
Implement the Python class `SegmentationAverageMeter` described below. Class description: An AverageMeter designed specifically for evaluating segmentation results. Method signatures and docstrings: - def __init__(self) -> None: Initialize object. - def update_metrics_cpu(self, pred: np.ndarray, target: np.ndarray, n...
Implement the Python class `SegmentationAverageMeter` described below. Class description: An AverageMeter designed specifically for evaluating segmentation results. Method signatures and docstrings: - def __init__(self) -> None: Initialize object. - def update_metrics_cpu(self, pred: np.ndarray, target: np.ndarray, n...
e078ae6ee33ca34dc07f3900b9ded5295c29d9c8
<|skeleton|> class SegmentationAverageMeter: """An AverageMeter designed specifically for evaluating segmentation results.""" def __init__(self) -> None: """Initialize object.""" <|body_0|> def update_metrics_cpu(self, pred: np.ndarray, target: np.ndarray, num_classes: int) -> None: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SegmentationAverageMeter: """An AverageMeter designed specifically for evaluating segmentation results.""" def __init__(self) -> None: """Initialize object.""" self.intersection_meter = AverageMeter() self.union_meter = AverageMeter() self.target_meter = AverageMeter() ...
the_stack_v2_python_sparse
mseg_semantic/utils/avg_meter.py
mseg-dataset/mseg-semantic
train
461
23552b6bd9a0076dff9fb1bde82366f6f0bf6595
[ "while get_current_window_id() == 10101:\n xbmc.sleep(100)\nsuper(progress_dialog, self).__init__()", "if kodi_version_major() < 19:\n lines = message.split('\\n', 2)\n line1, line2, line3 = lines + [None] * (3 - len(lines))\n return super(progress_dialog, self).create(heading, line1=line1, line2=line...
<|body_start_0|> while get_current_window_id() == 10101: xbmc.sleep(100) super(progress_dialog, self).__init__() <|end_body_0|> <|body_start_1|> if kodi_version_major() < 19: lines = message.split('\n', 2) line1, line2, line3 = lines + [None] * (3 - len(lines...
Show Kodi's Progress dialog
progress_dialog
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class progress_dialog: """Show Kodi's Progress dialog""" def __init__(self): """Initialize a new progress dialog""" <|body_0|> def create(self, heading, message=''): """Create and show a progress dialog""" <|body_1|> def update(self, percent, message=''): ...
stack_v2_sparse_classes_36k_train_008540
14,153
permissive
[ { "docstring": "Initialize a new progress dialog", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Create and show a progress dialog", "name": "create", "signature": "def create(self, heading, message='')" }, { "docstring": "Update the progress dialog", ...
3
stack_v2_sparse_classes_30k_train_012365
Implement the Python class `progress_dialog` described below. Class description: Show Kodi's Progress dialog Method signatures and docstrings: - def __init__(self): Initialize a new progress dialog - def create(self, heading, message=''): Create and show a progress dialog - def update(self, percent, message=''): Upda...
Implement the Python class `progress_dialog` described below. Class description: Show Kodi's Progress dialog Method signatures and docstrings: - def __init__(self): Initialize a new progress dialog - def create(self, heading, message=''): Create and show a progress dialog - def update(self, percent, message=''): Upda...
9b7cab3656c2497c812ab101a56ed661dd8cf4a7
<|skeleton|> class progress_dialog: """Show Kodi's Progress dialog""" def __init__(self): """Initialize a new progress dialog""" <|body_0|> def create(self, heading, message=''): """Create and show a progress dialog""" <|body_1|> def update(self, percent, message=''): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class progress_dialog: """Show Kodi's Progress dialog""" def __init__(self): """Initialize a new progress dialog""" while get_current_window_id() == 10101: xbmc.sleep(100) super(progress_dialog, self).__init__() def create(self, heading, message=''): """Create a...
the_stack_v2_python_sparse
repo/script.module.inputstreamhelper/lib/inputstreamhelper/kodiutils.py
irmu/arda
train
7
c7746f5fdc97129331ce8be711368b5a9bff62c1
[ "env = EpisodeInfo(gym.make('CartPole-v1'))\n\ndef actor(ob):\n ac = torch.from_numpy(np.array(env.action_space.sample()))[None]\n return namedtuple('test', ['action', 'state_out'])(action=ac, state_out=None)\nstats = rl_evaluate(env, actor, 10, outfile='./out.pt', save_info=True)\nassert len(stats['episode_l...
<|body_start_0|> env = EpisodeInfo(gym.make('CartPole-v1')) def actor(ob): ac = torch.from_numpy(np.array(env.action_space.sample()))[None] return namedtuple('test', ['action', 'state_out'])(action=ac, state_out=None) stats = rl_evaluate(env, actor, 10, outfile='./out.pt...
Test.
Test
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test: """Test.""" def test_eval(self): """Test.""" <|body_0|> def test_record(self): """Test record.""" <|body_1|> <|end_skeleton|> <|body_start_0|> env = EpisodeInfo(gym.make('CartPole-v1')) def actor(ob): ac = torch.from_n...
stack_v2_sparse_classes_36k_train_008541
7,046
no_license
[ { "docstring": "Test.", "name": "test_eval", "signature": "def test_eval(self)" }, { "docstring": "Test record.", "name": "test_record", "signature": "def test_record(self)" } ]
2
stack_v2_sparse_classes_30k_train_015911
Implement the Python class `Test` described below. Class description: Test. Method signatures and docstrings: - def test_eval(self): Test. - def test_record(self): Test record.
Implement the Python class `Test` described below. Class description: Test. Method signatures and docstrings: - def test_eval(self): Test. - def test_record(self): Test record. <|skeleton|> class Test: """Test.""" def test_eval(self): """Test.""" <|body_0|> def test_record(self): ...
e71c4b12955b01bfb907aa31c91ded6bcd8aaec8
<|skeleton|> class Test: """Test.""" def test_eval(self): """Test.""" <|body_0|> def test_record(self): """Test record.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Test: """Test.""" def test_eval(self): """Test.""" env = EpisodeInfo(gym.make('CartPole-v1')) def actor(ob): ac = torch.from_numpy(np.array(env.action_space.sample()))[None] return namedtuple('test', ['action', 'state_out'])(action=ac, state_out=None) ...
the_stack_v2_python_sparse
dl/rl/util/eval.py
cbschaff/dl
train
1
2984dbcad5c98d03efd32a90951b1c7fa4d7768f
[ "if not Arr:\n return None\nhead = ListNode(Arr[0])\np = head\nfor i in range(1, len(Arr)):\n p.next = ListNode(Arr[i])\n p = p.next\nreturn head", "if not head:\n return None\nresult = []\np = head\nwhile p:\n result.append(p.val)\n p = p.next\nreturn result" ]
<|body_start_0|> if not Arr: return None head = ListNode(Arr[0]) p = head for i in range(1, len(Arr)): p.next = ListNode(Arr[i]) p = p.next return head <|end_body_0|> <|body_start_1|> if not head: return None result...
LinkList
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LinkList: def buildList(self, Arr): """建立链表""" <|body_0|> def printLinkList(self, head): """打印链表""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not Arr: return None head = ListNode(Arr[0]) p = head for i in ra...
stack_v2_sparse_classes_36k_train_008542
2,459
no_license
[ { "docstring": "建立链表", "name": "buildList", "signature": "def buildList(self, Arr)" }, { "docstring": "打印链表", "name": "printLinkList", "signature": "def printLinkList(self, head)" } ]
2
null
Implement the Python class `LinkList` described below. Class description: Implement the LinkList class. Method signatures and docstrings: - def buildList(self, Arr): 建立链表 - def printLinkList(self, head): 打印链表
Implement the Python class `LinkList` described below. Class description: Implement the LinkList class. Method signatures and docstrings: - def buildList(self, Arr): 建立链表 - def printLinkList(self, head): 打印链表 <|skeleton|> class LinkList: def buildList(self, Arr): """建立链表""" <|body_0|> def p...
4e4f739402b95691f6c91411da26d7d3bfe042b6
<|skeleton|> class LinkList: def buildList(self, Arr): """建立链表""" <|body_0|> def printLinkList(self, head): """打印链表""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LinkList: def buildList(self, Arr): """建立链表""" if not Arr: return None head = ListNode(Arr[0]) p = head for i in range(1, len(Arr)): p.next = ListNode(Arr[i]) p = p.next return head def printLinkList(self, head): ...
the_stack_v2_python_sparse
Big大话数据结构/linklist链表/1、相交链表的交点.py
hugechuanqi/Algorithms-and-Data-Structures
train
3
a9feae6f37a759eeb6f33b95ea92c7aa66d8432c
[ "self.url = '/ydtp-backend-service/api/web_hand_over_duty'\ndata = {'user_id': handUser, 'password': pwd}\nre = self.post(url=self.zby_api, data=data, headers=form_headers)\nreturn re.text", "self.url = '/ydtp-backend-service/api/offduty'\nre = self.post(url=self.zby_api, headers=form_headers)\nreturn re.text", ...
<|body_start_0|> self.url = '/ydtp-backend-service/api/web_hand_over_duty' data = {'user_id': handUser, 'password': pwd} re = self.post(url=self.zby_api, data=data, headers=form_headers) return re.text <|end_body_0|> <|body_start_1|> self.url = '/ydtp-backend-service/api/offduty...
个人中心
PersonalInfo
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PersonalInfo: """个人中心""" def webHandOverDuty(self, handUser, pwd): """交接班""" <|body_0|> def offduty(self): """退出登录""" <|body_1|> def dutyInfo(self): """个人信息""" <|body_2|> def __shiftRecords(self): """收费汇总列表""" <|b...
stack_v2_sparse_classes_36k_train_008543
1,626
no_license
[ { "docstring": "交接班", "name": "webHandOverDuty", "signature": "def webHandOverDuty(self, handUser, pwd)" }, { "docstring": "退出登录", "name": "offduty", "signature": "def offduty(self)" }, { "docstring": "个人信息", "name": "dutyInfo", "signature": "def dutyInfo(self)" }, { ...
5
null
Implement the Python class `PersonalInfo` described below. Class description: 个人中心 Method signatures and docstrings: - def webHandOverDuty(self, handUser, pwd): 交接班 - def offduty(self): 退出登录 - def dutyInfo(self): 个人信息 - def __shiftRecords(self): 收费汇总列表 - def shiftMoneys(self): 查看收费流水清单
Implement the Python class `PersonalInfo` described below. Class description: 个人中心 Method signatures and docstrings: - def webHandOverDuty(self, handUser, pwd): 交接班 - def offduty(self): 退出登录 - def dutyInfo(self): 个人信息 - def __shiftRecords(self): 收费汇总列表 - def shiftMoneys(self): 查看收费流水清单 <|skeleton|> class PersonalInf...
34c368c109867da26d9256bca85f872b0fac2ea7
<|skeleton|> class PersonalInfo: """个人中心""" def webHandOverDuty(self, handUser, pwd): """交接班""" <|body_0|> def offduty(self): """退出登录""" <|body_1|> def dutyInfo(self): """个人信息""" <|body_2|> def __shiftRecords(self): """收费汇总列表""" <|b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PersonalInfo: """个人中心""" def webHandOverDuty(self, handUser, pwd): """交接班""" self.url = '/ydtp-backend-service/api/web_hand_over_duty' data = {'user_id': handUser, 'password': pwd} re = self.post(url=self.zby_api, data=data, headers=form_headers) return re.text ...
the_stack_v2_python_sparse
Api/sentry_service/personalInfo.py
oyebino/pomp_api
train
1
71a09f56391825e8356cf44bef808b34970e9728
[ "if self.action == 'create':\n return [IsAuthenticated()]\nif self.action in ['update', 'partial_update', 'destroy']:\n return [IsAdminUser()]\nreturn []", "if self.request.user.is_superuser:\n return Order.objects.prefetch_related('orders_in').all()\nif self.request.user.is_authenticated:\n return Or...
<|body_start_0|> if self.action == 'create': return [IsAuthenticated()] if self.action in ['update', 'partial_update', 'destroy']: return [IsAdminUser()] return [] <|end_body_0|> <|body_start_1|> if self.request.user.is_superuser: return Order.objects...
OrderViewSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OrderViewSet: def get_permissions(self): """Получение прав для действий.""" <|body_0|> def get_queryset(self): """Получение списка заказов.""" <|body_1|> <|end_skeleton|> <|body_start_0|> if self.action == 'create': return [IsAuthenticat...
stack_v2_sparse_classes_36k_train_008544
1,309
no_license
[ { "docstring": "Получение прав для действий.", "name": "get_permissions", "signature": "def get_permissions(self)" }, { "docstring": "Получение списка заказов.", "name": "get_queryset", "signature": "def get_queryset(self)" } ]
2
stack_v2_sparse_classes_30k_train_020546
Implement the Python class `OrderViewSet` described below. Class description: Implement the OrderViewSet class. Method signatures and docstrings: - def get_permissions(self): Получение прав для действий. - def get_queryset(self): Получение списка заказов.
Implement the Python class `OrderViewSet` described below. Class description: Implement the OrderViewSet class. Method signatures and docstrings: - def get_permissions(self): Получение прав для действий. - def get_queryset(self): Получение списка заказов. <|skeleton|> class OrderViewSet: def get_permissions(sel...
1edce1a74e1fef43c4cdc9fe39a0b4d2fbec77b2
<|skeleton|> class OrderViewSet: def get_permissions(self): """Получение прав для действий.""" <|body_0|> def get_queryset(self): """Получение списка заказов.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OrderViewSet: def get_permissions(self): """Получение прав для действий.""" if self.action == 'create': return [IsAuthenticated()] if self.action in ['update', 'partial_update', 'destroy']: return [IsAdminUser()] return [] def get_queryset(self): ...
the_stack_v2_python_sparse
order/views.py
LiliyaVerchenko/dj_diplom
train
0
9468d4724c762ae62f7aebece6a1ef51dfd29736
[ "if self is NativeOrForeign.Foreign:\n return pair.foreign\nelif self is NativeOrForeign.Native:\n return pair.native", "if self is NativeOrForeign.Foreign:\n return NativeOrForeign.Native\nelif self is NativeOrForeign.Native:\n return NativeOrForeign.Foreign" ]
<|body_start_0|> if self is NativeOrForeign.Foreign: return pair.foreign elif self is NativeOrForeign.Native: return pair.native <|end_body_0|> <|body_start_1|> if self is NativeOrForeign.Foreign: return NativeOrForeign.Native elif self is NativeOrFor...
Helper class to dynamically get the proper Form from a Concpet Pair
NativeOrForeign
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NativeOrForeign: """Helper class to dynamically get the proper Form from a Concpet Pair""" def __call__(self, pair): """Return the proepr Form from the given Concept Pair""" <|body_0|> def other(self): """Return the other Type of Native or Foreign""" <|bo...
stack_v2_sparse_classes_36k_train_008545
717
no_license
[ { "docstring": "Return the proepr Form from the given Concept Pair", "name": "__call__", "signature": "def __call__(self, pair)" }, { "docstring": "Return the other Type of Native or Foreign", "name": "other", "signature": "def other(self)" } ]
2
stack_v2_sparse_classes_30k_train_004061
Implement the Python class `NativeOrForeign` described below. Class description: Helper class to dynamically get the proper Form from a Concpet Pair Method signatures and docstrings: - def __call__(self, pair): Return the proepr Form from the given Concept Pair - def other(self): Return the other Type of Native or Fo...
Implement the Python class `NativeOrForeign` described below. Class description: Helper class to dynamically get the proper Form from a Concpet Pair Method signatures and docstrings: - def __call__(self, pair): Return the proepr Form from the given Concept Pair - def other(self): Return the other Type of Native or Fo...
f08dc4465b7e4fb32235e1647c46edd4472f9093
<|skeleton|> class NativeOrForeign: """Helper class to dynamically get the proper Form from a Concpet Pair""" def __call__(self, pair): """Return the proepr Form from the given Concept Pair""" <|body_0|> def other(self): """Return the other Type of Native or Foreign""" <|bo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NativeOrForeign: """Helper class to dynamically get the proper Form from a Concpet Pair""" def __call__(self, pair): """Return the proepr Form from the given Concept Pair""" if self is NativeOrForeign.Foreign: return pair.foreign elif self is NativeOrForeign.Native: ...
the_stack_v2_python_sparse
src/Data/Concept/native_or_foreign.py
cloew/VocabTester
train
0
a7669150fc762245c8fb0d68f8df6901ff0b2d8d
[ "storage = get_storage()\nsites = storage.list_sites()\nreturn jsonify(SiteResponseSchema(many=True).dump(sites))", "data = request.get_json()\ntry:\n site = SiteSchema().load(data)\nexcept ValidationError as err:\n return (jsonify({'errors': err.messages}), 400)\nstorage = get_storage()\nsite_id = storage....
<|body_start_0|> storage = get_storage() sites = storage.list_sites() return jsonify(SiteResponseSchema(many=True).dump(sites)) <|end_body_0|> <|body_start_1|> data = request.get_json() try: site = SiteSchema().load(data) except ValidationError as err: ...
AllSitesView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AllSitesView: def get(self, *args): """--- summary: List sites description: List all sites that the user has access to. tags: - Sites responses: 200: description: A list of sites content: application/json: schema: type: array items: $ref: '#/components/schemas/SiteMetadata' 401: $ref: '#...
stack_v2_sparse_classes_36k_train_008546
10,882
permissive
[ { "docstring": "--- summary: List sites description: List all sites that the user has access to. tags: - Sites responses: 200: description: A list of sites content: application/json: schema: type: array items: $ref: '#/components/schemas/SiteMetadata' 401: $ref: '#/components/responses/401-Unauthorized'", "...
2
stack_v2_sparse_classes_30k_train_018939
Implement the Python class `AllSitesView` described below. Class description: Implement the AllSitesView class. Method signatures and docstrings: - def get(self, *args): --- summary: List sites description: List all sites that the user has access to. tags: - Sites responses: 200: description: A list of sites content:...
Implement the Python class `AllSitesView` described below. Class description: Implement the AllSitesView class. Method signatures and docstrings: - def get(self, *args): --- summary: List sites description: List all sites that the user has access to. tags: - Sites responses: 200: description: A list of sites content:...
280800c73eb7cfd49029462b352887e78f1ff91b
<|skeleton|> class AllSitesView: def get(self, *args): """--- summary: List sites description: List all sites that the user has access to. tags: - Sites responses: 200: description: A list of sites content: application/json: schema: type: array items: $ref: '#/components/schemas/SiteMetadata' 401: $ref: '#...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AllSitesView: def get(self, *args): """--- summary: List sites description: List all sites that the user has access to. tags: - Sites responses: 200: description: A list of sites content: application/json: schema: type: array items: $ref: '#/components/schemas/SiteMetadata' 401: $ref: '#/components/re...
the_stack_v2_python_sparse
sfa_api/sites.py
SolarArbiter/solarforecastarbiter-api
train
9
0a0e8ca954e11fa02ce577db60c945c42932fb3e
[ "self.w = w\nself.arr = [w[0]]\nfor n in w[1:]:\n self.arr.append(self.arr[-1] + n)", "rnd = random.random() * self.arr[-1]\ni = bisect.bisect_left(self.arr, rnd)\nreturn i" ]
<|body_start_0|> self.w = w self.arr = [w[0]] for n in w[1:]: self.arr.append(self.arr[-1] + n) <|end_body_0|> <|body_start_1|> rnd = random.random() * self.arr[-1] i = bisect.bisect_left(self.arr, rnd) return i <|end_body_1|>
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def __init__(self, w): """:type w: List[int]""" <|body_0|> def pickIndex(self): """:rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.w = w self.arr = [w[0]] for n in w[1:]: self.arr.append(self.ar...
stack_v2_sparse_classes_36k_train_008547
542
no_license
[ { "docstring": ":type w: List[int]", "name": "__init__", "signature": "def __init__(self, w)" }, { "docstring": ":rtype: int", "name": "pickIndex", "signature": "def pickIndex(self)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, w): :type w: List[int] - def pickIndex(self): :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, w): :type w: List[int] - def pickIndex(self): :rtype: int <|skeleton|> class Solution: def __init__(self, w): """:type w: List[int]""" <|...
b4da922c4e8406c486760639b71e3ec50283ca43
<|skeleton|> class Solution: def __init__(self, w): """:type w: List[int]""" <|body_0|> def pickIndex(self): """:rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def __init__(self, w): """:type w: List[int]""" self.w = w self.arr = [w[0]] for n in w[1:]: self.arr.append(self.arr[-1] + n) def pickIndex(self): """:rtype: int""" rnd = random.random() * self.arr[-1] i = bisect.bisect_left(s...
the_stack_v2_python_sparse
current_session/python/528_redo2.py
YJL33/LeetCode
train
3
a164b4fa59a69e1154a25238695a2d4c0fc69a16
[ "self.__domain = domainName\nself.__kdcHost = serverIP\nself.__domainUsers = domainusers\nself.__sprayPassword = sprayPassword\nself.DomainUserRequest()", "domain = '@' + self.__domain\nfor user in self.__domainUsers:\n targetuser = user + domain\n self.AttackToTarget(targetuser)", "self.__sprayusers = []...
<|body_start_0|> self.__domain = domainName self.__kdcHost = serverIP self.__domainUsers = domainusers self.__sprayPassword = sprayPassword self.DomainUserRequest() <|end_body_0|> <|body_start_1|> domain = '@' + self.__domain for user in self.__domainUsers: ...
PasswordSPRAY
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PasswordSPRAY: def AttackArguments(self, serverIP, domainusers, sprayPassword, domainName): """Spray Attack Arguments""" <|body_0|> def DomainUserRequest(self): """Pars to Domain""" <|body_1|> def AttackToTarget(self, username): """Attack Part"""...
stack_v2_sparse_classes_36k_train_008548
1,067
permissive
[ { "docstring": "Spray Attack Arguments", "name": "AttackArguments", "signature": "def AttackArguments(self, serverIP, domainusers, sprayPassword, domainName)" }, { "docstring": "Pars to Domain", "name": "DomainUserRequest", "signature": "def DomainUserRequest(self)" }, { "docstri...
3
stack_v2_sparse_classes_30k_train_017093
Implement the Python class `PasswordSPRAY` described below. Class description: Implement the PasswordSPRAY class. Method signatures and docstrings: - def AttackArguments(self, serverIP, domainusers, sprayPassword, domainName): Spray Attack Arguments - def DomainUserRequest(self): Pars to Domain - def AttackToTarget(s...
Implement the Python class `PasswordSPRAY` described below. Class description: Implement the PasswordSPRAY class. Method signatures and docstrings: - def AttackArguments(self, serverIP, domainusers, sprayPassword, domainName): Spray Attack Arguments - def DomainUserRequest(self): Pars to Domain - def AttackToTarget(s...
92263ea73bd2eaa2081fb277c76aa229103a1d54
<|skeleton|> class PasswordSPRAY: def AttackArguments(self, serverIP, domainusers, sprayPassword, domainName): """Spray Attack Arguments""" <|body_0|> def DomainUserRequest(self): """Pars to Domain""" <|body_1|> def AttackToTarget(self, username): """Attack Part"""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PasswordSPRAY: def AttackArguments(self, serverIP, domainusers, sprayPassword, domainName): """Spray Attack Arguments""" self.__domain = domainName self.__kdcHost = serverIP self.__domainUsers = domainusers self.__sprayPassword = sprayPassword self.DomainUserReq...
the_stack_v2_python_sparse
pentestui/pentest_api/enumeration/ldap/spray/sprayattack.py
mustgundogdu/PentestUI
train
31
3119ec891683e72a49046e7cff5463760b8e7a7e
[ "profiles = Profile.objects.all()\nserializer = ProfileCreateSerializer(profiles, many=True)\nreturn Response(serializer.data)", "serializer = ProfileCreateSerializer(data=request.data)\nif serializer.is_valid(raise_exception=ValueError):\n serializer.save()\n return Response(serializer.data, status=status....
<|body_start_0|> profiles = Profile.objects.all() serializer = ProfileCreateSerializer(profiles, many=True) return Response(serializer.data) <|end_body_0|> <|body_start_1|> serializer = ProfileCreateSerializer(data=request.data) if serializer.is_valid(raise_exception=ValueError)...
A class based view for creating and fetching student records
ProfileCreateAPIView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProfileCreateAPIView: """A class based view for creating and fetching student records""" def get(self, format: object=None) -> object: """Get all the student records :param format: Format of the student records to return to :return: Returns a list of student records""" <|body...
stack_v2_sparse_classes_36k_train_008549
8,136
no_license
[ { "docstring": "Get all the student records :param format: Format of the student records to return to :return: Returns a list of student records", "name": "get", "signature": "def get(self, format: object=None) -> object" }, { "docstring": "Create a student record :param format: Format of the st...
2
null
Implement the Python class `ProfileCreateAPIView` described below. Class description: A class based view for creating and fetching student records Method signatures and docstrings: - def get(self, format: object=None) -> object: Get all the student records :param format: Format of the student records to return to :re...
Implement the Python class `ProfileCreateAPIView` described below. Class description: A class based view for creating and fetching student records Method signatures and docstrings: - def get(self, format: object=None) -> object: Get all the student records :param format: Format of the student records to return to :re...
42e42cbd9b7dbcaed38109b7373735ff110900a3
<|skeleton|> class ProfileCreateAPIView: """A class based view for creating and fetching student records""" def get(self, format: object=None) -> object: """Get all the student records :param format: Format of the student records to return to :return: Returns a list of student records""" <|body...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProfileCreateAPIView: """A class based view for creating and fetching student records""" def get(self, format: object=None) -> object: """Get all the student records :param format: Format of the student records to return to :return: Returns a list of student records""" profiles = Profile....
the_stack_v2_python_sparse
UserRegistrationApp/views.py
HishamDigitalHub/SportActivities
train
0
4f89da3cd0a34cb113e61d9694ff10fc4519053d
[ "EventHandler.__init__(self)\nself._pegHand = pegHandler\nself._color = colorNum", "if event.getDescription() == 'mouse click':\n gui = self._pegHand._gui\n gui._guess.setPegColor(self._pegHand._peg, self._color)\n hole = gui._holes[gui._currentTurnNum][self._pegHand._peg]\n hole.setRadius(gui._pegRad...
<|body_start_0|> EventHandler.__init__(self) self._pegHand = pegHandler self._color = colorNum <|end_body_0|> <|body_start_1|> if event.getDescription() == 'mouse click': gui = self._pegHand._gui gui._guess.setPegColor(self._pegHand._peg, self._color) ...
Handler class for the selection of a colored peg.
ChoiceHandler
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ChoiceHandler: """Handler class for the selection of a colored peg.""" def __init__(self, pegHandler, colorNum): """Create a new instance.""" <|body_0|> def handle(self, event): """Set the choice of color and close the popup.""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_36k_train_008550
6,736
no_license
[ { "docstring": "Create a new instance.", "name": "__init__", "signature": "def __init__(self, pegHandler, colorNum)" }, { "docstring": "Set the choice of color and close the popup.", "name": "handle", "signature": "def handle(self, event)" } ]
2
null
Implement the Python class `ChoiceHandler` described below. Class description: Handler class for the selection of a colored peg. Method signatures and docstrings: - def __init__(self, pegHandler, colorNum): Create a new instance. - def handle(self, event): Set the choice of color and close the popup.
Implement the Python class `ChoiceHandler` described below. Class description: Handler class for the selection of a colored peg. Method signatures and docstrings: - def __init__(self, pegHandler, colorNum): Create a new instance. - def handle(self, event): Set the choice of color and close the popup. <|skeleton|> cl...
2d008e9cedc33d9e24420bef14b73b28ff54cdbf
<|skeleton|> class ChoiceHandler: """Handler class for the selection of a colored peg.""" def __init__(self, pegHandler, colorNum): """Create a new instance.""" <|body_0|> def handle(self, event): """Set the choice of color and close the popup.""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ChoiceHandler: """Handler class for the selection of a colored peg.""" def __init__(self, pegHandler, colorNum): """Create a new instance.""" EventHandler.__init__(self) self._pegHand = pegHandler self._color = colorNum def handle(self, event): """Set the choi...
the_stack_v2_python_sparse
C152/sourcecode/ch15/MastermindGUI.py
nrichgels/ClassCode
train
2
ee13ea769fd21ec674b0316d052d7a3838685764
[ "url = host + '/api/goods/find'\ndata = {'sku': sku, 'gid': goods_id}\nr = requests.post(url=url, data=data).json()\nout_format('获取单品:', r)", "url = host + '/api/goods/line'\ndata = {'sku': sku, 'gid': goods_id}\nr = requests.post(url=url, data=data).json()\nout_format('获取单品价格和属性:', r)\nreturn r", "url = host +...
<|body_start_0|> url = host + '/api/goods/find' data = {'sku': sku, 'gid': goods_id} r = requests.post(url=url, data=data).json() out_format('获取单品:', r) <|end_body_0|> <|body_start_1|> url = host + '/api/goods/line' data = {'sku': sku, 'gid': goods_id} r = reques...
goods
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class goods: def get_goods(self): """获取单品 :return: gid""" <|body_0|> def get_price(self): """获取单品价格和属性 :return:""" <|body_1|> def get_comment(self): """获取评论列表 gid:产品id size:记录条数 page:页码 :return:""" <|body_2|> <|end_skeleton|> <|body_start_0|>...
stack_v2_sparse_classes_36k_train_008551
1,426
no_license
[ { "docstring": "获取单品 :return: gid", "name": "get_goods", "signature": "def get_goods(self)" }, { "docstring": "获取单品价格和属性 :return:", "name": "get_price", "signature": "def get_price(self)" }, { "docstring": "获取评论列表 gid:产品id size:记录条数 page:页码 :return:", "name": "get_comment", ...
3
stack_v2_sparse_classes_30k_train_005459
Implement the Python class `goods` described below. Class description: Implement the goods class. Method signatures and docstrings: - def get_goods(self): 获取单品 :return: gid - def get_price(self): 获取单品价格和属性 :return: - def get_comment(self): 获取评论列表 gid:产品id size:记录条数 page:页码 :return:
Implement the Python class `goods` described below. Class description: Implement the goods class. Method signatures and docstrings: - def get_goods(self): 获取单品 :return: gid - def get_price(self): 获取单品价格和属性 :return: - def get_comment(self): 获取评论列表 gid:产品id size:记录条数 page:页码 :return: <|skeleton|> class goods: def...
0ebaae335de2f1633e31c4fc3f60e556220a8bfb
<|skeleton|> class goods: def get_goods(self): """获取单品 :return: gid""" <|body_0|> def get_price(self): """获取单品价格和属性 :return:""" <|body_1|> def get_comment(self): """获取评论列表 gid:产品id size:记录条数 page:页码 :return:""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class goods: def get_goods(self): """获取单品 :return: gid""" url = host + '/api/goods/find' data = {'sku': sku, 'gid': goods_id} r = requests.post(url=url, data=data).json() out_format('获取单品:', r) def get_price(self): """获取单品价格和属性 :return:""" url = host + '/...
the_stack_v2_python_sparse
Atle/interface/framework/base/aGoods.py
shiqi0128/My_scripts
train
0
b40d56eabe8d6e3f1f5875a2ba77b5222ec40314
[ "self.user = user\npipelines = kwargs.pop('pipelines', None)\nsuper(ProjectCreateForm, self).__init__(*args, **kwargs)\nchoices = []\nif pipelines is not None:\n for pipeline in pipelines:\n choices.append((pipeline.id, pipeline.name))\n self.fields['pipeline'].choices = choices", "project_name = sel...
<|body_start_0|> self.user = user pipelines = kwargs.pop('pipelines', None) super(ProjectCreateForm, self).__init__(*args, **kwargs) choices = [] if pipelines is not None: for pipeline in pipelines: choices.append((pipeline.id, pipeline.name)) ...
Form for project creation.
ProjectCreateForm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProjectCreateForm: """Form for project creation.""" def __init__(self, user, *args, **kwargs): """Initialise method for ProjectCreateForm. :param args: argument :param kwargs: keyword arguments containing a scripts variable with Script objects""" <|body_0|> def clean_pro...
stack_v2_sparse_classes_36k_train_008552
2,111
no_license
[ { "docstring": "Initialise method for ProjectCreateForm. :param args: argument :param kwargs: keyword arguments containing a scripts variable with Script objects", "name": "__init__", "signature": "def __init__(self, user, *args, **kwargs)" }, { "docstring": "Clean the project name in this form....
3
stack_v2_sparse_classes_30k_train_019192
Implement the Python class `ProjectCreateForm` described below. Class description: Form for project creation. Method signatures and docstrings: - def __init__(self, user, *args, **kwargs): Initialise method for ProjectCreateForm. :param args: argument :param kwargs: keyword arguments containing a scripts variable wit...
Implement the Python class `ProjectCreateForm` described below. Class description: Form for project creation. Method signatures and docstrings: - def __init__(self, user, *args, **kwargs): Initialise method for ProjectCreateForm. :param args: argument :param kwargs: keyword arguments containing a scripts variable wit...
dfa60c9a812e52fa44f0d3cf1c201943574976df
<|skeleton|> class ProjectCreateForm: """Form for project creation.""" def __init__(self, user, *args, **kwargs): """Initialise method for ProjectCreateForm. :param args: argument :param kwargs: keyword arguments containing a scripts variable with Script objects""" <|body_0|> def clean_pro...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProjectCreateForm: """Form for project creation.""" def __init__(self, user, *args, **kwargs): """Initialise method for ProjectCreateForm. :param args: argument :param kwargs: keyword arguments containing a scripts variable with Script objects""" self.user = user pipelines = kwarg...
the_stack_v2_python_sparse
equestria/projects/forms.py
KiOui/CLST-2020
train
0
c8123c33139ade40cee1c22d58ef0279d1d914ab
[ "super().__init__(model_path, device, core, num_requests, 'Action Recognition')\n_, _, t, h, w = self.input_size\nself.input_height = h\nself.input_width = w\nself.input_length = t\nself.img_scale = img_scale\nself.num_test_classes = num_classes", "src_roi_height, src_roi_width = (src_roi[3] - src_roi[1], src_roi...
<|body_start_0|> super().__init__(model_path, device, core, num_requests, 'Action Recognition') _, _, t, h, w = self.input_size self.input_height = h self.input_width = w self.input_length = t self.img_scale = img_scale self.num_test_classes = num_classes <|end_bo...
Class that is used to work with action recognition model.
ActionRecognizer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ActionRecognizer: """Class that is used to work with action recognition model.""" def __init__(self, model_path, device, core, num_requests, img_scale, num_classes): """Constructor""" <|body_0|> def _convert_to_central_roi(src_roi, input_height, input_width, img_scale): ...
stack_v2_sparse_classes_36k_train_008553
3,426
permissive
[ { "docstring": "Constructor", "name": "__init__", "signature": "def __init__(self, model_path, device, core, num_requests, img_scale, num_classes)" }, { "docstring": "Extracts from the input ROI the central square part with specified side size", "name": "_convert_to_central_roi", "signat...
5
null
Implement the Python class `ActionRecognizer` described below. Class description: Class that is used to work with action recognition model. Method signatures and docstrings: - def __init__(self, model_path, device, core, num_requests, img_scale, num_classes): Constructor - def _convert_to_central_roi(src_roi, input_h...
Implement the Python class `ActionRecognizer` described below. Class description: Class that is used to work with action recognition model. Method signatures and docstrings: - def __init__(self, model_path, device, core, num_requests, img_scale, num_classes): Constructor - def _convert_to_central_roi(src_roi, input_h...
7929adbe91e9cfe8dc5dc1daad5ae7392f9719a0
<|skeleton|> class ActionRecognizer: """Class that is used to work with action recognition model.""" def __init__(self, model_path, device, core, num_requests, img_scale, num_classes): """Constructor""" <|body_0|> def _convert_to_central_roi(src_roi, input_height, input_width, img_scale): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ActionRecognizer: """Class that is used to work with action recognition model.""" def __init__(self, model_path, device, core, num_requests, img_scale, num_classes): """Constructor""" super().__init__(model_path, device, core, num_requests, 'Action Recognition') _, _, t, h, w = se...
the_stack_v2_python_sparse
demos/gesture_recognition_demo/python/gesture_recognition_demo/action_recognizer.py
openvinotoolkit/open_model_zoo
train
1,712
f17eac5a734194eba918cb8a2185f3505e4f5e9f
[ "if self.auto:\n try:\n application.pyre_mpi(*args, **kwds)\n except AttributeError:\n pass\n return self.spawn(*args, application=application, **kwds)\nreturn self.parallel(*args, application=application, **kwds)", "import mpi\nif mpi.init():\n self.world = mpi.world\n return super()...
<|body_start_0|> if self.auto: try: application.pyre_mpi(*args, **kwds) except AttributeError: pass return self.spawn(*args, application=application, **kwds) return self.parallel(*args, application=application, **kwds) <|end_body_0|> <...
Encapsulation of launching an MPI job using {mpirun}
Launcher
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Launcher: """Encapsulation of launching an MPI job using {mpirun}""" def launch(self, application, *args, **kwds): """Launch {application} as a collection of mpi tasks""" <|body_0|> def parallel(self, *args, **kwds): """Called after the parallel machine has been ...
stack_v2_sparse_classes_36k_train_008554
5,102
permissive
[ { "docstring": "Launch {application} as a collection of mpi tasks", "name": "launch", "signature": "def launch(self, application, *args, **kwds)" }, { "docstring": "Called after the parallel machine has been built and it is time to invoke the user's code in every node", "name": "parallel", ...
4
stack_v2_sparse_classes_30k_train_006701
Implement the Python class `Launcher` described below. Class description: Encapsulation of launching an MPI job using {mpirun} Method signatures and docstrings: - def launch(self, application, *args, **kwds): Launch {application} as a collection of mpi tasks - def parallel(self, *args, **kwds): Called after the paral...
Implement the Python class `Launcher` described below. Class description: Encapsulation of launching an MPI job using {mpirun} Method signatures and docstrings: - def launch(self, application, *args, **kwds): Launch {application} as a collection of mpi tasks - def parallel(self, *args, **kwds): Called after the paral...
d741c44ffb3e9e1f726bf492202ac8738bb4aa1c
<|skeleton|> class Launcher: """Encapsulation of launching an MPI job using {mpirun}""" def launch(self, application, *args, **kwds): """Launch {application} as a collection of mpi tasks""" <|body_0|> def parallel(self, *args, **kwds): """Called after the parallel machine has been ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Launcher: """Encapsulation of launching an MPI job using {mpirun}""" def launch(self, application, *args, **kwds): """Launch {application} as a collection of mpi tasks""" if self.auto: try: application.pyre_mpi(*args, **kwds) except AttributeError: ...
the_stack_v2_python_sparse
packages/mpi/Launcher.py
pyre/pyre
train
27
4eaf959e6e238a9044869b45cd495ded070f94fa
[ "if r >= N or r < 0 or c < 0 or (c >= N):\n return 0\nif K == 0:\n return 1\nelse:\n explore = [[-2, -1], [-1, -2], [-2, 1], [-1, 2], [2, -1], [1, -2], [2, 1], [1, 2]]\n tot_prob = 0\n for xd, yd in explore:\n v = self.knightProbability(N, K - 1, r + xd, c + yd)\n tot_prob += v\n ret...
<|body_start_0|> if r >= N or r < 0 or c < 0 or (c >= N): return 0 if K == 0: return 1 else: explore = [[-2, -1], [-1, -2], [-2, 1], [-1, 2], [2, -1], [1, -2], [2, 1], [1, 2]] tot_prob = 0 for xd, yd in explore: v = self...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def knightProbability_bf(self, N, K, r, c): """:type N: int :type K: int :type r: int :type c: int :rtype: float""" <|body_0|> def knightProbability(self, N, K, r, c): """:type N: int :type K: int :type r: int :type c: int :rtype: float""" <|body_1|...
stack_v2_sparse_classes_36k_train_008555
1,548
no_license
[ { "docstring": ":type N: int :type K: int :type r: int :type c: int :rtype: float", "name": "knightProbability_bf", "signature": "def knightProbability_bf(self, N, K, r, c)" }, { "docstring": ":type N: int :type K: int :type r: int :type c: int :rtype: float", "name": "knightProbability", ...
2
stack_v2_sparse_classes_30k_train_019398
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def knightProbability_bf(self, N, K, r, c): :type N: int :type K: int :type r: int :type c: int :rtype: float - def knightProbability(self, N, K, r, c): :type N: int :type K: int...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def knightProbability_bf(self, N, K, r, c): :type N: int :type K: int :type r: int :type c: int :rtype: float - def knightProbability(self, N, K, r, c): :type N: int :type K: int...
b3a8a4db43f1d8620b70d54dd032e37b1eae7947
<|skeleton|> class Solution: def knightProbability_bf(self, N, K, r, c): """:type N: int :type K: int :type r: int :type c: int :rtype: float""" <|body_0|> def knightProbability(self, N, K, r, c): """:type N: int :type K: int :type r: int :type c: int :rtype: float""" <|body_1|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def knightProbability_bf(self, N, K, r, c): """:type N: int :type K: int :type r: int :type c: int :rtype: float""" if r >= N or r < 0 or c < 0 or (c >= N): return 0 if K == 0: return 1 else: explore = [[-2, -1], [-1, -2], [-2, 1], ...
the_stack_v2_python_sparse
Leetcode/Medium/knight_prob.py
rajaditya-m/Interview-Prep
train
0
4d733c4aefc460de5b36fbc0fb046509e030af71
[ "alloy_type_set = alloy_model.AlloyType.objects.only('id', 'type').filter(is_delete=False)\nalloy = alloy_model.Alloy.objects.only('id', 'name').filter(is_delete=False, id=alloy_id)\nif alloy:\n data = {'alloy_type_set': alloy_type_set, 'alloy': alloy}\n return render(request, 'admin/alloy/alloy_edit.html', c...
<|body_start_0|> alloy_type_set = alloy_model.AlloyType.objects.only('id', 'type').filter(is_delete=False) alloy = alloy_model.Alloy.objects.only('id', 'name').filter(is_delete=False, id=alloy_id) if alloy: data = {'alloy_type_set': alloy_type_set, 'alloy': alloy} return ...
合金修改
AlloyEdit
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AlloyEdit: """合金修改""" def get(self, request, alloy_id): """指定合金查询展示 :param request: :param alloy_id: :return:""" <|body_0|> def put(self, request, alloy_id): """指定合金修改 :param request: :param alloy_id: :return:""" <|body_1|> def delete(self, request, ...
stack_v2_sparse_classes_36k_train_008556
11,849
no_license
[ { "docstring": "指定合金查询展示 :param request: :param alloy_id: :return:", "name": "get", "signature": "def get(self, request, alloy_id)" }, { "docstring": "指定合金修改 :param request: :param alloy_id: :return:", "name": "put", "signature": "def put(self, request, alloy_id)" }, { "docstring...
3
stack_v2_sparse_classes_30k_train_009375
Implement the Python class `AlloyEdit` described below. Class description: 合金修改 Method signatures and docstrings: - def get(self, request, alloy_id): 指定合金查询展示 :param request: :param alloy_id: :return: - def put(self, request, alloy_id): 指定合金修改 :param request: :param alloy_id: :return: - def delete(self, request, allo...
Implement the Python class `AlloyEdit` described below. Class description: 合金修改 Method signatures and docstrings: - def get(self, request, alloy_id): 指定合金查询展示 :param request: :param alloy_id: :return: - def put(self, request, alloy_id): 指定合金修改 :param request: :param alloy_id: :return: - def delete(self, request, allo...
063332d2a5e2ddabf800817f02074b4f5c162ade
<|skeleton|> class AlloyEdit: """合金修改""" def get(self, request, alloy_id): """指定合金查询展示 :param request: :param alloy_id: :return:""" <|body_0|> def put(self, request, alloy_id): """指定合金修改 :param request: :param alloy_id: :return:""" <|body_1|> def delete(self, request, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AlloyEdit: """合金修改""" def get(self, request, alloy_id): """指定合金查询展示 :param request: :param alloy_id: :return:""" alloy_type_set = alloy_model.AlloyType.objects.only('id', 'type').filter(is_delete=False) alloy = alloy_model.Alloy.objects.only('id', 'name').filter(is_delete=False, i...
the_stack_v2_python_sparse
sfs/apps/alloy/views.py
Hx-someone/sfs-1
train
0
1486af3848f9ce74c1c9ad17c7fc0fe6a6c3b2bb
[ "if self.action in ['login', 'signup', 'verify']:\n permissions = [AllowAny]\nelif self.action in ['profile', 'retrieve', 'update', 'partial_update']:\n permissions = [IsAuthenticated, IsAccountOwner]\nelse:\n permissions = [IsAuthenticated]\nreturn [p() for p in permissions]", "serializer = UserLoginSer...
<|body_start_0|> if self.action in ['login', 'signup', 'verify']: permissions = [AllowAny] elif self.action in ['profile', 'retrieve', 'update', 'partial_update']: permissions = [IsAuthenticated, IsAccountOwner] else: permissions = [IsAuthenticated] re...
User view set. Handle sign up, login and account verification.
UserViewSet
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserViewSet: """User view set. Handle sign up, login and account verification.""" def get_permissions(self): """Assign permissions based on action. If the action is retrieve, custom permission is added so that only the same User can be edited and viewed""" <|body_0|> def...
stack_v2_sparse_classes_36k_train_008557
3,563
permissive
[ { "docstring": "Assign permissions based on action. If the action is retrieve, custom permission is added so that only the same User can be edited and viewed", "name": "get_permissions", "signature": "def get_permissions(self)" }, { "docstring": "User sign in.", "name": "login", "signatu...
5
stack_v2_sparse_classes_30k_train_009513
Implement the Python class `UserViewSet` described below. Class description: User view set. Handle sign up, login and account verification. Method signatures and docstrings: - def get_permissions(self): Assign permissions based on action. If the action is retrieve, custom permission is added so that only the same Use...
Implement the Python class `UserViewSet` described below. Class description: User view set. Handle sign up, login and account verification. Method signatures and docstrings: - def get_permissions(self): Assign permissions based on action. If the action is retrieve, custom permission is added so that only the same Use...
9693e95ca723f1846666838a24c60d0715224e36
<|skeleton|> class UserViewSet: """User view set. Handle sign up, login and account verification.""" def get_permissions(self): """Assign permissions based on action. If the action is retrieve, custom permission is added so that only the same User can be edited and viewed""" <|body_0|> def...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserViewSet: """User view set. Handle sign up, login and account verification.""" def get_permissions(self): """Assign permissions based on action. If the action is retrieve, custom permission is added so that only the same User can be edited and viewed""" if self.action in ['login', 'sig...
the_stack_v2_python_sparse
root/users/api/views/users.py
macknilan/Post-prueba-tecnica-desarrollador-python
train
1
ec26c73f2ab189b55b53dbdfcf44d4b890a40935
[ "self.kekule_smiles = kekule_smiles\nself.all_bonds_explicit = all_bonds_explicit\nself.all_hs_explicit = all_hs_explicit\nself.sanitize = sanitize\nself.seed = seed\nif self.seed > -1:\n np.random.seed(self.seed)", "molecule = Chem.MolFromSmiles(smiles, sanitize=self.sanitize)\nif molecule is None:\n logge...
<|body_start_0|> self.kekule_smiles = kekule_smiles self.all_bonds_explicit = all_bonds_explicit self.all_hs_explicit = all_hs_explicit self.sanitize = sanitize self.seed = seed if self.seed > -1: np.random.seed(self.seed) <|end_body_0|> <|body_start_1|> ...
Augment a SMILES string, according to Bjerrum (2017).
Augment
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Augment: """Augment a SMILES string, according to Bjerrum (2017).""" def __init__(self, kekule_smiles: bool=False, all_bonds_explicit: bool=False, all_hs_explicit: bool=False, sanitize: bool=True, seed: int=-1) -> None: """NOTE: These parameter need to be passed down to the enumerato...
stack_v2_sparse_classes_36k_train_008558
22,008
permissive
[ { "docstring": "NOTE: These parameter need to be passed down to the enumerator.", "name": "__init__", "signature": "def __init__(self, kekule_smiles: bool=False, all_bonds_explicit: bool=False, all_hs_explicit: bool=False, sanitize: bool=True, seed: int=-1) -> None" }, { "docstring": "Apply the ...
2
stack_v2_sparse_classes_30k_train_004030
Implement the Python class `Augment` described below. Class description: Augment a SMILES string, according to Bjerrum (2017). Method signatures and docstrings: - def __init__(self, kekule_smiles: bool=False, all_bonds_explicit: bool=False, all_hs_explicit: bool=False, sanitize: bool=True, seed: int=-1) -> None: NOTE...
Implement the Python class `Augment` described below. Class description: Augment a SMILES string, according to Bjerrum (2017). Method signatures and docstrings: - def __init__(self, kekule_smiles: bool=False, all_bonds_explicit: bool=False, all_hs_explicit: bool=False, sanitize: bool=True, seed: int=-1) -> None: NOTE...
27ca3f8c5b5463cd081be5abdea04f5bfa076f39
<|skeleton|> class Augment: """Augment a SMILES string, according to Bjerrum (2017).""" def __init__(self, kekule_smiles: bool=False, all_bonds_explicit: bool=False, all_hs_explicit: bool=False, sanitize: bool=True, seed: int=-1) -> None: """NOTE: These parameter need to be passed down to the enumerato...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Augment: """Augment a SMILES string, according to Bjerrum (2017).""" def __init__(self, kekule_smiles: bool=False, all_bonds_explicit: bool=False, all_hs_explicit: bool=False, sanitize: bool=True, seed: int=-1) -> None: """NOTE: These parameter need to be passed down to the enumerator.""" ...
the_stack_v2_python_sparse
pytoda/smiles/transforms.py
PaccMann/paccmann_datasets
train
22
a14a608257c4d48d58e96b617e3b1ba286c6296a
[ "try:\n attr_name = attr_name.lower()\n self.__getattribute__(attr_name)\nexcept AttributeError:\n try:\n attr_name = self.Attribute[attr_name.upper()].value\n self.__getattribute__(attr_name)\n except KeyError:\n raise AttributeError(f'No attribute \"{attr_name}\"')\nfor field in d...
<|body_start_0|> try: attr_name = attr_name.lower() self.__getattribute__(attr_name) except AttributeError: try: attr_name = self.Attribute[attr_name.upper()].value self.__getattribute__(attr_name) except KeyError: ...
Learner specific parameters
LearnerParams
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LearnerParams: """Learner specific parameters""" def set_attr(self, attr_name: str, value: Union[int, float]) -> None: """Enhanced set attribute method that has enhanced checking""" <|body_0|> def get_attr(self, attr_name: str) -> Optional[Union[int, float]]: """...
stack_v2_sparse_classes_36k_train_008559
6,052
permissive
[ { "docstring": "Enhanced set attribute method that has enhanced checking", "name": "set_attr", "signature": "def set_attr(self, attr_name: str, value: Union[int, float]) -> None" }, { "docstring": "Attribute accessor with more robust handling of attribute name", "name": "get_attr", "sign...
2
stack_v2_sparse_classes_30k_train_005971
Implement the Python class `LearnerParams` described below. Class description: Learner specific parameters Method signatures and docstrings: - def set_attr(self, attr_name: str, value: Union[int, float]) -> None: Enhanced set attribute method that has enhanced checking - def get_attr(self, attr_name: str) -> Optional...
Implement the Python class `LearnerParams` described below. Class description: Learner specific parameters Method signatures and docstrings: - def set_attr(self, attr_name: str, value: Union[int, float]) -> None: Enhanced set attribute method that has enhanced checking - def get_attr(self, attr_name: str) -> Optional...
bb11e9fceb2bcb22621ed1bd743858bfa5c2475e
<|skeleton|> class LearnerParams: """Learner specific parameters""" def set_attr(self, attr_name: str, value: Union[int, float]) -> None: """Enhanced set attribute method that has enhanced checking""" <|body_0|> def get_attr(self, attr_name: str) -> Optional[Union[int, float]]: """...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LearnerParams: """Learner specific parameters""" def set_attr(self, attr_name: str, value: Union[int, float]) -> None: """Enhanced set attribute method that has enhanced checking""" try: attr_name = attr_name.lower() self.__getattribute__(attr_name) except ...
the_stack_v2_python_sparse
src/apu/types.py
zhbfy/arbitrary_pu
train
0
27438849b800c9fa65cba43b03818eb13c7d7d86
[ "self._vectorizer = TfidfVectorizer(ngram_range=ngram_range, min_df=min_df, max_df=max_df, analyzer=analyzer.value)\nself._documents = documents\nself._index = self._vectorizer.fit_transform(map(text_getter, self._documents))", "query_vector = self._vectorizer.transform([query])\nscores = zip(self._documents, sel...
<|body_start_0|> self._vectorizer = TfidfVectorizer(ngram_range=ngram_range, min_df=min_df, max_df=max_df, analyzer=analyzer.value) self._documents = documents self._index = self._vectorizer.fit_transform(map(text_getter, self._documents)) <|end_body_0|> <|body_start_1|> query_vector = ...
A simple text index from a corpus of text using tf-idf similarity.
TextIndex
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TextIndex: """A simple text index from a corpus of text using tf-idf similarity.""" def __init__(self, documents, text_getter, ngram_range=(1, 2), analyzer=Analyzer.WORD, min_df=1, max_df=0.9): """Init parameters for TextIndex. Args: documents: Corpus of documents to be indexed and r...
stack_v2_sparse_classes_36k_train_008560
4,223
permissive
[ { "docstring": "Init parameters for TextIndex. Args: documents: Corpus of documents to be indexed and retrieved. text_getter: Function to extract text from documents. ngram_range: tuple (min_n, max_n), default=(1, 2) The lower and upper boundary of the range of n-values for different n-grams to be extracted. Al...
2
stack_v2_sparse_classes_30k_train_007763
Implement the Python class `TextIndex` described below. Class description: A simple text index from a corpus of text using tf-idf similarity. Method signatures and docstrings: - def __init__(self, documents, text_getter, ngram_range=(1, 2), analyzer=Analyzer.WORD, min_df=1, max_df=0.9): Init parameters for TextIndex....
Implement the Python class `TextIndex` described below. Class description: A simple text index from a corpus of text using tf-idf similarity. Method signatures and docstrings: - def __init__(self, documents, text_getter, ngram_range=(1, 2), analyzer=Analyzer.WORD, min_df=1, max_df=0.9): Init parameters for TextIndex....
569a3c31451d941165bd10783f73f494406b3906
<|skeleton|> class TextIndex: """A simple text index from a corpus of text using tf-idf similarity.""" def __init__(self, documents, text_getter, ngram_range=(1, 2), analyzer=Analyzer.WORD, min_df=1, max_df=0.9): """Init parameters for TextIndex. Args: documents: Corpus of documents to be indexed and r...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TextIndex: """A simple text index from a corpus of text using tf-idf similarity.""" def __init__(self, documents, text_getter, ngram_range=(1, 2), analyzer=Analyzer.WORD, min_df=1, max_df=0.9): """Init parameters for TextIndex. Args: documents: Corpus of documents to be indexed and retrieved. tex...
the_stack_v2_python_sparse
tapas/utils/text_index.py
google-research/tapas
train
1,043
4ea8d5f89063d53d94eae68df1e35943c20ac8f4
[ "if np.isscalar(times):\n t = np.asarray([times])\nelse:\n t = np.asarray(times)\nif np.isscalar(data):\n d = data * np.ones((t.size,))\nelse:\n d = np.asarray(data)\nreturn (d, t)", "if len(data.shape) != 1:\n raise EquationException('{}: Invalid number of dimensions in prescribed scalar data. Exp...
<|body_start_0|> if np.isscalar(times): t = np.asarray([times]) else: t = np.asarray(times) if np.isscalar(data): d = data * np.ones((t.size,)) else: d = np.asarray(data) return (d, t) <|end_body_0|> <|body_start_1|> if len...
PrescribedScalarParameter
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PrescribedScalarParameter: def _setScalarData(self, data, times=0): """Set prescribed scalar data appropriately.""" <|body_0|> def _verifySettingsPrescribedScalarData(self, name, data, times): """Verify the structure of the prescribed data.""" <|body_1|> <|e...
stack_v2_sparse_classes_36k_train_008561
1,257
permissive
[ { "docstring": "Set prescribed scalar data appropriately.", "name": "_setScalarData", "signature": "def _setScalarData(self, data, times=0)" }, { "docstring": "Verify the structure of the prescribed data.", "name": "_verifySettingsPrescribedScalarData", "signature": "def _verifySettingsP...
2
stack_v2_sparse_classes_30k_train_010390
Implement the Python class `PrescribedScalarParameter` described below. Class description: Implement the PrescribedScalarParameter class. Method signatures and docstrings: - def _setScalarData(self, data, times=0): Set prescribed scalar data appropriately. - def _verifySettingsPrescribedScalarData(self, name, data, t...
Implement the Python class `PrescribedScalarParameter` described below. Class description: Implement the PrescribedScalarParameter class. Method signatures and docstrings: - def _setScalarData(self, data, times=0): Set prescribed scalar data appropriately. - def _verifySettingsPrescribedScalarData(self, name, data, t...
eba9fabddfa4ef439737807ef30978a52ab55afb
<|skeleton|> class PrescribedScalarParameter: def _setScalarData(self, data, times=0): """Set prescribed scalar data appropriately.""" <|body_0|> def _verifySettingsPrescribedScalarData(self, name, data, times): """Verify the structure of the prescribed data.""" <|body_1|> <|e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PrescribedScalarParameter: def _setScalarData(self, data, times=0): """Set prescribed scalar data appropriately.""" if np.isscalar(times): t = np.asarray([times]) else: t = np.asarray(times) if np.isscalar(data): d = data * np.ones((t.size,))...
the_stack_v2_python_sparse
py/DREAM/Settings/Equations/PrescribedScalarParameter.py
anymodel/DREAM-1
train
0
8363b2b01ff97527f83427f0d277719d2a8ded3f
[ "super().__init__(productcode, description, marketprice, rentalprice)\nself.productcode = productcode\nself.description = description\nself.marketprice = marketprice\nself.rentalprice = rentalprice\nself.material = material\nself.size = size", "outputdict = {}\noutputdict['productcode'] = self.productcode\noutput...
<|body_start_0|> super().__init__(productcode, description, marketprice, rentalprice) self.productcode = productcode self.description = description self.marketprice = marketprice self.rentalprice = rentalprice self.material = material self.size = size <|end_body_0...
Class for inventory
Furniture
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Furniture: """Class for inventory""" def __init__(self, productcode, description, marketprice, rentalprice, material, size): """initializing variables""" <|body_0|> def returnasdictionary(self): """return as dictionary""" <|body_1|> <|end_skeleton|> <|b...
stack_v2_sparse_classes_36k_train_008562
1,114
no_license
[ { "docstring": "initializing variables", "name": "__init__", "signature": "def __init__(self, productcode, description, marketprice, rentalprice, material, size)" }, { "docstring": "return as dictionary", "name": "returnasdictionary", "signature": "def returnasdictionary(self)" } ]
2
null
Implement the Python class `Furniture` described below. Class description: Class for inventory Method signatures and docstrings: - def __init__(self, productcode, description, marketprice, rentalprice, material, size): initializing variables - def returnasdictionary(self): return as dictionary
Implement the Python class `Furniture` described below. Class description: Class for inventory Method signatures and docstrings: - def __init__(self, productcode, description, marketprice, rentalprice, material, size): initializing variables - def returnasdictionary(self): return as dictionary <|skeleton|> class Fur...
ac12beeae8aa57135bbcd03ac7a4f977fa3bdb56
<|skeleton|> class Furniture: """Class for inventory""" def __init__(self, productcode, description, marketprice, rentalprice, material, size): """initializing variables""" <|body_0|> def returnasdictionary(self): """return as dictionary""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Furniture: """Class for inventory""" def __init__(self, productcode, description, marketprice, rentalprice, material, size): """initializing variables""" super().__init__(productcode, description, marketprice, rentalprice) self.productcode = productcode self.description = ...
the_stack_v2_python_sparse
students/Daniel_Carrasco/lesson01/assignment/inventory_management/furnitureClass.py
UWPCE-PythonCert-ClassRepos/py220-online-201904-V2
train
1
c50eb8e053f5134c8eb92a4d910d5fde5f459e8f
[ "Algorithm.__init__(self)\nself.name = 'Keep only largest connected component'\nself.parent = 'Graph filtering'", "image, graph = args\nlargest = max(nx.connected_component_subgraphs(graph), key=len)\nself.result['img'] = largest\ntmp = self.draw_edges(image, largest)\ndrawn = self.draw_nodes(tmp, largest)\nself....
<|body_start_0|> Algorithm.__init__(self) self.name = 'Keep only largest connected component' self.parent = 'Graph filtering' <|end_body_0|> <|body_start_1|> image, graph = args largest = max(nx.connected_component_subgraphs(graph), key=len) self.result['img'] = largest ...
Largest component filter implementation.
AlgBody
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AlgBody: """Largest component filter implementation.""" def __init__(self): """Instance vars: | *name* : name of the algorithm | *parent* : name of the appropriate category""" <|body_0|> def process(self, args): """Keep only largest connected component from nefi1...
stack_v2_sparse_classes_36k_train_008563
2,726
no_license
[ { "docstring": "Instance vars: | *name* : name of the algorithm | *parent* : name of the appropriate category", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Keep only largest connected component from nefi1. Args: | *args* : a list containing image array and Graph obje...
4
stack_v2_sparse_classes_30k_train_020758
Implement the Python class `AlgBody` described below. Class description: Largest component filter implementation. Method signatures and docstrings: - def __init__(self): Instance vars: | *name* : name of the algorithm | *parent* : name of the appropriate category - def process(self, args): Keep only largest connected...
Implement the Python class `AlgBody` described below. Class description: Largest component filter implementation. Method signatures and docstrings: - def __init__(self): Instance vars: | *name* : name of the algorithm | *parent* : name of the appropriate category - def process(self, args): Keep only largest connected...
0dc9becc09da22af3edac90b81b1dd9b1f44fd5b
<|skeleton|> class AlgBody: """Largest component filter implementation.""" def __init__(self): """Instance vars: | *name* : name of the algorithm | *parent* : name of the appropriate category""" <|body_0|> def process(self, args): """Keep only largest connected component from nefi1...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AlgBody: """Largest component filter implementation.""" def __init__(self): """Instance vars: | *name* : name of the algorithm | *parent* : name of the appropriate category""" Algorithm.__init__(self) self.name = 'Keep only largest connected component' self.parent = 'Graph...
the_stack_v2_python_sparse
Andreas_Algorithms_Prototype/largest.py
andreasfirczynski/NetworkExtractionFromImages
train
0
87169dbebcb456678f87a682a1488d299cf21901
[ "self.pool_size = pool_size\nif self.pool_size > 0:\n self.num_imgs = 0\n self.images = []", "if isinstance(images, Tensor):\n images = images.asnumpy()\nif self.pool_size == 0:\n return Tensor(images)\nreturn_images = []\nfor image in images:\n if self.num_imgs < self.pool_size:\n self.num_...
<|body_start_0|> self.pool_size = pool_size if self.pool_size > 0: self.num_imgs = 0 self.images = [] <|end_body_0|> <|body_start_1|> if isinstance(images, Tensor): images = images.asnumpy() if self.pool_size == 0: return Tensor(images) ...
This class implements an image buffer that stores previously generated images. This buffer enables us to update discriminators using a history of generated images rather than the ones produced by the latest generators.
ImagePool
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-proprietary-license" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImagePool: """This class implements an image buffer that stores previously generated images. This buffer enables us to update discriminators using a history of generated images rather than the ones produced by the latest generators.""" def __init__(self, pool_size): """Initialize the...
stack_v2_sparse_classes_36k_train_008564
5,554
permissive
[ { "docstring": "Initialize the ImagePool class Args: pool_size (int): the size of image buffer, if pool_size=0, no buffer will be created.", "name": "__init__", "signature": "def __init__(self, pool_size)" }, { "docstring": "Return an image from the pool. Args: images: the latest generated image...
2
stack_v2_sparse_classes_30k_train_006591
Implement the Python class `ImagePool` described below. Class description: This class implements an image buffer that stores previously generated images. This buffer enables us to update discriminators using a history of generated images rather than the ones produced by the latest generators. Method signatures and do...
Implement the Python class `ImagePool` described below. Class description: This class implements an image buffer that stores previously generated images. This buffer enables us to update discriminators using a history of generated images rather than the ones produced by the latest generators. Method signatures and do...
eab643f51336dbf7d711f02d27e6516e5affee59
<|skeleton|> class ImagePool: """This class implements an image buffer that stores previously generated images. This buffer enables us to update discriminators using a history of generated images rather than the ones produced by the latest generators.""" def __init__(self, pool_size): """Initialize the...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImagePool: """This class implements an image buffer that stores previously generated images. This buffer enables us to update discriminators using a history of generated images rather than the ones produced by the latest generators.""" def __init__(self, pool_size): """Initialize the ImagePool cl...
the_stack_v2_python_sparse
official/cv/CycleGAN/src/utils/tools.py
mindspore-ai/models
train
301
162369d9f0693db5465a5698f63851fb7f331427
[ "self.idf_dict = idf_dict\nself.default_idf = default_idf\nself.word_list = word_list\nself.keyword_num = keyword_num\nself.tf_dict = self.get_tf_dict()", "tf_dict = {}\nfor word in self.word_list:\n tf_dict[word] = tf_dict.get(word, 0.0) + 1.0\ntt_count = len(self.word_list)\nfor key, value in tf_dict.items()...
<|body_start_0|> self.idf_dict = idf_dict self.default_idf = default_idf self.word_list = word_list self.keyword_num = keyword_num self.tf_dict = self.get_tf_dict() <|end_body_0|> <|body_start_1|> tf_dict = {} for word in self.word_list: tf_dict[word]...
TfIdfModel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TfIdfModel: def __init__(self, idf_dict, default_idf, word_list, keyword_num): """[summary] Args: idf_dict ([type]): 训练好的idf字典 default_idf ([type]): 默认idf值 word_list ([type]): 处理后的待提取文本 keyword_num ([type]): 关键词数量""" <|body_0|> def get_tf_dict(self): """统计 TF 值 Retur...
stack_v2_sparse_classes_36k_train_008565
12,729
no_license
[ { "docstring": "[summary] Args: idf_dict ([type]): 训练好的idf字典 default_idf ([type]): 默认idf值 word_list ([type]): 处理后的待提取文本 keyword_num ([type]): 关键词数量", "name": "__init__", "signature": "def __init__(self, idf_dict, default_idf, word_list, keyword_num)" }, { "docstring": "统计 TF 值 Returns: [type]: [...
3
null
Implement the Python class `TfIdfModel` described below. Class description: Implement the TfIdfModel class. Method signatures and docstrings: - def __init__(self, idf_dict, default_idf, word_list, keyword_num): [summary] Args: idf_dict ([type]): 训练好的idf字典 default_idf ([type]): 默认idf值 word_list ([type]): 处理后的待提取文本 key...
Implement the Python class `TfIdfModel` described below. Class description: Implement the TfIdfModel class. Method signatures and docstrings: - def __init__(self, idf_dict, default_idf, word_list, keyword_num): [summary] Args: idf_dict ([type]): 训练好的idf字典 default_idf ([type]): 默认idf值 word_list ([type]): 处理后的待提取文本 key...
b1690cc6e487aff70e4c1fe9a98cd4d5b6557ce8
<|skeleton|> class TfIdfModel: def __init__(self, idf_dict, default_idf, word_list, keyword_num): """[summary] Args: idf_dict ([type]): 训练好的idf字典 default_idf ([type]): 默认idf值 word_list ([type]): 处理后的待提取文本 keyword_num ([type]): 关键词数量""" <|body_0|> def get_tf_dict(self): """统计 TF 值 Retur...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TfIdfModel: def __init__(self, idf_dict, default_idf, word_list, keyword_num): """[summary] Args: idf_dict ([type]): 训练好的idf字典 default_idf ([type]): 默认idf值 word_list ([type]): 处理后的待提取文本 keyword_num ([type]): 关键词数量""" self.idf_dict = idf_dict self.default_idf = default_idf self....
the_stack_v2_python_sparse
src/src_nlp/keyword_extract/keyword_extract_demo.py
YanyiPU/deeplearning
train
0
87da29dba6340ec4955cc8c858e6108d0a19d6ed
[ "super(Summarization, self).__init__(**kwargs)\nself.d_model = d_model\nself.n_head = n_head\nself.d_head = d_head\nself.initializer = initializer\nself.dropout = dropout\nself.dropout_att = dropout_att\nself.use_proj = use_proj\nself.summary_type = summary_type", "if self.use_proj:\n self.proj_layer = tf.kera...
<|body_start_0|> super(Summarization, self).__init__(**kwargs) self.d_model = d_model self.n_head = n_head self.d_head = d_head self.initializer = initializer self.dropout = dropout self.dropout_att = dropout_att self.use_proj = use_proj self.summa...
The layer to pool the output from XLNet model into a vector.
Summarization
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Summarization: """The layer to pool the output from XLNet model into a vector.""" def __init__(self, d_model, n_head, d_head, dropout, dropout_att, initializer, use_proj=True, summary_type='last', **kwargs): """Constructs Summarization layer. Args: d_model: int, the dimension of mode...
stack_v2_sparse_classes_36k_train_008566
46,062
permissive
[ { "docstring": "Constructs Summarization layer. Args: d_model: int, the dimension of model hidden state. n_head: int, the number of attention heads. d_head: int, the dimension size of each attention head. dropout: float, dropout rate. dropout_att: float, dropout rate on attention probabilities. initializer: Ini...
3
stack_v2_sparse_classes_30k_train_017394
Implement the Python class `Summarization` described below. Class description: The layer to pool the output from XLNet model into a vector. Method signatures and docstrings: - def __init__(self, d_model, n_head, d_head, dropout, dropout_att, initializer, use_proj=True, summary_type='last', **kwargs): Constructs Summa...
Implement the Python class `Summarization` described below. Class description: The layer to pool the output from XLNet model into a vector. Method signatures and docstrings: - def __init__(self, d_model, n_head, d_head, dropout, dropout_att, initializer, use_proj=True, summary_type='last', **kwargs): Constructs Summa...
a115d918f6894a69586174653172be0b5d1de952
<|skeleton|> class Summarization: """The layer to pool the output from XLNet model into a vector.""" def __init__(self, d_model, n_head, d_head, dropout, dropout_att, initializer, use_proj=True, summary_type='last', **kwargs): """Constructs Summarization layer. Args: d_model: int, the dimension of mode...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Summarization: """The layer to pool the output from XLNet model into a vector.""" def __init__(self, d_model, n_head, d_head, dropout, dropout_att, initializer, use_proj=True, summary_type='last', **kwargs): """Constructs Summarization layer. Args: d_model: int, the dimension of model hidden stat...
the_stack_v2_python_sparse
models/official/nlp/xlnet/xlnet_modeling.py
finnickniu/tensorflow_object_detection_tflite
train
60
3b29838a84dd7a58ad4eff9f29b9e99e1358b71f
[ "super().__init__()\nif nonlinear_activation:\n nonlinear_activation = nonlinear_activation.lower()\ninitialize(self, init_type)\nself.layers = nn.LayerList()\nassert len(kernel_sizes) == 2\nassert kernel_sizes[0] % 2 == 1\nassert kernel_sizes[1] % 2 == 1\nself.layers.append(nn.Sequential(getattr(nn, pad)((np.pr...
<|body_start_0|> super().__init__() if nonlinear_activation: nonlinear_activation = nonlinear_activation.lower() initialize(self, init_type) self.layers = nn.LayerList() assert len(kernel_sizes) == 2 assert kernel_sizes[0] % 2 == 1 assert kernel_sizes[...
MelGAN discriminator module.
MelGANDiscriminator
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MelGANDiscriminator: """MelGAN discriminator module.""" def __init__(self, in_channels: int=1, out_channels: int=1, kernel_sizes: List[int]=[5, 3], channels: int=16, max_downsample_channels: int=1024, bias: bool=True, downsample_scales: List[int]=[4, 4, 4, 4], nonlinear_activation: str='leak...
stack_v2_sparse_classes_36k_train_008567
20,745
permissive
[ { "docstring": "Initilize MelGAN discriminator module. Args: in_channels (int): Number of input channels. out_channels (int): Number of output channels. kernel_sizes (List[int]): List of two kernel sizes. The prod will be used for the first conv layer, and the first and the second kernel sizes will be used for ...
2
null
Implement the Python class `MelGANDiscriminator` described below. Class description: MelGAN discriminator module. Method signatures and docstrings: - def __init__(self, in_channels: int=1, out_channels: int=1, kernel_sizes: List[int]=[5, 3], channels: int=16, max_downsample_channels: int=1024, bias: bool=True, downsa...
Implement the Python class `MelGANDiscriminator` described below. Class description: MelGAN discriminator module. Method signatures and docstrings: - def __init__(self, in_channels: int=1, out_channels: int=1, kernel_sizes: List[int]=[5, 3], channels: int=16, max_downsample_channels: int=1024, bias: bool=True, downsa...
17854a04d43c231eff66bfed9d6aa55e94a29e79
<|skeleton|> class MelGANDiscriminator: """MelGAN discriminator module.""" def __init__(self, in_channels: int=1, out_channels: int=1, kernel_sizes: List[int]=[5, 3], channels: int=16, max_downsample_channels: int=1024, bias: bool=True, downsample_scales: List[int]=[4, 4, 4, 4], nonlinear_activation: str='leak...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MelGANDiscriminator: """MelGAN discriminator module.""" def __init__(self, in_channels: int=1, out_channels: int=1, kernel_sizes: List[int]=[5, 3], channels: int=16, max_downsample_channels: int=1024, bias: bool=True, downsample_scales: List[int]=[4, 4, 4, 4], nonlinear_activation: str='leakyrelu', nonli...
the_stack_v2_python_sparse
paddlespeech/t2s/models/melgan/melgan.py
anniyanvr/DeepSpeech-1
train
0
15ed22f7fffd066270fb8d0534cc859287a9c769
[ "self.main_window = QtGui.QWidget()\nself.gui = Gui()\nself.gui.setupUi(self.main_window)\nself.gui.drawing_widget.mousePressEvent = self.mouse_press\nself.gui.drawing_widget.paintEvent = self.paint_event\nself.birds = []\nself.birds.append(Cardinal(random.randint(20, 600), random.randint(60, 400)))\nself.birds.app...
<|body_start_0|> self.main_window = QtGui.QWidget() self.gui = Gui() self.gui.setupUi(self.main_window) self.gui.drawing_widget.mousePressEvent = self.mouse_press self.gui.drawing_widget.paintEvent = self.paint_event self.birds = [] self.birds.append(Cardinal(rand...
Application class to create and control the gui.
App
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class App: """Application class to create and control the gui.""" def __init__(self): """Initialize the gui.""" <|body_0|> def mouse_press(self, event): """Called automatically when the user presses the mouse button on the drawing widget. :param PyQt.QtGui.QMouseEvent ...
stack_v2_sparse_classes_36k_train_008568
13,878
no_license
[ { "docstring": "Initialize the gui.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Called automatically when the user presses the mouse button on the drawing widget. :param PyQt.QtGui.QMouseEvent event: The event object from PyQt. :return: None", "name": "mouse_pr...
4
stack_v2_sparse_classes_30k_train_020914
Implement the Python class `App` described below. Class description: Application class to create and control the gui. Method signatures and docstrings: - def __init__(self): Initialize the gui. - def mouse_press(self, event): Called automatically when the user presses the mouse button on the drawing widget. :param Py...
Implement the Python class `App` described below. Class description: Application class to create and control the gui. Method signatures and docstrings: - def __init__(self): Initialize the gui. - def mouse_press(self, event): Called automatically when the user presses the mouse button on the drawing widget. :param Py...
0e3470085083012f893adb22aa46d46039016965
<|skeleton|> class App: """Application class to create and control the gui.""" def __init__(self): """Initialize the gui.""" <|body_0|> def mouse_press(self, event): """Called automatically when the user presses the mouse button on the drawing widget. :param PyQt.QtGui.QMouseEvent ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class App: """Application class to create and control the gui.""" def __init__(self): """Initialize the gui.""" self.main_window = QtGui.QWidget() self.gui = Gui() self.gui.setupUi(self.main_window) self.gui.drawing_widget.mousePressEvent = self.mouse_press self....
the_stack_v2_python_sparse
CS_210 (Introduction to Programming)/Labs/Lab34_AviaryApp.py
JacobOrner/USAFA
train
0
c3f2afb1cec4f1fb11ad16ba472ebddf50d73508
[ "self.key = 'sys_session_check'\nself.desc = _('Checks sessions so they are live.')\nself.interval = 60\nself.persistent = True", "global _SESSIONS\nif not _SESSIONS:\n from src.server.sessionhandler import SESSIONS as _SESSIONS\n_SESSIONS.validate_sessions()" ]
<|body_start_0|> self.key = 'sys_session_check' self.desc = _('Checks sessions so they are live.') self.interval = 60 self.persistent = True <|end_body_0|> <|body_start_1|> global _SESSIONS if not _SESSIONS: from src.server.sessionhandler import SESSIONS as _...
Check sessions regularly.
CheckSessions
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CheckSessions: """Check sessions regularly.""" def at_script_creation(self): """Setup the script""" <|body_0|> def at_repeat(self): """called every 60 seconds""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.key = 'sys_session_check' ...
stack_v2_sparse_classes_36k_train_008569
17,327
permissive
[ { "docstring": "Setup the script", "name": "at_script_creation", "signature": "def at_script_creation(self)" }, { "docstring": "called every 60 seconds", "name": "at_repeat", "signature": "def at_repeat(self)" } ]
2
stack_v2_sparse_classes_30k_train_017350
Implement the Python class `CheckSessions` described below. Class description: Check sessions regularly. Method signatures and docstrings: - def at_script_creation(self): Setup the script - def at_repeat(self): called every 60 seconds
Implement the Python class `CheckSessions` described below. Class description: Check sessions regularly. Method signatures and docstrings: - def at_script_creation(self): Setup the script - def at_repeat(self): called every 60 seconds <|skeleton|> class CheckSessions: """Check sessions regularly.""" def at_...
e8025abd5345b95fe7bee458d4dcf3a91e24602c
<|skeleton|> class CheckSessions: """Check sessions regularly.""" def at_script_creation(self): """Setup the script""" <|body_0|> def at_repeat(self): """called every 60 seconds""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CheckSessions: """Check sessions regularly.""" def at_script_creation(self): """Setup the script""" self.key = 'sys_session_check' self.desc = _('Checks sessions so they are live.') self.interval = 60 self.persistent = True def at_repeat(self): """call...
the_stack_v2_python_sparse
src/scripts/scripts.py
Aumnren/evennia
train
0
06a787cdda25d2773af420a6677b67dfd701745d
[ "self.data = data\nself.left = None\nself.right = None", "if val < self.data:\n if self.left is None:\n self.left = Node(val)\n else:\n self.left.insert(val)\nif val > self.data:\n if self.right is None:\n self.right = Node(val)\n else:\n self.right.insert(val)", "tree = ...
<|body_start_0|> self.data = data self.left = None self.right = None <|end_body_0|> <|body_start_1|> if val < self.data: if self.left is None: self.left = Node(val) else: self.left.insert(val) if val > self.data: ...
Node
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Node: def __init__(self, data): """Initialize Node data attributes.""" <|body_0|> def insert(self, val): """Insert values to tree accordingly.""" <|body_1|> def preorderTraversal(self, val): """Performs NLR traversal algorithm using recursion."""...
stack_v2_sparse_classes_36k_train_008570
1,606
no_license
[ { "docstring": "Initialize Node data attributes.", "name": "__init__", "signature": "def __init__(self, data)" }, { "docstring": "Insert values to tree accordingly.", "name": "insert", "signature": "def insert(self, val)" }, { "docstring": "Performs NLR traversal algorithm using ...
3
stack_v2_sparse_classes_30k_train_001676
Implement the Python class `Node` described below. Class description: Implement the Node class. Method signatures and docstrings: - def __init__(self, data): Initialize Node data attributes. - def insert(self, val): Insert values to tree accordingly. - def preorderTraversal(self, val): Performs NLR traversal algorith...
Implement the Python class `Node` described below. Class description: Implement the Node class. Method signatures and docstrings: - def __init__(self, data): Initialize Node data attributes. - def insert(self, val): Insert values to tree accordingly. - def preorderTraversal(self, val): Performs NLR traversal algorith...
9ad4b2ab8b6e1bf643534f61fe030ca56b094bde
<|skeleton|> class Node: def __init__(self, data): """Initialize Node data attributes.""" <|body_0|> def insert(self, val): """Insert values to tree accordingly.""" <|body_1|> def preorderTraversal(self, val): """Performs NLR traversal algorithm using recursion."""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Node: def __init__(self, data): """Initialize Node data attributes.""" self.data = data self.left = None self.right = None def insert(self, val): """Insert values to tree accordingly.""" if val < self.data: if self.left is None: ...
the_stack_v2_python_sparse
trees/tree traversals/preorder.py
gabrielleevaristo/algo-practice
train
0
5b04c9575c93733eae442c8a81cead6129515b36
[ "if Database.__instance is None:\n Database()\nreturn Database.__instance", "if Database.__instance is not None:\n raise Exception('This class is a singleton!')\nelse:\n Database.__instance = self\n self.connection = init_connection_engine()" ]
<|body_start_0|> if Database.__instance is None: Database() return Database.__instance <|end_body_0|> <|body_start_1|> if Database.__instance is not None: raise Exception('This class is a singleton!') else: Database.__instance = self self....
Singleton Database class to connect SQLServer. Database provides a connection to a remote SQLServer. Attributes: connection: db instance.
Database
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Database: """Singleton Database class to connect SQLServer. Database provides a connection to a remote SQLServer. Attributes: connection: db instance.""" def get_instance(): """Static access method.""" <|body_0|> def __init__(self): """Virtually private construct...
stack_v2_sparse_classes_36k_train_008571
5,624
permissive
[ { "docstring": "Static access method.", "name": "get_instance", "signature": "def get_instance()" }, { "docstring": "Virtually private constructor.", "name": "__init__", "signature": "def __init__(self)" } ]
2
stack_v2_sparse_classes_30k_val_000812
Implement the Python class `Database` described below. Class description: Singleton Database class to connect SQLServer. Database provides a connection to a remote SQLServer. Attributes: connection: db instance. Method signatures and docstrings: - def get_instance(): Static access method. - def __init__(self): Virtua...
Implement the Python class `Database` described below. Class description: Singleton Database class to connect SQLServer. Database provides a connection to a remote SQLServer. Attributes: connection: db instance. Method signatures and docstrings: - def get_instance(): Static access method. - def __init__(self): Virtua...
f47c6cce471d97104074d403ab9ec39a08276213
<|skeleton|> class Database: """Singleton Database class to connect SQLServer. Database provides a connection to a remote SQLServer. Attributes: connection: db instance.""" def get_instance(): """Static access method.""" <|body_0|> def __init__(self): """Virtually private construct...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Database: """Singleton Database class to connect SQLServer. Database provides a connection to a remote SQLServer. Attributes: connection: db instance.""" def get_instance(): """Static access method.""" if Database.__instance is None: Database() return Database.__instan...
the_stack_v2_python_sparse
util/database.py
ReadMoa/web-service
train
0
fe8af5173828e5f2ba3eec3accdcd3de4d5ac61f
[ "self.filename = filename\nself.__outputFieldsCsv = copy.deepcopy(outputFieldsCsv)\nself.__headerFiedlNames = None\nself.__boolAddShapeFields = boolAddShapeFields\nself.__userFieldShapeMap = userFieldShapeMap\ntry:\n self.__log = log\n if self.__outputFieldsCsv is not None:\n with open(self.filename, '...
<|body_start_0|> self.filename = filename self.__outputFieldsCsv = copy.deepcopy(outputFieldsCsv) self.__headerFiedlNames = None self.__boolAddShapeFields = boolAddShapeFields self.__userFieldShapeMap = userFieldShapeMap try: self.__log = log if se...
API for write output CSV files write data output files
CSV_Writer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CSV_Writer: """API for write output CSV files write data output files""" def __init__(self, log, filename, outputFieldsCsv, boolAddShapeFields=False, userFieldShapeMap=None): """Constructor :param log: logger object :param filename: Work file name :param inputFields: Column header na...
stack_v2_sparse_classes_36k_train_008572
8,314
permissive
[ { "docstring": "Constructor :param log: logger object :param filename: Work file name :param inputFields: Column header names list for output file", "name": "__init__", "signature": "def __init__(self, log, filename, outputFieldsCsv, boolAddShapeFields=False, userFieldShapeMap=None)" }, { "docst...
4
stack_v2_sparse_classes_30k_train_011035
Implement the Python class `CSV_Writer` described below. Class description: API for write output CSV files write data output files Method signatures and docstrings: - def __init__(self, log, filename, outputFieldsCsv, boolAddShapeFields=False, userFieldShapeMap=None): Constructor :param log: logger object :param file...
Implement the Python class `CSV_Writer` described below. Class description: API for write output CSV files write data output files Method signatures and docstrings: - def __init__(self, log, filename, outputFieldsCsv, boolAddShapeFields=False, userFieldShapeMap=None): Constructor :param log: logger object :param file...
9764fcb86d3898b232c4cc333dab75ebe41cd421
<|skeleton|> class CSV_Writer: """API for write output CSV files write data output files""" def __init__(self, log, filename, outputFieldsCsv, boolAddShapeFields=False, userFieldShapeMap=None): """Constructor :param log: logger object :param filename: Work file name :param inputFields: Column header na...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CSV_Writer: """API for write output CSV files write data output files""" def __init__(self, log, filename, outputFieldsCsv, boolAddShapeFields=False, userFieldShapeMap=None): """Constructor :param log: logger object :param filename: Work file name :param inputFields: Column header names list for ...
the_stack_v2_python_sparse
PlanheatMappingModule/PlanHeatDMM/manageCsv/csv_writer.py
Planheat/Planheat-Tool
train
2
a4d9f9fc3acf8095df6ead79c1c8113adc09d09b
[ "line = 'hello world, this is some téśt data!'\nmember = chrome_app.apis.api_member_used(line)\nself.assertIsNone(member)\nline = 'hello world, this is some téśt data!'\nmember = chrome_app.apis.api_member_used(line)\nself.assertIsNone(member)", "line = 'hello world, this test data uses chrome.tts.speak, test tes...
<|body_start_0|> line = 'hello world, this is some téśt data!' member = chrome_app.apis.api_member_used(line) self.assertIsNone(member) line = 'hello world, this is some téśt data!' member = chrome_app.apis.api_member_used(line) self.assertIsNone(member) <|end_body_0|> <...
Tests api_member_used.
TestApiMemberUsed
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestApiMemberUsed: """Tests api_member_used.""" def test_no_member(self): """Tests that if there is no member, None is returned.""" <|body_0|> def test_api_member(self): """Tests that a member is picked up in the input string.""" <|body_1|> def test_...
stack_v2_sparse_classes_36k_train_008573
3,679
permissive
[ { "docstring": "Tests that if there is no member, None is returned.", "name": "test_no_member", "signature": "def test_no_member(self)" }, { "docstring": "Tests that a member is picked up in the input string.", "name": "test_api_member", "signature": "def test_api_member(self)" }, { ...
3
stack_v2_sparse_classes_30k_train_017365
Implement the Python class `TestApiMemberUsed` described below. Class description: Tests api_member_used. Method signatures and docstrings: - def test_no_member(self): Tests that if there is no member, None is returned. - def test_api_member(self): Tests that a member is picked up in the input string. - def test_chro...
Implement the Python class `TestApiMemberUsed` described below. Class description: Tests api_member_used. Method signatures and docstrings: - def test_no_member(self): Tests that if there is no member, None is returned. - def test_api_member(self): Tests that a member is picked up in the input string. - def test_chro...
985419af32f9bbd3abc934db3edc09523477118a
<|skeleton|> class TestApiMemberUsed: """Tests api_member_used.""" def test_no_member(self): """Tests that if there is no member, None is returned.""" <|body_0|> def test_api_member(self): """Tests that a member is picked up in the input string.""" <|body_1|> def test_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestApiMemberUsed: """Tests api_member_used.""" def test_no_member(self): """Tests that if there is no member, None is returned.""" line = 'hello world, this is some téśt data!' member = chrome_app.apis.api_member_used(line) self.assertIsNone(member) line = 'hello ...
the_stack_v2_python_sparse
src/chrome_app/apis_test.py
HoeDetector/caterpillar
train
0
8711cacd47e4ec61718a1afe5a736b487d2e7a1d
[ "self.host = host\nif user:\n self._auth = HTTPBasicAuth(user, password)\nelse:\n self._auth = None\nself.dam = Assets(self)", "try:\n url = self.host + path\n logging.debug('URL - ' + url)\n result = requests.get(url, auth=self._auth)\n logging.debug('Response from the URL : ' + str(result))\n ...
<|body_start_0|> self.host = host if user: self._auth = HTTPBasicAuth(user, password) else: self._auth = None self.dam = Assets(self) <|end_body_0|> <|body_start_1|> try: url = self.host + path logging.debug('URL - ' + url) ...
Connects to and performs the get and post operations on the connected AEM instance
Connector
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Connector: """Connects to and performs the get and post operations on the connected AEM instance""" def __init__(self, host, user, password): """Initialize connection to the host with given user and password""" <|body_0|> def rawget(self, path): """Performs a get...
stack_v2_sparse_classes_36k_train_008574
3,242
permissive
[ { "docstring": "Initialize connection to the host with given user and password", "name": "__init__", "signature": "def __init__(self, host, user, password)" }, { "docstring": "Performs a get operation to the path and returns the raw response as-is", "name": "rawget", "signature": "def ra...
5
stack_v2_sparse_classes_30k_train_000507
Implement the Python class `Connector` described below. Class description: Connects to and performs the get and post operations on the connected AEM instance Method signatures and docstrings: - def __init__(self, host, user, password): Initialize connection to the host with given user and password - def rawget(self, ...
Implement the Python class `Connector` described below. Class description: Connects to and performs the get and post operations on the connected AEM instance Method signatures and docstrings: - def __init__(self, host, user, password): Initialize connection to the host with given user and password - def rawget(self, ...
432d802f62da95eaa630cae651dabba56d50029c
<|skeleton|> class Connector: """Connects to and performs the get and post operations on the connected AEM instance""" def __init__(self, host, user, password): """Initialize connection to the host with given user and password""" <|body_0|> def rawget(self, path): """Performs a get...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Connector: """Connects to and performs the get and post operations on the connected AEM instance""" def __init__(self, host, user, password): """Initialize connection to the host with given user and password""" self.host = host if user: self._auth = HTTPBasicAuth(user,...
the_stack_v2_python_sparse
dampy/lib/Connector.py
moonraker46/dampy
train
0
10259174f6d2eae2f4d8eb8747ba893fdca27cc0
[ "self.is_lambda_based_g_c_enabled = is_lambda_based_g_c_enabled\nself.access_key_id = access_key_id\nself.auth_method = auth_method\nself.c_2_s_access_portal = c_2_s_access_portal\nself.credential_blob = credential_blob\nself.credential_endpoint = credential_endpoint\nself.iam_role_arn = iam_role_arn\nself.read_onl...
<|body_start_0|> self.is_lambda_based_g_c_enabled = is_lambda_based_g_c_enabled self.access_key_id = access_key_id self.auth_method = auth_method self.c_2_s_access_portal = c_2_s_access_portal self.credential_blob = credential_blob self.credential_endpoint = credential_en...
Implementation of the 'AmazonCloudCredentials' model. Specifies the cloud credentials to connect to a Amazon service account. Glacier, S3, and S3-compatible clouds all use these credentials. Attributes: is_lambda_based_g_c_enabled (bool): Specifies whether this vault supports AWS Lambda based GC. A Lambda function need...
AmazonCloudCredentials
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AmazonCloudCredentials: """Implementation of the 'AmazonCloudCredentials' model. Specifies the cloud credentials to connect to a Amazon service account. Glacier, S3, and S3-compatible clouds all use these credentials. Attributes: is_lambda_based_g_c_enabled (bool): Specifies whether this vault su...
stack_v2_sparse_classes_36k_train_008575
9,393
permissive
[ { "docstring": "Constructor for the AmazonCloudCredentials class", "name": "__init__", "signature": "def __init__(self, is_lambda_based_g_c_enabled=None, access_key_id=None, auth_method=None, c_2_s_access_portal=None, credential_blob=None, credential_endpoint=None, iam_role_arn=None, read_only_iam_role_...
2
null
Implement the Python class `AmazonCloudCredentials` described below. Class description: Implementation of the 'AmazonCloudCredentials' model. Specifies the cloud credentials to connect to a Amazon service account. Glacier, S3, and S3-compatible clouds all use these credentials. Attributes: is_lambda_based_g_c_enabled ...
Implement the Python class `AmazonCloudCredentials` described below. Class description: Implementation of the 'AmazonCloudCredentials' model. Specifies the cloud credentials to connect to a Amazon service account. Glacier, S3, and S3-compatible clouds all use these credentials. Attributes: is_lambda_based_g_c_enabled ...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class AmazonCloudCredentials: """Implementation of the 'AmazonCloudCredentials' model. Specifies the cloud credentials to connect to a Amazon service account. Glacier, S3, and S3-compatible clouds all use these credentials. Attributes: is_lambda_based_g_c_enabled (bool): Specifies whether this vault su...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AmazonCloudCredentials: """Implementation of the 'AmazonCloudCredentials' model. Specifies the cloud credentials to connect to a Amazon service account. Glacier, S3, and S3-compatible clouds all use these credentials. Attributes: is_lambda_based_g_c_enabled (bool): Specifies whether this vault supports AWS La...
the_stack_v2_python_sparse
cohesity_management_sdk/models/amazon_cloud_credentials.py
cohesity/management-sdk-python
train
24
1a16784ef4c043c8cd21240f66dae8ecb512ebc3
[ "client = Client.objects.filter(pk=self.kwargs.get('client_pk')).filter(organization=self.request.user.organization).first()\nif client is None:\n raise NotFound()\nreturn client", "campaign = client.campaign_set.filter(pk=self.kwargs['campaign_pk']).first()\nif campaign is None:\n raise NotFound()\nreturn ...
<|body_start_0|> client = Client.objects.filter(pk=self.kwargs.get('client_pk')).filter(organization=self.request.user.organization).first() if client is None: raise NotFound() return client <|end_body_0|> <|body_start_1|> campaign = client.campaign_set.filter(pk=self.kwargs...
Checks that user has access to client for viewsets that depend on client_pk url
ClientAccessMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClientAccessMixin: """Checks that user has access to client for viewsets that depend on client_pk url""" def _check_client_access(self): """Make sure client exists and belongs to the same organization""" <|body_0|> def _check_campaign_access(self, client): """Mak...
stack_v2_sparse_classes_36k_train_008576
6,187
no_license
[ { "docstring": "Make sure client exists and belongs to the same organization", "name": "_check_client_access", "signature": "def _check_client_access(self)" }, { "docstring": "Make sure campaign belongs to client", "name": "_check_campaign_access", "signature": "def _check_campaign_acces...
3
stack_v2_sparse_classes_30k_train_020268
Implement the Python class `ClientAccessMixin` described below. Class description: Checks that user has access to client for viewsets that depend on client_pk url Method signatures and docstrings: - def _check_client_access(self): Make sure client exists and belongs to the same organization - def _check_campaign_acce...
Implement the Python class `ClientAccessMixin` described below. Class description: Checks that user has access to client for viewsets that depend on client_pk url Method signatures and docstrings: - def _check_client_access(self): Make sure client exists and belongs to the same organization - def _check_campaign_acce...
4a66bc3d516f8116c20aa11399f25e618e74f06e
<|skeleton|> class ClientAccessMixin: """Checks that user has access to client for viewsets that depend on client_pk url""" def _check_client_access(self): """Make sure client exists and belongs to the same organization""" <|body_0|> def _check_campaign_access(self, client): """Mak...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ClientAccessMixin: """Checks that user has access to client for viewsets that depend on client_pk url""" def _check_client_access(self): """Make sure client exists and belongs to the same organization""" client = Client.objects.filter(pk=self.kwargs.get('client_pk')).filter(organization=s...
the_stack_v2_python_sparse
clients/views.py
magloirend/budget_tracker
train
0
3498d556b10af91a07b7551e2c2947717e1eac27
[ "self.reward = reward\nself.nb_arms = nb_arms\nself.pattern = pattern\nself.terminate_on_win = terminate_on_win\nassert len(self.pattern) > 0, 'Pattern cannot be empty.'\nassert min(self.pattern) >= 0, 'Negative values in patterns not allowed.'\nassert max(self.pattern) < self.nb_arms, 'Values greater than the numb...
<|body_start_0|> self.reward = reward self.nb_arms = nb_arms self.pattern = pattern self.terminate_on_win = terminate_on_win assert len(self.pattern) > 0, 'Pattern cannot be empty.' assert min(self.pattern) >= 0, 'Negative values in patterns not allowed.' assert m...
A variant of the classic MAB. There exists a sequence of actions s.t. after performing that sequence, all actions lead to a reward with probability 1 from that point on. E.g. pull arm 1 three times, then pull arm 3. The reward is deterministic.
CheatMAB
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CheatMAB: """A variant of the classic MAB. There exists a sequence of actions s.t. after performing that sequence, all actions lead to a reward with probability 1 from that point on. E.g. pull arm 1 three times, then pull arm 3. The reward is deterministic.""" def __init__(self, nb_arms: int...
stack_v2_sparse_classes_36k_train_008577
3,255
no_license
[ { "docstring": "Initialize a sequential MAB. :param nb_arms: the number of arms. :param pattern: the pattern to perform in order to give a reward. :param reward: the reward. :param terminate_on_win: whether the episode should terminate when the pattern is matched.", "name": "__init__", "signature": "def...
2
stack_v2_sparse_classes_30k_train_014064
Implement the Python class `CheatMAB` described below. Class description: A variant of the classic MAB. There exists a sequence of actions s.t. after performing that sequence, all actions lead to a reward with probability 1 from that point on. E.g. pull arm 1 three times, then pull arm 3. The reward is deterministic. ...
Implement the Python class `CheatMAB` described below. Class description: A variant of the classic MAB. There exists a sequence of actions s.t. after performing that sequence, all actions lead to a reward with probability 1 from that point on. E.g. pull arm 1 three times, then pull arm 3. The reward is deterministic. ...
b516ffa46e9df6a67fbda7546f9128c23920c460
<|skeleton|> class CheatMAB: """A variant of the classic MAB. There exists a sequence of actions s.t. after performing that sequence, all actions lead to a reward with probability 1 from that point on. E.g. pull arm 1 three times, then pull arm 3. The reward is deterministic.""" def __init__(self, nb_arms: int...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CheatMAB: """A variant of the classic MAB. There exists a sequence of actions s.t. after performing that sequence, all actions lead to a reward with probability 1 from that point on. E.g. pull arm 1 three times, then pull arm 3. The reward is deterministic.""" def __init__(self, nb_arms: int, pattern: Se...
the_stack_v2_python_sparse
src/envs/cheat_mab.py
marcofavorito/PAC-RDPs-code
train
2
bd471540f6e90add42c640a93b189e88990f311a
[ "to_datetime = lambda x: {'dateTime': self.__class__.strftime(x)}\nto_visibility = lambda x: 'public' if x == 'public' else 'private'\nto_source = lambda x: {'url': get_base_url() + x()}\nto_attendees = lambda x: [dict(email=a.email, displayName=a.nickname) for a in x.iterator()]\ntranslation_table = (('summary', '...
<|body_start_0|> to_datetime = lambda x: {'dateTime': self.__class__.strftime(x)} to_visibility = lambda x: 'public' if x == 'public' else 'private' to_source = lambda x: {'url': get_base_url() + x()} to_attendees = lambda x: [dict(email=a.email, displayName=a.nickname) for a in x.iterat...
KawazGoogleCalendarBackend
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KawazGoogleCalendarBackend: def translate(self, event): """Kawaz3のEventモデルをGoogle Calendar API Version3のBodyパラメーターに変換します Params: event [Event] Eventモデルインスタンス Return: [dict] パラメーター""" <|body_0|> def is_valid(self, event, raise_exception=False): """Kawaz3のEventモデルインスタン...
stack_v2_sparse_classes_36k_train_008578
2,550
no_license
[ { "docstring": "Kawaz3のEventモデルをGoogle Calendar API Version3のBodyパラメーターに変換します Params: event [Event] Eventモデルインスタンス Return: [dict] パラメーター", "name": "translate", "signature": "def translate(self, event)" }, { "docstring": "Kawaz3のEventモデルインスタンスが、Google Calendar API Version3の Bodyパラメーターと適合しているかをチェッ...
2
null
Implement the Python class `KawazGoogleCalendarBackend` described below. Class description: Implement the KawazGoogleCalendarBackend class. Method signatures and docstrings: - def translate(self, event): Kawaz3のEventモデルをGoogle Calendar API Version3のBodyパラメーターに変換します Params: event [Event] Eventモデルインスタンス Return: [dict] ...
Implement the Python class `KawazGoogleCalendarBackend` described below. Class description: Implement the KawazGoogleCalendarBackend class. Method signatures and docstrings: - def translate(self, event): Kawaz3のEventモデルをGoogle Calendar API Version3のBodyパラメーターに変換します Params: event [Event] Eventモデルインスタンス Return: [dict] ...
8f9a850c4df41b0fc1da5b73189772552d5cd531
<|skeleton|> class KawazGoogleCalendarBackend: def translate(self, event): """Kawaz3のEventモデルをGoogle Calendar API Version3のBodyパラメーターに変換します Params: event [Event] Eventモデルインスタンス Return: [dict] パラメーター""" <|body_0|> def is_valid(self, event, raise_exception=False): """Kawaz3のEventモデルインスタン...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KawazGoogleCalendarBackend: def translate(self, event): """Kawaz3のEventモデルをGoogle Calendar API Version3のBodyパラメーターに変換します Params: event [Event] Eventモデルインスタンス Return: [dict] パラメーター""" to_datetime = lambda x: {'dateTime': self.__class__.strftime(x)} to_visibility = lambda x: 'public' if ...
the_stack_v2_python_sparse
src/kawaz/apps/events/gcal.py
kawazrepos/Kawaz3rd
train
7
89f67c60f1b50e0e4a876628b0231090c038f511
[ "if n == 0 or n == 1:\n return 1\nelse:\n return self.climbStairs(n - 1) + self.climbStairs(n - 2)", "if n == 0 or n == 1:\n return 1\nelse:\n dp = [0] * (n + 1)\n dp[0] = 1\n dp[1] = 1\n for i in range(2, n + 1):\n dp[i] = dp[i - 1] + dp[i - 2]\n return dp[-1]", "if n == 0 or n =...
<|body_start_0|> if n == 0 or n == 1: return 1 else: return self.climbStairs(n - 1) + self.climbStairs(n - 2) <|end_body_0|> <|body_start_1|> if n == 0 or n == 1: return 1 else: dp = [0] * (n + 1) dp[0] = 1 dp[1] = ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def climbStairs(self, n: int) -> int: """Time: N/A Time limit exceeded Mem: N/A ^""" <|body_0|> def climbStairs(self, n): """Time: 24ms (96.94%) Mem: 12.7 MB (100%)""" <|body_1|> def climbStairs(self, n): """Time: 28ms (90.99%) Mem: 12....
stack_v2_sparse_classes_36k_train_008579
1,874
no_license
[ { "docstring": "Time: N/A Time limit exceeded Mem: N/A ^", "name": "climbStairs", "signature": "def climbStairs(self, n: int) -> int" }, { "docstring": "Time: 24ms (96.94%) Mem: 12.7 MB (100%)", "name": "climbStairs", "signature": "def climbStairs(self, n)" }, { "docstring": "Tim...
3
stack_v2_sparse_classes_30k_train_018791
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def climbStairs(self, n: int) -> int: Time: N/A Time limit exceeded Mem: N/A ^ - def climbStairs(self, n): Time: 24ms (96.94%) Mem: 12.7 MB (100%) - def climbStairs(self, n): Tim...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def climbStairs(self, n: int) -> int: Time: N/A Time limit exceeded Mem: N/A ^ - def climbStairs(self, n): Time: 24ms (96.94%) Mem: 12.7 MB (100%) - def climbStairs(self, n): Tim...
5a40f53602d3a5f4d5478ac6ea2b41f3272420db
<|skeleton|> class Solution: def climbStairs(self, n: int) -> int: """Time: N/A Time limit exceeded Mem: N/A ^""" <|body_0|> def climbStairs(self, n): """Time: 24ms (96.94%) Mem: 12.7 MB (100%)""" <|body_1|> def climbStairs(self, n): """Time: 28ms (90.99%) Mem: 12....
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def climbStairs(self, n: int) -> int: """Time: N/A Time limit exceeded Mem: N/A ^""" if n == 0 or n == 1: return 1 else: return self.climbStairs(n - 1) + self.climbStairs(n - 2) def climbStairs(self, n): """Time: 24ms (96.94%) Mem: 12.7 MB...
the_stack_v2_python_sparse
coding-problems/leetcode/recursion/climb_stairs.py
BaoAdrian/interview-prep
train
0
4847c9905587193f73d90e010c479bfac08bafff
[ "try:\n session = async_get_clientsession(hass)\n cloud_api_client = cloud_loqed.CloudAPIClient(session, data[CONF_API_TOKEN])\n cloud_client = cloud_loqed.LoqedCloudAPI(cloud_api_client)\n lock_data = await cloud_client.async_get_locks()\nexcept aiohttp.ClientError as err:\n _LOGGER.error('HTTP Conn...
<|body_start_0|> try: session = async_get_clientsession(hass) cloud_api_client = cloud_loqed.CloudAPIClient(session, data[CONF_API_TOKEN]) cloud_client = cloud_loqed.LoqedCloudAPI(cloud_api_client) lock_data = await cloud_client.async_get_locks() except ai...
Handle a config flow for Loqed.
ConfigFlow
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConfigFlow: """Handle a config flow for Loqed.""" async def validate_input(self, hass: HomeAssistant, data: dict[str, Any]) -> dict[str, Any]: """Validate the user input allows us to connect.""" <|body_0|> async def async_step_zeroconf(self, discovery_info: ZeroconfServi...
stack_v2_sparse_classes_36k_train_008580
5,680
permissive
[ { "docstring": "Validate the user input allows us to connect.", "name": "validate_input", "signature": "async def validate_input(self, hass: HomeAssistant, data: dict[str, Any]) -> dict[str, Any]" }, { "docstring": "Handle zeroconf discovery.", "name": "async_step_zeroconf", "signature":...
3
null
Implement the Python class `ConfigFlow` described below. Class description: Handle a config flow for Loqed. Method signatures and docstrings: - async def validate_input(self, hass: HomeAssistant, data: dict[str, Any]) -> dict[str, Any]: Validate the user input allows us to connect. - async def async_step_zeroconf(sel...
Implement the Python class `ConfigFlow` described below. Class description: Handle a config flow for Loqed. Method signatures and docstrings: - async def validate_input(self, hass: HomeAssistant, data: dict[str, Any]) -> dict[str, Any]: Validate the user input allows us to connect. - async def async_step_zeroconf(sel...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class ConfigFlow: """Handle a config flow for Loqed.""" async def validate_input(self, hass: HomeAssistant, data: dict[str, Any]) -> dict[str, Any]: """Validate the user input allows us to connect.""" <|body_0|> async def async_step_zeroconf(self, discovery_info: ZeroconfServi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ConfigFlow: """Handle a config flow for Loqed.""" async def validate_input(self, hass: HomeAssistant, data: dict[str, Any]) -> dict[str, Any]: """Validate the user input allows us to connect.""" try: session = async_get_clientsession(hass) cloud_api_client = cloud_...
the_stack_v2_python_sparse
homeassistant/components/loqed/config_flow.py
home-assistant/core
train
35,501
476a3243b4d74a3f3b22c5def18ee7ee96910301
[ "self.x_procedure_created = True\nfor line in self.order_line:\n print(line.product_id)\n if line.product_id.is_procedure():\n product_product = line.product_id\n pl_creates.create_procedure(treatment, product_product)", "print()\nprint('order - proc_is_not_created_and_state_is_sale')\nreturn ...
<|body_start_0|> self.x_procedure_created = True for line in self.order_line: print(line.product_id) if line.product_id.is_procedure(): product_product = line.product_id pl_creates.create_procedure(treatment, product_product) <|end_body_0|> <|body...
Order controller. Directs flow between Order and other models (Treatment).
OrderBl
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OrderBl: """Order controller. Directs flow between Order and other models (Treatment).""" def create_procedure_man(self, treatment): """Create Procedure Man - In prog Used by: Treatment""" <|body_0|> def proc_is_not_created_and_state_is_sale(self): """Used by: Tr...
stack_v2_sparse_classes_36k_train_008581
2,116
no_license
[ { "docstring": "Create Procedure Man - In prog Used by: Treatment", "name": "create_procedure_man", "signature": "def create_procedure_man(self, treatment)" }, { "docstring": "Used by: Treatment", "name": "proc_is_not_created_and_state_is_sale", "signature": "def proc_is_not_created_and_...
5
null
Implement the Python class `OrderBl` described below. Class description: Order controller. Directs flow between Order and other models (Treatment). Method signatures and docstrings: - def create_procedure_man(self, treatment): Create Procedure Man - In prog Used by: Treatment - def proc_is_not_created_and_state_is_sa...
Implement the Python class `OrderBl` described below. Class description: Order controller. Directs flow between Order and other models (Treatment). Method signatures and docstrings: - def create_procedure_man(self, treatment): Create Procedure Man - In prog Used by: Treatment - def proc_is_not_created_and_state_is_sa...
c15f8b146392d47a9040404a4ac8e45a1b062198
<|skeleton|> class OrderBl: """Order controller. Directs flow between Order and other models (Treatment).""" def create_procedure_man(self, treatment): """Create Procedure Man - In prog Used by: Treatment""" <|body_0|> def proc_is_not_created_and_state_is_sale(self): """Used by: Tr...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OrderBl: """Order controller. Directs flow between Order and other models (Treatment).""" def create_procedure_man(self, treatment): """Create Procedure Man - In prog Used by: Treatment""" self.x_procedure_created = True for line in self.order_line: print(line.product_...
the_stack_v2_python_sparse
models/order/order_controller.py
gibil5/openhealth
train
1
d208ca4db22c8cf8466a505e4ff0d86271a9748e
[ "location_node = xml_root.find(INPUT)\nnames = [OBJ_NAME, REG_SIZE]\nxml_nodes = self.node_dict(names, location_node)\nself._dust_nodes = [CoordNode(xml_nodes[OBJ_NAME], col_names=['RA', 'Dec', 'coord sys']), NumberNode(xml_nodes[REG_SIZE], REG_SIZE, units=u.deg)]\nself.create_columns()", "base_string = BaseResul...
<|body_start_0|> location_node = xml_root.find(INPUT) names = [OBJ_NAME, REG_SIZE] xml_nodes = self.node_dict(names, location_node) self._dust_nodes = [CoordNode(xml_nodes[OBJ_NAME], col_names=['RA', 'Dec', 'coord sys']), NumberNode(xml_nodes[REG_SIZE], REG_SIZE, units=u.deg)] se...
The location section of the DustResults object.
LocationSection
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LocationSection: """The location section of the DustResults object.""" def __init__(self, xml_root): """Parameters ---------- xml_root : `xml.etree.ElementTree` the xml tree where the data for this section resides""" <|body_0|> def __str__(self): """Return a stri...
stack_v2_sparse_classes_36k_train_008582
41,056
permissive
[ { "docstring": "Parameters ---------- xml_root : `xml.etree.ElementTree` the xml tree where the data for this section resides", "name": "__init__", "signature": "def __init__(self, xml_root)" }, { "docstring": "Return a string representation of the section.", "name": "__str__", "signatur...
2
stack_v2_sparse_classes_30k_train_008949
Implement the Python class `LocationSection` described below. Class description: The location section of the DustResults object. Method signatures and docstrings: - def __init__(self, xml_root): Parameters ---------- xml_root : `xml.etree.ElementTree` the xml tree where the data for this section resides - def __str__...
Implement the Python class `LocationSection` described below. Class description: The location section of the DustResults object. Method signatures and docstrings: - def __init__(self, xml_root): Parameters ---------- xml_root : `xml.etree.ElementTree` the xml tree where the data for this section resides - def __str__...
51316d7417d7daf01a8b29d1df99037b9227c2bc
<|skeleton|> class LocationSection: """The location section of the DustResults object.""" def __init__(self, xml_root): """Parameters ---------- xml_root : `xml.etree.ElementTree` the xml tree where the data for this section resides""" <|body_0|> def __str__(self): """Return a stri...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LocationSection: """The location section of the DustResults object.""" def __init__(self, xml_root): """Parameters ---------- xml_root : `xml.etree.ElementTree` the xml tree where the data for this section resides""" location_node = xml_root.find(INPUT) names = [OBJ_NAME, REG_SIZE...
the_stack_v2_python_sparse
astroquery/ipac/irsa/irsa_dust/core.py
astropy/astroquery
train
636
99f6b8338f9990d97be47923bae154e1bdd79abf
[ "self.__vc = virtual_coach.VirtualCoach('local', storage_username='demo', storage_password='demo')\nself.__experiments_list = {}\nself.__last_status = [None]\nself.__launched = False\nself.__sim = None\nexperiments_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'experiments_list.json')\nif not os....
<|body_start_0|> self.__vc = virtual_coach.VirtualCoach('local', storage_username='demo', storage_password='demo') self.__experiments_list = {} self.__last_status = [None] self.__launched = False self.__sim = None experiments_path = os.path.join(os.path.dirname(os.path.re...
This class contains an instance of the virtual coach, and exposes a single function to run continuously the list of experiments contained in the experiments_list.json
ExperimentsLauncher
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ExperimentsLauncher: """This class contains an instance of the virtual coach, and exposes a single function to run continuously the list of experiments contained in the experiments_list.json""" def __init__(self): """In the constructor we instantiate a VC, and read the list of experi...
stack_v2_sparse_classes_36k_train_008583
5,296
no_license
[ { "docstring": "In the constructor we instantiate a VC, and read the list of experiments from the experiments_list.json", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "\" Helper method that is specified as the callback function whenever we have a status change. By defa...
4
null
Implement the Python class `ExperimentsLauncher` described below. Class description: This class contains an instance of the virtual coach, and exposes a single function to run continuously the list of experiments contained in the experiments_list.json Method signatures and docstrings: - def __init__(self): In the con...
Implement the Python class `ExperimentsLauncher` described below. Class description: This class contains an instance of the virtual coach, and exposes a single function to run continuously the list of experiments contained in the experiments_list.json Method signatures and docstrings: - def __init__(self): In the con...
e4d22da4488aacd727d9f520b40fba2230bea113
<|skeleton|> class ExperimentsLauncher: """This class contains an instance of the virtual coach, and exposes a single function to run continuously the list of experiments contained in the experiments_list.json""" def __init__(self): """In the constructor we instantiate a VC, and read the list of experi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ExperimentsLauncher: """This class contains an instance of the virtual coach, and exposes a single function to run continuously the list of experiments contained in the experiments_list.json""" def __init__(self): """In the constructor we instantiate a VC, and read the list of experiments from th...
the_stack_v2_python_sparse
demo_carousel/experiments_launcher.py
HBPNeurorobotics/Experiments
train
1
8e9154c5b89ffbcfef759af6b028819fee440ae3
[ "self.mNormal = normal.normalized()\nself.mDistance = dvalue\nself.mColor = color", "if self.mNormal.dot(ray.mDirection) == 0:\n return None\nt = (self.mDistance - ray.mOrigin.dot(self.mNormal)) / self.mNormal.dot(ray.mDirection)\nif t < 0:\n return None\nelse:\n return rayHit(t, self.mNormal, ray, self)...
<|body_start_0|> self.mNormal = normal.normalized() self.mDistance = dvalue self.mColor = color <|end_body_0|> <|body_start_1|> if self.mNormal.dot(ray.mDirection) == 0: return None t = (self.mDistance - ray.mOrigin.dot(self.mNormal)) / self.mNormal.dot(ray.mDirectio...
Creates a plane object
Plane
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Plane: """Creates a plane object""" def __init__(self, normal, dvalue, color): """creates the plane""" <|body_0|> def rayIntersection(self, ray): """Returns the distance from the intersection of the ray and the object""" <|body_1|> <|end_skeleton|> <|bo...
stack_v2_sparse_classes_36k_train_008584
7,372
no_license
[ { "docstring": "creates the plane", "name": "__init__", "signature": "def __init__(self, normal, dvalue, color)" }, { "docstring": "Returns the distance from the intersection of the ray and the object", "name": "rayIntersection", "signature": "def rayIntersection(self, ray)" } ]
2
stack_v2_sparse_classes_30k_train_004863
Implement the Python class `Plane` described below. Class description: Creates a plane object Method signatures and docstrings: - def __init__(self, normal, dvalue, color): creates the plane - def rayIntersection(self, ray): Returns the distance from the intersection of the ray and the object
Implement the Python class `Plane` described below. Class description: Creates a plane object Method signatures and docstrings: - def __init__(self, normal, dvalue, color): creates the plane - def rayIntersection(self, ray): Returns the distance from the intersection of the ray and the object <|skeleton|> class Plan...
95fc6bcdad6e61abb469c5025b9b3c9edafab8fc
<|skeleton|> class Plane: """Creates a plane object""" def __init__(self, normal, dvalue, color): """creates the plane""" <|body_0|> def rayIntersection(self, ray): """Returns the distance from the intersection of the ray and the object""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Plane: """Creates a plane object""" def __init__(self, normal, dvalue, color): """creates the plane""" self.mNormal = normal.normalized() self.mDistance = dvalue self.mColor = color def rayIntersection(self, ray): """Returns the distance from the intersection ...
the_stack_v2_python_sparse
Raytracer/objects3d.py
TylermEvans/Portfolio
train
1
2bde7d6856a12976001b0a381f406e072370b56e
[ "Parametre.__init__(self, 'supprimer', 'del')\nself.schema = '<groupe1:groupe_existant> <groupe2:groupe_existant>'\nself.aide_courte = 'supprime un groupe inclus'\nself.aide_longue = 'Cette commande permet de supprimer un groupe inclus. Le premier groupe à entrer est celui dans lequel on doit supprimer le second gr...
<|body_start_0|> Parametre.__init__(self, 'supprimer', 'del') self.schema = '<groupe1:groupe_existant> <groupe2:groupe_existant>' self.aide_courte = 'supprime un groupe inclus' self.aide_longue = 'Cette commande permet de supprimer un groupe inclus. Le premier groupe à entrer est celui d...
Commande 'groupe inclus ajouter'.
PrmInclusSupprimer
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PrmInclusSupprimer: """Commande 'groupe inclus ajouter'.""" def __init__(self): """Constructeur du paramètre""" <|body_0|> def interpreter(self, personnage, dic_masques): """Interprétation du paramètre""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_008585
3,321
permissive
[ { "docstring": "Constructeur du paramètre", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Interprétation du paramètre", "name": "interpreter", "signature": "def interpreter(self, personnage, dic_masques)" } ]
2
null
Implement the Python class `PrmInclusSupprimer` described below. Class description: Commande 'groupe inclus ajouter'. Method signatures and docstrings: - def __init__(self): Constructeur du paramètre - def interpreter(self, personnage, dic_masques): Interprétation du paramètre
Implement the Python class `PrmInclusSupprimer` described below. Class description: Commande 'groupe inclus ajouter'. Method signatures and docstrings: - def __init__(self): Constructeur du paramètre - def interpreter(self, personnage, dic_masques): Interprétation du paramètre <|skeleton|> class PrmInclusSupprimer: ...
7e93bff08cdf891352efba587e89c40f3b4a2301
<|skeleton|> class PrmInclusSupprimer: """Commande 'groupe inclus ajouter'.""" def __init__(self): """Constructeur du paramètre""" <|body_0|> def interpreter(self, personnage, dic_masques): """Interprétation du paramètre""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PrmInclusSupprimer: """Commande 'groupe inclus ajouter'.""" def __init__(self): """Constructeur du paramètre""" Parametre.__init__(self, 'supprimer', 'del') self.schema = '<groupe1:groupe_existant> <groupe2:groupe_existant>' self.aide_courte = 'supprime un groupe inclus' ...
the_stack_v2_python_sparse
src/primaires/joueur/commandes/groupe/inclus_supprimer.py
vincent-lg/tsunami
train
5
bc94add4f8676af81e87e1f15f5efc53de58a542
[ "if data is None:\n if lambtha < 1:\n raise ValueError('lambtha must be a positive value')\n else:\n self.lambtha = float(lambtha)\nelif type(data) is not list:\n raise TypeError('data must be a list')\nelif len(data) < 2:\n raise ValueError('data must contain multiple values')\nelse:\n ...
<|body_start_0|> if data is None: if lambtha < 1: raise ValueError('lambtha must be a positive value') else: self.lambtha = float(lambtha) elif type(data) is not list: raise TypeError('data must be a list') elif len(data) < 2: ...
class that represents Poisson distribution class constructor: def __init__(self, data=None, lambtha=1.) instance attributes: lambtha [float]: the expected number of occurances in a given time instance methods: def pmf(self, k): calculates PMF for given number of successes def cdf(self, k): calculates CDF for given numb...
Poisson
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Poisson: """class that represents Poisson distribution class constructor: def __init__(self, data=None, lambtha=1.) instance attributes: lambtha [float]: the expected number of occurances in a given time instance methods: def pmf(self, k): calculates PMF for given number of successes def cdf(self...
stack_v2_sparse_classes_36k_train_008586
2,830
no_license
[ { "docstring": "class constructor parameters: data [list]: data to be used to estimate the distibution lambtha [float]: the expected number of occurances on a given time Sets the instance attribute lambtha as a float If data is not given: Use the given lambtha or raise ValueError if lambtha is not positive valu...
3
stack_v2_sparse_classes_30k_train_008905
Implement the Python class `Poisson` described below. Class description: class that represents Poisson distribution class constructor: def __init__(self, data=None, lambtha=1.) instance attributes: lambtha [float]: the expected number of occurances in a given time instance methods: def pmf(self, k): calculates PMF for...
Implement the Python class `Poisson` described below. Class description: class that represents Poisson distribution class constructor: def __init__(self, data=None, lambtha=1.) instance attributes: lambtha [float]: the expected number of occurances in a given time instance methods: def pmf(self, k): calculates PMF for...
8834b201ca84937365e4dcc0fac978656cdf5293
<|skeleton|> class Poisson: """class that represents Poisson distribution class constructor: def __init__(self, data=None, lambtha=1.) instance attributes: lambtha [float]: the expected number of occurances in a given time instance methods: def pmf(self, k): calculates PMF for given number of successes def cdf(self...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Poisson: """class that represents Poisson distribution class constructor: def __init__(self, data=None, lambtha=1.) instance attributes: lambtha [float]: the expected number of occurances in a given time instance methods: def pmf(self, k): calculates PMF for given number of successes def cdf(self, k): calcula...
the_stack_v2_python_sparse
math/0x03-probability/poisson.py
ejonakodra/holbertonschool-machine_learning-1
train
0
75d5a64caf8b6175ffedde32d4f3f5868be5fb05
[ "try:\n if create_if_missing:\n site_profile, is_new = self.get_or_create(user=user, profile=profile, local_site=local_site)\n else:\n site_profile = self.get(user=user, profile=profile, local_site=local_site)\n is_new = False\nexcept MultipleObjectsReturned:\n site_profile = self._fix...
<|body_start_0|> try: if create_if_missing: site_profile, is_new = self.get_or_create(user=user, profile=profile, local_site=local_site) else: site_profile = self.get(user=user, profile=profile, local_site=local_site) is_new = False ...
Manager for Local Site profiles.
LocalSiteProfileManager
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LocalSiteProfileManager: """Manager for Local Site profiles.""" def for_user(self, user, profile, local_site, create_if_missing=False): """Return the Local Site profile for the given user and site. Version Added: 5.0 Args: user (django.contrib.auth.models.User): The user to get the p...
stack_v2_sparse_classes_36k_train_008587
9,061
permissive
[ { "docstring": "Return the Local Site profile for the given user and site. Version Added: 5.0 Args: user (django.contrib.auth.models.User): The user to get the profile for. profile (reviewboard.accounts.models.Profile): The user's global profile. local_site (reviewboard.site.models.LocalSite): The Local Site to...
2
null
Implement the Python class `LocalSiteProfileManager` described below. Class description: Manager for Local Site profiles. Method signatures and docstrings: - def for_user(self, user, profile, local_site, create_if_missing=False): Return the Local Site profile for the given user and site. Version Added: 5.0 Args: user...
Implement the Python class `LocalSiteProfileManager` described below. Class description: Manager for Local Site profiles. Method signatures and docstrings: - def for_user(self, user, profile, local_site, create_if_missing=False): Return the Local Site profile for the given user and site. Version Added: 5.0 Args: user...
c3a991f1e9d7682239a1ab0e8661cee6da01d537
<|skeleton|> class LocalSiteProfileManager: """Manager for Local Site profiles.""" def for_user(self, user, profile, local_site, create_if_missing=False): """Return the Local Site profile for the given user and site. Version Added: 5.0 Args: user (django.contrib.auth.models.User): The user to get the p...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LocalSiteProfileManager: """Manager for Local Site profiles.""" def for_user(self, user, profile, local_site, create_if_missing=False): """Return the Local Site profile for the given user and site. Version Added: 5.0 Args: user (django.contrib.auth.models.User): The user to get the profile for. p...
the_stack_v2_python_sparse
reviewboard/accounts/managers.py
reviewboard/reviewboard
train
1,141
feada690bdbf32241921ed938f937eaaa5ed25ee
[ "assert isinstance(converter, Converter), 'Invalid converter %s' % converter\nassert isinstance(baseTimeZone, tzinfo), 'Invalid base time zone %s' % baseTimeZone\nassert isinstance(timeZoneStr, tzinfo), 'Invalid time zone %s' % timeZoneStr\nassert isinstance(timeZoneVal, tzinfo), 'Invalid time zone %s' % timeZoneVa...
<|body_start_0|> assert isinstance(converter, Converter), 'Invalid converter %s' % converter assert isinstance(baseTimeZone, tzinfo), 'Invalid base time zone %s' % baseTimeZone assert isinstance(timeZoneStr, tzinfo), 'Invalid time zone %s' % timeZoneStr assert isinstance(timeZoneVal, tzi...
Provides the converter time zone support.
ConverterTimeZone
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConverterTimeZone: """Provides the converter time zone support.""" def __init__(self, converter, baseTimeZone, timeZoneStr, timeZoneVal): """Construct the GMT converter. @param converter: Converter The wrapped converter. @param baseTimeZone: tzinfo The time zone of the dates to be co...
stack_v2_sparse_classes_36k_train_008588
5,482
no_license
[ { "docstring": "Construct the GMT converter. @param converter: Converter The wrapped converter. @param baseTimeZone: tzinfo The time zone of the dates to be converted. @param timeZoneStr: tzinfo The time zone to convert to string values. @param timeZoneVal: tzinfo The time zone to convert the string values.", ...
3
stack_v2_sparse_classes_30k_train_016596
Implement the Python class `ConverterTimeZone` described below. Class description: Provides the converter time zone support. Method signatures and docstrings: - def __init__(self, converter, baseTimeZone, timeZoneStr, timeZoneVal): Construct the GMT converter. @param converter: Converter The wrapped converter. @param...
Implement the Python class `ConverterTimeZone` described below. Class description: Provides the converter time zone support. Method signatures and docstrings: - def __init__(self, converter, baseTimeZone, timeZoneStr, timeZoneVal): Construct the GMT converter. @param converter: Converter The wrapped converter. @param...
e0b3466b34d31548996d57be4a9dac134d904380
<|skeleton|> class ConverterTimeZone: """Provides the converter time zone support.""" def __init__(self, converter, baseTimeZone, timeZoneStr, timeZoneVal): """Construct the GMT converter. @param converter: Converter The wrapped converter. @param baseTimeZone: tzinfo The time zone of the dates to be co...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ConverterTimeZone: """Provides the converter time zone support.""" def __init__(self, converter, baseTimeZone, timeZoneStr, timeZoneVal): """Construct the GMT converter. @param converter: Converter The wrapped converter. @param baseTimeZone: tzinfo The time zone of the dates to be converted. @par...
the_stack_v2_python_sparse
components/ally-core-http/ally/core/http/impl/processor/time_zone.py
cristidomsa/Ally-Py
train
0
feba19c3e280bbd99bc8ce19a4fc58ffaac612d6
[ "self.dic = {}\ni = 0\nfor n in list(nx.traversal.bfs_tree(self.tree, 'Thing')):\n self.dic[n] = i\n i += 1\nself.inv_dic = {str(v): k for k, v in self.dic.items()}", "ordered_edgelist = {n: list(self.tree.successors(n)) for n in self.tree.nodes()}\nedgelist = defaultdict(list)\nfor k, v in ordered_edgelist...
<|body_start_0|> self.dic = {} i = 0 for n in list(nx.traversal.bfs_tree(self.tree, 'Thing')): self.dic[n] = i i += 1 self.inv_dic = {str(v): k for k, v in self.dic.items()} <|end_body_0|> <|body_start_1|> ordered_edgelist = {n: list(self.tree.successors(...
HyperEEmbeddingManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HyperEEmbeddingManager: def create_dictionary(self): """create a dictionary which is {node: value} and the inverse dictionary which is {value: node} this is because HyperE wants an edgelist in which node names are number, (with the root which is the O (zero) value)""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_008589
11,182
no_license
[ { "docstring": "create a dictionary which is {node: value} and the inverse dictionary which is {value: node} this is because HyperE wants an edgelist in which node names are number, (with the root which is the O (zero) value)", "name": "create_dictionary", "signature": "def create_dictionary(self)" },...
4
stack_v2_sparse_classes_30k_train_012448
Implement the Python class `HyperEEmbeddingManager` described below. Class description: Implement the HyperEEmbeddingManager class. Method signatures and docstrings: - def create_dictionary(self): create a dictionary which is {node: value} and the inverse dictionary which is {value: node} this is because HyperE wants...
Implement the Python class `HyperEEmbeddingManager` described below. Class description: Implement the HyperEEmbeddingManager class. Method signatures and docstrings: - def create_dictionary(self): create a dictionary which is {node: value} and the inverse dictionary which is {value: node} this is because HyperE wants...
14fcc9081ecd27e042de0be2d6b9c53914506fb8
<|skeleton|> class HyperEEmbeddingManager: def create_dictionary(self): """create a dictionary which is {node: value} and the inverse dictionary which is {value: node} this is because HyperE wants an edgelist in which node names are number, (with the root which is the O (zero) value)""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HyperEEmbeddingManager: def create_dictionary(self): """create a dictionary which is {node: value} and the inverse dictionary which is {value: node} this is because HyperE wants an edgelist in which node names are number, (with the root which is the O (zero) value)""" self.dic = {} i =...
the_stack_v2_python_sparse
preprocessing/ConceptEmbeddingManager.py
NooneBug/MTNCI
train
0
56d4948c9dedbe24f9707be0f76742caba6b6a1a
[ "self.uid = uid or str(uuid.uuid4())\nself.battlearea = battlearea\nself.target_missile_locs = target_missile_locs", "target = None\nif len(self.target_missile_locs) > 0:\n target = self.target_missile_locs.pop(0)\nreturn target" ]
<|body_start_0|> self.uid = uid or str(uuid.uuid4()) self.battlearea = battlearea self.target_missile_locs = target_missile_locs <|end_body_0|> <|body_start_1|> target = None if len(self.target_missile_locs) > 0: target = self.target_missile_locs.pop(0) retur...
An instance of this class represents a player.
Player
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Player: """An instance of this class represents a player.""" def __init__(self, battlearea, target_missile_locs, uid=None): """:param battlearea: Underlying player's battlearea :param target_missile_locs: Missile targets. e.e. [A1, B2, C6, D2] :param uid Unique id of player.""" ...
stack_v2_sparse_classes_36k_train_008590
808
permissive
[ { "docstring": ":param battlearea: Underlying player's battlearea :param target_missile_locs: Missile targets. e.e. [A1, B2, C6, D2] :param uid Unique id of player.", "name": "__init__", "signature": "def __init__(self, battlearea, target_missile_locs, uid=None)" }, { "docstring": "Get and remov...
2
null
Implement the Python class `Player` described below. Class description: An instance of this class represents a player. Method signatures and docstrings: - def __init__(self, battlearea, target_missile_locs, uid=None): :param battlearea: Underlying player's battlearea :param target_missile_locs: Missile targets. e.e. ...
Implement the Python class `Player` described below. Class description: An instance of this class represents a player. Method signatures and docstrings: - def __init__(self, battlearea, target_missile_locs, uid=None): :param battlearea: Underlying player's battlearea :param target_missile_locs: Missile targets. e.e. ...
1ca9470c33236016cbb88a38b2f19db41535e457
<|skeleton|> class Player: """An instance of this class represents a player.""" def __init__(self, battlearea, target_missile_locs, uid=None): """:param battlearea: Underlying player's battlearea :param target_missile_locs: Missile targets. e.e. [A1, B2, C6, D2] :param uid Unique id of player.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Player: """An instance of this class represents a player.""" def __init__(self, battlearea, target_missile_locs, uid=None): """:param battlearea: Underlying player's battlearea :param target_missile_locs: Missile targets. e.e. [A1, B2, C6, D2] :param uid Unique id of player.""" self.uid =...
the_stack_v2_python_sparse
Misc/battleshipGame/src/entity/player/player.py
suyash248/ds_algo
train
8
a012293ade129d98d8c85dc89b94c564b4280007
[ "try:\n post_data = request.data\n bk_username = request.user.username\n if create_topic(post_data, bk_username):\n return JsonResponse({'result': True, 'code': 0, 'data': [], 'message': 'topic创建成功'})\n else:\n return JsonResponse({'result': False, 'code': 1, 'data': [], 'message': 'topic创...
<|body_start_0|> try: post_data = request.data bk_username = request.user.username if create_topic(post_data, bk_username): return JsonResponse({'result': True, 'code': 0, 'data': [], 'message': 'topic创建成功'}) else: return JsonRespon...
kafka topic信息表视图
KafkaTopicViewSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KafkaTopicViewSet: """kafka topic信息表视图""" def create_topic(self, request, *args, **kwargs): """/kafka/create_topic 创建kafka topic信息""" <|body_0|> def check_topic(self, request, *args, **kwargs): """/kafka/check_topic 后台查询kafka topic状态信息""" <|body_1|> <|en...
stack_v2_sparse_classes_36k_train_008591
12,453
no_license
[ { "docstring": "/kafka/create_topic 创建kafka topic信息", "name": "create_topic", "signature": "def create_topic(self, request, *args, **kwargs)" }, { "docstring": "/kafka/check_topic 后台查询kafka topic状态信息", "name": "check_topic", "signature": "def check_topic(self, request, *args, **kwargs)" ...
2
stack_v2_sparse_classes_30k_train_016977
Implement the Python class `KafkaTopicViewSet` described below. Class description: kafka topic信息表视图 Method signatures and docstrings: - def create_topic(self, request, *args, **kwargs): /kafka/create_topic 创建kafka topic信息 - def check_topic(self, request, *args, **kwargs): /kafka/check_topic 后台查询kafka topic状态信息
Implement the Python class `KafkaTopicViewSet` described below. Class description: kafka topic信息表视图 Method signatures and docstrings: - def create_topic(self, request, *args, **kwargs): /kafka/create_topic 创建kafka topic信息 - def check_topic(self, request, *args, **kwargs): /kafka/check_topic 后台查询kafka topic状态信息 <|ske...
97cfac2ba94d67980d837f0b541caae70b68a595
<|skeleton|> class KafkaTopicViewSet: """kafka topic信息表视图""" def create_topic(self, request, *args, **kwargs): """/kafka/create_topic 创建kafka topic信息""" <|body_0|> def check_topic(self, request, *args, **kwargs): """/kafka/check_topic 后台查询kafka topic状态信息""" <|body_1|> <|en...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KafkaTopicViewSet: """kafka topic信息表视图""" def create_topic(self, request, *args, **kwargs): """/kafka/create_topic 创建kafka topic信息""" try: post_data = request.data bk_username = request.user.username if create_topic(post_data, bk_username): ...
the_stack_v2_python_sparse
apps/kafka/views.py
sdgdsffdsfff/bk-dop
train
0
79f1f9403e408b557a41330ebb7d2d08d8b3f800
[ "try:\n self.assertEqual(add(17, 23), 40)\nexcept Exception as error:\n print(error)", "try:\n self.assertEqual(add(-7, -11), -18)\nexcept Exception as error:\n print(error)", "try:\n self.assertEqual(add(0, 15), 15)\nexcept Exception as error:\n print(error)" ]
<|body_start_0|> try: self.assertEqual(add(17, 23), 40) except Exception as error: print(error) <|end_body_0|> <|body_start_1|> try: self.assertEqual(add(-7, -11), -18) except Exception as error: print(error) <|end_body_1|> <|body_start_2...
Test add function from calculation.py module.
TestAddFunction
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestAddFunction: """Test add function from calculation.py module.""" def test_add_all_args_greater_zero(self): """Test add function if all arguments are greater than zero.""" <|body_0|> def test_add_all_args_less_zero(self): """Test add function if all arguments ...
stack_v2_sparse_classes_36k_train_008592
1,838
no_license
[ { "docstring": "Test add function if all arguments are greater than zero.", "name": "test_add_all_args_greater_zero", "signature": "def test_add_all_args_greater_zero(self)" }, { "docstring": "Test add function if all arguments are less than zero.", "name": "test_add_all_args_less_zero", ...
3
stack_v2_sparse_classes_30k_train_017366
Implement the Python class `TestAddFunction` described below. Class description: Test add function from calculation.py module. Method signatures and docstrings: - def test_add_all_args_greater_zero(self): Test add function if all arguments are greater than zero. - def test_add_all_args_less_zero(self): Test add funct...
Implement the Python class `TestAddFunction` described below. Class description: Test add function from calculation.py module. Method signatures and docstrings: - def test_add_all_args_greater_zero(self): Test add function if all arguments are greater than zero. - def test_add_all_args_less_zero(self): Test add funct...
3a500c9d55fecf4032b5faf59a1cbecf64592e9a
<|skeleton|> class TestAddFunction: """Test add function from calculation.py module.""" def test_add_all_args_greater_zero(self): """Test add function if all arguments are greater than zero.""" <|body_0|> def test_add_all_args_less_zero(self): """Test add function if all arguments ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestAddFunction: """Test add function from calculation.py module.""" def test_add_all_args_greater_zero(self): """Test add function if all arguments are greater than zero.""" try: self.assertEqual(add(17, 23), 40) except Exception as error: print(error) ...
the_stack_v2_python_sparse
python10/test_calculation.py
maksimok93/Dp-189
train
0
9d0e47607b8d7f3e9acfc65962522eafd5a94fda
[ "logger.info('【获取微信全局唯一票据access_token】>>>执行定时器任务')\ntornado.ioloop.IOLoop.instance().call_later(0, self.get_access_token)\ntornado.ioloop.PeriodicCallback(self.get_access_token, self._expire_time_access_token).start()", "url = WxConfig.config_get_access_token_url\nr = requests.get(url)\nif r.status_code == 200:\n...
<|body_start_0|> logger.info('【获取微信全局唯一票据access_token】>>>执行定时器任务') tornado.ioloop.IOLoop.instance().call_later(0, self.get_access_token) tornado.ioloop.PeriodicCallback(self.get_access_token, self._expire_time_access_token).start() <|end_body_0|> <|body_start_1|> url = WxConfig.config_g...
定时任务调度器 excute 执行定时器任务 get_access_token 获取微信全局唯一票据access_token get_jsapi_ticket 获取JS_SDK权限签名的jsapi_ticket
WxShedule
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WxShedule: """定时任务调度器 excute 执行定时器任务 get_access_token 获取微信全局唯一票据access_token get_jsapi_ticket 获取JS_SDK权限签名的jsapi_ticket""" def excute(self): """执行定时器任务""" <|body_0|> def get_access_token(self): """获取微信全局唯一票据access_token""" <|body_1|> <|end_skeleton|> <|...
stack_v2_sparse_classes_36k_train_008593
1,897
no_license
[ { "docstring": "执行定时器任务", "name": "excute", "signature": "def excute(self)" }, { "docstring": "获取微信全局唯一票据access_token", "name": "get_access_token", "signature": "def get_access_token(self)" } ]
2
stack_v2_sparse_classes_30k_train_015317
Implement the Python class `WxShedule` described below. Class description: 定时任务调度器 excute 执行定时器任务 get_access_token 获取微信全局唯一票据access_token get_jsapi_ticket 获取JS_SDK权限签名的jsapi_ticket Method signatures and docstrings: - def excute(self): 执行定时器任务 - def get_access_token(self): 获取微信全局唯一票据access_token
Implement the Python class `WxShedule` described below. Class description: 定时任务调度器 excute 执行定时器任务 get_access_token 获取微信全局唯一票据access_token get_jsapi_ticket 获取JS_SDK权限签名的jsapi_ticket Method signatures and docstrings: - def excute(self): 执行定时器任务 - def get_access_token(self): 获取微信全局唯一票据access_token <|skeleton|> class Wx...
b4b60a33028ae1c638b8051304576f2b9e4630aa
<|skeleton|> class WxShedule: """定时任务调度器 excute 执行定时器任务 get_access_token 获取微信全局唯一票据access_token get_jsapi_ticket 获取JS_SDK权限签名的jsapi_ticket""" def excute(self): """执行定时器任务""" <|body_0|> def get_access_token(self): """获取微信全局唯一票据access_token""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WxShedule: """定时任务调度器 excute 执行定时器任务 get_access_token 获取微信全局唯一票据access_token get_jsapi_ticket 获取JS_SDK权限签名的jsapi_ticket""" def excute(self): """执行定时器任务""" logger.info('【获取微信全局唯一票据access_token】>>>执行定时器任务') tornado.ioloop.IOLoop.instance().call_later(0, self.get_access_token) ...
the_stack_v2_python_sparse
prize_server/weixinback/core/server/wxshedule.py
XTAYJGDUFVF/prize_server
train
0
e261ee90ac21f193058a3a9581da3dc8b8eef0ec
[ "for group in self:\n if group.match(environments):\n return group\nreturn None", "ret = set()\nfor group in self:\n for env in group.environments:\n ret.add(HashableEnvironment(name=env.name, typename=env.environmentType.name))\nreturn sorted(ret, key=lambda e: e.typename)" ]
<|body_start_0|> for group in self: if group.match(environments): return group return None <|end_body_0|> <|body_start_1|> ret = set() for group in self: for env in group.environments: ret.add(HashableEnvironment(name=env.name, typ...
BaseEnvironmentGroupList
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseEnvironmentGroupList: def match(self, environments): """If the given set of ``environments`` match any environment group in this environment group list, return that environment group. Else return None.""" <|body_0|> def environments(self): """Return a list of all...
stack_v2_sparse_classes_36k_train_008594
8,477
no_license
[ { "docstring": "If the given set of ``environments`` match any environment group in this environment group list, return that environment group. Else return None.", "name": "match", "signature": "def match(self, environments)" }, { "docstring": "Return a list of all unique environments in this en...
2
stack_v2_sparse_classes_30k_train_002495
Implement the Python class `BaseEnvironmentGroupList` described below. Class description: Implement the BaseEnvironmentGroupList class. Method signatures and docstrings: - def match(self, environments): If the given set of ``environments`` match any environment group in this environment group list, return that enviro...
Implement the Python class `BaseEnvironmentGroupList` described below. Class description: Implement the BaseEnvironmentGroupList class. Method signatures and docstrings: - def match(self, environments): If the given set of ``environments`` match any environment group in this environment group list, return that enviro...
deb6b22ed417740bf947e86938710bd5fa2ee2e7
<|skeleton|> class BaseEnvironmentGroupList: def match(self, environments): """If the given set of ``environments`` match any environment group in this environment group list, return that environment group. Else return None.""" <|body_0|> def environments(self): """Return a list of all...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseEnvironmentGroupList: def match(self, environments): """If the given set of ``environments`` match any environment group in this environment group list, return that environment group. Else return None.""" for group in self: if group.match(environments): return g...
the_stack_v2_python_sparse
ccui/environments/models.py
camd/caseconductor-ui
train
0
c55f1e260e27665a32fea9d7d8a92c8ed12268af
[ "logger.info('%s initialization' % obj.name)\nsuper(self.__class__, self).__init__(obj, parent)\nself.ppx = 0.0\nself.ppy = 0.0\nself.ppz = 0.0\nself.pvx = 0.0\nself.pvy = 0.0\nself.pvz = 0.0\nself.p = self.blender_obj.position\nself.v = [0.0, 0.0, 0.0]\nself.pv = [0.0, 0.0, 0.0]\nself.a = [0.0, 0.0, 0.0]\nself.tic...
<|body_start_0|> logger.info('%s initialization' % obj.name) super(self.__class__, self).__init__(obj, parent) self.ppx = 0.0 self.ppy = 0.0 self.ppz = 0.0 self.pvx = 0.0 self.pvy = 0.0 self.pvz = 0.0 self.p = self.blender_obj.position self...
Accelerometer sensor
AccelerometerClass
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AccelerometerClass: """Accelerometer sensor""" def __init__(self, obj, parent=None): """Constructor method. Receives the reference to the Blender object. The second parameter should be the name of the object's parent.""" <|body_0|> def default_action(self): """Co...
stack_v2_sparse_classes_36k_train_008595
3,250
permissive
[ { "docstring": "Constructor method. Receives the reference to the Blender object. The second parameter should be the name of the object's parent.", "name": "__init__", "signature": "def __init__(self, obj, parent=None)" }, { "docstring": "Compute the speed and accleration of the robot The speed ...
2
null
Implement the Python class `AccelerometerClass` described below. Class description: Accelerometer sensor Method signatures and docstrings: - def __init__(self, obj, parent=None): Constructor method. Receives the reference to the Blender object. The second parameter should be the name of the object's parent. - def def...
Implement the Python class `AccelerometerClass` described below. Class description: Accelerometer sensor Method signatures and docstrings: - def __init__(self, obj, parent=None): Constructor method. Receives the reference to the Blender object. The second parameter should be the name of the object's parent. - def def...
07fcb64fea3b58b258e917eb1aed0a585f863418
<|skeleton|> class AccelerometerClass: """Accelerometer sensor""" def __init__(self, obj, parent=None): """Constructor method. Receives the reference to the Blender object. The second parameter should be the name of the object's parent.""" <|body_0|> def default_action(self): """Co...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AccelerometerClass: """Accelerometer sensor""" def __init__(self, obj, parent=None): """Constructor method. Receives the reference to the Blender object. The second parameter should be the name of the object's parent.""" logger.info('%s initialization' % obj.name) super(self.__cla...
the_stack_v2_python_sparse
src/morse/sensors/accelerometer.py
DefaultUser/morse
train
2
3723b140e34e94025c6f6a8400bbe3361c257f7a
[ "for name, hook in what.iteritems():\n func = getattr(target, name)\n if not isinstance(func, HookedMethod):\n func = HookedMethod(func)\n setattr(target, name, func)\n func.pending.append(hook)", "for name, hook in what.iteritems():\n hooked = getattr(target, name)\n if hook in hooke...
<|body_start_0|> for name, hook in what.iteritems(): func = getattr(target, name) if not isinstance(func, HookedMethod): func = HookedMethod(func) setattr(target, name, func) func.pending.append(hook) <|end_body_0|> <|body_start_1|> fo...
HookSet
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HookSet: def install_hooks(target, **what): """:param target: :param what: :return:""" <|body_0|> def remove_hooks(target, **what): """:param target: :param what: :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> for name, hook in what.iterit...
stack_v2_sparse_classes_36k_train_008596
1,672
permissive
[ { "docstring": ":param target: :param what: :return:", "name": "install_hooks", "signature": "def install_hooks(target, **what)" }, { "docstring": ":param target: :param what: :return:", "name": "remove_hooks", "signature": "def remove_hooks(target, **what)" } ]
2
stack_v2_sparse_classes_30k_test_000579
Implement the Python class `HookSet` described below. Class description: Implement the HookSet class. Method signatures and docstrings: - def install_hooks(target, **what): :param target: :param what: :return: - def remove_hooks(target, **what): :param target: :param what: :return:
Implement the Python class `HookSet` described below. Class description: Implement the HookSet class. Method signatures and docstrings: - def install_hooks(target, **what): :param target: :param what: :return: - def remove_hooks(target, **what): :param target: :param what: :return: <|skeleton|> class HookSet: d...
18b77c72bd12de2e3c510a5792434386a79ccfa8
<|skeleton|> class HookSet: def install_hooks(target, **what): """:param target: :param what: :return:""" <|body_0|> def remove_hooks(target, **what): """:param target: :param what: :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HookSet: def install_hooks(target, **what): """:param target: :param what: :return:""" for name, hook in what.iteritems(): func = getattr(target, name) if not isinstance(func, HookedMethod): func = HookedMethod(func) setattr(target, name,...
the_stack_v2_python_sparse
angr/misc/hookset.py
ercoppa/angr
train
1
dd219f4b1e819975173334a422d9b7ea0cd460e1
[ "name = self.cleaned_data.get('name')\nif name[-1] == '.':\n raise ValidationError(_('Name may not end with dot.'), code='invalid')\nreturn name", "data = self.cleaned_data.get('content')\n_type = self.cleaned_data.get('type')\nif _type == 'A':\n validate_ipv4_address(data)\nelif _type == 'AAAA':\n valid...
<|body_start_0|> name = self.cleaned_data.get('name') if name[-1] == '.': raise ValidationError(_('Name may not end with dot.'), code='invalid') return name <|end_body_0|> <|body_start_1|> data = self.cleaned_data.get('content') _type = self.cleaned_data.get('type') ...
Create/edit DataRecord
DataRecordForm
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DataRecordForm: """Create/edit DataRecord""" def clean_name(self): """Make sure name doesn't end with `.`""" <|body_0|> def clean_content(self): """Clean content based on selected type""" <|body_1|> <|end_skeleton|> <|body_start_0|> name = self....
stack_v2_sparse_classes_36k_train_008597
2,285
permissive
[ { "docstring": "Make sure name doesn't end with `.`", "name": "clean_name", "signature": "def clean_name(self)" }, { "docstring": "Clean content based on selected type", "name": "clean_content", "signature": "def clean_content(self)" } ]
2
null
Implement the Python class `DataRecordForm` described below. Class description: Create/edit DataRecord Method signatures and docstrings: - def clean_name(self): Make sure name doesn't end with `.` - def clean_content(self): Clean content based on selected type
Implement the Python class `DataRecordForm` described below. Class description: Create/edit DataRecord Method signatures and docstrings: - def clean_name(self): Make sure name doesn't end with `.` - def clean_content(self): Clean content based on selected type <|skeleton|> class DataRecordForm: """Create/edit Da...
2305b1e27abb0bfe9fcee93b79e012c62cba712e
<|skeleton|> class DataRecordForm: """Create/edit DataRecord""" def clean_name(self): """Make sure name doesn't end with `.`""" <|body_0|> def clean_content(self): """Clean content based on selected type""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DataRecordForm: """Create/edit DataRecord""" def clean_name(self): """Make sure name doesn't end with `.`""" name = self.cleaned_data.get('name') if name[-1] == '.': raise ValidationError(_('Name may not end with dot.'), code='invalid') return name def cle...
the_stack_v2_python_sparse
supervisr/dns/forms/records.py
BeryJu/supervisr
train
1
b36f1ae0209c72dc7b6ef426920d4eed12026f69
[ "import sys\nimport os\nnew_path = os.path.join(sys.prefix, 'Lib', 'site-packages')\nif os.path.exists(new_path) and new_path not in sys.path:\n sys.path += [new_path]", "action_handler_t_name = ida_kernwin.action_handler_t.__name__\nif action_handler_t_name == 'action_handler_t_objprotect':\n return\nif is...
<|body_start_0|> import sys import os new_path = os.path.join(sys.prefix, 'Lib', 'site-packages') if os.path.exists(new_path) and new_path not in sys.path: sys.path += [new_path] <|end_body_0|> <|body_start_1|> action_handler_t_name = ida_kernwin.action_handler_t.__n...
Fix
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Fix: def packagespath(): """Hack required in relatively old IDA linux/osx versions (around 6.4/5) to successfully load python packages installed in site-packages. IDA for linux/osx was using the machine's installed python instead of a packaged version, but that version was running withou...
stack_v2_sparse_classes_36k_train_008598
6,068
no_license
[ { "docstring": "Hack required in relatively old IDA linux/osx versions (around 6.4/5) to successfully load python packages installed in site-packages. IDA for linux/osx was using the machine's installed python instead of a packaged version, but that version was running without using site-packages. This made a u...
3
stack_v2_sparse_classes_30k_test_000877
Implement the Python class `Fix` described below. Class description: Implement the Fix class. Method signatures and docstrings: - def packagespath(): Hack required in relatively old IDA linux/osx versions (around 6.4/5) to successfully load python packages installed in site-packages. IDA for linux/osx was using the m...
Implement the Python class `Fix` described below. Class description: Implement the Fix class. Method signatures and docstrings: - def packagespath(): Hack required in relatively old IDA linux/osx versions (around 6.4/5) to successfully load python packages installed in site-packages. IDA for linux/osx was using the m...
149c210576ab77f930a7592d99203cf9e8819675
<|skeleton|> class Fix: def packagespath(): """Hack required in relatively old IDA linux/osx versions (around 6.4/5) to successfully load python packages installed in site-packages. IDA for linux/osx was using the machine's installed python instead of a packaged version, but that version was running withou...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Fix: def packagespath(): """Hack required in relatively old IDA linux/osx versions (around 6.4/5) to successfully load python packages installed in site-packages. IDA for linux/osx was using the machine's installed python instead of a packaged version, but that version was running without using site-p...
the_stack_v2_python_sparse
ida_plugins/rematch/rematch/idasix.py
Trietptm-on-Coding-Algorithms/stuff
train
0
c55d654ea716533d197236fde7525488d396d215
[ "FlatReader.__init__(self, underlying_array, formatted_dtype=formatted_dtype, formatted_shape=formatted_shape, reverse_axes=reverse_axes, transpose_axes=transpose_axes, format_function=format_function, close_segments=close_segments)\nSICDTypeReader.__init__(self, None, sicd_meta)\nself._check_sizes()", "if not is...
<|body_start_0|> FlatReader.__init__(self, underlying_array, formatted_dtype=formatted_dtype, formatted_shape=formatted_shape, reverse_axes=reverse_axes, transpose_axes=transpose_axes, format_function=format_function, close_segments=close_segments) SICDTypeReader.__init__(self, None, sicd_meta) ...
Create a sicd type reader directly from an array. **Changed in version 1.3.0** for reading changes.
FlatSICDReader
[ "MIT", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-public-domain" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FlatSICDReader: """Create a sicd type reader directly from an array. **Changed in version 1.3.0** for reading changes.""" def __init__(self, sicd_meta, underlying_array, formatted_dtype: Union[None, str, numpy.dtype]=None, formatted_shape: Union[None, Tuple[int, ...]]=None, reverse_axes: Uni...
stack_v2_sparse_classes_36k_train_008599
9,108
permissive
[ { "docstring": "Parameters ---------- sicd_meta : None|SICDType `None`, or the SICD metadata object underlying_array : numpy.ndarray formatted_dtype : None|str|numpy.dtype formatted_shape : None|Tuple[int, ...] reverse_axes : None|Sequence[int] transpose_axes : None|Tuple[int, ...] format_function : None|Format...
2
stack_v2_sparse_classes_30k_test_000696
Implement the Python class `FlatSICDReader` described below. Class description: Create a sicd type reader directly from an array. **Changed in version 1.3.0** for reading changes. Method signatures and docstrings: - def __init__(self, sicd_meta, underlying_array, formatted_dtype: Union[None, str, numpy.dtype]=None, f...
Implement the Python class `FlatSICDReader` described below. Class description: Create a sicd type reader directly from an array. **Changed in version 1.3.0** for reading changes. Method signatures and docstrings: - def __init__(self, sicd_meta, underlying_array, formatted_dtype: Union[None, str, numpy.dtype]=None, f...
de1b1886f161a83b6c89aadc7a2c7cfc4892ef81
<|skeleton|> class FlatSICDReader: """Create a sicd type reader directly from an array. **Changed in version 1.3.0** for reading changes.""" def __init__(self, sicd_meta, underlying_array, formatted_dtype: Union[None, str, numpy.dtype]=None, formatted_shape: Union[None, Tuple[int, ...]]=None, reverse_axes: Uni...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FlatSICDReader: """Create a sicd type reader directly from an array. **Changed in version 1.3.0** for reading changes.""" def __init__(self, sicd_meta, underlying_array, formatted_dtype: Union[None, str, numpy.dtype]=None, formatted_shape: Union[None, Tuple[int, ...]]=None, reverse_axes: Union[None, int,...
the_stack_v2_python_sparse
sarpy/io/complex/base.py
ngageoint/sarpy
train
192