blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
7.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
467
8.64k
id
stringlengths
40
40
length_bytes
int64
515
49.7k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
160
3.93k
prompted_full_text
stringlengths
681
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.09k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
331
8.3k
source
stringclasses
1 value
source_path
stringlengths
5
177
source_repo
stringlengths
6
88
split
stringclasses
1 value
star_events_count
int64
0
209k
63f19762c3cd44d05cd3dc51f3cb193ce3e5d93b
[ "routing_table_file = open(routing_table_file_name, 'rb')\nrouting_table = pickle.load(routing_table_file)\nrouting_table_file.close()\nreturn routing_table", "pickle_file_name = 'picked_routing_table_for_{}_{}'.format(routing_table.x, routing_table.y)\npickle_file_path = os.path.join(binary_directory, pickle_fil...
<|body_start_0|> routing_table_file = open(routing_table_file_name, 'rb') routing_table = pickle.load(routing_table_file) routing_table_file.close() return routing_table <|end_body_0|> <|body_start_1|> pickle_file_name = 'picked_routing_table_for_{}_{}'.format(routing_table.x, r...
A routing table to be reloaded
ReloadRoutingTable
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReloadRoutingTable: """A routing table to be reloaded""" def reload(routing_table_file_name): """Reload a routing table via a pickled filename :param routing_table_file_name: the file name for the pickled routeing table :return: None""" <|body_0|> def store(binary_direct...
stack_v2_sparse_classes_10k_train_008900
1,109
permissive
[ { "docstring": "Reload a routing table via a pickled filename :param routing_table_file_name: the file name for the pickled routeing table :return: None", "name": "reload", "signature": "def reload(routing_table_file_name)" }, { "docstring": "Store a routing table in pickled form :param binary_d...
2
null
Implement the Python class `ReloadRoutingTable` described below. Class description: A routing table to be reloaded Method signatures and docstrings: - def reload(routing_table_file_name): Reload a routing table via a pickled filename :param routing_table_file_name: the file name for the pickled routeing table :return...
Implement the Python class `ReloadRoutingTable` described below. Class description: A routing table to be reloaded Method signatures and docstrings: - def reload(routing_table_file_name): Reload a routing table via a pickled filename :param routing_table_file_name: the file name for the pickled routeing table :return...
04fa1eaf78778edea3ba3afa4c527d20c491718e
<|skeleton|> class ReloadRoutingTable: """A routing table to be reloaded""" def reload(routing_table_file_name): """Reload a routing table via a pickled filename :param routing_table_file_name: the file name for the pickled routeing table :return: None""" <|body_0|> def store(binary_direct...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ReloadRoutingTable: """A routing table to be reloaded""" def reload(routing_table_file_name): """Reload a routing table via a pickled filename :param routing_table_file_name: the file name for the pickled routeing table :return: None""" routing_table_file = open(routing_table_file_name, '...
the_stack_v2_python_sparse
src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/utilities/reload/reload_routing_table.py
Roboy/LSM_SpiNNaker_MyoArm
train
2
b41b20b5d28d32c03f874c5d84ddb780236ed369
[ "self.user_pin = user_pin\nself.user_name = user_name\nself.user_pwd = user_pwd\nself.bad_chars = '0123456789!\"@#$%^&*()_=+,<>/?;:[]{}\\\\)'\nself.bad_pwd_chars = '!\"@#$%^&*()_=+,<>/?;:[]{}\\\\)'", "if self.user_pin:\n if self.user_pin.isnumeric():\n if len(self.user_pin) <= max_length:\n r...
<|body_start_0|> self.user_pin = user_pin self.user_name = user_name self.user_pwd = user_pwd self.bad_chars = '0123456789!"@#$%^&*()_=+,<>/?;:[]{}\\)' self.bad_pwd_chars = '!"@#$%^&*()_=+,<>/?;:[]{}\\)' <|end_body_0|> <|body_start_1|> if self.user_pin: if se...
A class representation of user input validation. Inherits attributes of the Person class. Methods: Constructor: < __init__() > < ID_check > < Name_Checker > All attributes of the class has default value of empty string.
Validator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Validator: """A class representation of user input validation. Inherits attributes of the Person class. Methods: Constructor: < __init__() > < ID_check > < Name_Checker > All attributes of the class has default value of empty string.""" def __init__(self, user_pin='', user_name='', user_pwd=...
stack_v2_sparse_classes_10k_train_008901
4,203
no_license
[ { "docstring": "Initialising attributes for Validator class", "name": "__init__", "signature": "def __init__(self, user_pin='', user_name='', user_pwd='')" }, { "docstring": "Description: Method checks user ID for maximum length and returns <user ID> . Method returns in event of bad character in...
4
stack_v2_sparse_classes_30k_train_007109
Implement the Python class `Validator` described below. Class description: A class representation of user input validation. Inherits attributes of the Person class. Methods: Constructor: < __init__() > < ID_check > < Name_Checker > All attributes of the class has default value of empty string. Method signatures and d...
Implement the Python class `Validator` described below. Class description: A class representation of user input validation. Inherits attributes of the Person class. Methods: Constructor: < __init__() > < ID_check > < Name_Checker > All attributes of the class has default value of empty string. Method signatures and d...
b4c2072cf51e4ee8523e77a6850f5418b936ceb0
<|skeleton|> class Validator: """A class representation of user input validation. Inherits attributes of the Person class. Methods: Constructor: < __init__() > < ID_check > < Name_Checker > All attributes of the class has default value of empty string.""" def __init__(self, user_pin='', user_name='', user_pwd=...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Validator: """A class representation of user input validation. Inherits attributes of the Person class. Methods: Constructor: < __init__() > < ID_check > < Name_Checker > All attributes of the class has default value of empty string.""" def __init__(self, user_pin='', user_name='', user_pwd=''): ...
the_stack_v2_python_sparse
user.py
Johnnyhashtag/my_work
train
0
2eb340c30d5cd2e26a29c62a11c79a58f7a68bce
[ "request = RequestFactory().get('/')\ncontext = {'request': request}\ncommon_bundle = (chunk for chunk in FAKE_COMMON_BUNDLE)\nget_bundle = Mock(return_value=common_bundle)\nloader = Mock(get_bundle=get_bundle)\nbundle_name = 'bundle_name'\nwith patch('ui.templatetags.render_bundle.get_loader', return_value=loader)...
<|body_start_0|> request = RequestFactory().get('/') context = {'request': request} common_bundle = (chunk for chunk in FAKE_COMMON_BUNDLE) get_bundle = Mock(return_value=common_bundle) loader = Mock(get_bundle=get_bundle) bundle_name = 'bundle_name' with patch('u...
Tests for render_bundle
TestRenderBundle
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestRenderBundle: """Tests for render_bundle""" def test_debug(self): """If USE_WEBPACK_DEV_SERVER=True, return a hot reload URL""" <|body_0|> def test_production(self): """If USE_WEBPACK_DEV_SERVER=False, return a static URL for production""" <|body_1|> ...
stack_v2_sparse_classes_10k_train_008902
3,850
permissive
[ { "docstring": "If USE_WEBPACK_DEV_SERVER=True, return a hot reload URL", "name": "test_debug", "signature": "def test_debug(self)" }, { "docstring": "If USE_WEBPACK_DEV_SERVER=False, return a static URL for production", "name": "test_production", "signature": "def test_production(self)"...
3
null
Implement the Python class `TestRenderBundle` described below. Class description: Tests for render_bundle Method signatures and docstrings: - def test_debug(self): If USE_WEBPACK_DEV_SERVER=True, return a hot reload URL - def test_production(self): If USE_WEBPACK_DEV_SERVER=False, return a static URL for production -...
Implement the Python class `TestRenderBundle` described below. Class description: Tests for render_bundle Method signatures and docstrings: - def test_debug(self): If USE_WEBPACK_DEV_SERVER=True, return a hot reload URL - def test_production(self): If USE_WEBPACK_DEV_SERVER=False, return a static URL for production -...
d6564caca0b7bbfd31e67a751564107fd17d6eb0
<|skeleton|> class TestRenderBundle: """Tests for render_bundle""" def test_debug(self): """If USE_WEBPACK_DEV_SERVER=True, return a hot reload URL""" <|body_0|> def test_production(self): """If USE_WEBPACK_DEV_SERVER=False, return a static URL for production""" <|body_1|> ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TestRenderBundle: """Tests for render_bundle""" def test_debug(self): """If USE_WEBPACK_DEV_SERVER=True, return a hot reload URL""" request = RequestFactory().get('/') context = {'request': request} common_bundle = (chunk for chunk in FAKE_COMMON_BUNDLE) get_bundle...
the_stack_v2_python_sparse
ui/templatetags/render_bundle_test.py
mitodl/micromasters
train
35
67d551dcccde1f32407da6b9c68f8c84f7448b1f
[ "self.id = id\nself.title = title\nself.device_group = device_group\nself.device_type_id = device_type_id\nself.device_brand_id = device_brand_id\nself.create_on = create_on\nself.update_on = update_on\nself.created_by = created_by\nself.updated_by = updated_by\nself.create_on_persian_date = create_on_persian_date\...
<|body_start_0|> self.id = id self.title = title self.device_group = device_group self.device_type_id = device_type_id self.device_brand_id = device_brand_id self.create_on = create_on self.update_on = update_on self.created_by = created_by self.up...
Implementation of the 'DeviceBrandTypes' model. TODO: type model description here. Attributes: id (int): TODO: type description here. title (string): TODO: type description here. device_group (int): TODO: type description here. device_type_id (int): TODO: type description here. device_brand_id (string): TODO: type desc...
DeviceBrandTypes
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DeviceBrandTypes: """Implementation of the 'DeviceBrandTypes' model. TODO: type model description here. Attributes: id (int): TODO: type description here. title (string): TODO: type description here. device_group (int): TODO: type description here. device_type_id (int): TODO: type description her...
stack_v2_sparse_classes_10k_train_008903
5,769
permissive
[ { "docstring": "Constructor for the DeviceBrandTypes class", "name": "__init__", "signature": "def __init__(self, id=None, title=None, device_group=None, create_on=None, update_on=None, created_by=None, create_on_persian_date=None, update_on_persian_date=None, device_type_brand_model_title=None, device_...
2
stack_v2_sparse_classes_30k_train_001354
Implement the Python class `DeviceBrandTypes` described below. Class description: Implementation of the 'DeviceBrandTypes' model. TODO: type model description here. Attributes: id (int): TODO: type description here. title (string): TODO: type description here. device_group (int): TODO: type description here. device_ty...
Implement the Python class `DeviceBrandTypes` described below. Class description: Implementation of the 'DeviceBrandTypes' model. TODO: type model description here. Attributes: id (int): TODO: type description here. title (string): TODO: type description here. device_group (int): TODO: type description here. device_ty...
b574a76a8805b306a423229b572c36dae0159def
<|skeleton|> class DeviceBrandTypes: """Implementation of the 'DeviceBrandTypes' model. TODO: type model description here. Attributes: id (int): TODO: type description here. title (string): TODO: type description here. device_group (int): TODO: type description here. device_type_id (int): TODO: type description her...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class DeviceBrandTypes: """Implementation of the 'DeviceBrandTypes' model. TODO: type model description here. Attributes: id (int): TODO: type description here. title (string): TODO: type description here. device_group (int): TODO: type description here. device_type_id (int): TODO: type description here. device_bra...
the_stack_v2_python_sparse
easybimehlanding/models/device_brand_types.py
kmelodi/EasyBimehLanding_Python
train
0
44c41be0793e1e44975f1ce6da060a775979e655
[ "self.group = game.all_sprites\npygame.sprite.Sprite.__init__(self)\nself.layer = 0\nself.group.add(self, layer=self.layer)\nself.game = game\nself.timer = 0\nself.frame = 0\nself.images = images\nself.image = self.images[0]\nself.rect = self.image.get_rect()\nself.rect.center = pos\nself.game = game\nself.pos = po...
<|body_start_0|> self.group = game.all_sprites pygame.sprite.Sprite.__init__(self) self.layer = 0 self.group.add(self, layer=self.layer) self.game = game self.timer = 0 self.frame = 0 self.images = images self.image = self.images[0] self.re...
This class is base class for effects. Animation is played from images list and destroyed itself.
Effect
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Effect: """This class is base class for effects. Animation is played from images list and destroyed itself.""" def __init__(self, game, pos, images, delay): """__init__ method for Explosion class Args: game (<class 'Integrate.Game'>): Integrate.Game class object. pos (tuple length 2)...
stack_v2_sparse_classes_10k_train_008904
1,620
no_license
[ { "docstring": "__init__ method for Explosion class Args: game (<class 'Integrate.Game'>): Integrate.Game class object. pos (tuple length 2): position of the player (x,y). images (<list>): image list from sprites. delay (int): delay between animation images", "name": "__init__", "signature": "def __init...
2
stack_v2_sparse_classes_30k_train_002807
Implement the Python class `Effect` described below. Class description: This class is base class for effects. Animation is played from images list and destroyed itself. Method signatures and docstrings: - def __init__(self, game, pos, images, delay): __init__ method for Explosion class Args: game (<class 'Integrate.G...
Implement the Python class `Effect` described below. Class description: This class is base class for effects. Animation is played from images list and destroyed itself. Method signatures and docstrings: - def __init__(self, game, pos, images, delay): __init__ method for Explosion class Args: game (<class 'Integrate.G...
74524cd52988c4c3f720150a418ff283a8d05683
<|skeleton|> class Effect: """This class is base class for effects. Animation is played from images list and destroyed itself.""" def __init__(self, game, pos, images, delay): """__init__ method for Explosion class Args: game (<class 'Integrate.Game'>): Integrate.Game class object. pos (tuple length 2)...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Effect: """This class is base class for effects. Animation is played from images list and destroyed itself.""" def __init__(self, game, pos, images, delay): """__init__ method for Explosion class Args: game (<class 'Integrate.Game'>): Integrate.Game class object. pos (tuple length 2): position of...
the_stack_v2_python_sparse
effects/Effect.py
ImpulseLimited/momentus-proto
train
0
3e97a639e14dd96e69151acf2c663d770df2d5a2
[ "filters = {}\nif hasattr(request, 'GET'):\n filters = request.GET.copy()\nfilters.update(kwargs)\ntry:\n user = UserProfile.objects.filter(uuid=uuid_from_uri(filters['user']))\n sub_pk = sorted(chain(user[0].subscriptions(), user))\n im = Image.objects.filter(is_active=True, owner__in=sub_pk)\n wb =...
<|body_start_0|> filters = {} if hasattr(request, 'GET'): filters = request.GET.copy() filters.update(kwargs) try: user = UserProfile.objects.filter(uuid=uuid_from_uri(filters['user'])) sub_pk = sorted(chain(user[0].subscriptions(), user)) ...
NewsfeedResource
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NewsfeedResource: def obj_get_list(self, request=None, **kwargs): """A ORM-specific implementation of ``obj_get_list``. Takes an optional ``request`` object, whose ``GET`` dictionary can be used to narrow the query.""" <|body_0|> def full_dehydrate(self, bundle): """...
stack_v2_sparse_classes_10k_train_008905
19,893
no_license
[ { "docstring": "A ORM-specific implementation of ``obj_get_list``. Takes an optional ``request`` object, whose ``GET`` dictionary can be used to narrow the query.", "name": "obj_get_list", "signature": "def obj_get_list(self, request=None, **kwargs)" }, { "docstring": "Given a bundle with an obj...
2
stack_v2_sparse_classes_30k_train_000154
Implement the Python class `NewsfeedResource` described below. Class description: Implement the NewsfeedResource class. Method signatures and docstrings: - def obj_get_list(self, request=None, **kwargs): A ORM-specific implementation of ``obj_get_list``. Takes an optional ``request`` object, whose ``GET`` dictionary ...
Implement the Python class `NewsfeedResource` described below. Class description: Implement the NewsfeedResource class. Method signatures and docstrings: - def obj_get_list(self, request=None, **kwargs): A ORM-specific implementation of ``obj_get_list``. Takes an optional ``request`` object, whose ``GET`` dictionary ...
698e027b7f6f4db5c2e9b9a899ba74f4ad4daf8e
<|skeleton|> class NewsfeedResource: def obj_get_list(self, request=None, **kwargs): """A ORM-specific implementation of ``obj_get_list``. Takes an optional ``request`` object, whose ``GET`` dictionary can be used to narrow the query.""" <|body_0|> def full_dehydrate(self, bundle): """...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class NewsfeedResource: def obj_get_list(self, request=None, **kwargs): """A ORM-specific implementation of ``obj_get_list``. Takes an optional ``request`` object, whose ``GET`` dictionary can be used to narrow the query.""" filters = {} if hasattr(request, 'GET'): filters = requ...
the_stack_v2_python_sparse
back-end/website/api/v1/action_resources.py
dchang00/keekaa-back-end
train
0
1d4bf16cede0f8688702ef4f98dc7ea51d318dc6
[ "if root is None:\n return 0\nleft_height = self.maxDepth(root.left)\nright_height = self.maxDepth(root.right)\nreturn max(left_height, right_height) + 1", "stack = []\nif root is not None:\n stack.append((1, root))\ndepth = 0\nwhile stack != []:\n current_depth, root = stack.pop()\n if root is not No...
<|body_start_0|> if root is None: return 0 left_height = self.maxDepth(root.left) right_height = self.maxDepth(root.right) return max(left_height, right_height) + 1 <|end_body_0|> <|body_start_1|> stack = [] if root is not None: stack.append((1, r...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxDepth(self, root: TreeNode) -> int: """递归实现 DFS""" <|body_0|> def maxDepth2(self, root: TreeNode) -> int: """栈实现 DFS 76 ms 14.9 MB""" <|body_1|> <|end_skeleton|> <|body_start_0|> if root is None: return 0 left_he...
stack_v2_sparse_classes_10k_train_008906
1,790
no_license
[ { "docstring": "递归实现 DFS", "name": "maxDepth", "signature": "def maxDepth(self, root: TreeNode) -> int" }, { "docstring": "栈实现 DFS 76 ms 14.9 MB", "name": "maxDepth2", "signature": "def maxDepth2(self, root: TreeNode) -> int" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxDepth(self, root: TreeNode) -> int: 递归实现 DFS - def maxDepth2(self, root: TreeNode) -> int: 栈实现 DFS 76 ms 14.9 MB
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxDepth(self, root: TreeNode) -> int: 递归实现 DFS - def maxDepth2(self, root: TreeNode) -> int: 栈实现 DFS 76 ms 14.9 MB <|skeleton|> class Solution: def maxDepth(self, root...
40726506802d2d60028fdce206696b1df2f63ece
<|skeleton|> class Solution: def maxDepth(self, root: TreeNode) -> int: """递归实现 DFS""" <|body_0|> def maxDepth2(self, root: TreeNode) -> int: """栈实现 DFS 76 ms 14.9 MB""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def maxDepth(self, root: TreeNode) -> int: """递归实现 DFS""" if root is None: return 0 left_height = self.maxDepth(root.left) right_height = self.maxDepth(root.right) return max(left_height, right_height) + 1 def maxDepth2(self, root: TreeNode) -...
the_stack_v2_python_sparse
算法/maxDepth.py
1oser5/LeetCode
train
0
e538e26a3316f7b60fd55e220443cb05870a4bb3
[ "if not s:\n return ''\nif len(s) == 1:\n return s\nret = ''\nfor i in range(len(s)):\n l = r = i\n while r < len(s) and s[l] == s[r]:\n r += 1\n if len(ret) < r - l:\n ret = s[l:r]\n l -= 1\n while l >= 0 and r < len(s) and (s[l] == s[r]):\n l -= 1\n r += 1\n if ...
<|body_start_0|> if not s: return '' if len(s) == 1: return s ret = '' for i in range(len(s)): l = r = i while r < len(s) and s[l] == s[r]: r += 1 if len(ret) < r - l: ret = s[l:r] l -...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longestPalindrome(self, s): """Time complexity:O(N*N) Spave complexity:O(N) 验证通过,性能不错 Runtime: 728 ms, faster than 91.18% of Python3 online submissions for Longest Palindromic Substring. Memory Usage: 14.1 MB, less than 76.49% of Python3 online submissions for Longest Palin...
stack_v2_sparse_classes_10k_train_008907
3,775
no_license
[ { "docstring": "Time complexity:O(N*N) Spave complexity:O(N) 验证通过,性能不错 Runtime: 728 ms, faster than 91.18% of Python3 online submissions for Longest Palindromic Substring. Memory Usage: 14.1 MB, less than 76.49% of Python3 online submissions for Longest Palindromic Substring. :param s: :return:", "name": "l...
2
stack_v2_sparse_classes_30k_test_000014
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestPalindrome(self, s): Time complexity:O(N*N) Spave complexity:O(N) 验证通过,性能不错 Runtime: 728 ms, faster than 91.18% of Python3 online submissions for Longest Palindromic S...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestPalindrome(self, s): Time complexity:O(N*N) Spave complexity:O(N) 验证通过,性能不错 Runtime: 728 ms, faster than 91.18% of Python3 online submissions for Longest Palindromic S...
6a7267b8b784283a760de7775089b936a0e97617
<|skeleton|> class Solution: def longestPalindrome(self, s): """Time complexity:O(N*N) Spave complexity:O(N) 验证通过,性能不错 Runtime: 728 ms, faster than 91.18% of Python3 online submissions for Longest Palindromic Substring. Memory Usage: 14.1 MB, less than 76.49% of Python3 online submissions for Longest Palin...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def longestPalindrome(self, s): """Time complexity:O(N*N) Spave complexity:O(N) 验证通过,性能不错 Runtime: 728 ms, faster than 91.18% of Python3 online submissions for Longest Palindromic Substring. Memory Usage: 14.1 MB, less than 76.49% of Python3 online submissions for Longest Palindromic Substri...
the_stack_v2_python_sparse
leetcode/5_longest_palindromic_substring/longest_palindromic_substring.py
liuyanhui/leetcode-py
train
0
f29dd8f61f0491cf45bc566ff43f6a469032e233
[ "ret = 'zz'\nfor letter in letters:\n if letter > target:\n ret = min(letter, ret)\nreturn ret if ret != 'zz' else min(letters)", "for letter in letters:\n if letter > target:\n return letter\nreturn letters[0]", "if target >= letters[-1]:\n return letters[0]\nstart = 0\nend = len(letters...
<|body_start_0|> ret = 'zz' for letter in letters: if letter > target: ret = min(letter, ret) return ret if ret != 'zz' else min(letters) <|end_body_0|> <|body_start_1|> for letter in letters: if letter > target: return letter ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def nextGreatestLetter1(self, letters, target): """:type letters: List[str] :type target: str :rtype: str""" <|body_0|> def nextGreatestLetter2(self, letters, target): """:type letters: List[str] :type target: str :rtype: str""" <|body_1|> def ...
stack_v2_sparse_classes_10k_train_008908
1,413
no_license
[ { "docstring": ":type letters: List[str] :type target: str :rtype: str", "name": "nextGreatestLetter1", "signature": "def nextGreatestLetter1(self, letters, target)" }, { "docstring": ":type letters: List[str] :type target: str :rtype: str", "name": "nextGreatestLetter2", "signature": "d...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def nextGreatestLetter1(self, letters, target): :type letters: List[str] :type target: str :rtype: str - def nextGreatestLetter2(self, letters, target): :type letters: List[str] ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def nextGreatestLetter1(self, letters, target): :type letters: List[str] :type target: str :rtype: str - def nextGreatestLetter2(self, letters, target): :type letters: List[str] ...
70bdd75b6af2e1811c1beab22050c01d28d7373e
<|skeleton|> class Solution: def nextGreatestLetter1(self, letters, target): """:type letters: List[str] :type target: str :rtype: str""" <|body_0|> def nextGreatestLetter2(self, letters, target): """:type letters: List[str] :type target: str :rtype: str""" <|body_1|> def ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def nextGreatestLetter1(self, letters, target): """:type letters: List[str] :type target: str :rtype: str""" ret = 'zz' for letter in letters: if letter > target: ret = min(letter, ret) return ret if ret != 'zz' else min(letters) def n...
the_stack_v2_python_sparse
python/leetcode_bak/744_Find_Smallest_Letter_Greater_Than_Target.py
bobcaoge/my-code
train
0
54b64b8d644f496f7399d07a752379e19c2d1b28
[ "self.s3_conn = s3_conn\nself.cache_dir = cache_dir\nself.s3_path = s3_path\nself.bucket_name, self.prefix = split_s3_path(self.s3_path)", "full_path = os.path.join(self.cache_dir, filename)\nif os.path.isfile(full_path):\n yield full_path\nelse:\n if not os.path.isdir(self.cache_dir):\n os.mkdir(sel...
<|body_start_0|> self.s3_conn = s3_conn self.cache_dir = cache_dir self.s3_path = s3_path self.bucket_name, self.prefix = split_s3_path(self.s3_path) <|end_body_0|> <|body_start_1|> full_path = os.path.join(self.cache_dir, filename) if os.path.isfile(full_path): ...
An object that downloads and caches ONET files from S3
OnetCache
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OnetCache: """An object that downloads and caches ONET files from S3""" def __init__(self, s3_conn, s3_path, cache_dir): """Args: s3_conn: a boto s3 connection s3_path: path to the onet directory cache_dir: directory to cache files""" <|body_0|> def ensure_file(self, fil...
stack_v2_sparse_classes_10k_train_008909
2,489
permissive
[ { "docstring": "Args: s3_conn: a boto s3 connection s3_path: path to the onet directory cache_dir: directory to cache files", "name": "__init__", "signature": "def __init__(self, s3_conn, s3_path, cache_dir)" }, { "docstring": "Ensures that the given ONET data file is present, either by using a ...
2
stack_v2_sparse_classes_30k_train_006213
Implement the Python class `OnetCache` described below. Class description: An object that downloads and caches ONET files from S3 Method signatures and docstrings: - def __init__(self, s3_conn, s3_path, cache_dir): Args: s3_conn: a boto s3 connection s3_path: path to the onet directory cache_dir: directory to cache f...
Implement the Python class `OnetCache` described below. Class description: An object that downloads and caches ONET files from S3 Method signatures and docstrings: - def __init__(self, s3_conn, s3_path, cache_dir): Args: s3_conn: a boto s3 connection s3_path: path to the onet directory cache_dir: directory to cache f...
feffead90815ccdecf24bf1a995f79683442b046
<|skeleton|> class OnetCache: """An object that downloads and caches ONET files from S3""" def __init__(self, s3_conn, s3_path, cache_dir): """Args: s3_conn: a boto s3 connection s3_path: path to the onet directory cache_dir: directory to cache files""" <|body_0|> def ensure_file(self, fil...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class OnetCache: """An object that downloads and caches ONET files from S3""" def __init__(self, s3_conn, s3_path, cache_dir): """Args: s3_conn: a boto s3 connection s3_path: path to the onet directory cache_dir: directory to cache files""" self.s3_conn = s3_conn self.cache_dir = cache_...
the_stack_v2_python_sparse
skills_ml/datasets/onet_cache.py
workforce-data-initiative/skills-ml
train
164
8d6a9f254f5f172d59c528d8e8f6dd584e13f435
[ "tk.Tk.__init__(self)\nself.title('CPPN playground')\ncontainer = tk.Frame(self)\ncontainer.pack(side='top', fill='both', expand=True)\ncontainer.grid_rowconfigure(0, weight=1)\ncontainer.grid_columnconfigure(0, weight=1)\nmenubar = tk.Menu(self)\nfilemenu = tk.Menu(menubar)\nfilemenu.add_command(label='Main Page',...
<|body_start_0|> tk.Tk.__init__(self) self.title('CPPN playground') container = tk.Frame(self) container.pack(side='top', fill='both', expand=True) container.grid_rowconfigure(0, weight=1) container.grid_columnconfigure(0, weight=1) menubar = tk.Menu(self) ...
Main class that contains all handlers for the Tkinter GUI
Playground
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Playground: """Main class that contains all handlers for the Tkinter GUI""" def __init__(self, genotype): """Contructer for main GUI container/handler""" <|body_0|> def raise_frame(self, page_name, container): """Raise a certain frame to the front of the GUI base...
stack_v2_sparse_classes_10k_train_008910
11,786
no_license
[ { "docstring": "Contructer for main GUI container/handler", "name": "__init__", "signature": "def __init__(self, genotype)" }, { "docstring": "Raise a certain frame to the front of the GUI based on its page_name", "name": "raise_frame", "signature": "def raise_frame(self, page_name, cont...
2
stack_v2_sparse_classes_30k_train_006640
Implement the Python class `Playground` described below. Class description: Main class that contains all handlers for the Tkinter GUI Method signatures and docstrings: - def __init__(self, genotype): Contructer for main GUI container/handler - def raise_frame(self, page_name, container): Raise a certain frame to the ...
Implement the Python class `Playground` described below. Class description: Main class that contains all handlers for the Tkinter GUI Method signatures and docstrings: - def __init__(self, genotype): Contructer for main GUI container/handler - def raise_frame(self, page_name, container): Raise a certain frame to the ...
317b615e39df5999f2fd3d5e7dd0af7d54aee6c8
<|skeleton|> class Playground: """Main class that contains all handlers for the Tkinter GUI""" def __init__(self, genotype): """Contructer for main GUI container/handler""" <|body_0|> def raise_frame(self, page_name, container): """Raise a certain frame to the front of the GUI base...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Playground: """Main class that contains all handlers for the Tkinter GUI""" def __init__(self, genotype): """Contructer for main GUI container/handler""" tk.Tk.__init__(self) self.title('CPPN playground') container = tk.Frame(self) container.pack(side='top', fill='...
the_stack_v2_python_sparse
FULL_CPPN_playground.py
wolfecameron/CPPN_springopt
train
4
62d6584c2b47f966c964d1875f06e83e47e3bdfa
[ "trie = Trie()\nfor p in products:\n trie.add(p)\nres = []\nprefix = ''\nfor c in searchWord:\n prefix += c\n l = trie.findAll(prefix)\n res.append(sorted(l)[:3])\nreturn res", "products.sort()\nprefix = ''\nres = []\nfor c in searchWord:\n temp = []\n prefix += c\n i = bisect.bisect_left(pro...
<|body_start_0|> trie = Trie() for p in products: trie.add(p) res = [] prefix = '' for c in searchWord: prefix += c l = trie.findAll(prefix) res.append(sorted(l)[:3]) return res <|end_body_0|> <|body_start_1|> produ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]: """Trie 구현.""" <|body_0|> def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]: """sort 후 binary search.""" <|body_1|> <|end_skele...
stack_v2_sparse_classes_10k_train_008911
1,844
no_license
[ { "docstring": "Trie 구현.", "name": "suggestedProducts", "signature": "def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]" }, { "docstring": "sort 후 binary search.", "name": "suggestedProducts", "signature": "def suggestedProducts(self, products: List[str...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]: Trie 구현. - def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[st...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]: Trie 구현. - def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[st...
c26aef2a59e5cc2d9b0658b9c7386a43267ff8a1
<|skeleton|> class Solution: def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]: """Trie 구현.""" <|body_0|> def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]: """sort 후 binary search.""" <|body_1|> <|end_skele...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]: """Trie 구현.""" trie = Trie() for p in products: trie.add(p) res = [] prefix = '' for c in searchWord: prefix += c l = trie.findAll...
the_stack_v2_python_sparse
Leetcode/1268.py
hanwgyu/algorithm_problem_solving
train
5
edc81c749fb9780625a96a3f24be57a1a5028743
[ "cm = {}\nwm = {}\nfor c, w in itertools.zip_longest(pattern, s.split()):\n if c is None or w is None or (c in cm and cm[c] != w) or (w in wm and wm[w] != c):\n return False\n cm[c] = w\n wm[w] = c\nreturn True", "pw = {}\nwp = {}\nfor p, w in itertools.zip_longest(pattern, s.split()):\n if p i...
<|body_start_0|> cm = {} wm = {} for c, w in itertools.zip_longest(pattern, s.split()): if c is None or w is None or (c in cm and cm[c] != w) or (w in wm and wm[w] != c): return False cm[c] = w wm[w] = c return True <|end_body_0|> <|bo...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def wordPattern(self, pattern: str, s: str) -> bool: """Jan 31, 2022 13:02""" <|body_0|> def wordPattern(self, pattern: str, s: str) -> bool: """Mar 04, 2023 20:08""" <|body_1|> <|end_skeleton|> <|body_start_0|> cm = {} wm = {} ...
stack_v2_sparse_classes_10k_train_008912
2,226
no_license
[ { "docstring": "Jan 31, 2022 13:02", "name": "wordPattern", "signature": "def wordPattern(self, pattern: str, s: str) -> bool" }, { "docstring": "Mar 04, 2023 20:08", "name": "wordPattern", "signature": "def wordPattern(self, pattern: str, s: str) -> bool" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wordPattern(self, pattern: str, s: str) -> bool: Jan 31, 2022 13:02 - def wordPattern(self, pattern: str, s: str) -> bool: Mar 04, 2023 20:08
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wordPattern(self, pattern: str, s: str) -> bool: Jan 31, 2022 13:02 - def wordPattern(self, pattern: str, s: str) -> bool: Mar 04, 2023 20:08 <|skeleton|> class Solution: ...
1389a009a02e90e8700a7a00e0b7f797c129cdf4
<|skeleton|> class Solution: def wordPattern(self, pattern: str, s: str) -> bool: """Jan 31, 2022 13:02""" <|body_0|> def wordPattern(self, pattern: str, s: str) -> bool: """Mar 04, 2023 20:08""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def wordPattern(self, pattern: str, s: str) -> bool: """Jan 31, 2022 13:02""" cm = {} wm = {} for c, w in itertools.zip_longest(pattern, s.split()): if c is None or w is None or (c in cm and cm[c] != w) or (w in wm and wm[w] != c): return F...
the_stack_v2_python_sparse
leetcode/solved/290_Word_Pattern/solution.py
sungminoh/algorithms
train
0
0a8ac351d92f30d2694341ff6977d3a26435cef4
[ "q1 = [node]\nans = Node(node.val, [])\nq2 = [ans]\nvisited = set()\nwhile q1:\n cur1 = q1.pop()\n cur2 = q2.pop()\n visited.add(cur1)\n for neighbor in cur1.neighbors:\n if neighbor in visited:\n continue\n if neighbor not in q1:\n q1.append(neighbor)\n ne...
<|body_start_0|> q1 = [node] ans = Node(node.val, []) q2 = [ans] visited = set() while q1: cur1 = q1.pop() cur2 = q2.pop() visited.add(cur1) for neighbor in cur1.neighbors: if neighbor in visited: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def cloneGraph(self, node: 'Node') -> 'Node': """bfs""" <|body_0|> def cloneGraph1(self, node: 'Node') -> 'Node': """dfs""" <|body_1|> def cloneGraph2(self, node: 'Node') -> 'Node': """非递归 dfs""" <|body_2|> def cloneGraph3(...
stack_v2_sparse_classes_10k_train_008913
2,567
no_license
[ { "docstring": "bfs", "name": "cloneGraph", "signature": "def cloneGraph(self, node: 'Node') -> 'Node'" }, { "docstring": "dfs", "name": "cloneGraph1", "signature": "def cloneGraph1(self, node: 'Node') -> 'Node'" }, { "docstring": "非递归 dfs", "name": "cloneGraph2", "signat...
4
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def cloneGraph(self, node: 'Node') -> 'Node': bfs - def cloneGraph1(self, node: 'Node') -> 'Node': dfs - def cloneGraph2(self, node: 'Node') -> 'Node': 非递归 dfs - def cloneGraph3(...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def cloneGraph(self, node: 'Node') -> 'Node': bfs - def cloneGraph1(self, node: 'Node') -> 'Node': dfs - def cloneGraph2(self, node: 'Node') -> 'Node': 非递归 dfs - def cloneGraph3(...
e2fecd266bfced6208694b19a2d81182b13dacd6
<|skeleton|> class Solution: def cloneGraph(self, node: 'Node') -> 'Node': """bfs""" <|body_0|> def cloneGraph1(self, node: 'Node') -> 'Node': """dfs""" <|body_1|> def cloneGraph2(self, node: 'Node') -> 'Node': """非递归 dfs""" <|body_2|> def cloneGraph3(...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def cloneGraph(self, node: 'Node') -> 'Node': """bfs""" q1 = [node] ans = Node(node.val, []) q2 = [ans] visited = set() while q1: cur1 = q1.pop() cur2 = q2.pop() visited.add(cur1) for neighbor in cur1.nei...
the_stack_v2_python_sparse
cloneGraph.py
HuipengXu/leetcode
train
0
47b1e796708ee421f462e4a68b1e71be170df340
[ "super().__init__(**kwargs)\nself.identifier_required = identifier_required\nself.disallowed_asset_types = disallowed_asset_types\nself.coingecko_obj = coingecko\nself.cryptocompare_obj = cryptocompare", "asset_type = data.pop('asset_type')\nif self.disallowed_asset_types is not None and asset_type in self.disall...
<|body_start_0|> super().__init__(**kwargs) self.identifier_required = identifier_required self.disallowed_asset_types = disallowed_asset_types self.coingecko_obj = coingecko self.cryptocompare_obj = cryptocompare <|end_body_0|> <|body_start_1|> asset_type = data.pop('as...
AssetSchema
[ "AGPL-3.0-only", "AGPL-3.0-or-later", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AssetSchema: def __init__(self, identifier_required: bool, disallowed_asset_types: Optional[list[AssetType]]=None, coingecko: Optional['Coingecko']=None, cryptocompare: Optional['Cryptocompare']=None, **kwargs: Any) -> None: """Initializes an asset schema depending on the given asset typ...
stack_v2_sparse_classes_10k_train_008914
13,942
permissive
[ { "docstring": "Initializes an asset schema depending on the given asset type. If identifier_required is True then the identifier field is required. Provided asset_type must not be in disallowed_asset_types list. If coingecko is not None then the coingecko identifier has to be valid. If cryptocompare is not Non...
2
null
Implement the Python class `AssetSchema` described below. Class description: Implement the AssetSchema class. Method signatures and docstrings: - def __init__(self, identifier_required: bool, disallowed_asset_types: Optional[list[AssetType]]=None, coingecko: Optional['Coingecko']=None, cryptocompare: Optional['Crypto...
Implement the Python class `AssetSchema` described below. Class description: Implement the AssetSchema class. Method signatures and docstrings: - def __init__(self, identifier_required: bool, disallowed_asset_types: Optional[list[AssetType]]=None, coingecko: Optional['Coingecko']=None, cryptocompare: Optional['Crypto...
496948458b89afc41458f19d1cba0e971ab67c8b
<|skeleton|> class AssetSchema: def __init__(self, identifier_required: bool, disallowed_asset_types: Optional[list[AssetType]]=None, coingecko: Optional['Coingecko']=None, cryptocompare: Optional['Cryptocompare']=None, **kwargs: Any) -> None: """Initializes an asset schema depending on the given asset typ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AssetSchema: def __init__(self, identifier_required: bool, disallowed_asset_types: Optional[list[AssetType]]=None, coingecko: Optional['Coingecko']=None, cryptocompare: Optional['Cryptocompare']=None, **kwargs: Any) -> None: """Initializes an asset schema depending on the given asset type. If identifi...
the_stack_v2_python_sparse
rotkehlchen/serialization/schemas.py
LefterisJP/rotkehlchen
train
0
57075916f7e244c45d7b3e3fe373e4ebfa04e094
[ "w = AddText(None)\nyield w\nw.close()", "assert isinstance(widget, QtWidgets.QDialog)\nassert isinstance(widget._font, QtGui.QFont)\nassert widget._color == 'black'", "font_1 = QtGui.QFont('Helvetica', 15)\nmocker.patch.object(QtWidgets.QFontDialog, 'getFont', return_value=(font_1, True))\nwidget.onFontChange(...
<|body_start_0|> w = AddText(None) yield w w.close() <|end_body_0|> <|body_start_1|> assert isinstance(widget, QtWidgets.QDialog) assert isinstance(widget._font, QtGui.QFont) assert widget._color == 'black' <|end_body_1|> <|body_start_2|> font_1 = QtGui.QFont('H...
Test the AddText
AddTextTest
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AddTextTest: """Test the AddText""" def widget(self, qapp): """Create/Destroy the AddText""" <|body_0|> def testDefaults(self, widget): """Test the GUI in its default state""" <|body_1|> def testOnFontChange(self, widget, mocker): """Test the...
stack_v2_sparse_classes_10k_train_008915
1,950
permissive
[ { "docstring": "Create/Destroy the AddText", "name": "widget", "signature": "def widget(self, qapp)" }, { "docstring": "Test the GUI in its default state", "name": "testDefaults", "signature": "def testDefaults(self, widget)" }, { "docstring": "Test the QFontDialog output", "...
4
stack_v2_sparse_classes_30k_train_003700
Implement the Python class `AddTextTest` described below. Class description: Test the AddText Method signatures and docstrings: - def widget(self, qapp): Create/Destroy the AddText - def testDefaults(self, widget): Test the GUI in its default state - def testOnFontChange(self, widget, mocker): Test the QFontDialog ou...
Implement the Python class `AddTextTest` described below. Class description: Test the AddText Method signatures and docstrings: - def widget(self, qapp): Create/Destroy the AddText - def testDefaults(self, widget): Test the GUI in its default state - def testOnFontChange(self, widget, mocker): Test the QFontDialog ou...
55b1e9f6db58e33729f2a93b7dd1d8bf255b46f7
<|skeleton|> class AddTextTest: """Test the AddText""" def widget(self, qapp): """Create/Destroy the AddText""" <|body_0|> def testDefaults(self, widget): """Test the GUI in its default state""" <|body_1|> def testOnFontChange(self, widget, mocker): """Test the...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AddTextTest: """Test the AddText""" def widget(self, qapp): """Create/Destroy the AddText""" w = AddText(None) yield w w.close() def testDefaults(self, widget): """Test the GUI in its default state""" assert isinstance(widget, QtWidgets.QDialog) ...
the_stack_v2_python_sparse
src/sas/qtgui/Plotting/UnitTesting/AddTextTest.py
SasView/sasview
train
48
71e5ec9f0105511cb33dd5bbec9e2789017b92b4
[ "self.id = id\nself.provider_id = provider_id\nself.server_time = server_time\nself.active_from = active_from\nself.active_to = active_to\nself.rpm_over_value = rpm_over_value\nself.over_speed_value = over_speed_value\nself.excess_speed_value = excess_speed_value\nself.long_idle_value = long_idle_value\nself.hi_thr...
<|body_start_0|> self.id = id self.provider_id = provider_id self.server_time = server_time self.active_from = active_from self.active_to = active_to self.rpm_over_value = rpm_over_value self.over_speed_value = over_speed_value self.excess_speed_value = ex...
Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of the TSP server_time (string): Date and time when this object was received at the TSP act...
PerformanceThresholds
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PerformanceThresholds: """Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of the TSP server_time (string): Date and ...
stack_v2_sparse_classes_10k_train_008916
4,395
permissive
[ { "docstring": "Constructor for the PerformanceThresholds class", "name": "__init__", "signature": "def __init__(self, id=None, provider_id=None, server_time=None, active_from=None, active_to=None, rpm_over_value=None, over_speed_value=None, excess_speed_value=None, long_idle_value=None, hi_throttle_val...
2
stack_v2_sparse_classes_30k_train_003984
Implement the Python class `PerformanceThresholds` described below. Class description: Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of ...
Implement the Python class `PerformanceThresholds` described below. Class description: Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of ...
729e9391879e273545a4818558677b2e47261f08
<|skeleton|> class PerformanceThresholds: """Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of the TSP server_time (string): Date and ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PerformanceThresholds: """Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of the TSP server_time (string): Date and time when thi...
the_stack_v2_python_sparse
sdk/python/v0.1-rc.4/opentelematicsapi/models/performance_thresholds.py
nmfta-repo/nmfta-opentelematics-prototype
train
2
35db5a3db506d34cba4fb78ae0fd15ce29c7f519
[ "if self.app.pargs.download is None:\n download_type = []\nelse:\n download_type = self.app.pargs.download.split(',')\n download_type = list(filter(lambda x: x in all_download_type, download_type))\nreturn download_type", "help = None\nfun = getattr(self, func_name, None)\nif fun and getattr(fun, '__ceme...
<|body_start_0|> if self.app.pargs.download is None: download_type = [] else: download_type = self.app.pargs.download.split(',') download_type = list(filter(lambda x: x in all_download_type, download_type)) return download_type <|end_body_0|> <|body_start_1|>...
NXSpiderBaseController
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NXSpiderBaseController: def parse_download(self): """lost of spider function will parse -dw param, this will do it :return:""" <|body_0|> def param_check(self, params, func_name): """this will check param inputted and require is complete or not, and print help help w...
stack_v2_sparse_classes_10k_train_008917
1,707
permissive
[ { "docstring": "lost of spider function will parse -dw param, this will do it :return:", "name": "parse_download", "signature": "def parse_download(self)" }, { "docstring": "this will check param inputted and require is complete or not, and print help help will be in expose(help='...'), and got ...
2
stack_v2_sparse_classes_30k_val_000146
Implement the Python class `NXSpiderBaseController` described below. Class description: Implement the NXSpiderBaseController class. Method signatures and docstrings: - def parse_download(self): lost of spider function will parse -dw param, this will do it :return: - def param_check(self, params, func_name): this will...
Implement the Python class `NXSpiderBaseController` described below. Class description: Implement the NXSpiderBaseController class. Method signatures and docstrings: - def parse_download(self): lost of spider function will parse -dw param, this will do it :return: - def param_check(self, params, func_name): this will...
68e588c0612d0ab2af3a820ff88ca24d698ceeb7
<|skeleton|> class NXSpiderBaseController: def parse_download(self): """lost of spider function will parse -dw param, this will do it :return:""" <|body_0|> def param_check(self, params, func_name): """this will check param inputted and require is complete or not, and print help help w...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class NXSpiderBaseController: def parse_download(self): """lost of spider function will parse -dw param, this will do it :return:""" if self.app.pargs.download is None: download_type = [] else: download_type = self.app.pargs.download.split(',') download_ty...
the_stack_v2_python_sparse
NXSpider/bin/base_ctrl.py
Z-Shuming/NXSpider
train
0
331f9cb2f5f8a1fbd220da40d09faf981bb3c4b1
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn KubernetesClusterEvidence()", "from .alert_evidence import AlertEvidence\nfrom .kubernetes_platform import KubernetesPlatform\nfrom .alert_evidence import AlertEvidence\nfrom .kubernetes_platform import KubernetesPlatform\nfields: Dict...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return KubernetesClusterEvidence() <|end_body_0|> <|body_start_1|> from .alert_evidence import AlertEvidence from .kubernetes_platform import KubernetesPlatform from .alert_evidence imp...
KubernetesClusterEvidence
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KubernetesClusterEvidence: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> KubernetesClusterEvidence: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and c...
stack_v2_sparse_classes_10k_train_008918
3,403
permissive
[ { "docstring": "Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: KubernetesClusterEvidence", "name": "create_from_discriminator_value", "signature": "def create_from_discrim...
3
stack_v2_sparse_classes_30k_train_006652
Implement the Python class `KubernetesClusterEvidence` described below. Class description: Implement the KubernetesClusterEvidence class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> KubernetesClusterEvidence: Creates a new instance of the appropriat...
Implement the Python class `KubernetesClusterEvidence` described below. Class description: Implement the KubernetesClusterEvidence class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> KubernetesClusterEvidence: Creates a new instance of the appropriat...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class KubernetesClusterEvidence: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> KubernetesClusterEvidence: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and c...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class KubernetesClusterEvidence: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> KubernetesClusterEvidence: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the obje...
the_stack_v2_python_sparse
msgraph/generated/models/security/kubernetes_cluster_evidence.py
microsoftgraph/msgraph-sdk-python
train
135
666544a592026b46ada7e2ff54a92c105001fc02
[ "if self.entity.exists:\n return self.entity['Owner'].get_entity()\nelse:\n return None", "if self.entity.exists:\n with self.entity['Owner'].open() as collection:\n collection.clear()\nelse:\n self.entity['Owner'].ClearBindings()" ]
<|body_start_0|> if self.entity.exists: return self.entity['Owner'].get_entity() else: return None <|end_body_0|> <|body_start_1|> if self.entity.exists: with self.entity['Owner'].open() as collection: collection.clear() else: ...
MultiTenantSession
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiTenantSession: def get_owner(self): """Returns the owner of the session The owner is the person logged in to the root of the application. It may be None. This should not be confused with a user associated with the session via an LTI launch. If there is no owner, None is returned."""...
stack_v2_sparse_classes_10k_train_008919
18,986
permissive
[ { "docstring": "Returns the owner of the session The owner is the person logged in to the root of the application. It may be None. This should not be confused with a user associated with the session via an LTI launch. If there is no owner, None is returned.", "name": "get_owner", "signature": "def get_o...
2
stack_v2_sparse_classes_30k_train_006112
Implement the Python class `MultiTenantSession` described below. Class description: Implement the MultiTenantSession class. Method signatures and docstrings: - def get_owner(self): Returns the owner of the session The owner is the person logged in to the root of the application. It may be None. This should not be con...
Implement the Python class `MultiTenantSession` described below. Class description: Implement the MultiTenantSession class. Method signatures and docstrings: - def get_owner(self): Returns the owner of the session The owner is the person logged in to the root of the application. It may be None. This should not be con...
ef27dd6bb6fbd6d47687a349508cd4ab2989a0ad
<|skeleton|> class MultiTenantSession: def get_owner(self): """Returns the owner of the session The owner is the person logged in to the root of the application. It may be None. This should not be confused with a user associated with the session via an LTI launch. If there is no owner, None is returned."""...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MultiTenantSession: def get_owner(self): """Returns the owner of the session The owner is the person logged in to the root of the application. It may be None. This should not be confused with a user associated with the session via an LTI launch. If there is no owner, None is returned.""" if se...
the_stack_v2_python_sparse
samples/noticeboard/mtnoticeboard.py
j5int/pyslet
train
2
bed8b673f07f36960439a0bb7e016e92bff5deb6
[ "tortoise = hare = head\nwhile hare and hare.next:\n tortoise = tortoise.next\n hare = hare.next.next\n if tortoise == hare:\n return hare\nreturn None", "if not head:\n return head\nmeeting_point = self.get_intersection(head)\nif not meeting_point:\n return None\npointer_1 = head\npointer_2...
<|body_start_0|> tortoise = hare = head while hare and hare.next: tortoise = tortoise.next hare = hare.next.next if tortoise == hare: return hare return None <|end_body_0|> <|body_start_1|> if not head: return head ...
ListCycle
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ListCycle: def get_intersection(self, head: 'ListNode'): """Gets the intersection point of slow and fast. or hare and tortoise. :param head: :return:""" <|body_0|> def get_node(self, head: 'ListNode') -> 'ListNode': """Approach: Floyd's tortoise and hare Time Complex...
stack_v2_sparse_classes_10k_train_008920
1,598
no_license
[ { "docstring": "Gets the intersection point of slow and fast. or hare and tortoise. :param head: :return:", "name": "get_intersection", "signature": "def get_intersection(self, head: 'ListNode')" }, { "docstring": "Approach: Floyd's tortoise and hare Time Complexity: O(N) Space Complexity: O(1) ...
3
null
Implement the Python class `ListCycle` described below. Class description: Implement the ListCycle class. Method signatures and docstrings: - def get_intersection(self, head: 'ListNode'): Gets the intersection point of slow and fast. or hare and tortoise. :param head: :return: - def get_node(self, head: 'ListNode') -...
Implement the Python class `ListCycle` described below. Class description: Implement the ListCycle class. Method signatures and docstrings: - def get_intersection(self, head: 'ListNode'): Gets the intersection point of slow and fast. or hare and tortoise. :param head: :return: - def get_node(self, head: 'ListNode') -...
65cc78b5afa0db064f9fe8f06597e3e120f7363d
<|skeleton|> class ListCycle: def get_intersection(self, head: 'ListNode'): """Gets the intersection point of slow and fast. or hare and tortoise. :param head: :return:""" <|body_0|> def get_node(self, head: 'ListNode') -> 'ListNode': """Approach: Floyd's tortoise and hare Time Complex...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ListCycle: def get_intersection(self, head: 'ListNode'): """Gets the intersection point of slow and fast. or hare and tortoise. :param head: :return:""" tortoise = hare = head while hare and hare.next: tortoise = tortoise.next hare = hare.next.next i...
the_stack_v2_python_sparse
revisited/linked_list/list_cycle_ii.py
Shiv2157k/leet_code
train
1
d05983623662d8d6065188dda19c26ec61ad0cd0
[ "keyboard = ['qwertyuiopQWERTYUIOP', 'asdfghjklASDFGHJKL', 'zxcvbnmZXCVBNM']\nres = []\nfor word in words:\n pos = []\n for w in word:\n for index, key in enumerate(keyboard):\n if w in key:\n pos.append(index)\n break\n if len(set(pos)) == 1:\n res.ap...
<|body_start_0|> keyboard = ['qwertyuiopQWERTYUIOP', 'asdfghjklASDFGHJKL', 'zxcvbnmZXCVBNM'] res = [] for word in words: pos = [] for w in word: for index, key in enumerate(keyboard): if w in key: pos.append(inde...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findWords(self, words): """:type words: List[str] :rtype: List[str]""" <|body_0|> def _findWords(self, words): """:type words: List[str] :rtype: List[str]""" <|body_1|> <|end_skeleton|> <|body_start_0|> keyboard = ['qwertyuiopQWERTYUIO...
stack_v2_sparse_classes_10k_train_008921
1,800
permissive
[ { "docstring": ":type words: List[str] :rtype: List[str]", "name": "findWords", "signature": "def findWords(self, words)" }, { "docstring": ":type words: List[str] :rtype: List[str]", "name": "_findWords", "signature": "def _findWords(self, words)" } ]
2
stack_v2_sparse_classes_30k_train_006502
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findWords(self, words): :type words: List[str] :rtype: List[str] - def _findWords(self, words): :type words: List[str] :rtype: List[str]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findWords(self, words): :type words: List[str] :rtype: List[str] - def _findWords(self, words): :type words: List[str] :rtype: List[str] <|skeleton|> class Solution: de...
0dd67edca4e0b0323cb5a7239f02ea46383cd15a
<|skeleton|> class Solution: def findWords(self, words): """:type words: List[str] :rtype: List[str]""" <|body_0|> def _findWords(self, words): """:type words: List[str] :rtype: List[str]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def findWords(self, words): """:type words: List[str] :rtype: List[str]""" keyboard = ['qwertyuiopQWERTYUIOP', 'asdfghjklASDFGHJKL', 'zxcvbnmZXCVBNM'] res = [] for word in words: pos = [] for w in word: for index, key in enumera...
the_stack_v2_python_sparse
500.keyboard-row.py
windard/leeeeee
train
0
b0057acdc0e2755c710d7497fef4414b7a2a71dd
[ "self.svc_name = svc_name\nself.set_name = set_name\nself.min = int(min)\nself.max = int(max)\nself.isContinuous = True\nself.vals = None", "self.isContinuous = False\nself.vals = [int(val) for val in vals]\nself.min = min(self.vals)\nself.max = max(self.vals)" ]
<|body_start_0|> self.svc_name = svc_name self.set_name = set_name self.min = int(min) self.max = int(max) self.isContinuous = True self.vals = None <|end_body_0|> <|body_start_1|> self.isContinuous = False self.vals = [int(val) for val in vals] s...
a knob setting with max and min settings. It's the smallest unit for RAPID-C
Knob
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Knob: """a knob setting with max and min settings. It's the smallest unit for RAPID-C""" def __init__(self, svc_name, set_name, min, max): """Initialization :param svc_name: name of service :param set_name: name of setting :param min: lower bound :param max: upper bound""" <|...
stack_v2_sparse_classes_10k_train_008922
5,554
no_license
[ { "docstring": "Initialization :param svc_name: name of service :param set_name: name of setting :param min: lower bound :param max: upper bound", "name": "__init__", "signature": "def __init__(self, svc_name, set_name, min, max)" }, { "docstring": "Trasform to a knob with vals (discrete)", ...
2
stack_v2_sparse_classes_30k_train_004379
Implement the Python class `Knob` described below. Class description: a knob setting with max and min settings. It's the smallest unit for RAPID-C Method signatures and docstrings: - def __init__(self, svc_name, set_name, min, max): Initialization :param svc_name: name of service :param set_name: name of setting :par...
Implement the Python class `Knob` described below. Class description: a knob setting with max and min settings. It's the smallest unit for RAPID-C Method signatures and docstrings: - def __init__(self, svc_name, set_name, min, max): Initialization :param svc_name: name of service :param set_name: name of setting :par...
63b50cc32c6f647ea34b5512f48688149f949a3c
<|skeleton|> class Knob: """a knob setting with max and min settings. It's the smallest unit for RAPID-C""" def __init__(self, svc_name, set_name, min, max): """Initialization :param svc_name: name of service :param set_name: name of setting :param min: lower bound :param max: upper bound""" <|...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Knob: """a knob setting with max and min settings. It's the smallest unit for RAPID-C""" def __init__(self, svc_name, set_name, min, max): """Initialization :param svc_name: name of service :param set_name: name of setting :param min: lower bound :param max: upper bound""" self.svc_name =...
the_stack_v2_python_sparse
modelConstr/Rapids/Rapids_Classes/KDG.py
niuye8911/rapidlib-linux
train
0
5a79ae9a7a59f3365740a0fdf8a389177daa53cb
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn AppleManagedIdentityProvider()", "from .identity_provider_base import IdentityProviderBase\nfrom .identity_provider_base import IdentityProviderBase\nfields: Dict[str, Callable[[Any], None]] = {'certificateData': lambda n: setattr(self...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return AppleManagedIdentityProvider() <|end_body_0|> <|body_start_1|> from .identity_provider_base import IdentityProviderBase from .identity_provider_base import IdentityProviderBase f...
AppleManagedIdentityProvider
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AppleManagedIdentityProvider: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AppleManagedIdentityProvider: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value...
stack_v2_sparse_classes_10k_train_008923
2,952
permissive
[ { "docstring": "Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: AppleManagedIdentityProvider", "name": "create_from_discriminator_value", "signature": "def create_from_disc...
3
stack_v2_sparse_classes_30k_train_005807
Implement the Python class `AppleManagedIdentityProvider` described below. Class description: Implement the AppleManagedIdentityProvider class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AppleManagedIdentityProvider: Creates a new instance of the a...
Implement the Python class `AppleManagedIdentityProvider` described below. Class description: Implement the AppleManagedIdentityProvider class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AppleManagedIdentityProvider: Creates a new instance of the a...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class AppleManagedIdentityProvider: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AppleManagedIdentityProvider: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AppleManagedIdentityProvider: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AppleManagedIdentityProvider: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create th...
the_stack_v2_python_sparse
msgraph/generated/models/apple_managed_identity_provider.py
microsoftgraph/msgraph-sdk-python
train
135
06ca5f88badc833510d948f797ba3ffa9d1729b7
[ "def write(root):\n if not root:\n return\n res.append(str(root.val))\n for child in root.children:\n write(child)\n res.append('#')\nres = []\nwrite(root)\nreturn ' '.join(res)", "if not data:\n return None\ndata = collections.deque(data.split(' '))\nroot = Node(int(data.popleft()), ...
<|body_start_0|> def write(root): if not root: return res.append(str(root.val)) for child in root.children: write(child) res.append('#') res = [] write(root) return ' '.join(res) <|end_body_0|> <|body_start_...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: Node :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: Node""" <|body_1|> <|end_skeleton|> <|body_start_0|...
stack_v2_sparse_classes_10k_train_008924
1,306
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: Node :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: Node", "name": "deserialize", "signature": "def deserialize(self, ...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: Node :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype: Nod...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: Node :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype: Nod...
431b763bf3019bac7c08619d7ffef37e638940e8
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: Node :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: Node""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: Node :rtype: str""" def write(root): if not root: return res.append(str(root.val)) for child in root.children: write(child) res.ap...
the_stack_v2_python_sparse
notes/0428/0428.py
PaulGuo5/Leetcode-notes
train
1
5ea39dda1400833d7ab14640a7ec1cc996ba5494
[ "self.app_server_id = app_server_id\nself.backup_supported = backup_supported\nself.backup_unsupported_reasons = backup_unsupported_reasons\nself.created_time_msecs = created_time_msecs\nself.database_state = database_state\nself.db_size_bytes = db_size_bytes\nself.dbguid = dbguid\nself.name = name\nself.owner_id =...
<|body_start_0|> self.app_server_id = app_server_id self.backup_supported = backup_supported self.backup_unsupported_reasons = backup_unsupported_reasons self.created_time_msecs = created_time_msecs self.database_state = database_state self.db_size_bytes = db_size_bytes ...
Implementation of the 'ExchangeDatabaseInfo' model. Specifies the information about the Exchange Database. Attributes: app_server_id (long|int): Specifies the entity id of the Exchange Application Server which has this database copy. backup_supported (bool): Specifies if backup is supported for the Exchange database co...
ExchangeDatabaseInfo
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ExchangeDatabaseInfo: """Implementation of the 'ExchangeDatabaseInfo' model. Specifies the information about the Exchange Database. Attributes: app_server_id (long|int): Specifies the entity id of the Exchange Application Server which has this database copy. backup_supported (bool): Specifies if ...
stack_v2_sparse_classes_10k_train_008925
4,567
permissive
[ { "docstring": "Constructor for the ExchangeDatabaseInfo class", "name": "__init__", "signature": "def __init__(self, app_server_id=None, backup_supported=None, backup_unsupported_reasons=None, created_time_msecs=None, database_state=None, db_size_bytes=None, dbguid=None, name=None, owner_id=None, utc_o...
2
null
Implement the Python class `ExchangeDatabaseInfo` described below. Class description: Implementation of the 'ExchangeDatabaseInfo' model. Specifies the information about the Exchange Database. Attributes: app_server_id (long|int): Specifies the entity id of the Exchange Application Server which has this database copy....
Implement the Python class `ExchangeDatabaseInfo` described below. Class description: Implementation of the 'ExchangeDatabaseInfo' model. Specifies the information about the Exchange Database. Attributes: app_server_id (long|int): Specifies the entity id of the Exchange Application Server which has this database copy....
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class ExchangeDatabaseInfo: """Implementation of the 'ExchangeDatabaseInfo' model. Specifies the information about the Exchange Database. Attributes: app_server_id (long|int): Specifies the entity id of the Exchange Application Server which has this database copy. backup_supported (bool): Specifies if ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ExchangeDatabaseInfo: """Implementation of the 'ExchangeDatabaseInfo' model. Specifies the information about the Exchange Database. Attributes: app_server_id (long|int): Specifies the entity id of the Exchange Application Server which has this database copy. backup_supported (bool): Specifies if backup is sup...
the_stack_v2_python_sparse
cohesity_management_sdk/models/exchange_database_info.py
cohesity/management-sdk-python
train
24
61b8186209dbcb0c14734399d2c312c571c12a9e
[ "try:\n client.containers.get(name_or_id).remove(force=force)\nexcept docker.errors.NotFound as not_found:\n if not ignore_container_not_found:\n raise not_found", "try:\n client.images.remove(name_or_id, force=force)\nexcept docker.errors.ImageNotFound as not_found:\n if not ignore_image_not_f...
<|body_start_0|> try: client.containers.get(name_or_id).remove(force=force) except docker.errors.NotFound as not_found: if not ignore_container_not_found: raise not_found <|end_body_0|> <|body_start_1|> try: client.images.remove(name_or_id, fo...
docker extra tools that will be usefully also as stand alone commands
DockerTools
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DockerTools: """docker extra tools that will be usefully also as stand alone commands""" def remove_container(name_or_id: str, ignore_container_not_found: bool=True, force: bool=False): """Examples docker rm MyTestContainer can be replaced with DockerTools.remove_container("MyTestCon...
stack_v2_sparse_classes_10k_train_008926
6,497
permissive
[ { "docstring": "Examples docker rm MyTestContainer can be replaced with DockerTools.remove_container(\"MyTestContainer\") in your code Args: name_or_id: the name or id of the container ignore_container_not_found: don't raise an exception in case the container already removed force: same as the -f option in the ...
2
stack_v2_sparse_classes_30k_train_003144
Implement the Python class `DockerTools` described below. Class description: docker extra tools that will be usefully also as stand alone commands Method signatures and docstrings: - def remove_container(name_or_id: str, ignore_container_not_found: bool=True, force: bool=False): Examples docker rm MyTestContainer can...
Implement the Python class `DockerTools` described below. Class description: docker extra tools that will be usefully also as stand alone commands Method signatures and docstrings: - def remove_container(name_or_id: str, ignore_container_not_found: bool=True, force: bool=False): Examples docker rm MyTestContainer can...
59d99cf4b5016be8a4a333c2541418e1612549e1
<|skeleton|> class DockerTools: """docker extra tools that will be usefully also as stand alone commands""" def remove_container(name_or_id: str, ignore_container_not_found: bool=True, force: bool=False): """Examples docker rm MyTestContainer can be replaced with DockerTools.remove_container("MyTestCon...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class DockerTools: """docker extra tools that will be usefully also as stand alone commands""" def remove_container(name_or_id: str, ignore_container_not_found: bool=True, force: bool=False): """Examples docker rm MyTestContainer can be replaced with DockerTools.remove_container("MyTestContainer") in y...
the_stack_v2_python_sparse
demisto_sdk/commands/common/docker_util.py
kfirstri/demisto-sdk
train
1
d5efa6ff0d0bc190951eab8e986435d63f523567
[ "super(ErrorCalculator, self).__init__()\nself.report_cer = report_cer\nself.report_wer = report_wer\nself.char_list = char_list\nself.space = sym_space\nself.blank = sym_blank\nif self.blank in self.char_list:\n self.idx_blank = self.char_list.index(self.blank)\nelse:\n self.idx_blank = None\nif self.space i...
<|body_start_0|> super(ErrorCalculator, self).__init__() self.report_cer = report_cer self.report_wer = report_wer self.char_list = char_list self.space = sym_space self.blank = sym_blank if self.blank in self.char_list: self.idx_blank = self.char_list...
Calculate CER and WER for E2E_ASR and CTC models during training. :param y_hats: numpy array with predicted text :param y_pads: numpy array with true (target) text :param char_list: :param sym_space: :param sym_blank: :return:
ErrorCalculator
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ErrorCalculator: """Calculate CER and WER for E2E_ASR and CTC models during training. :param y_hats: numpy array with predicted text :param y_pads: numpy array with true (target) text :param char_list: :param sym_space: :param sym_blank: :return:""" def __init__(self, char_list, sym_space, s...
stack_v2_sparse_classes_10k_train_008927
8,773
permissive
[ { "docstring": "Construct an ErrorCalculator object.", "name": "__init__", "signature": "def __init__(self, char_list, sym_space, sym_blank, report_cer=False, report_wer=False)" }, { "docstring": "Calculate sentence-level WER/CER score. :param torch.Tensor ys_hat: prediction (batch, seqlen) :par...
6
null
Implement the Python class `ErrorCalculator` described below. Class description: Calculate CER and WER for E2E_ASR and CTC models during training. :param y_hats: numpy array with predicted text :param y_pads: numpy array with true (target) text :param char_list: :param sym_space: :param sym_blank: :return: Method sig...
Implement the Python class `ErrorCalculator` described below. Class description: Calculate CER and WER for E2E_ASR and CTC models during training. :param y_hats: numpy array with predicted text :param y_pads: numpy array with true (target) text :param char_list: :param sym_space: :param sym_blank: :return: Method sig...
bcd20948db7846ee523443ef9fd78c7a1248c95e
<|skeleton|> class ErrorCalculator: """Calculate CER and WER for E2E_ASR and CTC models during training. :param y_hats: numpy array with predicted text :param y_pads: numpy array with true (target) text :param char_list: :param sym_space: :param sym_blank: :return:""" def __init__(self, char_list, sym_space, s...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ErrorCalculator: """Calculate CER and WER for E2E_ASR and CTC models during training. :param y_hats: numpy array with predicted text :param y_pads: numpy array with true (target) text :param char_list: :param sym_space: :param sym_blank: :return:""" def __init__(self, char_list, sym_space, sym_blank, rep...
the_stack_v2_python_sparse
espnet/nets/e2e_asr_common.py
espnet/espnet
train
7,242
9253f01e88adce33444245fcf2b4fbd744be6a7d
[ "errors = []\nif not file_path or file_path.isspace():\n errors.append(VerifierError(subject=self, local_error='Gromacs file name is white space.', global_error='Gromacs file not specified.'))\nif ext is not None:\n if not file_path.endswith('.{}'.format(ext)):\n errors.append(VerifierError(subject=sel...
<|body_start_0|> errors = [] if not file_path or file_path.isspace(): errors.append(VerifierError(subject=self, local_error='Gromacs file name is white space.', global_error='Gromacs file not specified.')) if ext is not None: if not file_path.endswith('.{}'.format(ext)): ...
Class containing all input parameters for a single molecular fragment in a Gromacs simulation
FragmentDataSourceModel
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FragmentDataSourceModel: """Class containing all input parameters for a single molecular fragment in a Gromacs simulation""" def _file_check(self, file_path, ext=None): """Performs a series of checks on selected Gromacs file located at file_path Parameters ---------- file_path: str F...
stack_v2_sparse_classes_10k_train_008928
2,768
permissive
[ { "docstring": "Performs a series of checks on selected Gromacs file located at file_path Parameters ---------- file_path: str File path for Gromacs input file ext: str, optional Expected extension of Gromacs input file", "name": "_file_check", "signature": "def _file_check(self, file_path, ext=None)" ...
2
stack_v2_sparse_classes_30k_train_002439
Implement the Python class `FragmentDataSourceModel` described below. Class description: Class containing all input parameters for a single molecular fragment in a Gromacs simulation Method signatures and docstrings: - def _file_check(self, file_path, ext=None): Performs a series of checks on selected Gromacs file lo...
Implement the Python class `FragmentDataSourceModel` described below. Class description: Class containing all input parameters for a single molecular fragment in a Gromacs simulation Method signatures and docstrings: - def _file_check(self, file_path, ext=None): Performs a series of checks on selected Gromacs file lo...
1518185e4cdab824d57570bc5df6c719f1f11bea
<|skeleton|> class FragmentDataSourceModel: """Class containing all input parameters for a single molecular fragment in a Gromacs simulation""" def _file_check(self, file_path, ext=None): """Performs a series of checks on selected Gromacs file located at file_path Parameters ---------- file_path: str F...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class FragmentDataSourceModel: """Class containing all input parameters for a single molecular fragment in a Gromacs simulation""" def _file_check(self, file_path, ext=None): """Performs a series of checks on selected Gromacs file located at file_path Parameters ---------- file_path: str File path for ...
the_stack_v2_python_sparse
force_gromacs/data_sources/fragment/fragment_model.py
force-h2020/force-bdss-plugin-gromacs
train
0
d9c2eb175d70fb3920a078fc581b3fa19f51beac
[ "self.copy_task_uid = copy_task_uid\nself.job_run_id = job_run_id\nself.task_id_list = task_id_list", "if dictionary is None:\n return None\ncopy_task_uid = cohesity_management_sdk.models.universal_id.UniversalId.from_dictionary(dictionary.get('copyTaskUid')) if dictionary.get('copyTaskUid') else None\njob_run...
<|body_start_0|> self.copy_task_uid = copy_task_uid self.job_run_id = job_run_id self.task_id_list = task_id_list <|end_body_0|> <|body_start_1|> if dictionary is None: return None copy_task_uid = cohesity_management_sdk.models.universal_id.UniversalId.from_dictionar...
Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field should be set to the id of that particular copy task. For example, if replication task is to be...
CancelProtectionJobRunParam
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CancelProtectionJobRunParam: """Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field should be set to the id of that particul...
stack_v2_sparse_classes_10k_train_008929
2,888
permissive
[ { "docstring": "Constructor for the CancelProtectionJobRunParam class", "name": "__init__", "signature": "def __init__(self, copy_task_uid=None, job_run_id=None, task_id_list=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary...
2
null
Implement the Python class `CancelProtectionJobRunParam` described below. Class description: Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field s...
Implement the Python class `CancelProtectionJobRunParam` described below. Class description: Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field s...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class CancelProtectionJobRunParam: """Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field should be set to the id of that particul...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class CancelProtectionJobRunParam: """Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field should be set to the id of that particular copy task....
the_stack_v2_python_sparse
cohesity_management_sdk/models/cancel_protection_job_run_param.py
cohesity/management-sdk-python
train
24
2d86d4782d610f3d325c06000d3846a6b9879646
[ "try:\n try:\n pObject = PTJInfo.objects.get(id=pid)\n except:\n return JsonResponse({'status': False, 'err': '内容不存在'}, status=404)\n ptjResult = model_to_dict(pObject)\n return JsonResponse({'status': True, 'ptj': ptjResult})\nexcept:\n return JsonResponse({'status': False, 'err': '出现未...
<|body_start_0|> try: try: pObject = PTJInfo.objects.get(id=pid) except: return JsonResponse({'status': False, 'err': '内容不存在'}, status=404) ptjResult = model_to_dict(pObject) return JsonResponse({'status': True, 'ptj': ptjResult}) ...
PTJInfoView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PTJInfoView: def get(self, requests, pid): """获得兼职消息详情 :param requests: :param pid: ptj id :return:""" <|body_0|> def delete(self, requests, pid): """删除兼职消息 :param requests: :param pid: :return:""" <|body_1|> def post(self, requests): """新增兼职信息 :...
stack_v2_sparse_classes_10k_train_008930
2,987
no_license
[ { "docstring": "获得兼职消息详情 :param requests: :param pid: ptj id :return:", "name": "get", "signature": "def get(self, requests, pid)" }, { "docstring": "删除兼职消息 :param requests: :param pid: :return:", "name": "delete", "signature": "def delete(self, requests, pid)" }, { "docstring": ...
3
stack_v2_sparse_classes_30k_train_001578
Implement the Python class `PTJInfoView` described below. Class description: Implement the PTJInfoView class. Method signatures and docstrings: - def get(self, requests, pid): 获得兼职消息详情 :param requests: :param pid: ptj id :return: - def delete(self, requests, pid): 删除兼职消息 :param requests: :param pid: :return: - def po...
Implement the Python class `PTJInfoView` described below. Class description: Implement the PTJInfoView class. Method signatures and docstrings: - def get(self, requests, pid): 获得兼职消息详情 :param requests: :param pid: ptj id :return: - def delete(self, requests, pid): 删除兼职消息 :param requests: :param pid: :return: - def po...
526dea540048fc92260bce611c520c50af744e0b
<|skeleton|> class PTJInfoView: def get(self, requests, pid): """获得兼职消息详情 :param requests: :param pid: ptj id :return:""" <|body_0|> def delete(self, requests, pid): """删除兼职消息 :param requests: :param pid: :return:""" <|body_1|> def post(self, requests): """新增兼职信息 :...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PTJInfoView: def get(self, requests, pid): """获得兼职消息详情 :param requests: :param pid: ptj id :return:""" try: try: pObject = PTJInfo.objects.get(id=pid) except: return JsonResponse({'status': False, 'err': '内容不存在'}, status=404) ...
the_stack_v2_python_sparse
apps/PTJ/views/PTJInfo.py
DICKQI/ALGYunXS
train
0
d009b74557a1af19f1ed38b28804c4b3d0fe5231
[ "if root is None:\n return [0]\nsums = []\ncounts = []\n\ndef dfs(node, level):\n if len(sums) == level:\n sums.append(0)\n counts.append(0)\n sums[level] += node.val\n counts[level] += 1\n if node.left:\n dfs(node.left, level + 1)\n if node.right:\n dfs(node.right, lev...
<|body_start_0|> if root is None: return [0] sums = [] counts = [] def dfs(node, level): if len(sums) == level: sums.append(0) counts.append(0) sums[level] += node.val counts[level] += 1 if node....
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def averageOfLevels(self, root) -> List[float]: """DFS, Time: O(n), Space: O(n)""" <|body_0|> def averageOfLevels(self, root) -> List[float]: """BFS, Time: O(n), Space: O(n)""" <|body_1|> <|end_skeleton|> <|body_start_0|> if root is None: ...
stack_v2_sparse_classes_10k_train_008931
1,288
no_license
[ { "docstring": "DFS, Time: O(n), Space: O(n)", "name": "averageOfLevels", "signature": "def averageOfLevels(self, root) -> List[float]" }, { "docstring": "BFS, Time: O(n), Space: O(n)", "name": "averageOfLevels", "signature": "def averageOfLevels(self, root) -> List[float]" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def averageOfLevels(self, root) -> List[float]: DFS, Time: O(n), Space: O(n) - def averageOfLevels(self, root) -> List[float]: BFS, Time: O(n), Space: O(n)
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def averageOfLevels(self, root) -> List[float]: DFS, Time: O(n), Space: O(n) - def averageOfLevels(self, root) -> List[float]: BFS, Time: O(n), Space: O(n) <|skeleton|> class So...
72136e3487d239f5b37e2d6393e034262a6bf599
<|skeleton|> class Solution: def averageOfLevels(self, root) -> List[float]: """DFS, Time: O(n), Space: O(n)""" <|body_0|> def averageOfLevels(self, root) -> List[float]: """BFS, Time: O(n), Space: O(n)""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def averageOfLevels(self, root) -> List[float]: """DFS, Time: O(n), Space: O(n)""" if root is None: return [0] sums = [] counts = [] def dfs(node, level): if len(sums) == level: sums.append(0) counts.app...
the_stack_v2_python_sparse
python/637-Average of Levels in Binary Tree.py
cwza/leetcode
train
0
624a0723b90324fdc737f34bb8ec9d0fe32a5e20
[ "v = utils.splitpath_root_file_ext('F:\\\\foo\\\\bar.py')\nself.assertEqual(v, ('F:\\\\foo', 'bar', '.py'))\nv = utils.splitpath_root_file_ext('J:\\\\spam.py')\nself.assertEqual(v, ('J:\\\\', 'spam', '.py'))", "v = utils.splitpath_root_file_ext('C:\\\\foo\\\\bar')\nself.assertEqual(v, ('C:\\\\foo', 'bar', ''))\nv...
<|body_start_0|> v = utils.splitpath_root_file_ext('F:\\foo\\bar.py') self.assertEqual(v, ('F:\\foo', 'bar', '.py')) v = utils.splitpath_root_file_ext('J:\\spam.py') self.assertEqual(v, ('J:\\', 'spam', '.py')) <|end_body_0|> <|body_start_1|> v = utils.splitpath_root_file_ext('C...
TestSplitRootFileExt
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestSplitRootFileExt: def testRegularPath(self): """Test the method's behavior on regular paths.""" <|body_0|> def testDirOnly(self): """Test behavior when passed a path only.""" <|body_1|> def testFileOnly(self): """Test behavior when passed a f...
stack_v2_sparse_classes_10k_train_008932
2,610
permissive
[ { "docstring": "Test the method's behavior on regular paths.", "name": "testRegularPath", "signature": "def testRegularPath(self)" }, { "docstring": "Test behavior when passed a path only.", "name": "testDirOnly", "signature": "def testDirOnly(self)" }, { "docstring": "Test behav...
3
stack_v2_sparse_classes_30k_train_002937
Implement the Python class `TestSplitRootFileExt` described below. Class description: Implement the TestSplitRootFileExt class. Method signatures and docstrings: - def testRegularPath(self): Test the method's behavior on regular paths. - def testDirOnly(self): Test behavior when passed a path only. - def testFileOnly...
Implement the Python class `TestSplitRootFileExt` described below. Class description: Implement the TestSplitRootFileExt class. Method signatures and docstrings: - def testRegularPath(self): Test the method's behavior on regular paths. - def testDirOnly(self): Test behavior when passed a path only. - def testFileOnly...
679397c86992fe434e3aabff7edf4f6867424bc9
<|skeleton|> class TestSplitRootFileExt: def testRegularPath(self): """Test the method's behavior on regular paths.""" <|body_0|> def testDirOnly(self): """Test behavior when passed a path only.""" <|body_1|> def testFileOnly(self): """Test behavior when passed a f...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TestSplitRootFileExt: def testRegularPath(self): """Test the method's behavior on regular paths.""" v = utils.splitpath_root_file_ext('F:\\foo\\bar.py') self.assertEqual(v, ('F:\\foo', 'bar', '.py')) v = utils.splitpath_root_file_ext('J:\\spam.py') self.assertEqual(v, (...
the_stack_v2_python_sparse
pynocle-0.3.2/build/lib.linux-x86_64-2.7/pynocle/test_utils.py
1147279/SoftwareProject
train
0
c863db94ef5227e48b68e93afe0b1ce404c392a8
[ "super().__init__(data, device)\nself.entity_description = description\nself._attr_unique_id = f'{device.device_uuid}-{description.key}'\nif description.key == CONST.TEMP_STATUS_KEY:\n self._attr_native_unit_of_measurement = device.temp_unit\nelif description.key == CONST.HUMI_STATUS_KEY:\n self._attr_native_...
<|body_start_0|> super().__init__(data, device) self.entity_description = description self._attr_unique_id = f'{device.device_uuid}-{description.key}' if description.key == CONST.TEMP_STATUS_KEY: self._attr_native_unit_of_measurement = device.temp_unit elif descriptio...
A sensor implementation for Abode devices.
AbodeSensor
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AbodeSensor: """A sensor implementation for Abode devices.""" def __init__(self, data: AbodeSystem, device: AbodeSense, description: SensorEntityDescription) -> None: """Initialize a sensor for an Abode device.""" <|body_0|> def native_value(self) -> float | None: ...
stack_v2_sparse_classes_10k_train_008933
2,873
permissive
[ { "docstring": "Initialize a sensor for an Abode device.", "name": "__init__", "signature": "def __init__(self, data: AbodeSystem, device: AbodeSense, description: SensorEntityDescription) -> None" }, { "docstring": "Return the state of the sensor.", "name": "native_value", "signature": ...
2
stack_v2_sparse_classes_30k_train_007054
Implement the Python class `AbodeSensor` described below. Class description: A sensor implementation for Abode devices. Method signatures and docstrings: - def __init__(self, data: AbodeSystem, device: AbodeSense, description: SensorEntityDescription) -> None: Initialize a sensor for an Abode device. - def native_val...
Implement the Python class `AbodeSensor` described below. Class description: A sensor implementation for Abode devices. Method signatures and docstrings: - def __init__(self, data: AbodeSystem, device: AbodeSense, description: SensorEntityDescription) -> None: Initialize a sensor for an Abode device. - def native_val...
2e65b77b2b5c17919939481f327963abdfdc53f0
<|skeleton|> class AbodeSensor: """A sensor implementation for Abode devices.""" def __init__(self, data: AbodeSystem, device: AbodeSense, description: SensorEntityDescription) -> None: """Initialize a sensor for an Abode device.""" <|body_0|> def native_value(self) -> float | None: ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AbodeSensor: """A sensor implementation for Abode devices.""" def __init__(self, data: AbodeSystem, device: AbodeSense, description: SensorEntityDescription) -> None: """Initialize a sensor for an Abode device.""" super().__init__(data, device) self.entity_description = descriptio...
the_stack_v2_python_sparse
homeassistant/components/abode/sensor.py
konnected-io/home-assistant
train
24
353968c3a6343a5c194548a6c34c8e34bf14885a
[ "super(Psi, self).__init__()\nself.in_emb_dims = in_emb_dims\nself.upsamp = nn.UpsamplingBilinear2d(scale_factor=(2, 2))\nself.upsamp_time = nn.UpsamplingBilinear2d(size=(T, 1))\nout_c = min(in_emb_dims)\nself.c1 = nn.Conv2d(in_emb_dims[0], out_c, kernel_size=3, padding='same')\nself.c2 = nn.Conv2d(in_emb_dims[1], ...
<|body_start_0|> super(Psi, self).__init__() self.in_emb_dims = in_emb_dims self.upsamp = nn.UpsamplingBilinear2d(scale_factor=(2, 2)) self.upsamp_time = nn.UpsamplingBilinear2d(size=(T, 1)) out_c = min(in_emb_dims) self.c1 = nn.Conv2d(in_emb_dims[0], out_c, kernel_size=3...
Convolutional Layers to estimate NMF Activations from Classifier Representations Arguments --------- n_comp : int Number of NMF components (or equivalently number of neurons at the output per timestep) T: int The targeted length along the time dimension in_emb_dims: List with int elements A list with length 3 that cont...
Psi
[ "Apache-2.0", "BSD-2-Clause", "MIT", "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-unknown-license-reference", "GPL-1.0-or-later", "LicenseRef-scancode-other-permissive" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Psi: """Convolutional Layers to estimate NMF Activations from Classifier Representations Arguments --------- n_comp : int Number of NMF components (or equivalently number of neurons at the output per timestep) T: int The targeted length along the time dimension in_emb_dims: List with int elements...
stack_v2_sparse_classes_10k_train_008934
11,147
permissive
[ { "docstring": "Computes NMF activations given classifier hidden representations", "name": "__init__", "signature": "def __init__(self, n_comp=100, T=431, in_emb_dims=[2048, 1024, 512])" }, { "docstring": "This forward function returns the NMF time activations given classifier activations Argume...
2
null
Implement the Python class `Psi` described below. Class description: Convolutional Layers to estimate NMF Activations from Classifier Representations Arguments --------- n_comp : int Number of NMF components (or equivalently number of neurons at the output per timestep) T: int The targeted length along the time dimens...
Implement the Python class `Psi` described below. Class description: Convolutional Layers to estimate NMF Activations from Classifier Representations Arguments --------- n_comp : int Number of NMF components (or equivalently number of neurons at the output per timestep) T: int The targeted length along the time dimens...
92acc188d3a0f634de58463b6676e70df83ef808
<|skeleton|> class Psi: """Convolutional Layers to estimate NMF Activations from Classifier Representations Arguments --------- n_comp : int Number of NMF components (or equivalently number of neurons at the output per timestep) T: int The targeted length along the time dimension in_emb_dims: List with int elements...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Psi: """Convolutional Layers to estimate NMF Activations from Classifier Representations Arguments --------- n_comp : int Number of NMF components (or equivalently number of neurons at the output per timestep) T: int The targeted length along the time dimension in_emb_dims: List with int elements A list with ...
the_stack_v2_python_sparse
PyTorch/dev/perf/speechbrain-tdnn/speechbrain/lobes/models/L2I.py
Ascend/ModelZoo-PyTorch
train
23
34289ca0ce5ec0431cbe4dbfe9942e3e5fa84c72
[ "if not value:\n return []\ndelimters = '[, \\\\-!?:\\t]+'\nreturn list(filter(None, re.split(delimters, value)))", "super(MultiPriceField, self).validate(value)\nif len(value) > 0 and len(value) != 11:\n raise ValidationError('Must have 11 values, separated by commas, spaces or tabs.')\nfor price in value:...
<|body_start_0|> if not value: return [] delimters = '[, \\-!?:\t]+' return list(filter(None, re.split(delimters, value))) <|end_body_0|> <|body_start_1|> super(MultiPriceField, self).validate(value) if len(value) > 0 and len(value) != 11: raise Validatio...
MultiPriceField
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiPriceField: def to_python(self, value): """Normalize data to a list of strings.""" <|body_0|> def validate(self, value): """Check if value consists only of valid emails.""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not value: ...
stack_v2_sparse_classes_10k_train_008935
6,902
no_license
[ { "docstring": "Normalize data to a list of strings.", "name": "to_python", "signature": "def to_python(self, value)" }, { "docstring": "Check if value consists only of valid emails.", "name": "validate", "signature": "def validate(self, value)" } ]
2
stack_v2_sparse_classes_30k_train_000280
Implement the Python class `MultiPriceField` described below. Class description: Implement the MultiPriceField class. Method signatures and docstrings: - def to_python(self, value): Normalize data to a list of strings. - def validate(self, value): Check if value consists only of valid emails.
Implement the Python class `MultiPriceField` described below. Class description: Implement the MultiPriceField class. Method signatures and docstrings: - def to_python(self, value): Normalize data to a list of strings. - def validate(self, value): Check if value consists only of valid emails. <|skeleton|> class Mult...
ebff02b1e6c95b653f027f0e05125b754c6af5af
<|skeleton|> class MultiPriceField: def to_python(self, value): """Normalize data to a list of strings.""" <|body_0|> def validate(self, value): """Check if value consists only of valid emails.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MultiPriceField: def to_python(self, value): """Normalize data to a list of strings.""" if not value: return [] delimters = '[, \\-!?:\t]+' return list(filter(None, re.split(delimters, value))) def validate(self, value): """Check if value consists only ...
the_stack_v2_python_sparse
lcf/forms.py
gamzatti/lcf
train
0
5cdf4f096f3d83c2a7fc7243e48c06cf07fd4358
[ "super().setupUI(Form)\nself.label_4 = QtWidgets.QLabel(self.verticalLayoutWidget)\nself.label_4.setToolTip('')\nself.label_4.setAlignment(QtCore.Qt.AlignCenter)\nself.label_4.setObjectName('label_4')\nself.verticalLayout_2.addWidget(self.label_4)\nself.label_8 = QtWidgets.QLabel(self.verticalLayoutWidget)\nself.la...
<|body_start_0|> super().setupUI(Form) self.label_4 = QtWidgets.QLabel(self.verticalLayoutWidget) self.label_4.setToolTip('') self.label_4.setAlignment(QtCore.Qt.AlignCenter) self.label_4.setObjectName('label_4') self.verticalLayout_2.addWidget(self.label_4) self....
TMTWindowWidget
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TMTWindowWidget: def setupUi(self, Form): """Método empleado para especificar el contenido de la Interfáz gráfica, es generado por pyuic5. Args: Form: Ventana en la que se deplegará la interfáz gráfica (es un tipo de dato QtWidget.QWidget)""" <|body_0|> def retranslateUi(sel...
stack_v2_sparse_classes_10k_train_008936
2,685
no_license
[ { "docstring": "Método empleado para especificar el contenido de la Interfáz gráfica, es generado por pyuic5. Args: Form: Ventana en la que se deplegará la interfáz gráfica (es un tipo de dato QtWidget.QWidget)", "name": "setupUi", "signature": "def setupUi(self, Form)" }, { "docstring": "Método...
2
stack_v2_sparse_classes_30k_train_004697
Implement the Python class `TMTWindowWidget` described below. Class description: Implement the TMTWindowWidget class. Method signatures and docstrings: - def setupUi(self, Form): Método empleado para especificar el contenido de la Interfáz gráfica, es generado por pyuic5. Args: Form: Ventana en la que se deplegará la...
Implement the Python class `TMTWindowWidget` described below. Class description: Implement the TMTWindowWidget class. Method signatures and docstrings: - def setupUi(self, Form): Método empleado para especificar el contenido de la Interfáz gráfica, es generado por pyuic5. Args: Form: Ventana en la que se deplegará la...
5d1d68fc4476ed866ecfc305112854d9a49c3876
<|skeleton|> class TMTWindowWidget: def setupUi(self, Form): """Método empleado para especificar el contenido de la Interfáz gráfica, es generado por pyuic5. Args: Form: Ventana en la que se deplegará la interfáz gráfica (es un tipo de dato QtWidget.QWidget)""" <|body_0|> def retranslateUi(sel...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TMTWindowWidget: def setupUi(self, Form): """Método empleado para especificar el contenido de la Interfáz gráfica, es generado por pyuic5. Args: Form: Ventana en la que se deplegará la interfáz gráfica (es un tipo de dato QtWidget.QWidget)""" super().setupUI(Form) self.label_4 = QtWidg...
the_stack_v2_python_sparse
src/main/python/vistas/TMTWindowWidget.py
ProyectoIntegrador2018/reportes-neurociencias
train
1
d70113f927a7cf062be3fa9350b0e2d074ff5909
[ "self.pump = Pump('127.0.0.1', 8000)\nself.pump.set_state = MagicMock(return_value=True)\nself.new_sensor = Sensor('127.0.0.1', 8000)\nself.new_decider = Decider(100, 0.1)\nself.new_controller = Controller(self.new_sensor, self.pump, self.new_decider)\nself.actions = {'PUMP_IN': self.pump.PUMP_IN, 'PUMP_OUT': self....
<|body_start_0|> self.pump = Pump('127.0.0.1', 8000) self.pump.set_state = MagicMock(return_value=True) self.new_sensor = Sensor('127.0.0.1', 8000) self.new_decider = Decider(100, 0.1) self.new_controller = Controller(self.new_sensor, self.pump, self.new_decider) self.act...
Unit tests for the Controller class
ControllerTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ControllerTests: """Unit tests for the Controller class""" def setUp(self): """Sets the necessary varialbles to test the Controller class""" <|body_0|> def test_controller_tick(self): """Tests each of the behaviors defined in the Controller class""" <|bod...
stack_v2_sparse_classes_10k_train_008937
5,129
no_license
[ { "docstring": "Sets the necessary varialbles to test the Controller class", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Tests each of the behaviors defined in the Controller class", "name": "test_controller_tick", "signature": "def test_controller_tick(self)" } ...
2
null
Implement the Python class `ControllerTests` described below. Class description: Unit tests for the Controller class Method signatures and docstrings: - def setUp(self): Sets the necessary varialbles to test the Controller class - def test_controller_tick(self): Tests each of the behaviors defined in the Controller c...
Implement the Python class `ControllerTests` described below. Class description: Unit tests for the Controller class Method signatures and docstrings: - def setUp(self): Sets the necessary varialbles to test the Controller class - def test_controller_tick(self): Tests each of the behaviors defined in the Controller c...
b1fea0309b3495b3e1dc167d7029bc9e4b6f00f1
<|skeleton|> class ControllerTests: """Unit tests for the Controller class""" def setUp(self): """Sets the necessary varialbles to test the Controller class""" <|body_0|> def test_controller_tick(self): """Tests each of the behaviors defined in the Controller class""" <|bod...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ControllerTests: """Unit tests for the Controller class""" def setUp(self): """Sets the necessary varialbles to test the Controller class""" self.pump = Pump('127.0.0.1', 8000) self.pump.set_state = MagicMock(return_value=True) self.new_sensor = Sensor('127.0.0.1', 8000) ...
the_stack_v2_python_sparse
students/rob_sanchez/lesson_06/Water_Regulation/waterregulation/test.py
UWPCE-PythonCert-ClassRepos/SP_Online_Course2_2018
train
4
af2524f76b65ebca9fda2884b50c2495fd1745f5
[ "s = croc_scan.Scanner()\nself.assertEqual(s.re_token.pattern, '#')\nself.assertEqual(s.comment_to_eol, ['#'])\nself.assertEqual(s.comment_start, None)\nself.assertEqual(s.comment_end, None)", "s = croc_scan.Scanner()\ns.re_token = re.compile('([\\\\:\\\\\"\\\\(\\\\)])')\ns.comment_to_eol = [':']\ns.comment_start...
<|body_start_0|> s = croc_scan.Scanner() self.assertEqual(s.re_token.pattern, '#') self.assertEqual(s.comment_to_eol, ['#']) self.assertEqual(s.comment_start, None) self.assertEqual(s.comment_end, None) <|end_body_0|> <|body_start_1|> s = croc_scan.Scanner() s.re...
Tests for croc_scan.Scanner.
TestScanner
[ "BSD-3-Clause", "LGPL-2.0-or-later", "LicenseRef-scancode-unknown-license-reference", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-unknown", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestScanner: """Tests for croc_scan.Scanner.""" def testInit(self): """Test __init()__.""" <|body_0|> def testScanLines(self): """Test ScanLines().""" <|body_1|> <|end_skeleton|> <|body_start_0|> s = croc_scan.Scanner() self.assertEqual(...
stack_v2_sparse_classes_10k_train_008938
7,181
permissive
[ { "docstring": "Test __init()__.", "name": "testInit", "signature": "def testInit(self)" }, { "docstring": "Test ScanLines().", "name": "testScanLines", "signature": "def testScanLines(self)" } ]
2
stack_v2_sparse_classes_30k_train_004501
Implement the Python class `TestScanner` described below. Class description: Tests for croc_scan.Scanner. Method signatures and docstrings: - def testInit(self): Test __init()__. - def testScanLines(self): Test ScanLines().
Implement the Python class `TestScanner` described below. Class description: Tests for croc_scan.Scanner. Method signatures and docstrings: - def testInit(self): Test __init()__. - def testScanLines(self): Test ScanLines(). <|skeleton|> class TestScanner: """Tests for croc_scan.Scanner.""" def testInit(self...
72a05af97787001756bae2511b7985e61498c965
<|skeleton|> class TestScanner: """Tests for croc_scan.Scanner.""" def testInit(self): """Test __init()__.""" <|body_0|> def testScanLines(self): """Test ScanLines().""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TestScanner: """Tests for croc_scan.Scanner.""" def testInit(self): """Test __init()__.""" s = croc_scan.Scanner() self.assertEqual(s.re_token.pattern, '#') self.assertEqual(s.comment_to_eol, ['#']) self.assertEqual(s.comment_start, None) self.assertEqual(s...
the_stack_v2_python_sparse
tools/code_coverage/croc_scan_test.py
metux/chromium-suckless
train
5
a40e36424bdf0dac7ef3b258ce27876cfa3de4de
[ "self.host = host\nself.integral_volume_names = integral_volume_names\nself.password = password\nself.port = port\nself.share_type = share_type\nself.use_https = use_https\nself.username = username", "if dictionary is None:\n return None\nhost = dictionary.get('host')\nintegral_volume_names = dictionary.get('i...
<|body_start_0|> self.host = host self.integral_volume_names = integral_volume_names self.password = password self.port = port self.share_type = share_type self.use_https = use_https self.username = username <|end_body_0|> <|body_start_1|> if dictionary i...
Implementation of the 'QStarServerCredentials' model. Specifies the server credentials to connect to a QStar service to manage the media Vault. Attributes: host (string): Specifies the IP address or DNS name of the server where QStar service is running. integral_volume_names (list of string): Array of Integral Volume N...
QStarServerCredentials
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class QStarServerCredentials: """Implementation of the 'QStarServerCredentials' model. Specifies the server credentials to connect to a QStar service to manage the media Vault. Attributes: host (string): Specifies the IP address or DNS name of the server where QStar service is running. integral_volume_...
stack_v2_sparse_classes_10k_train_008939
3,345
permissive
[ { "docstring": "Constructor for the QStarServerCredentials class", "name": "__init__", "signature": "def __init__(self, host=None, integral_volume_names=None, password=None, port=None, share_type=None, use_https=None, username=None)" }, { "docstring": "Creates an instance of this model from a di...
2
null
Implement the Python class `QStarServerCredentials` described below. Class description: Implementation of the 'QStarServerCredentials' model. Specifies the server credentials to connect to a QStar service to manage the media Vault. Attributes: host (string): Specifies the IP address or DNS name of the server where QSt...
Implement the Python class `QStarServerCredentials` described below. Class description: Implementation of the 'QStarServerCredentials' model. Specifies the server credentials to connect to a QStar service to manage the media Vault. Attributes: host (string): Specifies the IP address or DNS name of the server where QSt...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class QStarServerCredentials: """Implementation of the 'QStarServerCredentials' model. Specifies the server credentials to connect to a QStar service to manage the media Vault. Attributes: host (string): Specifies the IP address or DNS name of the server where QStar service is running. integral_volume_...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class QStarServerCredentials: """Implementation of the 'QStarServerCredentials' model. Specifies the server credentials to connect to a QStar service to manage the media Vault. Attributes: host (string): Specifies the IP address or DNS name of the server where QStar service is running. integral_volume_names (list o...
the_stack_v2_python_sparse
cohesity_management_sdk/models/q_star_server_credentials.py
cohesity/management-sdk-python
train
24
a466d4e73543c0124692b9e4c4b8ad714b5a82ec
[ "interval = self.coordinator.data[self.entity_description.key][self.channel_type]\nif interval.channel_type == ChannelType.FEED_IN:\n return format_cents_to_dollars(interval.per_kwh) * -1\nreturn format_cents_to_dollars(interval.per_kwh)", "interval = self.coordinator.data[self.entity_description.key][self.cha...
<|body_start_0|> interval = self.coordinator.data[self.entity_description.key][self.channel_type] if interval.channel_type == ChannelType.FEED_IN: return format_cents_to_dollars(interval.per_kwh) * -1 return format_cents_to_dollars(interval.per_kwh) <|end_body_0|> <|body_start_1|> ...
Amber Price Sensor.
AmberPriceSensor
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AmberPriceSensor: """Amber Price Sensor.""" def native_value(self) -> float | None: """Return the current price in $/kWh.""" <|body_0|> def extra_state_attributes(self) -> Mapping[str, Any] | None: """Return additional pieces of information about the price.""" ...
stack_v2_sparse_classes_10k_train_008940
9,224
permissive
[ { "docstring": "Return the current price in $/kWh.", "name": "native_value", "signature": "def native_value(self) -> float | None" }, { "docstring": "Return additional pieces of information about the price.", "name": "extra_state_attributes", "signature": "def extra_state_attributes(self...
2
stack_v2_sparse_classes_30k_train_000274
Implement the Python class `AmberPriceSensor` described below. Class description: Amber Price Sensor. Method signatures and docstrings: - def native_value(self) -> float | None: Return the current price in $/kWh. - def extra_state_attributes(self) -> Mapping[str, Any] | None: Return additional pieces of information a...
Implement the Python class `AmberPriceSensor` described below. Class description: Amber Price Sensor. Method signatures and docstrings: - def native_value(self) -> float | None: Return the current price in $/kWh. - def extra_state_attributes(self) -> Mapping[str, Any] | None: Return additional pieces of information a...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class AmberPriceSensor: """Amber Price Sensor.""" def native_value(self) -> float | None: """Return the current price in $/kWh.""" <|body_0|> def extra_state_attributes(self) -> Mapping[str, Any] | None: """Return additional pieces of information about the price.""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AmberPriceSensor: """Amber Price Sensor.""" def native_value(self) -> float | None: """Return the current price in $/kWh.""" interval = self.coordinator.data[self.entity_description.key][self.channel_type] if interval.channel_type == ChannelType.FEED_IN: return format_...
the_stack_v2_python_sparse
homeassistant/components/amberelectric/sensor.py
home-assistant/core
train
35,501
e4d45fe7dbdcd1656deed30e63b78e90b9b129cb
[ "params = super().get_default_params(with_embedding=True, with_multi_layer_perceptron=True)\nparams.add(Param(name='lstm_hidden_size', value=5, desc='Integer, the hidden size of the bi-directional LSTM layer.'))\nparams.add(Param(name='lstm_num', value=3, desc='Integer, number of LSTM units'))\nparams.add(Param(nam...
<|body_start_0|> params = super().get_default_params(with_embedding=True, with_multi_layer_perceptron=True) params.add(Param(name='lstm_hidden_size', value=5, desc='Integer, the hidden size of the bi-directional LSTM layer.')) params.add(Param(name='lstm_num', value=3, desc='Integer, number of L...
HBMP model. Examples: >>> model = HBMP() >>> model.params['embedding_input_dim'] = 200 >>> model.params['embedding_output_dim'] = 100 >>> model.params['mlp_num_layers'] = 1 >>> model.params['mlp_num_units'] = 10 >>> model.params['mlp_num_fan_out'] = 10 >>> model.params['mlp_activation_func'] = nn.LeakyReLU(0.1) >>> mod...
HBMP
[ "MIT", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-or-later", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HBMP: """HBMP model. Examples: >>> model = HBMP() >>> model.params['embedding_input_dim'] = 200 >>> model.params['embedding_output_dim'] = 100 >>> model.params['mlp_num_layers'] = 1 >>> model.params['mlp_num_units'] = 10 >>> model.params['mlp_num_fan_out'] = 10 >>> model.params['mlp_activation_fu...
stack_v2_sparse_classes_10k_train_008941
4,584
permissive
[ { "docstring": ":return: model default parameters.", "name": "get_default_params", "signature": "def get_default_params(cls) -> ParamTable" }, { "docstring": "Build model structure. HBMP use Siamese arthitecture.", "name": "build", "signature": "def build(self)" }, { "docstring":...
3
stack_v2_sparse_classes_30k_train_000194
Implement the Python class `HBMP` described below. Class description: HBMP model. Examples: >>> model = HBMP() >>> model.params['embedding_input_dim'] = 200 >>> model.params['embedding_output_dim'] = 100 >>> model.params['mlp_num_layers'] = 1 >>> model.params['mlp_num_units'] = 10 >>> model.params['mlp_num_fan_out'] =...
Implement the Python class `HBMP` described below. Class description: HBMP model. Examples: >>> model = HBMP() >>> model.params['embedding_input_dim'] = 200 >>> model.params['embedding_output_dim'] = 100 >>> model.params['mlp_num_layers'] = 1 >>> model.params['mlp_num_units'] = 10 >>> model.params['mlp_num_fan_out'] =...
4198ebce942f4afe7ddca6a96ab6f4464ade4518
<|skeleton|> class HBMP: """HBMP model. Examples: >>> model = HBMP() >>> model.params['embedding_input_dim'] = 200 >>> model.params['embedding_output_dim'] = 100 >>> model.params['mlp_num_layers'] = 1 >>> model.params['mlp_num_units'] = 10 >>> model.params['mlp_num_fan_out'] = 10 >>> model.params['mlp_activation_fu...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class HBMP: """HBMP model. Examples: >>> model = HBMP() >>> model.params['embedding_input_dim'] = 200 >>> model.params['embedding_output_dim'] = 100 >>> model.params['mlp_num_layers'] = 1 >>> model.params['mlp_num_units'] = 10 >>> model.params['mlp_num_fan_out'] = 10 >>> model.params['mlp_activation_func'] = nn.Lea...
the_stack_v2_python_sparse
poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/models/hbmp.py
microsoft/ContextualSP
train
332
e89a149388e0a425974768dfe727f30a495ec9f8
[ "value = '<div>'\nclase = 'actions_fase'\ncontroller = './'\nif UrlParser.parse_nombre(request.url, 'post_buscar'):\n controller = '../'\nid_fase = UrlParser.parse_id(request.url, 'fases')\nid = str(obj.id_lb)\nif PoseePermiso('abrir-cerrar lb', id_fase=id_fase).is_met(request.environ):\n if obj.estado in [u'...
<|body_start_0|> value = '<div>' clase = 'actions_fase' controller = './' if UrlParser.parse_nombre(request.url, 'post_buscar'): controller = '../' id_fase = UrlParser.parse_id(request.url, 'fases') id = str(obj.id_lb) if PoseePermiso('abrir-cerrar lb'...
LineaBaseTableFiller
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LineaBaseTableFiller: def __actions__(self, obj): """Links de acciones para un registro dado""" <|body_0|> def _do_get_provider_count_and_objs(self, id_fase=None, id_lb=None, **kw): """Recupera las lineas bases de una fase, o aquellas para las que tenemos algún permi...
stack_v2_sparse_classes_10k_train_008942
21,724
no_license
[ { "docstring": "Links de acciones para un registro dado", "name": "__actions__", "signature": "def __actions__(self, obj)" }, { "docstring": "Recupera las lineas bases de una fase, o aquellas para las que tenemos algún permiso.", "name": "_do_get_provider_count_and_objs", "signature": "d...
2
stack_v2_sparse_classes_30k_train_006739
Implement the Python class `LineaBaseTableFiller` described below. Class description: Implement the LineaBaseTableFiller class. Method signatures and docstrings: - def __actions__(self, obj): Links de acciones para un registro dado - def _do_get_provider_count_and_objs(self, id_fase=None, id_lb=None, **kw): Recupera ...
Implement the Python class `LineaBaseTableFiller` described below. Class description: Implement the LineaBaseTableFiller class. Method signatures and docstrings: - def __actions__(self, obj): Links de acciones para un registro dado - def _do_get_provider_count_and_objs(self, id_fase=None, id_lb=None, **kw): Recupera ...
997531e130d1951b483f4a6a67f2df7467cd9fd1
<|skeleton|> class LineaBaseTableFiller: def __actions__(self, obj): """Links de acciones para un registro dado""" <|body_0|> def _do_get_provider_count_and_objs(self, id_fase=None, id_lb=None, **kw): """Recupera las lineas bases de una fase, o aquellas para las que tenemos algún permi...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LineaBaseTableFiller: def __actions__(self, obj): """Links de acciones para un registro dado""" value = '<div>' clase = 'actions_fase' controller = './' if UrlParser.parse_nombre(request.url, 'post_buscar'): controller = '../' id_fase = UrlParser.par...
the_stack_v2_python_sparse
lpm/controllers/lineabase.py
jorgeramirez/LPM
train
1
f0fb1b4387b455604fa3d01f6c93bdedb8d29991
[ "shape = np.array([2, 3, 4])\ndata = np.zeros(shape)\ngraph = build_graph_with_attrs(nodes_with_attrs=self.nodes, edges_with_attrs=self.edges, update_nodes_attributes=[('data_node', {'shape': shape, 'value': data})])\ngraph_ref = build_graph_with_attrs(nodes_with_attrs=self.nodes + self.new_nodes, edges_with_attrs=...
<|body_start_0|> shape = np.array([2, 3, 4]) data = np.zeros(shape) graph = build_graph_with_attrs(nodes_with_attrs=self.nodes, edges_with_attrs=self.edges, update_nodes_attributes=[('data_node', {'shape': shape, 'value': data})]) graph_ref = build_graph_with_attrs(nodes_with_attrs=self....
CreateConstNodesReplacementTest
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CreateConstNodesReplacementTest: def test_one_node(self): """We should add Const node and data node.""" <|body_0|> def test_one_bin_node(self): """Nothing should happen.""" <|body_1|> def test_two_nodes_with_bin(self): """Test case for data node ...
stack_v2_sparse_classes_10k_train_008943
4,410
permissive
[ { "docstring": "We should add Const node and data node.", "name": "test_one_node", "signature": "def test_one_node(self)" }, { "docstring": "Nothing should happen.", "name": "test_one_bin_node", "signature": "def test_one_bin_node(self)" }, { "docstring": "Test case for data node...
4
null
Implement the Python class `CreateConstNodesReplacementTest` described below. Class description: Implement the CreateConstNodesReplacementTest class. Method signatures and docstrings: - def test_one_node(self): We should add Const node and data node. - def test_one_bin_node(self): Nothing should happen. - def test_tw...
Implement the Python class `CreateConstNodesReplacementTest` described below. Class description: Implement the CreateConstNodesReplacementTest class. Method signatures and docstrings: - def test_one_node(self): We should add Const node and data node. - def test_one_bin_node(self): Nothing should happen. - def test_tw...
e4bed7a31c9f00d8afbfcabee3f64f55496ae56a
<|skeleton|> class CreateConstNodesReplacementTest: def test_one_node(self): """We should add Const node and data node.""" <|body_0|> def test_one_bin_node(self): """Nothing should happen.""" <|body_1|> def test_two_nodes_with_bin(self): """Test case for data node ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class CreateConstNodesReplacementTest: def test_one_node(self): """We should add Const node and data node.""" shape = np.array([2, 3, 4]) data = np.zeros(shape) graph = build_graph_with_attrs(nodes_with_attrs=self.nodes, edges_with_attrs=self.edges, update_nodes_attributes=[('data_no...
the_stack_v2_python_sparse
tools/mo/unit_tests/mo/back/SpecialNodesFinalization_test.py
openvinotoolkit/openvino
train
3,953
c1523587f90bc9a42b5173aea128d555c4bb7912
[ "super().__init__(**kwargs)\nself.magnitude = magnitude\nself.n_transforms = n_transforms\nself._max_magnitude = 10.0\nself._max_x_shift = 0.1\nself._max_y_shift = 0.2\nself._max_angle = 30\nself._max_contrast = 1\nself._max_brightness = 1", "level = self.magnitude / self._max_magnitude\nangle = self.randomly_neg...
<|body_start_0|> super().__init__(**kwargs) self.magnitude = magnitude self.n_transforms = n_transforms self._max_magnitude = 10.0 self._max_x_shift = 0.1 self._max_y_shift = 0.2 self._max_angle = 30 self._max_contrast = 1 self._max_brightness = 1 ...
Implements the RandAugment procedure on a restricted set of transformations. https://arxiv.org/abs/1909.13719 Possible transformations for segmentations maps are: rotation, horizontal and vertical shift, horizontal flip, identity. Additional transformations for images are brightness adjustment and contrast adjustment.
RandAugmentSlice
[ "MIT", "LicenseRef-scancode-generic-cla" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RandAugmentSlice: """Implements the RandAugment procedure on a restricted set of transformations. https://arxiv.org/abs/1909.13719 Possible transformations for segmentations maps are: rotation, horizontal and vertical shift, horizontal flip, identity. Additional transformations for images are bri...
stack_v2_sparse_classes_10k_train_008944
19,979
permissive
[ { "docstring": ":param magnitude: magnitude to apply to the transformations as defined in the RandAugment paper. 1 means a weak transform, 10 is the strongest transform. :param n_transforms: number of transformation to sample for each image.", "name": "__init__", "signature": "def __init__(self, magnitu...
3
stack_v2_sparse_classes_30k_train_000108
Implement the Python class `RandAugmentSlice` described below. Class description: Implements the RandAugment procedure on a restricted set of transformations. https://arxiv.org/abs/1909.13719 Possible transformations for segmentations maps are: rotation, horizontal and vertical shift, horizontal flip, identity. Additi...
Implement the Python class `RandAugmentSlice` described below. Class description: Implements the RandAugment procedure on a restricted set of transformations. https://arxiv.org/abs/1909.13719 Possible transformations for segmentations maps are: rotation, horizontal and vertical shift, horizontal flip, identity. Additi...
12b496093097ef48d5ac8880985c04918d7f76fe
<|skeleton|> class RandAugmentSlice: """Implements the RandAugment procedure on a restricted set of transformations. https://arxiv.org/abs/1909.13719 Possible transformations for segmentations maps are: rotation, horizontal and vertical shift, horizontal flip, identity. Additional transformations for images are bri...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class RandAugmentSlice: """Implements the RandAugment procedure on a restricted set of transformations. https://arxiv.org/abs/1909.13719 Possible transformations for segmentations maps are: rotation, horizontal and vertical shift, horizontal flip, identity. Additional transformations for images are brightness adjus...
the_stack_v2_python_sparse
InnerEye/ML/utils/augmentation.py
MaxCodeXTC/InnerEye-DeepLearning
train
1
c8b07211370c3be9387017c9972b29c7c02acdc7
[ "super(Net, self).__init__()\nself.cfgs = cfgs\nself.simclr = SimCLR(cfgs)\nself.backbone = BAN(cfgs)\nlayers = [weight_norm(nn.Linear(cfgs.hidden_size, cfgs.flat_out_size), dim=None), nn.ReLU(), nn.Dropout(cfgs.classifer_dropout_r, inplace=True)]\nself.flatten = nn.Sequential(*layers)\nlayers_classifer = [weight_n...
<|body_start_0|> super(Net, self).__init__() self.cfgs = cfgs self.simclr = SimCLR(cfgs) self.backbone = BAN(cfgs) layers = [weight_norm(nn.Linear(cfgs.hidden_size, cfgs.flat_out_size), dim=None), nn.ReLU(), nn.Dropout(cfgs.classifer_dropout_r, inplace=True)] self.flatten...
Net
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Net: def __init__(self, cfgs): """:param cfgs: configurations of XTQA. :param pretrained_emb: :param token_size: the size of vocabulary table.""" <|body_0|> def forward(self, que_emb, dia_f, opt_emb, dia_matrix, dia_node_emb, cfg): """:param que_ix: the index of ques...
stack_v2_sparse_classes_10k_train_008945
2,507
no_license
[ { "docstring": ":param cfgs: configurations of XTQA. :param pretrained_emb: :param token_size: the size of vocabulary table.", "name": "__init__", "signature": "def __init__(self, cfgs)" }, { "docstring": ":param que_ix: the index of questions :param opt_ix: the index of options :param dia: the ...
2
stack_v2_sparse_classes_30k_train_000257
Implement the Python class `Net` described below. Class description: Implement the Net class. Method signatures and docstrings: - def __init__(self, cfgs): :param cfgs: configurations of XTQA. :param pretrained_emb: :param token_size: the size of vocabulary table. - def forward(self, que_emb, dia_f, opt_emb, dia_matr...
Implement the Python class `Net` described below. Class description: Implement the Net class. Method signatures and docstrings: - def __init__(self, cfgs): :param cfgs: configurations of XTQA. :param pretrained_emb: :param token_size: the size of vocabulary table. - def forward(self, que_emb, dia_f, opt_emb, dia_matr...
7b2d913fa70e3520d9055c9493ca640cf30892b9
<|skeleton|> class Net: def __init__(self, cfgs): """:param cfgs: configurations of XTQA. :param pretrained_emb: :param token_size: the size of vocabulary table.""" <|body_0|> def forward(self, que_emb, dia_f, opt_emb, dia_matrix, dia_node_emb, cfg): """:param que_ix: the index of ques...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Net: def __init__(self, cfgs): """:param cfgs: configurations of XTQA. :param pretrained_emb: :param token_size: the size of vocabulary table.""" super(Net, self).__init__() self.cfgs = cfgs self.simclr = SimCLR(cfgs) self.backbone = BAN(cfgs) layers = [weight_n...
the_stack_v2_python_sparse
model/ban_csdia/net.py
dr-majie/2019-mytqa
train
3
5387360372fa674be695cc9aa2ef1c0cb4c8a047
[ "seq1 = 'AAAA'\nres = geneutil.sequenceEntropy(seq1)\nself.assertAlmostEqual(res.entropy, 0.0)\nself.assertTrue(res.counts['A'] == 4)", "seq1 = 'ACDEFGHIKLMNPQRSTVWY'\nres = geneutil.sequenceEntropy(seq1, base=20)\nself.assertAlmostEqual(res.entropy, 1.0)\nfor aa in seq1:\n self.assertTrue(res.counts[aa] == 1)...
<|body_start_0|> seq1 = 'AAAA' res = geneutil.sequenceEntropy(seq1) self.assertAlmostEqual(res.entropy, 0.0) self.assertTrue(res.counts['A'] == 4) <|end_body_0|> <|body_start_1|> seq1 = 'ACDEFGHIKLMNPQRSTVWY' res = geneutil.sequenceEntropy(seq1, base=20) self.ass...
test004
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class test004: def test_entropy(self): """Entropy of a homopolymer""" <|body_0|> def test_max_entropy(self): """Maximum possible entropy""" <|body_1|> <|end_skeleton|> <|body_start_0|> seq1 = 'AAAA' res = geneutil.sequenceEntropy(seq1) sel...
stack_v2_sparse_classes_10k_train_008946
2,692
no_license
[ { "docstring": "Entropy of a homopolymer", "name": "test_entropy", "signature": "def test_entropy(self)" }, { "docstring": "Maximum possible entropy", "name": "test_max_entropy", "signature": "def test_max_entropy(self)" } ]
2
stack_v2_sparse_classes_30k_test_000209
Implement the Python class `test004` described below. Class description: Implement the test004 class. Method signatures and docstrings: - def test_entropy(self): Entropy of a homopolymer - def test_max_entropy(self): Maximum possible entropy
Implement the Python class `test004` described below. Class description: Implement the test004 class. Method signatures and docstrings: - def test_entropy(self): Entropy of a homopolymer - def test_max_entropy(self): Maximum possible entropy <|skeleton|> class test004: def test_entropy(self): """Entropy...
d7ddd2b585a841c6d986974a24a53e4d1abe71ba
<|skeleton|> class test004: def test_entropy(self): """Entropy of a homopolymer""" <|body_0|> def test_max_entropy(self): """Maximum possible entropy""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class test004: def test_entropy(self): """Entropy of a homopolymer""" seq1 = 'AAAA' res = geneutil.sequenceEntropy(seq1) self.assertAlmostEqual(res.entropy, 0.0) self.assertTrue(res.counts['A'] == 4) def test_max_entropy(self): """Maximum possible entropy""" ...
the_stack_v2_python_sparse
src/geneutil_test.py
dad/base
train
0
abe63f9aa466b4d1cff570cff8aceede68f93805
[ "self.res = 0\nself.nums = sorted(nums, reverse=True)\n\ndef deeper(target_sum, current_index):\n print(target_sum, current_index)\n if current_index == len(self.nums):\n if target_sum == 0:\n self.res += 1\n cache[target_sum, current_index] = True\n return True\n ...
<|body_start_0|> self.res = 0 self.nums = sorted(nums, reverse=True) def deeper(target_sum, current_index): print(target_sum, current_index) if current_index == len(self.nums): if target_sum == 0: self.res += 1 cach...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findTargetSumWays1(self, nums, S): """:type nums: List[int] :type S: int :rtype: int""" <|body_0|> def findTargetSumWays(self, nums, S): """第二次做的时候发现上面那个结果不对了是什么鬼""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.res = 0 sel...
stack_v2_sparse_classes_10k_train_008947
2,364
no_license
[ { "docstring": ":type nums: List[int] :type S: int :rtype: int", "name": "findTargetSumWays1", "signature": "def findTargetSumWays1(self, nums, S)" }, { "docstring": "第二次做的时候发现上面那个结果不对了是什么鬼", "name": "findTargetSumWays", "signature": "def findTargetSumWays(self, nums, S)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findTargetSumWays1(self, nums, S): :type nums: List[int] :type S: int :rtype: int - def findTargetSumWays(self, nums, S): 第二次做的时候发现上面那个结果不对了是什么鬼
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findTargetSumWays1(self, nums, S): :type nums: List[int] :type S: int :rtype: int - def findTargetSumWays(self, nums, S): 第二次做的时候发现上面那个结果不对了是什么鬼 <|skeleton|> class Solution:...
97533d53c8892b6519e99f344489fa4fd4c9ab93
<|skeleton|> class Solution: def findTargetSumWays1(self, nums, S): """:type nums: List[int] :type S: int :rtype: int""" <|body_0|> def findTargetSumWays(self, nums, S): """第二次做的时候发现上面那个结果不对了是什么鬼""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def findTargetSumWays1(self, nums, S): """:type nums: List[int] :type S: int :rtype: int""" self.res = 0 self.nums = sorted(nums, reverse=True) def deeper(target_sum, current_index): print(target_sum, current_index) if current_index == len(sel...
the_stack_v2_python_sparse
2. DFS/494.py
proTao/leetcode
train
0
1151650be6e24ccde1faed55433809427ce2bc60
[ "super().__init__()\nself.embed_dim = embed_dim\nself.k_embed_size = kdim if kdim else embed_dim\nself.v_embed_size = vdim if vdim else embed_dim\nself.num_heads = num_attn_heads\nself.attention_dropout = dropout\nself.head_embed_size = embed_dim // num_attn_heads\nself.head_scaling = math.sqrt(self.head_embed_size...
<|body_start_0|> super().__init__() self.embed_dim = embed_dim self.k_embed_size = kdim if kdim else embed_dim self.v_embed_size = vdim if vdim else embed_dim self.num_heads = num_attn_heads self.attention_dropout = dropout self.head_embed_size = embed_dim // num_...
Multi-Head Attention
MultiHeadAttention
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiHeadAttention: """Multi-Head Attention""" def __init__(self, embed_dim, num_attn_heads, kdim=None, vdim=None, dropout=0.0, self_attention=False, encoder_decoder_attention=False): """___QUESTION-7-MULTIHEAD-ATTENTION-NOTE You shouldn't need to change the __init__ of this class fo...
stack_v2_sparse_classes_10k_train_008948
28,210
no_license
[ { "docstring": "___QUESTION-7-MULTIHEAD-ATTENTION-NOTE You shouldn't need to change the __init__ of this class for your attention implementation", "name": "__init__", "signature": "def __init__(self, embed_dim, num_attn_heads, kdim=None, vdim=None, dropout=0.0, self_attention=False, encoder_decoder_atte...
2
stack_v2_sparse_classes_30k_train_000990
Implement the Python class `MultiHeadAttention` described below. Class description: Multi-Head Attention Method signatures and docstrings: - def __init__(self, embed_dim, num_attn_heads, kdim=None, vdim=None, dropout=0.0, self_attention=False, encoder_decoder_attention=False): ___QUESTION-7-MULTIHEAD-ATTENTION-NOTE Y...
Implement the Python class `MultiHeadAttention` described below. Class description: Multi-Head Attention Method signatures and docstrings: - def __init__(self, embed_dim, num_attn_heads, kdim=None, vdim=None, dropout=0.0, self_attention=False, encoder_decoder_attention=False): ___QUESTION-7-MULTIHEAD-ATTENTION-NOTE Y...
7f109bcf3cc17d2c669e18fb2ad3357aa4e0fc2e
<|skeleton|> class MultiHeadAttention: """Multi-Head Attention""" def __init__(self, embed_dim, num_attn_heads, kdim=None, vdim=None, dropout=0.0, self_attention=False, encoder_decoder_attention=False): """___QUESTION-7-MULTIHEAD-ATTENTION-NOTE You shouldn't need to change the __init__ of this class fo...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MultiHeadAttention: """Multi-Head Attention""" def __init__(self, embed_dim, num_attn_heads, kdim=None, vdim=None, dropout=0.0, self_attention=False, encoder_decoder_attention=False): """___QUESTION-7-MULTIHEAD-ATTENTION-NOTE You shouldn't need to change the __init__ of this class for your attent...
the_stack_v2_python_sparse
NLG/table/modules/Transformer.py
Lyz1213/msc_dissertation
train
2
fe6f208cddc84bea8d5bca52e0bc3c6d2764cfcc
[ "tests = ['KIF.test1', 'KIF.test2']\nexpected = 'NAME:test1|test2'\nself.assertEqual(test_runner.get_kif_test_filter(tests), expected)", "tests = ['KIF.test1', 'KIF.test2']\nexpected = '-NAME:test1|test2'\nself.assertEqual(test_runner.get_kif_test_filter(tests, invert=True), expected)" ]
<|body_start_0|> tests = ['KIF.test1', 'KIF.test2'] expected = 'NAME:test1|test2' self.assertEqual(test_runner.get_kif_test_filter(tests), expected) <|end_body_0|> <|body_start_1|> tests = ['KIF.test1', 'KIF.test2'] expected = '-NAME:test1|test2' self.assertEqual(test_ru...
Tests for test_runner.get_kif_test_filter.
GetKIFTestFilterTest
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GetKIFTestFilterTest: """Tests for test_runner.get_kif_test_filter.""" def test_correct(self): """Ensures correctness of filter.""" <|body_0|> def test_correct_inverted(self): """Ensures correctness of inverted filter.""" <|body_1|> <|end_skeleton|> <|b...
stack_v2_sparse_classes_10k_train_008949
19,298
permissive
[ { "docstring": "Ensures correctness of filter.", "name": "test_correct", "signature": "def test_correct(self)" }, { "docstring": "Ensures correctness of inverted filter.", "name": "test_correct_inverted", "signature": "def test_correct_inverted(self)" } ]
2
null
Implement the Python class `GetKIFTestFilterTest` described below. Class description: Tests for test_runner.get_kif_test_filter. Method signatures and docstrings: - def test_correct(self): Ensures correctness of filter. - def test_correct_inverted(self): Ensures correctness of inverted filter.
Implement the Python class `GetKIFTestFilterTest` described below. Class description: Tests for test_runner.get_kif_test_filter. Method signatures and docstrings: - def test_correct(self): Ensures correctness of filter. - def test_correct_inverted(self): Ensures correctness of inverted filter. <|skeleton|> class Get...
4896f732fc747dfdcfcbac3d442f2d2d42df264a
<|skeleton|> class GetKIFTestFilterTest: """Tests for test_runner.get_kif_test_filter.""" def test_correct(self): """Ensures correctness of filter.""" <|body_0|> def test_correct_inverted(self): """Ensures correctness of inverted filter.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class GetKIFTestFilterTest: """Tests for test_runner.get_kif_test_filter.""" def test_correct(self): """Ensures correctness of filter.""" tests = ['KIF.test1', 'KIF.test2'] expected = 'NAME:test1|test2' self.assertEqual(test_runner.get_kif_test_filter(tests), expected) def ...
the_stack_v2_python_sparse
ios/build/bots/scripts/test_runner_test.py
Samsung/Castanets
train
58
ae2442c4d6ad0fb664be80d134e8bc7feeee63a7
[ "if decay_time <= datetime.timedelta(0):\n raise ValueError('decay_time must have positive duration')\nself.decay_time = decay_time\nself.decay_factor = decay_factor", "timestamp, x = value\nif now is None:\n now = datetime.datetime.utcnow()\ndelta = now - timestamp\nif delta < datetime.timedelta(seconds=0)...
<|body_start_0|> if decay_time <= datetime.timedelta(0): raise ValueError('decay_time must have positive duration') self.decay_time = decay_time self.decay_factor = decay_factor <|end_body_0|> <|body_start_1|> timestamp, x = value if now is None: now = da...
TimeDecay class. Helps to update counters that require a time decay
TimeDecay
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TimeDecay: """TimeDecay class. Helps to update counters that require a time decay""" def __init__(self, decay_time, decay_factor=2.0): """decay_time is timedelta""" <|body_0|> def update_value(self, value, now=None): """Computes the updated value for the given ha...
stack_v2_sparse_classes_10k_train_008950
1,847
permissive
[ { "docstring": "decay_time is timedelta", "name": "__init__", "signature": "def __init__(self, decay_time, decay_factor=2.0)" }, { "docstring": "Computes the updated value for the given half-life. Args: value (tuple(datetime.datetime, numeric_type)): tuple with the numeric value we wish to updat...
2
stack_v2_sparse_classes_30k_val_000097
Implement the Python class `TimeDecay` described below. Class description: TimeDecay class. Helps to update counters that require a time decay Method signatures and docstrings: - def __init__(self, decay_time, decay_factor=2.0): decay_time is timedelta - def update_value(self, value, now=None): Computes the updated v...
Implement the Python class `TimeDecay` described below. Class description: TimeDecay class. Helps to update counters that require a time decay Method signatures and docstrings: - def __init__(self, decay_time, decay_factor=2.0): decay_time is timedelta - def update_value(self, value, now=None): Computes the updated v...
70280110ec342a6f6db1c102e96756fcc3c3c01b
<|skeleton|> class TimeDecay: """TimeDecay class. Helps to update counters that require a time decay""" def __init__(self, decay_time, decay_factor=2.0): """decay_time is timedelta""" <|body_0|> def update_value(self, value, now=None): """Computes the updated value for the given ha...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TimeDecay: """TimeDecay class. Helps to update counters that require a time decay""" def __init__(self, decay_time, decay_factor=2.0): """decay_time is timedelta""" if decay_time <= datetime.timedelta(0): raise ValueError('decay_time must have positive duration') self....
the_stack_v2_python_sparse
pylib/util/time_decay.py
room77/py77
train
0
6d9edcf9b1f284086145d9c9b78943b0aca8dbe8
[ "if last_state is not None and last_state.state is not None:\n if last_state.state == STATE_ON:\n self._attr_is_on = True\n elif last_state.state == STATE_OFF:\n self._attr_is_on = False\n elif last_state.state == STATE_UNAVAILABLE:\n self._attr_available = False", "new_state = None\...
<|body_start_0|> if last_state is not None and last_state.state is not None: if last_state.state == STATE_ON: self._attr_is_on = True elif last_state.state == STATE_OFF: self._attr_is_on = False elif last_state.state == STATE_UNAVAILABLE: ...
Class for SIA Binary Sensors.
SIABinarySensor
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SIABinarySensor: """Class for SIA Binary Sensors.""" def handle_last_state(self, last_state: State | None) -> None: """Handle the last state.""" <|body_0|> def update_state(self, sia_event: SIAEvent) -> bool: """Update the state of the binary sensor. Return True ...
stack_v2_sparse_classes_10k_train_008951
4,615
permissive
[ { "docstring": "Handle the last state.", "name": "handle_last_state", "signature": "def handle_last_state(self, last_state: State | None) -> None" }, { "docstring": "Update the state of the binary sensor. Return True if the event was relevant for this entity.", "name": "update_state", "s...
2
null
Implement the Python class `SIABinarySensor` described below. Class description: Class for SIA Binary Sensors. Method signatures and docstrings: - def handle_last_state(self, last_state: State | None) -> None: Handle the last state. - def update_state(self, sia_event: SIAEvent) -> bool: Update the state of the binary...
Implement the Python class `SIABinarySensor` described below. Class description: Class for SIA Binary Sensors. Method signatures and docstrings: - def handle_last_state(self, last_state: State | None) -> None: Handle the last state. - def update_state(self, sia_event: SIAEvent) -> bool: Update the state of the binary...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class SIABinarySensor: """Class for SIA Binary Sensors.""" def handle_last_state(self, last_state: State | None) -> None: """Handle the last state.""" <|body_0|> def update_state(self, sia_event: SIAEvent) -> bool: """Update the state of the binary sensor. Return True ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SIABinarySensor: """Class for SIA Binary Sensors.""" def handle_last_state(self, last_state: State | None) -> None: """Handle the last state.""" if last_state is not None and last_state.state is not None: if last_state.state == STATE_ON: self._attr_is_on = True...
the_stack_v2_python_sparse
homeassistant/components/sia/binary_sensor.py
home-assistant/core
train
35,501
284d223fc8b651d190bd014dfcfafc922ef7c9b7
[ "hs = set()\nq = []\nq.append(root)\nwhile q:\n sz = len(q)\n for i in range(sz):\n cur = q.pop(0)\n if k - cur.val in hs:\n return True\n hs.add(cur.val)\n if cur.left:\n q.append(cur.left)\n if cur.right:\n q.append(cur.right)\nreturn False...
<|body_start_0|> hs = set() q = [] q.append(root) while q: sz = len(q) for i in range(sz): cur = q.pop(0) if k - cur.val in hs: return True hs.add(cur.val) if cur.left: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findTarget(self, root, k): """:type root: TreeNode :type k: int :rtype: bool BFS+HashSet""" <|body_0|> def findTarget1(self, root, k): """:type root: TreeNode :type k: int :rtype: bool 先中序遍历,再双指针""" <|body_1|> <|end_skeleton|> <|body_start_0|>...
stack_v2_sparse_classes_10k_train_008952
1,886
no_license
[ { "docstring": ":type root: TreeNode :type k: int :rtype: bool BFS+HashSet", "name": "findTarget", "signature": "def findTarget(self, root, k)" }, { "docstring": ":type root: TreeNode :type k: int :rtype: bool 先中序遍历,再双指针", "name": "findTarget1", "signature": "def findTarget1(self, root, ...
2
stack_v2_sparse_classes_30k_train_003583
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findTarget(self, root, k): :type root: TreeNode :type k: int :rtype: bool BFS+HashSet - def findTarget1(self, root, k): :type root: TreeNode :type k: int :rtype: bool 先中序遍历,再...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findTarget(self, root, k): :type root: TreeNode :type k: int :rtype: bool BFS+HashSet - def findTarget1(self, root, k): :type root: TreeNode :type k: int :rtype: bool 先中序遍历,再...
6e18c5d257840489cc3fb1079ae3804c743982a4
<|skeleton|> class Solution: def findTarget(self, root, k): """:type root: TreeNode :type k: int :rtype: bool BFS+HashSet""" <|body_0|> def findTarget1(self, root, k): """:type root: TreeNode :type k: int :rtype: bool 先中序遍历,再双指针""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def findTarget(self, root, k): """:type root: TreeNode :type k: int :rtype: bool BFS+HashSet""" hs = set() q = [] q.append(root) while q: sz = len(q) for i in range(sz): cur = q.pop(0) if k - cur.val in h...
the_stack_v2_python_sparse
out/production/leetcode/653.两数之和-iv-输入-bst.py
yangyuxiang1996/leetcode
train
0
83c0b70fcf56401f49bfb8cc4801d338245a861e
[ "collaboration = db.Collaboration.get(id)\nif not collaboration:\n return ({'msg': 'collaboration having collaboration_id={} can not be found'.format(id)}, HTTPStatus.NOT_FOUND)\norg_schema = OrganizationSchema()\nreturn (org_schema.dump(collaboration.organizations, many=True).data, HTTPStatus.OK)", "collabora...
<|body_start_0|> collaboration = db.Collaboration.get(id) if not collaboration: return ({'msg': 'collaboration having collaboration_id={} can not be found'.format(id)}, HTTPStatus.NOT_FOUND) org_schema = OrganizationSchema() return (org_schema.dump(collaboration.organizations...
Resource for /api/collaboration/<int:id>/organization.
CollaborationOrganization
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CollaborationOrganization: """Resource for /api/collaboration/<int:id>/organization.""" def get(self, id): """Return organizations for a specific collaboration.""" <|body_0|> def post(self, id): """Add an organizations to a specific collaboration.""" <|bo...
stack_v2_sparse_classes_10k_train_008953
14,133
permissive
[ { "docstring": "Return organizations for a specific collaboration.", "name": "get", "signature": "def get(self, id)" }, { "docstring": "Add an organizations to a specific collaboration.", "name": "post", "signature": "def post(self, id)" }, { "docstring": "Removes an organization...
3
stack_v2_sparse_classes_30k_train_000149
Implement the Python class `CollaborationOrganization` described below. Class description: Resource for /api/collaboration/<int:id>/organization. Method signatures and docstrings: - def get(self, id): Return organizations for a specific collaboration. - def post(self, id): Add an organizations to a specific collabora...
Implement the Python class `CollaborationOrganization` described below. Class description: Resource for /api/collaboration/<int:id>/organization. Method signatures and docstrings: - def get(self, id): Return organizations for a specific collaboration. - def post(self, id): Add an organizations to a specific collabora...
a64827981db26b34dd1dcea1cb2282d03dd4545d
<|skeleton|> class CollaborationOrganization: """Resource for /api/collaboration/<int:id>/organization.""" def get(self, id): """Return organizations for a specific collaboration.""" <|body_0|> def post(self, id): """Add an organizations to a specific collaboration.""" <|bo...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class CollaborationOrganization: """Resource for /api/collaboration/<int:id>/organization.""" def get(self, id): """Return organizations for a specific collaboration.""" collaboration = db.Collaboration.get(id) if not collaboration: return ({'msg': 'collaboration having coll...
the_stack_v2_python_sparse
vantage6/server/resource/collaboration.py
mindrenee/vantage6-server
train
0
03844b3080cdaff41534beaf3f68ec40f7475a22
[ "super().__init__(name, mode, session, options)\nif options is None:\n options = _DEFAULT_FLOWDRONET_OPTS\nself.ds = dataset\nself.dronet_graph = None\nself.dronet_x_tnsr = None\nself.dronet_y_tnsr = None\nself.dronet_sess = None\nself.set_dronet_graph(options['dronet_model_path'])", "try:\n with tf.gfile.G...
<|body_start_0|> super().__init__(name, mode, session, options) if options is None: options = _DEFAULT_FLOWDRONET_OPTS self.ds = dataset self.dronet_graph = None self.dronet_x_tnsr = None self.dronet_y_tnsr = None self.dronet_sess = None self.s...
ModelFlowDroNet
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ModelFlowDroNet: def __init__(self, name='flowdronet', mode='train', session=None, options=None, dataset=None): """Initialize the ModelFloDroNet object Args: name: Model name mode: Possible values: 'train', 'val', 'test' session: optional TF session options: see _DEFAULT_PWCNET_TRAIN_OPT...
stack_v2_sparse_classes_10k_train_008954
9,033
permissive
[ { "docstring": "Initialize the ModelFloDroNet object Args: name: Model name mode: Possible values: 'train', 'val', 'test' session: optional TF session options: see _DEFAULT_PWCNET_TRAIN_OPTIONS comments dataset: Dataset loader Training Ref: See original PWC-Net Model", "name": "__init__", "signature": "...
3
stack_v2_sparse_classes_30k_train_002474
Implement the Python class `ModelFlowDroNet` described below. Class description: Implement the ModelFlowDroNet class. Method signatures and docstrings: - def __init__(self, name='flowdronet', mode='train', session=None, options=None, dataset=None): Initialize the ModelFloDroNet object Args: name: Model name mode: Pos...
Implement the Python class `ModelFlowDroNet` described below. Class description: Implement the ModelFlowDroNet class. Method signatures and docstrings: - def __init__(self, name='flowdronet', mode='train', session=None, options=None, dataset=None): Initialize the ModelFloDroNet object Args: name: Model name mode: Pos...
a2281a37b4cc6482eb87546fa414fdaa38ec04e5
<|skeleton|> class ModelFlowDroNet: def __init__(self, name='flowdronet', mode='train', session=None, options=None, dataset=None): """Initialize the ModelFloDroNet object Args: name: Model name mode: Possible values: 'train', 'val', 'test' session: optional TF session options: see _DEFAULT_PWCNET_TRAIN_OPT...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ModelFlowDroNet: def __init__(self, name='flowdronet', mode='train', session=None, options=None, dataset=None): """Initialize the ModelFloDroNet object Args: name: Model name mode: Possible values: 'train', 'val', 'test' session: optional TF session options: see _DEFAULT_PWCNET_TRAIN_OPTIONS comments ...
the_stack_v2_python_sparse
DroNeTello/tfoptflow/tfoptflow/model_flowdronet.py
MISTLab/of-obstacledetection
train
13
6479c06810459e14a4eccaebfa64d5cafab14b76
[ "prev_min = prev_max = global_max = nums[0]\nfor num in nums[1:]:\n minn, maxx = (min(num, prev_max * num, prev_min * num), max(num, prev_max * num, prev_min * num))\n prev_min, prev_max, global_max = (minn, maxx, max(global_max, maxx))\nreturn global_max", "front_max = front_min = global_max = nums[0]\nfor...
<|body_start_0|> prev_min = prev_max = global_max = nums[0] for num in nums[1:]: minn, maxx = (min(num, prev_max * num, prev_min * num), max(num, prev_max * num, prev_min * num)) prev_min, prev_max, global_max = (minn, maxx, max(global_max, maxx)) return global_max <|end_...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProduct(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def maxProduct_1(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def maxProduct_2(self, nums): """:type nums: List[int] :rtype: int""" ...
stack_v2_sparse_classes_10k_train_008955
3,237
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "maxProduct", "signature": "def maxProduct(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "maxProduct_1", "signature": "def maxProduct_1(self, nums)" }, { "docstring": ":type nums: List[int] ...
4
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProduct(self, nums): :type nums: List[int] :rtype: int - def maxProduct_1(self, nums): :type nums: List[int] :rtype: int - def maxProduct_2(self, nums): :type nums: List[i...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProduct(self, nums): :type nums: List[int] :rtype: int - def maxProduct_1(self, nums): :type nums: List[int] :rtype: int - def maxProduct_2(self, nums): :type nums: List[i...
3d9e0ad2f6ed92ec969556f75d97c51ea4854719
<|skeleton|> class Solution: def maxProduct(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def maxProduct_1(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def maxProduct_2(self, nums): """:type nums: List[int] :rtype: int""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def maxProduct(self, nums): """:type nums: List[int] :rtype: int""" prev_min = prev_max = global_max = nums[0] for num in nums[1:]: minn, maxx = (min(num, prev_max * num, prev_min * num), max(num, prev_max * num, prev_min * num)) prev_min, prev_max, gl...
the_stack_v2_python_sparse
Solutions/0152_maxProduct.py
YoupengLi/leetcode-sorting
train
3
8fb19d8590fe4071c00fc36b6ce2f053654701ce
[ "empty = UniqueKeyFunction.FLAG_EMPTY_REGISTER\ncollision = UniqueKeyFunction.FLAG_COLLIDED_REGISTER\nif x == empty and y == empty:\n return empty\nif x == collision or y == collision:\n return collision\nif x == empty:\n return y\nif y == empty:\n return x\nif x == y:\n return x\nreturn collision", ...
<|body_start_0|> empty = UniqueKeyFunction.FLAG_EMPTY_REGISTER collision = UniqueKeyFunction.FLAG_COLLIDED_REGISTER if x == empty and y == empty: return empty if x == collision or y == collision: return collision if x == empty: return y ...
ValueFunction to track the state of unique key of a register.
UniqueKeyFunction
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UniqueKeyFunction: """ValueFunction to track the state of unique key of a register.""" def __call__(self, x, y): """ValueFunction to track the state of unique key of a register. Args: x: A state of unique key. It can be either a real key (hashed ID) indicating the unique key in the r...
stack_v2_sparse_classes_10k_train_008956
13,872
permissive
[ { "docstring": "ValueFunction to track the state of unique key of a register. Args: x: A state of unique key. It can be either a real key (hashed ID) indicating the unique key in the register, or FLAG_EMPTY_REGISTER indicating that the register is empty, or FLAG_COLLIDED_REGISTER indicating that the register al...
2
stack_v2_sparse_classes_30k_train_003791
Implement the Python class `UniqueKeyFunction` described below. Class description: ValueFunction to track the state of unique key of a register. Method signatures and docstrings: - def __call__(self, x, y): ValueFunction to track the state of unique key of a register. Args: x: A state of unique key. It can be either ...
Implement the Python class `UniqueKeyFunction` described below. Class description: ValueFunction to track the state of unique key of a register. Method signatures and docstrings: - def __call__(self, x, y): ValueFunction to track the state of unique key of a register. Args: x: A state of unique key. It can be either ...
1727e9545a8f219b543c1b67da6b6653e36d931e
<|skeleton|> class UniqueKeyFunction: """ValueFunction to track the state of unique key of a register.""" def __call__(self, x, y): """ValueFunction to track the state of unique key of a register. Args: x: A state of unique key. It can be either a real key (hashed ID) indicating the unique key in the r...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class UniqueKeyFunction: """ValueFunction to track the state of unique key of a register.""" def __call__(self, x, y): """ValueFunction to track the state of unique key of a register. Args: x: A state of unique key. It can be either a real key (hashed ID) indicating the unique key in the register, or F...
the_stack_v2_python_sparse
src/estimators/any_sketch.py
world-federation-of-advertisers/cardinality_estimation_evaluation_framework
train
21
7fa1f11e0ed3ad74d66fb62d86a4720ed925e146
[ "bad_lines = []\nif not content:\n raise SkipComponent('Empty content.')\nif len(content) < 5:\n raise ParseException(\"Wrong content in table: '{0}'.\".format(content))\ndata = {}\nfor _l in content[3:-1]:\n l = _l.strip()\n if not (l.startswith('|') and l.endswith('|')):\n bad_lines.append(_l)\...
<|body_start_0|> bad_lines = [] if not content: raise SkipComponent('Empty content.') if len(content) < 5: raise ParseException("Wrong content in table: '{0}'.".format(content)) data = {} for _l in content[3:-1]: l = _l.strip() if n...
The output of command ``/bin/mysqladmin variables`` is in mysql table format, contains 'Variable_name' and 'Value' two columns. This parser will parse the table and set each variable as an class attribute. The unparsable lines are stored in the ``bad_lines`` property list. Example: >>> output.get('version') '5.5.56-Mar...
MysqladminVars
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MysqladminVars: """The output of command ``/bin/mysqladmin variables`` is in mysql table format, contains 'Variable_name' and 'Value' two columns. This parser will parse the table and set each variable as an class attribute. The unparsable lines are stored in the ``bad_lines`` property list. Exam...
stack_v2_sparse_classes_10k_train_008957
4,351
permissive
[ { "docstring": "Parse output content table of command ``/bin/mysqladmin variables``. Set each variable as an class attribute.", "name": "parse_content", "signature": "def parse_content(self, content)" }, { "docstring": "Get value for specified keyword, use default if keyword not found. Example: ...
2
null
Implement the Python class `MysqladminVars` described below. Class description: The output of command ``/bin/mysqladmin variables`` is in mysql table format, contains 'Variable_name' and 'Value' two columns. This parser will parse the table and set each variable as an class attribute. The unparsable lines are stored i...
Implement the Python class `MysqladminVars` described below. Class description: The output of command ``/bin/mysqladmin variables`` is in mysql table format, contains 'Variable_name' and 'Value' two columns. This parser will parse the table and set each variable as an class attribute. The unparsable lines are stored i...
b0ea07fc3f4dd8801b505fe70e9b36e628152c4a
<|skeleton|> class MysqladminVars: """The output of command ``/bin/mysqladmin variables`` is in mysql table format, contains 'Variable_name' and 'Value' two columns. This parser will parse the table and set each variable as an class attribute. The unparsable lines are stored in the ``bad_lines`` property list. Exam...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MysqladminVars: """The output of command ``/bin/mysqladmin variables`` is in mysql table format, contains 'Variable_name' and 'Value' two columns. This parser will parse the table and set each variable as an class attribute. The unparsable lines are stored in the ``bad_lines`` property list. Example: >>> outp...
the_stack_v2_python_sparse
insights/parsers/mysqladmin.py
RedHatInsights/insights-core
train
144
74e3565f82b2a7eb54cdf3d676b33f0c4d62fc49
[ "self.screen_width = 1200\nself.screen_height = 800\nself.bg_color = (230, 230, 230)\nself.ship_limit = 3\nself.bullet_width = 10\nself.bullet_height = 15\nself.bullet_color = (60, 60, 60)\nself.bullets_allowed = 6\nself.fleet_drop_speed = 20\nself.speedup_scale = 1.1\nself.score_scale = 1.5\nself.initialize_dynami...
<|body_start_0|> self.screen_width = 1200 self.screen_height = 800 self.bg_color = (230, 230, 230) self.ship_limit = 3 self.bullet_width = 10 self.bullet_height = 15 self.bullet_color = (60, 60, 60) self.bullets_allowed = 6 self.fleet_drop_speed = ...
存储《外星人入侵》的所有设置的类
Settings
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Settings: """存储《外星人入侵》的所有设置的类""" def __init__(self): """初始化游戏的静态设置""" <|body_0|> def initialize_dynamic_settings(self): """初始化随着游戏进行而变化的设置""" <|body_1|> def increase_speed(self): """提高速度设置""" <|body_2|> <|end_skeleton|> <|body_start...
stack_v2_sparse_classes_10k_train_008958
1,704
no_license
[ { "docstring": "初始化游戏的静态设置", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "初始化随着游戏进行而变化的设置", "name": "initialize_dynamic_settings", "signature": "def initialize_dynamic_settings(self)" }, { "docstring": "提高速度设置", "name": "increase_speed", "signa...
3
stack_v2_sparse_classes_30k_train_006756
Implement the Python class `Settings` described below. Class description: 存储《外星人入侵》的所有设置的类 Method signatures and docstrings: - def __init__(self): 初始化游戏的静态设置 - def initialize_dynamic_settings(self): 初始化随着游戏进行而变化的设置 - def increase_speed(self): 提高速度设置
Implement the Python class `Settings` described below. Class description: 存储《外星人入侵》的所有设置的类 Method signatures and docstrings: - def __init__(self): 初始化游戏的静态设置 - def initialize_dynamic_settings(self): 初始化随着游戏进行而变化的设置 - def increase_speed(self): 提高速度设置 <|skeleton|> class Settings: """存储《外星人入侵》的所有设置的类""" def __...
61e92d51227962d361123109d5d4a2b460175069
<|skeleton|> class Settings: """存储《外星人入侵》的所有设置的类""" def __init__(self): """初始化游戏的静态设置""" <|body_0|> def initialize_dynamic_settings(self): """初始化随着游戏进行而变化的设置""" <|body_1|> def increase_speed(self): """提高速度设置""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Settings: """存储《外星人入侵》的所有设置的类""" def __init__(self): """初始化游戏的静态设置""" self.screen_width = 1200 self.screen_height = 800 self.bg_color = (230, 230, 230) self.ship_limit = 3 self.bullet_width = 10 self.bullet_height = 15 self.bullet_color = (6...
the_stack_v2_python_sparse
aliens/settings.py
yangrencong/pythonstudy
train
0
d834cc82efc874f4528b3cff0f219f67b7e376a3
[ "cur = 60 * int(time[:2]) + int(time[3:])\nallowed = {int(x) for x in time if x != ':'}\nwhile True:\n cur = (cur + 1) % (24 * 60)\n if all((digit in allowed for block in divmod(cur, 60) for digit in divmod(block, 10))):\n return '{:02d}:{:02d}'.format(*divmod(cur, 60))", "ans = start = 60 * int(time...
<|body_start_0|> cur = 60 * int(time[:2]) + int(time[3:]) allowed = {int(x) for x in time if x != ':'} while True: cur = (cur + 1) % (24 * 60) if all((digit in allowed for block in divmod(cur, 60) for digit in divmod(block, 10))): return '{:02d}:{:02d}'.fo...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def nextClosestTime(self, time): """Approach #1: Simulation [Accepted] Intuition and Algorithm Simulate the clock going forward by one minute. Each time it moves forward, if all the digits are allowed, then return the current time. The natural way to represent the time is as an...
stack_v2_sparse_classes_10k_train_008959
3,527
no_license
[ { "docstring": "Approach #1: Simulation [Accepted] Intuition and Algorithm Simulate the clock going forward by one minute. Each time it moves forward, if all the digits are allowed, then return the current time. The natural way to represent the time is as an integer t in the range 0 <= t < 24 * 60. Then the hou...
2
stack_v2_sparse_classes_30k_train_000104
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def nextClosestTime(self, time): Approach #1: Simulation [Accepted] Intuition and Algorithm Simulate the clock going forward by one minute. Each time it moves forward, if all the...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def nextClosestTime(self, time): Approach #1: Simulation [Accepted] Intuition and Algorithm Simulate the clock going forward by one minute. Each time it moves forward, if all the...
11d6bf2ba7b50c07e048df37c4e05c8f46b92241
<|skeleton|> class Solution: def nextClosestTime(self, time): """Approach #1: Simulation [Accepted] Intuition and Algorithm Simulate the clock going forward by one minute. Each time it moves forward, if all the digits are allowed, then return the current time. The natural way to represent the time is as an...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def nextClosestTime(self, time): """Approach #1: Simulation [Accepted] Intuition and Algorithm Simulate the clock going forward by one minute. Each time it moves forward, if all the digits are allowed, then return the current time. The natural way to represent the time is as an integer t in ...
the_stack_v2_python_sparse
LeetCodes/Google/NextClosestTime.py
chutianwen/LeetCodes
train
0
5e03adcad67aef73b6801d5bf8aad51652f4b4eb
[ "n = logits.shape[-1]\nbin1, bin2, w2 = self._calc_bin(logits, target)\nw = F.one_hot(bin1, num_classes=n).to(logits.dtype)\nw = 1 - w.cumsum(dim=-1)\nB = _get_indexer(target.shape)\nw[B + (bin2,)] = w2\nw[B + (bin1,)] = 1\ncross_entropy = F.binary_cross_entropy_with_logits(logits, w, reduction='none')\nkld = cross...
<|body_start_0|> n = logits.shape[-1] bin1, bin2, w2 = self._calc_bin(logits, target) w = F.one_hot(bin1, num_classes=n).to(logits.dtype) w = 1 - w.cumsum(dim=-1) B = _get_indexer(target.shape) w[B + (bin2,)] = w2 w[B + (bin1,)] = 1 cross_entropy = F.binar...
A loss for predicting the distribution of a scalar. The target is assumed to be in the range ``[-(n-1)//2, n//2]``, where ``n=logits.shape[-1]``. The logits are used to calculate the probabilities of being greater than or equal to each of these ``n`` values. If a target value y is not an integer, it is treated as havin...
OrderedDiscreteRegressionLoss
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OrderedDiscreteRegressionLoss: """A loss for predicting the distribution of a scalar. The target is assumed to be in the range ``[-(n-1)//2, n//2]``, where ``n=logits.shape[-1]``. The logits are used to calculate the probabilities of being greater than or equal to each of these ``n`` values. If a...
stack_v2_sparse_classes_10k_train_008960
31,133
permissive
[ { "docstring": "Caculate the loss. Args: logits: shape is [B, n] target: the shape is [B] Returns: loss with the same shape as target", "name": "__call__", "signature": "def __call__(self, logits: torch.Tensor, target: torch.Tensor)" }, { "docstring": "Calculate the expected predition in the unt...
3
stack_v2_sparse_classes_30k_train_000794
Implement the Python class `OrderedDiscreteRegressionLoss` described below. Class description: A loss for predicting the distribution of a scalar. The target is assumed to be in the range ``[-(n-1)//2, n//2]``, where ``n=logits.shape[-1]``. The logits are used to calculate the probabilities of being greater than or eq...
Implement the Python class `OrderedDiscreteRegressionLoss` described below. Class description: A loss for predicting the distribution of a scalar. The target is assumed to be in the range ``[-(n-1)//2, n//2]``, where ``n=logits.shape[-1]``. The logits are used to calculate the probabilities of being greater than or eq...
b00ff2fa5e660de31020338ba340263183fbeaa4
<|skeleton|> class OrderedDiscreteRegressionLoss: """A loss for predicting the distribution of a scalar. The target is assumed to be in the range ``[-(n-1)//2, n//2]``, where ``n=logits.shape[-1]``. The logits are used to calculate the probabilities of being greater than or equal to each of these ``n`` values. If a...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class OrderedDiscreteRegressionLoss: """A loss for predicting the distribution of a scalar. The target is assumed to be in the range ``[-(n-1)//2, n//2]``, where ``n=logits.shape[-1]``. The logits are used to calculate the probabilities of being greater than or equal to each of these ``n`` values. If a target value...
the_stack_v2_python_sparse
alf/utils/losses.py
HorizonRobotics/alf
train
288
3741bf53a69284f089f7a83e209b33de91b3751f
[ "event = cls.objects.create(event_type=event_type, **kwargs)\nif inventory_changes:\n event._process_by_event_type(inventory_changes)\nreturn event", "processes = EVENT_TYPE_PROCESS[self.event_type]\nfor process in processes:\n for inventorychange in inventory_changes:\n product_id = inventorychange....
<|body_start_0|> event = cls.objects.create(event_type=event_type, **kwargs) if inventory_changes: event._process_by_event_type(inventory_changes) return event <|end_body_0|> <|body_start_1|> processes = EVENT_TYPE_PROCESS[self.event_type] for process in processes: ...
EventMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EventMixin: def create_instance(cls, event_type, inventory_changes=None, **kwargs): """이벤트 인스턴스 생성""" <|body_0|> def _process_by_event_type(self, inventory_changes) -> None: """이벤트타입에 따른 재고 처리""" <|body_1|> <|end_skeleton|> <|body_start_0|> event = ...
stack_v2_sparse_classes_10k_train_008961
2,069
no_license
[ { "docstring": "이벤트 인스턴스 생성", "name": "create_instance", "signature": "def create_instance(cls, event_type, inventory_changes=None, **kwargs)" }, { "docstring": "이벤트타입에 따른 재고 처리", "name": "_process_by_event_type", "signature": "def _process_by_event_type(self, inventory_changes) -> None"...
2
stack_v2_sparse_classes_30k_train_001217
Implement the Python class `EventMixin` described below. Class description: Implement the EventMixin class. Method signatures and docstrings: - def create_instance(cls, event_type, inventory_changes=None, **kwargs): 이벤트 인스턴스 생성 - def _process_by_event_type(self, inventory_changes) -> None: 이벤트타입에 따른 재고 처리
Implement the Python class `EventMixin` described below. Class description: Implement the EventMixin class. Method signatures and docstrings: - def create_instance(cls, event_type, inventory_changes=None, **kwargs): 이벤트 인스턴스 생성 - def _process_by_event_type(self, inventory_changes) -> None: 이벤트타입에 따른 재고 처리 <|skeleton...
7b994f34837cf7c9f3e87684ddbf9aa61bee64f5
<|skeleton|> class EventMixin: def create_instance(cls, event_type, inventory_changes=None, **kwargs): """이벤트 인스턴스 생성""" <|body_0|> def _process_by_event_type(self, inventory_changes) -> None: """이벤트타입에 따른 재고 처리""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class EventMixin: def create_instance(cls, event_type, inventory_changes=None, **kwargs): """이벤트 인스턴스 생성""" event = cls.objects.create(event_type=event_type, **kwargs) if inventory_changes: event._process_by_event_type(inventory_changes) return event def _process_by_...
the_stack_v2_python_sparse
server/events/mixins/model_mixins.py
jinimong/inventory-manager
train
0
037d5658e5e85f09b18e9b0cab84902de5aed6fe
[ "super().__init__()\nself.fft_size = fft_size\nif win_length is None:\n self.win_length = fft_size\nelse:\n self.win_length = win_length\nself.hop_size = hop_size\nself.center = center\nself.normalized = normalized\nself.onesided = onesided\nif window is not None and (not hasattr(signal.windows, f'{window}'))...
<|body_start_0|> super().__init__() self.fft_size = fft_size if win_length is None: self.win_length = fft_size else: self.win_length = win_length self.hop_size = hop_size self.center = center self.normalized = normalized self.onesid...
Calculate Mel-spectrogram.
MelSpectrogram
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MelSpectrogram: """Calculate Mel-spectrogram.""" def __init__(self, fs=22050, fft_size=1024, hop_size=256, win_length=None, window='hann', num_mels=80, fmin=80, fmax=7600, center=True, normalized=False, onesided=True, eps=1e-10, log_base=10.0): """Initialize MelSpectrogram module."""...
stack_v2_sparse_classes_10k_train_008962
46,210
permissive
[ { "docstring": "Initialize MelSpectrogram module.", "name": "__init__", "signature": "def __init__(self, fs=22050, fft_size=1024, hop_size=256, win_length=None, window='hann', num_mels=80, fmin=80, fmax=7600, center=True, normalized=False, onesided=True, eps=1e-10, log_base=10.0)" }, { "docstrin...
2
stack_v2_sparse_classes_30k_train_000554
Implement the Python class `MelSpectrogram` described below. Class description: Calculate Mel-spectrogram. Method signatures and docstrings: - def __init__(self, fs=22050, fft_size=1024, hop_size=256, win_length=None, window='hann', num_mels=80, fmin=80, fmax=7600, center=True, normalized=False, onesided=True, eps=1e...
Implement the Python class `MelSpectrogram` described below. Class description: Calculate Mel-spectrogram. Method signatures and docstrings: - def __init__(self, fs=22050, fft_size=1024, hop_size=256, win_length=None, window='hann', num_mels=80, fmin=80, fmax=7600, center=True, normalized=False, onesided=True, eps=1e...
17854a04d43c231eff66bfed9d6aa55e94a29e79
<|skeleton|> class MelSpectrogram: """Calculate Mel-spectrogram.""" def __init__(self, fs=22050, fft_size=1024, hop_size=256, win_length=None, window='hann', num_mels=80, fmin=80, fmax=7600, center=True, normalized=False, onesided=True, eps=1e-10, log_base=10.0): """Initialize MelSpectrogram module."""...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MelSpectrogram: """Calculate Mel-spectrogram.""" def __init__(self, fs=22050, fft_size=1024, hop_size=256, win_length=None, window='hann', num_mels=80, fmin=80, fmax=7600, center=True, normalized=False, onesided=True, eps=1e-10, log_base=10.0): """Initialize MelSpectrogram module.""" supe...
the_stack_v2_python_sparse
paddlespeech/t2s/modules/losses.py
anniyanvr/DeepSpeech-1
train
0
092bdb9a602ae0f2f00413fa5729592b6f90b7ca
[ "prop = typeFor(ref)\nif not isinstance(prop, TypeProperty):\n return False\nassert isinstance(prop, TypeProperty)\nassert isinstance(prop.parent, TypeContainer), 'Invalid parent for %s' % prop\nif prop.parent.isValid(self):\n descriptor, _clazz = getAttrAndClass(self.__class__, prop.name)\n if not isinsta...
<|body_start_0|> prop = typeFor(ref) if not isinstance(prop, TypeProperty): return False assert isinstance(prop, TypeProperty) assert isinstance(prop.parent, TypeContainer), 'Invalid parent for %s' % prop if prop.parent.isValid(self): descriptor, _clazz = ...
Support class for containers.
Container
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Container: """Support class for containers.""" def __contains__(self, ref): """Checks if the object contains a value for the property even if that value is None. @param ref: TypeProperty reference The type property to check. @return: boolean True if a value for the reference is prese...
stack_v2_sparse_classes_10k_train_008963
16,647
no_license
[ { "docstring": "Checks if the object contains a value for the property even if that value is None. @param ref: TypeProperty reference The type property to check. @return: boolean True if a value for the reference is present, false otherwise.", "name": "__contains__", "signature": "def __contains__(self,...
2
null
Implement the Python class `Container` described below. Class description: Support class for containers. Method signatures and docstrings: - def __contains__(self, ref): Checks if the object contains a value for the property even if that value is None. @param ref: TypeProperty reference The type property to check. @r...
Implement the Python class `Container` described below. Class description: Support class for containers. Method signatures and docstrings: - def __contains__(self, ref): Checks if the object contains a value for the property even if that value is None. @param ref: TypeProperty reference The type property to check. @r...
e0b3466b34d31548996d57be4a9dac134d904380
<|skeleton|> class Container: """Support class for containers.""" def __contains__(self, ref): """Checks if the object contains a value for the property even if that value is None. @param ref: TypeProperty reference The type property to check. @return: boolean True if a value for the reference is prese...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Container: """Support class for containers.""" def __contains__(self, ref): """Checks if the object contains a value for the property even if that value is None. @param ref: TypeProperty reference The type property to check. @return: boolean True if a value for the reference is present, false oth...
the_stack_v2_python_sparse
components/ally-api/ally/api/operator/descriptor.py
cristidomsa/Ally-Py
train
0
44555fba81f56524330a9195180a06f99ea1b950
[ "self.title = 'Convert Miles to KM Program'\nself.root = Builder.load_file('convert_miles_km.kv')\nreturn self.root", "miles = self.get_valid_miles()\nkm = miles * MILES_TO_KM\nself.root.ids.km_output.text = str(km)", "new_miles = self.get_valid_miles() + increment\nself.root.ids.miles_input.text = str(new_mile...
<|body_start_0|> self.title = 'Convert Miles to KM Program' self.root = Builder.load_file('convert_miles_km.kv') return self.root <|end_body_0|> <|body_start_1|> miles = self.get_valid_miles() km = miles * MILES_TO_KM self.root.ids.km_output.text = str(km) <|end_body_1|>...
ConvertMilesToKMProgram is a KIVY GUI program for converting miles to km.
ConvertMilesToKMProgram
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConvertMilesToKMProgram: """ConvertMilesToKMProgram is a KIVY GUI program for converting miles to km.""" def build(self): """Build app using Kivy app from kv file""" <|body_0|> def calculate_miles_to_km(self): """Calculates miles to km and outputs to GUI""" ...
stack_v2_sparse_classes_10k_train_008964
1,212
no_license
[ { "docstring": "Build app using Kivy app from kv file", "name": "build", "signature": "def build(self)" }, { "docstring": "Calculates miles to km and outputs to GUI", "name": "calculate_miles_to_km", "signature": "def calculate_miles_to_km(self)" }, { "docstring": "Handle increme...
4
stack_v2_sparse_classes_30k_train_000962
Implement the Python class `ConvertMilesToKMProgram` described below. Class description: ConvertMilesToKMProgram is a KIVY GUI program for converting miles to km. Method signatures and docstrings: - def build(self): Build app using Kivy app from kv file - def calculate_miles_to_km(self): Calculates miles to km and ou...
Implement the Python class `ConvertMilesToKMProgram` described below. Class description: ConvertMilesToKMProgram is a KIVY GUI program for converting miles to km. Method signatures and docstrings: - def build(self): Build app using Kivy app from kv file - def calculate_miles_to_km(self): Calculates miles to km and ou...
6c47affda245b594e25accdcd04fbf65facd53da
<|skeleton|> class ConvertMilesToKMProgram: """ConvertMilesToKMProgram is a KIVY GUI program for converting miles to km.""" def build(self): """Build app using Kivy app from kv file""" <|body_0|> def calculate_miles_to_km(self): """Calculates miles to km and outputs to GUI""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ConvertMilesToKMProgram: """ConvertMilesToKMProgram is a KIVY GUI program for converting miles to km.""" def build(self): """Build app using Kivy app from kv file""" self.title = 'Convert Miles to KM Program' self.root = Builder.load_file('convert_miles_km.kv') return self...
the_stack_v2_python_sparse
prac_07/convert_miles_km.py
CamA-JCU/cp1404practicals
train
0
4097e81aaba8e4244df1ecf5284b098ff00cd90d
[ "if not root:\n return\ncallback(root.val)\ncls.preorder_traverse(root.left, callback=callback)\ncls.preorder_traverse(root.right, callback=callback)", "if not root:\n return\ncls.inorder_traverse(root.left, callback=callback)\ncallback(root.val)\ncls.inorder_traverse(root.right, callback=callback)", "if ...
<|body_start_0|> if not root: return callback(root.val) cls.preorder_traverse(root.left, callback=callback) cls.preorder_traverse(root.right, callback=callback) <|end_body_0|> <|body_start_1|> if not root: return cls.inorder_traverse(root.left, ca...
RecursiveTraversal
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RecursiveTraversal: def preorder_traverse(cls, root, callback=None): """:type root: TreeNode :type callback: function :rtype: void""" <|body_0|> def inorder_traverse(cls, root, callback=None): """:type root: TreeNode :type callback: function :rtype: void""" <...
stack_v2_sparse_classes_10k_train_008965
1,182
no_license
[ { "docstring": ":type root: TreeNode :type callback: function :rtype: void", "name": "preorder_traverse", "signature": "def preorder_traverse(cls, root, callback=None)" }, { "docstring": ":type root: TreeNode :type callback: function :rtype: void", "name": "inorder_traverse", "signature"...
3
null
Implement the Python class `RecursiveTraversal` described below. Class description: Implement the RecursiveTraversal class. Method signatures and docstrings: - def preorder_traverse(cls, root, callback=None): :type root: TreeNode :type callback: function :rtype: void - def inorder_traverse(cls, root, callback=None): ...
Implement the Python class `RecursiveTraversal` described below. Class description: Implement the RecursiveTraversal class. Method signatures and docstrings: - def preorder_traverse(cls, root, callback=None): :type root: TreeNode :type callback: function :rtype: void - def inorder_traverse(cls, root, callback=None): ...
91892fd64281d96b8a9d5c0d57b938c314ae71be
<|skeleton|> class RecursiveTraversal: def preorder_traverse(cls, root, callback=None): """:type root: TreeNode :type callback: function :rtype: void""" <|body_0|> def inorder_traverse(cls, root, callback=None): """:type root: TreeNode :type callback: function :rtype: void""" <...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class RecursiveTraversal: def preorder_traverse(cls, root, callback=None): """:type root: TreeNode :type callback: function :rtype: void""" if not root: return callback(root.val) cls.preorder_traverse(root.left, callback=callback) cls.preorder_traverse(root.right,...
the_stack_v2_python_sparse
topic/traversal/python/recursive_traversal.py
jaychsu/algorithm
train
143
2d0291479ba802c4944a356d7d2b12936a30165a
[ "if not isinstance(gate, Gate):\n raise TypeError('Expected gate object, got %s' % type(gate))\nself.gate = gate\nself.tag = tag\nself.name = 'Tagged(%s:%s)' % (gate.get_name(), tag)\nself.num_params = gate.get_num_params()\nself.size = gate.get_size()\nself.radixes = gate.get_radixes()\nif self.num_params == 0:...
<|body_start_0|> if not isinstance(gate, Gate): raise TypeError('Expected gate object, got %s' % type(gate)) self.gate = gate self.tag = tag self.name = 'Tagged(%s:%s)' % (gate.get_name(), tag) self.num_params = gate.get_num_params() self.size = gate.get_size(...
The TaggedGate Class. Allows a user to place a tag on a gate.
TaggedGate
[ "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TaggedGate: """The TaggedGate Class. Allows a user to place a tag on a gate.""" def __init__(self, gate: Gate, tag: Any) -> None: """Associate `tag` with `gate`.""" <|body_0|> def get_unitary(self, params: Sequence[float]=[]) -> UnitaryMatrix: """Returns the unit...
stack_v2_sparse_classes_10k_train_008966
2,289
permissive
[ { "docstring": "Associate `tag` with `gate`.", "name": "__init__", "signature": "def __init__(self, gate: Gate, tag: Any) -> None" }, { "docstring": "Returns the unitary for this gate, see Unitary for more info.", "name": "get_unitary", "signature": "def get_unitary(self, params: Sequenc...
4
stack_v2_sparse_classes_30k_train_003015
Implement the Python class `TaggedGate` described below. Class description: The TaggedGate Class. Allows a user to place a tag on a gate. Method signatures and docstrings: - def __init__(self, gate: Gate, tag: Any) -> None: Associate `tag` with `gate`. - def get_unitary(self, params: Sequence[float]=[]) -> UnitaryMat...
Implement the Python class `TaggedGate` described below. Class description: The TaggedGate Class. Allows a user to place a tag on a gate. Method signatures and docstrings: - def __init__(self, gate: Gate, tag: Any) -> None: Associate `tag` with `gate`. - def get_unitary(self, params: Sequence[float]=[]) -> UnitaryMat...
3083218c2f4e3c3ce4ba027d12caa30c384d7665
<|skeleton|> class TaggedGate: """The TaggedGate Class. Allows a user to place a tag on a gate.""" def __init__(self, gate: Gate, tag: Any) -> None: """Associate `tag` with `gate`.""" <|body_0|> def get_unitary(self, params: Sequence[float]=[]) -> UnitaryMatrix: """Returns the unit...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TaggedGate: """The TaggedGate Class. Allows a user to place a tag on a gate.""" def __init__(self, gate: Gate, tag: Any) -> None: """Associate `tag` with `gate`.""" if not isinstance(gate, Gate): raise TypeError('Expected gate object, got %s' % type(gate)) self.gate = ...
the_stack_v2_python_sparse
bqskit/ir/gates/composed/tagged.py
mtreinish/bqskit
train
0
41cbcd356e023e3b87e5ea368aab2176b78ce1ff
[ "self.set_status(200)\nself.set_header('Content-Type', 'application/x-mplane+json')\nself.write(mplane.model.unparse_json(msg))\nself.finish()", "self.set_status(code)\nif text is not None:\n self.set_header('Content-Type', 'text/plain')\n self.write(text)\nself.finish()", "self.set_status(code)\nif text ...
<|body_start_0|> self.set_status(200) self.set_header('Content-Type', 'application/x-mplane+json') self.write(mplane.model.unparse_json(msg)) self.finish() <|end_body_0|> <|body_start_1|> self.set_status(code) if text is not None: self.set_header('Content-Typ...
Abstract tornado RequestHandler that allows a handler to respond with an mPlane Message.
MPlaneHandler
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MPlaneHandler: """Abstract tornado RequestHandler that allows a handler to respond with an mPlane Message.""" def _respond_message(self, msg): """Returns an HTTP response containing a JSON message""" <|body_0|> def _respond_plain_text(self, code, text=None): """R...
stack_v2_sparse_classes_10k_train_008967
37,893
no_license
[ { "docstring": "Returns an HTTP response containing a JSON message", "name": "_respond_message", "signature": "def _respond_message(self, msg)" }, { "docstring": "Returns an HTTP response containing a plain text message", "name": "_respond_plain_text", "signature": "def _respond_plain_te...
3
stack_v2_sparse_classes_30k_test_000216
Implement the Python class `MPlaneHandler` described below. Class description: Abstract tornado RequestHandler that allows a handler to respond with an mPlane Message. Method signatures and docstrings: - def _respond_message(self, msg): Returns an HTTP response containing a JSON message - def _respond_plain_text(self...
Implement the Python class `MPlaneHandler` described below. Class description: Abstract tornado RequestHandler that allows a handler to respond with an mPlane Message. Method signatures and docstrings: - def _respond_message(self, msg): Returns an HTTP response containing a JSON message - def _respond_plain_text(self...
25f11a1bb6c0fc6eb95935be2a2afc2fa3be9beb
<|skeleton|> class MPlaneHandler: """Abstract tornado RequestHandler that allows a handler to respond with an mPlane Message.""" def _respond_message(self, msg): """Returns an HTTP response containing a JSON message""" <|body_0|> def _respond_plain_text(self, code, text=None): """R...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MPlaneHandler: """Abstract tornado RequestHandler that allows a handler to respond with an mPlane Message.""" def _respond_message(self, msg): """Returns an HTTP response containing a JSON message""" self.set_status(200) self.set_header('Content-Type', 'application/x-mplane+json')...
the_stack_v2_python_sparse
mplane/client.py
mami-project/mplane-sdk
train
1
aa876ff752c87ba050211cd7def0415b28d91afb
[ "super(MulticastRange, self).__init__()\nself.schema_class = 'vsm_multicast_range_schema.MulticastRangeSchema'\nself.set_connection(vsm.get_connection())\nif scope is None or scope is '':\n self.set_create_endpoint('/vdn/config/multicasts')\nelse:\n self.set_create_endpoint('/vdn/config/multicasts?isUniversal...
<|body_start_0|> super(MulticastRange, self).__init__() self.schema_class = 'vsm_multicast_range_schema.MulticastRangeSchema' self.set_connection(vsm.get_connection()) if scope is None or scope is '': self.set_create_endpoint('/vdn/config/multicasts') else: ...
MulticastRange
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MulticastRange: def __init__(self, vsm=None, scope=None): """Constructor to create MulticastRange managed object @param vsm : vsm object on which this managed object needs to be configured""" <|body_0|> def create(self, schema_object): """Creates multicast range with...
stack_v2_sparse_classes_10k_train_008968
1,989
no_license
[ { "docstring": "Constructor to create MulticastRange managed object @param vsm : vsm object on which this managed object needs to be configured", "name": "__init__", "signature": "def __init__(self, vsm=None, scope=None)" }, { "docstring": "Creates multicast range with specified parameters @para...
2
null
Implement the Python class `MulticastRange` described below. Class description: Implement the MulticastRange class. Method signatures and docstrings: - def __init__(self, vsm=None, scope=None): Constructor to create MulticastRange managed object @param vsm : vsm object on which this managed object needs to be configu...
Implement the Python class `MulticastRange` described below. Class description: Implement the MulticastRange class. Method signatures and docstrings: - def __init__(self, vsm=None, scope=None): Constructor to create MulticastRange managed object @param vsm : vsm object on which this managed object needs to be configu...
5b55817c050b637e2747084290f6206d2e622938
<|skeleton|> class MulticastRange: def __init__(self, vsm=None, scope=None): """Constructor to create MulticastRange managed object @param vsm : vsm object on which this managed object needs to be configured""" <|body_0|> def create(self, schema_object): """Creates multicast range with...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MulticastRange: def __init__(self, vsm=None, scope=None): """Constructor to create MulticastRange managed object @param vsm : vsm object on which this managed object needs to be configured""" super(MulticastRange, self).__init__() self.schema_class = 'vsm_multicast_range_schema.Multica...
the_stack_v2_python_sparse
SystemTesting/pylib/nsx/vsm/multicast_range/vsm_multicast_range.py
Cloudxtreme/MyProject
train
0
b118f558b174ec499dc5d820ac8aaffe6520cc55
[ "self.exploration_vs_exploitation = exploration_vs_exploitation\nself.decomposition_funcs = decomposition_funcs\nself.preprocessors = preprocessors\nself.nbits = nbits\nself.seed = seed\nself.estimators = [SGDRegressor(penalty='elasticnet') for _ in range(n_estimators)]", "coefs = [est.coef_ for est in self.estim...
<|body_start_0|> self.exploration_vs_exploitation = exploration_vs_exploitation self.decomposition_funcs = decomposition_funcs self.preprocessors = preprocessors self.nbits = nbits self.seed = seed self.estimators = [SGDRegressor(penalty='elasticnet') for _ in range(n_est...
ScoreEstimator.
GraphLinearScoreEstimator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GraphLinearScoreEstimator: """ScoreEstimator.""" def __init__(self, n_estimators=100, exploration_vs_exploitation=0, decomposition_funcs=None, preprocessors=None, nbits=14, seed=1): """init.""" <|body_0|> def predict_gradient(self, graphs): """predict_gradient.""...
stack_v2_sparse_classes_10k_train_008969
21,013
permissive
[ { "docstring": "init.", "name": "__init__", "signature": "def __init__(self, n_estimators=100, exploration_vs_exploitation=0, decomposition_funcs=None, preprocessors=None, nbits=14, seed=1)" }, { "docstring": "predict_gradient.", "name": "predict_gradient", "signature": "def predict_grad...
2
stack_v2_sparse_classes_30k_train_002293
Implement the Python class `GraphLinearScoreEstimator` described below. Class description: ScoreEstimator. Method signatures and docstrings: - def __init__(self, n_estimators=100, exploration_vs_exploitation=0, decomposition_funcs=None, preprocessors=None, nbits=14, seed=1): init. - def predict_gradient(self, graphs)...
Implement the Python class `GraphLinearScoreEstimator` described below. Class description: ScoreEstimator. Method signatures and docstrings: - def __init__(self, n_estimators=100, exploration_vs_exploitation=0, decomposition_funcs=None, preprocessors=None, nbits=14, seed=1): init. - def predict_gradient(self, graphs)...
d89e88183cce1ff24dca9333c09fa11597a45c7a
<|skeleton|> class GraphLinearScoreEstimator: """ScoreEstimator.""" def __init__(self, n_estimators=100, exploration_vs_exploitation=0, decomposition_funcs=None, preprocessors=None, nbits=14, seed=1): """init.""" <|body_0|> def predict_gradient(self, graphs): """predict_gradient.""...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class GraphLinearScoreEstimator: """ScoreEstimator.""" def __init__(self, n_estimators=100, exploration_vs_exploitation=0, decomposition_funcs=None, preprocessors=None, nbits=14, seed=1): """init.""" self.exploration_vs_exploitation = exploration_vs_exploitation self.decomposition_funcs...
the_stack_v2_python_sparse
ego/optimization/score_estimator.py
smautner/EGO
train
0
fdb9af6308e60b7f913135329713a002b28acc66
[ "elem = deepcopy(elem)\nyld = elem.find('./YIELD')\nif yld is not None:\n yld.tag = 'YLD'\nreturn super(STOCKINFO, STOCKINFO).groom(elem)", "elem = deepcopy(elem)\nyld = elem.find('./YLD')\nif yld is not None:\n yld.tag = 'YIELD'\nreturn super(STOCKINFO, STOCKINFO).ungroom(elem)" ]
<|body_start_0|> elem = deepcopy(elem) yld = elem.find('./YIELD') if yld is not None: yld.tag = 'YLD' return super(STOCKINFO, STOCKINFO).groom(elem) <|end_body_0|> <|body_start_1|> elem = deepcopy(elem) yld = elem.find('./YLD') if yld is not None: ...
OFX Section 13.8.5.6
STOCKINFO
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class STOCKINFO: """OFX Section 13.8.5.6""" def groom(elem): """Rename all Elements tagged YIELD (reserved Python keyword) to YLD""" <|body_0|> def ungroom(elem): """Rename YLD back to YLD""" <|body_1|> <|end_skeleton|> <|body_start_0|> elem = deepcop...
stack_v2_sparse_classes_10k_train_008970
6,031
no_license
[ { "docstring": "Rename all Elements tagged YIELD (reserved Python keyword) to YLD", "name": "groom", "signature": "def groom(elem)" }, { "docstring": "Rename YLD back to YLD", "name": "ungroom", "signature": "def ungroom(elem)" } ]
2
stack_v2_sparse_classes_30k_train_002773
Implement the Python class `STOCKINFO` described below. Class description: OFX Section 13.8.5.6 Method signatures and docstrings: - def groom(elem): Rename all Elements tagged YIELD (reserved Python keyword) to YLD - def ungroom(elem): Rename YLD back to YLD
Implement the Python class `STOCKINFO` described below. Class description: OFX Section 13.8.5.6 Method signatures and docstrings: - def groom(elem): Rename all Elements tagged YIELD (reserved Python keyword) to YLD - def ungroom(elem): Rename YLD back to YLD <|skeleton|> class STOCKINFO: """OFX Section 13.8.5.6"...
67e688ea6510853657736c3804969d029c672c5c
<|skeleton|> class STOCKINFO: """OFX Section 13.8.5.6""" def groom(elem): """Rename all Elements tagged YIELD (reserved Python keyword) to YLD""" <|body_0|> def ungroom(elem): """Rename YLD back to YLD""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class STOCKINFO: """OFX Section 13.8.5.6""" def groom(elem): """Rename all Elements tagged YIELD (reserved Python keyword) to YLD""" elem = deepcopy(elem) yld = elem.find('./YIELD') if yld is not None: yld.tag = 'YLD' return super(STOCKINFO, STOCKINFO).groom(...
the_stack_v2_python_sparse
env/lib/python3.6/site-packages/ofxtools/models/invest/securities.py
yetaai/batchaccounting
train
0
c9c5dd27228805e6c3b1ec4329574202a657d5de
[ "if 'ServiceRole' in usr_model['Configurations']:\n service_role = usr_model['Configurations']['ServiceRole'].split('/')[-1]\n try:\n get_role(service_role)\n except (NotFoundError, ServiceError):\n raise InvalidOptionsError(strings['lifecycle.invalidrole'].replace('{role}', service_role))\nr...
<|body_start_0|> if 'ServiceRole' in usr_model['Configurations']: service_role = usr_model['Configurations']['ServiceRole'].split('/')[-1] try: get_role(service_role) except (NotFoundError, ServiceError): raise InvalidOptionsError(strings['life...
LifecycleConfiguration
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LifecycleConfiguration: def collect_changes(self, usr_model): """Because we can't remove options from the lifecycle config we can only add to them so we just take the direct user model and apply that. :param usr_model: User model, key-value style :return: api_model""" <|body_0|> ...
stack_v2_sparse_classes_10k_train_008971
3,127
permissive
[ { "docstring": "Because we can't remove options from the lifecycle config we can only add to them so we just take the direct user model and apply that. :param usr_model: User model, key-value style :return: api_model", "name": "collect_changes", "signature": "def collect_changes(self, usr_model)" }, ...
2
stack_v2_sparse_classes_30k_train_005770
Implement the Python class `LifecycleConfiguration` described below. Class description: Implement the LifecycleConfiguration class. Method signatures and docstrings: - def collect_changes(self, usr_model): Because we can't remove options from the lifecycle config we can only add to them so we just take the direct use...
Implement the Python class `LifecycleConfiguration` described below. Class description: Implement the LifecycleConfiguration class. Method signatures and docstrings: - def collect_changes(self, usr_model): Because we can't remove options from the lifecycle config we can only add to them so we just take the direct use...
252101641a7b6acb5de17fafd6adf8b96418426f
<|skeleton|> class LifecycleConfiguration: def collect_changes(self, usr_model): """Because we can't remove options from the lifecycle config we can only add to them so we just take the direct user model and apply that. :param usr_model: User model, key-value style :return: api_model""" <|body_0|> ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LifecycleConfiguration: def collect_changes(self, usr_model): """Because we can't remove options from the lifecycle config we can only add to them so we just take the direct user model and apply that. :param usr_model: User model, key-value style :return: api_model""" if 'ServiceRole' in usr_m...
the_stack_v2_python_sparse
ebcli/objects/lifecycleconfiguration.py
aws/aws-elastic-beanstalk-cli
train
149
856e8bbad431c81045a84fd91c33c105405fff45
[ "if num1 == num2:\n return\nif len(str(num2)) > len(str(num1)):\n return\nnum1_str = str(num1)\nnum1_dict = defaultdict(int)\nnum1_max_digit = float('-inf')\nnum1_min_digit = float('inf')\ni = 0\nwhile i < len(num1_str):\n n1 = int(num1_str[i])\n num1_dict[n1] += 1\n if n1 > num1_max_digit:\n ...
<|body_start_0|> if num1 == num2: return if len(str(num2)) > len(str(num1)): return num1_str = str(num1) num1_dict = defaultdict(int) num1_max_digit = float('-inf') num1_min_digit = float('inf') i = 0 while i < len(num1_str): ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def biggerNum(self, num1, num2): """input num1: num input num2: num return: num num1 = 23888 numDict = { 8: 3, 3: 1, 2: 1 } sortedKeys = [8, 3, 2] 88832""" <|body_0|> def newNum(self, num1_dict, num1_max_digit, num1_min_digit): """input num1_dict: {int: int...
stack_v2_sparse_classes_10k_train_008972
4,728
no_license
[ { "docstring": "input num1: num input num2: num return: num num1 = 23888 numDict = { 8: 3, 3: 1, 2: 1 } sortedKeys = [8, 3, 2] 88832", "name": "biggerNum", "signature": "def biggerNum(self, num1, num2)" }, { "docstring": "input num1_dict: {int: int} input num1_max_digit: int input num1_min_digit...
2
stack_v2_sparse_classes_30k_train_002756
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def biggerNum(self, num1, num2): input num1: num input num2: num return: num num1 = 23888 numDict = { 8: 3, 3: 1, 2: 1 } sortedKeys = [8, 3, 2] 88832 - def newNum(self, num1_dict...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def biggerNum(self, num1, num2): input num1: num input num2: num return: num num1 = 23888 numDict = { 8: 3, 3: 1, 2: 1 } sortedKeys = [8, 3, 2] 88832 - def newNum(self, num1_dict...
bf98c8fa31043a45b3d21cfe78d4e08f9cac9de6
<|skeleton|> class Solution: def biggerNum(self, num1, num2): """input num1: num input num2: num return: num num1 = 23888 numDict = { 8: 3, 3: 1, 2: 1 } sortedKeys = [8, 3, 2] 88832""" <|body_0|> def newNum(self, num1_dict, num1_max_digit, num1_min_digit): """input num1_dict: {int: int...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def biggerNum(self, num1, num2): """input num1: num input num2: num return: num num1 = 23888 numDict = { 8: 3, 3: 1, 2: 1 } sortedKeys = [8, 3, 2] 88832""" if num1 == num2: return if len(str(num2)) > len(str(num1)): return num1_str = str(num1) ...
the_stack_v2_python_sparse
string/create_a_bigger_num.py
mistrydarshan99/Leetcode-3
train
0
7e9daaf777de38f4b168931a6674724a54138ade
[ "self.device = device\nself.layer_output_size = layer_output_size\nself.model_name = model\nself.model, self.extraction_layer = self._get_model_and_layer(model, layer, model_path)\nself.model = self.model.to(self.device)\nself.model.eval()\nself.scaler = transforms.Resize((224, 224))\nself.normalize = transforms.No...
<|body_start_0|> self.device = device self.layer_output_size = layer_output_size self.model_name = model self.model, self.extraction_layer = self._get_model_and_layer(model, layer, model_path) self.model = self.model.to(self.device) self.model.eval() self.scaler =...
Img2Vec
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Img2Vec: def __init__(self, model_path, model='resnet-18', layer='default', layer_output_size=512, device='cuda'): """Img2Vec :param model: String name of requested model :param layer: String or Int depending on model. See more docs: https://github.com/christiansafka/img2vec.git :param l...
stack_v2_sparse_classes_10k_train_008973
4,647
permissive
[ { "docstring": "Img2Vec :param model: String name of requested model :param layer: String or Int depending on model. See more docs: https://github.com/christiansafka/img2vec.git :param layer_output_size: Int depicting the output size of the requested layer :param device: String that lets us decide between using...
3
stack_v2_sparse_classes_30k_val_000176
Implement the Python class `Img2Vec` described below. Class description: Implement the Img2Vec class. Method signatures and docstrings: - def __init__(self, model_path, model='resnet-18', layer='default', layer_output_size=512, device='cuda'): Img2Vec :param model: String name of requested model :param layer: String ...
Implement the Python class `Img2Vec` described below. Class description: Implement the Img2Vec class. Method signatures and docstrings: - def __init__(self, model_path, model='resnet-18', layer='default', layer_output_size=512, device='cuda'): Img2Vec :param model: String name of requested model :param layer: String ...
e97f11cee15a522a09cab325ee943526f19c7d71
<|skeleton|> class Img2Vec: def __init__(self, model_path, model='resnet-18', layer='default', layer_output_size=512, device='cuda'): """Img2Vec :param model: String name of requested model :param layer: String or Int depending on model. See more docs: https://github.com/christiansafka/img2vec.git :param l...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Img2Vec: def __init__(self, model_path, model='resnet-18', layer='default', layer_output_size=512, device='cuda'): """Img2Vec :param model: String name of requested model :param layer: String or Int depending on model. See more docs: https://github.com/christiansafka/img2vec.git :param layer_output_si...
the_stack_v2_python_sparse
distil/utils.py
uncharted-distil/distil-primitives
train
4
91c999d23c956d727251bf14e2dcd48a6137d532
[ "self.xk_hat = x0\nself.Pk = Pk0\nself.Gk = np.array([0])\nself.Q = Q\nself.R = R\nself.A = np.eye(self.xk_hat.shape[0])\nself.B = np.zeros(self.xk_hat.shape[0])\nself.C = np.eye(self.xk_hat.shape[0])", "self.xk_hat = self.A @ self.xk_hat + self.B @ np.array(uk)\nself.Pk = self.A @ self.Pk @ self.A.T + self.Q\nse...
<|body_start_0|> self.xk_hat = x0 self.Pk = Pk0 self.Gk = np.array([0]) self.Q = Q self.R = R self.A = np.eye(self.xk_hat.shape[0]) self.B = np.zeros(self.xk_hat.shape[0]) self.C = np.eye(self.xk_hat.shape[0]) <|end_body_0|> <|body_start_1|> self....
KalmanFilter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KalmanFilter: def __init__(self, x0=np.array([0]), Pk0=np.array([0]), Q=np.array([0.01]), R=np.array([0.01])): """Initializes Kalman Filter. :param x0: (float vector) initial state estimate :param Pk0: (float 2d array) initial filter gain :param Q: (float 2d array) process noise :param R...
stack_v2_sparse_classes_10k_train_008974
1,311
no_license
[ { "docstring": "Initializes Kalman Filter. :param x0: (float vector) initial state estimate :param Pk0: (float 2d array) initial filter gain :param Q: (float 2d array) process noise :param R: (float 2d array) sensor uncertainties", "name": "__init__", "signature": "def __init__(self, x0=np.array([0]), P...
2
stack_v2_sparse_classes_30k_test_000253
Implement the Python class `KalmanFilter` described below. Class description: Implement the KalmanFilter class. Method signatures and docstrings: - def __init__(self, x0=np.array([0]), Pk0=np.array([0]), Q=np.array([0.01]), R=np.array([0.01])): Initializes Kalman Filter. :param x0: (float vector) initial state estima...
Implement the Python class `KalmanFilter` described below. Class description: Implement the KalmanFilter class. Method signatures and docstrings: - def __init__(self, x0=np.array([0]), Pk0=np.array([0]), Q=np.array([0.01]), R=np.array([0.01])): Initializes Kalman Filter. :param x0: (float vector) initial state estima...
e6c9686c440486831ce5ea246ab05af5b4f6ea01
<|skeleton|> class KalmanFilter: def __init__(self, x0=np.array([0]), Pk0=np.array([0]), Q=np.array([0.01]), R=np.array([0.01])): """Initializes Kalman Filter. :param x0: (float vector) initial state estimate :param Pk0: (float 2d array) initial filter gain :param Q: (float 2d array) process noise :param R...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class KalmanFilter: def __init__(self, x0=np.array([0]), Pk0=np.array([0]), Q=np.array([0.01]), R=np.array([0.01])): """Initializes Kalman Filter. :param x0: (float vector) initial state estimate :param Pk0: (float 2d array) initial filter gain :param Q: (float 2d array) process noise :param R: (float 2d ar...
the_stack_v2_python_sparse
IMU/KalmanFilter.py
augustusellis/balance_bot
train
1
aa066272064ae6d8963e1367bc71819e5fbdea45
[ "super().__init__()\nself.in_features = in_features\nself.scan_weight = torch.nn.Parameter(torch.zeros(in_features, 1))\nself.apply(initialise_layer_weights)", "item = input[0]\nB, C, Z, Y, X = item.shape\nf_avg_2d = torch.nn.functional.avg_pool3d(item, [1, Y, X])\nnormalized_weight = TF.softmax(self.scan_weight,...
<|body_start_0|> super().__init__() self.in_features = in_features self.scan_weight = torch.nn.Parameter(torch.zeros(in_features, 1)) self.apply(initialise_layer_weights) <|end_body_0|> <|body_start_1|> item = input[0] B, C, Z, Y, X = item.shape f_avg_2d = torch....
Performs 3D average pooling with custom weighting along the Z dimension. In short: extract the 2d average for each B-scan. Learn a weighting for averaging these features over all B-Scans.
ZAdaptive3dAvgLayer
[ "MIT", "LicenseRef-scancode-generic-cla" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ZAdaptive3dAvgLayer: """Performs 3D average pooling with custom weighting along the Z dimension. In short: extract the 2d average for each B-scan. Learn a weighting for averaging these features over all B-Scans.""" def __init__(self, in_features: int) -> None: """:param in_features: ...
stack_v2_sparse_classes_10k_train_008975
4,772
permissive
[ { "docstring": ":param in_features: number of B-scan", "name": "__init__", "signature": "def __init__(self, in_features: int) -> None" }, { "docstring": ":param input: batch of size [B, C, Z, X, Y]", "name": "forward", "signature": "def forward(self, *input: torch.Tensor, **kwargs: Any) ...
2
null
Implement the Python class `ZAdaptive3dAvgLayer` described below. Class description: Performs 3D average pooling with custom weighting along the Z dimension. In short: extract the 2d average for each B-scan. Learn a weighting for averaging these features over all B-Scans. Method signatures and docstrings: - def __ini...
Implement the Python class `ZAdaptive3dAvgLayer` described below. Class description: Performs 3D average pooling with custom weighting along the Z dimension. In short: extract the 2d average for each B-scan. Learn a weighting for averaging these features over all B-Scans. Method signatures and docstrings: - def __ini...
2877002d50d3a34d80f647c18cb561025d9066cc
<|skeleton|> class ZAdaptive3dAvgLayer: """Performs 3D average pooling with custom weighting along the Z dimension. In short: extract the 2d average for each B-scan. Learn a weighting for averaging these features over all B-Scans.""" def __init__(self, in_features: int) -> None: """:param in_features: ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ZAdaptive3dAvgLayer: """Performs 3D average pooling with custom weighting along the Z dimension. In short: extract the 2d average for each B-scan. Learn a weighting for averaging these features over all B-Scans.""" def __init__(self, in_features: int) -> None: """:param in_features: number of B-s...
the_stack_v2_python_sparse
InnerEye/ML/models/layers/pooling_layers.py
microsoft/InnerEye-DeepLearning
train
511
c01ac6f0b059d2dd4fe85d2dac1454ca3d6bd08e
[ "if len(values) == 0 or len(weights) == 0:\n return 0\ntable = []\nfor i in range(limit + 1):\n table.append([0] * (len(values) + 1))\nfor max_weights in range(limit + 1):\n for i in range(len(values) + 1):\n if max_weights == 0:\n table[max_weights][i] = 0\n elif i == 0:\n ...
<|body_start_0|> if len(values) == 0 or len(weights) == 0: return 0 table = [] for i in range(limit + 1): table.append([0] * (len(values) + 1)) for max_weights in range(limit + 1): for i in range(len(values) + 1): if max_weights == 0: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def knapsack(self, values, weights, limit): """input: string source, string target return: int""" <|body_0|> def knapsack2(self, values, weights, limit): """input: string source, string target return: int""" <|body_1|> <|end_skeleton|> <|body_star...
stack_v2_sparse_classes_10k_train_008976
3,832
no_license
[ { "docstring": "input: string source, string target return: int", "name": "knapsack", "signature": "def knapsack(self, values, weights, limit)" }, { "docstring": "input: string source, string target return: int", "name": "knapsack2", "signature": "def knapsack2(self, values, weights, lim...
2
stack_v2_sparse_classes_30k_train_004216
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def knapsack(self, values, weights, limit): input: string source, string target return: int - def knapsack2(self, values, weights, limit): input: string source, string target ret...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def knapsack(self, values, weights, limit): input: string source, string target return: int - def knapsack2(self, values, weights, limit): input: string source, string target ret...
8d9eb98fa5e897602eae9c37b47fd8abae72b1dc
<|skeleton|> class Solution: def knapsack(self, values, weights, limit): """input: string source, string target return: int""" <|body_0|> def knapsack2(self, values, weights, limit): """input: string source, string target return: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def knapsack(self, values, weights, limit): """input: string source, string target return: int""" if len(values) == 0 or len(weights) == 0: return 0 table = [] for i in range(limit + 1): table.append([0] * (len(values) + 1)) for max_wei...
the_stack_v2_python_sparse
misc/knapsack.py
wanlipu/coding-python
train
0
5ead8ee283fd6ed0ccbd0adaaf4504ef0b306a7a
[ "im = Image.open(cls.infile)\nout = im.resize((width, height), Image.ANTIALIAS)\nout.save(cls.outfile)", "im = Image.open(cls.infile)\nx, y = im.size\nx_s = x\ny_s = x / w_divide_h\nout = im.resize((x_s, y_s), Image.ANTIALIAS)\nout.save(cls.outfile)", "im = Image.open(cls.infile)\nx, y = im.size\nx_s = y * w_di...
<|body_start_0|> im = Image.open(cls.infile) out = im.resize((width, height), Image.ANTIALIAS) out.save(cls.outfile) <|end_body_0|> <|body_start_1|> im = Image.open(cls.infile) x, y = im.size x_s = x y_s = x / w_divide_h out = im.resize((x_s, y_s), Image....
Graphics
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Graphics: def fixed_size(cls, width, height): """按照固定尺寸处理图片""" <|body_0|> def resize_by_width(cls, w_divide_h): """按照宽度进行所需比例缩放""" <|body_1|> def resize_by_height(cls, w_divide_h): """按照高度进行所需比例缩放""" <|body_2|> def resize_by_size(cls...
stack_v2_sparse_classes_10k_train_008977
2,331
no_license
[ { "docstring": "按照固定尺寸处理图片", "name": "fixed_size", "signature": "def fixed_size(cls, width, height)" }, { "docstring": "按照宽度进行所需比例缩放", "name": "resize_by_width", "signature": "def resize_by_width(cls, w_divide_h)" }, { "docstring": "按照高度进行所需比例缩放", "name": "resize_by_height", ...
5
stack_v2_sparse_classes_30k_train_005530
Implement the Python class `Graphics` described below. Class description: Implement the Graphics class. Method signatures and docstrings: - def fixed_size(cls, width, height): 按照固定尺寸处理图片 - def resize_by_width(cls, w_divide_h): 按照宽度进行所需比例缩放 - def resize_by_height(cls, w_divide_h): 按照高度进行所需比例缩放 - def resize_by_size(cls...
Implement the Python class `Graphics` described below. Class description: Implement the Graphics class. Method signatures and docstrings: - def fixed_size(cls, width, height): 按照固定尺寸处理图片 - def resize_by_width(cls, w_divide_h): 按照宽度进行所需比例缩放 - def resize_by_height(cls, w_divide_h): 按照高度进行所需比例缩放 - def resize_by_size(cls...
53a4d00752eb7134397b230d1d3eaeb056de32ef
<|skeleton|> class Graphics: def fixed_size(cls, width, height): """按照固定尺寸处理图片""" <|body_0|> def resize_by_width(cls, w_divide_h): """按照宽度进行所需比例缩放""" <|body_1|> def resize_by_height(cls, w_divide_h): """按照高度进行所需比例缩放""" <|body_2|> def resize_by_size(cls...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Graphics: def fixed_size(cls, width, height): """按照固定尺寸处理图片""" im = Image.open(cls.infile) out = im.resize((width, height), Image.ANTIALIAS) out.save(cls.outfile) def resize_by_width(cls, w_divide_h): """按照宽度进行所需比例缩放""" im = Image.open(cls.infile) x...
the_stack_v2_python_sparse
src/reXXXX/Graphics.py
happyxuwork/data-preprocess
train
1
a6469d7b56a33f527b7834646c2f6a4a7ce5f66e
[ "if context:\n if context.get('default_tally_location_ept', False):\n location_id = context.get('default_tally_location_ept')\n return location_id\nreturn super(stock_inventory_line_ept, self)._default_stock_location(cr, uid, context)", "if not product:\n return {'value': {'product_qty': 0.0, ...
<|body_start_0|> if context: if context.get('default_tally_location_ept', False): location_id = context.get('default_tally_location_ept') return location_id return super(stock_inventory_line_ept, self)._default_stock_location(cr, uid, context) <|end_body_0|> ...
stock_inventory_line_ept
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class stock_inventory_line_ept: def _default_stock_location(self, cr, uid, context=None): """it will set default location for stone.""" <|body_0|> def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False, to_date=False, amount=0.0): """set default amoun...
stack_v2_sparse_classes_10k_train_008978
30,102
no_license
[ { "docstring": "it will set default location for stone.", "name": "_default_stock_location", "signature": "def _default_stock_location(self, cr, uid, context=None)" }, { "docstring": "set default amount(product_qty)", "name": "on_change_product_id", "signature": "def on_change_product_id...
2
stack_v2_sparse_classes_30k_test_000396
Implement the Python class `stock_inventory_line_ept` described below. Class description: Implement the stock_inventory_line_ept class. Method signatures and docstrings: - def _default_stock_location(self, cr, uid, context=None): it will set default location for stone. - def on_change_product_id(self, cr, uid, ids, l...
Implement the Python class `stock_inventory_line_ept` described below. Class description: Implement the stock_inventory_line_ept class. Method signatures and docstrings: - def _default_stock_location(self, cr, uid, context=None): it will set default location for stone. - def on_change_product_id(self, cr, uid, ids, l...
b8615b70c33b79d8b2454cef4151d3f83c3bc77f
<|skeleton|> class stock_inventory_line_ept: def _default_stock_location(self, cr, uid, context=None): """it will set default location for stone.""" <|body_0|> def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False, to_date=False, amount=0.0): """set default amoun...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class stock_inventory_line_ept: def _default_stock_location(self, cr, uid, context=None): """it will set default location for stone.""" if context: if context.get('default_tally_location_ept', False): location_id = context.get('default_tally_location_ept') ...
the_stack_v2_python_sparse
product_stone_search_ept/py/product.py
arpanv/pansuriya
train
0
66c68f37af977b34b03765b3fd8e7a51f9c3243c
[ "try:\n self.object = User.objects.get(username=self.request.user)\n print(self.object)\n return self.object\nexcept:\n return None", "obj = self.get_object()\nprint(obj)\nif obj is not None:\n initial_data = model_to_dict(obj)\n print(initial_data)\n initial_data.update(model_to_dict(obj))\n...
<|body_start_0|> try: self.object = User.objects.get(username=self.request.user) print(self.object) return self.object except: return None <|end_body_0|> <|body_start_1|> obj = self.get_object() print(obj) if obj is not None: ...
Edit_Profile
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Edit_Profile: def get_object(self): """Check if data already exists""" <|body_0|> def get_initial(self): """Pre-fill the form if data exists""" <|body_1|> def form_valid(self, form): """Save to the database. If data exists, update else create new...
stack_v2_sparse_classes_10k_train_008979
6,927
no_license
[ { "docstring": "Check if data already exists", "name": "get_object", "signature": "def get_object(self)" }, { "docstring": "Pre-fill the form if data exists", "name": "get_initial", "signature": "def get_initial(self)" }, { "docstring": "Save to the database. If data exists, upda...
3
stack_v2_sparse_classes_30k_train_004026
Implement the Python class `Edit_Profile` described below. Class description: Implement the Edit_Profile class. Method signatures and docstrings: - def get_object(self): Check if data already exists - def get_initial(self): Pre-fill the form if data exists - def form_valid(self, form): Save to the database. If data e...
Implement the Python class `Edit_Profile` described below. Class description: Implement the Edit_Profile class. Method signatures and docstrings: - def get_object(self): Check if data already exists - def get_initial(self): Pre-fill the form if data exists - def form_valid(self, form): Save to the database. If data e...
4e466eefaac29d9aebd162a320be32785f221d24
<|skeleton|> class Edit_Profile: def get_object(self): """Check if data already exists""" <|body_0|> def get_initial(self): """Pre-fill the form if data exists""" <|body_1|> def form_valid(self, form): """Save to the database. If data exists, update else create new...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Edit_Profile: def get_object(self): """Check if data already exists""" try: self.object = User.objects.get(username=self.request.user) print(self.object) return self.object except: return None def get_initial(self): """Pre-fi...
the_stack_v2_python_sparse
SocialNetwork/dashboard/views.py
Nitu22499/SocialMediaClone
train
0
91a8c173d38077969ad7e6248ed289583bc40360
[ "command = config.editor\nif jumpIndex:\n line = text[:jumpIndex].count('\\n')\n column = jumpIndex - (text[:jumpIndex].rfind('\\n') + 1)\nelse:\n line = column = 0\nif config.editor.startswith('kate'):\n command += ' -l %i -c %i' % (line + 1, column + 1)\nelif config.editor.startswith('gedit'):\n co...
<|body_start_0|> command = config.editor if jumpIndex: line = text[:jumpIndex].count('\n') column = jumpIndex - (text[:jumpIndex].rfind('\n') + 1) else: line = column = 0 if config.editor.startswith('kate'): command += ' -l %i -c %i' % (lin...
Text editor.
TextEditor
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TextEditor: """Text editor.""" def command(self, tempFilename, text, jumpIndex=None): """Return editor selected in user-config.py.""" <|body_0|> def convertLinebreaks(self, text): """Convert line-breaks.""" <|body_1|> def restoreLinebreaks(self, text...
stack_v2_sparse_classes_10k_train_008980
4,743
permissive
[ { "docstring": "Return editor selected in user-config.py.", "name": "command", "signature": "def command(self, tempFilename, text, jumpIndex=None)" }, { "docstring": "Convert line-breaks.", "name": "convertLinebreaks", "signature": "def convertLinebreaks(self, text)" }, { "docstr...
4
stack_v2_sparse_classes_30k_train_006223
Implement the Python class `TextEditor` described below. Class description: Text editor. Method signatures and docstrings: - def command(self, tempFilename, text, jumpIndex=None): Return editor selected in user-config.py. - def convertLinebreaks(self, text): Convert line-breaks. - def restoreLinebreaks(self, text): R...
Implement the Python class `TextEditor` described below. Class description: Text editor. Method signatures and docstrings: - def command(self, tempFilename, text, jumpIndex=None): Return editor selected in user-config.py. - def convertLinebreaks(self, text): Convert line-breaks. - def restoreLinebreaks(self, text): R...
2461ccc6d24153790a1b1c0378348f99997c4eca
<|skeleton|> class TextEditor: """Text editor.""" def command(self, tempFilename, text, jumpIndex=None): """Return editor selected in user-config.py.""" <|body_0|> def convertLinebreaks(self, text): """Convert line-breaks.""" <|body_1|> def restoreLinebreaks(self, text...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TextEditor: """Text editor.""" def command(self, tempFilename, text, jumpIndex=None): """Return editor selected in user-config.py.""" command = config.editor if jumpIndex: line = text[:jumpIndex].count('\n') column = jumpIndex - (text[:jumpIndex].rfind('\n'...
the_stack_v2_python_sparse
pywikibot/editor.py
speedydeletion/pywikibot
train
1
fc6507c3beadb96e406358a7d00a98ea7d3fb3d4
[ "logs.debug('INSTALLERS: Instantiating Endpoint object')\nif os == 'Darwin':\n logs.debug(f'INSTALLERS: Operating system: {os}')\n self._docker_mac(logs=logs)\nelse:\n msg = f'Docker installation is not automated for this operating system: {os}:\\n If docker is already installed on yous system, ...
<|body_start_0|> logs.debug('INSTALLERS: Instantiating Endpoint object') if os == 'Darwin': logs.debug(f'INSTALLERS: Operating system: {os}') self._docker_mac(logs=logs) else: msg = f'Docker installation is not automated for this operating system: {os}:\n ...
Class wrapper for Docker installation procedures
Installers
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Installers: """Class wrapper for Docker installation procedures""" def __init__(self, os: str, logs: logging.Logger) -> None: """Instantiation of Installers object. Parameters ---------- logs: logging.Logger object Logger object to manage DHTK logs""" <|body_0|> def _doc...
stack_v2_sparse_classes_10k_train_008981
21,202
no_license
[ { "docstring": "Instantiation of Installers object. Parameters ---------- logs: logging.Logger object Logger object to manage DHTK logs", "name": "__init__", "signature": "def __init__(self, os: str, logs: logging.Logger) -> None" }, { "docstring": "Method to create Docker installation pipeline ...
3
stack_v2_sparse_classes_30k_train_003768
Implement the Python class `Installers` described below. Class description: Class wrapper for Docker installation procedures Method signatures and docstrings: - def __init__(self, os: str, logs: logging.Logger) -> None: Instantiation of Installers object. Parameters ---------- logs: logging.Logger object Logger objec...
Implement the Python class `Installers` described below. Class description: Class wrapper for Docker installation procedures Method signatures and docstrings: - def __init__(self, os: str, logs: logging.Logger) -> None: Instantiation of Installers object. Parameters ---------- logs: logging.Logger object Logger objec...
54d9104c8b04af0fb368a499372d7ea0337be3d2
<|skeleton|> class Installers: """Class wrapper for Docker installation procedures""" def __init__(self, os: str, logs: logging.Logger) -> None: """Instantiation of Installers object. Parameters ---------- logs: logging.Logger object Logger object to manage DHTK logs""" <|body_0|> def _doc...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Installers: """Class wrapper for Docker installation procedures""" def __init__(self, os: str, logs: logging.Logger) -> None: """Instantiation of Installers object. Parameters ---------- logs: logging.Logger object Logger object to manage DHTK logs""" logs.debug('INSTALLERS: Instantiating...
the_stack_v2_python_sparse
venv/Lib/site-packages/dhtk/core/client.py
sorchawalsh/semanticweb
train
0
5ee3eeb6f8f4704e64c30e68ded2d75eaa9585af
[ "if len(matrix) <= 1:\n return\nfor i in range(len(matrix)):\n for j in range(i + 1, len(matrix)):\n matrix[i][j], matrix[j][i] = (matrix[j][i], matrix[i][j])\nfor k in range(len(matrix)):\n matrix[k] = matrix[k][::-1]", "if len(matrix) <= 1:\n return\nfor i in range(len(matrix)):\n for j in...
<|body_start_0|> if len(matrix) <= 1: return for i in range(len(matrix)): for j in range(i + 1, len(matrix)): matrix[i][j], matrix[j][i] = (matrix[j][i], matrix[i][j]) for k in range(len(matrix)): matrix[k] = matrix[k][::-1] <|end_body_0|> <|b...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def rotate(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.""" <|body_0|> def rotate1(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-p...
stack_v2_sparse_classes_10k_train_008982
918
no_license
[ { "docstring": ":type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.", "name": "rotate", "signature": "def rotate(self, matrix)" }, { "docstring": ":type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.", ...
2
stack_v2_sparse_classes_30k_train_005404
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def rotate(self, matrix): :type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead. - def rotate1(self, matrix): :type matrix: List[List[...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def rotate(self, matrix): :type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead. - def rotate1(self, matrix): :type matrix: List[List[...
b8ec1350e904665f1375c29a53f443ecf262d723
<|skeleton|> class Solution: def rotate(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.""" <|body_0|> def rotate1(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-p...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def rotate(self, matrix): """:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.""" if len(matrix) <= 1: return for i in range(len(matrix)): for j in range(i + 1, len(matrix)): matrix[i][j]...
the_stack_v2_python_sparse
leetcode/048旋转图像.py
ShawDa/Coding
train
0
bd1a9b9d54a1c15e3cf7769fd8823aafc6754247
[ "quizTakerId = kwargs['pk']\nquizTaker = QuizTakers.objects.filter(id=quizTakerId).first()\nresponse = StudentResponse.objects.filter(quiztaker=quizTaker)\nserializer = ResponseSerializer(response, many=True)\nreturn Response(serializer.data)", "quizTakerId = kwargs['pk']\nquizTaker = QuizTakers.objects.filter(id...
<|body_start_0|> quizTakerId = kwargs['pk'] quizTaker = QuizTakers.objects.filter(id=quizTakerId).first() response = StudentResponse.objects.filter(quiztaker=quizTaker) serializer = ResponseSerializer(response, many=True) return Response(serializer.data) <|end_body_0|> <|body_st...
ListCreateResponse
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ListCreateResponse: def get(self, request, *args, **kwargs): """return quiz taker answers""" <|body_0|> def post(self, request, *args, **kwargs): """add quiz taker answers""" <|body_1|> <|end_skeleton|> <|body_start_0|> quizTakerId = kwargs['pk'] ...
stack_v2_sparse_classes_10k_train_008983
1,434
permissive
[ { "docstring": "return quiz taker answers", "name": "get", "signature": "def get(self, request, *args, **kwargs)" }, { "docstring": "add quiz taker answers", "name": "post", "signature": "def post(self, request, *args, **kwargs)" } ]
2
stack_v2_sparse_classes_30k_train_003214
Implement the Python class `ListCreateResponse` described below. Class description: Implement the ListCreateResponse class. Method signatures and docstrings: - def get(self, request, *args, **kwargs): return quiz taker answers - def post(self, request, *args, **kwargs): add quiz taker answers
Implement the Python class `ListCreateResponse` described below. Class description: Implement the ListCreateResponse class. Method signatures and docstrings: - def get(self, request, *args, **kwargs): return quiz taker answers - def post(self, request, *args, **kwargs): add quiz taker answers <|skeleton|> class List...
bebeff8d055ea769773cd1c749f42408aa83f5b9
<|skeleton|> class ListCreateResponse: def get(self, request, *args, **kwargs): """return quiz taker answers""" <|body_0|> def post(self, request, *args, **kwargs): """add quiz taker answers""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ListCreateResponse: def get(self, request, *args, **kwargs): """return quiz taker answers""" quizTakerId = kwargs['pk'] quizTaker = QuizTakers.objects.filter(id=quizTakerId).first() response = StudentResponse.objects.filter(quiztaker=quizTaker) serializer = ResponseSeri...
the_stack_v2_python_sparse
backend/quiz/api/views/response.py
mahmoud-batman/quizz-app
train
0
0c7a1a5b96126d09e5945b798b8f16a5c95957cd
[ "super().__init__(*args, **kwargs)\nself.command_q = command_q\nself.signal_q = signal_q\nself.sphere_args = sphere_args\nself.fname = fname\nself.file_lock = file_lock", "try:\n self._main()\nexcept:\n print('-' * 60)\n traceback.print_exc()\n print('-' * 60)", "sphere = EwaldSphere(data_file=self....
<|body_start_0|> super().__init__(*args, **kwargs) self.command_q = command_q self.signal_q = signal_q self.sphere_args = sphere_args self.fname = fname self.file_lock = file_lock <|end_body_0|> <|body_start_1|> try: self._main() except: ...
Base class for wrangler processes. Subclasses should extend _main, NOT run. _main is run in a try except clause which ensures errors are printed. attributes: command_q: mp.Queue, queue for commands from parent thread. file_lock: mp.Condition, process safe lock for file access fname: str, path to data file signal_q: que...
wranglerProcess
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class wranglerProcess: """Base class for wrangler processes. Subclasses should extend _main, NOT run. _main is run in a try except clause which ensures errors are printed. attributes: command_q: mp.Queue, queue for commands from parent thread. file_lock: mp.Condition, process safe lock for file access ...
stack_v2_sparse_classes_10k_train_008984
8,377
no_license
[ { "docstring": "command_q: mp.Queue, queue for commands from parent thread. signal_q: queue to place signals back to parent thread. sphere_args: dict, used as **kwargs in sphere initialization. see EwaldSphere. fname: str, path to data file file_lock: mp.Condition, process safe lock for file access", "name"...
3
stack_v2_sparse_classes_30k_train_002497
Implement the Python class `wranglerProcess` described below. Class description: Base class for wrangler processes. Subclasses should extend _main, NOT run. _main is run in a try except clause which ensures errors are printed. attributes: command_q: mp.Queue, queue for commands from parent thread. file_lock: mp.Condit...
Implement the Python class `wranglerProcess` described below. Class description: Base class for wrangler processes. Subclasses should extend _main, NOT run. _main is run in a try except clause which ensures errors are printed. attributes: command_q: mp.Queue, queue for commands from parent thread. file_lock: mp.Condit...
f145e757d092d85b5a21dc4c36d99f82d55f7037
<|skeleton|> class wranglerProcess: """Base class for wrangler processes. Subclasses should extend _main, NOT run. _main is run in a try except clause which ensures errors are printed. attributes: command_q: mp.Queue, queue for commands from parent thread. file_lock: mp.Condition, process safe lock for file access ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class wranglerProcess: """Base class for wrangler processes. Subclasses should extend _main, NOT run. _main is run in a try except clause which ensures errors are printed. attributes: command_q: mp.Queue, queue for commands from parent thread. file_lock: mp.Condition, process safe lock for file access fname: str, p...
the_stack_v2_python_sparse
xdart/gui/tabs/static_scan/wranglers/wrangler_widget.py
rwalroth/xdart
train
2
6c39e0d144ae45bb76ee7f90bccef400bc802762
[ "count = 0\nsorted_array = sorted(arr)\ns1 = s2 = 0\nfor num1, num2 in zip(arr, sorted_array):\n s1 += num1\n s2 += num2\n if s1 == s2:\n count += 1\nreturn count", "count = max_value = 0\nfor i in range(len(arr)):\n max_value = max(max_value, arr[i])\n if max_value == i:\n count += 1...
<|body_start_0|> count = 0 sorted_array = sorted(arr) s1 = s2 = 0 for num1, num2 in zip(arr, sorted_array): s1 += num1 s2 += num2 if s1 == s2: count += 1 return count <|end_body_0|> <|body_start_1|> count = max_value = ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxChunksToSorted(self, arr: List[int]) -> int: """sorting and compare sum""" <|body_0|> def maxChunksToSorted(self, arr: List[int]) -> int: """use index""" <|body_1|> <|end_skeleton|> <|body_start_0|> count = 0 sorted_array = ...
stack_v2_sparse_classes_10k_train_008985
905
no_license
[ { "docstring": "sorting and compare sum", "name": "maxChunksToSorted", "signature": "def maxChunksToSorted(self, arr: List[int]) -> int" }, { "docstring": "use index", "name": "maxChunksToSorted", "signature": "def maxChunksToSorted(self, arr: List[int]) -> int" } ]
2
stack_v2_sparse_classes_30k_train_004836
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxChunksToSorted(self, arr: List[int]) -> int: sorting and compare sum - def maxChunksToSorted(self, arr: List[int]) -> int: use index
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxChunksToSorted(self, arr: List[int]) -> int: sorting and compare sum - def maxChunksToSorted(self, arr: List[int]) -> int: use index <|skeleton|> class Solution: def...
fce451090ecaf5471aab5a9413ac0675639ace5d
<|skeleton|> class Solution: def maxChunksToSorted(self, arr: List[int]) -> int: """sorting and compare sum""" <|body_0|> def maxChunksToSorted(self, arr: List[int]) -> int: """use index""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def maxChunksToSorted(self, arr: List[int]) -> int: """sorting and compare sum""" count = 0 sorted_array = sorted(arr) s1 = s2 = 0 for num1, num2 in zip(arr, sorted_array): s1 += num1 s2 += num2 if s1 == s2: ...
the_stack_v2_python_sparse
array_stack_queue/769MaxChunksToMakeSorted.py
kidexp/91leetcode
train
0
0cd66ab4a8c2b5a1c4847b517486b38540457e69
[ "self.rotateByDegrees_(angle)\ntf = NSAffineTransform.transform()\ntf.rotateByDegrees_(-angle)\noldPt = tf.transformPoint_(point)\noldPt.x -= point.x\noldPt.y -= point.y\nself.translateXBy_yBy_(oldPt.x, oldPt.y)", "self.rotateByRadians_(angle)\ntf = NSAffineTransform.transform()\ntf.rotateByRadians_(-angle)\noldP...
<|body_start_0|> self.rotateByDegrees_(angle) tf = NSAffineTransform.transform() tf.rotateByDegrees_(-angle) oldPt = tf.transformPoint_(point) oldPt.x -= point.x oldPt.y -= point.y self.translateXBy_yBy_(oldPt.x, oldPt.y) <|end_body_0|> <|body_start_1|> s...
NSAffineTransform
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NSAffineTransform: def rotateByDegrees_atPoint_(self, angle, point): """Rotate the coordinatespace ``angle`` degrees around ``point``.""" <|body_0|> def rotateByRadians_atPoint_(self, angle, point): """Rotate the coordinatespace ``angle`` radians around ``point``."""...
stack_v2_sparse_classes_10k_train_008986
1,027
permissive
[ { "docstring": "Rotate the coordinatespace ``angle`` degrees around ``point``.", "name": "rotateByDegrees_atPoint_", "signature": "def rotateByDegrees_atPoint_(self, angle, point)" }, { "docstring": "Rotate the coordinatespace ``angle`` radians around ``point``.", "name": "rotateByRadians_at...
2
stack_v2_sparse_classes_30k_train_006841
Implement the Python class `NSAffineTransform` described below. Class description: Implement the NSAffineTransform class. Method signatures and docstrings: - def rotateByDegrees_atPoint_(self, angle, point): Rotate the coordinatespace ``angle`` degrees around ``point``. - def rotateByRadians_atPoint_(self, angle, poi...
Implement the Python class `NSAffineTransform` described below. Class description: Implement the NSAffineTransform class. Method signatures and docstrings: - def rotateByDegrees_atPoint_(self, angle, point): Rotate the coordinatespace ``angle`` degrees around ``point``. - def rotateByRadians_atPoint_(self, angle, poi...
375ab43104712c5e1c782e5ea5f04073b5f8916c
<|skeleton|> class NSAffineTransform: def rotateByDegrees_atPoint_(self, angle, point): """Rotate the coordinatespace ``angle`` degrees around ``point``.""" <|body_0|> def rotateByRadians_atPoint_(self, angle, point): """Rotate the coordinatespace ``angle`` radians around ``point``."""...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class NSAffineTransform: def rotateByDegrees_atPoint_(self, angle, point): """Rotate the coordinatespace ``angle`` degrees around ``point``.""" self.rotateByDegrees_(angle) tf = NSAffineTransform.transform() tf.rotateByDegrees_(-angle) oldPt = tf.transformPoint_(point) ...
the_stack_v2_python_sparse
venv/lib/python3.7/site-packages/PyObjCTools/FndCategories.py
ykhade/Advent_Of_Code_2019
train
1
029e5f6f34691e3d3f7ad351588495e13dd5834c
[ "session.query(DbFunction).filter_by(kb=db_kb).delete()\nfor func in func_manager.values():\n db_func = DbFunction(kb=db_kb, addr=func.addr, blob=func.serialize())\n session.add(db_func)", "funcs = FunctionManager(kb)\ndb_funcs = session.query(DbFunction).filter_by(kb=db_kb)\nall_func_addrs = set(map(lambda...
<|body_start_0|> session.query(DbFunction).filter_by(kb=db_kb).delete() for func in func_manager.values(): db_func = DbFunction(kb=db_kb, addr=func.addr, blob=func.serialize()) session.add(db_func) <|end_body_0|> <|body_start_1|> funcs = FunctionManager(kb) db_fu...
Serialize/unserialize a function manager and its functions.
FunctionManagerSerializer
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FunctionManagerSerializer: """Serialize/unserialize a function manager and its functions.""" def dump(session, db_kb: 'DbKnowledgeBase', func_manager: FunctionManager): """:param session: :param DbKnowledgeBase db_kb: :param FunctionManager func_manager: :return:""" <|body_0|...
stack_v2_sparse_classes_10k_train_008987
1,696
permissive
[ { "docstring": ":param session: :param DbKnowledgeBase db_kb: :param FunctionManager func_manager: :return:", "name": "dump", "signature": "def dump(session, db_kb: 'DbKnowledgeBase', func_manager: FunctionManager)" }, { "docstring": ":param session: :param DbKnowledgeBase db_kb: :param Knowledg...
2
null
Implement the Python class `FunctionManagerSerializer` described below. Class description: Serialize/unserialize a function manager and its functions. Method signatures and docstrings: - def dump(session, db_kb: 'DbKnowledgeBase', func_manager: FunctionManager): :param session: :param DbKnowledgeBase db_kb: :param Fu...
Implement the Python class `FunctionManagerSerializer` described below. Class description: Serialize/unserialize a function manager and its functions. Method signatures and docstrings: - def dump(session, db_kb: 'DbKnowledgeBase', func_manager: FunctionManager): :param session: :param DbKnowledgeBase db_kb: :param Fu...
37e8ca1c3308ec601ad1d7c6bc8081ff38a7cffd
<|skeleton|> class FunctionManagerSerializer: """Serialize/unserialize a function manager and its functions.""" def dump(session, db_kb: 'DbKnowledgeBase', func_manager: FunctionManager): """:param session: :param DbKnowledgeBase db_kb: :param FunctionManager func_manager: :return:""" <|body_0|...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class FunctionManagerSerializer: """Serialize/unserialize a function manager and its functions.""" def dump(session, db_kb: 'DbKnowledgeBase', func_manager: FunctionManager): """:param session: :param DbKnowledgeBase db_kb: :param FunctionManager func_manager: :return:""" session.query(DbFuncti...
the_stack_v2_python_sparse
angr/angrdb/serializers/funcs.py
angr/angr
train
7,184
9589a47bd34b78dc096b895378410a6fe6eaf639
[ "if not str(uuid).isdigit() or int(uuid) <= 0:\n api.logger.error(f'[{datetime.now()}], movies, put, \"id\": {uuid}, Error: \"Wrong movie ID')\n return ({'Error': 'Wrong movie ID'}, 404)\nuuid = int(uuid)\nmovie = Movie.query.filter_by(id=uuid).first()\nif not movie:\n api.logger.error(f'[{datetime.now()}]...
<|body_start_0|> if not str(uuid).isdigit() or int(uuid) <= 0: api.logger.error(f'[{datetime.now()}], movies, put, "id": {uuid}, Error: "Wrong movie ID') return ({'Error': 'Wrong movie ID'}, 404) uuid = int(uuid) movie = Movie.query.filter_by(id=uuid).first() if n...
Movie Api
MovieApi
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MovieApi: """Movie Api""" def get(self, uuid=None): """Output a single movie""" <|body_0|> def put(self, uuid: int): """Changing a movie""" <|body_1|> def delete(uuid: int): """Delete a movie""" <|body_2|> <|end_skeleton|> <|body_st...
stack_v2_sparse_classes_10k_train_008988
12,285
no_license
[ { "docstring": "Output a single movie", "name": "get", "signature": "def get(self, uuid=None)" }, { "docstring": "Changing a movie", "name": "put", "signature": "def put(self, uuid: int)" }, { "docstring": "Delete a movie", "name": "delete", "signature": "def delete(uuid:...
3
stack_v2_sparse_classes_30k_train_000265
Implement the Python class `MovieApi` described below. Class description: Movie Api Method signatures and docstrings: - def get(self, uuid=None): Output a single movie - def put(self, uuid: int): Changing a movie - def delete(uuid: int): Delete a movie
Implement the Python class `MovieApi` described below. Class description: Movie Api Method signatures and docstrings: - def get(self, uuid=None): Output a single movie - def put(self, uuid: int): Changing a movie - def delete(uuid: int): Delete a movie <|skeleton|> class MovieApi: """Movie Api""" def get(se...
b3a021bff8112a3eb81f553b3eb0df751a488adb
<|skeleton|> class MovieApi: """Movie Api""" def get(self, uuid=None): """Output a single movie""" <|body_0|> def put(self, uuid: int): """Changing a movie""" <|body_1|> def delete(uuid: int): """Delete a movie""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MovieApi: """Movie Api""" def get(self, uuid=None): """Output a single movie""" if not str(uuid).isdigit() or int(uuid) <= 0: api.logger.error(f'[{datetime.now()}], movies, put, "id": {uuid}, Error: "Wrong movie ID') return ({'Error': 'Wrong movie ID'}, 404) ...
the_stack_v2_python_sparse
app/resources/movies.py
cyr1z/api-movie-library-
train
1
9b3cb5f9ed083599534f3d4a073815d643880cc1
[ "self.create_new_group = create_new_group\nself.ms_groups_vec = ms_groups_vec\nself.restore_original_owners_members = restore_original_owners_members\nself.restore_to_original = restore_to_original\nself.target_group = target_group\nself.target_group_name = target_group_name\nself.target_group_owner = target_group_...
<|body_start_0|> self.create_new_group = create_new_group self.ms_groups_vec = ms_groups_vec self.restore_original_owners_members = restore_original_owners_members self.restore_to_original = restore_to_original self.target_group = target_group self.target_group_name = tar...
Implementation of the 'RestoreO365GroupsParams' model. TODO: type description here. Attributes: create_new_group (bool): Bool which specifies, if we have to create a new group if it doesn't exist. ms_groups_vec (list of RestoreO365GroupsParams_MSGroupInfo): List of groups getting restored. restore_original_owners_membe...
RestoreO365GroupsParams
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RestoreO365GroupsParams: """Implementation of the 'RestoreO365GroupsParams' model. TODO: type description here. Attributes: create_new_group (bool): Bool which specifies, if we have to create a new group if it doesn't exist. ms_groups_vec (list of RestoreO365GroupsParams_MSGroupInfo): List of gro...
stack_v2_sparse_classes_10k_train_008989
4,068
permissive
[ { "docstring": "Constructor for the RestoreO365GroupsParams class", "name": "__init__", "signature": "def __init__(self, create_new_group=None, ms_groups_vec=None, restore_original_owners_members=None, restore_to_original=None, target_group=None, target_group_name=None, target_group_owner=None)" }, ...
2
stack_v2_sparse_classes_30k_train_002390
Implement the Python class `RestoreO365GroupsParams` described below. Class description: Implementation of the 'RestoreO365GroupsParams' model. TODO: type description here. Attributes: create_new_group (bool): Bool which specifies, if we have to create a new group if it doesn't exist. ms_groups_vec (list of RestoreO36...
Implement the Python class `RestoreO365GroupsParams` described below. Class description: Implementation of the 'RestoreO365GroupsParams' model. TODO: type description here. Attributes: create_new_group (bool): Bool which specifies, if we have to create a new group if it doesn't exist. ms_groups_vec (list of RestoreO36...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class RestoreO365GroupsParams: """Implementation of the 'RestoreO365GroupsParams' model. TODO: type description here. Attributes: create_new_group (bool): Bool which specifies, if we have to create a new group if it doesn't exist. ms_groups_vec (list of RestoreO365GroupsParams_MSGroupInfo): List of gro...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class RestoreO365GroupsParams: """Implementation of the 'RestoreO365GroupsParams' model. TODO: type description here. Attributes: create_new_group (bool): Bool which specifies, if we have to create a new group if it doesn't exist. ms_groups_vec (list of RestoreO365GroupsParams_MSGroupInfo): List of groups getting r...
the_stack_v2_python_sparse
cohesity_management_sdk/models/restore_o_365_groups_params.py
cohesity/management-sdk-python
train
24
373f7d1380b1773e5921521e75257f3befa159ac
[ "if source == 'auxiliary_file':\n logger.debug('Creating an auxiliary FileStoreItem')\n item = self.create(sharename=sharename, filetype=filetype)\n return item\nif not source:\n logger.error('Source is required but was not provided')\n return None\nitem = self.create(source=map_source(source), share...
<|body_start_0|> if source == 'auxiliary_file': logger.debug('Creating an auxiliary FileStoreItem') item = self.create(sharename=sharename, filetype=filetype) return item if not source: logger.error('Source is required but was not provided') re...
Custom model manager to handle creation and retrieval of FileStoreItems
_FileStoreItemManager
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _FileStoreItemManager: """Custom model manager to handle creation and retrieval of FileStoreItems""" def create_item(self, source, sharename='', filetype=''): """A "constructor" for FileStoreItem. :param source: URL or absolute file system path to a file. :type source: str. :returns:...
stack_v2_sparse_classes_10k_train_008990
23,458
permissive
[ { "docstring": "A \"constructor\" for FileStoreItem. :param source: URL or absolute file system path to a file. :type source: str. :returns: FileStoreItem -- if success, None if failure.", "name": "create_item", "signature": "def create_item(self, source, sharename='', filetype='')" }, { "docstr...
2
stack_v2_sparse_classes_30k_train_003625
Implement the Python class `_FileStoreItemManager` described below. Class description: Custom model manager to handle creation and retrieval of FileStoreItems Method signatures and docstrings: - def create_item(self, source, sharename='', filetype=''): A "constructor" for FileStoreItem. :param source: URL or absolute...
Implement the Python class `_FileStoreItemManager` described below. Class description: Custom model manager to handle creation and retrieval of FileStoreItems Method signatures and docstrings: - def create_item(self, source, sharename='', filetype=''): A "constructor" for FileStoreItem. :param source: URL or absolute...
fca97c904be407c6619608e13437f25a9fc9e979
<|skeleton|> class _FileStoreItemManager: """Custom model manager to handle creation and retrieval of FileStoreItems""" def create_item(self, source, sharename='', filetype=''): """A "constructor" for FileStoreItem. :param source: URL or absolute file system path to a file. :type source: str. :returns:...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class _FileStoreItemManager: """Custom model manager to handle creation and retrieval of FileStoreItems""" def create_item(self, source, sharename='', filetype=''): """A "constructor" for FileStoreItem. :param source: URL or absolute file system path to a file. :type source: str. :returns: FileStoreIte...
the_stack_v2_python_sparse
refinery/file_store/models.py
ShuhratBek/refinery-platform
train
1
cc860b29375d98cbbad73336b6919396ffa08e9c
[ "if not check_exist(file):\n assert False, 'Cannot find the KPOINTS file. Check the path: ' + file\nelse:\n self.kpoints = open(file, 'r').readlines()", "plane = self.kpoints[0].split()[-5]\nkrange = np.float64(self.kpoints[0].split()[-4:-2])\nnpoint = np.int64(self.kpoints[0].split()[-2:])\nreturn (plane, ...
<|body_start_0|> if not check_exist(file): assert False, 'Cannot find the KPOINTS file. Check the path: ' + file else: self.kpoints = open(file, 'r').readlines() <|end_body_0|> <|body_start_1|> plane = self.kpoints[0].split()[-5] krange = np.float64(self.kpoints[...
KPOINTS
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KPOINTS: def __init__(self, file='KPOINTS'): """Read KPOINTS TODO: extend it to Selective dynamics""" <|body_0|> def get_spin_kmesh(self): """Read the kmesh header""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not check_exist(file): ...
stack_v2_sparse_classes_10k_train_008991
31,019
permissive
[ { "docstring": "Read KPOINTS TODO: extend it to Selective dynamics", "name": "__init__", "signature": "def __init__(self, file='KPOINTS')" }, { "docstring": "Read the kmesh header", "name": "get_spin_kmesh", "signature": "def get_spin_kmesh(self)" } ]
2
stack_v2_sparse_classes_30k_train_000749
Implement the Python class `KPOINTS` described below. Class description: Implement the KPOINTS class. Method signatures and docstrings: - def __init__(self, file='KPOINTS'): Read KPOINTS TODO: extend it to Selective dynamics - def get_spin_kmesh(self): Read the kmesh header
Implement the Python class `KPOINTS` described below. Class description: Implement the KPOINTS class. Method signatures and docstrings: - def __init__(self, file='KPOINTS'): Read KPOINTS TODO: extend it to Selective dynamics - def get_spin_kmesh(self): Read the kmesh header <|skeleton|> class KPOINTS: def __ini...
42945ee15465caa6fad1983597e23beac78b774d
<|skeleton|> class KPOINTS: def __init__(self, file='KPOINTS'): """Read KPOINTS TODO: extend it to Selective dynamics""" <|body_0|> def get_spin_kmesh(self): """Read the kmesh header""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class KPOINTS: def __init__(self, file='KPOINTS'): """Read KPOINTS TODO: extend it to Selective dynamics""" if not check_exist(file): assert False, 'Cannot find the KPOINTS file. Check the path: ' + file else: self.kpoints = open(file, 'r').readlines() def get_sp...
the_stack_v2_python_sparse
mcu/vasp/vasp_io.py
hungpham2017/mcu
train
44
0771dde3c88db872a004e7b7d169c40014b13677
[ "self.dataframe = df\nself.rows_count = None\nself.variables_count = None\nself.has_error = False\nself.error_messages = []\nself.final_output = OrderedDict()\nself.set_values()", "if self.dataframe is not None:\n self.rows_count = self.dataframe.shape[0]\n self.variables_count = len(self.dataframe.columns)...
<|body_start_0|> self.dataframe = df self.rows_count = None self.variables_count = None self.has_error = False self.error_messages = [] self.final_output = OrderedDict() self.set_values() <|end_body_0|> <|body_start_1|> if self.dataframe is not None: ...
DatasetLevelInfo
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DatasetLevelInfo: def __init__(self, df): """This class sets the dataset level info of the preprocess file.""" <|body_0|> def set_values(self): """"dataset": { "row_cnt": 1000, "variable_cnt": 25 }""" <|body_1|> <|end_skeleton|> <|body_start_0|> sel...
stack_v2_sparse_classes_10k_train_008992
1,809
permissive
[ { "docstring": "This class sets the dataset level info of the preprocess file.", "name": "__init__", "signature": "def __init__(self, df)" }, { "docstring": "\"dataset\": { \"row_cnt\": 1000, \"variable_cnt\": 25 }", "name": "set_values", "signature": "def set_values(self)" } ]
2
stack_v2_sparse_classes_30k_train_006781
Implement the Python class `DatasetLevelInfo` described below. Class description: Implement the DatasetLevelInfo class. Method signatures and docstrings: - def __init__(self, df): This class sets the dataset level info of the preprocess file. - def set_values(self): "dataset": { "row_cnt": 1000, "variable_cnt": 25 }
Implement the Python class `DatasetLevelInfo` described below. Class description: Implement the DatasetLevelInfo class. Method signatures and docstrings: - def __init__(self, df): This class sets the dataset level info of the preprocess file. - def set_values(self): "dataset": { "row_cnt": 1000, "variable_cnt": 25 } ...
9461522219f5ef0f4877f24c8f5923e462bd9557
<|skeleton|> class DatasetLevelInfo: def __init__(self, df): """This class sets the dataset level info of the preprocess file.""" <|body_0|> def set_values(self): """"dataset": { "row_cnt": 1000, "variable_cnt": 25 }""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class DatasetLevelInfo: def __init__(self, df): """This class sets the dataset level info of the preprocess file.""" self.dataframe = df self.rows_count = None self.variables_count = None self.has_error = False self.error_messages = [] self.final_output = Orde...
the_stack_v2_python_sparse
preprocess/raven_preprocess/dataset_level_info_util.py
TwoRavens/raven-metadata-service
train
0
1f2f968a0a62f1cda6f947114cc5d6512544c8e4
[ "self.rect = rect\nself.function = function\nself.overlay = overlay if not isinstance(overlay, str) else ButtonFont.render(overlay, True, KDS.Colors.White)\nself.button_default_color = button_default_color\nself.button_highlighted_color = button_highlighted_color\nself.button_pressed_color = button_pressed_color\ns...
<|body_start_0|> self.rect = rect self.function = function self.overlay = overlay if not isinstance(overlay, str) else ButtonFont.render(overlay, True, KDS.Colors.White) self.button_default_color = button_default_color self.button_highlighted_color = button_highlighted_color ...
Button
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Button: def __init__(self, rect: pygame.Rect, function: Callable, overlay: Union[pygame.Surface, str]=None, button_default_color: Tuple[int, int, int]=(100, 100, 100), button_highlighted_color: Tuple[int, int, int]=(115, 115, 115), button_pressed_color: Tuple[int, int, int]=(90, 90, 90), button_...
stack_v2_sparse_classes_10k_train_008993
18,129
no_license
[ { "docstring": "Instantiates a new Button Args: rect (Rect): The rect where the button will be drawn. function (Callable): A function to be called when the button is pressed. overlay (Surface, optional): Any surface you want to write on top of the button. Defaults to None. button_default_color (Tuple[int, int, ...
2
stack_v2_sparse_classes_30k_train_005126
Implement the Python class `Button` described below. Class description: Implement the Button class. Method signatures and docstrings: - def __init__(self, rect: pygame.Rect, function: Callable, overlay: Union[pygame.Surface, str]=None, button_default_color: Tuple[int, int, int]=(100, 100, 100), button_highlighted_col...
Implement the Python class `Button` described below. Class description: Implement the Button class. Method signatures and docstrings: - def __init__(self, rect: pygame.Rect, function: Callable, overlay: Union[pygame.Surface, str]=None, button_default_color: Tuple[int, int, int]=(100, 100, 100), button_highlighted_col...
641695c56ea2d2a02cca1077b6289988ec9eeb3d
<|skeleton|> class Button: def __init__(self, rect: pygame.Rect, function: Callable, overlay: Union[pygame.Surface, str]=None, button_default_color: Tuple[int, int, int]=(100, 100, 100), button_highlighted_color: Tuple[int, int, int]=(115, 115, 115), button_pressed_color: Tuple[int, int, int]=(90, 90, 90), button_...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Button: def __init__(self, rect: pygame.Rect, function: Callable, overlay: Union[pygame.Surface, str]=None, button_default_color: Tuple[int, int, int]=(100, 100, 100), button_highlighted_color: Tuple[int, int, int]=(115, 115, 115), button_pressed_color: Tuple[int, int, int]=(90, 90, 90), button_disabled_color...
the_stack_v2_python_sparse
KDS/UI.py
KL-Corporation/Koponen-Dating-Simulator
train
0
75ca7e6efd65bc041187450c85762d1a1bb98f87
[ "user = User.objects.get(email=email)\ntoken = Token.objects.get(user_id=user.id)\nurl = 'https://' if self.request.is_secure() else 'http://'\nurl += get_current_site(self.request).domain\nurl += '/en/activate/' + str(user.id) + '/' + str(token) + '/'\nreturn url", "contact_list = [env_var('DEFAULT_TO_EMAIL')]\n...
<|body_start_0|> user = User.objects.get(email=email) token = Token.objects.get(user_id=user.id) url = 'https://' if self.request.is_secure() else 'http://' url += get_current_site(self.request).domain url += '/en/activate/' + str(user.id) + '/' + str(token) + '/' return ...
SendEmailViewMixin
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SendEmailViewMixin: def activation_url(self, email): """Function will get the User ID and Token and generate a URL.""" <|body_0|> def send_activation(self, email): """Function will send to the inputted email the URL that needs to be accessed to activate the account."...
stack_v2_sparse_classes_10k_train_008994
2,444
permissive
[ { "docstring": "Function will get the User ID and Token and generate a URL.", "name": "activation_url", "signature": "def activation_url(self, email)" }, { "docstring": "Function will send to the inputted email the URL that needs to be accessed to activate the account.", "name": "send_activa...
2
stack_v2_sparse_classes_30k_train_006073
Implement the Python class `SendEmailViewMixin` described below. Class description: Implement the SendEmailViewMixin class. Method signatures and docstrings: - def activation_url(self, email): Function will get the User ID and Token and generate a URL. - def send_activation(self, email): Function will send to the inp...
Implement the Python class `SendEmailViewMixin` described below. Class description: Implement the SendEmailViewMixin class. Method signatures and docstrings: - def activation_url(self, email): Function will get the User ID and Token and generate a URL. - def send_activation(self, email): Function will send to the inp...
053973b5ff0b997c52bfaca8daf8e07db64a877c
<|skeleton|> class SendEmailViewMixin: def activation_url(self, email): """Function will get the User ID and Token and generate a URL.""" <|body_0|> def send_activation(self, email): """Function will send to the inputted email the URL that needs to be accessed to activate the account."...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SendEmailViewMixin: def activation_url(self, email): """Function will get the User ID and Token and generate a URL.""" user = User.objects.get(email=email) token = Token.objects.get(user_id=user.id) url = 'https://' if self.request.is_secure() else 'http://' url += get_...
the_stack_v2_python_sparse
api/views/authentication/emailactivation.py
smegurus/smegurus-django
train
1
ee2163444009e02b30dd264718be56eeedbe166b
[ "self.num_classes = num_classes\nself.num_shots = num_shots\nself.num_queries = num_queries\nself.shape_x = shape_x\nself.dataset = dataset\nself.batch_size = batch_size\nself.rng = np.random.RandomState(706)", "num_classes = self.num_classes\nnum_shots = self.num_shots\nnum_queries = self.num_queries\nshape_x = ...
<|body_start_0|> self.num_classes = num_classes self.num_shots = num_shots self.num_queries = num_queries self.shape_x = shape_x self.dataset = dataset self.batch_size = batch_size self.rng = np.random.RandomState(706) <|end_body_0|> <|body_start_1|> num_...
DataGenerator
[ "BSD-3-Clause", "MIT", "LicenseRef-scancode-proprietary-license", "Apache-2.0", "CC-BY-NC-4.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DataGenerator: def __init__(self, num_classes, num_shots, num_queries, shape_x, dataset, batch_size): """Create episode function Args: num_classes (int): number of support classes, generally called n_way in one-shot literatuer num_shots (int): number of shots per class num_queries (int):...
stack_v2_sparse_classes_10k_train_008995
3,834
permissive
[ { "docstring": "Create episode function Args: num_classes (int): number of support classes, generally called n_way in one-shot literatuer num_shots (int): number of shots per class num_queries (int): numper of queries per class. shape_x (tuple): dimension of the input image. dataset(nd_array): nd_array of (clas...
2
stack_v2_sparse_classes_30k_train_003328
Implement the Python class `DataGenerator` described below. Class description: Implement the DataGenerator class. Method signatures and docstrings: - def __init__(self, num_classes, num_shots, num_queries, shape_x, dataset, batch_size): Create episode function Args: num_classes (int): number of support classes, gener...
Implement the Python class `DataGenerator` described below. Class description: Implement the DataGenerator class. Method signatures and docstrings: - def __init__(self, num_classes, num_shots, num_queries, shape_x, dataset, batch_size): Create episode function Args: num_classes (int): number of support classes, gener...
41f71faa6efff7774a76bbd5af3198322a90a6ab
<|skeleton|> class DataGenerator: def __init__(self, num_classes, num_shots, num_queries, shape_x, dataset, batch_size): """Create episode function Args: num_classes (int): number of support classes, generally called n_way in one-shot literatuer num_shots (int): number of shots per class num_queries (int):...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class DataGenerator: def __init__(self, num_classes, num_shots, num_queries, shape_x, dataset, batch_size): """Create episode function Args: num_classes (int): number of support classes, generally called n_way in one-shot literatuer num_shots (int): number of shots per class num_queries (int): numper of que...
the_stack_v2_python_sparse
meta-learning/maml/data_generator_maml.py
sony/nnabla-examples
train
308
2540f2153f6c6bb0a6f4398e49bd1954bde0b3fa
[ "self.df_trinary = df_trinary\ndf_valid = self.df_trinary.applymap(lambda v: 1 if v in [-1, 0, 1] else np.nan)\nif np.isnan(df_valid.sum().sum()):\n raise ValueError('Argument is not a trinary dataframe')\nself.columns = df_trinary.columns\nself.num_col = len(self.columns)\nself.indices = self.df_trinary.index\n...
<|body_start_0|> self.df_trinary = df_trinary df_valid = self.df_trinary.applymap(lambda v: 1 if v in [-1, 0, 1] else np.nan) if np.isnan(df_valid.sum().sum()): raise ValueError('Argument is not a trinary dataframe') self.columns = df_trinary.columns self.num_col = le...
TrinaryDistance
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TrinaryDistance: def __init__(self, df_trinary): """Parameters ---------- df_trinary: DataFrame columns: vector names index: instances values: -1, 0, 1""" <|body_0|> def calcDistance(self): """Calculates the distance between all pairs of column vectors.""" <|...
stack_v2_sparse_classes_10k_train_008996
2,227
permissive
[ { "docstring": "Parameters ---------- df_trinary: DataFrame columns: vector names index: instances values: -1, 0, 1", "name": "__init__", "signature": "def __init__(self, df_trinary)" }, { "docstring": "Calculates the distance between all pairs of column vectors.", "name": "calcDistance", ...
2
stack_v2_sparse_classes_30k_train_005246
Implement the Python class `TrinaryDistance` described below. Class description: Implement the TrinaryDistance class. Method signatures and docstrings: - def __init__(self, df_trinary): Parameters ---------- df_trinary: DataFrame columns: vector names index: instances values: -1, 0, 1 - def calcDistance(self): Calcul...
Implement the Python class `TrinaryDistance` described below. Class description: Implement the TrinaryDistance class. Method signatures and docstrings: - def __init__(self, df_trinary): Parameters ---------- df_trinary: DataFrame columns: vector names index: instances values: -1, 0, 1 - def calcDistance(self): Calcul...
a57542245f117fe6c835cc9d7ad570b9853b7e6c
<|skeleton|> class TrinaryDistance: def __init__(self, df_trinary): """Parameters ---------- df_trinary: DataFrame columns: vector names index: instances values: -1, 0, 1""" <|body_0|> def calcDistance(self): """Calculates the distance between all pairs of column vectors.""" <|...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TrinaryDistance: def __init__(self, df_trinary): """Parameters ---------- df_trinary: DataFrame columns: vector names index: instances values: -1, 0, 1""" self.df_trinary = df_trinary df_valid = self.df_trinary.applymap(lambda v: 1 if v in [-1, 0, 1] else np.nan) if np.isnan(df...
the_stack_v2_python_sparse
common_python/classifier/trinary_distance.py
ScienceStacks/common_python
train
1
d6b65b6bffc5b0a58a5bec5cc0b150e2ba349eb0
[ "faster = lower = head\nfor _ in range(n):\n faster = faster.next\nif not faster:\n return head.next\nwhile faster:\n faster = faster.next\n if not faster:\n break\n lower = lower.next\nlower.next = lower.next.next\nreturn head", "length = 0\nsource = head\nwhile head:\n head = head.next\...
<|body_start_0|> faster = lower = head for _ in range(n): faster = faster.next if not faster: return head.next while faster: faster = faster.next if not faster: break lower = lower.next lower.next = lower...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def _removeNthFromEnd(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" <|body_0|> def removeNthFromEnd(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_10k_train_008997
2,050
permissive
[ { "docstring": ":type head: ListNode :type n: int :rtype: ListNode", "name": "_removeNthFromEnd", "signature": "def _removeNthFromEnd(self, head, n)" }, { "docstring": ":type head: ListNode :type n: int :rtype: ListNode", "name": "removeNthFromEnd", "signature": "def removeNthFromEnd(sel...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _removeNthFromEnd(self, head, n): :type head: ListNode :type n: int :rtype: ListNode - def removeNthFromEnd(self, head, n): :type head: ListNode :type n: int :rtype: ListNode
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _removeNthFromEnd(self, head, n): :type head: ListNode :type n: int :rtype: ListNode - def removeNthFromEnd(self, head, n): :type head: ListNode :type n: int :rtype: ListNode...
0dd67edca4e0b0323cb5a7239f02ea46383cd15a
<|skeleton|> class Solution: def _removeNthFromEnd(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" <|body_0|> def removeNthFromEnd(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def _removeNthFromEnd(self, head, n): """:type head: ListNode :type n: int :rtype: ListNode""" faster = lower = head for _ in range(n): faster = faster.next if not faster: return head.next while faster: faster = faster.next ...
the_stack_v2_python_sparse
19.remove-nth-node-from-end-of-list.py
windard/leeeeee
train
0
d0c44c99119ac2e02260ff2f0b0d23a3c6d45be4
[ "super().__init__()\ntotal_size = input_size + prev_input_size\nself.proj = nn.Linear(total_size, input_size)\nself.transform = nn.Linear(total_size, input_size)\nself.transform.bias.data.fill_(-2.0)", "concat_inputs = torch.cat((current, previous), 1)\nproj_result = F.relu(self.proj(concat_inputs))\nproj_gate = ...
<|body_start_0|> super().__init__() total_size = input_size + prev_input_size self.proj = nn.Linear(total_size, input_size) self.transform = nn.Linear(total_size, input_size) self.transform.bias.data.fill_(-2.0) <|end_body_0|> <|body_start_1|> concat_inputs = torch.cat((...
The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387.
Highway
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Highway: """The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387.""" def __init__(self, input_size: int, prev_input_size: int): """Instantiate the Highway up...
stack_v2_sparse_classes_10k_train_008998
25,672
no_license
[ { "docstring": "Instantiate the Highway update layer. :param input_size: Current representation size. :param prev_input_size: Size of the representation obtained by the previous convolutional layer.", "name": "__init__", "signature": "def __init__(self, input_size: int, prev_input_size: int)" }, { ...
2
stack_v2_sparse_classes_30k_train_001615
Implement the Python class `Highway` described below. Class description: The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387. Method signatures and docstrings: - def __init__(self, input_siz...
Implement the Python class `Highway` described below. Class description: The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387. Method signatures and docstrings: - def __init__(self, input_siz...
7e55a422588c1d1e00f35a3d3a3ff896cce59e18
<|skeleton|> class Highway: """The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387.""" def __init__(self, input_size: int, prev_input_size: int): """Instantiate the Highway up...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Highway: """The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387.""" def __init__(self, input_size: int, prev_input_size: int): """Instantiate the Highway update layer. :...
the_stack_v2_python_sparse
generated/test_AstraZeneca_chemicalx.py
jansel/pytorch-jit-paritybench
train
35
669ba5d3ddcb833f1e01465ccec198b7daee4b80
[ "super(BertLayerNorm, self).__init__()\nself.reducemean = P.ReduceMean(keep_dims=True)\nself.sub = P.Sub()\nself.pow = P.Pow()\nself.add = P.Add()\nself.sqrt = P.Sqrt()\nself.div = P.Div()\nself.mul = P.Mul()\nself.variance_epsilon = eps\nself.bert_layer_norm_weight = Parameter(Tensor(np.random.uniform(0, 1, bert_l...
<|body_start_0|> super(BertLayerNorm, self).__init__() self.reducemean = P.ReduceMean(keep_dims=True) self.sub = P.Sub() self.pow = P.Pow() self.add = P.Add() self.sqrt = P.Sqrt() self.div = P.Div() self.mul = P.Mul() self.variance_epsilon = eps ...
Normalization module of reader downstream
BertLayerNorm
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-proprietary-license" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BertLayerNorm: """Normalization module of reader downstream""" def __init__(self, bert_layer_norm_weight_shape, bert_layer_norm_bias_shape, eps=1e-12): """init function""" <|body_0|> def construct(self, x): """construct function""" <|body_1|> <|end_skele...
stack_v2_sparse_classes_10k_train_008999
9,011
permissive
[ { "docstring": "init function", "name": "__init__", "signature": "def __init__(self, bert_layer_norm_weight_shape, bert_layer_norm_bias_shape, eps=1e-12)" }, { "docstring": "construct function", "name": "construct", "signature": "def construct(self, x)" } ]
2
stack_v2_sparse_classes_30k_val_000261
Implement the Python class `BertLayerNorm` described below. Class description: Normalization module of reader downstream Method signatures and docstrings: - def __init__(self, bert_layer_norm_weight_shape, bert_layer_norm_bias_shape, eps=1e-12): init function - def construct(self, x): construct function
Implement the Python class `BertLayerNorm` described below. Class description: Normalization module of reader downstream Method signatures and docstrings: - def __init__(self, bert_layer_norm_weight_shape, bert_layer_norm_bias_shape, eps=1e-12): init function - def construct(self, x): construct function <|skeleton|>...
eab643f51336dbf7d711f02d27e6516e5affee59
<|skeleton|> class BertLayerNorm: """Normalization module of reader downstream""" def __init__(self, bert_layer_norm_weight_shape, bert_layer_norm_bias_shape, eps=1e-12): """init function""" <|body_0|> def construct(self, x): """construct function""" <|body_1|> <|end_skele...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class BertLayerNorm: """Normalization module of reader downstream""" def __init__(self, bert_layer_norm_weight_shape, bert_layer_norm_bias_shape, eps=1e-12): """init function""" super(BertLayerNorm, self).__init__() self.reducemean = P.ReduceMean(keep_dims=True) self.sub = P.Sub...
the_stack_v2_python_sparse
research/nlp/tprr/src/reader_downstream.py
mindspore-ai/models
train
301