blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
6.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
438
7.52k
id
stringlengths
40
40
length_bytes
int64
506
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.25k
prompted_full_text
stringlengths
645
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.34k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
302
7.33k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
ab8730795161ecb89426f9f0db37c162c2c1f894
[ "self.dic = {}\nfor word in set(dictionary):\n if word:\n if len(word) <= 2:\n if word not in self.dic:\n self.dic[word] = set()\n self.dic[word].add(word)\n else:\n abb = word[0] + str(len(word) - 2) + word[-1]\n if abb in self.dic:\n ...
<|body_start_0|> self.dic = {} for word in set(dictionary): if word: if len(word) <= 2: if word not in self.dic: self.dic[word] = set() self.dic[word].add(word) else: abb =...
ValidWordAbbr
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ValidWordAbbr: def __init__(self, dictionary): """initialize your data structure here. :type dictionary: List[str]""" <|body_0|> def isUnique(self, word): """check if a word is unique. :type word: str :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start...
stack_v2_sparse_classes_36k_train_026200
1,496
no_license
[ { "docstring": "initialize your data structure here. :type dictionary: List[str]", "name": "__init__", "signature": "def __init__(self, dictionary)" }, { "docstring": "check if a word is unique. :type word: str :rtype: bool", "name": "isUnique", "signature": "def isUnique(self, word)" ...
2
stack_v2_sparse_classes_30k_train_019204
Implement the Python class `ValidWordAbbr` described below. Class description: Implement the ValidWordAbbr class. Method signatures and docstrings: - def __init__(self, dictionary): initialize your data structure here. :type dictionary: List[str] - def isUnique(self, word): check if a word is unique. :type word: str ...
Implement the Python class `ValidWordAbbr` described below. Class description: Implement the ValidWordAbbr class. Method signatures and docstrings: - def __init__(self, dictionary): initialize your data structure here. :type dictionary: List[str] - def isUnique(self, word): check if a word is unique. :type word: str ...
f1b85a2bfee024ef3afdf2ca0b223842c2d2d3f3
<|skeleton|> class ValidWordAbbr: def __init__(self, dictionary): """initialize your data structure here. :type dictionary: List[str]""" <|body_0|> def isUnique(self, word): """check if a word is unique. :type word: str :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ValidWordAbbr: def __init__(self, dictionary): """initialize your data structure here. :type dictionary: List[str]""" self.dic = {} for word in set(dictionary): if word: if len(word) <= 2: if word not in self.dic: ...
the_stack_v2_python_sparse
288-Unique-Word-Abbreviation/solution.py
Xochitlxie/Leetcode
train
0
52c41950217afca0b46e5a7f0ac7c8af355aa293
[ "self.array = array\nself.tree = [0 for _ in range(len(self.array) * 4)]\nself.init(self.tree, 0, len(self.array) - 1, 1)\nself.last_index = len(array) - 1", "if start == end:\n tree[node] = start\n return tree[node]\nmid = (start + end) // 2\nleft = self.init(tree, start, mid, node * 2)\nright = self.init(...
<|body_start_0|> self.array = array self.tree = [0 for _ in range(len(self.array) * 4)] self.init(self.tree, 0, len(self.array) - 1, 1) self.last_index = len(array) - 1 <|end_body_0|> <|body_start_1|> if start == end: tree[node] = start return tree[node] ...
A Class used to get partial min of an array and update data ... Attributes ---------- array : list a list which to make a segment tree Methods ------- init(tree, start, end, node) make segment tree from the array. don't call this method directly. min(left, right, node=1, start=0, end=-1) return the partial min of the a...
Segment_Min_Tree
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Segment_Min_Tree: """A Class used to get partial min of an array and update data ... Attributes ---------- array : list a list which to make a segment tree Methods ------- init(tree, start, end, node) make segment tree from the array. don't call this method directly. min(left, right, node=1, star...
stack_v2_sparse_classes_36k_train_026201
4,003
permissive
[ { "docstring": "Parameters ---------- array : list the array that you want to make tree", "name": "__init__", "signature": "def __init__(self, array)" }, { "docstring": "Don't Call This Method Directly", "name": "init", "signature": "def init(self, tree, start, end, node)" }, { "...
3
null
Implement the Python class `Segment_Min_Tree` described below. Class description: A Class used to get partial min of an array and update data ... Attributes ---------- array : list a list which to make a segment tree Methods ------- init(tree, start, end, node) make segment tree from the array. don't call this method ...
Implement the Python class `Segment_Min_Tree` described below. Class description: A Class used to get partial min of an array and update data ... Attributes ---------- array : list a list which to make a segment tree Methods ------- init(tree, start, end, node) make segment tree from the array. don't call this method ...
3efa96710e97c8740d6fef69e4afe7a23bfca05f
<|skeleton|> class Segment_Min_Tree: """A Class used to get partial min of an array and update data ... Attributes ---------- array : list a list which to make a segment tree Methods ------- init(tree, start, end, node) make segment tree from the array. don't call this method directly. min(left, right, node=1, star...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Segment_Min_Tree: """A Class used to get partial min of an array and update data ... Attributes ---------- array : list a list which to make a segment tree Methods ------- init(tree, start, end, node) make segment tree from the array. don't call this method directly. min(left, right, node=1, start=0, end=-1) ...
the_stack_v2_python_sparse
libs/segment_tree_min.py
yskang/AlgorithmPractice
train
0
ff92132657b857349b01daa1f5bf7aeb1bb7fb1d
[ "i = 0\nres = []\nwhile i < len(nums):\n if nums[i] != i + 1 and nums[i] != nums[nums[i] - 1]:\n tmp = nums[i]\n nums[i] = nums[tmp - 1]\n nums[tmp - 1] = tmp\n else:\n i += 1\nfor i in range(len(nums)):\n if nums[i] != i + 1:\n res.append(i + 1)\nreturn res", "myset = ...
<|body_start_0|> i = 0 res = [] while i < len(nums): if nums[i] != i + 1 and nums[i] != nums[nums[i] - 1]: tmp = nums[i] nums[i] = nums[tmp - 1] nums[tmp - 1] = tmp else: i += 1 for i in range(len(num...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findDisappearedNumbers(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_0|> def findDisappearedNumbers2(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> i = 0 ...
stack_v2_sparse_classes_36k_train_026202
1,144
no_license
[ { "docstring": ":type nums: List[int] :rtype: List[int]", "name": "findDisappearedNumbers", "signature": "def findDisappearedNumbers(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: List[int]", "name": "findDisappearedNumbers2", "signature": "def findDisappearedNumbers2(self...
2
stack_v2_sparse_classes_30k_train_021577
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findDisappearedNumbers(self, nums): :type nums: List[int] :rtype: List[int] - def findDisappearedNumbers2(self, nums): :type nums: List[int] :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findDisappearedNumbers(self, nums): :type nums: List[int] :rtype: List[int] - def findDisappearedNumbers2(self, nums): :type nums: List[int] :rtype: List[int] <|skeleton|> c...
ab49373ff3fc306a03a90de02e1801b8cbe520d7
<|skeleton|> class Solution: def findDisappearedNumbers(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_0|> def findDisappearedNumbers2(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findDisappearedNumbers(self, nums): """:type nums: List[int] :rtype: List[int]""" i = 0 res = [] while i < len(nums): if nums[i] != i + 1 and nums[i] != nums[nums[i] - 1]: tmp = nums[i] nums[i] = nums[tmp - 1] ...
the_stack_v2_python_sparse
explore/array/448.py
yiguid/LeetCodePractise
train
0
fb03652a4ac48127d705619db5ccefde52b63d40
[ "super(TransformerDecoderLayer, self).__init__()\nself.self_attn = NonLocalSelfAttention(channels)\nself.dropout1 = nn.Dropout(dropout)\nout_c = int(channels / 2)\nself.mutate = nn.Sequential(ConvolutionalTransposeBlock(in_c=channels, out_c=out_c, padded=True, kernel_size=kernel_size), ConvolutionalTransposeBlock(i...
<|body_start_0|> super(TransformerDecoderLayer, self).__init__() self.self_attn = NonLocalSelfAttention(channels) self.dropout1 = nn.Dropout(dropout) out_c = int(channels / 2) self.mutate = nn.Sequential(ConvolutionalTransposeBlock(in_c=channels, out_c=out_c, padded=True, kernel_...
TransformerEncoderLayer is made up of self-attn and feedforward network. This standard encoder layer is based on the paper "Attention Is All You Need". Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advance...
TransformerDecoderLayer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TransformerDecoderLayer: """TransformerEncoderLayer is made up of self-attn and feedforward network. This standard encoder layer is based on the paper "Attention Is All You Need". Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polo...
stack_v2_sparse_classes_36k_train_026203
9,975
no_license
[ { "docstring": ":param channels: :param dropout: :param kernel_size:", "name": "__init__", "signature": "def __init__(self, channels, dropout=0.1, kernel_size=1)" }, { "docstring": "Pass the input through the encoder layer. Args: src: the sequence to the encoder layer (required). Shape: see the ...
2
stack_v2_sparse_classes_30k_train_017471
Implement the Python class `TransformerDecoderLayer` described below. Class description: TransformerEncoderLayer is made up of self-attn and feedforward network. This standard encoder layer is based on the paper "Attention Is All You Need". Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan...
Implement the Python class `TransformerDecoderLayer` described below. Class description: TransformerEncoderLayer is made up of self-attn and feedforward network. This standard encoder layer is based on the paper "Attention Is All You Need". Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan...
be76715676dc1652e80ff5f95003220d8002c4d9
<|skeleton|> class TransformerDecoderLayer: """TransformerEncoderLayer is made up of self-attn and feedforward network. This standard encoder layer is based on the paper "Attention Is All You Need". Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TransformerDecoderLayer: """TransformerEncoderLayer is made up of self-attn and feedforward network. This standard encoder layer is based on the paper "Attention Is All You Need". Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017....
the_stack_v2_python_sparse
models/transformer_convolutional_vae.py
flawnson/AA_VAE
train
0
7109acb5fcc67928fcc899ea32bda20a0df3f7a3
[ "def preorder_traversal(root):\n if not root:\n return 'None'\n return ','.join([str(root.val), preorder_traversal(root.left), preorder_traversal(root.right)])\nreturn preorder_traversal(root)", "from collections import deque\ndata = deque(data.split(','))\n\ndef build_tree_from_inorder(data):\n n...
<|body_start_0|> def preorder_traversal(root): if not root: return 'None' return ','.join([str(root.val), preorder_traversal(root.left), preorder_traversal(root.right)]) return preorder_traversal(root) <|end_body_0|> <|body_start_1|> from collections impo...
Codec
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_026204
1,331
permissive
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
fd4cf122cfd4920f3bd8dce40ba7487a170a1b57
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" def preorder_traversal(root): if not root: return 'None' return ','.join([str(root.val), preorder_traversal(root.left), preorder_traversal(root.ri...
the_stack_v2_python_sparse
0297_Serialize_and_Deserialize_Binary_Tree.py
coldmanck/leetcode-python
train
6
c1aa2c79ec02ea2569d041088936be373b090142
[ "s.dingding = dingding\ns.match_pattern = d.get('MatchPattern', None)\ns.xmlrpc_recv_url = d['XmlRpcRecvUrl']\ns.recv_password = d.get('RecvPassword', None)", "if s.xmlrpc_recv_url != subs.xmlrpc_recv_url:\n return False\nif s.recv_password != subs.recv_password:\n return False\nif not s.match_pattern:\n ...
<|body_start_0|> s.dingding = dingding s.match_pattern = d.get('MatchPattern', None) s.xmlrpc_recv_url = d['XmlRpcRecvUrl'] s.recv_password = d.get('RecvPassword', None) <|end_body_0|> <|body_start_1|> if s.xmlrpc_recv_url != subs.xmlrpc_recv_url: return False ...
Unsubscription - augment an unsubscription dictionary
Unsubscription
[ "LicenseRef-scancode-public-domain" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Unsubscription: """Unsubscription - augment an unsubscription dictionary""" def __init__(s, d, dingding): """unsubscribe dict: * MatchPattern (*OPTIONAL*) - pattern to unsubscribe; if missing, unsubscribe ALL patterns * XmlRpcRecvUrl (REQUIRED) - XML-RPC URL of unsubscribing interfac...
stack_v2_sparse_classes_36k_train_026205
25,098
permissive
[ { "docstring": "unsubscribe dict: * MatchPattern (*OPTIONAL*) - pattern to unsubscribe; if missing, unsubscribe ALL patterns * XmlRpcRecvUrl (REQUIRED) - XML-RPC URL of unsubscribing interface * RecvPassword (OPTIONAL) - if there is a password associated with the receiver, put it here nothing else", "name":...
2
stack_v2_sparse_classes_30k_train_009903
Implement the Python class `Unsubscription` described below. Class description: Unsubscription - augment an unsubscription dictionary Method signatures and docstrings: - def __init__(s, d, dingding): unsubscribe dict: * MatchPattern (*OPTIONAL*) - pattern to unsubscribe; if missing, unsubscribe ALL patterns * XmlRpcR...
Implement the Python class `Unsubscription` described below. Class description: Unsubscription - augment an unsubscription dictionary Method signatures and docstrings: - def __init__(s, d, dingding): unsubscribe dict: * MatchPattern (*OPTIONAL*) - pattern to unsubscribe; if missing, unsubscribe ALL patterns * XmlRpcR...
da65d948b346d3f455e79168a8753b2b16d8fc5f
<|skeleton|> class Unsubscription: """Unsubscription - augment an unsubscription dictionary""" def __init__(s, d, dingding): """unsubscribe dict: * MatchPattern (*OPTIONAL*) - pattern to unsubscribe; if missing, unsubscribe ALL patterns * XmlRpcRecvUrl (REQUIRED) - XML-RPC URL of unsubscribing interfac...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Unsubscription: """Unsubscription - augment an unsubscription dictionary""" def __init__(s, d, dingding): """unsubscribe dict: * MatchPattern (*OPTIONAL*) - pattern to unsubscribe; if missing, unsubscribe ALL patterns * XmlRpcRecvUrl (REQUIRED) - XML-RPC URL of unsubscribing interface * RecvPassw...
the_stack_v2_python_sparse
ancient/src/dingding/dingding.py
BackupTheBerlios/onebigsoup-svn
train
0
c054df0ab52c3e6ab864b948a4bb8061e9dff15d
[ "self.src = src_pattern\nself.dst = dst_pattern\nself.dayu_object = DayuPath(self.src)", "scan_gen = self.dayu_object.scan()\nscan_list = list(scan_gen)\nif scan_list:\n return scan_list[0].frames\nreturn []", "scan_gen = self.dayu_object.scan()\nscan_list = list(scan_gen)\nif scan_list:\n scan_object = s...
<|body_start_0|> self.src = src_pattern self.dst = dst_pattern self.dayu_object = DayuPath(self.src) <|end_body_0|> <|body_start_1|> scan_gen = self.dayu_object.scan() scan_list = list(scan_gen) if scan_list: return scan_list[0].frames return [] <|end...
SequenceConverter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SequenceConverter: def __init__(self, src_pattern, dst_pattern): """序列转换 :param src_pattern: name.####.ext :param dst_pattern: name.####.ext""" <|body_0|> def frames(self): """获取序列的帧数 :return: <list>""" <|body_1|> def file_list(self): """这种情况,sel...
stack_v2_sparse_classes_36k_train_026206
1,692
no_license
[ { "docstring": "序列转换 :param src_pattern: name.####.ext :param dst_pattern: name.####.ext", "name": "__init__", "signature": "def __init__(self, src_pattern, dst_pattern)" }, { "docstring": "获取序列的帧数 :return: <list>", "name": "frames", "signature": "def frames(self)" }, { "docstrin...
4
null
Implement the Python class `SequenceConverter` described below. Class description: Implement the SequenceConverter class. Method signatures and docstrings: - def __init__(self, src_pattern, dst_pattern): 序列转换 :param src_pattern: name.####.ext :param dst_pattern: name.####.ext - def frames(self): 获取序列的帧数 :return: <lis...
Implement the Python class `SequenceConverter` described below. Class description: Implement the SequenceConverter class. Method signatures and docstrings: - def __init__(self, src_pattern, dst_pattern): 序列转换 :param src_pattern: name.####.ext :param dst_pattern: name.####.ext - def frames(self): 获取序列的帧数 :return: <lis...
5fdc4e308191345149b902c5913e2698336630ea
<|skeleton|> class SequenceConverter: def __init__(self, src_pattern, dst_pattern): """序列转换 :param src_pattern: name.####.ext :param dst_pattern: name.####.ext""" <|body_0|> def frames(self): """获取序列的帧数 :return: <list>""" <|body_1|> def file_list(self): """这种情况,sel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SequenceConverter: def __init__(self, src_pattern, dst_pattern): """序列转换 :param src_pattern: name.####.ext :param dst_pattern: name.####.ext""" self.src = src_pattern self.dst = dst_pattern self.dayu_object = DayuPath(self.src) def frames(self): """获取序列的帧数 :return:...
the_stack_v2_python_sparse
mliber_libs/python_libs/sequence_converter/sequence_converter.py
githeshuai/mliber
train
2
a3f701106cf559711e47350e1d107303c6eac275
[ "self.struct_format = '=h'\nself.prefix_length = struct.calcsize(self.struct_format)\nself._unprocessed = ''\nself.PACKET_MAX_LENGTH = 99999", "all_data = self._unprocessed + data\ncurrent_offset = 0\nfmt = self.struct_format\nself._unprocessed = all_data\npacket, result = (None, None)\nwhile len(all_data) >= cur...
<|body_start_0|> self.struct_format = '=h' self.prefix_length = struct.calcsize(self.struct_format) self._unprocessed = '' self.PACKET_MAX_LENGTH = 99999 <|end_body_0|> <|body_start_1|> all_data = self._unprocessed + data current_offset = 0 fmt = self.struct_form...
class docs
NetData
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NetData: """class docs""" def __init__(self): """Constructor""" <|body_0|> def net_wok(self, data): """work 长度取前2个字节""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.struct_format = '=h' self.prefix_length = struct.calcsize(self.stru...
stack_v2_sparse_classes_36k_train_026207
1,438
no_license
[ { "docstring": "Constructor", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "work 长度取前2个字节", "name": "net_wok", "signature": "def net_wok(self, data)" } ]
2
stack_v2_sparse_classes_30k_train_008286
Implement the Python class `NetData` described below. Class description: class docs Method signatures and docstrings: - def __init__(self): Constructor - def net_wok(self, data): work 长度取前2个字节
Implement the Python class `NetData` described below. Class description: class docs Method signatures and docstrings: - def __init__(self): Constructor - def net_wok(self, data): work 长度取前2个字节 <|skeleton|> class NetData: """class docs""" def __init__(self): """Constructor""" <|body_0|> ...
fd5dff2607164f4d8a3fa1c328f72ac540c844ca
<|skeleton|> class NetData: """class docs""" def __init__(self): """Constructor""" <|body_0|> def net_wok(self, data): """work 长度取前2个字节""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NetData: """class docs""" def __init__(self): """Constructor""" self.struct_format = '=h' self.prefix_length = struct.calcsize(self.struct_format) self._unprocessed = '' self.PACKET_MAX_LENGTH = 99999 def net_wok(self, data): """work 长度取前2个字节""" ...
the_stack_v2_python_sparse
client/analysis/netsvc/resolve.py
flaght/mcrawler
train
0
97164383dc7930d4674c89ae1a3ef19f2e886f69
[ "homedir = pwd.getpwnam(user)[5]\nsshdir = os.path.join(homedir, '.ssh')\nkeyfile = os.path.join(sshdir, 'id_dsa.pub')\nif os.path.exists(keyfile):\n return keyfile\nelse:\n keyfile = os.path.join(sshdir, 'id_rsa.pub')\n if os.path.exists(keyfile):\n return keyfile\nreturn False", "homedir = pwd.g...
<|body_start_0|> homedir = pwd.getpwnam(user)[5] sshdir = os.path.join(homedir, '.ssh') keyfile = os.path.join(sshdir, 'id_dsa.pub') if os.path.exists(keyfile): return keyfile else: keyfile = os.path.join(sshdir, 'id_rsa.pub') if os.path.exists...
Generic system administration stuff
SysADM
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SysADM: """Generic system administration stuff""" def findSSHKeyFile(self, user): """return ssh key file if it exists, or False""" <|body_0|> def genSSHKey(self, user): """generate a user SSH key, assuming it's not already created. returns full path to public key...
stack_v2_sparse_classes_36k_train_026208
7,200
permissive
[ { "docstring": "return ssh key file if it exists, or False", "name": "findSSHKeyFile", "signature": "def findSSHKeyFile(self, user)" }, { "docstring": "generate a user SSH key, assuming it's not already created. returns full path to public key file.", "name": "genSSHKey", "signature": "d...
3
stack_v2_sparse_classes_30k_train_013987
Implement the Python class `SysADM` described below. Class description: Generic system administration stuff Method signatures and docstrings: - def findSSHKeyFile(self, user): return ssh key file if it exists, or False - def genSSHKey(self, user): generate a user SSH key, assuming it's not already created. returns fu...
Implement the Python class `SysADM` described below. Class description: Generic system administration stuff Method signatures and docstrings: - def findSSHKeyFile(self, user): return ssh key file if it exists, or False - def genSSHKey(self, user): generate a user SSH key, assuming it's not already created. returns fu...
14812dfbc7bac1d76c4d9e5be2cdf83fc1c391a1
<|skeleton|> class SysADM: """Generic system administration stuff""" def findSSHKeyFile(self, user): """return ssh key file if it exists, or False""" <|body_0|> def genSSHKey(self, user): """generate a user SSH key, assuming it's not already created. returns full path to public key...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SysADM: """Generic system administration stuff""" def findSSHKeyFile(self, user): """return ssh key file if it exists, or False""" homedir = pwd.getpwnam(user)[5] sshdir = os.path.join(homedir, '.ssh') keyfile = os.path.join(sshdir, 'id_dsa.pub') if os.path.exists(...
the_stack_v2_python_sparse
data/python/be83e963dd5f3631631f7c1497f0afdf_appadm.py
maxim5/code-inspector
train
5
5aeaf528d92c7d3d7ac0d98ac36bafe81b1dd06a
[ "if not list_of_files:\n return {}\n_dict = file_handler.retrieve_time_stamp(list_of_files, label=label)\n_time_metadata_dict = MetadataHandler._reformat_dict(dictionary=_dict)\n_beamline_metadata_dict = MetadataHandler.retrieve_beamline_metadata(list_of_files)\n_metadata_dict = combine_dictionaries(master_dicti...
<|body_start_0|> if not list_of_files: return {} _dict = file_handler.retrieve_time_stamp(list_of_files, label=label) _time_metadata_dict = MetadataHandler._reformat_dict(dictionary=_dict) _beamline_metadata_dict = MetadataHandler.retrieve_beamline_metadata(list_of_files) ...
MetadataHandler
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MetadataHandler: def retrieve_metadata(list_of_files=None, display_infos=False, label=''): """dict = {'file1': {'metadata1_key': {'value': value, 'name': name}, 'metadata2_key': {'value': value, 'name': name}, 'metadata3_key': {'value': value, 'name': name}, ... }, ... }""" <|bod...
stack_v2_sparse_classes_36k_train_026209
5,100
permissive
[ { "docstring": "dict = {'file1': {'metadata1_key': {'value': value, 'name': name}, 'metadata2_key': {'value': value, 'name': name}, 'metadata3_key': {'value': value, 'name': name}, ... }, ... }", "name": "retrieve_metadata", "signature": "def retrieve_metadata(list_of_files=None, display_infos=False, la...
3
stack_v2_sparse_classes_30k_train_005433
Implement the Python class `MetadataHandler` described below. Class description: Implement the MetadataHandler class. Method signatures and docstrings: - def retrieve_metadata(list_of_files=None, display_infos=False, label=''): dict = {'file1': {'metadata1_key': {'value': value, 'name': name}, 'metadata2_key': {'valu...
Implement the Python class `MetadataHandler` described below. Class description: Implement the MetadataHandler class. Method signatures and docstrings: - def retrieve_metadata(list_of_files=None, display_infos=False, label=''): dict = {'file1': {'metadata1_key': {'value': value, 'name': name}, 'metadata2_key': {'valu...
70a43a76eaf08f4ac63db3df7fbfb2e5cdb1216e
<|skeleton|> class MetadataHandler: def retrieve_metadata(list_of_files=None, display_infos=False, label=''): """dict = {'file1': {'metadata1_key': {'value': value, 'name': name}, 'metadata2_key': {'value': value, 'name': name}, 'metadata3_key': {'value': value, 'name': name}, ... }, ... }""" <|bod...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MetadataHandler: def retrieve_metadata(list_of_files=None, display_infos=False, label=''): """dict = {'file1': {'metadata1_key': {'value': value, 'name': name}, 'metadata2_key': {'value': value, 'name': name}, 'metadata3_key': {'value': value, 'name': name}, ... }, ... }""" if not list_of_file...
the_stack_v2_python_sparse
notebooks/__code/normalization/metadata_handler.py
neutronimaging/python_notebooks
train
8
8cd8d517e5f6b5fce4b6888148192fc295cb9545
[ "if n == 1 or n == 0 or n == -1:\n return x ** n\nhalf = self.myPow(x, n // 2)\nmod = n % 2\nreturn half * half * x ** mod", "if x == 0:\n return 0\nif n < 0:\n x, n = (1 / x, -n)\nres = 1\nwhile n:\n if n & 1:\n res *= x\n x *= x\n n >>= 1\nreturn res" ]
<|body_start_0|> if n == 1 or n == 0 or n == -1: return x ** n half = self.myPow(x, n // 2) mod = n % 2 return half * half * x ** mod <|end_body_0|> <|body_start_1|> if x == 0: return 0 if n < 0: x, n = (1 / x, -n) res = 1 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def myPow(self, x: float, n: int) -> float: """二分递归相乘,不过仍然有大量重复运算 :param x: :param n: 指数;注意考虑 指数为负的情况 :return:""" <|body_0|> def myPow1(self, x: float, n: int) -> float: """:param x: -100 < x < 100 注意分析 x=0 情况 :param n: 注意分析 负指数情况 :return:""" <|body...
stack_v2_sparse_classes_36k_train_026210
1,071
no_license
[ { "docstring": "二分递归相乘,不过仍然有大量重复运算 :param x: :param n: 指数;注意考虑 指数为负的情况 :return:", "name": "myPow", "signature": "def myPow(self, x: float, n: int) -> float" }, { "docstring": ":param x: -100 < x < 100 注意分析 x=0 情况 :param n: 注意分析 负指数情况 :return:", "name": "myPow1", "signature": "def myPow1(...
2
stack_v2_sparse_classes_30k_train_013859
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def myPow(self, x: float, n: int) -> float: 二分递归相乘,不过仍然有大量重复运算 :param x: :param n: 指数;注意考虑 指数为负的情况 :return: - def myPow1(self, x: float, n: int) -> float: :param x: -100 < x < 10...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def myPow(self, x: float, n: int) -> float: 二分递归相乘,不过仍然有大量重复运算 :param x: :param n: 指数;注意考虑 指数为负的情况 :return: - def myPow1(self, x: float, n: int) -> float: :param x: -100 < x < 10...
4ca0ec2ab9510b12b7e8c65af52dee719f099ea6
<|skeleton|> class Solution: def myPow(self, x: float, n: int) -> float: """二分递归相乘,不过仍然有大量重复运算 :param x: :param n: 指数;注意考虑 指数为负的情况 :return:""" <|body_0|> def myPow1(self, x: float, n: int) -> float: """:param x: -100 < x < 100 注意分析 x=0 情况 :param n: 注意分析 负指数情况 :return:""" <|body...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def myPow(self, x: float, n: int) -> float: """二分递归相乘,不过仍然有大量重复运算 :param x: :param n: 指数;注意考虑 指数为负的情况 :return:""" if n == 1 or n == 0 or n == -1: return x ** n half = self.myPow(x, n // 2) mod = n % 2 return half * half * x ** mod def myPow1(s...
the_stack_v2_python_sparse
offer/16-数值的整数次方.py
JDer-liuodngkai/LeetCode
train
0
27497175e67a23b396b5523e6ddffdfe17ca787a
[ "if hypothesis == '' or references == '':\n if self.metric.__name__ == 'wip':\n max_val = 0.0\n min_val = 1.0\n else:\n max_val = 1.0\n min_val = 0.0\n return _empty_values_score(hypothesis, references, min_val=max_val, max_val=min_val)\nscore = self.metric(truth=references, hyp...
<|body_start_0|> if hypothesis == '' or references == '': if self.metric.__name__ == 'wip': max_val = 0.0 min_val = 1.0 else: max_val = 1.0 min_val = 0.0 return _empty_values_score(hypothesis, references, min_val...
JIWERScore template metric class
JIWERScore
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JIWERScore: """JIWERScore template metric class""" def __call__(self, hypothesis: Union[str, List[str]], references: Union[str, List[str]], **kwargs) -> float: """Compute JIWERScore score of a hypothesis and a reference. Params: hypothesis (str): a hypothesis sentence or a list of hy...
stack_v2_sparse_classes_36k_train_026211
7,252
permissive
[ { "docstring": "Compute JIWERScore score of a hypothesis and a reference. Params: hypothesis (str): a hypothesis sentence or a list of hypothesis sentences reference (str): a reference sentence or a list of reference sentences kwargs: see complete list at: https://github.com/jitsi/jiwer/blob/1fd2a161fd21296640c...
2
stack_v2_sparse_classes_30k_train_006187
Implement the Python class `JIWERScore` described below. Class description: JIWERScore template metric class Method signatures and docstrings: - def __call__(self, hypothesis: Union[str, List[str]], references: Union[str, List[str]], **kwargs) -> float: Compute JIWERScore score of a hypothesis and a reference. Params...
Implement the Python class `JIWERScore` described below. Class description: JIWERScore template metric class Method signatures and docstrings: - def __call__(self, hypothesis: Union[str, List[str]], references: Union[str, List[str]], **kwargs) -> float: Compute JIWERScore score of a hypothesis and a reference. Params...
bef8033d9b9d7ea9797b5a0fdc7558d388bb0bfd
<|skeleton|> class JIWERScore: """JIWERScore template metric class""" def __call__(self, hypothesis: Union[str, List[str]], references: Union[str, List[str]], **kwargs) -> float: """Compute JIWERScore score of a hypothesis and a reference. Params: hypothesis (str): a hypothesis sentence or a list of hy...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class JIWERScore: """JIWERScore template metric class""" def __call__(self, hypothesis: Union[str, List[str]], references: Union[str, List[str]], **kwargs) -> float: """Compute JIWERScore score of a hypothesis and a reference. Params: hypothesis (str): a hypothesis sentence or a list of hypothesis sent...
the_stack_v2_python_sparse
platiagro/metrics_nlp/base.py
platiagro/sdk
train
1
2ec081459688116921fdaf8fccab8274c26377bd
[ "self.root = Node()\nfor word in words:\n insert(self.root, word)\nself.node_list = []", "complete_found = False\nfor i in range(len(self.node_list) - 1, -1, -1):\n if letter in self.node_list[i].d:\n self.node_list[i] = self.node_list[i].d[letter]\n if self.node_list[i].complete:\n ...
<|body_start_0|> self.root = Node() for word in words: insert(self.root, word) self.node_list = [] <|end_body_0|> <|body_start_1|> complete_found = False for i in range(len(self.node_list) - 1, -1, -1): if letter in self.node_list[i].d: se...
StreamChecker
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StreamChecker: def __init__(self, words): """:type words: List[str]""" <|body_0|> def query(self, letter): """:type letter: str :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.root = Node() for word in words: in...
stack_v2_sparse_classes_36k_train_026212
5,756
no_license
[ { "docstring": ":type words: List[str]", "name": "__init__", "signature": "def __init__(self, words)" }, { "docstring": ":type letter: str :rtype: bool", "name": "query", "signature": "def query(self, letter)" } ]
2
null
Implement the Python class `StreamChecker` described below. Class description: Implement the StreamChecker class. Method signatures and docstrings: - def __init__(self, words): :type words: List[str] - def query(self, letter): :type letter: str :rtype: bool
Implement the Python class `StreamChecker` described below. Class description: Implement the StreamChecker class. Method signatures and docstrings: - def __init__(self, words): :type words: List[str] - def query(self, letter): :type letter: str :rtype: bool <|skeleton|> class StreamChecker: def __init__(self, w...
3a2e75238a333843987c6413ab674a7e985c8c01
<|skeleton|> class StreamChecker: def __init__(self, words): """:type words: List[str]""" <|body_0|> def query(self, letter): """:type letter: str :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StreamChecker: def __init__(self, words): """:type words: List[str]""" self.root = Node() for word in words: insert(self.root, word) self.node_list = [] def query(self, letter): """:type letter: str :rtype: bool""" complete_found = False ...
the_stack_v2_python_sparse
coding_practice/tries/stream_of_characters.py
daveboat/interview_prep
train
2
0fbb2829d370ad36e4ee4d5a5ff212c23e4a335a
[ "super(MLP, self).__init__()\nself.hidden_sizes = configs.hidden_sizes\nself.input_size = configs.input_size\nself.output_size = configs.output_size\nself.hidden_activation = getattr(helper_functions, configs.hidden_activation) if 'hidden_activation' in configs.keys() else hidden_activation\nself.output_activation ...
<|body_start_0|> super(MLP, self).__init__() self.hidden_sizes = configs.hidden_sizes self.input_size = configs.input_size self.output_size = configs.output_size self.hidden_activation = getattr(helper_functions, configs.hidden_activation) if 'hidden_activation' in configs.keys()...
Baseline of Multilayer perceptron. Attributes: input_size (int): size of input output_size (int): size of output layer hidden_sizes (list): sizes of hidden layers hidden_activation (function): activation function of hidden layers output_activation (function): activation function of output layer hidden_layers (list): li...
MLP
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MLP: """Baseline of Multilayer perceptron. Attributes: input_size (int): size of input output_size (int): size of output layer hidden_sizes (list): sizes of hidden layers hidden_activation (function): activation function of hidden layers output_activation (function): activation function of output...
stack_v2_sparse_classes_36k_train_026213
7,663
permissive
[ { "docstring": "Initialize.", "name": "__init__", "signature": "def __init__(self, configs: ConfigDict, hidden_activation: Callable=F.relu, linear_layer: nn.Module=nn.Linear, use_output_layer: bool=True, n_category: int=-1, init_fn: Callable=init_layer_uniform)" }, { "docstring": "Forward method...
2
stack_v2_sparse_classes_30k_train_002632
Implement the Python class `MLP` described below. Class description: Baseline of Multilayer perceptron. Attributes: input_size (int): size of input output_size (int): size of output layer hidden_sizes (list): sizes of hidden layers hidden_activation (function): activation function of hidden layers output_activation (f...
Implement the Python class `MLP` described below. Class description: Baseline of Multilayer perceptron. Attributes: input_size (int): size of input output_size (int): size of output layer hidden_sizes (list): sizes of hidden layers hidden_activation (function): activation function of hidden layers output_activation (f...
fdfac4e7056ee5a9d5b48b7b9653ce844a03ca22
<|skeleton|> class MLP: """Baseline of Multilayer perceptron. Attributes: input_size (int): size of input output_size (int): size of output layer hidden_sizes (list): sizes of hidden layers hidden_activation (function): activation function of hidden layers output_activation (function): activation function of output...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MLP: """Baseline of Multilayer perceptron. Attributes: input_size (int): size of input output_size (int): size of output layer hidden_sizes (list): sizes of hidden layers hidden_activation (function): activation function of hidden layers output_activation (function): activation function of output layer hidden...
the_stack_v2_python_sparse
rl_algorithms/common/networks/heads.py
medipixel/rl_algorithms
train
525
cd009a2c2dd786937e4193a1038d2ff40d81b372
[ "self.server_endpoint = server_endpoint\nself.treq_client = treq_client\nif self.treq_client is None:\n import treq\n self.treq_client = treq", "payload = {'alarmTemplate': alarm_template, 'checkTemplate': check_template, 'policyId': policy_id}\nd = self.treq_client.post(append_segments(self.server_endpoint...
<|body_start_0|> self.server_endpoint = server_endpoint self.treq_client = treq_client if self.treq_client is None: import treq self.treq_client = treq <|end_body_0|> <|body_start_1|> payload = {'alarmTemplate': alarm_template, 'checkTemplate': check_template, 'p...
Client for Bobby
BobbyClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BobbyClient: """Client for Bobby""" def __init__(self, server_endpoint, treq_client=None): """Create a Bobby Client :param server_endpoint: Endpoint to use""" <|body_0|> def create_policy(self, tenant_id, group_id, policy_id, check_template, alarm_template): """C...
stack_v2_sparse_classes_36k_train_026214
4,855
permissive
[ { "docstring": "Create a Bobby Client :param server_endpoint: Endpoint to use", "name": "__init__", "signature": "def __init__(self, server_endpoint, treq_client=None)" }, { "docstring": "Create a policy in Bobby. This means that Bobby will start to roll out alarms and checks across all of the s...
4
null
Implement the Python class `BobbyClient` described below. Class description: Client for Bobby Method signatures and docstrings: - def __init__(self, server_endpoint, treq_client=None): Create a Bobby Client :param server_endpoint: Endpoint to use - def create_policy(self, tenant_id, group_id, policy_id, check_templat...
Implement the Python class `BobbyClient` described below. Class description: Client for Bobby Method signatures and docstrings: - def __init__(self, server_endpoint, treq_client=None): Create a Bobby Client :param server_endpoint: Endpoint to use - def create_policy(self, tenant_id, group_id, policy_id, check_templat...
7199cdd67255fe116dbcbedea660c13453671134
<|skeleton|> class BobbyClient: """Client for Bobby""" def __init__(self, server_endpoint, treq_client=None): """Create a Bobby Client :param server_endpoint: Endpoint to use""" <|body_0|> def create_policy(self, tenant_id, group_id, policy_id, check_template, alarm_template): """C...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BobbyClient: """Client for Bobby""" def __init__(self, server_endpoint, treq_client=None): """Create a Bobby Client :param server_endpoint: Endpoint to use""" self.server_endpoint = server_endpoint self.treq_client = treq_client if self.treq_client is None: imp...
the_stack_v2_python_sparse
otter/bobby.py
rackerlabs/otter
train
20
ce64b155e92bbc5a4a0aa16c7ad6c746a4842352
[ "self.get_model = get_model\nassert callable(get_model), get_model\nself.input_signature = input_signature\nself.target_signature = target_signature\nif trainer is None:\n nr_gpu = get_nr_gpu()\n if nr_gpu <= 1:\n trainer = SimpleTrainer()\n else:\n trainer = SyncMultiGPUTrainerParameterServe...
<|body_start_0|> self.get_model = get_model assert callable(get_model), get_model self.input_signature = input_signature self.target_signature = target_signature if trainer is None: nr_gpu = get_nr_gpu() if nr_gpu <= 1: trainer = SimpleTrai...
KerasModel
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KerasModel: def __init__(self, get_model, input_signature=None, target_signature=None, input=None, trainer=None): """Args: get_model (input1, input2, ... -> keras.Model): A function which takes tensors, builds and returns a Keras model. It will be part of the tower function. input_signat...
stack_v2_sparse_classes_36k_train_026215
12,196
permissive
[ { "docstring": "Args: get_model (input1, input2, ... -> keras.Model): A function which takes tensors, builds and returns a Keras model. It will be part of the tower function. input_signature ([tf.TensorSpec]): required. The signature for inputs. target_signature ([tf.TensorSpec]): required. The signature for th...
3
null
Implement the Python class `KerasModel` described below. Class description: Implement the KerasModel class. Method signatures and docstrings: - def __init__(self, get_model, input_signature=None, target_signature=None, input=None, trainer=None): Args: get_model (input1, input2, ... -> keras.Model): A function which t...
Implement the Python class `KerasModel` described below. Class description: Implement the KerasModel class. Method signatures and docstrings: - def __init__(self, get_model, input_signature=None, target_signature=None, input=None, trainer=None): Args: get_model (input1, input2, ... -> keras.Model): A function which t...
1547a54e8546494614ca31c984a1bfd1d0e24b77
<|skeleton|> class KerasModel: def __init__(self, get_model, input_signature=None, target_signature=None, input=None, trainer=None): """Args: get_model (input1, input2, ... -> keras.Model): A function which takes tensors, builds and returns a Keras model. It will be part of the tower function. input_signat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KerasModel: def __init__(self, get_model, input_signature=None, target_signature=None, input=None, trainer=None): """Args: get_model (input1, input2, ... -> keras.Model): A function which takes tensors, builds and returns a Keras model. It will be part of the tower function. input_signature ([tf.Tenso...
the_stack_v2_python_sparse
tensorpack/contrib/keras.py
tensorpack/tensorpack
train
4,600
63f29c22e7ae287a6a7d55727880a80d53550f8d
[ "users = models.CmAlarmUser.objects.all()\nserializer = serializers.CmAlarmUserSerializer(users, many=True)\nreturn Response(serializer.data)", "serializer = serializers.CmAlarmUserSerializer(data=request.DATA)\nif serializer.is_valid():\n d_user_count = models.CmAlarmUser.objects.filter(phone=serializer.data[...
<|body_start_0|> users = models.CmAlarmUser.objects.all() serializer = serializers.CmAlarmUserSerializer(users, many=True) return Response(serializer.data) <|end_body_0|> <|body_start_1|> serializer = serializers.CmAlarmUserSerializer(data=request.DATA) if serializer.is_valid():...
UserList
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserList: def get(self, request): """action : 9.6 get users list :param request: :return:""" <|body_0|> def post(self, request): """acrtion: 9.7 create a new alarm user :param request: :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> users =...
stack_v2_sparse_classes_36k_train_026216
10,115
no_license
[ { "docstring": "action : 9.6 get users list :param request: :return:", "name": "get", "signature": "def get(self, request)" }, { "docstring": "acrtion: 9.7 create a new alarm user :param request: :return:", "name": "post", "signature": "def post(self, request)" } ]
2
stack_v2_sparse_classes_30k_train_013030
Implement the Python class `UserList` described below. Class description: Implement the UserList class. Method signatures and docstrings: - def get(self, request): action : 9.6 get users list :param request: :return: - def post(self, request): acrtion: 9.7 create a new alarm user :param request: :return:
Implement the Python class `UserList` described below. Class description: Implement the UserList class. Method signatures and docstrings: - def get(self, request): action : 9.6 get users list :param request: :return: - def post(self, request): acrtion: 9.7 create a new alarm user :param request: :return: <|skeleton|...
44bc38c2c04fcaa928f58aeb8165fc1fff64bbcd
<|skeleton|> class UserList: def get(self, request): """action : 9.6 get users list :param request: :return:""" <|body_0|> def post(self, request): """acrtion: 9.7 create a new alarm user :param request: :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserList: def get(self, request): """action : 9.6 get users list :param request: :return:""" users = models.CmAlarmUser.objects.all() serializer = serializers.CmAlarmUserSerializer(users, many=True) return Response(serializer.data) def post(self, request): """acrti...
the_stack_v2_python_sparse
trunk/monitor_web/cm_alarm/group_user_views.py
wuhongyang/iass-web
train
0
3a190a21cd5d7bf18adb6f16b73d18c3546493da
[ "assert cloud_name in equation.field_names, f'Field {cloud_name} does not exist in the equation set'\nassert rain_name in equation.field_names, f'Field {rain_name} does not exist in the equation set'\nself.cloud_idx = equation.field_names.index(cloud_name)\nself.rain_idx = equation.field_names.index(rain_name)\nVcl...
<|body_start_0|> assert cloud_name in equation.field_names, f'Field {cloud_name} does not exist in the equation set' assert rain_name in equation.field_names, f'Field {rain_name} does not exist in the equation set' self.cloud_idx = equation.field_names.index(cloud_name) self.rain_idx = e...
Represents the coalescence of cloud droplets to form rain droplets. Coalescence is the process of forming rain droplets from cloud droplets. This scheme performs that process, using two parts: accretion, which is independent of the rain concentration, and auto-accumulation, which is accelerated by the existence of rain...
Coalescence
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Coalescence: """Represents the coalescence of cloud droplets to form rain droplets. Coalescence is the process of forming rain droplets from cloud droplets. This scheme performs that process, using two parts: accretion, which is independent of the rain concentration, and auto-accumulation, which ...
stack_v2_sparse_classes_36k_train_026217
46,841
permissive
[ { "docstring": "Args: equation (:class:`PrognosticEquationSet`): the model's equation. cloud_name (str, optional): name of the cloud variable. Defaults to 'cloud_water'. rain_name (str, optional): name of the rain variable. Defaults to 'rain'. accretion (bool, optional): whether to include the accretion process...
2
stack_v2_sparse_classes_30k_train_012594
Implement the Python class `Coalescence` described below. Class description: Represents the coalescence of cloud droplets to form rain droplets. Coalescence is the process of forming rain droplets from cloud droplets. This scheme performs that process, using two parts: accretion, which is independent of the rain conce...
Implement the Python class `Coalescence` described below. Class description: Represents the coalescence of cloud droplets to form rain droplets. Coalescence is the process of forming rain droplets from cloud droplets. This scheme performs that process, using two parts: accretion, which is independent of the rain conce...
ab93672a84d4a71019abad4249529403e4b0c8d7
<|skeleton|> class Coalescence: """Represents the coalescence of cloud droplets to form rain droplets. Coalescence is the process of forming rain droplets from cloud droplets. This scheme performs that process, using two parts: accretion, which is independent of the rain concentration, and auto-accumulation, which ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Coalescence: """Represents the coalescence of cloud droplets to form rain droplets. Coalescence is the process of forming rain droplets from cloud droplets. This scheme performs that process, using two parts: accretion, which is independent of the rain concentration, and auto-accumulation, which is accelerate...
the_stack_v2_python_sparse
gusto/physics.py
firedrakeproject/gusto
train
10
aa320c154fbed1082647fa73b0e87b802b993cb9
[ "lhs_match = lhs_match or Match.IGNORED\nrhs_match = rhs_match or Match.IGNORED\nif lhs_match == Match.IGNORED:\n return rhs_match\nif rhs_match == Match.IGNORED:\n return lhs_match\nif lhs_match == Match.FAIL:\n return Match.FAIL\nif rhs_match == Match.FAIL:\n return Match.FAIL\nreturn Match.PASS", "...
<|body_start_0|> lhs_match = lhs_match or Match.IGNORED rhs_match = rhs_match or Match.IGNORED if lhs_match == Match.IGNORED: return rhs_match if rhs_match == Match.IGNORED: return lhs_match if lhs_match == Match.FAIL: return Match.FAIL ...
Internal enum. Represents the result of a match.
Match
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Match: """Internal enum. Represents the result of a match.""" def combine(lhs_match, rhs_match): """Combines to match levels into a single match level""" <|body_0|> def from_bool(passed): """Constructs a match description from a boolean value""" <|body_1|...
stack_v2_sparse_classes_36k_train_026218
42,043
permissive
[ { "docstring": "Combines to match levels into a single match level", "name": "combine", "signature": "def combine(lhs_match, rhs_match)" }, { "docstring": "Constructs a match description from a boolean value", "name": "from_bool", "signature": "def from_bool(passed)" }, { "docstr...
3
null
Implement the Python class `Match` described below. Class description: Internal enum. Represents the result of a match. Method signatures and docstrings: - def combine(lhs_match, rhs_match): Combines to match levels into a single match level - def from_bool(passed): Constructs a match description from a boolean value...
Implement the Python class `Match` described below. Class description: Internal enum. Represents the result of a match. Method signatures and docstrings: - def combine(lhs_match, rhs_match): Combines to match levels into a single match level - def from_bool(passed): Constructs a match description from a boolean value...
69c082d2bf9b9985db77d1d25a3f423ecf016e00
<|skeleton|> class Match: """Internal enum. Represents the result of a match.""" def combine(lhs_match, rhs_match): """Combines to match levels into a single match level""" <|body_0|> def from_bool(passed): """Constructs a match description from a boolean value""" <|body_1|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Match: """Internal enum. Represents the result of a match.""" def combine(lhs_match, rhs_match): """Combines to match levels into a single match level""" lhs_match = lhs_match or Match.IGNORED rhs_match = rhs_match or Match.IGNORED if lhs_match == Match.IGNORED: ...
the_stack_v2_python_sparse
testplan/common/utils/comparison.py
morganstanley/testplan
train
78
00cff3ed654eb303c0b8ab1bb1f53329d98f1710
[ "super(SqueezeNomenclature, self).build_from_string(name)\nif len(self.tokens) > 1:\n self.tokens = self.tokens[:-1]", "new_tokens = []\nfor token in tokens:\n if len(token) > 1:\n new_token = token[0].upper() + token[1:]\n else:\n new_token = token.upper()\n new_tokens.append(new_token)...
<|body_start_0|> super(SqueezeNomenclature, self).build_from_string(name) if len(self.tokens) > 1: self.tokens = self.tokens[:-1] <|end_body_0|> <|body_start_1|> new_tokens = [] for token in tokens: if len(token) > 1: new_token = token[0].upper() ...
SqueezeNomenclature
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SqueezeNomenclature: def build_from_string(self, name): """In Squeeze nomenclature, the last token is always the type of the object.""" <|body_0|> def _join_tokens(self, tokens): """In Squeeze nomenclature, the first letter of each token is always in uppercase.""" ...
stack_v2_sparse_classes_36k_train_026219
6,903
permissive
[ { "docstring": "In Squeeze nomenclature, the last token is always the type of the object.", "name": "build_from_string", "signature": "def build_from_string(self, name)" }, { "docstring": "In Squeeze nomenclature, the first letter of each token is always in uppercase.", "name": "_join_tokens...
2
stack_v2_sparse_classes_30k_train_021115
Implement the Python class `SqueezeNomenclature` described below. Class description: Implement the SqueezeNomenclature class. Method signatures and docstrings: - def build_from_string(self, name): In Squeeze nomenclature, the last token is always the type of the object. - def _join_tokens(self, tokens): In Squeeze no...
Implement the Python class `SqueezeNomenclature` described below. Class description: Implement the SqueezeNomenclature class. Method signatures and docstrings: - def build_from_string(self, name): In Squeeze nomenclature, the last token is always the type of the object. - def _join_tokens(self, tokens): In Squeeze no...
132911d908ebc8eebe7a29923936ce03d513c112
<|skeleton|> class SqueezeNomenclature: def build_from_string(self, name): """In Squeeze nomenclature, the last token is always the type of the object.""" <|body_0|> def _join_tokens(self, tokens): """In Squeeze nomenclature, the first letter of each token is always in uppercase.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SqueezeNomenclature: def build_from_string(self, name): """In Squeeze nomenclature, the last token is always the type of the object.""" super(SqueezeNomenclature, self).build_from_string(name) if len(self.tokens) > 1: self.tokens = self.tokens[:-1] def _join_tokens(sel...
the_stack_v2_python_sparse
omtk/rigs/rigSqueeze.py
fsanges/omtk
train
2
ecc7c70f5f32e53034797b5c49abba77c7892873
[ "ref_counts, alt_counts = AD\ntotal_counts = ref_counts + alt_counts\nif not total_counts:\n return 0.0\nreturn alt_counts / total_counts", "self.name = name\nself.record = record\ntarget_sample = [self.record.samples[index] for index in range(len(self.record.samples)) if self.record.samples[index].name == sel...
<|body_start_0|> ref_counts, alt_counts = AD total_counts = ref_counts + alt_counts if not total_counts: return 0.0 return alt_counts / total_counts <|end_body_0|> <|body_start_1|> self.name = name self.record = record target_sample = [self.record.sam...
Object to calculate and store FORMAT information for samples associated with a VCF record (Variant)
Sample
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Sample: """Object to calculate and store FORMAT information for samples associated with a VCF record (Variant)""" def AF_from_AD(AD): """Calculate allele frequency from AD FORMAT field value""" <|body_0|> def __init__(self, name, record, caller): """Initialize th...
stack_v2_sparse_classes_36k_train_026220
25,776
no_license
[ { "docstring": "Calculate allele frequency from AD FORMAT field value", "name": "AF_from_AD", "signature": "def AF_from_AD(AD)" }, { "docstring": "Initialize this object and calculate Args: name (str): the name of the sample from the VCF record (pysam.VariantRecord): record with which this sampl...
6
stack_v2_sparse_classes_30k_train_003024
Implement the Python class `Sample` described below. Class description: Object to calculate and store FORMAT information for samples associated with a VCF record (Variant) Method signatures and docstrings: - def AF_from_AD(AD): Calculate allele frequency from AD FORMAT field value - def __init__(self, name, record, c...
Implement the Python class `Sample` described below. Class description: Object to calculate and store FORMAT information for samples associated with a VCF record (Variant) Method signatures and docstrings: - def AF_from_AD(AD): Calculate allele frequency from AD FORMAT field value - def __init__(self, name, record, c...
4d7989c5e83cdf6fd19ef50df4563a03b326c0c0
<|skeleton|> class Sample: """Object to calculate and store FORMAT information for samples associated with a VCF record (Variant)""" def AF_from_AD(AD): """Calculate allele frequency from AD FORMAT field value""" <|body_0|> def __init__(self, name, record, caller): """Initialize th...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Sample: """Object to calculate and store FORMAT information for samples associated with a VCF record (Variant)""" def AF_from_AD(AD): """Calculate allele frequency from AD FORMAT field value""" ref_counts, alt_counts = AD total_counts = ref_counts + alt_counts if not total...
the_stack_v2_python_sparse
scripts/consensus_merge.py
kids-first/kf-somatic-workflow
train
13
65cde5a8b5950a4d4eaaa10a448481b427392782
[ "count = 0\nresult = []\nfor i in S[::-1]:\n if i != '-':\n count += 1\n result.append(i.upper())\n if count == K:\n result.append('-')\n count = 0\nresult.reverse()\nreturn ''.join(result).lstrip('-')", "S = S.replace('-', '').upper()\nn = len(S)\nnumDash = n // K\nl...
<|body_start_0|> count = 0 result = [] for i in S[::-1]: if i != '-': count += 1 result.append(i.upper()) if count == K: result.append('-') count = 0 result.reverse() return ''.joi...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def licenseKeyFormatting(self, S, K): """:type S: str :type K: int :rtype: str 75ms""" <|body_0|> def licenseKeyFormatting_1(self, S, K): """:type S: str :type K: int :rtype: str 32ms""" <|body_1|> <|end_skeleton|> <|body_start_0|> count =...
stack_v2_sparse_classes_36k_train_026221
2,695
no_license
[ { "docstring": ":type S: str :type K: int :rtype: str 75ms", "name": "licenseKeyFormatting", "signature": "def licenseKeyFormatting(self, S, K)" }, { "docstring": ":type S: str :type K: int :rtype: str 32ms", "name": "licenseKeyFormatting_1", "signature": "def licenseKeyFormatting_1(self...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def licenseKeyFormatting(self, S, K): :type S: str :type K: int :rtype: str 75ms - def licenseKeyFormatting_1(self, S, K): :type S: str :type K: int :rtype: str 32ms
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def licenseKeyFormatting(self, S, K): :type S: str :type K: int :rtype: str 75ms - def licenseKeyFormatting_1(self, S, K): :type S: str :type K: int :rtype: str 32ms <|skeleton|...
679a2b246b8b6bb7fc55ed1c8096d3047d6d4461
<|skeleton|> class Solution: def licenseKeyFormatting(self, S, K): """:type S: str :type K: int :rtype: str 75ms""" <|body_0|> def licenseKeyFormatting_1(self, S, K): """:type S: str :type K: int :rtype: str 32ms""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def licenseKeyFormatting(self, S, K): """:type S: str :type K: int :rtype: str 75ms""" count = 0 result = [] for i in S[::-1]: if i != '-': count += 1 result.append(i.upper()) if count == K: ...
the_stack_v2_python_sparse
LicenseKeyFormatting_MID_482.py
953250587/leetcode-python
train
2
3e56e0bc6a88cfed99a3b9a024311f14daa90b10
[ "super(Group_RDB, self).__init__()\nself.InChan = InChannel\nself.OutChan = OutChannel\nself.G = growRate\nself.C = nConvLayers\nif self.InChan != self.G:\n self.InConv = nn.Conv2d(self.InChan, self.G, 1, padding=0, stride=1)\nif self.OutChan != self.G and self.OutChan != self.InChan:\n self.OutConv = nn.Conv...
<|body_start_0|> super(Group_RDB, self).__init__() self.InChan = InChannel self.OutChan = OutChannel self.G = growRate self.C = nConvLayers if self.InChan != self.G: self.InConv = nn.Conv2d(self.InChan, self.G, 1, padding=0, stride=1) if self.OutChan !...
Group residual dense block.
Group_RDB
[ "Apache-2.0", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Group_RDB: """Group residual dense block.""" def __init__(self, InChannel, OutChannel, growRate, nConvLayers, kSize=3): """Initialize Block. :param InChannel: channel number of input :type InChannel: int :param OutChannel: channel number of output :type OutChannel: int :param growRat...
stack_v2_sparse_classes_36k_train_026222
13,650
permissive
[ { "docstring": "Initialize Block. :param InChannel: channel number of input :type InChannel: int :param OutChannel: channel number of output :type OutChannel: int :param growRate: growth rate of block :type growRate: int :param nConvLayers: the number of convlution layer :type nConvLayers: int :param kSize: ker...
2
stack_v2_sparse_classes_30k_train_003825
Implement the Python class `Group_RDB` described below. Class description: Group residual dense block. Method signatures and docstrings: - def __init__(self, InChannel, OutChannel, growRate, nConvLayers, kSize=3): Initialize Block. :param InChannel: channel number of input :type InChannel: int :param OutChannel: chan...
Implement the Python class `Group_RDB` described below. Class description: Group residual dense block. Method signatures and docstrings: - def __init__(self, InChannel, OutChannel, growRate, nConvLayers, kSize=3): Initialize Block. :param InChannel: channel number of input :type InChannel: int :param OutChannel: chan...
df51ed9c1d6dbde1deef63f2a037a369f8554406
<|skeleton|> class Group_RDB: """Group residual dense block.""" def __init__(self, InChannel, OutChannel, growRate, nConvLayers, kSize=3): """Initialize Block. :param InChannel: channel number of input :type InChannel: int :param OutChannel: channel number of output :type OutChannel: int :param growRat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Group_RDB: """Group residual dense block.""" def __init__(self, InChannel, OutChannel, growRate, nConvLayers, kSize=3): """Initialize Block. :param InChannel: channel number of input :type InChannel: int :param OutChannel: channel number of output :type OutChannel: int :param growRate: growth rat...
the_stack_v2_python_sparse
built-in/TensorFlow/Research/cv/image_classification/Darts_for_TensorFlow/automl/vega/search_space/networks/pytorch/esrbodys/erdb_esr.py
Huawei-Ascend/modelzoo
train
1
e5077a26d041cc9bbed47296fc66fa74cea5ead3
[ "super().__init__(input_tensor_spec=input_tensor_spec, name=name)\nif kernel_initializer is None:\n kernel_initializer = functools.partial(variance_scaling_init, mode='fan_in', distribution='truncated_normal', nonlinearity=activation)\nself._param_length = None\nself._conv_net = None\nif conv_layer_params:\n ...
<|body_start_0|> super().__init__(input_tensor_spec=input_tensor_spec, name=name) if kernel_initializer is None: kernel_initializer = functools.partial(variance_scaling_init, mode='fan_in', distribution='truncated_normal', nonlinearity=activation) self._param_length = None se...
ParamNetwork
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ParamNetwork: def __init__(self, input_tensor_spec, conv_layer_params=None, fc_layer_params=None, use_conv_bias=False, use_conv_ln=False, use_fc_bias=True, use_fc_ln=False, n_groups=None, activation=torch.relu_, kernel_initializer=None, last_layer_size=None, last_activation=None, last_use_bias=T...
stack_v2_sparse_classes_36k_train_026223
14,523
permissive
[ { "docstring": "A network with Fc and conv2D layers that does not maintain its own network parameters, but accepts them from users. If the given parameter tensor has an extra batch dimension (first dimension), it performs parallel operations. Args: input_tensor_spec (nested TensorSpec): the (nested) tensor spec...
4
stack_v2_sparse_classes_30k_train_000404
Implement the Python class `ParamNetwork` described below. Class description: Implement the ParamNetwork class. Method signatures and docstrings: - def __init__(self, input_tensor_spec, conv_layer_params=None, fc_layer_params=None, use_conv_bias=False, use_conv_ln=False, use_fc_bias=True, use_fc_ln=False, n_groups=No...
Implement the Python class `ParamNetwork` described below. Class description: Implement the ParamNetwork class. Method signatures and docstrings: - def __init__(self, input_tensor_spec, conv_layer_params=None, fc_layer_params=None, use_conv_bias=False, use_conv_ln=False, use_fc_bias=True, use_fc_ln=False, n_groups=No...
b00ff2fa5e660de31020338ba340263183fbeaa4
<|skeleton|> class ParamNetwork: def __init__(self, input_tensor_spec, conv_layer_params=None, fc_layer_params=None, use_conv_bias=False, use_conv_ln=False, use_fc_bias=True, use_fc_ln=False, n_groups=None, activation=torch.relu_, kernel_initializer=None, last_layer_size=None, last_activation=None, last_use_bias=T...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ParamNetwork: def __init__(self, input_tensor_spec, conv_layer_params=None, fc_layer_params=None, use_conv_bias=False, use_conv_ln=False, use_fc_bias=True, use_fc_ln=False, n_groups=None, activation=torch.relu_, kernel_initializer=None, last_layer_size=None, last_activation=None, last_use_bias=True, last_use_...
the_stack_v2_python_sparse
alf/networks/param_networks.py
HorizonRobotics/alf
train
288
10164d4fee1539138eb78fa575966d63b226c8e1
[ "self.name = name\nself.protocol = protocol\nself.public_port = public_port\nself.local_ip = local_ip\nself.local_port = local_port\nself.allowed_ips = allowed_ips", "if dictionary is None:\n return None\nname = dictionary.get('name')\nprotocol = dictionary.get('protocol')\npublic_port = dictionary.get('public...
<|body_start_0|> self.name = name self.protocol = protocol self.public_port = public_port self.local_ip = local_ip self.local_port = local_port self.allowed_ips = allowed_ips <|end_body_0|> <|body_start_1|> if dictionary is None: return None n...
Implementation of the 'PortRule' model. TODO: type model description here. Attributes: name (string): A description of the rule protocol (Protocol3Enum): 'tcp' or 'udp' public_port (string): Destination port of the traffic that is arriving on the WAN local_ip (string): Local IP address to which traffic will be forwarde...
PortRuleModel
[ "MIT", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PortRuleModel: """Implementation of the 'PortRule' model. TODO: type model description here. Attributes: name (string): A description of the rule protocol (Protocol3Enum): 'tcp' or 'udp' public_port (string): Destination port of the traffic that is arriving on the WAN local_ip (string): Local IP ...
stack_v2_sparse_classes_36k_train_026224
3,031
permissive
[ { "docstring": "Constructor for the PortRuleModel class", "name": "__init__", "signature": "def __init__(self, name=None, protocol=None, public_port=None, local_ip=None, local_port=None, allowed_ips=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (d...
2
null
Implement the Python class `PortRuleModel` described below. Class description: Implementation of the 'PortRule' model. TODO: type model description here. Attributes: name (string): A description of the rule protocol (Protocol3Enum): 'tcp' or 'udp' public_port (string): Destination port of the traffic that is arriving ...
Implement the Python class `PortRuleModel` described below. Class description: Implementation of the 'PortRule' model. TODO: type model description here. Attributes: name (string): A description of the rule protocol (Protocol3Enum): 'tcp' or 'udp' public_port (string): Destination port of the traffic that is arriving ...
9894089eb013318243ae48869cc5130eb37f80c0
<|skeleton|> class PortRuleModel: """Implementation of the 'PortRule' model. TODO: type model description here. Attributes: name (string): A description of the rule protocol (Protocol3Enum): 'tcp' or 'udp' public_port (string): Destination port of the traffic that is arriving on the WAN local_ip (string): Local IP ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PortRuleModel: """Implementation of the 'PortRule' model. TODO: type model description here. Attributes: name (string): A description of the rule protocol (Protocol3Enum): 'tcp' or 'udp' public_port (string): Destination port of the traffic that is arriving on the WAN local_ip (string): Local IP address to wh...
the_stack_v2_python_sparse
meraki_sdk/models/port_rule_model.py
RaulCatalano/meraki-python-sdk
train
1
5ad93cb5d267f0bfd68bc11e8230f81b97927e97
[ "n = len(nums)\nif n < 3:\n return False\nleft_min = nums[0]\nrights = SortedList(nums[2:])\nfor j in range(1, n - 1):\n if left_min < nums[j]:\n idx = rights.bisect_right(left_min)\n if idx != len(rights) and rights[idx] < nums[j]:\n return True\n left_min = min(left_min, nums[j])...
<|body_start_0|> n = len(nums) if n < 3: return False left_min = nums[0] rights = SortedList(nums[2:]) for j in range(1, n - 1): if left_min < nums[j]: idx = rights.bisect_right(left_min) if idx != len(rights) and rights[idx...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def find132pattern(self, nums: List[int]) -> bool: """O(nlogn)""" <|body_0|> def find132pattern(self, nums: List[int]) -> bool: """O(n) 单调栈""" <|body_1|> <|end_skeleton|> <|body_start_0|> n = len(nums) if n < 3: return ...
stack_v2_sparse_classes_36k_train_026225
1,107
no_license
[ { "docstring": "O(nlogn)", "name": "find132pattern", "signature": "def find132pattern(self, nums: List[int]) -> bool" }, { "docstring": "O(n) 单调栈", "name": "find132pattern", "signature": "def find132pattern(self, nums: List[int]) -> bool" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find132pattern(self, nums: List[int]) -> bool: O(nlogn) - def find132pattern(self, nums: List[int]) -> bool: O(n) 单调栈
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find132pattern(self, nums: List[int]) -> bool: O(nlogn) - def find132pattern(self, nums: List[int]) -> bool: O(n) 单调栈 <|skeleton|> class Solution: def find132pattern(se...
26a467dfe8acd8ae4be0cd2784d79eebf09c06ce
<|skeleton|> class Solution: def find132pattern(self, nums: List[int]) -> bool: """O(nlogn)""" <|body_0|> def find132pattern(self, nums: List[int]) -> bool: """O(n) 单调栈""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def find132pattern(self, nums: List[int]) -> bool: """O(nlogn)""" n = len(nums) if n < 3: return False left_min = nums[0] rights = SortedList(nums[2:]) for j in range(1, n - 1): if left_min < nums[j]: idx = right...
the_stack_v2_python_sparse
FuckLeetcode/456.132 模式.py
Alex-Beng/ojs
train
0
d0b3d3db9aab6110be1759054cc99c17449711d2
[ "super(SemanticLidar, self).__init__(carla_actor=carla_actor, parent=parent, node=node, synchronous_mode=synchronous_mode, prefix='semantic_lidar/' + carla_actor.attributes.get('role_name'))\nself.semantic_lidar_publisher = rospy.Publisher(self.get_topic_prefix() + '/point_cloud', PointCloud2, queue_size=10)\nself....
<|body_start_0|> super(SemanticLidar, self).__init__(carla_actor=carla_actor, parent=parent, node=node, synchronous_mode=synchronous_mode, prefix='semantic_lidar/' + carla_actor.attributes.get('role_name')) self.semantic_lidar_publisher = rospy.Publisher(self.get_topic_prefix() + '/point_cloud', PointCl...
Actor implementation details for semantic lidars
SemanticLidar
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SemanticLidar: """Actor implementation details for semantic lidars""" def __init__(self, carla_actor, parent, node, synchronous_mode): """Constructor :param carla_actor: carla actor object :type carla_actor: carla.Actor :param parent: the parent of this :type parent: carla_ros_bridge...
stack_v2_sparse_classes_36k_train_026226
5,360
permissive
[ { "docstring": "Constructor :param carla_actor: carla actor object :type carla_actor: carla.Actor :param parent: the parent of this :type parent: carla_ros_bridge.Parent :param node: node-handle :type node: carla_ros_bridge.CarlaRosBridge", "name": "__init__", "signature": "def __init__(self, carla_acto...
2
stack_v2_sparse_classes_30k_train_018951
Implement the Python class `SemanticLidar` described below. Class description: Actor implementation details for semantic lidars Method signatures and docstrings: - def __init__(self, carla_actor, parent, node, synchronous_mode): Constructor :param carla_actor: carla actor object :type carla_actor: carla.Actor :param ...
Implement the Python class `SemanticLidar` described below. Class description: Actor implementation details for semantic lidars Method signatures and docstrings: - def __init__(self, carla_actor, parent, node, synchronous_mode): Constructor :param carla_actor: carla actor object :type carla_actor: carla.Actor :param ...
65ba2fdb2ca24907083bc277ec333294ab174fa6
<|skeleton|> class SemanticLidar: """Actor implementation details for semantic lidars""" def __init__(self, carla_actor, parent, node, synchronous_mode): """Constructor :param carla_actor: carla actor object :type carla_actor: carla.Actor :param parent: the parent of this :type parent: carla_ros_bridge...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SemanticLidar: """Actor implementation details for semantic lidars""" def __init__(self, carla_actor, parent, node, synchronous_mode): """Constructor :param carla_actor: carla actor object :type carla_actor: carla.Actor :param parent: the parent of this :type parent: carla_ros_bridge.Parent :para...
the_stack_v2_python_sparse
ros/ros-bridge/carla_ros_bridge/src/carla_ros_bridge/lidar.py
Essentia-Laboratory/intelligent-embedded-systems
train
3
3d6cb4a82092bed82b0b7818f2f697f3293a3073
[ "for pair in self.non_infinite_loop_pairs:\n self.assertFalse(results_in_infinite_loop(pair[0], pair[1]))\n self.assertTrue(is_power_of_two(pair[0] + pair[1]))", "for pair in self.infinite_loop_pairs:\n self.assertTrue(results_in_infinite_loop(pair[0], pair[1]))\n self.assertFalse(is_power_of_two(pair...
<|body_start_0|> for pair in self.non_infinite_loop_pairs: self.assertFalse(results_in_infinite_loop(pair[0], pair[1])) self.assertTrue(is_power_of_two(pair[0] + pair[1])) <|end_body_0|> <|body_start_1|> for pair in self.infinite_loop_pairs: self.assertTrue(results_i...
LoopTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoopTests: def test_no_loop_if_sum_is_power_of_two(self): """Do not loop when the sum of the pair of numbers IS a power of 2 i.e., if the pair of numbers will NOT enter an infinite loop, the sum of the pairs are powers of 2""" <|body_0|> def test_loop_if_sum_is_not_power_of_...
stack_v2_sparse_classes_36k_train_026227
23,320
no_license
[ { "docstring": "Do not loop when the sum of the pair of numbers IS a power of 2 i.e., if the pair of numbers will NOT enter an infinite loop, the sum of the pairs are powers of 2", "name": "test_no_loop_if_sum_is_power_of_two", "signature": "def test_no_loop_if_sum_is_power_of_two(self)" }, { "d...
2
stack_v2_sparse_classes_30k_train_019731
Implement the Python class `LoopTests` described below. Class description: Implement the LoopTests class. Method signatures and docstrings: - def test_no_loop_if_sum_is_power_of_two(self): Do not loop when the sum of the pair of numbers IS a power of 2 i.e., if the pair of numbers will NOT enter an infinite loop, the...
Implement the Python class `LoopTests` described below. Class description: Implement the LoopTests class. Method signatures and docstrings: - def test_no_loop_if_sum_is_power_of_two(self): Do not loop when the sum of the pair of numbers IS a power of 2 i.e., if the pair of numbers will NOT enter an infinite loop, the...
d8b9bb69f9ca12565200e99efb575988de10185e
<|skeleton|> class LoopTests: def test_no_loop_if_sum_is_power_of_two(self): """Do not loop when the sum of the pair of numbers IS a power of 2 i.e., if the pair of numbers will NOT enter an infinite loop, the sum of the pairs are powers of 2""" <|body_0|> def test_loop_if_sum_is_not_power_of_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LoopTests: def test_no_loop_if_sum_is_power_of_two(self): """Do not loop when the sum of the pair of numbers IS a power of 2 i.e., if the pair of numbers will NOT enter an infinite loop, the sum of the pairs are powers of 2""" for pair in self.non_infinite_loop_pairs: self.assertFa...
the_stack_v2_python_sparse
Level_4/7_DistractTheTrainers/solution.py
ken-power/Foobar_Challenge
train
5
f0680e6efd13e740ed9c035196b21bbc77487efe
[ "if not Path('state.dump').exists():\n logger.info('CHECK: dump file does not exist, creating a new one')\n engine_data = os.environ.get('postgres')\n psql = create_engine(engine_data, connect_args={'options': '-csearch_path=content'})\n tables_states = {}\n which_time_to_get = {'film_work': 'min', '...
<|body_start_0|> if not Path('state.dump').exists(): logger.info('CHECK: dump file does not exist, creating a new one') engine_data = os.environ.get('postgres') psql = create_engine(engine_data, connect_args={'options': '-csearch_path=content'}) tables_states = {}...
BaseStorage
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseStorage: def get_initial_data(self): """If not yet exist creates dump file with initial update dates in psql :return: None""" <|body_0|> def save_state(self, updated_at: str) -> None: """Saves key:value of a state. All states are in one file if form: table_name: ...
stack_v2_sparse_classes_36k_train_026228
2,737
no_license
[ { "docstring": "If not yet exist creates dump file with initial update dates in psql :return: None", "name": "get_initial_data", "signature": "def get_initial_data(self)" }, { "docstring": "Saves key:value of a state. All states are in one file if form: table_name: updated_at If file with state ...
3
stack_v2_sparse_classes_30k_train_008107
Implement the Python class `BaseStorage` described below. Class description: Implement the BaseStorage class. Method signatures and docstrings: - def get_initial_data(self): If not yet exist creates dump file with initial update dates in psql :return: None - def save_state(self, updated_at: str) -> None: Saves key:va...
Implement the Python class `BaseStorage` described below. Class description: Implement the BaseStorage class. Method signatures and docstrings: - def get_initial_data(self): If not yet exist creates dump file with initial update dates in psql :return: None - def save_state(self, updated_at: str) -> None: Saves key:va...
4ddc8a77e5a9e9bc2a900c7bb6ffbcf5999e8c89
<|skeleton|> class BaseStorage: def get_initial_data(self): """If not yet exist creates dump file with initial update dates in psql :return: None""" <|body_0|> def save_state(self, updated_at: str) -> None: """Saves key:value of a state. All states are in one file if form: table_name: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseStorage: def get_initial_data(self): """If not yet exist creates dump file with initial update dates in psql :return: None""" if not Path('state.dump').exists(): logger.info('CHECK: dump file does not exist, creating a new one') engine_data = os.environ.get('postgre...
the_stack_v2_python_sparse
postgres_to_es/state_tracking.py
maffka123/Admin_panel_sprint_2
train
0
0d7435c9c3f78fea8212d02288beb662458c31ff
[ "message = get_object_or_404(Message, pk=message_id)\nserializer = MessageSerializer(message)\nreturn Response(serializer.data)", "message = get_object_or_404(Event, pk=message_id)\nmessage.delete()\nreturn Response(status=status.HTTP_204_NO_CONTENT)" ]
<|body_start_0|> message = get_object_or_404(Message, pk=message_id) serializer = MessageSerializer(message) return Response(serializer.data) <|end_body_0|> <|body_start_1|> message = get_object_or_404(Event, pk=message_id) message.delete() return Response(status=status....
MessageDetail
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MessageDetail: def get(self, request, message_id, format=None): """Get message detail --- serializer: administrator.serializers.MessageSerializer""" <|body_0|> def delete(self, request, message_id, format=None): """Delete message (you cannot revert this change) --- s...
stack_v2_sparse_classes_36k_train_026229
30,608
permissive
[ { "docstring": "Get message detail --- serializer: administrator.serializers.MessageSerializer", "name": "get", "signature": "def get(self, request, message_id, format=None)" }, { "docstring": "Delete message (you cannot revert this change) --- serializer: administrator.serializers.MessageSerial...
2
stack_v2_sparse_classes_30k_train_008332
Implement the Python class `MessageDetail` described below. Class description: Implement the MessageDetail class. Method signatures and docstrings: - def get(self, request, message_id, format=None): Get message detail --- serializer: administrator.serializers.MessageSerializer - def delete(self, request, message_id, ...
Implement the Python class `MessageDetail` described below. Class description: Implement the MessageDetail class. Method signatures and docstrings: - def get(self, request, message_id, format=None): Get message detail --- serializer: administrator.serializers.MessageSerializer - def delete(self, request, message_id, ...
73728463badb3bfd4413aa0f7aeb44a9606fdfea
<|skeleton|> class MessageDetail: def get(self, request, message_id, format=None): """Get message detail --- serializer: administrator.serializers.MessageSerializer""" <|body_0|> def delete(self, request, message_id, format=None): """Delete message (you cannot revert this change) --- s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MessageDetail: def get(self, request, message_id, format=None): """Get message detail --- serializer: administrator.serializers.MessageSerializer""" message = get_object_or_404(Message, pk=message_id) serializer = MessageSerializer(message) return Response(serializer.data) ...
the_stack_v2_python_sparse
administrator/views.py
belatrix/BackendAllStars
train
5
fff124458b642f6f1196eccbc6244b29d9a0c547
[ "self.input = input_object\nself.output = output_object\nreturn self.handle()", "self.output = PyStratumStyle(self.input, self.output)\ncommand = self.get_application().find('constants')\nret = command.execute(self.input, self.output)\nif ret:\n return ret\ncommand = self.get_application().find('loader')\nret ...
<|body_start_0|> self.input = input_object self.output = output_object return self.handle() <|end_body_0|> <|body_start_1|> self.output = PyStratumStyle(self.input, self.output) command = self.get_application().find('constants') ret = command.execute(self.input, self.out...
Loads stored routines and generates a wrapper class stratum {config_file : The stratum configuration file} {file_names?* : Sources with stored routines}
PyStratumCommand
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PyStratumCommand: """Loads stored routines and generates a wrapper class stratum {config_file : The stratum configuration file} {file_names?* : Sources with stored routines}""" def execute(self, input_object: Input, output_object: Output) -> int: """Executes this command.""" ...
stack_v2_sparse_classes_36k_train_026230
1,572
permissive
[ { "docstring": "Executes this command.", "name": "execute", "signature": "def execute(self, input_object: Input, output_object: Output) -> int" }, { "docstring": "Executes the actual Stratum program.", "name": "handle", "signature": "def handle(self) -> int" } ]
2
stack_v2_sparse_classes_30k_train_004828
Implement the Python class `PyStratumCommand` described below. Class description: Loads stored routines and generates a wrapper class stratum {config_file : The stratum configuration file} {file_names?* : Sources with stored routines} Method signatures and docstrings: - def execute(self, input_object: Input, output_o...
Implement the Python class `PyStratumCommand` described below. Class description: Loads stored routines and generates a wrapper class stratum {config_file : The stratum configuration file} {file_names?* : Sources with stored routines} Method signatures and docstrings: - def execute(self, input_object: Input, output_o...
52484003b431f2c42c1c29959fe7a2ba3bd38515
<|skeleton|> class PyStratumCommand: """Loads stored routines and generates a wrapper class stratum {config_file : The stratum configuration file} {file_names?* : Sources with stored routines}""" def execute(self, input_object: Input, output_object: Output) -> int: """Executes this command.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PyStratumCommand: """Loads stored routines and generates a wrapper class stratum {config_file : The stratum configuration file} {file_names?* : Sources with stored routines}""" def execute(self, input_object: Input, output_object: Output) -> int: """Executes this command.""" self.input = ...
the_stack_v2_python_sparse
pystratum/command/PyStratumCommand.py
cryptobuks1/py-stratum
train
0
571decb2462cdbde483836a9cc776f31c84606d3
[ "dp = [-100 for _ in range(len(nums))]\ndp[0] = nums[0]\nfor i in range(1, len(nums)):\n for j in range(i + 1):\n dp[i] = max([dp[i], sum(nums[j:i + 1])])\nreturn max(dp)", "dp = [-100 for _ in range(len(nums))]\ndp[0] = nums[0]\nfor i in range(1, len(nums)):\n dp[i] = dp[i - 1] + max(nums[i - 1], 0)...
<|body_start_0|> dp = [-100 for _ in range(len(nums))] dp[0] = nums[0] for i in range(1, len(nums)): for j in range(i + 1): dp[i] = max([dp[i], sum(nums[j:i + 1])]) return max(dp) <|end_body_0|> <|body_start_1|> dp = [-100 for _ in range(len(nums))] ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxSubArray_fail(self, nums): """暴力法 :param nums: :return:""" <|body_0|> def maxSubArray_self(self, nums): """暴力法 :param nums: :return:""" <|body_1|> def maxSubArray(self, nums): """f(n+1) 只与 f(n) 与 nums[n+1]有关 只要nums[n+1]>0 则f(n)必然...
stack_v2_sparse_classes_36k_train_026231
2,523
no_license
[ { "docstring": "暴力法 :param nums: :return:", "name": "maxSubArray_fail", "signature": "def maxSubArray_fail(self, nums)" }, { "docstring": "暴力法 :param nums: :return:", "name": "maxSubArray_self", "signature": "def maxSubArray_self(self, nums)" }, { "docstring": "f(n+1) 只与 f(n) 与 n...
3
stack_v2_sparse_classes_30k_val_000628
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxSubArray_fail(self, nums): 暴力法 :param nums: :return: - def maxSubArray_self(self, nums): 暴力法 :param nums: :return: - def maxSubArray(self, nums): f(n+1) 只与 f(n) 与 nums[n+1...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxSubArray_fail(self, nums): 暴力法 :param nums: :return: - def maxSubArray_self(self, nums): 暴力法 :param nums: :return: - def maxSubArray(self, nums): f(n+1) 只与 f(n) 与 nums[n+1...
e12ead66d28175d34b51eac4ccdd6de06eb4d92d
<|skeleton|> class Solution: def maxSubArray_fail(self, nums): """暴力法 :param nums: :return:""" <|body_0|> def maxSubArray_self(self, nums): """暴力法 :param nums: :return:""" <|body_1|> def maxSubArray(self, nums): """f(n+1) 只与 f(n) 与 nums[n+1]有关 只要nums[n+1]>0 则f(n)必然...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxSubArray_fail(self, nums): """暴力法 :param nums: :return:""" dp = [-100 for _ in range(len(nums))] dp[0] = nums[0] for i in range(1, len(nums)): for j in range(i + 1): dp[i] = max([dp[i], sum(nums[j:i + 1])]) return max(dp) ...
the_stack_v2_python_sparse
df_42_maxSubArray.py
zhenglinghan/leetcode_jianzhi_Offer
train
2
89d9756f78aab8677e4c58945eb4814f305a3da6
[ "l1 = len(word1)\nl2 = len(word2)\ndp = [[0 for i in range(l1 + 1)] for i in range(l2 + 1)]\nfor i in range(1, l1 + 1):\n dp[0][i] = i\nfor i in range(1, l2 + 1):\n dp[i][0] = i\nfor i in range(1, l2 + 1):\n for j in range(1, l1 + 1):\n if word2[i - 1] == word1[j - 1]:\n dp[i][j] = dp[i -...
<|body_start_0|> l1 = len(word1) l2 = len(word2) dp = [[0 for i in range(l1 + 1)] for i in range(l2 + 1)] for i in range(1, l1 + 1): dp[0][i] = i for i in range(1, l2 + 1): dp[i][0] = i for i in range(1, l2 + 1): for j in range(1, l1 + ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def minDistance(self, word1, word2): """:type word1: str :type word2: str :rtype: int""" <|body_0|> def minDistance_self(self, word1, word2): """:type word1: str :type word2: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_026232
1,819
no_license
[ { "docstring": ":type word1: str :type word2: str :rtype: int", "name": "minDistance", "signature": "def minDistance(self, word1, word2)" }, { "docstring": ":type word1: str :type word2: str :rtype: int", "name": "minDistance_self", "signature": "def minDistance_self(self, word1, word2)"...
2
stack_v2_sparse_classes_30k_train_014924
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minDistance(self, word1, word2): :type word1: str :type word2: str :rtype: int - def minDistance_self(self, word1, word2): :type word1: str :type word2: str :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minDistance(self, word1, word2): :type word1: str :type word2: str :rtype: int - def minDistance_self(self, word1, word2): :type word1: str :type word2: str :rtype: int <|sk...
ea492ec864b50547214ecbbb2cdeeac21e70229b
<|skeleton|> class Solution: def minDistance(self, word1, word2): """:type word1: str :type word2: str :rtype: int""" <|body_0|> def minDistance_self(self, word1, word2): """:type word1: str :type word2: str :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def minDistance(self, word1, word2): """:type word1: str :type word2: str :rtype: int""" l1 = len(word1) l2 = len(word2) dp = [[0 for i in range(l1 + 1)] for i in range(l2 + 1)] for i in range(1, l1 + 1): dp[0][i] = i for i in range(1, l2 +...
the_stack_v2_python_sparse
72_edit_distance/sol.py
lianke123321/leetcode_sol
train
0
0f031c0b23b317cda83cbecb0005207764d961e5
[ "outZipFile = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED)\nfor idx, dir in enumerate(directory_list):\n if not os.path.exists(dir):\n print(f'Error, directory {dir} does not exist')\n continue\n rootdir = os.path.basename(dir)\n try:\n os.listdir(dir)\n for dirpath, dirn...
<|body_start_0|> outZipFile = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED) for idx, dir in enumerate(directory_list): if not os.path.exists(dir): print(f'Error, directory {dir} does not exist') continue rootdir = os.path.basename(dir) ...
Functions for accessing local files.
Local
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Local: """Functions for accessing local files.""" def zip_dir(cls, directory_list, zipname): """Compress a directory into a single ZIP file. :param directory_list: List of files to compress into zip file. :param zipname: Name of zip file to compress files into. :return: Zip file cont...
stack_v2_sparse_classes_36k_train_026233
12,445
permissive
[ { "docstring": "Compress a directory into a single ZIP file. :param directory_list: List of files to compress into zip file. :param zipname: Name of zip file to compress files into. :return: Zip file containing files.", "name": "zip_dir", "signature": "def zip_dir(cls, directory_list, zipname)" }, {...
6
stack_v2_sparse_classes_30k_train_019838
Implement the Python class `Local` described below. Class description: Functions for accessing local files. Method signatures and docstrings: - def zip_dir(cls, directory_list, zipname): Compress a directory into a single ZIP file. :param directory_list: List of files to compress into zip file. :param zipname: Name o...
Implement the Python class `Local` described below. Class description: Functions for accessing local files. Method signatures and docstrings: - def zip_dir(cls, directory_list, zipname): Compress a directory into a single ZIP file. :param directory_list: List of files to compress into zip file. :param zipname: Name o...
f200ccd224170761ed6a73ae8adf84972af2213d
<|skeleton|> class Local: """Functions for accessing local files.""" def zip_dir(cls, directory_list, zipname): """Compress a directory into a single ZIP file. :param directory_list: List of files to compress into zip file. :param zipname: Name of zip file to compress files into. :return: Zip file cont...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Local: """Functions for accessing local files.""" def zip_dir(cls, directory_list, zipname): """Compress a directory into a single ZIP file. :param directory_list: List of files to compress into zip file. :param zipname: Name of zip file to compress files into. :return: Zip file containing files....
the_stack_v2_python_sparse
fusetools/transfer_tools.py
TrendingTechnology/fusetools
train
0
ea86e129cb5a2ab072541b7dfca40534645a92c4
[ "Menu.__init__(self, master)\nroot.configure(menu=self)\nself.menuFichier = Menu(self, tearoff=0)\nself.menuEdition = Menu(self, tearoff=0)\nself.menuAffichage = Menu(self, tearoff=0)\nself.add_cascade(label='Fichier', menu=self.menuFichier)\nself.add_cascade(label='Edition', menu=self.menuEdition)\nself.add_cascad...
<|body_start_0|> Menu.__init__(self, master) root.configure(menu=self) self.menuFichier = Menu(self, tearoff=0) self.menuEdition = Menu(self, tearoff=0) self.menuAffichage = Menu(self, tearoff=0) self.add_cascade(label='Fichier', menu=self.menuFichier) self.add_ca...
Classe de la barre de menus.
MenuBar
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MenuBar: """Classe de la barre de menus.""" def __init__(self, root, master): """Constructeur de la barre de menus. @param root: fenêtre sur laquelle mettre cette barre de menus. @param master: l'Application du programme.""" <|body_0|> def __getBindingOf(self, bindingVir...
stack_v2_sparse_classes_36k_train_026234
2,550
no_license
[ { "docstring": "Constructeur de la barre de menus. @param root: fenêtre sur laquelle mettre cette barre de menus. @param master: l'Application du programme.", "name": "__init__", "signature": "def __init__(self, root, master)" }, { "docstring": "@param bindingVirtuel : <str> nom du bindings dont...
2
stack_v2_sparse_classes_30k_train_008563
Implement the Python class `MenuBar` described below. Class description: Classe de la barre de menus. Method signatures and docstrings: - def __init__(self, root, master): Constructeur de la barre de menus. @param root: fenêtre sur laquelle mettre cette barre de menus. @param master: l'Application du programme. - def...
Implement the Python class `MenuBar` described below. Class description: Classe de la barre de menus. Method signatures and docstrings: - def __init__(self, root, master): Constructeur de la barre de menus. @param root: fenêtre sur laquelle mettre cette barre de menus. @param master: l'Application du programme. - def...
f59e9d491fe1d60654fad5357474763e4755f13a
<|skeleton|> class MenuBar: """Classe de la barre de menus.""" def __init__(self, root, master): """Constructeur de la barre de menus. @param root: fenêtre sur laquelle mettre cette barre de menus. @param master: l'Application du programme.""" <|body_0|> def __getBindingOf(self, bindingVir...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MenuBar: """Classe de la barre de menus.""" def __init__(self, root, master): """Constructeur de la barre de menus. @param root: fenêtre sur laquelle mettre cette barre de menus. @param master: l'Application du programme.""" Menu.__init__(self, master) root.configure(menu=self) ...
the_stack_v2_python_sparse
TaskManager/MenuBar.py
Zetrypio/TaskManager
train
2
0960020f36e83c50446ef6ea1006b6c5531c6f8d
[ "e = std.runtime_error('runtime pb!!')\nself.assertTrue(e)\nself.assertEqual(e.what(), 'runtime pb!!')", "ROOT.gInterpreter.Declare('\\n namespace test2Exception {\\n template <typename T>\\n class Handle;\\n\\n class Exception : public std::exception {};\\n }\\n\\n template...
<|body_start_0|> e = std.runtime_error('runtime pb!!') self.assertTrue(e) self.assertEqual(e.what(), 'runtime pb!!') <|end_body_0|> <|body_start_1|> ROOT.gInterpreter.Declare('\n namespace test2Exception {\n template <typename T>\n class Handle;\n\n class Ex...
Cpp10StandardExceptions
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Cpp10StandardExceptions: def test1StandardExceptionsAccessFromPython(self): """Access C++ standard exception objects from python""" <|body_0|> def test2ExceptionBoolValue(self): """Test boolean value of exception object""" <|body_1|> <|end_skeleton|> <|body...
stack_v2_sparse_classes_36k_train_026235
30,462
no_license
[ { "docstring": "Access C++ standard exception objects from python", "name": "test1StandardExceptionsAccessFromPython", "signature": "def test1StandardExceptionsAccessFromPython(self)" }, { "docstring": "Test boolean value of exception object", "name": "test2ExceptionBoolValue", "signatur...
2
stack_v2_sparse_classes_30k_train_004845
Implement the Python class `Cpp10StandardExceptions` described below. Class description: Implement the Cpp10StandardExceptions class. Method signatures and docstrings: - def test1StandardExceptionsAccessFromPython(self): Access C++ standard exception objects from python - def test2ExceptionBoolValue(self): Test boole...
Implement the Python class `Cpp10StandardExceptions` described below. Class description: Implement the Cpp10StandardExceptions class. Method signatures and docstrings: - def test1StandardExceptionsAccessFromPython(self): Access C++ standard exception objects from python - def test2ExceptionBoolValue(self): Test boole...
134508460915282a5d82d6cbbb6e6afa14653413
<|skeleton|> class Cpp10StandardExceptions: def test1StandardExceptionsAccessFromPython(self): """Access C++ standard exception objects from python""" <|body_0|> def test2ExceptionBoolValue(self): """Test boolean value of exception object""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Cpp10StandardExceptions: def test1StandardExceptionsAccessFromPython(self): """Access C++ standard exception objects from python""" e = std.runtime_error('runtime pb!!') self.assertTrue(e) self.assertEqual(e.what(), 'runtime pb!!') def test2ExceptionBoolValue(self): ...
the_stack_v2_python_sparse
python/cpp/PyROOT_advancedtests.py
root-project/roottest
train
41
19a785c2d6f7f5842701b16f7ea7213b45d5a5d9
[ "if head is None:\n return None\nif head.next is None:\n return head\nif head.next.next is None:\n if head.val < head.next.val:\n return head\n else:\n head.next.next = head\n tmp = head.next\n head.next = None\n return tmp\nf = ListNode()\nf.next = head\nfast = f\nslo...
<|body_start_0|> if head is None: return None if head.next is None: return head if head.next.next is None: if head.val < head.next.val: return head else: head.next.next = head tmp = head.next ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def sortList(self, head): """:type head: ListNode :rtype: ListNode""" <|body_0|> def mergeTwoLists(self, list1, list2): """:type list1: Optional[ListNode] :type list2: Optional[ListNode] :rtype: Optional[ListNode]""" <|body_1|> <|end_skeleton|> <|...
stack_v2_sparse_classes_36k_train_026236
1,578
no_license
[ { "docstring": ":type head: ListNode :rtype: ListNode", "name": "sortList", "signature": "def sortList(self, head)" }, { "docstring": ":type list1: Optional[ListNode] :type list2: Optional[ListNode] :rtype: Optional[ListNode]", "name": "mergeTwoLists", "signature": "def mergeTwoLists(sel...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def sortList(self, head): :type head: ListNode :rtype: ListNode - def mergeTwoLists(self, list1, list2): :type list1: Optional[ListNode] :type list2: Optional[ListNode] :rtype: O...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def sortList(self, head): :type head: ListNode :rtype: ListNode - def mergeTwoLists(self, list1, list2): :type list1: Optional[ListNode] :type list2: Optional[ListNode] :rtype: O...
ca8b2662330776d14962532ed8994dfeedadef70
<|skeleton|> class Solution: def sortList(self, head): """:type head: ListNode :rtype: ListNode""" <|body_0|> def mergeTwoLists(self, list1, list2): """:type list1: Optional[ListNode] :type list2: Optional[ListNode] :rtype: Optional[ListNode]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def sortList(self, head): """:type head: ListNode :rtype: ListNode""" if head is None: return None if head.next is None: return head if head.next.next is None: if head.val < head.next.val: return head els...
the_stack_v2_python_sparse
Algo/Leetcode/148SortList.py
lawy623/Algorithm_Interview_Prep
train
2
d765bd4196eb3ca05265a641e83201eae7c2af77
[ "server = g.db.query(Server).get(server_id)\nif not server:\n log.warning('Requested a non-existant battleserver: %s', server_id)\n abort(http_client.NOT_FOUND, description='Server not found')\nmachine_id = server.machine_id\nrecord = server.as_dict()\nrecord['url'] = url_for('servers.entry', server_id=server...
<|body_start_0|> server = g.db.query(Server).get(server_id) if not server: log.warning('Requested a non-existant battleserver: %s', server_id) abort(http_client.NOT_FOUND, description='Server not found') machine_id = server.machine_id record = server.as_dict() ...
Interface to battle servers instances. A battleserver instance is a single run of a battleserver executable. The battleserver will have a single battle on it. You should never have a battle resource without an associated battleserver resource.
ServerAPI
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ServerAPI: """Interface to battle servers instances. A battleserver instance is a single run of a battleserver executable. The battleserver will have a single battle on it. You should never have a battle resource without an associated battleserver resource.""" def get(self, server_id): ...
stack_v2_sparse_classes_36k_train_026237
16,872
permissive
[ { "docstring": "Get information about a single battle server instance. Returns information from the machine and the associated battle if found.", "name": "get", "signature": "def get(self, server_id)" }, { "docstring": "The battleserver management (celery) process calls this to update the status...
2
stack_v2_sparse_classes_30k_val_000123
Implement the Python class `ServerAPI` described below. Class description: Interface to battle servers instances. A battleserver instance is a single run of a battleserver executable. The battleserver will have a single battle on it. You should never have a battle resource without an associated battleserver resource. ...
Implement the Python class `ServerAPI` described below. Class description: Interface to battle servers instances. A battleserver instance is a single run of a battleserver executable. The battleserver will have a single battle on it. You should never have a battle resource without an associated battleserver resource. ...
9825cb22b26b577b715f2ce95453363bf90ecc7e
<|skeleton|> class ServerAPI: """Interface to battle servers instances. A battleserver instance is a single run of a battleserver executable. The battleserver will have a single battle on it. You should never have a battle resource without an associated battleserver resource.""" def get(self, server_id): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ServerAPI: """Interface to battle servers instances. A battleserver instance is a single run of a battleserver executable. The battleserver will have a single battle on it. You should never have a battle resource without an associated battleserver resource.""" def get(self, server_id): """Get inf...
the_stack_v2_python_sparse
driftbase/api/servers.py
dgnorth/drift-base
train
1
6602bba6449ae7c6078c48f4ab703167d7e8e0dd
[ "self._metadata = metadata\nif not rest_prefix.endswith('/'):\n self._rest_prefix = '%s/' % rest_prefix\nelse:\n self._rest_prefix = rest_prefix\nself._mapping_rules = [CustomRequestMappingRule(self._rest_prefix), VerbMappingRule(self._rest_prefix), ListMappingRule(self._rest_prefix), PostMappingRule(self._re...
<|body_start_0|> self._metadata = metadata if not rest_prefix.endswith('/'): self._rest_prefix = '%s/' % rest_prefix else: self._rest_prefix = rest_prefix self._mapping_rules = [CustomRequestMappingRule(self._rest_prefix), VerbMappingRule(self._rest_prefix), ListM...
Generate the routing rules based on vAPI metamodel metadata.
RoutingRuleGenerator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RoutingRuleGenerator: """Generate the routing rules based on vAPI metamodel metadata.""" def __init__(self, metadata, rest_prefix): """Initialize RoutingRuleGenerator :type metadata: :class:`vmware.vapi.server.rest_handler.MetadataStore` :param metadata: Object that contains the rele...
stack_v2_sparse_classes_36k_train_026238
37,981
permissive
[ { "docstring": "Initialize RoutingRuleGenerator :type metadata: :class:`vmware.vapi.server.rest_handler.MetadataStore` :param metadata: Object that contains the relevant metamodel metadata of all the services. :type rest_prefix: :class:`str` :param rest_prefix: REST URL prefix", "name": "__init__", "sig...
3
null
Implement the Python class `RoutingRuleGenerator` described below. Class description: Generate the routing rules based on vAPI metamodel metadata. Method signatures and docstrings: - def __init__(self, metadata, rest_prefix): Initialize RoutingRuleGenerator :type metadata: :class:`vmware.vapi.server.rest_handler.Meta...
Implement the Python class `RoutingRuleGenerator` described below. Class description: Generate the routing rules based on vAPI metamodel metadata. Method signatures and docstrings: - def __init__(self, metadata, rest_prefix): Initialize RoutingRuleGenerator :type metadata: :class:`vmware.vapi.server.rest_handler.Meta...
c07e1be98615201139b26c28db3aa584c4254b66
<|skeleton|> class RoutingRuleGenerator: """Generate the routing rules based on vAPI metamodel metadata.""" def __init__(self, metadata, rest_prefix): """Initialize RoutingRuleGenerator :type metadata: :class:`vmware.vapi.server.rest_handler.MetadataStore` :param metadata: Object that contains the rele...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RoutingRuleGenerator: """Generate the routing rules based on vAPI metamodel metadata.""" def __init__(self, metadata, rest_prefix): """Initialize RoutingRuleGenerator :type metadata: :class:`vmware.vapi.server.rest_handler.MetadataStore` :param metadata: Object that contains the relevant metamode...
the_stack_v2_python_sparse
vmware/vapi/rest/rules.py
adammillerio/vsphere-automation-sdk-python
train
0
bd050bda65ec61070a21596eec0b1c1e09df51b6
[ "self.rotating_right = False\nself.rotating_left = True\nself.stop_front_dist = 0.6\nself.min_front_dist = 0.8\nsuper().__init__('tw02_navigation')\nself.create_subscription(LaserScan, '/robot_0/base_scan', self.laserCallback, 1)\nself.vel_pub = self.create_publisher(Twist, '/robot_0/cmd_vel', 1)", "\"\"\" Right ...
<|body_start_0|> self.rotating_right = False self.rotating_left = True self.stop_front_dist = 0.6 self.min_front_dist = 0.8 super().__init__('tw02_navigation') self.create_subscription(LaserScan, '/robot_0/base_scan', self.laserCallback, 1) self.vel_pub = self.cre...
Random navigation avoiding laser-based detected obstacles.
BasicNavigation
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BasicNavigation: """Random navigation avoiding laser-based detected obstacles.""" def __init__(self): """Initializes the class instance.""" <|body_0|> def laserCallback(self, msg: LaserScan): """Update distance to closest obstacles and controll the robot bsed on ...
stack_v2_sparse_classes_36k_train_026239
5,606
no_license
[ { "docstring": "Initializes the class instance.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Update distance to closest obstacles and controll the robot bsed on those detected obstacles", "name": "laserCallback", "signature": "def laserCallback(self, msg: La...
2
stack_v2_sparse_classes_30k_train_000925
Implement the Python class `BasicNavigation` described below. Class description: Random navigation avoiding laser-based detected obstacles. Method signatures and docstrings: - def __init__(self): Initializes the class instance. - def laserCallback(self, msg: LaserScan): Update distance to closest obstacles and contro...
Implement the Python class `BasicNavigation` described below. Class description: Random navigation avoiding laser-based detected obstacles. Method signatures and docstrings: - def __init__(self): Initializes the class instance. - def laserCallback(self, msg: LaserScan): Update distance to closest obstacles and contro...
a8f2541c60f36cd5c1af417a6fef7c80b163cd01
<|skeleton|> class BasicNavigation: """Random navigation avoiding laser-based detected obstacles.""" def __init__(self): """Initializes the class instance.""" <|body_0|> def laserCallback(self, msg: LaserScan): """Update distance to closest obstacles and controll the robot bsed on ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BasicNavigation: """Random navigation avoiding laser-based detected obstacles.""" def __init__(self): """Initializes the class instance.""" self.rotating_right = False self.rotating_left = True self.stop_front_dist = 0.6 self.min_front_dist = 0.8 super().__...
the_stack_v2_python_sparse
src/tw02/tw02/navigation.py
ipleiria-robotics/adv_robotics
train
0
296b09bf3bc7e476538bb530f54b2ca888f4f602
[ "self.obj = obj\nself.attrGetter = xobj_attrgetter(varName)\nself.previousValue = self.attrGetter(self.obj)\nself.callback = callback", "value = self.attrGetter(self.obj)\nif value != self.previousValue:\n self.previousValue = value\n self.callback(value)" ]
<|body_start_0|> self.obj = obj self.attrGetter = xobj_attrgetter(varName) self.previousValue = self.attrGetter(self.obj) self.callback = callback <|end_body_0|> <|body_start_1|> value = self.attrGetter(self.obj) if value != self.previousValue: self.previousV...
Represents a watch placed on a particular variable of an object
VarWatch
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VarWatch: """Represents a watch placed on a particular variable of an object""" def __init__(self, obj, varName, callback): """Initialize the Watch with the object and its variable to watch and the callback to fire""" <|body_0|> def checkChange(self): """Check if...
stack_v2_sparse_classes_36k_train_026240
702
no_license
[ { "docstring": "Initialize the Watch with the object and its variable to watch and the callback to fire", "name": "__init__", "signature": "def __init__(self, obj, varName, callback)" }, { "docstring": "Check if the value has changed", "name": "checkChange", "signature": "def checkChange...
2
null
Implement the Python class `VarWatch` described below. Class description: Represents a watch placed on a particular variable of an object Method signatures and docstrings: - def __init__(self, obj, varName, callback): Initialize the Watch with the object and its variable to watch and the callback to fire - def checkC...
Implement the Python class `VarWatch` described below. Class description: Represents a watch placed on a particular variable of an object Method signatures and docstrings: - def __init__(self, obj, varName, callback): Initialize the Watch with the object and its variable to watch and the callback to fire - def checkC...
19b7bf08658ce329c7b076ce2014bae9f5f09268
<|skeleton|> class VarWatch: """Represents a watch placed on a particular variable of an object""" def __init__(self, obj, varName, callback): """Initialize the Watch with the object and its variable to watch and the callback to fire""" <|body_0|> def checkChange(self): """Check if...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class VarWatch: """Represents a watch placed on a particular variable of an object""" def __init__(self, obj, varName, callback): """Initialize the Watch with the object and its variable to watch and the callback to fire""" self.obj = obj self.attrGetter = xobj_attrgetter(varName) ...
the_stack_v2_python_sparse
src/knot/watches/var_watch.py
cloew/Knot
train
1
eea8de42a84217c39b5874ee4708cb5ecb435be6
[ "\"\"\"\n 大致步骤:\n 1-获取传入date以及code\n 2-根据code以及date获取geostationtidedata中的一个 StationTideData(model)\n 3-从realdata中获取过程中的极值出现时间以及值\n \"\"\"\ncode = request.GET.get('code', settings.DEFAULT_TYPHOON_CODE_BYSTATION)\nself.code = code\ndate_str = request.GET....
<|body_start_0|> """ 大致步骤: 1-获取传入date以及code 2-根据code以及date获取geostationtidedata中的一个 StationTideData(model) 3-从realdata中获取过程中的极值出现时间以及值 """ code = request.GET.get('code', settings.DEFAULT_TYPHOON_CO...
StationTideDataListView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StationTideDataListView: def get(self, request): """:param request: :return:""" <|body_0|> def getStationTargetRealData(self, targetdatetime: datetime, code: str) -> []: """根据时间获取该时间该台风的测站数据 :param date: :return:""" <|body_1|> def dataListMax(self, data:...
stack_v2_sparse_classes_36k_train_026241
46,325
no_license
[ { "docstring": ":param request: :return:", "name": "get", "signature": "def get(self, request)" }, { "docstring": "根据时间获取该时间该台风的测站数据 :param date: :return:", "name": "getStationTargetRealData", "signature": "def getStationTargetRealData(self, targetdatetime: datetime, code: str) -> []" ...
4
stack_v2_sparse_classes_30k_test_000258
Implement the Python class `StationTideDataListView` described below. Class description: Implement the StationTideDataListView class. Method signatures and docstrings: - def get(self, request): :param request: :return: - def getStationTargetRealData(self, targetdatetime: datetime, code: str) -> []: 根据时间获取该时间该台风的测站数据 ...
Implement the Python class `StationTideDataListView` described below. Class description: Implement the StationTideDataListView class. Method signatures and docstrings: - def get(self, request): :param request: :return: - def getStationTargetRealData(self, targetdatetime: datetime, code: str) -> []: 根据时间获取该时间该台风的测站数据 ...
53289e9583e52531346031921fb8f8b7026e399d
<|skeleton|> class StationTideDataListView: def get(self, request): """:param request: :return:""" <|body_0|> def getStationTargetRealData(self, targetdatetime: datetime, code: str) -> []: """根据时间获取该时间该台风的测站数据 :param date: :return:""" <|body_1|> def dataListMax(self, data:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StationTideDataListView: def get(self, request): """:param request: :return:""" """ 大致步骤: 1-获取传入date以及code 2-根据code以及date获取geostationtidedata中的一个 StationTideData(model) 3-从realdata中获取过程中的极值出现时间以及值 ...
the_stack_v2_python_sparse
docker/pull-code/210724/code/apps/Typhoon/views.py
evaseemefly/TyphoonSearchSys
train
20
ea593a3f0a5e147e667cabf307ff543913229fde
[ "super(ResizeImageTask, self).__init__(*args, **kwargs)\nself.setOption('convertToRGBA', self.__defaultConvertToRGBA)\nself.setMetadata('dispatch.split', True)", "import OpenImageIO as oiio\nfor crawler in self.crawlers():\n width = self.option('width')\n height = self.option('height')\n if isinstance(wi...
<|body_start_0|> super(ResizeImageTask, self).__init__(*args, **kwargs) self.setOption('convertToRGBA', self.__defaultConvertToRGBA) self.setMetadata('dispatch.split', True) <|end_body_0|> <|body_start_1|> import OpenImageIO as oiio for crawler in self.crawlers(): wi...
Image resize task. Options: - Optional: "convertToRGBA" - Required: "width" and "height" (both support templates) TODO: missing to kombi metadata/source image attributes.
ResizeImageTask
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResizeImageTask: """Image resize task. Options: - Optional: "convertToRGBA" - Required: "width" and "height" (both support templates) TODO: missing to kombi metadata/source image attributes.""" def __init__(self, *args, **kwargs): """Create a resize image task.""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_026242
3,190
permissive
[ { "docstring": "Create a resize image task.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Perform the task.", "name": "_perform", "signature": "def _perform(self)" } ]
2
stack_v2_sparse_classes_30k_train_020675
Implement the Python class `ResizeImageTask` described below. Class description: Image resize task. Options: - Optional: "convertToRGBA" - Required: "width" and "height" (both support templates) TODO: missing to kombi metadata/source image attributes. Method signatures and docstrings: - def __init__(self, *args, **kw...
Implement the Python class `ResizeImageTask` described below. Class description: Image resize task. Options: - Optional: "convertToRGBA" - Required: "width" and "height" (both support templates) TODO: missing to kombi metadata/source image attributes. Method signatures and docstrings: - def __init__(self, *args, **kw...
046dbb0c1b4ff20ea5f2e1679f8d89f3089b6aa4
<|skeleton|> class ResizeImageTask: """Image resize task. Options: - Optional: "convertToRGBA" - Required: "width" and "height" (both support templates) TODO: missing to kombi metadata/source image attributes.""" def __init__(self, *args, **kwargs): """Create a resize image task.""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResizeImageTask: """Image resize task. Options: - Optional: "convertToRGBA" - Required: "width" and "height" (both support templates) TODO: missing to kombi metadata/source image attributes.""" def __init__(self, *args, **kwargs): """Create a resize image task.""" super(ResizeImageTask, s...
the_stack_v2_python_sparse
src/lib/kombi/Task/Image/ResizeImageTask.py
kombiHQ/kombi
train
2
4f2d71c4097ff2a0b9d9fed3bb43d80e6dd33c6f
[ "self.included = self._get_plugins_by_type('included')\nself.custom = self._get_plugins_by_type('custom')\nfor plugin in list(self.custom):\n if plugin in self.included:\n del self.custom[plugin]\n warn('Custom plugin \"{plugin_name}\" is invalid, as there is already an included plugin of the same ...
<|body_start_0|> self.included = self._get_plugins_by_type('included') self.custom = self._get_plugins_by_type('custom') for plugin in list(self.custom): if plugin in self.included: del self.custom[plugin] warn('Custom plugin "{plugin_name}" is invalid...
Class used to store valid included and custom plugins.
_ValidPlugins
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _ValidPlugins: """Class used to store valid included and custom plugins.""" def __init__(self): """Store all plugins by their type.""" <|body_0|> def get_plugin_type(self, plugin_name): """Return the type (included or custom) for the given plugin.""" <|bo...
stack_v2_sparse_classes_36k_train_026243
5,248
no_license
[ { "docstring": "Store all plugins by their type.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Return the type (included or custom) for the given plugin.", "name": "get_plugin_type", "signature": "def get_plugin_type(self, plugin_name)" }, { "docstrin...
3
stack_v2_sparse_classes_30k_train_011842
Implement the Python class `_ValidPlugins` described below. Class description: Class used to store valid included and custom plugins. Method signatures and docstrings: - def __init__(self): Store all plugins by their type. - def get_plugin_type(self, plugin_name): Return the type (included or custom) for the given pl...
Implement the Python class `_ValidPlugins` described below. Class description: Class used to store valid included and custom plugins. Method signatures and docstrings: - def __init__(self): Store all plugins by their type. - def get_plugin_type(self, plugin_name): Return the type (included or custom) for the given pl...
cead3639bab2acce9da55a4e7f196c750160b27f
<|skeleton|> class _ValidPlugins: """Class used to store valid included and custom plugins.""" def __init__(self): """Store all plugins by their type.""" <|body_0|> def get_plugin_type(self, plugin_name): """Return the type (included or custom) for the given plugin.""" <|bo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _ValidPlugins: """Class used to store valid included and custom plugins.""" def __init__(self): """Store all plugins by their type.""" self.included = self._get_plugins_by_type('included') self.custom = self._get_plugins_by_type('custom') for plugin in list(self.custom): ...
the_stack_v2_python_sparse
srcds/addons/source-python/plugins/admin/core/plugins/valid.py
Source-Python-Dev-Team/Source.Python.Admin
train
8
55b273f55322caf5218b488e63f32a7db2a3f3a0
[ "self.item = item\nif emoji is None:\n if item.hasEmoji:\n emoji = item.emoji\n else:\n raise ValueError('Attempted to create a ReactionInventoryPickerOption without providing an emoji, and the provided item has no emoji')\nif name is None:\n name = item.name\n if item.hasEmoji and emoji !...
<|body_start_0|> self.item = item if emoji is None: if item.hasEmoji: emoji = item.emoji else: raise ValueError('Attempted to create a ReactionInventoryPickerOption without providing an emoji, and the provided item has no emoji') if name is...
A reaction menu option that represents a bbItem instance. Unless configured otherwise, the option's name and emoji will correspond to the item's name and emoji. :var item: The bbItem that this option represents :vartype item: bbItem
ReactionInventoryPickerOption
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReactionInventoryPickerOption: """A reaction menu option that represents a bbItem instance. Unless configured otherwise, the option's name and emoji will correspond to the item's name and emoji. :var item: The bbItem that this option represents :vartype item: bbItem""" def __init__(self, ite...
stack_v2_sparse_classes_36k_train_026244
9,225
permissive
[ { "docstring": ":param bbItem item: The bbItem that this option represents :param ReactionMenu menu: The ReactionMenu where this option is active :param lib.emojis.dumbEmoji emoji: The emoji that a user must react with in order to trigger this menu option (Default item.emoji) :param str name: The name of this o...
2
null
Implement the Python class `ReactionInventoryPickerOption` described below. Class description: A reaction menu option that represents a bbItem instance. Unless configured otherwise, the option's name and emoji will correspond to the item's name and emoji. :var item: The bbItem that this option represents :vartype item...
Implement the Python class `ReactionInventoryPickerOption` described below. Class description: A reaction menu option that represents a bbItem instance. Unless configured otherwise, the option's name and emoji will correspond to the item's name and emoji. :var item: The bbItem that this option represents :vartype item...
b4fe3d765b764ab169284ce0869a810825013389
<|skeleton|> class ReactionInventoryPickerOption: """A reaction menu option that represents a bbItem instance. Unless configured otherwise, the option's name and emoji will correspond to the item's name and emoji. :var item: The bbItem that this option represents :vartype item: bbItem""" def __init__(self, ite...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ReactionInventoryPickerOption: """A reaction menu option that represents a bbItem instance. Unless configured otherwise, the option's name and emoji will correspond to the item's name and emoji. :var item: The bbItem that this option represents :vartype item: bbItem""" def __init__(self, item: bbItem.bbI...
the_stack_v2_python_sparse
BB/reactionMenus/ReactionInventoryPicker.py
Trimatix/GOF2BountyBot
train
7
e6651aaa82c284e68825ed7e24f1ef0f41a4bd60
[ "subtotal = 0\nfor item in self.items:\n subtotal += item.total_cost\nreturn subtotal", "if self.shipping_handling:\n return self.subtotal + self.shipping_handling\nreturn self.subtotal" ]
<|body_start_0|> subtotal = 0 for item in self.items: subtotal += item.total_cost return subtotal <|end_body_0|> <|body_start_1|> if self.shipping_handling: return self.subtotal + self.shipping_handling return self.subtotal <|end_body_1|>
The PurchaseOrder object contains purchase order properties Attributes: po_id: Integer value that uniquely identifies the purchase order status: Integer of the status of the purchase order shipping_handling: Float value of the shipping and handling that will be applied total: Float value of the total cost
PurchaseOrder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PurchaseOrder: """The PurchaseOrder object contains purchase order properties Attributes: po_id: Integer value that uniquely identifies the purchase order status: Integer of the status of the purchase order shipping_handling: Float value of the shipping and handling that will be applied total: Fl...
stack_v2_sparse_classes_36k_train_026245
19,591
no_license
[ { "docstring": "Calculate the subtotal of the item. Returns: subtotal (float)", "name": "subtotal", "signature": "def subtotal(self)" }, { "docstring": "Calculate the actual total of the item. This is done by add shipping and handling to the subtotal. If there is no shipping and handling just re...
2
stack_v2_sparse_classes_30k_train_015654
Implement the Python class `PurchaseOrder` described below. Class description: The PurchaseOrder object contains purchase order properties Attributes: po_id: Integer value that uniquely identifies the purchase order status: Integer of the status of the purchase order shipping_handling: Float value of the shipping and ...
Implement the Python class `PurchaseOrder` described below. Class description: The PurchaseOrder object contains purchase order properties Attributes: po_id: Integer value that uniquely identifies the purchase order status: Integer of the status of the purchase order shipping_handling: Float value of the shipping and ...
b4774f3e3616ccde6b02086811b82627f6614498
<|skeleton|> class PurchaseOrder: """The PurchaseOrder object contains purchase order properties Attributes: po_id: Integer value that uniquely identifies the purchase order status: Integer of the status of the purchase order shipping_handling: Float value of the shipping and handling that will be applied total: Fl...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PurchaseOrder: """The PurchaseOrder object contains purchase order properties Attributes: po_id: Integer value that uniquely identifies the purchase order status: Integer of the status of the purchase order shipping_handling: Float value of the shipping and handling that will be applied total: Float value of ...
the_stack_v2_python_sparse
models.py
cyberjedi22/TCMS
train
0
b016d2423a2003fdb0536c3ae3bd2f8fef212ee6
[ "self.start = [0, 0]\nself.current = [0, 0]\nself.start_facing = 'E'\nself.current_facing = self.start_facing", "result = self.current\nstep = 0\nstep_dir = re.match('^(\\\\D)', instr).group()\nstep_size = int(re.search('(\\\\d+)', instr).group())\ndirection_map = {'N': operator.add(self.current[1], step_size), '...
<|body_start_0|> self.start = [0, 0] self.current = [0, 0] self.start_facing = 'E' self.current_facing = self.start_facing <|end_body_0|> <|body_start_1|> result = self.current step = 0 step_dir = re.match('^(\\D)', instr).group() step_size = int(re.searc...
Ship
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Ship: def __init__(self): """:param facing: direction the ship is facing right now""" <|body_0|> def move_ship(self, instr: str) -> list: """Assuming a coordinate system of (-inf, inf) on the x and (-inf, inf) on the y :param instr: looks like NSEW, LR, or F (forward...
stack_v2_sparse_classes_36k_train_026246
4,032
no_license
[ { "docstring": ":param facing: direction the ship is facing right now", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Assuming a coordinate system of (-inf, inf) on the x and (-inf, inf) on the y :param instr: looks like NSEW, LR, or F (forward), plus a number :return:...
5
stack_v2_sparse_classes_30k_train_007941
Implement the Python class `Ship` described below. Class description: Implement the Ship class. Method signatures and docstrings: - def __init__(self): :param facing: direction the ship is facing right now - def move_ship(self, instr: str) -> list: Assuming a coordinate system of (-inf, inf) on the x and (-inf, inf) ...
Implement the Python class `Ship` described below. Class description: Implement the Ship class. Method signatures and docstrings: - def __init__(self): :param facing: direction the ship is facing right now - def move_ship(self, instr: str) -> list: Assuming a coordinate system of (-inf, inf) on the x and (-inf, inf) ...
aa7e5daec4226bd96020db66bf38009463960f6b
<|skeleton|> class Ship: def __init__(self): """:param facing: direction the ship is facing right now""" <|body_0|> def move_ship(self, instr: str) -> list: """Assuming a coordinate system of (-inf, inf) on the x and (-inf, inf) on the y :param instr: looks like NSEW, LR, or F (forward...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Ship: def __init__(self): """:param facing: direction the ship is facing right now""" self.start = [0, 0] self.current = [0, 0] self.start_facing = 'E' self.current_facing = self.start_facing def move_ship(self, instr: str) -> list: """Assuming a coordinate...
the_stack_v2_python_sparse
day_12.py
szeitlin/advent_of_code
train
0
2144115a128b85ae0eab9db409c4b863ce7af8b3
[ "if not matrix:\n return []\nm = len(matrix)\nn = len(matrix[0])\ni, j = (0, n - 1)\nspiral = matrix[0]\ndirection = 1\nk = 1\nfor _ in range((m - 1) * n):\n if direction == 0:\n j += 1\n if j == n - k:\n direction = 1\n elif direction == 1:\n i += 1\n if i == m - k:\...
<|body_start_0|> if not matrix: return [] m = len(matrix) n = len(matrix[0]) i, j = (0, n - 1) spiral = matrix[0] direction = 1 k = 1 for _ in range((m - 1) * n): if direction == 0: j += 1 if j == n -...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def spiralOrder(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" <|body_0|> def spiralOrder1(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not matri...
stack_v2_sparse_classes_36k_train_026247
1,687
no_license
[ { "docstring": ":type matrix: List[List[int]] :rtype: List[int]", "name": "spiralOrder", "signature": "def spiralOrder(self, matrix)" }, { "docstring": ":type matrix: List[List[int]] :rtype: List[int]", "name": "spiralOrder1", "signature": "def spiralOrder1(self, matrix)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def spiralOrder(self, matrix): :type matrix: List[List[int]] :rtype: List[int] - def spiralOrder1(self, matrix): :type matrix: List[List[int]] :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def spiralOrder(self, matrix): :type matrix: List[List[int]] :rtype: List[int] - def spiralOrder1(self, matrix): :type matrix: List[List[int]] :rtype: List[int] <|skeleton|> cla...
863b89be674a82eef60c0f33d726ac08d43f2e01
<|skeleton|> class Solution: def spiralOrder(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" <|body_0|> def spiralOrder1(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def spiralOrder(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" if not matrix: return [] m = len(matrix) n = len(matrix[0]) i, j = (0, n - 1) spiral = matrix[0] direction = 1 k = 1 for _ in range...
the_stack_v2_python_sparse
q54_Spiral_Matrix.py
Ryuya1995/leetcode
train
0
a0fa4b89d7ec0f39289f3fb3a800450e009967ab
[ "super().__init__(app, id=id, config=config)\nself.Username = self.Config.get('username')\nself.Password = self.Config.get('password')\nself.Hostname = self.Config.get('hostname')\nself.Port = self.Config.get('port')", "client = aioftp.Client()\nawait client.connect(self.Hostname, 21)\nawait client.login(self.Use...
<|body_start_0|> super().__init__(app, id=id, config=config) self.Username = self.Config.get('username') self.Password = self.Config.get('password') self.Hostname = self.Config.get('hostname') self.Port = self.Config.get('port') <|end_body_0|> <|body_start_1|> client = a...
Description: |
FTPConnection
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FTPConnection: """Description: |""" def __init__(self, app, id=None, config=None): """Description: **Parameters** app : Application Name of the Application id : ID, default = None config : JSON, default = None""" <|body_0|> async def connect(self): """Description...
stack_v2_sparse_classes_36k_train_026248
887
permissive
[ { "docstring": "Description: **Parameters** app : Application Name of the Application id : ID, default = None config : JSON, default = None", "name": "__init__", "signature": "def __init__(self, app, id=None, config=None)" }, { "docstring": "Description: :return: client |", "name": "connect"...
2
null
Implement the Python class `FTPConnection` described below. Class description: Description: | Method signatures and docstrings: - def __init__(self, app, id=None, config=None): Description: **Parameters** app : Application Name of the Application id : ID, default = None config : JSON, default = None - async def conne...
Implement the Python class `FTPConnection` described below. Class description: Description: | Method signatures and docstrings: - def __init__(self, app, id=None, config=None): Description: **Parameters** app : Application Name of the Application id : ID, default = None config : JSON, default = None - async def conne...
11ee3689d0ff6e9b662deeb3fc5e18bb0aabc8f2
<|skeleton|> class FTPConnection: """Description: |""" def __init__(self, app, id=None, config=None): """Description: **Parameters** app : Application Name of the Application id : ID, default = None config : JSON, default = None""" <|body_0|> async def connect(self): """Description...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FTPConnection: """Description: |""" def __init__(self, app, id=None, config=None): """Description: **Parameters** app : Application Name of the Application id : ID, default = None config : JSON, default = None""" super().__init__(app, id=id, config=config) self.Username = self.Con...
the_stack_v2_python_sparse
bspump/ftp/connection.py
LibertyAces/BitSwanPump
train
24
87ae9a44f57c448574c79c961c32b747b8bfac5e
[ "xy = points.data[..., :2]\nz = points.z\nuv = (xy.T @ diag(z).inverse()).T if len(z.shape) else xy.T * 1 / z\nreturn Vector2(uv)", "if isinstance(depth, (float, int)):\n depth = Tensor([depth])\nreturn Vector3.from_coords(points.x * depth, points.y * depth, depth)" ]
<|body_start_0|> xy = points.data[..., :2] z = points.z uv = (xy.T @ diag(z).inverse()).T if len(z.shape) else xy.T * 1 / z return Vector2(uv) <|end_body_0|> <|body_start_1|> if isinstance(depth, (float, int)): depth = Tensor([depth]) return Vector3.from_coor...
Z1Projection
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Z1Projection: def project(self, points: Vector3) -> Vector2: """Project one or more Vector3 from the camera frame into the canonical z=1 plane through perspective division. Args: points: Vector3 representing the points to project. Returns: Vector2 representing the projected points. Examp...
stack_v2_sparse_classes_36k_train_026249
1,838
permissive
[ { "docstring": "Project one or more Vector3 from the camera frame into the canonical z=1 plane through perspective division. Args: points: Vector3 representing the points to project. Returns: Vector2 representing the projected points. Example: >>> points = Vector3.from_coords(1., 2., 3.) >>> Z1Projection().proj...
2
null
Implement the Python class `Z1Projection` described below. Class description: Implement the Z1Projection class. Method signatures and docstrings: - def project(self, points: Vector3) -> Vector2: Project one or more Vector3 from the camera frame into the canonical z=1 plane through perspective division. Args: points: ...
Implement the Python class `Z1Projection` described below. Class description: Implement the Z1Projection class. Method signatures and docstrings: - def project(self, points: Vector3) -> Vector2: Project one or more Vector3 from the camera frame into the canonical z=1 plane through perspective division. Args: points: ...
1e0f8baa7318c05b17ea6dbb48605691bca8972f
<|skeleton|> class Z1Projection: def project(self, points: Vector3) -> Vector2: """Project one or more Vector3 from the camera frame into the canonical z=1 plane through perspective division. Args: points: Vector3 representing the points to project. Returns: Vector2 representing the projected points. Examp...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Z1Projection: def project(self, points: Vector3) -> Vector2: """Project one or more Vector3 from the camera frame into the canonical z=1 plane through perspective division. Args: points: Vector3 representing the points to project. Returns: Vector2 representing the projected points. Example: >>> points...
the_stack_v2_python_sparse
kornia/sensors/camera/projection_model.py
kornia/kornia
train
7,351
9c5ead501ba0f152d92c322dd718a60ca9a9f95d
[ "def serializeRecur(node, level):\n if node == None:\n return '#'\n next_level = chr(ord(level) + 1)\n return serializeRecur(node.left, next_level) + level + str(node.val) + level + serializeRecur(node.right, next_level)\nreturn serializeRecur(root, 'A')", "def deserializeRecur(code, level):\n ...
<|body_start_0|> def serializeRecur(node, level): if node == None: return '#' next_level = chr(ord(level) + 1) return serializeRecur(node.left, next_level) + level + str(node.val) + level + serializeRecur(node.right, next_level) return serializeRecur(r...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_026250
2,916
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
8cda0518440488992d7e2c70cb8555ec7b34083f
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" def serializeRecur(node, level): if node == None: return '#' next_level = chr(ord(level) + 1) return serializeRecur(node.left, next_le...
the_stack_v2_python_sparse
449/main.py
szhongren/leetcode
train
0
faac29f81eed167eff719c30e413bea06098fe85
[ "ans = []\nself.removeHelper(s, 0, 0, '(', ')', ans)\nreturn ans", "sum = 0\nfor i in range(last_i, len(s)):\n if s[i] == char1:\n sum += 1\n if s[i] == char2:\n sum -= 1\n if sum >= 0:\n continue\n for j in range(last_j, i + 1):\n if s[j] == char2 and (j == last_j or s[j] ...
<|body_start_0|> ans = [] self.removeHelper(s, 0, 0, '(', ')', ans) return ans <|end_body_0|> <|body_start_1|> sum = 0 for i in range(last_i, len(s)): if s[i] == char1: sum += 1 if s[i] == char2: sum -= 1 if sum...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def removeInvalidParentheses(self, s): """:type s: str :rtype: List[str]""" <|body_0|> def removeHelper(self, s, last_i, last_j, char1, char2, ans): """Remove invalid parentheses in two rounds: 1st round: detect ')' appears more times then '(' 2nd round: de...
stack_v2_sparse_classes_36k_train_026251
1,373
no_license
[ { "docstring": ":type s: str :rtype: List[str]", "name": "removeInvalidParentheses", "signature": "def removeInvalidParentheses(self, s)" }, { "docstring": "Remove invalid parentheses in two rounds: 1st round: detect ')' appears more times then '(' 2nd round: detect '(' appears more times then '...
2
stack_v2_sparse_classes_30k_train_021328
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeInvalidParentheses(self, s): :type s: str :rtype: List[str] - def removeHelper(self, s, last_i, last_j, char1, char2, ans): Remove invalid parentheses in two rounds: 1s...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeInvalidParentheses(self, s): :type s: str :rtype: List[str] - def removeHelper(self, s, last_i, last_j, char1, char2, ans): Remove invalid parentheses in two rounds: 1s...
83f95caa3f7a487e8561e69133772d5add4484e1
<|skeleton|> class Solution: def removeInvalidParentheses(self, s): """:type s: str :rtype: List[str]""" <|body_0|> def removeHelper(self, s, last_i, last_j, char1, char2, ans): """Remove invalid parentheses in two rounds: 1st round: detect ')' appears more times then '(' 2nd round: de...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def removeInvalidParentheses(self, s): """:type s: str :rtype: List[str]""" ans = [] self.removeHelper(s, 0, 0, '(', ')', ans) return ans def removeHelper(self, s, last_i, last_j, char1, char2, ans): """Remove invalid parentheses in two rounds: 1st round:...
the_stack_v2_python_sparse
algorithms.master/invalid paranthesis.py
apk2129/_personal
train
0
387e927070389bbbebded9641a55d59a8283f1aa
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn Domain()", "from .directory_object import DirectoryObject\nfrom .domain_dns_record import DomainDnsRecord\nfrom .domain_state import DomainState\nfrom .entity import Entity\nfrom .internal_domain_federation import InternalDomainFederat...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return Domain() <|end_body_0|> <|body_start_1|> from .directory_object import DirectoryObject from .domain_dns_record import DomainDnsRecord from .domain_state import DomainState ...
Domain
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Domain: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Domain: """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: Domain""" ...
stack_v2_sparse_classes_36k_train_026252
9,421
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: Domain", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value(parse_...
3
stack_v2_sparse_classes_30k_train_001890
Implement the Python class `Domain` described below. Class description: Implement the Domain class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Domain: Creates a new instance of the appropriate class based on discriminator value Args: parse_node: Th...
Implement the Python class `Domain` described below. Class description: Implement the Domain class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Domain: Creates a new instance of the appropriate class based on discriminator value Args: parse_node: Th...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class Domain: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Domain: """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: Domain""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Domain: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Domain: """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: Domain""" if not p...
the_stack_v2_python_sparse
msgraph/generated/models/domain.py
microsoftgraph/msgraph-sdk-python
train
135
5eb5529630d1a899d08b74c5c4ae06524cca194b
[ "name_base = self.specs['dsn_basename']\nsuffix = ''\nfor var, val in zip(self.swp_var_list, combo_list):\n if isinstance(val, str):\n val = os.path.splitext(os.path.basename(val))[0]\n suffix += '_%s_%s' % (var, val)\n elif isinstance(val, int):\n suffix += '_%s_%d' % (var, val)\n eli...
<|body_start_0|> name_base = self.specs['dsn_basename'] suffix = '' for var, val in zip(self.swp_var_list, combo_list): if isinstance(val, str): val = os.path.splitext(os.path.basename(val))[0] suffix += '_%s_%s' % (var, val) elif isinstanc...
CustomDesignManager
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomDesignManager: def get_design_name(self, combo_list): """Generate cell names based on sweep parameter values.""" <|body_0|> def get_layout_params(self, val_list): """Returns the layout dictionary from the given sweep parameter values. Overwritten to incorporate...
stack_v2_sparse_classes_36k_train_026253
19,150
permissive
[ { "docstring": "Generate cell names based on sweep parameter values.", "name": "get_design_name", "signature": "def get_design_name(self, combo_list)" }, { "docstring": "Returns the layout dictionary from the given sweep parameter values. Overwritten to incorporate the discrete evaluation proble...
2
stack_v2_sparse_classes_30k_val_001132
Implement the Python class `CustomDesignManager` described below. Class description: Implement the CustomDesignManager class. Method signatures and docstrings: - def get_design_name(self, combo_list): Generate cell names based on sweep parameter values. - def get_layout_params(self, val_list): Returns the layout dict...
Implement the Python class `CustomDesignManager` described below. Class description: Implement the CustomDesignManager class. Method signatures and docstrings: - def get_design_name(self, combo_list): Generate cell names based on sweep parameter values. - def get_layout_params(self, val_list): Returns the layout dict...
2ce6da8665d944bab8508a83bc4d3d07fd5afb35
<|skeleton|> class CustomDesignManager: def get_design_name(self, combo_list): """Generate cell names based on sweep parameter values.""" <|body_0|> def get_layout_params(self, val_list): """Returns the layout dictionary from the given sweep parameter values. Overwritten to incorporate...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomDesignManager: def get_design_name(self, combo_list): """Generate cell names based on sweep parameter values.""" name_base = self.specs['dsn_basename'] suffix = '' for var, val in zip(self.swp_var_list, combo_list): if isinstance(val, str): val...
the_stack_v2_python_sparse
eval_engines/bag/AFE_CMP_eval.py
kouroshHakha/bag_deep_ckt
train
19
0d8d1c3e6819939ebb050b24b2c5ae2596a89539
[ "def structure2list(list):\n if list == []:\n return None\n max_1 = list[0]\n max_item = 0\n for i, val in enumerate(list):\n if val >= max_1:\n max_1 = val\n max_item = i\n root = TreeNode(max_1)\n root.left = structure2list(list[0:max_item])\n root.right = ...
<|body_start_0|> def structure2list(list): if list == []: return None max_1 = list[0] max_item = 0 for i, val in enumerate(list): if val >= max_1: max_1 = val max_item = i root = T...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def constructMaximumBinaryTree(self, nums): """:type nums: List[int] :rtype: TreeNode 282ms""" <|body_0|> def constructMaximumBinaryTree_1(self, nums): """:type nums: List[int] :rtype: TreeNode 192ms""" <|body_1|> def constructMaximumBinaryTree...
stack_v2_sparse_classes_36k_train_026254
2,893
no_license
[ { "docstring": ":type nums: List[int] :rtype: TreeNode 282ms", "name": "constructMaximumBinaryTree", "signature": "def constructMaximumBinaryTree(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: TreeNode 192ms", "name": "constructMaximumBinaryTree_1", "signature": "def const...
3
stack_v2_sparse_classes_30k_train_012064
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def constructMaximumBinaryTree(self, nums): :type nums: List[int] :rtype: TreeNode 282ms - def constructMaximumBinaryTree_1(self, nums): :type nums: List[int] :rtype: TreeNode 19...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def constructMaximumBinaryTree(self, nums): :type nums: List[int] :rtype: TreeNode 282ms - def constructMaximumBinaryTree_1(self, nums): :type nums: List[int] :rtype: TreeNode 19...
679a2b246b8b6bb7fc55ed1c8096d3047d6d4461
<|skeleton|> class Solution: def constructMaximumBinaryTree(self, nums): """:type nums: List[int] :rtype: TreeNode 282ms""" <|body_0|> def constructMaximumBinaryTree_1(self, nums): """:type nums: List[int] :rtype: TreeNode 192ms""" <|body_1|> def constructMaximumBinaryTree...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def constructMaximumBinaryTree(self, nums): """:type nums: List[int] :rtype: TreeNode 282ms""" def structure2list(list): if list == []: return None max_1 = list[0] max_item = 0 for i, val in enumerate(list): ...
the_stack_v2_python_sparse
MaximumBinaryTree_MID_654.py
953250587/leetcode-python
train
2
f32f4d669853ce1068b6b4af3abe5fc22e4eb52d
[ "params = kwarg['params']\ncmd = 'tc qdisc {} '.format(command)\nreturn cmd", "params = kwarg['params']\ncmd = 'tc qdisc {} '.format(command)\nreturn cmd" ]
<|body_start_0|> params = kwarg['params'] cmd = 'tc qdisc {} '.format(command) return cmd <|end_body_0|> <|body_start_1|> params = kwarg['params'] cmd = 'tc qdisc {} '.format(command) return cmd <|end_body_1|>
tc [ OPTIONS ] qdisc [ add | change | replace | link | delete ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ] qdisc [ qdisc specific parameters ] tc [ OPTIONS ] [ FORMAT ] qdisc show [ dev DEV ]
LinuxTcQdiscImpl
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LinuxTcQdiscImpl: """tc [ OPTIONS ] qdisc [ add | change | replace | link | delete ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ] qdisc [ qdisc specific parameters ] tc [ OPTIONS ] [ FORMAT ] qdisc show [ dev DEV ]""" def f...
stack_v2_sparse_classes_36k_train_026255
1,163
permissive
[ { "docstring": "tc [ OPTIONS ] qdisc [ add | change | replace | link | delete ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ] qdisc [ qdisc specific parameters ]", "name": "format_modify", "signature": "def format_modify(self, command, ...
2
null
Implement the Python class `LinuxTcQdiscImpl` described below. Class description: tc [ OPTIONS ] qdisc [ add | change | replace | link | delete ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ] qdisc [ qdisc specific parameters ] tc [ OPTIONS ] [ FORMAT...
Implement the Python class `LinuxTcQdiscImpl` described below. Class description: tc [ OPTIONS ] qdisc [ add | change | replace | link | delete ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ] qdisc [ qdisc specific parameters ] tc [ OPTIONS ] [ FORMAT...
e4c8221e18cd94e7424c30e12eb0fb82f7767267
<|skeleton|> class LinuxTcQdiscImpl: """tc [ OPTIONS ] qdisc [ add | change | replace | link | delete ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ] qdisc [ qdisc specific parameters ] tc [ OPTIONS ] [ FORMAT ] qdisc show [ dev DEV ]""" def f...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LinuxTcQdiscImpl: """tc [ OPTIONS ] qdisc [ add | change | replace | link | delete ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ] qdisc [ qdisc specific parameters ] tc [ OPTIONS ] [ FORMAT ] qdisc show [ dev DEV ]""" def format_modify(...
the_stack_v2_python_sparse
Amazon_Framework/DentOsTestbedLib/src/dent_os_testbed/lib/tc/linux/linux_tc_qdisc_impl.py
tld3daniel/testing
train
0
8fe6190044b8d9d00330b58afb087f6e4f16282c
[ "srv = service_url[8:20]\nlast = WEBQuery.T[srv] if srv in WEBQuery.T else 0.0\nwait = 0 if timestamp() - last > throttling else throttling\nsleep(wait)\nself.url = service_url\nself.data = webservice.query(service_url, ua)\nWEBQuery.T[srv] = timestamp()", "if data_checker:\n return data_checker(self.data)\nif...
<|body_start_0|> srv = service_url[8:20] last = WEBQuery.T[srv] if srv in WEBQuery.T else 0.0 wait = 0 if timestamp() - last > throttling else throttling sleep(wait) self.url = service_url self.data = webservice.query(service_url, ua) WEBQuery.T[srv] = timestamp()...
Base class to query a webservice and parse the result to py objects.
WEBQuery
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WEBQuery: """Base class to query a webservice and parse the result to py objects.""" def __init__(self, service_url, ua=UA, throttling=THROTTLING): """Initialize & call webservice.""" <|body_0|> def check_data(self, data_checker=None): """Check the data & handle ...
stack_v2_sparse_classes_36k_train_026256
2,294
permissive
[ { "docstring": "Initialize & call webservice.", "name": "__init__", "signature": "def __init__(self, service_url, ua=UA, throttling=THROTTLING)" }, { "docstring": "Check the data & handle errors.", "name": "check_data", "signature": "def check_data(self, data_checker=None)" }, { ...
3
stack_v2_sparse_classes_30k_train_020807
Implement the Python class `WEBQuery` described below. Class description: Base class to query a webservice and parse the result to py objects. Method signatures and docstrings: - def __init__(self, service_url, ua=UA, throttling=THROTTLING): Initialize & call webservice. - def check_data(self, data_checker=None): Che...
Implement the Python class `WEBQuery` described below. Class description: Base class to query a webservice and parse the result to py objects. Method signatures and docstrings: - def __init__(self, service_url, ua=UA, throttling=THROTTLING): Initialize & call webservice. - def check_data(self, data_checker=None): Che...
973fd05ddcee1c5c3cd9bf88353c6623dd69f57a
<|skeleton|> class WEBQuery: """Base class to query a webservice and parse the result to py objects.""" def __init__(self, service_url, ua=UA, throttling=THROTTLING): """Initialize & call webservice.""" <|body_0|> def check_data(self, data_checker=None): """Check the data & handle ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WEBQuery: """Base class to query a webservice and parse the result to py objects.""" def __init__(self, service_url, ua=UA, throttling=THROTTLING): """Initialize & call webservice.""" srv = service_url[8:20] last = WEBQuery.T[srv] if srv in WEBQuery.T else 0.0 wait = 0 if ...
the_stack_v2_python_sparse
lib/python3.6/site-packages/isbnlib/dev/webquery.py
sanjaymaniam/OpenKindlerWeb
train
1
32aa3e77edd63b76826e226d0ff1d79cb09caa39
[ "super().__init__()\nself.mid_planes = mid_planes = out_planes // 1\nself.out_planes = out_planes\nself.share_planes = share_planes\nself.nsample = nsample\nself.linear_q = layers.Dense(mid_planes)\nself.linear_k = layers.Dense(mid_planes)\nself.linear_v = layers.Dense(out_planes)\nself.linear_p = tf.keras.models.S...
<|body_start_0|> super().__init__() self.mid_planes = mid_planes = out_planes // 1 self.out_planes = out_planes self.share_planes = share_planes self.nsample = nsample self.linear_q = layers.Dense(mid_planes) self.linear_k = layers.Dense(mid_planes) self.l...
Transformer layer of the model, uses self attention.
Transformer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Transformer: """Transformer layer of the model, uses self attention.""" def __init__(self, in_planes, out_planes, share_planes=8, nsample=16): """Constructor for Transformer Layer. Args: in_planes (int): Number of input planes. out_planes (int): Number of output planes. share_planes ...
stack_v2_sparse_classes_36k_train_026257
29,888
permissive
[ { "docstring": "Constructor for Transformer Layer. Args: in_planes (int): Number of input planes. out_planes (int): Number of output planes. share_planes (int): Number of shared planes. nsample (int): Number of neighbours.", "name": "__init__", "signature": "def __init__(self, in_planes, out_planes, sha...
2
stack_v2_sparse_classes_30k_train_016011
Implement the Python class `Transformer` described below. Class description: Transformer layer of the model, uses self attention. Method signatures and docstrings: - def __init__(self, in_planes, out_planes, share_planes=8, nsample=16): Constructor for Transformer Layer. Args: in_planes (int): Number of input planes....
Implement the Python class `Transformer` described below. Class description: Transformer layer of the model, uses self attention. Method signatures and docstrings: - def __init__(self, in_planes, out_planes, share_planes=8, nsample=16): Constructor for Transformer Layer. Args: in_planes (int): Number of input planes....
51482281dc180786e7563c73c12ac5df89289748
<|skeleton|> class Transformer: """Transformer layer of the model, uses self attention.""" def __init__(self, in_planes, out_planes, share_planes=8, nsample=16): """Constructor for Transformer Layer. Args: in_planes (int): Number of input planes. out_planes (int): Number of output planes. share_planes ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Transformer: """Transformer layer of the model, uses self attention.""" def __init__(self, in_planes, out_planes, share_planes=8, nsample=16): """Constructor for Transformer Layer. Args: in_planes (int): Number of input planes. out_planes (int): Number of output planes. share_planes (int): Number...
the_stack_v2_python_sparse
ml3d/tf/models/point_transformer.py
CosmosHua/Open3D-ML
train
0
5de109650ffc20d48dfb983592cfd637f0ebbb61
[ "self.c0 = c0\nself.cm = cm\nself.z_src = z_src\nself.c_src = c0 + self.z_src * cm\nself.launch_angles = np.linspace(pi / 2 - 0.001, theta_min, num_rays)\nself.px = None\nself.rho = None\nself.travel_time = None\nself.q = None\nself._rays_to_z0()", "surface_rays = np.zeros((self.launch_angles.size, 4))\npx = np.e...
<|body_start_0|> self.c0 = c0 self.cm = cm self.z_src = z_src self.c_src = c0 + self.z_src * cm self.launch_angles = np.linspace(pi / 2 - 0.001, theta_min, num_rays) self.px = None self.rho = None self.travel_time = None self.q = None self....
Shoot a fan of rays to the surface, create an interpolator
CLinearFan
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CLinearFan: """Shoot a fan of rays to the surface, create an interpolator""" def __init__(self, c0, cm, z_src, num_rays, theta_min): """Initilize rays""" <|body_0|> def _rays_to_z0(self): """propagate rays untill they hit z=0""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_36k_train_026258
2,352
permissive
[ { "docstring": "Initilize rays", "name": "__init__", "signature": "def __init__(self, c0, cm, z_src, num_rays, theta_min)" }, { "docstring": "propagate rays untill they hit z=0", "name": "_rays_to_z0", "signature": "def _rays_to_z0(self)" } ]
2
stack_v2_sparse_classes_30k_test_000342
Implement the Python class `CLinearFan` described below. Class description: Shoot a fan of rays to the surface, create an interpolator Method signatures and docstrings: - def __init__(self, c0, cm, z_src, num_rays, theta_min): Initilize rays - def _rays_to_z0(self): propagate rays untill they hit z=0
Implement the Python class `CLinearFan` described below. Class description: Shoot a fan of rays to the surface, create an interpolator Method signatures and docstrings: - def __init__(self, c0, cm, z_src, num_rays, theta_min): Initilize rays - def _rays_to_z0(self): propagate rays untill they hit z=0 <|skeleton|> cl...
23038da6ee14ad8861938f7307e33b65e3835626
<|skeleton|> class CLinearFan: """Shoot a fan of rays to the surface, create an interpolator""" def __init__(self, c0, cm, z_src, num_rays, theta_min): """Initilize rays""" <|body_0|> def _rays_to_z0(self): """propagate rays untill they hit z=0""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CLinearFan: """Shoot a fan of rays to the surface, create an interpolator""" def __init__(self, c0, cm, z_src, num_rays, theta_min): """Initilize rays""" self.c0 = c0 self.cm = cm self.z_src = z_src self.c_src = c0 + self.z_src * cm self.launch_angles = np....
the_stack_v2_python_sparse
novice_stakes/refraction/clin_greens.py
nedlrichards/novice_stakes
train
0
659eb6fadc32229d48a9e1f09215e699ca037b36
[ "if layer_specs is None:\n layer_specs = [[3, 128, 1, 1], [3, 128, 1, 1], [3, 96, 1, 1], [3, 64, 1, 1], [3, 32, 1, 1], [3, 2, 1, 1]]\nsuper().__init__(name=name, layer_specs=layer_specs, activation_fn=activation_fn, last_activation_fn=None, regularizer=regularizer, padding='SAME', dense_net=dense_net)\nself.sear...
<|body_start_0|> if layer_specs is None: layer_specs = [[3, 128, 1, 1], [3, 128, 1, 1], [3, 96, 1, 1], [3, 64, 1, 1], [3, 32, 1, 1], [3, 2, 1, 1]] super().__init__(name=name, layer_specs=layer_specs, activation_fn=activation_fn, last_activation_fn=None, regularizer=regularizer, padding='SAME...
EstimatorNetwork
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EstimatorNetwork: def __init__(self, name='estimator_network', layer_specs=None, activation_fn=leaky_relu, regularizer=None, search_range=4, dense_net=True, cost_volume_activation=True): """:param name: Str. For variable scoping. :param layer_specs: See parent class. :param activation_fn...
stack_v2_sparse_classes_36k_train_026259
4,188
no_license
[ { "docstring": ":param name: Str. For variable scoping. :param layer_specs: See parent class. :param activation_fn: Tensorflow activation function. :param regularizer: Tf regularizer such as tf.contrib.layers.l2_regularizer. :param dense_net: Bool. Default for PWC-Net is true. :param cost_volume_activation: Boo...
2
stack_v2_sparse_classes_30k_train_016698
Implement the Python class `EstimatorNetwork` described below. Class description: Implement the EstimatorNetwork class. Method signatures and docstrings: - def __init__(self, name='estimator_network', layer_specs=None, activation_fn=leaky_relu, regularizer=None, search_range=4, dense_net=True, cost_volume_activation=...
Implement the Python class `EstimatorNetwork` described below. Class description: Implement the EstimatorNetwork class. Method signatures and docstrings: - def __init__(self, name='estimator_network', layer_specs=None, activation_fn=leaky_relu, regularizer=None, search_range=4, dense_net=True, cost_volume_activation=...
494d503c729ba018614fc742f1aee1e48d37127e
<|skeleton|> class EstimatorNetwork: def __init__(self, name='estimator_network', layer_specs=None, activation_fn=leaky_relu, regularizer=None, search_range=4, dense_net=True, cost_volume_activation=True): """:param name: Str. For variable scoping. :param layer_specs: See parent class. :param activation_fn...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EstimatorNetwork: def __init__(self, name='estimator_network', layer_specs=None, activation_fn=leaky_relu, regularizer=None, search_range=4, dense_net=True, cost_volume_activation=True): """:param name: Str. For variable scoping. :param layer_specs: See parent class. :param activation_fn: Tensorflow a...
the_stack_v2_python_sparse
pwcnet/estimator_network/model.py
NeedsMorePie/interpolator
train
2
f363efa9af9881501129cc3336798bf47f20b12b
[ "conv_data = Bech32BaseUtils.ConvertBits(data, 8, 5)\nif conv_data is None:\n raise ValueError('Invalid data, cannot perform conversion to base32')\nreturn conv_data", "conv_data = Bech32BaseUtils.ConvertBits(data, 5, 8, False)\nif conv_data is None:\n raise ValueError('Invalid data, cannot perform conversi...
<|body_start_0|> conv_data = Bech32BaseUtils.ConvertBits(data, 8, 5) if conv_data is None: raise ValueError('Invalid data, cannot perform conversion to base32') return conv_data <|end_body_0|> <|body_start_1|> conv_data = Bech32BaseUtils.ConvertBits(data, 5, 8, False) ...
Class container for Bech32 utility functions.
Bech32BaseUtils
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Bech32BaseUtils: """Class container for Bech32 utility functions.""" def ConvertToBase32(data: Union[List[int], bytes]) -> List[int]: """Convert data to base32. Args: data (list[int] or bytes): Data to be converted Returns: list[int]: Converted data Raises: ValueError: If the string ...
stack_v2_sparse_classes_36k_train_026260
8,003
permissive
[ { "docstring": "Convert data to base32. Args: data (list[int] or bytes): Data to be converted Returns: list[int]: Converted data Raises: ValueError: If the string is not valid", "name": "ConvertToBase32", "signature": "def ConvertToBase32(data: Union[List[int], bytes]) -> List[int]" }, { "docstr...
3
stack_v2_sparse_classes_30k_train_011422
Implement the Python class `Bech32BaseUtils` described below. Class description: Class container for Bech32 utility functions. Method signatures and docstrings: - def ConvertToBase32(data: Union[List[int], bytes]) -> List[int]: Convert data to base32. Args: data (list[int] or bytes): Data to be converted Returns: lis...
Implement the Python class `Bech32BaseUtils` described below. Class description: Class container for Bech32 utility functions. Method signatures and docstrings: - def ConvertToBase32(data: Union[List[int], bytes]) -> List[int]: Convert data to base32. Args: data (list[int] or bytes): Data to be converted Returns: lis...
d15c75ddd74e4838c396a0d036ef6faf11b06a4b
<|skeleton|> class Bech32BaseUtils: """Class container for Bech32 utility functions.""" def ConvertToBase32(data: Union[List[int], bytes]) -> List[int]: """Convert data to base32. Args: data (list[int] or bytes): Data to be converted Returns: list[int]: Converted data Raises: ValueError: If the string ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Bech32BaseUtils: """Class container for Bech32 utility functions.""" def ConvertToBase32(data: Union[List[int], bytes]) -> List[int]: """Convert data to base32. Args: data (list[int] or bytes): Data to be converted Returns: list[int]: Converted data Raises: ValueError: If the string is not valid"...
the_stack_v2_python_sparse
bip_utils/bech32/bech32_base.py
ebellocchia/bip_utils
train
244
ad2cf5ed5bf84c172cb0aa1eaac2f3cd983f6298
[ "super().__init__()\nself.self_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)\nself.sru = SRUCell(d_model, dim_feedforward, dropout, sru_dropout or dropout, bidirectional=bidirectional, has_skip_term=False, **kwargs)\nself.linear2 = nn.Linear(dim_feedforward, d_model)\nself.norm1 = nn.LayerNorm(d_mod...
<|body_start_0|> super().__init__() self.self_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout) self.sru = SRUCell(d_model, dim_feedforward, dropout, sru_dropout or dropout, bidirectional=bidirectional, has_skip_term=False, **kwargs) self.linear2 = nn.Linear(dim_feedforward, ...
A TransformerSRUEncoderLayer with an SRU replacing the FFN.
TransformerSRUEncoderLayer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TransformerSRUEncoderLayer: """A TransformerSRUEncoderLayer with an SRU replacing the FFN.""" def __init__(self, d_model: int, nhead: int, dim_feedforward: int=2048, dropout: float=0.1, sru_dropout: Optional[float]=None, bidirectional: bool=False, **kwargs: Dict[str, Any]) -> None: "...
stack_v2_sparse_classes_36k_train_026261
23,050
permissive
[ { "docstring": "Initialize a TransformerSRUEncoderLayer. Parameters ---------- d_model : int The number of expected features in the input. n_head : int The number of heads in the multiheadattention models. dim_feedforward : int, optional The dimension of the feedforward network (default=2048). dropout : float, ...
2
null
Implement the Python class `TransformerSRUEncoderLayer` described below. Class description: A TransformerSRUEncoderLayer with an SRU replacing the FFN. Method signatures and docstrings: - def __init__(self, d_model: int, nhead: int, dim_feedforward: int=2048, dropout: float=0.1, sru_dropout: Optional[float]=None, bid...
Implement the Python class `TransformerSRUEncoderLayer` described below. Class description: A TransformerSRUEncoderLayer with an SRU replacing the FFN. Method signatures and docstrings: - def __init__(self, d_model: int, nhead: int, dim_feedforward: int=2048, dropout: float=0.1, sru_dropout: Optional[float]=None, bid...
0dc2f5b2b286694defe8abf450fe5be9ae12c097
<|skeleton|> class TransformerSRUEncoderLayer: """A TransformerSRUEncoderLayer with an SRU replacing the FFN.""" def __init__(self, d_model: int, nhead: int, dim_feedforward: int=2048, dropout: float=0.1, sru_dropout: Optional[float]=None, bidirectional: bool=False, **kwargs: Dict[str, Any]) -> None: "...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TransformerSRUEncoderLayer: """A TransformerSRUEncoderLayer with an SRU replacing the FFN.""" def __init__(self, d_model: int, nhead: int, dim_feedforward: int=2048, dropout: float=0.1, sru_dropout: Optional[float]=None, bidirectional: bool=False, **kwargs: Dict[str, Any]) -> None: """Initialize ...
the_stack_v2_python_sparse
flambe/nn/transformer_sru.py
cle-ros/flambe
train
1
2c592bf4954ce95a840a657b7b9e04c3be0e6cfe
[ "self.backend_tiering = backend_tiering\nself.frontend_tiering = frontend_tiering\nself.max_retention = max_retention", "if dictionary is None:\n return None\nbackend_tiering = dictionary.get('backendTiering')\nfrontend_tiering = dictionary.get('frontendTiering')\nmax_retention = dictionary.get('maxRetention')...
<|body_start_0|> self.backend_tiering = backend_tiering self.frontend_tiering = frontend_tiering self.max_retention = max_retention <|end_body_0|> <|body_start_1|> if dictionary is None: return None backend_tiering = dictionary.get('backendTiering') frontend_...
Implementation of the 'TieringInfo' model. TODO: type description here. Attributes: backend_tiering (bool): Specifies whether back-end tiering is enabled. frontend_tiering (bool): Specifies whether Front End Tiering Enabled max_retention (long|int): Specified the max retention for backup policy creation.
TieringInfo
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TieringInfo: """Implementation of the 'TieringInfo' model. TODO: type description here. Attributes: backend_tiering (bool): Specifies whether back-end tiering is enabled. frontend_tiering (bool): Specifies whether Front End Tiering Enabled max_retention (long|int): Specified the max retention for...
stack_v2_sparse_classes_36k_train_026262
1,968
permissive
[ { "docstring": "Constructor for the TieringInfo class", "name": "__init__", "signature": "def __init__(self, backend_tiering=None, frontend_tiering=None, max_retention=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary repres...
2
null
Implement the Python class `TieringInfo` described below. Class description: Implementation of the 'TieringInfo' model. TODO: type description here. Attributes: backend_tiering (bool): Specifies whether back-end tiering is enabled. frontend_tiering (bool): Specifies whether Front End Tiering Enabled max_retention (lon...
Implement the Python class `TieringInfo` described below. Class description: Implementation of the 'TieringInfo' model. TODO: type description here. Attributes: backend_tiering (bool): Specifies whether back-end tiering is enabled. frontend_tiering (bool): Specifies whether Front End Tiering Enabled max_retention (lon...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class TieringInfo: """Implementation of the 'TieringInfo' model. TODO: type description here. Attributes: backend_tiering (bool): Specifies whether back-end tiering is enabled. frontend_tiering (bool): Specifies whether Front End Tiering Enabled max_retention (long|int): Specified the max retention for...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TieringInfo: """Implementation of the 'TieringInfo' model. TODO: type description here. Attributes: backend_tiering (bool): Specifies whether back-end tiering is enabled. frontend_tiering (bool): Specifies whether Front End Tiering Enabled max_retention (long|int): Specified the max retention for backup polic...
the_stack_v2_python_sparse
cohesity_management_sdk/models/tiering_info.py
cohesity/management-sdk-python
train
24
c9a51ff94bd984e34c43853f9e2b64e18a2493f3
[ "C = 1\nfor i in range(0, n):\n C = C * 2 * (2 * i + 1) / (i + 2)\nreturn int(C)", "G = [0] * (n + 1)\nG[0] = G[1] = 1\nfor i in range(2, n + 1):\n for j in range(1, i + 1):\n G[i] += G[j - 1] * G[i - j]\nreturn G[-1]" ]
<|body_start_0|> C = 1 for i in range(0, n): C = C * 2 * (2 * i + 1) / (i + 2) return int(C) <|end_body_0|> <|body_start_1|> G = [0] * (n + 1) G[0] = G[1] = 1 for i in range(2, n + 1): for j in range(1, i + 1): G[i] += G[j - 1] * G...
BST
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BST: def get_unique_bst_count(self, n: int) -> int: """Approach: Mathematical Deduction Time Complexity: O(N) Space Complexity: O(1) Formulae: Cn = 2(2n + 1)Cn / n + 2 :param n: :return:""" <|body_0|> def get_unique_bst_count_(self, n: int) -> int: """Approach: DP Ti...
stack_v2_sparse_classes_36k_train_026263
969
no_license
[ { "docstring": "Approach: Mathematical Deduction Time Complexity: O(N) Space Complexity: O(1) Formulae: Cn = 2(2n + 1)Cn / n + 2 :param n: :return:", "name": "get_unique_bst_count", "signature": "def get_unique_bst_count(self, n: int) -> int" }, { "docstring": "Approach: DP Time Complexity: O(N^...
2
null
Implement the Python class `BST` described below. Class description: Implement the BST class. Method signatures and docstrings: - def get_unique_bst_count(self, n: int) -> int: Approach: Mathematical Deduction Time Complexity: O(N) Space Complexity: O(1) Formulae: Cn = 2(2n + 1)Cn / n + 2 :param n: :return: - def get...
Implement the Python class `BST` described below. Class description: Implement the BST class. Method signatures and docstrings: - def get_unique_bst_count(self, n: int) -> int: Approach: Mathematical Deduction Time Complexity: O(N) Space Complexity: O(1) Formulae: Cn = 2(2n + 1)Cn / n + 2 :param n: :return: - def get...
65cc78b5afa0db064f9fe8f06597e3e120f7363d
<|skeleton|> class BST: def get_unique_bst_count(self, n: int) -> int: """Approach: Mathematical Deduction Time Complexity: O(N) Space Complexity: O(1) Formulae: Cn = 2(2n + 1)Cn / n + 2 :param n: :return:""" <|body_0|> def get_unique_bst_count_(self, n: int) -> int: """Approach: DP Ti...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BST: def get_unique_bst_count(self, n: int) -> int: """Approach: Mathematical Deduction Time Complexity: O(N) Space Complexity: O(1) Formulae: Cn = 2(2n + 1)Cn / n + 2 :param n: :return:""" C = 1 for i in range(0, n): C = C * 2 * (2 * i + 1) / (i + 2) return int(C) ...
the_stack_v2_python_sparse
revisited/trees/unique_binary_search_tree_ii.py
Shiv2157k/leet_code
train
1
ffbcf06dfb4ca6f267808f4235baf87d86dcaf11
[ "E0 = a0 * m_e * c ** 2 * k0 / e\nzr = 0.5 * k0 * waist ** 2\nself.k0 = k0\nself.inv_zr = 1.0 / zr\nself.inv_waist2 = 1.0 / waist ** 2\nself.inv_tau2 = 1 / tau ** 2\nself.focal_length = focal_length\nself.t_peak = t_peak\nself.v_antenna = source_v\nself.E0 = E0\nself.beta = beta\nself.zeta = zeta\nself.phi2 = phi2\...
<|body_start_0|> E0 = a0 * m_e * c ** 2 * k0 / e zr = 0.5 * k0 * waist ** 2 self.k0 = k0 self.inv_zr = 1.0 / zr self.inv_waist2 = 1.0 / waist ** 2 self.inv_tau2 = 1 / tau ** 2 self.focal_length = focal_length self.t_peak = t_peak self.v_antenna = s...
Class that calculates a Gaussian laser pulse with spatio-temporal correlations (i.e. spatial chirp, angular dispersion and temporal chirp)
GaussianSTCProfile
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GaussianSTCProfile: """Class that calculates a Gaussian laser pulse with spatio-temporal correlations (i.e. spatial chirp, angular dispersion and temporal chirp)""" def __init__(self, k0, waist, tau, t_peak, a0, zeta, beta, phi2, dim, focal_length=0, boost=None, source_v=0): """Defin...
stack_v2_sparse_classes_36k_train_026264
34,589
permissive
[ { "docstring": "Define a Gaussian laser profile with spatio-temporal correlations (i.e. with spatial chirp, angular dispersion and temporal chirp) This object can then be passed to the `EM3D` class, as the argument `laser_func`, in order to have a Gaussian with spatio-temporal correlations laser emitted by the ...
2
null
Implement the Python class `GaussianSTCProfile` described below. Class description: Class that calculates a Gaussian laser pulse with spatio-temporal correlations (i.e. spatial chirp, angular dispersion and temporal chirp) Method signatures and docstrings: - def __init__(self, k0, waist, tau, t_peak, a0, zeta, beta, ...
Implement the Python class `GaussianSTCProfile` described below. Class description: Class that calculates a Gaussian laser pulse with spatio-temporal correlations (i.e. spatial chirp, angular dispersion and temporal chirp) Method signatures and docstrings: - def __init__(self, k0, waist, tau, t_peak, a0, zeta, beta, ...
091c982f82788209017315e13eb7d0e743687d46
<|skeleton|> class GaussianSTCProfile: """Class that calculates a Gaussian laser pulse with spatio-temporal correlations (i.e. spatial chirp, angular dispersion and temporal chirp)""" def __init__(self, k0, waist, tau, t_peak, a0, zeta, beta, phi2, dim, focal_length=0, boost=None, source_v=0): """Defin...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GaussianSTCProfile: """Class that calculates a Gaussian laser pulse with spatio-temporal correlations (i.e. spatial chirp, angular dispersion and temporal chirp)""" def __init__(self, k0, waist, tau, t_peak, a0, zeta, beta, phi2, dim, focal_length=0, boost=None, source_v=0): """Define a Gaussian ...
the_stack_v2_python_sparse
scripts/field_solvers/laser/laser_profiles.py
giadarol/warp
train
0
25385a28f0f74829106862d6042db499eda90493
[ "self._has_been_validated: bool = False\nself._source_names: Set[SourceName] = {GITHUB, GITLAB, BITBUCKET}\nself.protocol_override: Optional[Protocol] = None\nself._sources: Dict[SourceName, Source] = {GITHUB: Source(GITHUB, GITHUB_YAML), GITLAB: Source(GITLAB, GITLAB_YAML), BITBUCKET: Source(BITBUCKET, BITBUCKET_Y...
<|body_start_0|> self._has_been_validated: bool = False self._source_names: Set[SourceName] = {GITHUB, GITLAB, BITBUCKET} self.protocol_override: Optional[Protocol] = None self._sources: Dict[SourceName, Source] = {GITHUB: Source(GITHUB, GITHUB_YAML), GITLAB: Source(GITLAB, GITLAB_YAML),...
Class encapsulating project information from clowder yaml for controlling clowder :ivar Optional[str] protocol_override: The protocol to override sources without an explicitly specified protcol
SourceController
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SourceController: """Class encapsulating project information from clowder yaml for controlling clowder :ivar Optional[str] protocol_override: The protocol to override sources without an explicitly specified protcol""" def __init__(self): """SourceController __init__""" <|body...
stack_v2_sparse_classes_36k_train_026265
3,873
permissive
[ { "docstring": "SourceController __init__", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Register source with controller :param Optional[Union[Source, SourceName]] source: Source to add :raise SourcesValidatedError: :raise UnknownTypeError:", "name": "add_source",...
5
stack_v2_sparse_classes_30k_train_014296
Implement the Python class `SourceController` described below. Class description: Class encapsulating project information from clowder yaml for controlling clowder :ivar Optional[str] protocol_override: The protocol to override sources without an explicitly specified protcol Method signatures and docstrings: - def __...
Implement the Python class `SourceController` described below. Class description: Class encapsulating project information from clowder yaml for controlling clowder :ivar Optional[str] protocol_override: The protocol to override sources without an explicitly specified protcol Method signatures and docstrings: - def __...
1438fc8b1bb7379de66142ffcb0e20b459b59159
<|skeleton|> class SourceController: """Class encapsulating project information from clowder yaml for controlling clowder :ivar Optional[str] protocol_override: The protocol to override sources without an explicitly specified protcol""" def __init__(self): """SourceController __init__""" <|body...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SourceController: """Class encapsulating project information from clowder yaml for controlling clowder :ivar Optional[str] protocol_override: The protocol to override sources without an explicitly specified protcol""" def __init__(self): """SourceController __init__""" self._has_been_vali...
the_stack_v2_python_sparse
clowder/controller/source_controller.py
JrGoodle/clowder
train
17
7aa8431b6d51e95eb8346bd4493b33ac4f1bee52
[ "if root is None:\n return ''\nleft = self.serialize(root.left)\nright = self.serialize(root.right)\nreturn str(root.val) + '-' + str(len(left)) + '#' + left + '#' + right", "if data == '':\n return None\nindex = data.find('#')\nnode = data[:index].split('-')\nroot = TreeNode(int(node[0]))\nlength = int(nod...
<|body_start_0|> if root is None: return '' left = self.serialize(root.left) right = self.serialize(root.right) return str(root.val) + '-' + str(len(left)) + '#' + left + '#' + right <|end_body_0|> <|body_start_1|> if data == '': return None index...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" <|body_0|> def deserialize(self, data: str) -> TreeNode: """Decodes your encoded data to tree.""" <|body_1|> <|end_skeleton|> <|body_start_0|> if root is Non...
stack_v2_sparse_classes_36k_train_026266
2,405
no_license
[ { "docstring": "Encodes a tree to a single string.", "name": "serialize", "signature": "def serialize(self, root: TreeNode) -> str" }, { "docstring": "Decodes your encoded data to tree.", "name": "deserialize", "signature": "def deserialize(self, data: str) -> TreeNode" } ]
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: TreeNode) -> str: Encodes a tree to a single string. - def deserialize(self, data: str) -> TreeNode: Decodes your encoded data to tree.
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: TreeNode) -> str: Encodes a tree to a single string. - def deserialize(self, data: str) -> TreeNode: Decodes your encoded data to tree. <|skeleton|> class Co...
752ac00bea40be1e3794d80aa7b2be58c0a548f6
<|skeleton|> class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" <|body_0|> def deserialize(self, data: str) -> TreeNode: """Decodes your encoded data to tree.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root: TreeNode) -> str: """Encodes a tree to a single string.""" if root is None: return '' left = self.serialize(root.left) right = self.serialize(root.right) return str(root.val) + '-' + str(len(left)) + '#' + left + '#' + right ...
the_stack_v2_python_sparse
Code/Serialize and Deserialize BST.py
mws19901118/Leetcode
train
0
b63161d220b2066182b0baf591d11e67affa1bae
[ "adj_list = {0: [1, 2], 1: [2], 2: [0], 3: []}\nresult = find_friend_groups(adj_list)\nself.assertEqual(result, 2)", "adj_list = {0: [1, 2], 1: [0, 5], 2: [0], 3: [6], 4: [], 5: [1], 6: [3]}\nresult = find_friend_groups(adj_list)\nself.assertEqual(result, 3)" ]
<|body_start_0|> adj_list = {0: [1, 2], 1: [2], 2: [0], 3: []} result = find_friend_groups(adj_list) self.assertEqual(result, 2) <|end_body_0|> <|body_start_1|> adj_list = {0: [1, 2], 1: [0, 5], 2: [0], 3: [6], 4: [], 5: [1], 6: [3]} result = find_friend_groups(adj_list) ...
TestFindFriendGroups
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestFindFriendGroups: def test_returns_two_groups(self): """Takes in an adjacency list of friends and returns 2""" <|body_0|> def test_returns_three_groups(self): """Takes in an adjacency list of friends and returns 3""" <|body_1|> <|end_skeleton|> <|body_s...
stack_v2_sparse_classes_36k_train_026267
674
permissive
[ { "docstring": "Takes in an adjacency list of friends and returns 2", "name": "test_returns_two_groups", "signature": "def test_returns_two_groups(self)" }, { "docstring": "Takes in an adjacency list of friends and returns 3", "name": "test_returns_three_groups", "signature": "def test_r...
2
stack_v2_sparse_classes_30k_train_006364
Implement the Python class `TestFindFriendGroups` described below. Class description: Implement the TestFindFriendGroups class. Method signatures and docstrings: - def test_returns_two_groups(self): Takes in an adjacency list of friends and returns 2 - def test_returns_three_groups(self): Takes in an adjacency list o...
Implement the Python class `TestFindFriendGroups` described below. Class description: Implement the TestFindFriendGroups class. Method signatures and docstrings: - def test_returns_two_groups(self): Takes in an adjacency list of friends and returns 2 - def test_returns_three_groups(self): Takes in an adjacency list o...
27ffb6b32d6d18d279c51cfa45bf305a409be5c2
<|skeleton|> class TestFindFriendGroups: def test_returns_two_groups(self): """Takes in an adjacency list of friends and returns 2""" <|body_0|> def test_returns_three_groups(self): """Takes in an adjacency list of friends and returns 3""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestFindFriendGroups: def test_returns_two_groups(self): """Takes in an adjacency list of friends and returns 2""" adj_list = {0: [1, 2], 1: [2], 2: [0], 3: []} result = find_friend_groups(adj_list) self.assertEqual(result, 2) def test_returns_three_groups(self): "...
the_stack_v2_python_sparse
src/daily-coding-problem/easy/find-friend-groups/test_find_friend_group.py
nwthomas/code-challenges
train
2
d0fb03163a22b6906f8d653163f6ac4fab4bc9c7
[ "langs = hnd.request.headers.get('Accept-Language', '').split(',')\nlangs = get_languages(langs)\nformencode.api.set_stdtranslation(domain='FormEncode', languages=langs)\nself.translate = get_gettextobject('aha', langs).ugettext\nself._ = self.translate\nsuper(ModelCRUDController, self).__init__(hnd, params)", "q...
<|body_start_0|> langs = hnd.request.headers.get('Accept-Language', '').split(',') langs = get_languages(langs) formencode.api.set_stdtranslation(domain='FormEncode', languages=langs) self.translate = get_gettextobject('aha', langs).ugettext self._ = self.translate super(...
A controller that handles CRUD form of particular model.
ModelCRUDController
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ModelCRUDController: """A controller that handles CRUD form of particular model.""" def __init__(self, hnd, params={}): """Initialize method.""" <|body_0|> def get_index_object(self, start, end): """A method to generate query, that gets bunch of object to show in...
stack_v2_sparse_classes_36k_train_026268
11,935
permissive
[ { "docstring": "Initialize method.", "name": "__init__", "signature": "def __init__(self, hnd, params={})" }, { "docstring": "A method to generate query, that gets bunch of object to show in the list", "name": "get_index_object", "signature": "def get_index_object(self, start, end)" },...
3
null
Implement the Python class `ModelCRUDController` described below. Class description: A controller that handles CRUD form of particular model. Method signatures and docstrings: - def __init__(self, hnd, params={}): Initialize method. - def get_index_object(self, start, end): A method to generate query, that gets bunch...
Implement the Python class `ModelCRUDController` described below. Class description: A controller that handles CRUD form of particular model. Method signatures and docstrings: - def __init__(self, hnd, params={}): Initialize method. - def get_index_object(self, start, end): A method to generate query, that gets bunch...
e1209f7d44d1c59ff9d373b7d89d414f31a9c28b
<|skeleton|> class ModelCRUDController: """A controller that handles CRUD form of particular model.""" def __init__(self, hnd, params={}): """Initialize method.""" <|body_0|> def get_index_object(self, start, end): """A method to generate query, that gets bunch of object to show in...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ModelCRUDController: """A controller that handles CRUD form of particular model.""" def __init__(self, hnd, params={}): """Initialize method.""" langs = hnd.request.headers.get('Accept-Language', '').split(',') langs = get_languages(langs) formencode.api.set_stdtranslation...
the_stack_v2_python_sparse
aha/modelcontroller/crudcontroller.py
Letractively/aha-gae
train
0
7d260fc3f3b9de7d635f8b1acfd65fbd72ca8f14
[ "super().__init__(d_model, q, v, h, attention_size, **kwargs)\nself._window_size = window_size\nself._padding = padding\nself._q = q\nself._v = v\nself._step = self._window_size - 2 * self._padding\nself._future_mask = nn.Parameter(torch.triu(torch.ones((self._window_size, self._window_size)), diagonal=1).bool(), r...
<|body_start_0|> super().__init__(d_model, q, v, h, attention_size, **kwargs) self._window_size = window_size self._padding = padding self._q = q self._v = v self._step = self._window_size - 2 * self._padding self._future_mask = nn.Parameter(torch.triu(torch.ones(...
Multi Head Attention block with moving window. Given 3 inputs of shape (batch_size, K, d_model), that will be used to compute query, keys and values, we output a self attention tensor of shape (batch_size, K, d_model). Queries, keys and values are divided in chunks using a moving window. Parameters ---------- d_model: ...
MultiHeadAttentionWindow
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiHeadAttentionWindow: """Multi Head Attention block with moving window. Given 3 inputs of shape (batch_size, K, d_model), that will be used to compute query, keys and values, we output a self attention tensor of shape (batch_size, K, d_model). Queries, keys and values are divided in chunks us...
stack_v2_sparse_classes_36k_train_026269
13,552
permissive
[ { "docstring": "Initialize the Multi Head Block.", "name": "__init__", "signature": "def __init__(self, d_model: int, q: int, v: int, h: int, attention_size: int=None, window_size: Optional[int]=168, padding: Optional[int]=168 // 4, **kwargs)" }, { "docstring": "Propagate forward the input throu...
2
null
Implement the Python class `MultiHeadAttentionWindow` described below. Class description: Multi Head Attention block with moving window. Given 3 inputs of shape (batch_size, K, d_model), that will be used to compute query, keys and values, we output a self attention tensor of shape (batch_size, K, d_model). Queries, k...
Implement the Python class `MultiHeadAttentionWindow` described below. Class description: Multi Head Attention block with moving window. Given 3 inputs of shape (batch_size, K, d_model), that will be used to compute query, keys and values, we output a self attention tensor of shape (batch_size, K, d_model). Queries, k...
0b801d2d2e828ac480d1097cb3bdd82b1e25c15b
<|skeleton|> class MultiHeadAttentionWindow: """Multi Head Attention block with moving window. Given 3 inputs of shape (batch_size, K, d_model), that will be used to compute query, keys and values, we output a self attention tensor of shape (batch_size, K, d_model). Queries, keys and values are divided in chunks us...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MultiHeadAttentionWindow: """Multi Head Attention block with moving window. Given 3 inputs of shape (batch_size, K, d_model), that will be used to compute query, keys and values, we output a self attention tensor of shape (batch_size, K, d_model). Queries, keys and values are divided in chunks using a moving ...
the_stack_v2_python_sparse
code/deep/adarnn/tst/multiHeadAttention.py
jindongwang/transferlearning
train
12,773
548cd1060439ddb42d912ed288abda3fc3dbe3ea
[ "self.names = names\nif len(names) == 0:\n self.leader = None\nelse:\n self.leader = Person(names[0])\n current_person = self.leader\n for name in names[1:]:\n current_person.next = Person(name)\n current_person = current_person.next", "count = len(self.names)\ntemp = []\nif count > 0:\n...
<|body_start_0|> self.names = names if len(names) == 0: self.leader = None else: self.leader = Person(names[0]) current_person = self.leader for name in names[1:]: current_person.next = Person(name) current_person = ...
PeopleChain
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PeopleChain: def __init__(self, names): """(Person, list of str) -> NoneType Create Person objects linked together in the order provided in names. Set the leader of the chain as the first person in names.""" <|body_0|> def get_leader(self): """(Person) -> str Return ...
stack_v2_sparse_classes_36k_train_026270
3,971
permissive
[ { "docstring": "(Person, list of str) -> NoneType Create Person objects linked together in the order provided in names. Set the leader of the chain as the first person in names.", "name": "__init__", "signature": "def __init__(self, names)" }, { "docstring": "(Person) -> str Return the name of t...
5
null
Implement the Python class `PeopleChain` described below. Class description: Implement the PeopleChain class. Method signatures and docstrings: - def __init__(self, names): (Person, list of str) -> NoneType Create Person objects linked together in the order provided in names. Set the leader of the chain as the first ...
Implement the Python class `PeopleChain` described below. Class description: Implement the PeopleChain class. Method signatures and docstrings: - def __init__(self, names): (Person, list of str) -> NoneType Create Person objects linked together in the order provided in names. Set the leader of the chain as the first ...
37009dfdbef9a15c2851bcca2a4e029267e6a02d
<|skeleton|> class PeopleChain: def __init__(self, names): """(Person, list of str) -> NoneType Create Person objects linked together in the order provided in names. Set the leader of the chain as the first person in names.""" <|body_0|> def get_leader(self): """(Person) -> str Return ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PeopleChain: def __init__(self, names): """(Person, list of str) -> NoneType Create Person objects linked together in the order provided in names. Set the leader of the chain as the first person in names.""" self.names = names if len(names) == 0: self.leader = None ...
the_stack_v2_python_sparse
uoft/CSC148H1F Intro to Comp Sci/@week3_stacks/@@Exercise3/chain.py
Reginald-Lee/biji-ben
train
0
12d669248364c84b34be73e12e34a5be160a9069
[ "if isinstance(num, str):\n _n = int(num)\nelse:\n _n = num\nif _n < 0 or _n >= MAX_VALUE_LIMIT:\n raise ValueError('Out of range')\nnum_str = str(num)\ncapital_str = ''.join([LOWER_DIGITS[int(i)] for i in num_str])\ns_units = LOWER_UNITS[len(LOWER_UNITS) - len(num_str):]\no = ''.join((f'{u}{d}' for u, d i...
<|body_start_0|> if isinstance(num, str): _n = int(num) else: _n = num if _n < 0 or _n >= MAX_VALUE_LIMIT: raise ValueError('Out of range') num_str = str(num) capital_str = ''.join([LOWER_DIGITS[int(i)] for i in num_str]) s_units = LOWE...
ChineseNumbers
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ChineseNumbers: def measure_number(num: Union[int, str], upper: bool=False) -> str: """将数字转化为计量大/小写的中文数字,数字0的中文形式为“零”。 >>> ChineseNumbers.measure_number(11) '十一' >>> ChineseNumbers.measure_number(204, True) '贰佰零肆'""" <|body_0|> def order_number(num: Union[int, str], upper: b...
stack_v2_sparse_classes_36k_train_026271
4,068
permissive
[ { "docstring": "将数字转化为计量大/小写的中文数字,数字0的中文形式为“零”。 >>> ChineseNumbers.measure_number(11) '十一' >>> ChineseNumbers.measure_number(204, True) '贰佰零肆'", "name": "measure_number", "signature": "def measure_number(num: Union[int, str], upper: bool=False) -> str" }, { "docstring": "将数字转化为编号大/小写的中文数字,数字0的中文...
3
stack_v2_sparse_classes_30k_train_004078
Implement the Python class `ChineseNumbers` described below. Class description: Implement the ChineseNumbers class. Method signatures and docstrings: - def measure_number(num: Union[int, str], upper: bool=False) -> str: 将数字转化为计量大/小写的中文数字,数字0的中文形式为“零”。 >>> ChineseNumbers.measure_number(11) '十一' >>> ChineseNumbers.meas...
Implement the Python class `ChineseNumbers` described below. Class description: Implement the ChineseNumbers class. Method signatures and docstrings: - def measure_number(num: Union[int, str], upper: bool=False) -> str: 将数字转化为计量大/小写的中文数字,数字0的中文形式为“零”。 >>> ChineseNumbers.measure_number(11) '十一' >>> ChineseNumbers.meas...
06407958a6ba3115d783ed6457c2e7355a3f237c
<|skeleton|> class ChineseNumbers: def measure_number(num: Union[int, str], upper: bool=False) -> str: """将数字转化为计量大/小写的中文数字,数字0的中文形式为“零”。 >>> ChineseNumbers.measure_number(11) '十一' >>> ChineseNumbers.measure_number(204, True) '贰佰零肆'""" <|body_0|> def order_number(num: Union[int, str], upper: b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ChineseNumbers: def measure_number(num: Union[int, str], upper: bool=False) -> str: """将数字转化为计量大/小写的中文数字,数字0的中文形式为“零”。 >>> ChineseNumbers.measure_number(11) '十一' >>> ChineseNumbers.measure_number(204, True) '贰佰零肆'""" if isinstance(num, str): _n = int(num) else: ...
the_stack_v2_python_sparse
borax/numbers.py
kinegratii/borax
train
67
ceeff7b250ac1858f1286342b799ac0c9968b8ec
[ "if not matrix:\n self.M, self.N = (0, -1)\n return\nself.M, self.N = (len(matrix), len(matrix[0]))\nfor i in xrange(1, self.M):\n matrix[i][0] += matrix[i - 1][0]\nfor j in xrange(1, self.N):\n matrix[0][j] += matrix[0][j - 1]\nfor i in xrange(1, self.M):\n for j in xrange(1, self.N):\n matri...
<|body_start_0|> if not matrix: self.M, self.N = (0, -1) return self.M, self.N = (len(matrix), len(matrix[0])) for i in xrange(1, self.M): matrix[i][0] += matrix[i - 1][0] for j in xrange(1, self.N): matrix[0][j] += matrix[0][j - 1] ...
NumMatrix
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" <|body_0|> def sumRegion(self, row1, col1, row2, col2): """:type row1: int :type col1: int :type row2: int :type col2: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|>...
stack_v2_sparse_classes_36k_train_026272
1,750
no_license
[ { "docstring": ":type matrix: List[List[int]]", "name": "__init__", "signature": "def __init__(self, matrix)" }, { "docstring": ":type row1: int :type col1: int :type row2: int :type col2: int :rtype: int", "name": "sumRegion", "signature": "def sumRegion(self, row1, col1, row2, col2)" ...
2
stack_v2_sparse_classes_30k_train_001272
Implement the Python class `NumMatrix` described below. Class description: Implement the NumMatrix class. Method signatures and docstrings: - def __init__(self, matrix): :type matrix: List[List[int]] - def sumRegion(self, row1, col1, row2, col2): :type row1: int :type col1: int :type row2: int :type col2: int :rtype:...
Implement the Python class `NumMatrix` described below. Class description: Implement the NumMatrix class. Method signatures and docstrings: - def __init__(self, matrix): :type matrix: List[List[int]] - def sumRegion(self, row1, col1, row2, col2): :type row1: int :type col1: int :type row2: int :type col2: int :rtype:...
00196f836d4bc226ddcb745b17e247c2ed4e9b4b
<|skeleton|> class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" <|body_0|> def sumRegion(self, row1, col1, row2, col2): """:type row1: int :type col1: int :type row2: int :type col2: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" if not matrix: self.M, self.N = (0, -1) return self.M, self.N = (len(matrix), len(matrix[0])) for i in xrange(1, self.M): matrix[i][0] += matrix[i - 1][0] for ...
the_stack_v2_python_sparse
Facebook习题/面经/304. Range Sum Query 2D - Immutable.py
signalwolf/Leetcode_by_type
train
0
80afb49f56f742d7d0d5d04ef6ba5d6c89f73510
[ "force = req.get_param_as_bool(name='force') or False\ndryrun = req.get_param_as_bool(name='dryrun') or False\nhelper = ConfigdocsHelper(req.context)\nvalidations = self.commit_configdocs(helper, force, dryrun)\nresp.body = self.to_json(validations)\nresp.status = validations.get('code', falcon.HTTP_200)", "if he...
<|body_start_0|> force = req.get_param_as_bool(name='force') or False dryrun = req.get_param_as_bool(name='dryrun') or False helper = ConfigdocsHelper(req.context) validations = self.commit_configdocs(helper, force, dryrun) resp.body = self.to_json(validations) resp.statu...
Commits the buffered configdocs, if the validations pass (or are overridden (force = true)) Returns the list of validations.
CommitConfigDocsResource
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CommitConfigDocsResource: """Commits the buffered configdocs, if the validations pass (or are overridden (force = true)) Returns the list of validations.""" def on_post(self, req, resp): """Get validations from all UCP components Functionality does not exist yet""" <|body_0|>...
stack_v2_sparse_classes_36k_train_026273
9,265
permissive
[ { "docstring": "Get validations from all UCP components Functionality does not exist yet", "name": "on_post", "signature": "def on_post(self, req, resp)" }, { "docstring": "Attempts to commit the configdocs", "name": "commit_configdocs", "signature": "def commit_configdocs(self, helper, ...
2
stack_v2_sparse_classes_30k_train_013395
Implement the Python class `CommitConfigDocsResource` described below. Class description: Commits the buffered configdocs, if the validations pass (or are overridden (force = true)) Returns the list of validations. Method signatures and docstrings: - def on_post(self, req, resp): Get validations from all UCP componen...
Implement the Python class `CommitConfigDocsResource` described below. Class description: Commits the buffered configdocs, if the validations pass (or are overridden (force = true)) Returns the list of validations. Method signatures and docstrings: - def on_post(self, req, resp): Get validations from all UCP componen...
14d66afb012025a5289818d8e8d2092ccce19ffa
<|skeleton|> class CommitConfigDocsResource: """Commits the buffered configdocs, if the validations pass (or are overridden (force = true)) Returns the list of validations.""" def on_post(self, req, resp): """Get validations from all UCP components Functionality does not exist yet""" <|body_0|>...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CommitConfigDocsResource: """Commits the buffered configdocs, if the validations pass (or are overridden (force = true)) Returns the list of validations.""" def on_post(self, req, resp): """Get validations from all UCP components Functionality does not exist yet""" force = req.get_param_a...
the_stack_v2_python_sparse
src/bin/shipyard_airflow/shipyard_airflow/control/configdocs/configdocs_api.py
att-comdev/shipyard
train
14
58acc77c9d1a57ae5ed1fecd150e700e475007bf
[ "for i in range(len(nums)):\n while nums[i] != i + 1 and nums[nums[i] - 1] != nums[i]:\n nums[nums[i] - 1], nums[i] = (nums[i], nums[nums[i] - 1])\nreturn [i + 1 for i, num in enumerate(nums) if num != i + 1]", "for i in range(len(nums)):\n index = abs(nums[i]) - 1\n nums[index] = -abs(nums[index]...
<|body_start_0|> for i in range(len(nums)): while nums[i] != i + 1 and nums[nums[i] - 1] != nums[i]: nums[nums[i] - 1], nums[i] = (nums[i], nums[nums[i] - 1]) return [i + 1 for i, num in enumerate(nums) if num != i + 1] <|end_body_0|> <|body_start_1|> for i in range(...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findDisappearedNumbers(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_0|> def findDisappearedNumbers2(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> for i in r...
stack_v2_sparse_classes_36k_train_026274
895
permissive
[ { "docstring": ":type nums: List[int] :rtype: List[int]", "name": "findDisappearedNumbers", "signature": "def findDisappearedNumbers(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: List[int]", "name": "findDisappearedNumbers2", "signature": "def findDisappearedNumbers2(self...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findDisappearedNumbers(self, nums): :type nums: List[int] :rtype: List[int] - def findDisappearedNumbers2(self, nums): :type nums: List[int] :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findDisappearedNumbers(self, nums): :type nums: List[int] :rtype: List[int] - def findDisappearedNumbers2(self, nums): :type nums: List[int] :rtype: List[int] <|skeleton|> c...
c8bf33af30569177c5276ffcd72a8d93ba4c402a
<|skeleton|> class Solution: def findDisappearedNumbers(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_0|> def findDisappearedNumbers2(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findDisappearedNumbers(self, nums): """:type nums: List[int] :rtype: List[int]""" for i in range(len(nums)): while nums[i] != i + 1 and nums[nums[i] - 1] != nums[i]: nums[nums[i] - 1], nums[i] = (nums[i], nums[nums[i] - 1]) return [i + 1 for i,...
the_stack_v2_python_sparse
401-500/441-450/448-findAllNumbersDisappearedInArray/findAllNumbersDisappearedInArray.py
xuychen/Leetcode
train
0
13066b6179d3ad277d4f3bbcdc494fd56ff5debe
[ "endpoint = self.base_url + '/authorize'\nbody = {'user_auth': {'client_id': base.getid(consumer), 'scopes': scopes}}\nresponse, body = self.client.post(endpoint, body=body, redirect=redirect)\nredirect_uri = response.headers.get('Location')\nparsed = urlparse.urlparse(redirect_uri)\nquery = dict(urlparse.parse_qsl...
<|body_start_0|> endpoint = self.base_url + '/authorize' body = {'user_auth': {'client_id': base.getid(consumer), 'scopes': scopes}} response, body = self.client.post(endpoint, body=body, redirect=redirect) redirect_uri = response.headers.get('Location') parsed = urlparse.urlpars...
Manager class for manipulating identity OAuth authorization codes.
AuthorizationCodeManager
[ "Apache-2.0", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AuthorizationCodeManager: """Manager class for manipulating identity OAuth authorization codes.""" def authorize(self, consumer, scopes, redirect=False): """Authorize a Consumer for certain scopes, getting an authorization code. The way the provider (Keystone) will return the code is...
stack_v2_sparse_classes_36k_train_026275
4,893
permissive
[ { "docstring": "Authorize a Consumer for certain scopes, getting an authorization code. The way the provider (Keystone) will return the code is in the header, as an HTTP redirection: 'Location': 'https://foo.com/welcome_back?code=somerandomstring&state=xyz' Utilize Identity API operation: POST /OS-OAUTH2/author...
2
stack_v2_sparse_classes_30k_train_019277
Implement the Python class `AuthorizationCodeManager` described below. Class description: Manager class for manipulating identity OAuth authorization codes. Method signatures and docstrings: - def authorize(self, consumer, scopes, redirect=False): Authorize a Consumer for certain scopes, getting an authorization code...
Implement the Python class `AuthorizationCodeManager` described below. Class description: Manager class for manipulating identity OAuth authorization codes. Method signatures and docstrings: - def authorize(self, consumer, scopes, redirect=False): Authorize a Consumer for certain scopes, getting an authorization code...
e1c18ffc181de3a28dccae3bd4f3a08a3ed3d090
<|skeleton|> class AuthorizationCodeManager: """Manager class for manipulating identity OAuth authorization codes.""" def authorize(self, consumer, scopes, redirect=False): """Authorize a Consumer for certain scopes, getting an authorization code. The way the provider (Keystone) will return the code is...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AuthorizationCodeManager: """Manager class for manipulating identity OAuth authorization codes.""" def authorize(self, consumer, scopes, redirect=False): """Authorize a Consumer for certain scopes, getting an authorization code. The way the provider (Keystone) will return the code is in the heade...
the_stack_v2_python_sparse
keystoneclient/v3/contrib/oauth2/authorization_codes.py
hmunfru/python-keystoneclient
train
0
79b48d5be97a16f98ed183dd40b13a7b71c2f5f8
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "conte...
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
* 登录相关接口
AuthServiceServicer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AuthServiceServicer: """* 登录相关接口""" def sendVerificationCode(self, request, context): """* 发送验证码 @NoAuth""" <|body_0|> def login(self, request, context): """* 登录 @NoAuth""" <|body_1|> def refreshToken(self, request, context): """* 刷新token""" ...
stack_v2_sparse_classes_36k_train_026276
5,205
no_license
[ { "docstring": "* 发送验证码 @NoAuth", "name": "sendVerificationCode", "signature": "def sendVerificationCode(self, request, context)" }, { "docstring": "* 登录 @NoAuth", "name": "login", "signature": "def login(self, request, context)" }, { "docstring": "* 刷新token", "name": "refres...
3
stack_v2_sparse_classes_30k_train_021005
Implement the Python class `AuthServiceServicer` described below. Class description: * 登录相关接口 Method signatures and docstrings: - def sendVerificationCode(self, request, context): * 发送验证码 @NoAuth - def login(self, request, context): * 登录 @NoAuth - def refreshToken(self, request, context): * 刷新token
Implement the Python class `AuthServiceServicer` described below. Class description: * 登录相关接口 Method signatures and docstrings: - def sendVerificationCode(self, request, context): * 发送验证码 @NoAuth - def login(self, request, context): * 登录 @NoAuth - def refreshToken(self, request, context): * 刷新token <|skeleton|> clas...
3c8eb4b870087a0baab2a749e2876594b83044ea
<|skeleton|> class AuthServiceServicer: """* 登录相关接口""" def sendVerificationCode(self, request, context): """* 发送验证码 @NoAuth""" <|body_0|> def login(self, request, context): """* 登录 @NoAuth""" <|body_1|> def refreshToken(self, request, context): """* 刷新token""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AuthServiceServicer: """* 登录相关接口""" def sendVerificationCode(self, request, context): """* 发送验证码 @NoAuth""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def login(se...
the_stack_v2_python_sparse
buf_grpc/Auth_pb2_grpc.py
heyeping/grpc_auto_project
train
0
2389facaa4178096d6f98d80815317be2d66febc
[ "self.count = 0\nself.size = size\nself.array = []", "if self.count == self.size:\n return False\nself.array.append(value)\nself.count += 1\nreturn True", "if self.count == 0:\n return False\ndata = self.array[self.count - 1]\nself.count -= 1\nreturn data" ]
<|body_start_0|> self.count = 0 self.size = size self.array = [] <|end_body_0|> <|body_start_1|> if self.count == self.size: return False self.array.append(value) self.count += 1 return True <|end_body_1|> <|body_start_2|> if self.count == 0:...
stack
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class stack: def __init__(self, size): """栈结构 :param size: 栈大小""" <|body_0|> def push(self, value): """入栈 入栈判满 :param value:""" <|body_1|> def pop(self): """出栈 出栈判空 :return:""" <|body_2|> <|end_skeleton|> <|body_start_0|> self.count =...
stack_v2_sparse_classes_36k_train_026277
856
no_license
[ { "docstring": "栈结构 :param size: 栈大小", "name": "__init__", "signature": "def __init__(self, size)" }, { "docstring": "入栈 入栈判满 :param value:", "name": "push", "signature": "def push(self, value)" }, { "docstring": "出栈 出栈判空 :return:", "name": "pop", "signature": "def pop(se...
3
stack_v2_sparse_classes_30k_train_010086
Implement the Python class `stack` described below. Class description: Implement the stack class. Method signatures and docstrings: - def __init__(self, size): 栈结构 :param size: 栈大小 - def push(self, value): 入栈 入栈判满 :param value: - def pop(self): 出栈 出栈判空 :return:
Implement the Python class `stack` described below. Class description: Implement the stack class. Method signatures and docstrings: - def __init__(self, size): 栈结构 :param size: 栈大小 - def push(self, value): 入栈 入栈判满 :param value: - def pop(self): 出栈 出栈判空 :return: <|skeleton|> class stack: def __init__(self, size)...
7543af3cf09cc225626af78a44b185ecad52ac24
<|skeleton|> class stack: def __init__(self, size): """栈结构 :param size: 栈大小""" <|body_0|> def push(self, value): """入栈 入栈判满 :param value:""" <|body_1|> def pop(self): """出栈 出栈判空 :return:""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class stack: def __init__(self, size): """栈结构 :param size: 栈大小""" self.count = 0 self.size = size self.array = [] def push(self, value): """入栈 入栈判满 :param value:""" if self.count == self.size: return False self.array.append(value) self...
the_stack_v2_python_sparse
stack/array_stack.py
cpeixin/leetcode-bbbbrent
train
0
9d1a434935dc92f34a1a78f4b3f8b0efdf9596c4
[ "self.basename = addon\nself.addon_type = ValidAddons.get_addon_type(self.basename)\nself.module = 'gungame51.scripts.%s.%s.%s' % (self.addon_type, self.basename, self.basename)\ninstance = __import__(self.module, globals(), locals(), [''])\nreload(instance)\nself.globals = instance.__dict__\nself.info = self._get_...
<|body_start_0|> self.basename = addon self.addon_type = ValidAddons.get_addon_type(self.basename) self.module = 'gungame51.scripts.%s.%s.%s' % (self.addon_type, self.basename, self.basename) instance = __import__(self.module, globals(), locals(), ['']) reload(instance) s...
Class that stores the instance of an included/custom addon
_AddonInstance
[ "Artistic-1.0", "LicenseRef-scancode-public-domain" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _AddonInstance: """Class that stores the instance of an included/custom addon""" def __init__(self, addon): """Called when the addon is first imported""" <|body_0|> def _get_addon_info(self): """Returns the AddonInfo instance for the addon""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_026278
2,595
permissive
[ { "docstring": "Called when the addon is first imported", "name": "__init__", "signature": "def __init__(self, addon)" }, { "docstring": "Returns the AddonInfo instance for the addon", "name": "_get_addon_info", "signature": "def _get_addon_info(self)" } ]
2
null
Implement the Python class `_AddonInstance` described below. Class description: Class that stores the instance of an included/custom addon Method signatures and docstrings: - def __init__(self, addon): Called when the addon is first imported - def _get_addon_info(self): Returns the AddonInfo instance for the addon
Implement the Python class `_AddonInstance` described below. Class description: Class that stores the instance of an included/custom addon Method signatures and docstrings: - def __init__(self, addon): Called when the addon is first imported - def _get_addon_info(self): Returns the AddonInfo instance for the addon <...
ebf4624626266f552189a32612b8d09cd5b4c5a3
<|skeleton|> class _AddonInstance: """Class that stores the instance of an included/custom addon""" def __init__(self, addon): """Called when the addon is first imported""" <|body_0|> def _get_addon_info(self): """Returns the AddonInfo instance for the addon""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _AddonInstance: """Class that stores the instance of an included/custom addon""" def __init__(self, addon): """Called when the addon is first imported""" self.basename = addon self.addon_type = ValidAddons.get_addon_type(self.basename) self.module = 'gungame51.scripts.%s.%...
the_stack_v2_python_sparse
cstrike/addons/eventscripts/gungame51/core/addons/instance.py
GunGame-Dev-Team/GunGame51
train
0
1bd8a79b187fbde38cebe26939079f961c83d336
[ "super(QDesignatorSortModel, self).__init__(parent)\nself.comparator = QDesignatorComparator()\nself.column = designatorColumn", "try:\n a = left.data().split(',')[0]\n b = right.data().split(',')[0]\n desigs = list(map(self.comparator.getNormalisedDesignator, [a, b]))\nexcept IndexError:\n desigs = [...
<|body_start_0|> super(QDesignatorSortModel, self).__init__(parent) self.comparator = QDesignatorComparator() self.column = designatorColumn <|end_body_0|> <|body_start_1|> try: a = left.data().split(',')[0] b = right.data().split(',')[0] desigs = lis...
Reimplements sorting of the treeview such, that designator and values numbers are properly sorted according to 'normal' perception. Hence U1, U2, U3 and not U1, U10, U11 as by default.
QDesignatorSortModel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class QDesignatorSortModel: """Reimplements sorting of the treeview such, that designator and values numbers are properly sorted according to 'normal' perception. Hence U1, U2, U3 and not U1, U10, U11 as by default.""" def __init__(self, designatorColumn=0, parent=None): """sorting proxy a...
stack_v2_sparse_classes_36k_train_026279
2,928
no_license
[ { "docstring": "sorting proxy assures that designators are correctly sorted. For this give a column number, which contains designators. This is to identify whether ordinary sorting or string sorting has to be done", "name": "__init__", "signature": "def __init__(self, designatorColumn=0, parent=None)" ...
2
stack_v2_sparse_classes_30k_train_012584
Implement the Python class `QDesignatorSortModel` described below. Class description: Reimplements sorting of the treeview such, that designator and values numbers are properly sorted according to 'normal' perception. Hence U1, U2, U3 and not U1, U10, U11 as by default. Method signatures and docstrings: - def __init_...
Implement the Python class `QDesignatorSortModel` described below. Class description: Reimplements sorting of the treeview such, that designator and values numbers are properly sorted according to 'normal' perception. Hence U1, U2, U3 and not U1, U10, U11 as by default. Method signatures and docstrings: - def __init_...
013a5859fc64aa4b43dfe5b493c058fba6dfdcee
<|skeleton|> class QDesignatorSortModel: """Reimplements sorting of the treeview such, that designator and values numbers are properly sorted according to 'normal' perception. Hence U1, U2, U3 and not U1, U10, U11 as by default.""" def __init__(self, designatorColumn=0, parent=None): """sorting proxy a...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class QDesignatorSortModel: """Reimplements sorting of the treeview such, that designator and values numbers are properly sorted according to 'normal' perception. Hence U1, U2, U3 and not U1, U10, U11 as by default.""" def __init__(self, designatorColumn=0, parent=None): """sorting proxy assures that d...
the_stack_v2_python_sparse
BOMizator/qdesignatorsortmodel.py
dejfson/BOMizator
train
1
3f2d00cf00e3aa45fd91f013b68b468344bc1925
[ "email = self.cleaned_data['email']\nself.users_cache = User.objects.filter(email__iexact=email)\nif len(self.users_cache) == 0:\n raise forms.ValidationError(_(\"That e-mail address doesn't have an associated user account. Are you sure you've registered?\"))\nreturn email", "from utils.emails import send_emai...
<|body_start_0|> email = self.cleaned_data['email'] self.users_cache = User.objects.filter(email__iexact=email) if len(self.users_cache) == 0: raise forms.ValidationError(_("That e-mail address doesn't have an associated user account. Are you sure you've registered?")) return...
PasswordResetForm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PasswordResetForm: def clean_email(self): """Validates that a user exists with the given e-mail address.""" <|body_0|> def save(self, domain_override=None, email_template_name='registration/password_reset_email.html', use_https=False, token_generator=default_token_generator,...
stack_v2_sparse_classes_36k_train_026280
7,310
no_license
[ { "docstring": "Validates that a user exists with the given e-mail address.", "name": "clean_email", "signature": "def clean_email(self)" }, { "docstring": "Generates a one-use only link for resetting password and sends to the user", "name": "save", "signature": "def save(self, domain_ov...
2
null
Implement the Python class `PasswordResetForm` described below. Class description: Implement the PasswordResetForm class. Method signatures and docstrings: - def clean_email(self): Validates that a user exists with the given e-mail address. - def save(self, domain_override=None, email_template_name='registration/pass...
Implement the Python class `PasswordResetForm` described below. Class description: Implement the PasswordResetForm class. Method signatures and docstrings: - def clean_email(self): Validates that a user exists with the given e-mail address. - def save(self, domain_override=None, email_template_name='registration/pass...
7d0d58afb96b5ba57c5fe5517027555b36d47448
<|skeleton|> class PasswordResetForm: def clean_email(self): """Validates that a user exists with the given e-mail address.""" <|body_0|> def save(self, domain_override=None, email_template_name='registration/password_reset_email.html', use_https=False, token_generator=default_token_generator,...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PasswordResetForm: def clean_email(self): """Validates that a user exists with the given e-mail address.""" email = self.cleaned_data['email'] self.users_cache = User.objects.filter(email__iexact=email) if len(self.users_cache) == 0: raise forms.ValidationError(_("T...
the_stack_v2_python_sparse
source/frontoffice/forms.py
openstate/Wiekiesjij
train
0
4e2ed3a6116697bba605177a0604edffdd610b56
[ "loc = [(i - 1, j - 1), (i - 1, j), (i - 1, j + 1), (i, j - 1), (i, j), (i, j + 1), (i + 1, j - 1), (i + 1, j), (i + 1, j + 1)]\nsum_i = 0\ncnt_i = 0\nfor k in loc:\n if new_arr[k[0]][k[1]] != add_i:\n cnt_i += 1\n sum_i += new_arr[k[0]][k[1]]\nM[i - 1][j - 1] = math.floor(sum_i / cnt_i)", "new_a...
<|body_start_0|> loc = [(i - 1, j - 1), (i - 1, j), (i - 1, j + 1), (i, j - 1), (i, j), (i, j + 1), (i + 1, j - 1), (i + 1, j), (i + 1, j + 1)] sum_i = 0 cnt_i = 0 for k in loc: if new_arr[k[0]][k[1]] != add_i: cnt_i += 1 sum_i += new_arr[k[0]]...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def add_square(self, i, j, new_arr, M): """遍历 new_arr 元素,将对应的 M 中元素 M[i-1][j-1] 修改为平均值""" <|body_0|> def imageSmoother(self, M): """:type M: List[List[int]] :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|> <|body_start_0|> loc = [(i ...
stack_v2_sparse_classes_36k_train_026281
1,288
no_license
[ { "docstring": "遍历 new_arr 元素,将对应的 M 中元素 M[i-1][j-1] 修改为平均值", "name": "add_square", "signature": "def add_square(self, i, j, new_arr, M)" }, { "docstring": ":type M: List[List[int]] :rtype: List[List[int]]", "name": "imageSmoother", "signature": "def imageSmoother(self, M)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def add_square(self, i, j, new_arr, M): 遍历 new_arr 元素,将对应的 M 中元素 M[i-1][j-1] 修改为平均值 - def imageSmoother(self, M): :type M: List[List[int]] :rtype: List[List[int]]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def add_square(self, i, j, new_arr, M): 遍历 new_arr 元素,将对应的 M 中元素 M[i-1][j-1] 修改为平均值 - def imageSmoother(self, M): :type M: List[List[int]] :rtype: List[List[int]] <|skeleton|> c...
c37f44f71a0e266aa8078c95506e6aa54ce4660c
<|skeleton|> class Solution: def add_square(self, i, j, new_arr, M): """遍历 new_arr 元素,将对应的 M 中元素 M[i-1][j-1] 修改为平均值""" <|body_0|> def imageSmoother(self, M): """:type M: List[List[int]] :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def add_square(self, i, j, new_arr, M): """遍历 new_arr 元素,将对应的 M 中元素 M[i-1][j-1] 修改为平均值""" loc = [(i - 1, j - 1), (i - 1, j), (i - 1, j + 1), (i, j - 1), (i, j), (i, j + 1), (i + 1, j - 1), (i + 1, j), (i + 1, j + 1)] sum_i = 0 cnt_i = 0 for k in loc: ...
the_stack_v2_python_sparse
661. Image Smoother/661.py
hotheat/LeetCode
train
2
5b27cf5c7b5a6a62cd7ee99412bd0dcb6cdb13db
[ "super().__init__()\nself.W = tf.keras.layers.Dense(units)\nself.U = tf.keras.layers.Dense(units)\nself.V = tf.keras.layers.Dense(1)", "query = s_prev\nvalues = hidden_states\nnewaxis_query = tf.expand_dims(query, 1)\na = self.W(newaxis_query)\nb = self.U(values)\nscore = self.V(tf.nn.tanh(a + b))\nscore = tf.nn....
<|body_start_0|> super().__init__() self.W = tf.keras.layers.Dense(units) self.U = tf.keras.layers.Dense(units) self.V = tf.keras.layers.Dense(1) <|end_body_0|> <|body_start_1|> query = s_prev values = hidden_states newaxis_query = tf.expand_dims(query, 1) ...
calculate the attention for machine translation
SelfAttention
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SelfAttention: """calculate the attention for machine translation""" def __init__(self, units): """ARGS: *units :{integer}: the number of hidden units in the alignment model Sets : *W - {Dense} units units: the previous decoder hidden state *U - {Dense} units units: the encoder hidde...
stack_v2_sparse_classes_36k_train_026282
1,923
no_license
[ { "docstring": "ARGS: *units :{integer}: the number of hidden units in the alignment model Sets : *W - {Dense} units units: the previous decoder hidden state *U - {Dense} units units: the encoder hidden states *V - {Dense} 1 units: the tanh of the sum of the outputs of W and U", "name": "__init__", "sig...
2
null
Implement the Python class `SelfAttention` described below. Class description: calculate the attention for machine translation Method signatures and docstrings: - def __init__(self, units): ARGS: *units :{integer}: the number of hidden units in the alignment model Sets : *W - {Dense} units units: the previous decoder...
Implement the Python class `SelfAttention` described below. Class description: calculate the attention for machine translation Method signatures and docstrings: - def __init__(self, units): ARGS: *units :{integer}: the number of hidden units in the alignment model Sets : *W - {Dense} units units: the previous decoder...
7dafc37d306fcf2ea0f5af5bd97dfd78d388100c
<|skeleton|> class SelfAttention: """calculate the attention for machine translation""" def __init__(self, units): """ARGS: *units :{integer}: the number of hidden units in the alignment model Sets : *W - {Dense} units units: the previous decoder hidden state *U - {Dense} units units: the encoder hidde...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SelfAttention: """calculate the attention for machine translation""" def __init__(self, units): """ARGS: *units :{integer}: the number of hidden units in the alignment model Sets : *W - {Dense} units units: the previous decoder hidden state *U - {Dense} units units: the encoder hidden states *V -...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/1-self_attention.py
AndresSern/holbertonschool-machine_learning-1
train
0
948ff0c7f12e269d2431db353c5ac4b3fd7ce052
[ "result = await _booru(ctx.bot.session, BASE_URLS['safebooru']['api'], f'maid {tags}')\nif isinstance(result, str):\n await ctx.send(result)\nelse:\n embed = _process_post(result, BASE_URLS['safebooru']['post'])\n await ctx.send(embed=embed)", "result = await _booru(ctx.bot.session, BASE_URLS['safebooru'...
<|body_start_0|> result = await _booru(ctx.bot.session, BASE_URLS['safebooru']['api'], f'maid {tags}') if isinstance(result, str): await ctx.send(result) else: embed = _process_post(result, BASE_URLS['safebooru']['post']) await ctx.send(embed=embed) <|end_body...
Imageboard lookup commands.
Booru
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Booru: """Imageboard lookup commands.""" async def maid(self, ctx, *, tags=''): """Find a random maid. Optional tags.""" <|body_0|> async def animeme(self, ctx, *, tags=''): """Find a random anime meme. Optional tags.""" <|body_1|> async def colonles...
stack_v2_sparse_classes_36k_train_026283
4,323
permissive
[ { "docstring": "Find a random maid. Optional tags.", "name": "maid", "signature": "async def maid(self, ctx, *, tags='')" }, { "docstring": "Find a random anime meme. Optional tags.", "name": "animeme", "signature": "async def animeme(self, ctx, *, tags='')" }, { "docstring": ":<...
4
stack_v2_sparse_classes_30k_train_013625
Implement the Python class `Booru` described below. Class description: Imageboard lookup commands. Method signatures and docstrings: - async def maid(self, ctx, *, tags=''): Find a random maid. Optional tags. - async def animeme(self, ctx, *, tags=''): Find a random anime meme. Optional tags. - async def colonlesstha...
Implement the Python class `Booru` described below. Class description: Imageboard lookup commands. Method signatures and docstrings: - async def maid(self, ctx, *, tags=''): Find a random maid. Optional tags. - async def animeme(self, ctx, *, tags=''): Find a random anime meme. Optional tags. - async def colonlesstha...
9bf3f2125939b66bd1894e509c1b1fa1ab413a6a
<|skeleton|> class Booru: """Imageboard lookup commands.""" async def maid(self, ctx, *, tags=''): """Find a random maid. Optional tags.""" <|body_0|> async def animeme(self, ctx, *, tags=''): """Find a random anime meme. Optional tags.""" <|body_1|> async def colonles...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Booru: """Imageboard lookup commands.""" async def maid(self, ctx, *, tags=''): """Find a random maid. Optional tags.""" result = await _booru(ctx.bot.session, BASE_URLS['safebooru']['api'], f'maid {tags}') if isinstance(result, str): await ctx.send(result) els...
the_stack_v2_python_sparse
cogs/imgboards/booru.py
DasWolke/kitsuchan-2
train
1
2b7b2833cfe463367e53354102656bbdf9e10cec
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn WorkbookTable()", "from .entity import Entity\nfrom .workbook_table_column import WorkbookTableColumn\nfrom .workbook_table_row import WorkbookTableRow\nfrom .workbook_table_sort import WorkbookTableSort\nfrom .workbook_worksheet impor...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return WorkbookTable() <|end_body_0|> <|body_start_1|> from .entity import Entity from .workbook_table_column import WorkbookTableColumn from .workbook_table_row import WorkbookTableRow...
WorkbookTable
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WorkbookTable: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> WorkbookTable: """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...
stack_v2_sparse_classes_36k_train_026284
6,969
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: WorkbookTable", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value...
3
null
Implement the Python class `WorkbookTable` described below. Class description: Implement the WorkbookTable class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> WorkbookTable: Creates a new instance of the appropriate class based on discriminator value...
Implement the Python class `WorkbookTable` described below. Class description: Implement the WorkbookTable class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> WorkbookTable: Creates a new instance of the appropriate class based on discriminator value...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class WorkbookTable: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> WorkbookTable: """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...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WorkbookTable: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> WorkbookTable: """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: WorkbookTabl...
the_stack_v2_python_sparse
msgraph/generated/models/workbook_table.py
microsoftgraph/msgraph-sdk-python
train
135
aa3da683a2b93dcec2afbefb352ff374eebfd878
[ "super(RLEnvConfiguration, self).__init__(**kwargs)\nself.num = 1\nself.gamma = 0.99\nself.max_episode_steps = 100\nself.set_necessary_configs(**kwargs)\nself.set_unnecessary_configs(**kwargs)", "try:\n self.env_name = kwargs['env_name']\nexcept Exception as e:\n raise Exception('necessary configs error in ...
<|body_start_0|> super(RLEnvConfiguration, self).__init__(**kwargs) self.num = 1 self.gamma = 0.99 self.max_episode_steps = 100 self.set_necessary_configs(**kwargs) self.set_unnecessary_configs(**kwargs) <|end_body_0|> <|body_start_1|> try: self.env_n...
class stores the env for rl configuration
RLEnvConfiguration
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RLEnvConfiguration: """class stores the env for rl configuration""" def __init__(self, **kwargs): """initialize settings""" <|body_0|> def set_necessary_configs(self, **kwargs): """set rl env configs that necessarily provided by user""" <|body_1|> de...
stack_v2_sparse_classes_36k_train_026285
5,332
no_license
[ { "docstring": "initialize settings", "name": "__init__", "signature": "def __init__(self, **kwargs)" }, { "docstring": "set rl env configs that necessarily provided by user", "name": "set_necessary_configs", "signature": "def set_necessary_configs(self, **kwargs)" }, { "docstrin...
3
null
Implement the Python class `RLEnvConfiguration` described below. Class description: class stores the env for rl configuration Method signatures and docstrings: - def __init__(self, **kwargs): initialize settings - def set_necessary_configs(self, **kwargs): set rl env configs that necessarily provided by user - def se...
Implement the Python class `RLEnvConfiguration` described below. Class description: class stores the env for rl configuration Method signatures and docstrings: - def __init__(self, **kwargs): initialize settings - def set_necessary_configs(self, **kwargs): set rl env configs that necessarily provided by user - def se...
b0e8f66b3ade742445a41d3d5667032a931d94d2
<|skeleton|> class RLEnvConfiguration: """class stores the env for rl configuration""" def __init__(self, **kwargs): """initialize settings""" <|body_0|> def set_necessary_configs(self, **kwargs): """set rl env configs that necessarily provided by user""" <|body_1|> de...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RLEnvConfiguration: """class stores the env for rl configuration""" def __init__(self, **kwargs): """initialize settings""" super(RLEnvConfiguration, self).__init__(**kwargs) self.num = 1 self.gamma = 0.99 self.max_episode_steps = 100 self.set_necessary_con...
the_stack_v2_python_sparse
config/rl_config.py
wz139704646/MBRL_on_VAEs
train
1
43fb7e2734c8263ef4e6301bd3d67021ded81e96
[ "super(ProcessActionHandler, self).initialize(*args, **kwargs)\nself.actions = action_loader.load_actions()\nlogging.info('ProcessActionHandler loaded %d async actions: %s', len(self.actions['async']), str(sorted(self.actions['async'].keys())))", "payload = pickle.loads(self.request.body)\nasync_actions = payload...
<|body_start_0|> super(ProcessActionHandler, self).initialize(*args, **kwargs) self.actions = action_loader.load_actions() logging.info('ProcessActionHandler loaded %d async actions: %s', len(self.actions['async']), str(sorted(self.actions['async'].keys()))) <|end_body_0|> <|body_start_1|> ...
Handler for processing Actions.
ProcessActionHandler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProcessActionHandler: """Handler for processing Actions.""" def initialize(self, *args, **kwargs): """Overridden initializer that imports all available Actions.""" <|body_0|> def post(self): """Process an async Action task with the correct Action class.""" ...
stack_v2_sparse_classes_36k_train_026286
2,558
permissive
[ { "docstring": "Overridden initializer that imports all available Actions.", "name": "initialize", "signature": "def initialize(self, *args, **kwargs)" }, { "docstring": "Process an async Action task with the correct Action class.", "name": "post", "signature": "def post(self)" } ]
2
null
Implement the Python class `ProcessActionHandler` described below. Class description: Handler for processing Actions. Method signatures and docstrings: - def initialize(self, *args, **kwargs): Overridden initializer that imports all available Actions. - def post(self): Process an async Action task with the correct Ac...
Implement the Python class `ProcessActionHandler` described below. Class description: Handler for processing Actions. Method signatures and docstrings: - def initialize(self, *args, **kwargs): Overridden initializer that imports all available Actions. - def post(self): Process an async Action task with the correct Ac...
91753e47aff26d78978ebe7aca70f4a7cbf6a3d4
<|skeleton|> class ProcessActionHandler: """Handler for processing Actions.""" def initialize(self, *args, **kwargs): """Overridden initializer that imports all available Actions.""" <|body_0|> def post(self): """Process an async Action task with the correct Action class.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProcessActionHandler: """Handler for processing Actions.""" def initialize(self, *args, **kwargs): """Overridden initializer that imports all available Actions.""" super(ProcessActionHandler, self).initialize(*args, **kwargs) self.actions = action_loader.load_actions() log...
the_stack_v2_python_sparse
loaner/web_app/backend/handlers/task/process_action.py
ryangugcloudca/loaner
train
0
9ed2f6621a79b8041965c44e73f378c79502681f
[ "if dry_run:\n return\nthemes = get_themes()\nfor theme in themes:\n css_packages = self.get_themed_packages(theme.theme_dir_name, settings.PIPELINE['STYLESHEETS'])\n from pipeline.packager import Packager\n packager = Packager(storage=self, css_packages=css_packages)\n for package_name in packager.p...
<|body_start_0|> if dry_run: return themes = get_themes() for theme in themes: css_packages = self.get_themed_packages(theme.theme_dir_name, settings.PIPELINE['STYLESHEETS']) from pipeline.packager import Packager packager = Packager(storage=self, ...
Mixin to make sure themed assets are also packaged and used along with non themed assets. if a source asset for a particular package is not present then the default asset is used. e.g. in the following package and for 'red-theme' 'style-vendor': { 'source_filenames': [ 'js/vendor/afontgarde/afontgarde.css', 'css/vendor...
ThemePipelineMixin
[ "AGPL-3.0-only", "AGPL-3.0-or-later", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ThemePipelineMixin: """Mixin to make sure themed assets are also packaged and used along with non themed assets. if a source asset for a particular package is not present then the default asset is used. e.g. in the following package and for 'red-theme' 'style-vendor': { 'source_filenames': [ 'js/...
stack_v2_sparse_classes_36k_train_026287
13,343
permissive
[ { "docstring": "This post_process hook is used to package all themed assets.", "name": "post_process", "signature": "def post_process(self, paths, dry_run=False, **options)" }, { "docstring": "Update paths with the themed assets, Args: prefix: theme prefix for which to update asset paths e.g. 'r...
2
null
Implement the Python class `ThemePipelineMixin` described below. Class description: Mixin to make sure themed assets are also packaged and used along with non themed assets. if a source asset for a particular package is not present then the default asset is used. e.g. in the following package and for 'red-theme' 'styl...
Implement the Python class `ThemePipelineMixin` described below. Class description: Mixin to make sure themed assets are also packaged and used along with non themed assets. if a source asset for a particular package is not present then the default asset is used. e.g. in the following package and for 'red-theme' 'styl...
5809eaca7079a15ee56b0b7fcfea425337046c97
<|skeleton|> class ThemePipelineMixin: """Mixin to make sure themed assets are also packaged and used along with non themed assets. if a source asset for a particular package is not present then the default asset is used. e.g. in the following package and for 'red-theme' 'style-vendor': { 'source_filenames': [ 'js/...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ThemePipelineMixin: """Mixin to make sure themed assets are also packaged and used along with non themed assets. if a source asset for a particular package is not present then the default asset is used. e.g. in the following package and for 'red-theme' 'style-vendor': { 'source_filenames': [ 'js/vendor/afontg...
the_stack_v2_python_sparse
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/theming/storage.py
luque/better-ways-of-thinking-about-software
train
3
6325ed7b11217df22ab00563334555430f291120
[ "rmNum = []\nfor i, val in enumerate(nums):\n if i > 0 and nums[i] == nums[i - 1]:\n rmNum.append(nums[i - 1])\nfor val in rmNum:\n nums.remove(val)\nreturn len(nums)", "if len(nums) <= 1:\n return len(nums)\nslow = 0\nfor i in range(1, len(nums)):\n if nums[i] != nums[slow]:\n slow += 1...
<|body_start_0|> rmNum = [] for i, val in enumerate(nums): if i > 0 and nums[i] == nums[i - 1]: rmNum.append(nums[i - 1]) for val in rmNum: nums.remove(val) return len(nums) <|end_body_0|> <|body_start_1|> if len(nums) <= 1: re...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def removeDuplicates2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> rmNum = [] for i, val in e...
stack_v2_sparse_classes_36k_train_026288
724
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "removeDuplicates", "signature": "def removeDuplicates(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "removeDuplicates2", "signature": "def removeDuplicates2(self, nums)" } ]
2
stack_v2_sparse_classes_30k_test_001038
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeDuplicates(self, nums): :type nums: List[int] :rtype: int - def removeDuplicates2(self, nums): :type nums: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeDuplicates(self, nums): :type nums: List[int] :rtype: int - def removeDuplicates2(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: def ...
49d607a66890f3f419c3f0032a57cbd1365edbb7
<|skeleton|> class Solution: def removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def removeDuplicates2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" rmNum = [] for i, val in enumerate(nums): if i > 0 and nums[i] == nums[i - 1]: rmNum.append(nums[i - 1]) for val in rmNum: nums.remove(val) return...
the_stack_v2_python_sparse
Easy/026.remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.py
henryji96/LeetCode-Solutions
train
1
81d95e1c461584bec81e29048dae92835a151c10
[ "super(MACNNClassifier, self).__init__(model_name=model_name, model_save_directory=model_save_directory)\nself.verbose = verbose\nself._is_fitted = False\nself.classes_ = None\nself.nb_classes = -1\nself.input_shape = None\nself.model = None\nself.history = None\nself.kernel_sizes = kernel_sizes\nself.filters = fil...
<|body_start_0|> super(MACNNClassifier, self).__init__(model_name=model_name, model_save_directory=model_save_directory) self.verbose = verbose self._is_fitted = False self.classes_ = None self.nb_classes = -1 self.input_shape = None self.model = None self...
Implementation of MACNNClassifier from Chen (2021). [1]_ Overview: Neural Network made of multiple convolutional attention blocks. The block is separated into three sections. Section 1 and 2 are made up of two blocks followed by a max pooling layer. The final section contains two blocks and a mean reduction followed by...
MACNNClassifier
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MACNNClassifier: """Implementation of MACNNClassifier from Chen (2021). [1]_ Overview: Neural Network made of multiple convolutional attention blocks. The block is separated into three sections. Section 1 and 2 are made up of two blocks followed by a max pooling layer. The final section contains ...
stack_v2_sparse_classes_36k_train_026289
8,060
permissive
[ { "docstring": ":param nb_epochs: int, the number of epochs to train the model :param batch_size: int, the number of samples per gradient update. :param rnn_layer: int, filter size for rnn layer :param filters: int, array of shape 2, filter sizes for two convolutional layers :param kernel_sizes: int,array of sh...
3
stack_v2_sparse_classes_30k_train_016406
Implement the Python class `MACNNClassifier` described below. Class description: Implementation of MACNNClassifier from Chen (2021). [1]_ Overview: Neural Network made of multiple convolutional attention blocks. The block is separated into three sections. Section 1 and 2 are made up of two blocks followed by a max poo...
Implement the Python class `MACNNClassifier` described below. Class description: Implementation of MACNNClassifier from Chen (2021). [1]_ Overview: Neural Network made of multiple convolutional attention blocks. The block is separated into three sections. Section 1 and 2 are made up of two blocks followed by a max poo...
b565b7499f58f43da7314f1bf26eccce94e88134
<|skeleton|> class MACNNClassifier: """Implementation of MACNNClassifier from Chen (2021). [1]_ Overview: Neural Network made of multiple convolutional attention blocks. The block is separated into three sections. Section 1 and 2 are made up of two blocks followed by a max pooling layer. The final section contains ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MACNNClassifier: """Implementation of MACNNClassifier from Chen (2021). [1]_ Overview: Neural Network made of multiple convolutional attention blocks. The block is separated into three sections. Section 1 and 2 are made up of two blocks followed by a max pooling layer. The final section contains two blocks an...
the_stack_v2_python_sparse
sktime_dl/classification/_macnn.py
sktime/sktime-dl
train
586
e03bb58b24774d695efaaa1e9efd72944748a01d
[ "if environment is not None and utils.version_lt(self._version, '1.25'):\n raise errors.InvalidVersion('Setting environment for exec is not supported in API < 1.25')\nif isinstance(cmd, str):\n cmd = utils.split_command(cmd)\nif isinstance(environment, dict):\n environment = utils.utils.format_environment(...
<|body_start_0|> if environment is not None and utils.version_lt(self._version, '1.25'): raise errors.InvalidVersion('Setting environment for exec is not supported in API < 1.25') if isinstance(cmd, str): cmd = utils.split_command(cmd) if isinstance(environment, dict): ...
ExecApiMixin
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ExecApiMixin: def exec_create(self, container, cmd, stdout=True, stderr=True, stdin=False, tty=False, privileged=False, user='', environment=None, workdir=None, detach_keys=None): """Sets up an exec instance in a running container. Args: container (str): Target container where exec insta...
stack_v2_sparse_classes_36k_train_026290
6,224
permissive
[ { "docstring": "Sets up an exec instance in a running container. Args: container (str): Target container where exec instance will be created cmd (str or list): Command to be executed stdout (bool): Attach to stdout. Default: ``True`` stderr (bool): Attach to stderr. Default: ``True`` stdin (bool): Attach to std...
4
stack_v2_sparse_classes_30k_train_000420
Implement the Python class `ExecApiMixin` described below. Class description: Implement the ExecApiMixin class. Method signatures and docstrings: - def exec_create(self, container, cmd, stdout=True, stderr=True, stdin=False, tty=False, privileged=False, user='', environment=None, workdir=None, detach_keys=None): Sets...
Implement the Python class `ExecApiMixin` described below. Class description: Implement the ExecApiMixin class. Method signatures and docstrings: - def exec_create(self, container, cmd, stdout=True, stderr=True, stdin=False, tty=False, privileged=False, user='', environment=None, workdir=None, detach_keys=None): Sets...
c38656dc7894363f32317affecc3e4279e1163f8
<|skeleton|> class ExecApiMixin: def exec_create(self, container, cmd, stdout=True, stderr=True, stdin=False, tty=False, privileged=False, user='', environment=None, workdir=None, detach_keys=None): """Sets up an exec instance in a running container. Args: container (str): Target container where exec insta...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ExecApiMixin: def exec_create(self, container, cmd, stdout=True, stderr=True, stdin=False, tty=False, privileged=False, user='', environment=None, workdir=None, detach_keys=None): """Sets up an exec instance in a running container. Args: container (str): Target container where exec instance will be cr...
the_stack_v2_python_sparse
docker/api/exec_api.py
docker/docker-py
train
6,473
19010bc22c79b4716d5467797d05bf2d7327b74e
[ "if db_dir is None:\n db_dir = OnChainSQLite3.DEFAULT_PAYMENT_DB_DIR\nif db is None:\n db = OnChainSQLite3.DEFAULT_PAYMENT_DB_PATH\nif db_dir and (not os.path.exists(db_dir)):\n os.makedirs(db_dir)\nself.connection = sqlite3.connect(os.path.join(db_dir, db), check_same_thread=False)\nself.c = self.connecti...
<|body_start_0|> if db_dir is None: db_dir = OnChainSQLite3.DEFAULT_PAYMENT_DB_DIR if db is None: db = OnChainSQLite3.DEFAULT_PAYMENT_DB_PATH if db_dir and (not os.path.exists(db_dir)): os.makedirs(db_dir) self.connection = sqlite3.connect(os.path.join...
SQLite3 binding for the on-chain transaction model.
OnChainSQLite3
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OnChainSQLite3: """SQLite3 binding for the on-chain transaction model.""" def __init__(self, db=None, db_dir=None): """Instantiate SQLite3 for storing on chain transaction data.""" <|body_0|> def create(self, txid, amount): """Create a transaction entry.""" ...
stack_v2_sparse_classes_36k_train_026291
16,798
permissive
[ { "docstring": "Instantiate SQLite3 for storing on chain transaction data.", "name": "__init__", "signature": "def __init__(self, db=None, db_dir=None)" }, { "docstring": "Create a transaction entry.", "name": "create", "signature": "def create(self, txid, amount)" }, { "docstrin...
4
stack_v2_sparse_classes_30k_train_000136
Implement the Python class `OnChainSQLite3` described below. Class description: SQLite3 binding for the on-chain transaction model. Method signatures and docstrings: - def __init__(self, db=None, db_dir=None): Instantiate SQLite3 for storing on chain transaction data. - def create(self, txid, amount): Create a transa...
Implement the Python class `OnChainSQLite3` described below. Class description: SQLite3 binding for the on-chain transaction model. Method signatures and docstrings: - def __init__(self, db=None, db_dir=None): Instantiate SQLite3 for storing on chain transaction data. - def create(self, txid, amount): Create a transa...
a5e99fccf11ed75420775ae3e924c9ce94f2e86d
<|skeleton|> class OnChainSQLite3: """SQLite3 binding for the on-chain transaction model.""" def __init__(self, db=None, db_dir=None): """Instantiate SQLite3 for storing on chain transaction data.""" <|body_0|> def create(self, txid, amount): """Create a transaction entry.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OnChainSQLite3: """SQLite3 binding for the on-chain transaction model.""" def __init__(self, db=None, db_dir=None): """Instantiate SQLite3 for storing on chain transaction data.""" if db_dir is None: db_dir = OnChainSQLite3.DEFAULT_PAYMENT_DB_DIR if db is None: ...
the_stack_v2_python_sparse
two1/bitserv/models.py
shayanb/two1
train
4
c4e849864d94b8b94dc15c79409964e27fd5d805
[ "test_info = db.get_test(item_id)\nif not test_info:\n pecan.abort(404)\ntest_list = db.get_test_results(item_id)\ntest_name_list = [test_dict[0] for test_dict in test_list]\nreturn {'cpid': test_info.cpid, 'created_at': test_info.created_at, 'duration_seconds': test_info.duration_seconds, 'results': test_name_l...
<|body_start_0|> test_info = db.get_test(item_id) if not test_info: pecan.abort(404) test_list = db.get_test_results(item_id) test_name_list = [test_dict[0] for test_dict in test_list] return {'cpid': test_info.cpid, 'created_at': test_info.created_at, 'duration_secon...
/v1/results handler.
ResultsController
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResultsController: """/v1/results handler.""" def get_item(self, item_id): """Handler for getting item""" <|body_0|> def store_item(self, item_in_json): """Handler for storing item. Should return new item id""" <|body_1|> def get(self): """Ge...
stack_v2_sparse_classes_36k_train_026292
8,563
permissive
[ { "docstring": "Handler for getting item", "name": "get_item", "signature": "def get_item(self, item_id)" }, { "docstring": "Handler for storing item. Should return new item id", "name": "store_item", "signature": "def store_item(self, item_in_json)" }, { "docstring": "Get inform...
3
stack_v2_sparse_classes_30k_train_006213
Implement the Python class `ResultsController` described below. Class description: /v1/results handler. Method signatures and docstrings: - def get_item(self, item_id): Handler for getting item - def store_item(self, item_in_json): Handler for storing item. Should return new item id - def get(self): Get information o...
Implement the Python class `ResultsController` described below. Class description: /v1/results handler. Method signatures and docstrings: - def get_item(self, item_id): Handler for getting item - def store_item(self, item_in_json): Handler for storing item. Should return new item id - def get(self): Get information o...
711f7527c430873edbed72e4f85af916b2088014
<|skeleton|> class ResultsController: """/v1/results handler.""" def get_item(self, item_id): """Handler for getting item""" <|body_0|> def store_item(self, item_in_json): """Handler for storing item. Should return new item id""" <|body_1|> def get(self): """Ge...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResultsController: """/v1/results handler.""" def get_item(self, item_id): """Handler for getting item""" test_info = db.get_test(item_id) if not test_info: pecan.abort(404) test_list = db.get_test_results(item_id) test_name_list = [test_dict[0] for tes...
the_stack_v2_python_sparse
refstack/api/controllers/v1.py
russell/refstack
train
0
c89969d2dc917bef875f0ea8d6aacb561278d585
[ "self._msw = magicseaweed.MSW_Forecast(api_key, spot_id, None, units)\nself.currently = None\nself.hourly = {}\nself.update = Throttle(MIN_TIME_BETWEEN_UPDATES)(self._update)", "try:\n forecasts = self._msw.get_future()\n self.currently = forecasts.data[0]\n for forecast in forecasts.data[:8]:\n h...
<|body_start_0|> self._msw = magicseaweed.MSW_Forecast(api_key, spot_id, None, units) self.currently = None self.hourly = {} self.update = Throttle(MIN_TIME_BETWEEN_UPDATES)(self._update) <|end_body_0|> <|body_start_1|> try: forecasts = self._msw.get_future() ...
Get the latest data from MagicSeaweed.
MagicSeaweedData
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MagicSeaweedData: """Get the latest data from MagicSeaweed.""" def __init__(self, api_key, spot_id, units): """Initialize the data object.""" <|body_0|> def _update(self): """Get the latest data from MagicSeaweed.""" <|body_1|> <|end_skeleton|> <|body_s...
stack_v2_sparse_classes_36k_train_026293
6,249
permissive
[ { "docstring": "Initialize the data object.", "name": "__init__", "signature": "def __init__(self, api_key, spot_id, units)" }, { "docstring": "Get the latest data from MagicSeaweed.", "name": "_update", "signature": "def _update(self)" } ]
2
stack_v2_sparse_classes_30k_train_005070
Implement the Python class `MagicSeaweedData` described below. Class description: Get the latest data from MagicSeaweed. Method signatures and docstrings: - def __init__(self, api_key, spot_id, units): Initialize the data object. - def _update(self): Get the latest data from MagicSeaweed.
Implement the Python class `MagicSeaweedData` described below. Class description: Get the latest data from MagicSeaweed. Method signatures and docstrings: - def __init__(self, api_key, spot_id, units): Initialize the data object. - def _update(self): Get the latest data from MagicSeaweed. <|skeleton|> class MagicSea...
2fee32fce03bc49e86cf2e7b741a15621a97cce5
<|skeleton|> class MagicSeaweedData: """Get the latest data from MagicSeaweed.""" def __init__(self, api_key, spot_id, units): """Initialize the data object.""" <|body_0|> def _update(self): """Get the latest data from MagicSeaweed.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MagicSeaweedData: """Get the latest data from MagicSeaweed.""" def __init__(self, api_key, spot_id, units): """Initialize the data object.""" self._msw = magicseaweed.MSW_Forecast(api_key, spot_id, None, units) self.currently = None self.hourly = {} self.update = T...
the_stack_v2_python_sparse
homeassistant/components/magicseaweed/sensor.py
BenWoodford/home-assistant
train
11
a7b25973013730ad3e99ad9bc22ef843e64cb1c7
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn IosVppEBook()", "from .managed_e_book import ManagedEBook\nfrom .managed_e_book import ManagedEBook\nfields: Dict[str, Callable[[Any], None]] = {'appleId': lambda n: setattr(self, 'apple_id', n.get_str_value()), 'genres': lambda n: set...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return IosVppEBook() <|end_body_0|> <|body_start_1|> from .managed_e_book import ManagedEBook from .managed_e_book import ManagedEBook fields: Dict[str, Callable[[Any], None]] = {'apple...
A class containing the properties for iOS Vpp eBook.
IosVppEBook
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IosVppEBook: """A class containing the properties for iOS Vpp eBook.""" def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> IosVppEBook: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to...
stack_v2_sparse_classes_36k_train_026294
3,718
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: IosVppEBook", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value(p...
3
null
Implement the Python class `IosVppEBook` described below. Class description: A class containing the properties for iOS Vpp eBook. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> IosVppEBook: Creates a new instance of the appropriate class based on discr...
Implement the Python class `IosVppEBook` described below. Class description: A class containing the properties for iOS Vpp eBook. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> IosVppEBook: Creates a new instance of the appropriate class based on discr...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class IosVppEBook: """A class containing the properties for iOS Vpp eBook.""" def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> IosVppEBook: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class IosVppEBook: """A class containing the properties for iOS Vpp eBook.""" def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> IosVppEBook: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the dis...
the_stack_v2_python_sparse
msgraph/generated/models/ios_vpp_e_book.py
microsoftgraph/msgraph-sdk-python
train
135
161198a83d588b799819b6e33daa5dcfd821913c
[ "node = node_cache.setdefault(self.resource_id, URIRef(self.resource_id))\ngraph.add((node, RDF.type, getattr(namespace, self.type)))\ngraph.add((node, getattr(namespace, 'id'), Literal(self.resource_id)))\nself.link_collection.to_rdf(subj=node, namespace=namespace, graph=graph, node_cache=node_cache)", "vertex =...
<|body_start_0|> node = node_cache.setdefault(self.resource_id, URIRef(self.resource_id)) graph.add((node, RDF.type, getattr(namespace, self.type))) graph.add((node, getattr(namespace, 'id'), Literal(self.resource_id))) self.link_collection.to_rdf(subj=node, namespace=namespace, graph=gr...
A Resource defines a single scanned resource which is directly translatable to a graph node. It contains an id, type name and list of Links. Args: resource_id: id of this resource type: type name of this resource link_collection: a LinkCollection representing links from this resource
Resource
[ "MIT", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Resource: """A Resource defines a single scanned resource which is directly translatable to a graph node. It contains an id, type name and list of Links. Args: resource_id: id of this resource type: type name of this resource link_collection: a LinkCollection representing links from this resource...
stack_v2_sparse_classes_36k_train_026295
2,016
permissive
[ { "docstring": "Graph this Resource as a URIRef on a Graph. Args: namespace: RDF namespace to use for predicates and objects when graphing this resource's links graph: RDF graph node_cache: NodeCache to use for any cached URIRef lookups", "name": "to_rdf", "signature": "def to_rdf(self, namespace: Names...
2
null
Implement the Python class `Resource` described below. Class description: A Resource defines a single scanned resource which is directly translatable to a graph node. It contains an id, type name and list of Links. Args: resource_id: id of this resource type: type name of this resource link_collection: a LinkCollectio...
Implement the Python class `Resource` described below. Class description: A Resource defines a single scanned resource which is directly translatable to a graph node. It contains an id, type name and list of Links. Args: resource_id: id of this resource type: type name of this resource link_collection: a LinkCollectio...
eb7d5d18f3d177973c4105c21be9d251250ca8d6
<|skeleton|> class Resource: """A Resource defines a single scanned resource which is directly translatable to a graph node. It contains an id, type name and list of Links. Args: resource_id: id of this resource type: type name of this resource link_collection: a LinkCollection representing links from this resource...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Resource: """A Resource defines a single scanned resource which is directly translatable to a graph node. It contains an id, type name and list of Links. Args: resource_id: id of this resource type: type name of this resource link_collection: a LinkCollection representing links from this resource""" def ...
the_stack_v2_python_sparse
altimeter/core/resource/resource.py
tableau/altimeter
train
75
e9344b06ef250b4c62c7b61d823cea2600f87fc0
[ "meeting_user = MeetingUser()\nmeeting_user.is_accepted = is_accepted\nmeeting_user.is_response = may_join\nmeeting_user.is_coordinator = is_coordinator\nmeeting_user.user_id = user_id\nreturn meeting_user", "meeting_user = MeetingUser()\nmeeting_user.is_coordinator = True\nmeeting_user.is_accepted = 1\nmeeting_u...
<|body_start_0|> meeting_user = MeetingUser() meeting_user.is_accepted = is_accepted meeting_user.is_response = may_join meeting_user.is_coordinator = is_coordinator meeting_user.user_id = user_id return meeting_user <|end_body_0|> <|body_start_1|> meeting_user =...
CreateMeetingAttendees
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CreateMeetingAttendees: def _form_attendee(self, user_id: int, is_accepted=False, may_join=False, is_coordinator=False): """For create Meeting, create MeetingUser models. :param user_id: :param is_accepted: :param may_join: :param is_coordinator: :return: List of MeetingUser models.""" ...
stack_v2_sparse_classes_36k_train_026296
1,133
no_license
[ { "docstring": "For create Meeting, create MeetingUser models. :param user_id: :param is_accepted: :param may_join: :param is_coordinator: :return: List of MeetingUser models.", "name": "_form_attendee", "signature": "def _form_attendee(self, user_id: int, is_accepted=False, may_join=False, is_coordinat...
2
null
Implement the Python class `CreateMeetingAttendees` described below. Class description: Implement the CreateMeetingAttendees class. Method signatures and docstrings: - def _form_attendee(self, user_id: int, is_accepted=False, may_join=False, is_coordinator=False): For create Meeting, create MeetingUser models. :param...
Implement the Python class `CreateMeetingAttendees` described below. Class description: Implement the CreateMeetingAttendees class. Method signatures and docstrings: - def _form_attendee(self, user_id: int, is_accepted=False, may_join=False, is_coordinator=False): For create Meeting, create MeetingUser models. :param...
214cb14eb23f3aa1e32616d666c14d041a2c7dc7
<|skeleton|> class CreateMeetingAttendees: def _form_attendee(self, user_id: int, is_accepted=False, may_join=False, is_coordinator=False): """For create Meeting, create MeetingUser models. :param user_id: :param is_accepted: :param may_join: :param is_coordinator: :return: List of MeetingUser models.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CreateMeetingAttendees: def _form_attendee(self, user_id: int, is_accepted=False, may_join=False, is_coordinator=False): """For create Meeting, create MeetingUser models. :param user_id: :param is_accepted: :param may_join: :param is_coordinator: :return: List of MeetingUser models.""" meeting...
the_stack_v2_python_sparse
backend/src/api/pool/decorators/meeting_decorators/libs_meeting_decorator/meeting_attendee_libs/attendee_create.py
enixdark/meeting-training-app
train
0
faaabaeb71d1e73aed74372579eb77123fce9c8d
[ "startTime = datetime.datetime.now()\nclient = dml.pymongo.MongoClient()\nrepo = client.repo\nrepo.authenticate('bohorqux_peterg04_rocksdan_yfchen', 'bohorqux_peterg04_rocksdan_yfchen')\nurl = 'http://datamechanics.io/data/eileenli_yidingou/Restaurant.json'\nresponse = urllib.request.urlopen(url).read().decode('utf...
<|body_start_0|> startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('bohorqux_peterg04_rocksdan_yfchen', 'bohorqux_peterg04_rocksdan_yfchen') url = 'http://datamechanics.io/data/eileenli_yidingou/Restaurant.json' re...
getRestaurants
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class getRestaurants: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everythin...
stack_v2_sparse_classes_36k_train_026297
4,123
no_license
[ { "docstring": "Retrieve some data sets (not using the API here for the sake of simplicity).", "name": "execute", "signature": "def execute(trial=False)" }, { "docstring": "Create the provenance document describing everything happening in this script. Each run of the script will generate a new d...
2
stack_v2_sparse_classes_30k_train_004477
Implement the Python class `getRestaurants` described below. Class description: Implement the getRestaurants class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=None,...
Implement the Python class `getRestaurants` described below. Class description: Implement the getRestaurants class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=None,...
97e72731ffadbeae57d7a332decd58706e7c08de
<|skeleton|> class getRestaurants: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everythin...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class getRestaurants: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('bohorqux_peterg04_rocksdan_yfchen', ...
the_stack_v2_python_sparse
bohorqux_peterg04_rocksdan_yfchen/getRestaurants.py
ROODAY/course-2017-fal-proj
train
3
1c502a7a980e08d8ceb7b3a23fef094e82f18e77
[ "with open(path) as f:\n text = f.read()\nif preamble in text:\n with open(path, 'wt') as f:\n f.write(text.replace(preamble, '', 1))", "for directory in self.directories:\n python_files = files_with_extension('.py', directory)\n c_files = files_with_extension('.c', directory) + files_with_exte...
<|body_start_0|> with open(path) as f: text = f.read() if preamble in text: with open(path, 'wt') as f: f.write(text.replace(preamble, '', 1)) <|end_body_0|> <|body_start_1|> for directory in self.directories: python_files = files_with_extensi...
RemoveCopyrightCommand
[ "MIT", "MIT-0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RemoveCopyrightCommand: def _remove_copyright(self, path, preamble): """Remove the copyright if present in the given file.""" <|body_0|> def run(self): """Execution of the command action.""" <|body_1|> <|end_skeleton|> <|body_start_0|> with open(pat...
stack_v2_sparse_classes_36k_train_026298
14,165
permissive
[ { "docstring": "Remove the copyright if present in the given file.", "name": "_remove_copyright", "signature": "def _remove_copyright(self, path, preamble)" }, { "docstring": "Execution of the command action.", "name": "run", "signature": "def run(self)" } ]
2
stack_v2_sparse_classes_30k_train_010919
Implement the Python class `RemoveCopyrightCommand` described below. Class description: Implement the RemoveCopyrightCommand class. Method signatures and docstrings: - def _remove_copyright(self, path, preamble): Remove the copyright if present in the given file. - def run(self): Execution of the command action.
Implement the Python class `RemoveCopyrightCommand` described below. Class description: Implement the RemoveCopyrightCommand class. Method signatures and docstrings: - def _remove_copyright(self, path, preamble): Remove the copyright if present in the given file. - def run(self): Execution of the command action. <|s...
fa6808a6ca8063751da92f683f2b810a0690a462
<|skeleton|> class RemoveCopyrightCommand: def _remove_copyright(self, path, preamble): """Remove the copyright if present in the given file.""" <|body_0|> def run(self): """Execution of the command action.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RemoveCopyrightCommand: def _remove_copyright(self, path, preamble): """Remove the copyright if present in the given file.""" with open(path) as f: text = f.read() if preamble in text: with open(path, 'wt') as f: f.write(text.replace(preamble, ''...
the_stack_v2_python_sparse
setup.py
mramospe/minkit
train
0
d5b4d11dedf2138bffd1c08e7f3cb0ff528c2f91
[ "self.p0 = p0\nself.p1 = p1\nself.p2 = p2\nself.p3 = p3", "\"\"\"\n Caso en que la coordenada \"y\" es igual a cero. \n \"\"\"\nif self.y == 0:\n '\\n Caso en que la coordenada \"x\" es mayor que cero. \\n '\n if checkSign(self.x) == 2:\n return 0\n '\\n ...
<|body_start_0|> self.p0 = p0 self.p1 = p1 self.p2 = p2 self.p3 = p3 <|end_body_0|> <|body_start_1|> """ Caso en que la coordenada "y" es igual a cero. """ if self.y == 0: '\n Caso en que la coordenada "x" es mayor ...
Face3d
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Face3d: def __init__(self, p0, p1, p2, p3): """@param p0: instancia de Point3d @param p1: instancia de Point3d @param p2: instancia de Point3d @param p3: instancia de Point3d""" <|body_0|> def Triangulate(self): """Metodo que se encarga de triangular una cara en el e...
stack_v2_sparse_classes_36k_train_026299
3,592
no_license
[ { "docstring": "@param p0: instancia de Point3d @param p1: instancia de Point3d @param p2: instancia de Point3d @param p3: instancia de Point3d", "name": "__init__", "signature": "def __init__(self, p0, p1, p2, p3)" }, { "docstring": "Metodo que se encarga de triangular una cara en el espacio 3D...
3
stack_v2_sparse_classes_30k_train_002357
Implement the Python class `Face3d` described below. Class description: Implement the Face3d class. Method signatures and docstrings: - def __init__(self, p0, p1, p2, p3): @param p0: instancia de Point3d @param p1: instancia de Point3d @param p2: instancia de Point3d @param p3: instancia de Point3d - def Triangulate(...
Implement the Python class `Face3d` described below. Class description: Implement the Face3d class. Method signatures and docstrings: - def __init__(self, p0, p1, p2, p3): @param p0: instancia de Point3d @param p1: instancia de Point3d @param p2: instancia de Point3d @param p3: instancia de Point3d - def Triangulate(...
a93de278ea92ad8d57d66fcb76744d394400bd11
<|skeleton|> class Face3d: def __init__(self, p0, p1, p2, p3): """@param p0: instancia de Point3d @param p1: instancia de Point3d @param p2: instancia de Point3d @param p3: instancia de Point3d""" <|body_0|> def Triangulate(self): """Metodo que se encarga de triangular una cara en el e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Face3d: def __init__(self, p0, p1, p2, p3): """@param p0: instancia de Point3d @param p1: instancia de Point3d @param p2: instancia de Point3d @param p3: instancia de Point3d""" self.p0 = p0 self.p1 = p1 self.p2 = p2 self.p3 = p3 def Triangulate(self): """M...
the_stack_v2_python_sparse
geometry/controller/geometry_3d/face_3d.py
nvergarayi/Cubicador
train
0