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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74c0f13f7a3ddff19799e6523b440037b9028211 | [
"input_dict = get_input_as_dict(request)\ndn = input_dict.get('dn')\nop = input_dict.get('operation')\nif not dn or not op:\n raise HTTPBadRequest('Missing dn and/or operation')\ntry:\n authz = Session.query(AuthorizationByDn).get((dn, op))\n if not authz:\n authz = AuthorizationByDn(dn=dn, operatio... | <|body_start_0|>
input_dict = get_input_as_dict(request)
dn = input_dict.get('dn')
op = input_dict.get('operation')
if not dn or not op:
raise HTTPBadRequest('Missing dn and/or operation')
try:
authz = Session.query(AuthorizationByDn).get((dn, op))
... | Static authorizations | AuthzConfigController | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class AuthzConfigController:
"""Static authorizations"""
def add_authz(self):
"""Give special access to someone"""
<|body_0|>
def list_authz(self):
"""List granted accesses"""
<|body_1|>
def remove_authz(self, start_response):
"""Revoke access for ... | stack_v2_sparse_classes_36k_train_010200 | 4,217 | permissive | [
{
"docstring": "Give special access to someone",
"name": "add_authz",
"signature": "def add_authz(self)"
},
{
"docstring": "List granted accesses",
"name": "list_authz",
"signature": "def list_authz(self)"
},
{
"docstring": "Revoke access for a DN for a given operation, or all",
... | 3 | null | Implement the Python class `AuthzConfigController` described below.
Class description:
Static authorizations
Method signatures and docstrings:
- def add_authz(self): Give special access to someone
- def list_authz(self): List granted accesses
- def remove_authz(self, start_response): Revoke access for a DN for a give... | Implement the Python class `AuthzConfigController` described below.
Class description:
Static authorizations
Method signatures and docstrings:
- def add_authz(self): Give special access to someone
- def list_authz(self): List granted accesses
- def remove_authz(self, start_response): Revoke access for a DN for a give... | 12a763986e1a0b6245e7adef044a2d4179e34734 | <|skeleton|>
class AuthzConfigController:
"""Static authorizations"""
def add_authz(self):
"""Give special access to someone"""
<|body_0|>
def list_authz(self):
"""List granted accesses"""
<|body_1|>
def remove_authz(self, start_response):
"""Revoke access for ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class AuthzConfigController:
"""Static authorizations"""
def add_authz(self):
"""Give special access to someone"""
input_dict = get_input_as_dict(request)
dn = input_dict.get('dn')
op = input_dict.get('operation')
if not dn or not op:
raise HTTPBadRequest('Mi... | the_stack_v2_python_sparse | src/fts3rest/fts3rest/controllers/config/authz.py | cern-fts/fts-rest | train | 2 |
9aa3bdd6a9794598600c422ae0bb171e4ed07597 | [
"if not s or s[0] == 'a':\n return s\nmoveBack = ord(s[0]) - ord('a')\nreturn ''.join((chr(ord(c) - moveBack if c >= s[0] else ord(c) - moveBack + 26) for c in s))",
"groupToStrings = defaultdict(list)\nfor s in strings:\n groupToStrings[self.shiftStr(s)].append(s)\nreturn list(groupToStrings.values())"
] | <|body_start_0|>
if not s or s[0] == 'a':
return s
moveBack = ord(s[0]) - ord('a')
return ''.join((chr(ord(c) - moveBack if c >= s[0] else ord(c) - moveBack + 26) for c in s))
<|end_body_0|>
<|body_start_1|>
groupToStrings = defaultdict(list)
for s in strings:
... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def shiftStr(self, s):
"""shift s such that s[0]=='a'"""
<|body_0|>
def groupStrings(self, strings):
""":type strings: List[str] :rtype: List[List[str]]"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
if not s or s[0] == 'a':
r... | stack_v2_sparse_classes_36k_train_010201 | 709 | no_license | [
{
"docstring": "shift s such that s[0]=='a'",
"name": "shiftStr",
"signature": "def shiftStr(self, s)"
},
{
"docstring": ":type strings: List[str] :rtype: List[List[str]]",
"name": "groupStrings",
"signature": "def groupStrings(self, strings)"
}
] | 2 | stack_v2_sparse_classes_30k_train_000062 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def shiftStr(self, s): shift s such that s[0]=='a'
- def groupStrings(self, strings): :type strings: List[str] :rtype: List[List[str]] | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def shiftStr(self, s): shift s such that s[0]=='a'
- def groupStrings(self, strings): :type strings: List[str] :rtype: List[List[str]]
<|skeleton|>
class Solution:
def shif... | 6e051eb554d9cf6f424f1e0a77f3072adf7f64c4 | <|skeleton|>
class Solution:
def shiftStr(self, s):
"""shift s such that s[0]=='a'"""
<|body_0|>
def groupStrings(self, strings):
""":type strings: List[str] :rtype: List[List[str]]"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def shiftStr(self, s):
"""shift s such that s[0]=='a'"""
if not s or s[0] == 'a':
return s
moveBack = ord(s[0]) - ord('a')
return ''.join((chr(ord(c) - moveBack if c >= s[0] else ord(c) - moveBack + 26) for c in s))
def groupStrings(self, strings):
... | the_stack_v2_python_sparse | 249. Group Shifted Strings.py | vincent-kangzhou/LeetCode-Python | train | 0 | |
54043ad7b3c22eddb66bf8d4e3cdb6e6fef28def | [
"super(TFN, self).__init__()\nself.text_in, self.audio_in, self.video_in = args.feature_dims\nself.text_hidden, self.audio_hidden, self.video_hidden = args.hidden_dims\nself.output_dim = args.num_classes if args.train_mode == 'classification' else 1\nself.text_out = args.text_out\nself.post_fusion_dim = args.post_f... | <|body_start_0|>
super(TFN, self).__init__()
self.text_in, self.audio_in, self.video_in = args.feature_dims
self.text_hidden, self.audio_hidden, self.video_hidden = args.hidden_dims
self.output_dim = args.num_classes if args.train_mode == 'classification' else 1
self.text_out = a... | Implements the Tensor Fusion Networks for multimodal sentiment analysis as is described in: Zadeh, Amir, et al. "Tensor fusion network for multimodal sentiment analysis." EMNLP 2017 Oral. | TFN | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TFN:
"""Implements the Tensor Fusion Networks for multimodal sentiment analysis as is described in: Zadeh, Amir, et al. "Tensor fusion network for multimodal sentiment analysis." EMNLP 2017 Oral."""
def __init__(self, args):
"""Args: input_dims - a length-3 tuple, contains (audio_dim... | stack_v2_sparse_classes_36k_train_010202 | 5,409 | permissive | [
{
"docstring": "Args: input_dims - a length-3 tuple, contains (audio_dim, video_dim, text_dim) hidden_dims - another length-3 tuple, similar to input_dims text_out - int, specifying the resulting dimensions of the text subnetwork dropouts - a length-4 tuple, contains (audio_dropout, video_dropout, text_dropout,... | 2 | stack_v2_sparse_classes_30k_train_015452 | Implement the Python class `TFN` described below.
Class description:
Implements the Tensor Fusion Networks for multimodal sentiment analysis as is described in: Zadeh, Amir, et al. "Tensor fusion network for multimodal sentiment analysis." EMNLP 2017 Oral.
Method signatures and docstrings:
- def __init__(self, args):... | Implement the Python class `TFN` described below.
Class description:
Implements the Tensor Fusion Networks for multimodal sentiment analysis as is described in: Zadeh, Amir, et al. "Tensor fusion network for multimodal sentiment analysis." EMNLP 2017 Oral.
Method signatures and docstrings:
- def __init__(self, args):... | a887f3067c6c5a26fb670e2d5a119145f0b46aa9 | <|skeleton|>
class TFN:
"""Implements the Tensor Fusion Networks for multimodal sentiment analysis as is described in: Zadeh, Amir, et al. "Tensor fusion network for multimodal sentiment analysis." EMNLP 2017 Oral."""
def __init__(self, args):
"""Args: input_dims - a length-3 tuple, contains (audio_dim... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TFN:
"""Implements the Tensor Fusion Networks for multimodal sentiment analysis as is described in: Zadeh, Amir, et al. "Tensor fusion network for multimodal sentiment analysis." EMNLP 2017 Oral."""
def __init__(self, args):
"""Args: input_dims - a length-3 tuple, contains (audio_dim, video_dim, ... | the_stack_v2_python_sparse | models/singleTask/TFN.py | Columbine21/MMSA | train | 0 |
3378cc0ad4736f2a3e4b1fe7d0da48d4380a5a7b | [
"sorted_arr = sorted(arr[:])\norder = {}\nprev = float('-inf')\nrank = 0\nfor num in sorted_arr:\n if num != prev:\n rank += 1\n order[num] = rank\n prev = num\nfor i, num in enumerate(arr):\n arr[i] = order.get(num)\nreturn arr",
"nums = sorted(set(arr))\norder = {}\nrank = 1\nfor num in nums:... | <|body_start_0|>
sorted_arr = sorted(arr[:])
order = {}
prev = float('-inf')
rank = 0
for num in sorted_arr:
if num != prev:
rank += 1
order[num] = rank
prev = num
for i, num in enumerate(arr):
arr[i] = order... | OG solution Runtime: 352 ms, faster than 60.35% of Python online submissions for Rank Transform of an Array. Memory Usage: 30.7 MB, less than 96.67% of Python online submissions for Rank Transform of an Array. | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
"""OG solution Runtime: 352 ms, faster than 60.35% of Python online submissions for Rank Transform of an Array. Memory Usage: 30.7 MB, less than 96.67% of Python online submissions for Rank Transform of an Array."""
def arrayRankTransform(self, arr):
""":type arr: List[int]... | stack_v2_sparse_classes_36k_train_010203 | 2,337 | no_license | [
{
"docstring": ":type arr: List[int] :rtype: List[int]",
"name": "arrayRankTransform",
"signature": "def arrayRankTransform(self, arr)"
},
{
"docstring": ":type arr: List[int] :rtype: List[int]",
"name": "arrayRankTransform",
"signature": "def arrayRankTransform(self, arr)"
}
] | 2 | null | Implement the Python class `Solution` described below.
Class description:
OG solution Runtime: 352 ms, faster than 60.35% of Python online submissions for Rank Transform of an Array. Memory Usage: 30.7 MB, less than 96.67% of Python online submissions for Rank Transform of an Array.
Method signatures and docstrings:
... | Implement the Python class `Solution` described below.
Class description:
OG solution Runtime: 352 ms, faster than 60.35% of Python online submissions for Rank Transform of an Array. Memory Usage: 30.7 MB, less than 96.67% of Python online submissions for Rank Transform of an Array.
Method signatures and docstrings:
... | 844f502da4d6fb9cd69cf0a1ef71da3385a4d2b4 | <|skeleton|>
class Solution:
"""OG solution Runtime: 352 ms, faster than 60.35% of Python online submissions for Rank Transform of an Array. Memory Usage: 30.7 MB, less than 96.67% of Python online submissions for Rank Transform of an Array."""
def arrayRankTransform(self, arr):
""":type arr: List[int]... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
"""OG solution Runtime: 352 ms, faster than 60.35% of Python online submissions for Rank Transform of an Array. Memory Usage: 30.7 MB, less than 96.67% of Python online submissions for Rank Transform of an Array."""
def arrayRankTransform(self, arr):
""":type arr: List[int] :rtype: List... | the_stack_v2_python_sparse | 1331-array_rank.py | stevestar888/leetcode-problems | train | 2 |
a3519b6f5ad775a290e0f2d66e5f4b3e1bcced55 | [
"records = Records(Extractor.extract_records(filename))\ngroups = records.group(minsog, maxsog)\nfor key in groups:\n rw = RecordsWriter(groups[key])\n rw.write_to_dir(key + '.fasta', outdir)",
"records = Records(Extractor.extract_records(filename))\nfseqs = records.filtr_organism_by_size(organism, minsize,... | <|body_start_0|>
records = Records(Extractor.extract_records(filename))
groups = records.group(minsog, maxsog)
for key in groups:
rw = RecordsWriter(groups[key])
rw.write_to_dir(key + '.fasta', outdir)
<|end_body_0|>
<|body_start_1|>
records = Records(Extractor.e... | RecordsController | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class RecordsController:
def grouping(filename, outdir, minsog, maxsog):
"""Grouping sequences by names. All big sequences (genomes) with minsog <= size <= maxsog form separate group 'cds' :param filename: filename with sequences in fasta :param outdir: output directory for saving groups :para... | stack_v2_sparse_classes_36k_train_010204 | 2,438 | no_license | [
{
"docstring": "Grouping sequences by names. All big sequences (genomes) with minsog <= size <= maxsog form separate group 'cds' :param filename: filename with sequences in fasta :param outdir: output directory for saving groups :param minsog: int, min size of genome :param maxsog: int, max size of genome",
... | 4 | stack_v2_sparse_classes_30k_train_003002 | Implement the Python class `RecordsController` described below.
Class description:
Implement the RecordsController class.
Method signatures and docstrings:
- def grouping(filename, outdir, minsog, maxsog): Grouping sequences by names. All big sequences (genomes) with minsog <= size <= maxsog form separate group 'cds'... | Implement the Python class `RecordsController` described below.
Class description:
Implement the RecordsController class.
Method signatures and docstrings:
- def grouping(filename, outdir, minsog, maxsog): Grouping sequences by names. All big sequences (genomes) with minsog <= size <= maxsog form separate group 'cds'... | 98f8dc52f735bcaa9cc8a2f1c2f1697fcf0f5b4d | <|skeleton|>
class RecordsController:
def grouping(filename, outdir, minsog, maxsog):
"""Grouping sequences by names. All big sequences (genomes) with minsog <= size <= maxsog form separate group 'cds' :param filename: filename with sequences in fasta :param outdir: output directory for saving groups :para... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class RecordsController:
def grouping(filename, outdir, minsog, maxsog):
"""Grouping sequences by names. All big sequences (genomes) with minsog <= size <= maxsog form separate group 'cds' :param filename: filename with sequences in fasta :param outdir: output directory for saving groups :param minsog: int,... | the_stack_v2_python_sparse | Clss/Controller/RecordsController.py | Maximato/fstage | train | 0 | |
39f085ca7412146310393b9314434568355801bf | [
"flag = True\nif num < 0:\n num = num * -1\n flag = False\nres = 0\nwhile num != 0:\n k = num % 10\n tmp = res\n res = tmp * 10 + k\n num = num // 10\n if res // 10 != tmp:\n print('溢出')\n return 0\nif flag == False:\n print(res * -1)\n return res * -1\nelse:\n print(res)... | <|body_start_0|>
flag = True
if num < 0:
num = num * -1
flag = False
res = 0
while num != 0:
k = num % 10
tmp = res
res = tmp * 10 + k
num = num // 10
if res // 10 != tmp:
print('溢出')
... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def reserve_int(self, num):
""":type num: int :rtype:int"""
<|body_0|>
def reserve_int_2(self, num):
""":type num: int :rtype:int"""
<|body_1|>
def reserve_int_3(self, num):
""":type num: int :rtype:int"""
<|body_2|>
<|end_skel... | stack_v2_sparse_classes_36k_train_010205 | 1,844 | no_license | [
{
"docstring": ":type num: int :rtype:int",
"name": "reserve_int",
"signature": "def reserve_int(self, num)"
},
{
"docstring": ":type num: int :rtype:int",
"name": "reserve_int_2",
"signature": "def reserve_int_2(self, num)"
},
{
"docstring": ":type num: int :rtype:int",
"nam... | 3 | stack_v2_sparse_classes_30k_train_007517 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def reserve_int(self, num): :type num: int :rtype:int
- def reserve_int_2(self, num): :type num: int :rtype:int
- def reserve_int_3(self, num): :type num: int :rtype:int | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def reserve_int(self, num): :type num: int :rtype:int
- def reserve_int_2(self, num): :type num: int :rtype:int
- def reserve_int_3(self, num): :type num: int :rtype:int
<|skele... | 4f2802d4773eddd2a2e06e61c51463056886b730 | <|skeleton|>
class Solution:
def reserve_int(self, num):
""":type num: int :rtype:int"""
<|body_0|>
def reserve_int_2(self, num):
""":type num: int :rtype:int"""
<|body_1|>
def reserve_int_3(self, num):
""":type num: int :rtype:int"""
<|body_2|>
<|end_skel... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def reserve_int(self, num):
""":type num: int :rtype:int"""
flag = True
if num < 0:
num = num * -1
flag = False
res = 0
while num != 0:
k = num % 10
tmp = res
res = tmp * 10 + k
num = num ... | the_stack_v2_python_sparse | leetcode/13_reserve_integer.py | Yara7L/python_algorithm | train | 0 | |
4a9cf49521b1d5efb99f675eb5a7431c06f342fc | [
"super().__init__()\nself.unknown_idx = unknown_idx\nself.prob = probability",
"if self.training and self.prob > 0:\n mask = input.new(input.size()).float().uniform_(0, 1) < self.prob\n input.masked_fill_(mask, self.unknown_idx)\nreturn input"
] | <|body_start_0|>
super().__init__()
self.unknown_idx = unknown_idx
self.prob = probability
<|end_body_0|>
<|body_start_1|>
if self.training and self.prob > 0:
mask = input.new(input.size()).float().uniform_(0, 1) < self.prob
input.masked_fill_(mask, self.unknown_... | With set frequency, replaces tokens with unknown token. This layer can be used right before an embedding layer to make the model more robust to unknown words at test time. | UnknownDropout | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class UnknownDropout:
"""With set frequency, replaces tokens with unknown token. This layer can be used right before an embedding layer to make the model more robust to unknown words at test time."""
def __init__(self, unknown_idx, probability):
"""Initialize layer. :param unknown_idx: ind... | stack_v2_sparse_classes_36k_train_010206 | 24,820 | permissive | [
{
"docstring": "Initialize layer. :param unknown_idx: index of unknown token, replace tokens with this :param probability: during training, replaces tokens with unknown token at this rate.",
"name": "__init__",
"signature": "def __init__(self, unknown_idx, probability)"
},
{
"docstring": "If tra... | 2 | null | Implement the Python class `UnknownDropout` described below.
Class description:
With set frequency, replaces tokens with unknown token. This layer can be used right before an embedding layer to make the model more robust to unknown words at test time.
Method signatures and docstrings:
- def __init__(self, unknown_idx... | Implement the Python class `UnknownDropout` described below.
Class description:
With set frequency, replaces tokens with unknown token. This layer can be used right before an embedding layer to make the model more robust to unknown words at test time.
Method signatures and docstrings:
- def __init__(self, unknown_idx... | e1d899edfb92471552bae153f59ad30aa7fca468 | <|skeleton|>
class UnknownDropout:
"""With set frequency, replaces tokens with unknown token. This layer can be used right before an embedding layer to make the model more robust to unknown words at test time."""
def __init__(self, unknown_idx, probability):
"""Initialize layer. :param unknown_idx: ind... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class UnknownDropout:
"""With set frequency, replaces tokens with unknown token. This layer can be used right before an embedding layer to make the model more robust to unknown words at test time."""
def __init__(self, unknown_idx, probability):
"""Initialize layer. :param unknown_idx: index of unknown... | the_stack_v2_python_sparse | parlai/agents/seq2seq/modules.py | facebookresearch/ParlAI | train | 10,943 |
ed3a5db3e6423364366e87838af278de1141f63f | [
"res, perm = ([], [])\n\ndef permutation(partial, visited):\n if len(partial) == len(words):\n perm.append(partial)\n return\n for i, w in enumerate(words):\n if i in visited:\n continue\n visited.add(i)\n permutation(partial + [w], visited)\n visited.remov... | <|body_start_0|>
res, perm = ([], [])
def permutation(partial, visited):
if len(partial) == len(words):
perm.append(partial)
return
for i, w in enumerate(words):
if i in visited:
continue
visited... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def findSubstring(self, s, words):
""":type s: str :type words: List[str] :rtype: List[int]"""
<|body_0|>
def findSubstring(self, s, words):
""":type s: str :type words: List[str] :rtype: List[int]"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
... | stack_v2_sparse_classes_36k_train_010207 | 3,539 | no_license | [
{
"docstring": ":type s: str :type words: List[str] :rtype: List[int]",
"name": "findSubstring",
"signature": "def findSubstring(self, s, words)"
},
{
"docstring": ":type s: str :type words: List[str] :rtype: List[int]",
"name": "findSubstring",
"signature": "def findSubstring(self, s, w... | 2 | null | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def findSubstring(self, s, words): :type s: str :type words: List[str] :rtype: List[int]
- def findSubstring(self, s, words): :type s: str :type words: List[str] :rtype: List[int... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def findSubstring(self, s, words): :type s: str :type words: List[str] :rtype: List[int]
- def findSubstring(self, s, words): :type s: str :type words: List[str] :rtype: List[int... | f3fc71f344cd758cfce77f16ab72992c99ab288e | <|skeleton|>
class Solution:
def findSubstring(self, s, words):
""":type s: str :type words: List[str] :rtype: List[int]"""
<|body_0|>
def findSubstring(self, s, words):
""":type s: str :type words: List[str] :rtype: List[int]"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def findSubstring(self, s, words):
""":type s: str :type words: List[str] :rtype: List[int]"""
res, perm = ([], [])
def permutation(partial, visited):
if len(partial) == len(words):
perm.append(partial)
return
for i, w ... | the_stack_v2_python_sparse | 30_findSubstring.py | jennyChing/leetCode | train | 2 | |
d257d0170d1a1fff7a1f11014aa7a5578f0a632b | [
"formatter = logging.Formatter('[%(asctime)s %(hostname)s:%(process)d][%(filename)s:%(lineno)s][%(levelname)s] %(message)s')\nif color:\n formatter = colorlog.ColoredFormatter('%(reset)s[%(cyan)s%(asctime)s %(hostname)s:%(process)d%(reset)s][%(blue)s%(filename)s:%(lineno)s%(reset)s][%(log_color)s%(levelname)s%(r... | <|body_start_0|>
formatter = logging.Formatter('[%(asctime)s %(hostname)s:%(process)d][%(filename)s:%(lineno)s][%(levelname)s] %(message)s')
if color:
formatter = colorlog.ColoredFormatter('%(reset)s[%(cyan)s%(asctime)s %(hostname)s:%(process)d%(reset)s][%(blue)s%(filename)s:%(lineno)s%(rese... | SuperBench Logger class. | SuperBenchLogger | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SuperBenchLogger:
"""SuperBench Logger class."""
def add_handler(logger, stream=sys.stdout, filename=None, color=False):
"""Add handler for logger. Args: logger (Logger): Logger to which the handler is added. stream (IO, optional): The stream that the stream handler should use. Defau... | stack_v2_sparse_classes_36k_train_010208 | 2,693 | permissive | [
{
"docstring": "Add handler for logger. Args: logger (Logger): Logger to which the handler is added. stream (IO, optional): The stream that the stream handler should use. Defaults to sys.stdout. filename (str, optional): The filename that file handler should use. Defaults to None. color (bool, optional): Colore... | 2 | stack_v2_sparse_classes_30k_train_020022 | Implement the Python class `SuperBenchLogger` described below.
Class description:
SuperBench Logger class.
Method signatures and docstrings:
- def add_handler(logger, stream=sys.stdout, filename=None, color=False): Add handler for logger. Args: logger (Logger): Logger to which the handler is added. stream (IO, option... | Implement the Python class `SuperBenchLogger` described below.
Class description:
SuperBench Logger class.
Method signatures and docstrings:
- def add_handler(logger, stream=sys.stdout, filename=None, color=False): Add handler for logger. Args: logger (Logger): Logger to which the handler is added. stream (IO, option... | 43620c3f46701d11514901e5c238d7a571ab3ea9 | <|skeleton|>
class SuperBenchLogger:
"""SuperBench Logger class."""
def add_handler(logger, stream=sys.stdout, filename=None, color=False):
"""Add handler for logger. Args: logger (Logger): Logger to which the handler is added. stream (IO, optional): The stream that the stream handler should use. Defau... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SuperBenchLogger:
"""SuperBench Logger class."""
def add_handler(logger, stream=sys.stdout, filename=None, color=False):
"""Add handler for logger. Args: logger (Logger): Logger to which the handler is added. stream (IO, optional): The stream that the stream handler should use. Defaults to sys.st... | the_stack_v2_python_sparse | superbench/common/utils/logging.py | QPC-database/superbenchmark | train | 1 |
f8a9102c69dabe6ce3b7eb3e049cc2498447e0f5 | [
"self.name = name\nself.client_balancing_enabled = client_balancing_enabled\nself.min_bitrate_type = min_bitrate_type\nself.band_selection_type = band_selection_type\nself.ap_band_settings = ap_band_settings\nself.two_four_ghz_settings = two_four_ghz_settings\nself.five_ghz_settings = five_ghz_settings",
"if dict... | <|body_start_0|>
self.name = name
self.client_balancing_enabled = client_balancing_enabled
self.min_bitrate_type = min_bitrate_type
self.band_selection_type = band_selection_type
self.ap_band_settings = ap_band_settings
self.two_four_ghz_settings = two_four_ghz_settings
... | Implementation of the 'createNetworkWirelessRfProfile' model. TODO: type model description here. Attributes: name (string): The name of the new profile. Must be unique. This param is required on creation. client_balancing_enabled (bool): Steers client to best available access point. Can be either true or false. Default... | CreateNetworkWirelessRfProfileModel | [
"MIT",
"Python-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class CreateNetworkWirelessRfProfileModel:
"""Implementation of the 'createNetworkWirelessRfProfile' model. TODO: type model description here. Attributes: name (string): The name of the new profile. Must be unique. This param is required on creation. client_balancing_enabled (bool): Steers client to be... | stack_v2_sparse_classes_36k_train_010209 | 4,356 | permissive | [
{
"docstring": "Constructor for the CreateNetworkWirelessRfProfileModel class",
"name": "__init__",
"signature": "def __init__(self, name=None, band_selection_type=None, client_balancing_enabled=None, min_bitrate_type=None, ap_band_settings=None, two_four_ghz_settings=None, five_ghz_settings=None)"
},... | 2 | stack_v2_sparse_classes_30k_train_002673 | Implement the Python class `CreateNetworkWirelessRfProfileModel` described below.
Class description:
Implementation of the 'createNetworkWirelessRfProfile' model. TODO: type model description here. Attributes: name (string): The name of the new profile. Must be unique. This param is required on creation. client_balanc... | Implement the Python class `CreateNetworkWirelessRfProfileModel` described below.
Class description:
Implementation of the 'createNetworkWirelessRfProfile' model. TODO: type model description here. Attributes: name (string): The name of the new profile. Must be unique. This param is required on creation. client_balanc... | 9894089eb013318243ae48869cc5130eb37f80c0 | <|skeleton|>
class CreateNetworkWirelessRfProfileModel:
"""Implementation of the 'createNetworkWirelessRfProfile' model. TODO: type model description here. Attributes: name (string): The name of the new profile. Must be unique. This param is required on creation. client_balancing_enabled (bool): Steers client to be... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class CreateNetworkWirelessRfProfileModel:
"""Implementation of the 'createNetworkWirelessRfProfile' model. TODO: type model description here. Attributes: name (string): The name of the new profile. Must be unique. This param is required on creation. client_balancing_enabled (bool): Steers client to best available ... | the_stack_v2_python_sparse | meraki_sdk/models/create_network_wireless_rf_profile_model.py | RaulCatalano/meraki-python-sdk | train | 1 |
04b4e85c7119dfe172f44c9ad5d12033889247f5 | [
"super().__init__()\nself.k = k\nself.beta = beta",
"if len(ranking) == 0:\n return 0.0\nif len(query.getRelDocs()) == 0:\n return 0.0\np = Precision(self.k).evalQuery(ranking, query)\nr = Rappel(self.k).evalQuery(ranking, query)\nreturn (1 + self.beta ** 2) * (p * r) / (self.beta ** 2 * p + r)"
] | <|body_start_0|>
super().__init__()
self.k = k
self.beta = beta
<|end_body_0|>
<|body_start_1|>
if len(ranking) == 0:
return 0.0
if len(query.getRelDocs()) == 0:
return 0.0
p = Precision(self.k).evalQuery(ranking, query)
r = Rappel(self.k)... | Classe pour la f-mesure, qui combine les deux métriques P@k et R@k. | FMesure | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class FMesure:
"""Classe pour la f-mesure, qui combine les deux métriques P@k et R@k."""
def __init__(self, k=None, beta=0.5):
"""@param beta: float, paramètre qui donne plus d'importance au rappel ou à la précision. Deux valeurs très fréquentes sont: * beta = 2 pour donner plus de poids a... | stack_v2_sparse_classes_36k_train_010210 | 8,035 | no_license | [
{
"docstring": "@param beta: float, paramètre qui donne plus d'importance au rappel ou à la précision. Deux valeurs très fréquentes sont: * beta = 2 pour donner plus de poids au rappel * beta = 0.5 pour donner plus de poids à la précision",
"name": "__init__",
"signature": "def __init__(self, k=None, be... | 2 | stack_v2_sparse_classes_30k_train_002770 | Implement the Python class `FMesure` described below.
Class description:
Classe pour la f-mesure, qui combine les deux métriques P@k et R@k.
Method signatures and docstrings:
- def __init__(self, k=None, beta=0.5): @param beta: float, paramètre qui donne plus d'importance au rappel ou à la précision. Deux valeurs trè... | Implement the Python class `FMesure` described below.
Class description:
Classe pour la f-mesure, qui combine les deux métriques P@k et R@k.
Method signatures and docstrings:
- def __init__(self, k=None, beta=0.5): @param beta: float, paramètre qui donne plus d'importance au rappel ou à la précision. Deux valeurs trè... | 210bfc6b78e92fd3cc973ef64d6d91115b4f2c9b | <|skeleton|>
class FMesure:
"""Classe pour la f-mesure, qui combine les deux métriques P@k et R@k."""
def __init__(self, k=None, beta=0.5):
"""@param beta: float, paramètre qui donne plus d'importance au rappel ou à la précision. Deux valeurs très fréquentes sont: * beta = 2 pour donner plus de poids a... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class FMesure:
"""Classe pour la f-mesure, qui combine les deux métriques P@k et R@k."""
def __init__(self, k=None, beta=0.5):
"""@param beta: float, paramètre qui donne plus d'importance au rappel ou à la précision. Deux valeurs très fréquentes sont: * beta = 2 pour donner plus de poids au rappel * be... | the_stack_v2_python_sparse | RI/Metrics.py | celina-k/RITAL | train | 1 |
b70e73edb101e6303b655e31f58aa1ebc22cac70 | [
"super(Segmentor, self).__init__(parameters)\nself.layer_list = add_conv_block(self.Conv, self.BatchNorm, in_channels=anatomy_factors, out_channels=self.base_filters * 4)\nself.layer_list += add_conv_block(self.Conv, self.BatchNorm, in_channels=self.base_filters * 4, out_channels=self.base_filters * 4)\nself.conv =... | <|body_start_0|>
super(Segmentor, self).__init__(parameters)
self.layer_list = add_conv_block(self.Conv, self.BatchNorm, in_channels=anatomy_factors, out_channels=self.base_filters * 4)
self.layer_list += add_conv_block(self.Conv, self.BatchNorm, in_channels=self.base_filters * 4, out_channels=s... | Segmentor | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Segmentor:
def __init__(self, parameters, anatomy_factors):
"""Segmentor module for SDNet. Args: parameters (dict): A dictionary containing model parameters. anatomy_factors (int): The number of anatomical factors to be considered. Attributes: layer_list (list): List of layers in the Seg... | stack_v2_sparse_classes_36k_train_010211 | 14,834 | permissive | [
{
"docstring": "Segmentor module for SDNet. Args: parameters (dict): A dictionary containing model parameters. anatomy_factors (int): The number of anatomical factors to be considered. Attributes: layer_list (list): List of layers in the Segmentor module. conv (nn.Conv2d): Convolutional layer to generate the fi... | 3 | stack_v2_sparse_classes_30k_train_013451 | Implement the Python class `Segmentor` described below.
Class description:
Implement the Segmentor class.
Method signatures and docstrings:
- def __init__(self, parameters, anatomy_factors): Segmentor module for SDNet. Args: parameters (dict): A dictionary containing model parameters. anatomy_factors (int): The numbe... | Implement the Python class `Segmentor` described below.
Class description:
Implement the Segmentor class.
Method signatures and docstrings:
- def __init__(self, parameters, anatomy_factors): Segmentor module for SDNet. Args: parameters (dict): A dictionary containing model parameters. anatomy_factors (int): The numbe... | 72eb99f68205afd5f8d49a3bb6cfc08cfd467582 | <|skeleton|>
class Segmentor:
def __init__(self, parameters, anatomy_factors):
"""Segmentor module for SDNet. Args: parameters (dict): A dictionary containing model parameters. anatomy_factors (int): The number of anatomical factors to be considered. Attributes: layer_list (list): List of layers in the Seg... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Segmentor:
def __init__(self, parameters, anatomy_factors):
"""Segmentor module for SDNet. Args: parameters (dict): A dictionary containing model parameters. anatomy_factors (int): The number of anatomical factors to be considered. Attributes: layer_list (list): List of layers in the Segmentor module.... | the_stack_v2_python_sparse | GANDLF/models/sdnet.py | mlcommons/GaNDLF | train | 45 | |
11a229a8ab8aed4705bd2775e452f5e569993a19 | [
"self.hass = hass\nself.api = api\nself.ready = asyncio.Event()\nself.sensors = []",
"try:\n api_response = await self.api.get_data()\n self.ready.set()\nexcept InverterError as err:\n if now is not None:\n self.ready.clear()\n return\n raise PlatformNotReady from err\ndata = api_respons... | <|body_start_0|>
self.hass = hass
self.api = api
self.ready = asyncio.Event()
self.sensors = []
<|end_body_0|>
<|body_start_1|>
try:
api_response = await self.api.get_data()
self.ready.set()
except InverterError as err:
if now is not N... | Representation of a Sensor. | RealTimeDataEndpoint | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class RealTimeDataEndpoint:
"""Representation of a Sensor."""
def __init__(self, hass, api):
"""Initialize the sensor."""
<|body_0|>
async def async_refresh(self, now=None):
"""Fetch new state data for the sensor. This is the only method that should fetch new data for ... | stack_v2_sparse_classes_36k_train_010212 | 5,379 | permissive | [
{
"docstring": "Initialize the sensor.",
"name": "__init__",
"signature": "def __init__(self, hass, api)"
},
{
"docstring": "Fetch new state data for the sensor. This is the only method that should fetch new data for Home Assistant.",
"name": "async_refresh",
"signature": "async def asyn... | 2 | null | Implement the Python class `RealTimeDataEndpoint` described below.
Class description:
Representation of a Sensor.
Method signatures and docstrings:
- def __init__(self, hass, api): Initialize the sensor.
- async def async_refresh(self, now=None): Fetch new state data for the sensor. This is the only method that shoul... | Implement the Python class `RealTimeDataEndpoint` described below.
Class description:
Representation of a Sensor.
Method signatures and docstrings:
- def __init__(self, hass, api): Initialize the sensor.
- async def async_refresh(self, now=None): Fetch new state data for the sensor. This is the only method that shoul... | 8f4ec89be6c2505d8a59eee44de335abe308ac9f | <|skeleton|>
class RealTimeDataEndpoint:
"""Representation of a Sensor."""
def __init__(self, hass, api):
"""Initialize the sensor."""
<|body_0|>
async def async_refresh(self, now=None):
"""Fetch new state data for the sensor. This is the only method that should fetch new data for ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class RealTimeDataEndpoint:
"""Representation of a Sensor."""
def __init__(self, hass, api):
"""Initialize the sensor."""
self.hass = hass
self.api = api
self.ready = asyncio.Event()
self.sensors = []
async def async_refresh(self, now=None):
"""Fetch new sta... | the_stack_v2_python_sparse | homeassistant/components/solax/sensor.py | JeffLIrion/home-assistant | train | 5 |
9f3f628954de779253b554fbda7c6b718f9fb4b0 | [
"super().__init__(coordinator)\nself._site_info = site_info\nself._device_type = device_type\nself._version = status.version\nself.base_unique_id = '_'.join(powerwalls_serial_numbers)",
"device_info = {'identifiers': {(DOMAIN, self.base_unique_id)}, 'name': self._site_info.site_name, 'manufacturer': MANUFACTURER}... | <|body_start_0|>
super().__init__(coordinator)
self._site_info = site_info
self._device_type = device_type
self._version = status.version
self.base_unique_id = '_'.join(powerwalls_serial_numbers)
<|end_body_0|>
<|body_start_1|>
device_info = {'identifiers': {(DOMAIN, sel... | Base class for powerwall entities. | PowerWallEntity | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class PowerWallEntity:
"""Base class for powerwall entities."""
def __init__(self, coordinator, site_info, status, device_type, powerwalls_serial_numbers):
"""Initialize the sensor."""
<|body_0|>
def device_info(self):
"""Powerwall device info."""
<|body_1|>
<... | stack_v2_sparse_classes_36k_train_010213 | 1,145 | permissive | [
{
"docstring": "Initialize the sensor.",
"name": "__init__",
"signature": "def __init__(self, coordinator, site_info, status, device_type, powerwalls_serial_numbers)"
},
{
"docstring": "Powerwall device info.",
"name": "device_info",
"signature": "def device_info(self)"
}
] | 2 | stack_v2_sparse_classes_30k_train_021486 | Implement the Python class `PowerWallEntity` described below.
Class description:
Base class for powerwall entities.
Method signatures and docstrings:
- def __init__(self, coordinator, site_info, status, device_type, powerwalls_serial_numbers): Initialize the sensor.
- def device_info(self): Powerwall device info. | Implement the Python class `PowerWallEntity` described below.
Class description:
Base class for powerwall entities.
Method signatures and docstrings:
- def __init__(self, coordinator, site_info, status, device_type, powerwalls_serial_numbers): Initialize the sensor.
- def device_info(self): Powerwall device info.
<|... | 2fee32fce03bc49e86cf2e7b741a15621a97cce5 | <|skeleton|>
class PowerWallEntity:
"""Base class for powerwall entities."""
def __init__(self, coordinator, site_info, status, device_type, powerwalls_serial_numbers):
"""Initialize the sensor."""
<|body_0|>
def device_info(self):
"""Powerwall device info."""
<|body_1|>
<... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class PowerWallEntity:
"""Base class for powerwall entities."""
def __init__(self, coordinator, site_info, status, device_type, powerwalls_serial_numbers):
"""Initialize the sensor."""
super().__init__(coordinator)
self._site_info = site_info
self._device_type = device_type
... | the_stack_v2_python_sparse | homeassistant/components/powerwall/entity.py | BenWoodford/home-assistant | train | 11 |
c1cb22f544a3df2e8b70f65f03fcd2c4dd5ce453 | [
"if not root:\n return ''\nret = []\nst = []\nst.append(root)\nwhile len(st):\n nd = st.pop()\n ret.append(str(nd.val))\n if nd.right:\n st.append(nd.right)\n if nd.left:\n st.append(nd.left)\nreturn ','.join(ret)",
"dataArr = data.split(',')\nl = len(dataArr)\nif l < 1:\n return N... | <|body_start_0|>
if not root:
return ''
ret = []
st = []
st.append(root)
while len(st):
nd = st.pop()
ret.append(str(nd.val))
if nd.right:
st.append(nd.right)
if nd.left:
st.append(nd.left... | 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_010214 | 1,743 | no_license | [
{
"docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str",
"name": "serialize",
"signature": "def serialize(self, root)"
},
{
"docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode",
"name": "deserialize",
"signature": "def deserializ... | 2 | stack_v2_sparse_classes_30k_train_001361 | 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:... | d3e8669f932fc2e22711e8b7590d3365d020e189 | <|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"""
if not root:
return ''
ret = []
st = []
st.append(root)
while len(st):
nd = st.pop()
ret.append(str(nd.val))
... | the_stack_v2_python_sparse | leetcode/449.py | liuweilin17/algorithm | train | 3 | |
ce777ef6e115a829693a2fff4b39431390013497 | [
"self.num_pkts_arrived = 0\nself.num_pkts_left = 0\nself.num_normal_arrived = 0\nself.num_normal_left = 0\nself.num_malicious_arrived = 0\nself.num_malicious_left = 0\nself.num_permits_arrived = 0\nself.num_permits_left = 0\nself.num_negative_arrived = 0\nself.num_negative_left = 0\nself.num_normal_removed = 0\nsel... | <|body_start_0|>
self.num_pkts_arrived = 0
self.num_pkts_left = 0
self.num_normal_arrived = 0
self.num_normal_left = 0
self.num_malicious_arrived = 0
self.num_malicious_left = 0
self.num_permits_arrived = 0
self.num_permits_left = 0
self.num_negati... | Results | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Results:
def __init__(self):
"""`self.packets` is a dictionary of dictionaries as follows.. {<pkt_id>: {'arrival': ___, 'departure': ___}, <pkt_id>: {...}, ...}"""
<|body_0|>
def _add_packet_arrival(self, pkt_id, time, pkt_type):
"""Update packet list and counters wh... | stack_v2_sparse_classes_36k_train_010215 | 6,421 | no_license | [
{
"docstring": "`self.packets` is a dictionary of dictionaries as follows.. {<pkt_id>: {'arrival': ___, 'departure': ___}, <pkt_id>: {...}, ...}",
"name": "__init__",
"signature": "def __init__(self)"
},
{
"docstring": "Update packet list and counters when a packet arrived at module :param pkt_i... | 6 | stack_v2_sparse_classes_30k_train_010948 | Implement the Python class `Results` described below.
Class description:
Implement the Results class.
Method signatures and docstrings:
- def __init__(self): `self.packets` is a dictionary of dictionaries as follows.. {<pkt_id>: {'arrival': ___, 'departure': ___}, <pkt_id>: {...}, ...}
- def _add_packet_arrival(self,... | Implement the Python class `Results` described below.
Class description:
Implement the Results class.
Method signatures and docstrings:
- def __init__(self): `self.packets` is a dictionary of dictionaries as follows.. {<pkt_id>: {'arrival': ___, 'departure': ___}, <pkt_id>: {...}, ...}
- def _add_packet_arrival(self,... | 089dc4ac171e15c214f7fe81d59d7e1fa8370201 | <|skeleton|>
class Results:
def __init__(self):
"""`self.packets` is a dictionary of dictionaries as follows.. {<pkt_id>: {'arrival': ___, 'departure': ___}, <pkt_id>: {...}, ...}"""
<|body_0|>
def _add_packet_arrival(self, pkt_id, time, pkt_type):
"""Update packet list and counters wh... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Results:
def __init__(self):
"""`self.packets` is a dictionary of dictionaries as follows.. {<pkt_id>: {'arrival': ___, 'departure': ___}, <pkt_id>: {...}, ...}"""
self.num_pkts_arrived = 0
self.num_pkts_left = 0
self.num_normal_arrived = 0
self.num_normal_left = 0
... | the_stack_v2_python_sparse | results.py | mappls/gsim | train | 0 | |
e7f19309363f23d84fef5ba66af1ea204ffc2315 | [
"Parametre.__init__(self, 'créer', 'create')\nself.schema = '<type:cle> <cle>'\nself.aide_courte = 'crée un nouveau tag'\nself.aide_longue = 'Cette commande permet de créer un nouveau tag. Vous devez préciser en premier paramètre le type de tag (comme pnj, objet ou autre) et en second paramètre, la clé du tag à cré... | <|body_start_0|>
Parametre.__init__(self, 'créer', 'create')
self.schema = '<type:cle> <cle>'
self.aide_courte = 'crée un nouveau tag'
self.aide_longue = 'Cette commande permet de créer un nouveau tag. Vous devez préciser en premier paramètre le type de tag (comme pnj, objet ou autre) et... | Commande 'tags créer' | PrmCreer | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class PrmCreer:
"""Commande 'tags créer'"""
def __init__(self):
"""Constructeur du paramètre."""
<|body_0|>
def interpreter(self, personnage, dic_masques):
"""Méthode d'interprétation de commande"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
Paramet... | stack_v2_sparse_classes_36k_train_010216 | 3,016 | permissive | [
{
"docstring": "Constructeur du paramètre.",
"name": "__init__",
"signature": "def __init__(self)"
},
{
"docstring": "Méthode d'interprétation de commande",
"name": "interpreter",
"signature": "def interpreter(self, personnage, dic_masques)"
}
] | 2 | null | Implement the Python class `PrmCreer` described below.
Class description:
Commande 'tags créer'
Method signatures and docstrings:
- def __init__(self): Constructeur du paramètre.
- def interpreter(self, personnage, dic_masques): Méthode d'interprétation de commande | Implement the Python class `PrmCreer` described below.
Class description:
Commande 'tags créer'
Method signatures and docstrings:
- def __init__(self): Constructeur du paramètre.
- def interpreter(self, personnage, dic_masques): Méthode d'interprétation de commande
<|skeleton|>
class PrmCreer:
"""Commande 'tags ... | 7e93bff08cdf891352efba587e89c40f3b4a2301 | <|skeleton|>
class PrmCreer:
"""Commande 'tags créer'"""
def __init__(self):
"""Constructeur du paramètre."""
<|body_0|>
def interpreter(self, personnage, dic_masques):
"""Méthode d'interprétation de commande"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class PrmCreer:
"""Commande 'tags créer'"""
def __init__(self):
"""Constructeur du paramètre."""
Parametre.__init__(self, 'créer', 'create')
self.schema = '<type:cle> <cle>'
self.aide_courte = 'crée un nouveau tag'
self.aide_longue = 'Cette commande permet de créer un no... | the_stack_v2_python_sparse | src/secondaires/tags/commandes/tags/creer.py | vincent-lg/tsunami | train | 5 |
e9e3dd408401d510c3d2c1e1f4c7c3365c941e34 | [
"page = self.client.get('/')\nself.assertEqual(page.status_code, 200)\nself.assertTemplateUsed(page, 'index.html')",
"page = self.client.get('/about/')\nself.assertEqual(page.status_code, 200)\nself.assertTemplateUsed(page, 'about.html')",
"user = User.objects.create_user('TestingUser', 'testing@test.com', 'tes... | <|body_start_0|>
page = self.client.get('/')
self.assertEqual(page.status_code, 200)
self.assertTemplateUsed(page, 'index.html')
<|end_body_0|>
<|body_start_1|>
page = self.client.get('/about/')
self.assertEqual(page.status_code, 200)
self.assertTemplateUsed(page, 'about... | TestHomeViews | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TestHomeViews:
def test_get_index_page(self):
"""Testing index view which is the first page user sees"""
<|body_0|>
def test_get_about_page(self):
"""Testing about view"""
<|body_1|>
def test_get_faq_page(self):
"""Testing faq view"""
<|b... | stack_v2_sparse_classes_36k_train_010217 | 1,202 | no_license | [
{
"docstring": "Testing index view which is the first page user sees",
"name": "test_get_index_page",
"signature": "def test_get_index_page(self)"
},
{
"docstring": "Testing about view",
"name": "test_get_about_page",
"signature": "def test_get_about_page(self)"
},
{
"docstring":... | 3 | stack_v2_sparse_classes_30k_train_005729 | Implement the Python class `TestHomeViews` described below.
Class description:
Implement the TestHomeViews class.
Method signatures and docstrings:
- def test_get_index_page(self): Testing index view which is the first page user sees
- def test_get_about_page(self): Testing about view
- def test_get_faq_page(self): T... | Implement the Python class `TestHomeViews` described below.
Class description:
Implement the TestHomeViews class.
Method signatures and docstrings:
- def test_get_index_page(self): Testing index view which is the first page user sees
- def test_get_about_page(self): Testing about view
- def test_get_faq_page(self): T... | b28b2254b81c5edf4db68056aeaecffbc7a56ab5 | <|skeleton|>
class TestHomeViews:
def test_get_index_page(self):
"""Testing index view which is the first page user sees"""
<|body_0|>
def test_get_about_page(self):
"""Testing about view"""
<|body_1|>
def test_get_faq_page(self):
"""Testing faq view"""
<|b... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TestHomeViews:
def test_get_index_page(self):
"""Testing index view which is the first page user sees"""
page = self.client.get('/')
self.assertEqual(page.status_code, 200)
self.assertTemplateUsed(page, 'index.html')
def test_get_about_page(self):
"""Testing about ... | the_stack_v2_python_sparse | home/test_views.py | kimpea/us-issue-tracker | train | 0 | |
d7c1f8f6199d3466b7cdadcd89c13b06b17ddc25 | [
"self.labels = []\nself.mean = []\nself.var = []\nself.n = 0",
"if labels == None:\n labels = range(len(data))\nself.labels = labels\nself.n = len(labels)\nfor c in data:\n self.mean.append(np.mean(c, axis=0))\n self.var.append(np.var(c, axis=0))",
"est_prob = np.array([gauss(m, v, points) for m, v in ... | <|body_start_0|>
self.labels = []
self.mean = []
self.var = []
self.n = 0
<|end_body_0|>
<|body_start_1|>
if labels == None:
labels = range(len(data))
self.labels = labels
self.n = len(labels)
for c in data:
self.mean.append(np.mea... | BayesClassifier | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class BayesClassifier:
def __init__(self):
"""Initializing classifier with training data"""
<|body_0|>
def train(self, data, labels=None):
"""Train on data(List of arrays n*dim) Labels are optional, default is 0...n-1"""
<|body_1|>
def classify(self, points):
... | stack_v2_sparse_classes_36k_train_010218 | 1,545 | no_license | [
{
"docstring": "Initializing classifier with training data",
"name": "__init__",
"signature": "def __init__(self)"
},
{
"docstring": "Train on data(List of arrays n*dim) Labels are optional, default is 0...n-1",
"name": "train",
"signature": "def train(self, data, labels=None)"
},
{
... | 3 | stack_v2_sparse_classes_30k_train_003848 | Implement the Python class `BayesClassifier` described below.
Class description:
Implement the BayesClassifier class.
Method signatures and docstrings:
- def __init__(self): Initializing classifier with training data
- def train(self, data, labels=None): Train on data(List of arrays n*dim) Labels are optional, defaul... | Implement the Python class `BayesClassifier` described below.
Class description:
Implement the BayesClassifier class.
Method signatures and docstrings:
- def __init__(self): Initializing classifier with training data
- def train(self, data, labels=None): Train on data(List of arrays n*dim) Labels are optional, defaul... | 8c0e4df00a877464a64548e8d3a655ee2c0879f3 | <|skeleton|>
class BayesClassifier:
def __init__(self):
"""Initializing classifier with training data"""
<|body_0|>
def train(self, data, labels=None):
"""Train on data(List of arrays n*dim) Labels are optional, default is 0...n-1"""
<|body_1|>
def classify(self, points):
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class BayesClassifier:
def __init__(self):
"""Initializing classifier with training data"""
self.labels = []
self.mean = []
self.var = []
self.n = 0
def train(self, data, labels=None):
"""Train on data(List of arrays n*dim) Labels are optional, default is 0...n-1... | the_stack_v2_python_sparse | image_processing/segment/bayes.py | SelinaJing/python_proj | train | 0 | |
4b85250524ef6758c88e88639d3068673a2af4b7 | [
"self.matrix = matrix\nself.database2 = {}\nfor x in range(len(matrix) - 1):\n for y in range(len(matrix[0]) - 1):\n self.database2[x, y] = matrix[x][y] + matrix[x + 1][y] + matrix[x][y + 1] + matrix[x + 1][y + 1]",
"sumNum = 0\nif row2 - row1 >= 2 and col2 - col1 >= 2:\n return self.database2[row1, ... | <|body_start_0|>
self.matrix = matrix
self.database2 = {}
for x in range(len(matrix) - 1):
for y in range(len(matrix[0]) - 1):
self.database2[x, y] = matrix[x][y] + matrix[x + 1][y] + matrix[x][y + 1] + matrix[x + 1][y + 1]
<|end_body_0|>
<|body_start_1|>
sum... | 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_010219 | 13,059 | 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 | null | 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:... | 2711bc08f15266bec4ca135e8e3e629df46713eb | <|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]]"""
self.matrix = matrix
self.database2 = {}
for x in range(len(matrix) - 1):
for y in range(len(matrix[0]) - 1):
self.database2[x, y] = matrix[x][y] + matrix[x + 1][y] + matrix[x... | the_stack_v2_python_sparse | 0.算法/20180803.py | unlimitediw/CheckCode | train | 0 | |
5bb32112032f292891bc8ca887e02ab9f60b37a3 | [
"n = len(nums)\nif n < 4:\n return []\nL = set()\nsumsIndexes = {}\nfor i in range(n):\n for j in range(i + 1, n):\n cursum = nums[i] + nums[j]\n if cursum in sumsIndexes:\n sumsIndexes[cursum].append((i, j))\n else:\n sumsIndexes[cursum] = [(i, j)]\nfor i in range(n... | <|body_start_0|>
n = len(nums)
if n < 4:
return []
L = set()
sumsIndexes = {}
for i in range(n):
for j in range(i + 1, n):
cursum = nums[i] + nums[j]
if cursum in sumsIndexes:
sumsIndexes[cursum].append((... | Solution | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def fourSum(self, nums, target):
""":type nums: List[int] :type target: int :rtype: List[List[int]]"""
<|body_0|>
def fourSum_slow(self, nums, target):
""":type nums: List[int] :type target: int :rtype: List[List[int]]"""
<|body_1|>
<|end_skeleton|... | stack_v2_sparse_classes_36k_train_010220 | 1,875 | permissive | [
{
"docstring": ":type nums: List[int] :type target: int :rtype: List[List[int]]",
"name": "fourSum",
"signature": "def fourSum(self, nums, target)"
},
{
"docstring": ":type nums: List[int] :type target: int :rtype: List[List[int]]",
"name": "fourSum_slow",
"signature": "def fourSum_slow(... | 2 | stack_v2_sparse_classes_30k_train_015846 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def fourSum(self, nums, target): :type nums: List[int] :type target: int :rtype: List[List[int]]
- def fourSum_slow(self, nums, target): :type nums: List[int] :type target: int :... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def fourSum(self, nums, target): :type nums: List[int] :type target: int :rtype: List[List[int]]
- def fourSum_slow(self, nums, target): :type nums: List[int] :type target: int :... | 38eb0556f865fd06f517ca45253d00aaca39d70b | <|skeleton|>
class Solution:
def fourSum(self, nums, target):
""":type nums: List[int] :type target: int :rtype: List[List[int]]"""
<|body_0|>
def fourSum_slow(self, nums, target):
""":type nums: List[int] :type target: int :rtype: List[List[int]]"""
<|body_1|>
<|end_skeleton|... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def fourSum(self, nums, target):
""":type nums: List[int] :type target: int :rtype: List[List[int]]"""
n = len(nums)
if n < 4:
return []
L = set()
sumsIndexes = {}
for i in range(n):
for j in range(i + 1, n):
cur... | the_stack_v2_python_sparse | Python3/no18_4Sum.py | yif042/leetcode | train | 0 | |
08b3eb0a7d63bf88a91671ac4bdf1f8df99db0b4 | [
"super(MultiHeadedAttention, self).__init__()\nassert d_model % h == 0\nself.d_k = d_model // h\nself.h = h\nself.linears = clones(nn.Linear(d_model, d_model), 4)\nself.attn = None\nself.dropout = None",
"if mask is not None:\n mask = mask.unsqueeze(1)\nnbatches = query.size(0)\nquery, key, value = [l(x).view(... | <|body_start_0|>
super(MultiHeadedAttention, self).__init__()
assert d_model % h == 0
self.d_k = d_model // h
self.h = h
self.linears = clones(nn.Linear(d_model, d_model), 4)
self.attn = None
self.dropout = None
<|end_body_0|>
<|body_start_1|>
if mask is ... | MultiHeadedAttention | [
"CC0-1.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class MultiHeadedAttention:
def __init__(self, h, d_model, dropout=0.1):
"""Take in model size and number of heads."""
<|body_0|>
def forward(self, query, key, value, mask=None):
"""Implements Figure 2"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
super... | stack_v2_sparse_classes_36k_train_010221 | 20,810 | permissive | [
{
"docstring": "Take in model size and number of heads.",
"name": "__init__",
"signature": "def __init__(self, h, d_model, dropout=0.1)"
},
{
"docstring": "Implements Figure 2",
"name": "forward",
"signature": "def forward(self, query, key, value, mask=None)"
}
] | 2 | null | Implement the Python class `MultiHeadedAttention` described below.
Class description:
Implement the MultiHeadedAttention class.
Method signatures and docstrings:
- def __init__(self, h, d_model, dropout=0.1): Take in model size and number of heads.
- def forward(self, query, key, value, mask=None): Implements Figure ... | Implement the Python class `MultiHeadedAttention` described below.
Class description:
Implement the MultiHeadedAttention class.
Method signatures and docstrings:
- def __init__(self, h, d_model, dropout=0.1): Take in model size and number of heads.
- def forward(self, query, key, value, mask=None): Implements Figure ... | 2a5578577ce58786f05bb8701f2329b32ed6bb3a | <|skeleton|>
class MultiHeadedAttention:
def __init__(self, h, d_model, dropout=0.1):
"""Take in model size and number of heads."""
<|body_0|>
def forward(self, query, key, value, mask=None):
"""Implements Figure 2"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class MultiHeadedAttention:
def __init__(self, h, d_model, dropout=0.1):
"""Take in model size and number of heads."""
super(MultiHeadedAttention, self).__init__()
assert d_model % h == 0
self.d_k = d_model // h
self.h = h
self.linears = clones(nn.Linear(d_model, d_mo... | the_stack_v2_python_sparse | shapmagn/modules_reg/networks/dcp.py | dugushiyu/shapmagn | train | 0 | |
4b77679c72405a6ef08d434c4a0dbc27b114bf82 | [
"blob_info = getattr(model_instance, self.name)\nif blob_info is None:\n return None\nreturn blob_info.key()",
"if value is None:\n return None\nif isinstance(value, basestring):\n value = blobstore.BlobKey(value)\nreturn blobstore.BlobInfo(value)",
"if isinstance(value, basestring):\n value = blobs... | <|body_start_0|>
blob_info = getattr(model_instance, self.name)
if blob_info is None:
return None
return blob_info.key()
<|end_body_0|>
<|body_start_1|>
if value is None:
return None
if isinstance(value, basestring):
value = blobstore.BlobKey(... | Migrates pre-1.3.0 blob str props to real blobkey references. | MigratingBlobReferenceProperty | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class MigratingBlobReferenceProperty:
"""Migrates pre-1.3.0 blob str props to real blobkey references."""
def get_value_for_datastore(self, model_instance):
"""Translate model property to datastore value."""
<|body_0|>
def make_value_from_datastore(self, value):
"""Tra... | stack_v2_sparse_classes_36k_train_010222 | 24,849 | no_license | [
{
"docstring": "Translate model property to datastore value.",
"name": "get_value_for_datastore",
"signature": "def get_value_for_datastore(self, model_instance)"
},
{
"docstring": "Translate datastore value to BlobInfo.",
"name": "make_value_from_datastore",
"signature": "def make_value... | 3 | null | Implement the Python class `MigratingBlobReferenceProperty` described below.
Class description:
Migrates pre-1.3.0 blob str props to real blobkey references.
Method signatures and docstrings:
- def get_value_for_datastore(self, model_instance): Translate model property to datastore value.
- def make_value_from_datast... | Implement the Python class `MigratingBlobReferenceProperty` described below.
Class description:
Migrates pre-1.3.0 blob str props to real blobkey references.
Method signatures and docstrings:
- def get_value_for_datastore(self, model_instance): Translate model property to datastore value.
- def make_value_from_datast... | 0ac6653219c2701c13c508c5c4fc9bc3437eea06 | <|skeleton|>
class MigratingBlobReferenceProperty:
"""Migrates pre-1.3.0 blob str props to real blobkey references."""
def get_value_for_datastore(self, model_instance):
"""Translate model property to datastore value."""
<|body_0|>
def make_value_from_datastore(self, value):
"""Tra... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class MigratingBlobReferenceProperty:
"""Migrates pre-1.3.0 blob str props to real blobkey references."""
def get_value_for_datastore(self, model_instance):
"""Translate model property to datastore value."""
blob_info = getattr(model_instance, self.name)
if blob_info is None:
... | the_stack_v2_python_sparse | repoData/bradfitz-scanningcabinet/allPythonContent.py | aCoffeeYin/pyreco | train | 0 |
c4732d63492c06e01dbf9868ec7caaa1720a6817 | [
"self.posn_x = posn_x\nself.posn_y = posn_y\nself.velocity_x = velocity_x\nself.velocity_y = 100.0\nself.color = kula\nself.ball_width = 20.0\nself.ball_height = 20.0\nself.coef_restitution = 0.9",
"if self.posn_x > cw - self.ball_width:\n self.velocity_x = -self.velocity_x * self.coef_restitution\n self.po... | <|body_start_0|>
self.posn_x = posn_x
self.posn_y = posn_y
self.velocity_x = velocity_x
self.velocity_y = 100.0
self.color = kula
self.ball_width = 20.0
self.ball_height = 20.0
self.coef_restitution = 0.9
<|end_body_0|>
<|body_start_1|>
if self.po... | The behaviors and properties of bouncing balls. | BallBounce | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class BallBounce:
"""The behaviors and properties of bouncing balls."""
def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula):
"""Initialize values at instantiation."""
<|body_0|>
def detectWallCollision(self):
"""Collision detection with the walls of the co... | stack_v2_sparse_classes_36k_train_010223 | 4,695 | no_license | [
{
"docstring": "Initialize values at instantiation.",
"name": "__init__",
"signature": "def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula)"
},
{
"docstring": "Collision detection with the walls of the container",
"name": "detectWallCollision",
"signature": "def detectWallCo... | 3 | stack_v2_sparse_classes_30k_train_003358 | Implement the Python class `BallBounce` described below.
Class description:
The behaviors and properties of bouncing balls.
Method signatures and docstrings:
- def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula): Initialize values at instantiation.
- def detectWallCollision(self): Collision detection wit... | Implement the Python class `BallBounce` described below.
Class description:
The behaviors and properties of bouncing balls.
Method signatures and docstrings:
- def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula): Initialize values at instantiation.
- def detectWallCollision(self): Collision detection wit... | 0407c04c5776e0d38eaaba2331e9a7e5d962d653 | <|skeleton|>
class BallBounce:
"""The behaviors and properties of bouncing balls."""
def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula):
"""Initialize values at instantiation."""
<|body_0|>
def detectWallCollision(self):
"""Collision detection with the walls of the co... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class BallBounce:
"""The behaviors and properties of bouncing balls."""
def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula):
"""Initialize values at instantiation."""
self.posn_x = posn_x
self.posn_y = posn_y
self.velocity_x = velocity_x
self.velocity_y = 10... | the_stack_v2_python_sparse | ch2_prog7_ball_collisions_class_1.py | mikeodf/Python_Graphics_Animation | train | 3 |
675d4e518ae3f290c8cb4b43ee3cb9a048b1d0f7 | [
"self.base_path = base_path\nself.dic_list = dict()\nself.file_list = dict()\nself.get_list()",
"for base, dirs, files in os.walk(self.base_path):\n for d in dirs:\n fullname = os.path.join(base, d)\n self.dic_list.update({d: fullname})\n for f in files:\n fullname = os.path.join(base, ... | <|body_start_0|>
self.base_path = base_path
self.dic_list = dict()
self.file_list = dict()
self.get_list()
<|end_body_0|>
<|body_start_1|>
for base, dirs, files in os.walk(self.base_path):
for d in dirs:
fullname = os.path.join(base, d)
... | Attentions: details can be checked below | FilesFinder | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class FilesFinder:
"""Attentions: details can be checked below"""
def __init__(self, base_path):
"""Introduction ---------- Constructor Parameters ---------- base_path: The basic path"""
<|body_0|>
def get_list(self):
"""Introduction ---------- get all files, dictionar... | stack_v2_sparse_classes_36k_train_010224 | 2,380 | no_license | [
{
"docstring": "Introduction ---------- Constructor Parameters ---------- base_path: The basic path",
"name": "__init__",
"signature": "def __init__(self, base_path)"
},
{
"docstring": "Introduction ---------- get all files, dictionaries and store them into the dict",
"name": "get_list",
... | 3 | null | Implement the Python class `FilesFinder` described below.
Class description:
Attentions: details can be checked below
Method signatures and docstrings:
- def __init__(self, base_path): Introduction ---------- Constructor Parameters ---------- base_path: The basic path
- def get_list(self): Introduction ---------- get... | Implement the Python class `FilesFinder` described below.
Class description:
Attentions: details can be checked below
Method signatures and docstrings:
- def __init__(self, base_path): Introduction ---------- Constructor Parameters ---------- base_path: The basic path
- def get_list(self): Introduction ---------- get... | f37b870614edf7d85320da197d932df2f25a5720 | <|skeleton|>
class FilesFinder:
"""Attentions: details can be checked below"""
def __init__(self, base_path):
"""Introduction ---------- Constructor Parameters ---------- base_path: The basic path"""
<|body_0|>
def get_list(self):
"""Introduction ---------- get all files, dictionar... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class FilesFinder:
"""Attentions: details can be checked below"""
def __init__(self, base_path):
"""Introduction ---------- Constructor Parameters ---------- base_path: The basic path"""
self.base_path = base_path
self.dic_list = dict()
self.file_list = dict()
self.get_l... | the_stack_v2_python_sparse | 包亦航2018011890/操作系统实验作业/FilesFinder(Fourth_homework)/FilesFinder.py | wanghan79/2020_Option_System | train | 13 |
59e57acacef16f62e3f881f8e2877942152ec724 | [
"self.references = kwargs.pop('references', None)\n' References for folded spectrum calculation, or None for full diagonalization. \\n\\n In the first case, this is a tuple giving the two reference energies\\n (CBM and VBM) in eV.\\n '\nself.n = kwargs.pop('n', 5)\n' Maximum number of trial folded-... | <|body_start_0|>
self.references = kwargs.pop('references', None)
' References for folded spectrum calculation, or None for full diagonalization. \n\n In the first case, this is a tuple giving the two reference energies\n (CBM and VBM) in eV.\n '
self.n = kwargs.pop('n', 5)
... | Bandgap functional. Computes bandgap using either full diagonalization or two folded spectrum calculations. Performs some checking so that a non-zero band-gap is discored. see `bandgap` method. | Functional | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Functional:
"""Bandgap functional. Computes bandgap using either full diagonalization or two folded spectrum calculations. Performs some checking so that a non-zero band-gap is discored. see `bandgap` method."""
def __init__(self, *args, **kwargs):
"""Initializes an LDOS functional. ... | stack_v2_sparse_classes_36k_train_010225 | 21,073 | no_license | [
{
"docstring": "Initializes an LDOS functional. :param args: Any argument that works for `Escan`. :param kwargs: Any keyword argument that works for `Escan`.",
"name": "__init__",
"signature": "def __init__(self, *args, **kwargs)"
},
{
"docstring": "Computes band-gap. Parameters are passed on to... | 2 | stack_v2_sparse_classes_30k_train_005995 | Implement the Python class `Functional` described below.
Class description:
Bandgap functional. Computes bandgap using either full diagonalization or two folded spectrum calculations. Performs some checking so that a non-zero band-gap is discored. see `bandgap` method.
Method signatures and docstrings:
- def __init__... | Implement the Python class `Functional` described below.
Class description:
Bandgap functional. Computes bandgap using either full diagonalization or two folded spectrum calculations. Performs some checking so that a non-zero band-gap is discored. see `bandgap` method.
Method signatures and docstrings:
- def __init__... | 9c0ab667f94dc4629404a8ec99cbeaa323f0c8b3 | <|skeleton|>
class Functional:
"""Bandgap functional. Computes bandgap using either full diagonalization or two folded spectrum calculations. Performs some checking so that a non-zero band-gap is discored. see `bandgap` method."""
def __init__(self, *args, **kwargs):
"""Initializes an LDOS functional. ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Functional:
"""Bandgap functional. Computes bandgap using either full diagonalization or two folded spectrum calculations. Performs some checking so that a non-zero band-gap is discored. see `bandgap` method."""
def __init__(self, *args, **kwargs):
"""Initializes an LDOS functional. :param args: ... | the_stack_v2_python_sparse | escan/_bandgap.py | Shibu778/LaDa | train | 0 |
10618d8a39ddf338bb856a86dfe491a24df399fb | [
"super(LocationMultiAnnoReader, self).__init__(*args, **kwargs)\nself.location_indexes = []\nself.chromosome_list = []\nif 'chromosome_list' in kwargs.keys():\n self.chromosome_list = kwargs['chromosome_list']\nself.labels = [None, None, None]\nif 'label_chr' in kwargs.keys():\n self.labels[0] = kwargs['label... | <|body_start_0|>
super(LocationMultiAnnoReader, self).__init__(*args, **kwargs)
self.location_indexes = []
self.chromosome_list = []
if 'chromosome_list' in kwargs.keys():
self.chromosome_list = kwargs['chromosome_list']
self.labels = [None, None, None]
if 'la... | LocationMultiAnnoReader adds location data to a header. Wraps a table object associate a Location to the values. | LocationMultiAnnoReader | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class LocationMultiAnnoReader:
"""LocationMultiAnnoReader adds location data to a header. Wraps a table object associate a Location to the values."""
def __init__(self, *args, **kwargs):
"""__init__ creates a new LocationMultiAnnoReader."""
<|body_0|>
def next(self):
"... | stack_v2_sparse_classes_36k_train_010226 | 5,320 | permissive | [
{
"docstring": "__init__ creates a new LocationMultiAnnoReader.",
"name": "__init__",
"signature": "def __init__(self, *args, **kwargs)"
},
{
"docstring": "Return the next element.",
"name": "next",
"signature": "def next(self)"
}
] | 2 | stack_v2_sparse_classes_30k_train_012704 | Implement the Python class `LocationMultiAnnoReader` described below.
Class description:
LocationMultiAnnoReader adds location data to a header. Wraps a table object associate a Location to the values.
Method signatures and docstrings:
- def __init__(self, *args, **kwargs): __init__ creates a new LocationMultiAnnoRea... | Implement the Python class `LocationMultiAnnoReader` described below.
Class description:
LocationMultiAnnoReader adds location data to a header. Wraps a table object associate a Location to the values.
Method signatures and docstrings:
- def __init__(self, *args, **kwargs): __init__ creates a new LocationMultiAnnoRea... | bbf7ca288d798d8f1c6156ddf45fed31892bd557 | <|skeleton|>
class LocationMultiAnnoReader:
"""LocationMultiAnnoReader adds location data to a header. Wraps a table object associate a Location to the values."""
def __init__(self, *args, **kwargs):
"""__init__ creates a new LocationMultiAnnoReader."""
<|body_0|>
def next(self):
"... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class LocationMultiAnnoReader:
"""LocationMultiAnnoReader adds location data to a header. Wraps a table object associate a Location to the values."""
def __init__(self, *args, **kwargs):
"""__init__ creates a new LocationMultiAnnoReader."""
super(LocationMultiAnnoReader, self).__init__(*args, *... | the_stack_v2_python_sparse | table/Location/reader.py | DenverN3/Nimbus | train | 0 |
aae63d85692a785855c99db9fdba382ab24119eb | [
"count1 = 0\ncount2 = 0\ncount3 = 0\nfor i in range(len(nums)):\n if nums[i] == 0:\n count1 += 1\n elif nums[i] == 1:\n count2 += 1\n else:\n count3 += 1\nfor i in range(len(nums)):\n if i < count1:\n nums[i] = 0\n elif count1 <= i < count1 + count2:\n nums[i] = 1\n... | <|body_start_0|>
count1 = 0
count2 = 0
count3 = 0
for i in range(len(nums)):
if nums[i] == 0:
count1 += 1
elif nums[i] == 1:
count2 += 1
else:
count3 += 1
for i in range(len(nums)):
if... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def sortColors(self, nums: List[int]) -> None:
"""Do not return anything, modify nums in-place instead."""
<|body_0|>
def sortColors1(self, nums: List[int]) -> None:
"""单指针排序 :param nums: :return:"""
<|body_1|>
def sortColors2(self, nums: List[... | stack_v2_sparse_classes_36k_train_010227 | 2,482 | no_license | [
{
"docstring": "Do not return anything, modify nums in-place instead.",
"name": "sortColors",
"signature": "def sortColors(self, nums: List[int]) -> None"
},
{
"docstring": "单指针排序 :param nums: :return:",
"name": "sortColors1",
"signature": "def sortColors1(self, nums: List[int]) -> None"... | 3 | stack_v2_sparse_classes_30k_train_003876 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def sortColors(self, nums: List[int]) -> None: Do not return anything, modify nums in-place instead.
- def sortColors1(self, nums: List[int]) -> None: 单指针排序 :param nums: :return:... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def sortColors(self, nums: List[int]) -> None: Do not return anything, modify nums in-place instead.
- def sortColors1(self, nums: List[int]) -> None: 单指针排序 :param nums: :return:... | 9acba92695c06406f12f997a720bfe1deb9464a8 | <|skeleton|>
class Solution:
def sortColors(self, nums: List[int]) -> None:
"""Do not return anything, modify nums in-place instead."""
<|body_0|>
def sortColors1(self, nums: List[int]) -> None:
"""单指针排序 :param nums: :return:"""
<|body_1|>
def sortColors2(self, nums: List[... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def sortColors(self, nums: List[int]) -> None:
"""Do not return anything, modify nums in-place instead."""
count1 = 0
count2 = 0
count3 = 0
for i in range(len(nums)):
if nums[i] == 0:
count1 += 1
elif nums[i] == 1:
... | the_stack_v2_python_sparse | datastructure/array/SortColors.py | yinhuax/leet_code | train | 0 | |
baa248e41ea6f18df6c7aa3c048153763c0f80bb | [
"data = base_importData()\ndata.read_csv(filename)\ndata.format_data()\nself.add_sampleDescription(data.data)\ndata.clear_data()",
"data = base_importData()\ndata.read_csv(filename)\ndata.format_data()\nself.update_sampleDescription(data.data)\ndata.clear_data()",
"data_O = []\nfor sample_id in sample_ids_I:\n ... | <|body_start_0|>
data = base_importData()
data.read_csv(filename)
data.format_data()
self.add_sampleDescription(data.data)
data.clear_data()
<|end_body_0|>
<|body_start_1|>
data = base_importData()
data.read_csv(filename)
data.format_data()
self.u... | lims_sample_io | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class lims_sample_io:
def import_sampleDescription_add(self, filename):
"""table adds"""
<|body_0|>
def import_sampleDescription_update(self, filename):
"""table updates"""
<|body_1|>
def export_sampleStorage_csv(self, sample_ids_I, filename_O):
"""Exp... | stack_v2_sparse_classes_36k_train_010228 | 1,519 | permissive | [
{
"docstring": "table adds",
"name": "import_sampleDescription_add",
"signature": "def import_sampleDescription_add(self, filename)"
},
{
"docstring": "table updates",
"name": "import_sampleDescription_update",
"signature": "def import_sampleDescription_update(self, filename)"
},
{
... | 3 | stack_v2_sparse_classes_30k_train_021429 | Implement the Python class `lims_sample_io` described below.
Class description:
Implement the lims_sample_io class.
Method signatures and docstrings:
- def import_sampleDescription_add(self, filename): table adds
- def import_sampleDescription_update(self, filename): table updates
- def export_sampleStorage_csv(self,... | Implement the Python class `lims_sample_io` described below.
Class description:
Implement the lims_sample_io class.
Method signatures and docstrings:
- def import_sampleDescription_add(self, filename): table adds
- def import_sampleDescription_update(self, filename): table updates
- def export_sampleStorage_csv(self,... | 5dfd73689674953345d523178a67b8dda10e6d47 | <|skeleton|>
class lims_sample_io:
def import_sampleDescription_add(self, filename):
"""table adds"""
<|body_0|>
def import_sampleDescription_update(self, filename):
"""table updates"""
<|body_1|>
def export_sampleStorage_csv(self, sample_ids_I, filename_O):
"""Exp... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class lims_sample_io:
def import_sampleDescription_add(self, filename):
"""table adds"""
data = base_importData()
data.read_csv(filename)
data.format_data()
self.add_sampleDescription(data.data)
data.clear_data()
def import_sampleDescription_update(self, filename... | the_stack_v2_python_sparse | SBaaS_LIMS/lims_sample_io.py | dmccloskey/SBaaS_LIMS | train | 0 | |
1d241961d4ad5143937af7a637711ee23c1f7a96 | [
"super(CustomResNet152, self).__init__()\nself.dim = dim\nresnet = torchvision.models.resnet152(pretrained=True)\nmodules = list(resnet.children())[:-1]\nself.resnet = nn.Sequential(*modules)\nself.linear = nn.Linear(2048, self.dim)\nif train_resnet:\n for i, child in enumerate(self.resnet.children()):\n ... | <|body_start_0|>
super(CustomResNet152, self).__init__()
self.dim = dim
resnet = torchvision.models.resnet152(pretrained=True)
modules = list(resnet.children())[:-1]
self.resnet = nn.Sequential(*modules)
self.linear = nn.Linear(2048, self.dim)
if train_resnet:
... | Image encoder that computes both its image embedding and its convolutional feature map | CustomResNet152 | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class CustomResNet152:
"""Image encoder that computes both its image embedding and its convolutional feature map"""
def __init__(self, dim=1024, train_resnet=False):
"""Initializes image encoder based on ResNet :param dim: length of the UniVSE space embeddings :param train_resnet: sets bac... | stack_v2_sparse_classes_36k_train_010229 | 12,660 | no_license | [
{
"docstring": "Initializes image encoder based on ResNet :param dim: length of the UniVSE space embeddings :param train_resnet: sets backbone's weights as trainable if true",
"name": "__init__",
"signature": "def __init__(self, dim=1024, train_resnet=False)"
},
{
"docstring": "Initialize weight... | 3 | stack_v2_sparse_classes_30k_train_014191 | Implement the Python class `CustomResNet152` described below.
Class description:
Image encoder that computes both its image embedding and its convolutional feature map
Method signatures and docstrings:
- def __init__(self, dim=1024, train_resnet=False): Initializes image encoder based on ResNet :param dim: length of ... | Implement the Python class `CustomResNet152` described below.
Class description:
Image encoder that computes both its image embedding and its convolutional feature map
Method signatures and docstrings:
- def __init__(self, dim=1024, train_resnet=False): Initializes image encoder based on ResNet :param dim: length of ... | bc4fe571775e982975d6ecac82253e94de9dcd2b | <|skeleton|>
class CustomResNet152:
"""Image encoder that computes both its image embedding and its convolutional feature map"""
def __init__(self, dim=1024, train_resnet=False):
"""Initializes image encoder based on ResNet :param dim: length of the UniVSE space embeddings :param train_resnet: sets bac... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class CustomResNet152:
"""Image encoder that computes both its image embedding and its convolutional feature map"""
def __init__(self, dim=1024, train_resnet=False):
"""Initializes image encoder based on ResNet :param dim: length of the UniVSE space embeddings :param train_resnet: sets backbone's weigh... | the_stack_v2_python_sparse | models/simplified_univse/model.py | strategist922/UniVSE | train | 0 |
5a48304f499ede37fd6566713c351806ebb8f96a | [
"size = int(request.GET.get('size', 15))\npage = int(request.GET.get('page', 0))\npats_list = patient_svc.get_infolist()\ntotalelements = len(pats_list)\nif totalelements == 0:\n return ResponseDto(success=False, message='数据库无数据')\ntotalpages = int(math.ceil(float(totalelements) / float(size)))\ntotalpatients = ... | <|body_start_0|>
size = int(request.GET.get('size', 15))
page = int(request.GET.get('page', 0))
pats_list = patient_svc.get_infolist()
totalelements = len(pats_list)
if totalelements == 0:
return ResponseDto(success=False, message='数据库无数据')
totalpages = int(ma... | Patient | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Patient:
def get(self, request):
"""provide patients information list :param size:the number of data on the current page :param page:current page :return: information list"""
<|body_0|>
def delete(self, request):
"""provide patients information list :param size:the n... | stack_v2_sparse_classes_36k_train_010230 | 2,554 | no_license | [
{
"docstring": "provide patients information list :param size:the number of data on the current page :param page:current page :return: information list",
"name": "get",
"signature": "def get(self, request)"
},
{
"docstring": "provide patients information list :param size:the number of data on th... | 2 | stack_v2_sparse_classes_30k_train_013953 | Implement the Python class `Patient` described below.
Class description:
Implement the Patient class.
Method signatures and docstrings:
- def get(self, request): provide patients information list :param size:the number of data on the current page :param page:current page :return: information list
- def delete(self, r... | Implement the Python class `Patient` described below.
Class description:
Implement the Patient class.
Method signatures and docstrings:
- def get(self, request): provide patients information list :param size:the number of data on the current page :param page:current page :return: information list
- def delete(self, r... | d3206f29d37735b5cc393744faaa55295fe7d6b1 | <|skeleton|>
class Patient:
def get(self, request):
"""provide patients information list :param size:the number of data on the current page :param page:current page :return: information list"""
<|body_0|>
def delete(self, request):
"""provide patients information list :param size:the n... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Patient:
def get(self, request):
"""provide patients information list :param size:the number of data on the current page :param page:current page :return: information list"""
size = int(request.GET.get('size', 15))
page = int(request.GET.get('page', 0))
pats_list = patient_svc.... | the_stack_v2_python_sparse | back_end/apps/patient/views.py | yongweili1/portal | train | 0 | |
73a08a944039b4fc8c0b18c7f70d89221dee9841 | [
"_id = request.args.get('id', None)\nif not _id:\n return ({'msg': 'params error !'}, 400)\ntry:\n result = mongo_algo.db.algo_info.find_one({'_id': bson.ObjectId(_id)}, {'algo_performance': 1})\n if not result:\n return ({'msg': 'id is not exist !'}, 200)\nexcept Exception as e:\n logging.error(... | <|body_start_0|>
_id = request.args.get('id', None)
if not _id:
return ({'msg': 'params error !'}, 400)
try:
result = mongo_algo.db.algo_info.find_one({'_id': bson.ObjectId(_id)}, {'algo_performance': 1})
if not result:
return ({'msg': 'id is n... | AlgoPerformanceViews | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class AlgoPerformanceViews:
def get(self):
"""get one algo performance through id :return:"""
<|body_0|>
def post(self):
"""add an algo performance record :return:"""
<|body_1|>
def put(self):
"""update algo performance record :return:"""
<|bod... | stack_v2_sparse_classes_36k_train_010231 | 20,183 | no_license | [
{
"docstring": "get one algo performance through id :return:",
"name": "get",
"signature": "def get(self)"
},
{
"docstring": "add an algo performance record :return:",
"name": "post",
"signature": "def post(self)"
},
{
"docstring": "update algo performance record :return:",
"... | 3 | stack_v2_sparse_classes_30k_train_020506 | Implement the Python class `AlgoPerformanceViews` described below.
Class description:
Implement the AlgoPerformanceViews class.
Method signatures and docstrings:
- def get(self): get one algo performance through id :return:
- def post(self): add an algo performance record :return:
- def put(self): update algo perform... | Implement the Python class `AlgoPerformanceViews` described below.
Class description:
Implement the AlgoPerformanceViews class.
Method signatures and docstrings:
- def get(self): get one algo performance through id :return:
- def post(self): add an algo performance record :return:
- def put(self): update algo perform... | 054324b50e807d6f4e98f4a1b67afac9a0653b06 | <|skeleton|>
class AlgoPerformanceViews:
def get(self):
"""get one algo performance through id :return:"""
<|body_0|>
def post(self):
"""add an algo performance record :return:"""
<|body_1|>
def put(self):
"""update algo performance record :return:"""
<|bod... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class AlgoPerformanceViews:
def get(self):
"""get one algo performance through id :return:"""
_id = request.args.get('id', None)
if not _id:
return ({'msg': 'params error !'}, 400)
try:
result = mongo_algo.db.algo_info.find_one({'_id': bson.ObjectId(_id)}, {'a... | the_stack_v2_python_sparse | services/AlgoVersion/views.py | condilin/DMS | train | 0 | |
c2e08ad7a9b011d8d75b037d09501879b2bbb829 | [
"dict.__init__(self)\nself.context = context\nself[GTPL_CONDITION] = {}\nself.trace_id = (0, 'templates')\nreturn",
"self.trace_id = trace_dict[xml_templates_element]\nfor template_entry in xml_templates_element:\n template_type = template_entry.tag.split('}')[-1]\n if template_type != GTPL_CONDITION:\n ... | <|body_start_0|>
dict.__init__(self)
self.context = context
self[GTPL_CONDITION] = {}
self.trace_id = (0, 'templates')
return
<|end_body_0|>
<|body_start_1|>
self.trace_id = trace_dict[xml_templates_element]
for template_entry in xml_templates_element:
... | Dictionary of GEAR templates by type | GearTemplates | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class GearTemplates:
"""Dictionary of GEAR templates by type"""
def __init__(self, context):
"""Create the dictionary of GEAR templates Only condition templates are supported at this point"""
<|body_0|>
def read_from_xml(self, xml_templates_element, trace_dict):
"""Add... | stack_v2_sparse_classes_36k_train_010232 | 3,618 | no_license | [
{
"docstring": "Create the dictionary of GEAR templates Only condition templates are supported at this point",
"name": "__init__",
"signature": "def __init__(self, context)"
},
{
"docstring": "Add template info defined in an XML templates element",
"name": "read_from_xml",
"signature": "... | 3 | stack_v2_sparse_classes_30k_train_020207 | Implement the Python class `GearTemplates` described below.
Class description:
Dictionary of GEAR templates by type
Method signatures and docstrings:
- def __init__(self, context): Create the dictionary of GEAR templates Only condition templates are supported at this point
- def read_from_xml(self, xml_templates_elem... | Implement the Python class `GearTemplates` described below.
Class description:
Dictionary of GEAR templates by type
Method signatures and docstrings:
- def __init__(self, context): Create the dictionary of GEAR templates Only condition templates are supported at this point
- def read_from_xml(self, xml_templates_elem... | eba6c1489b503fdcf040a126942643b355867bcd | <|skeleton|>
class GearTemplates:
"""Dictionary of GEAR templates by type"""
def __init__(self, context):
"""Create the dictionary of GEAR templates Only condition templates are supported at this point"""
<|body_0|>
def read_from_xml(self, xml_templates_element, trace_dict):
"""Add... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class GearTemplates:
"""Dictionary of GEAR templates by type"""
def __init__(self, context):
"""Create the dictionary of GEAR templates Only condition templates are supported at this point"""
dict.__init__(self)
self.context = context
self[GTPL_CONDITION] = {}
self.trace... | the_stack_v2_python_sparse | src/ibm/teal/analyzer/gear/templates.py | ppjsand/pyteal | train | 1 |
5884d76564373e8c592cb06889b9bc8ecce3cccf | [
"helpline = data.get('helpline')\nusername = data.get('username')\nfirst_name = data.get('first_name')\nlast_name = data.get('last_name')\npassword = data.get('password')\nphone_no = data.get('phone_no')\nemail = data.get('email')\ngcm_canonical_id = data.get('gcm_canonical_id')\nhelper = Helper(gcm_canonical_id=gc... | <|body_start_0|>
helpline = data.get('helpline')
username = data.get('username')
first_name = data.get('first_name')
last_name = data.get('last_name')
password = data.get('password')
phone_no = data.get('phone_no')
email = data.get('email')
gcm_canonical_i... | Register call used to handle incoming call requests | RegisterHelper | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class RegisterHelper:
"""Register call used to handle incoming call requests"""
def register_call(self, data):
"""Register call handler"""
<|body_0|>
def post(self, request):
"""Post request handler"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
help... | stack_v2_sparse_classes_36k_train_010233 | 2,859 | no_license | [
{
"docstring": "Register call handler",
"name": "register_call",
"signature": "def register_call(self, data)"
},
{
"docstring": "Post request handler",
"name": "post",
"signature": "def post(self, request)"
}
] | 2 | stack_v2_sparse_classes_30k_train_006272 | Implement the Python class `RegisterHelper` described below.
Class description:
Register call used to handle incoming call requests
Method signatures and docstrings:
- def register_call(self, data): Register call handler
- def post(self, request): Post request handler | Implement the Python class `RegisterHelper` described below.
Class description:
Register call used to handle incoming call requests
Method signatures and docstrings:
- def register_call(self, data): Register call handler
- def post(self, request): Post request handler
<|skeleton|>
class RegisterHelper:
"""Regist... | 910ed40940d79f454a02b8553bb2ef76b99c1eaa | <|skeleton|>
class RegisterHelper:
"""Register call used to handle incoming call requests"""
def register_call(self, data):
"""Register call handler"""
<|body_0|>
def post(self, request):
"""Post request handler"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class RegisterHelper:
"""Register call used to handle incoming call requests"""
def register_call(self, data):
"""Register call handler"""
helpline = data.get('helpline')
username = data.get('username')
first_name = data.get('first_name')
last_name = data.get('last_name'... | the_stack_v2_python_sparse | register_helper/views.py | raj231992/helpline | train | 0 |
d11d8dcf65bca64afdb191aa0f74f6bb242330fd | [
"DebugObject.__init__(self, 'AntialiasingManager')\nself.pipeline = pipeline\nself.jitter = False\nself.jitterOffsets = []\nself.jitterIndex = 0\nself.jitterPTA = PTAVecBase2f.emptyArray(1)\nself.create()",
"technique = self.pipeline.settings.antialiasingTechnique\nif technique not in self.availableTechniques:\n ... | <|body_start_0|>
DebugObject.__init__(self, 'AntialiasingManager')
self.pipeline = pipeline
self.jitter = False
self.jitterOffsets = []
self.jitterIndex = 0
self.jitterPTA = PTAVecBase2f.emptyArray(1)
self.create()
<|end_body_0|>
<|body_start_1|>
techniqu... | The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame is moved by half a pixel up/down every second frame, and then merged with the previous... | AntialiasingManager | [
"WTFPL"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class AntialiasingManager:
"""The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame is moved by half a pixel up/down every ... | stack_v2_sparse_classes_36k_train_010234 | 3,455 | permissive | [
{
"docstring": "Creates the manager and directly setups the passes",
"name": "__init__",
"signature": "def __init__(self, pipeline)"
},
{
"docstring": "Setups the antialiasing passes, and also computes the jitter offsets",
"name": "create",
"signature": "def create(self)"
},
{
"d... | 3 | stack_v2_sparse_classes_30k_train_016749 | Implement the Python class `AntialiasingManager` described below.
Class description:
The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame ... | Implement the Python class `AntialiasingManager` described below.
Class description:
The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame ... | 12131b115775f97927633d71832af65b99eebd09 | <|skeleton|>
class AntialiasingManager:
"""The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame is moved by half a pixel up/down every ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class AntialiasingManager:
"""The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame is moved by half a pixel up/down every second frame,... | the_stack_v2_python_sparse | Code/AntialiasingManager.py | 2lost4u/RenderPipeline | train | 1 |
96362371067820cfb803329d38ccedc098fe7d59 | [
"try:\n return phonenumbers.format_number(obj, phonenumbers.PhoneNumberFormat.NATIONAL)\nexcept Exception as e:\n return None",
"try:\n obj = phonenumbers.parse(text, 'CA')\n return phonenumbers.format_number(obj, phonenumbers.PhoneNumberFormat.NATIONAL)\nexcept Exception as e:\n return None"
] | <|body_start_0|>
try:
return phonenumbers.format_number(obj, phonenumbers.PhoneNumberFormat.NATIONAL)
except Exception as e:
return None
<|end_body_0|>
<|body_start_1|>
try:
obj = phonenumbers.parse(text, 'CA')
return phonenumbers.format_number(ob... | Class used to convert the "PhoneNumber" objects "to" and "from" strings. This objects is from the "python-phonenumbers" library. | PhoneNumberField | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class PhoneNumberField:
"""Class used to convert the "PhoneNumber" objects "to" and "from" strings. This objects is from the "python-phonenumbers" library."""
def to_representation(self, obj):
"""Function used to convert the PhoneNumber object to text string representation."""
<|bo... | stack_v2_sparse_classes_36k_train_010235 | 1,880 | permissive | [
{
"docstring": "Function used to convert the PhoneNumber object to text string representation.",
"name": "to_representation",
"signature": "def to_representation(self, obj)"
},
{
"docstring": "Function used to conver the text into the PhoneNumber object representation.",
"name": "to_internal... | 2 | stack_v2_sparse_classes_30k_train_020795 | Implement the Python class `PhoneNumberField` described below.
Class description:
Class used to convert the "PhoneNumber" objects "to" and "from" strings. This objects is from the "python-phonenumbers" library.
Method signatures and docstrings:
- def to_representation(self, obj): Function used to convert the PhoneNum... | Implement the Python class `PhoneNumberField` described below.
Class description:
Class used to convert the "PhoneNumber" objects "to" and "from" strings. This objects is from the "python-phonenumbers" library.
Method signatures and docstrings:
- def to_representation(self, obj): Function used to convert the PhoneNum... | 98e1ff8bab7dda3492e5ff637bf5aafd111c840c | <|skeleton|>
class PhoneNumberField:
"""Class used to convert the "PhoneNumber" objects "to" and "from" strings. This objects is from the "python-phonenumbers" library."""
def to_representation(self, obj):
"""Function used to convert the PhoneNumber object to text string representation."""
<|bo... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class PhoneNumberField:
"""Class used to convert the "PhoneNumber" objects "to" and "from" strings. This objects is from the "python-phonenumbers" library."""
def to_representation(self, obj):
"""Function used to convert the PhoneNumber object to text string representation."""
try:
... | the_stack_v2_python_sparse | mikaponics/foundation/custom/drf/fields.py | mikaponics/mikaponics-back | train | 4 |
1e7c29db78f0b4829544f9f1b6266b4ecd83d4a3 | [
"if not telephone:\n raise ValueError(_('Users must have an telephone number'))\nuser = self.model(telephone=telephone, username=username, **other_fields)\nuser.is_admin = False\nif password:\n user.set_password(password)\nif is_save:\n user.save(using=self._db)\nreturn user",
"user = UserProfile.objects... | <|body_start_0|>
if not telephone:
raise ValueError(_('Users must have an telephone number'))
user = self.model(telephone=telephone, username=username, **other_fields)
user.is_admin = False
if password:
user.set_password(password)
if is_save:
u... | MyUserManager | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class MyUserManager:
def create_user(self, telephone, username, password=None, is_save=True, **other_fields):
"""Creates and saves a User with the given email, date of birth and password."""
<|body_0|>
def create_superuser(self, telephone, username, password=None, is_save=True, **... | stack_v2_sparse_classes_36k_train_010236 | 9,632 | no_license | [
{
"docstring": "Creates and saves a User with the given email, date of birth and password.",
"name": "create_user",
"signature": "def create_user(self, telephone, username, password=None, is_save=True, **other_fields)"
},
{
"docstring": "Creates and saves a superuser with the given email, date o... | 2 | null | Implement the Python class `MyUserManager` described below.
Class description:
Implement the MyUserManager class.
Method signatures and docstrings:
- def create_user(self, telephone, username, password=None, is_save=True, **other_fields): Creates and saves a User with the given email, date of birth and password.
- de... | Implement the Python class `MyUserManager` described below.
Class description:
Implement the MyUserManager class.
Method signatures and docstrings:
- def create_user(self, telephone, username, password=None, is_save=True, **other_fields): Creates and saves a User with the given email, date of birth and password.
- de... | 1fbb0941f26389cbfdc8015527ab0d426c2e2c01 | <|skeleton|>
class MyUserManager:
def create_user(self, telephone, username, password=None, is_save=True, **other_fields):
"""Creates and saves a User with the given email, date of birth and password."""
<|body_0|>
def create_superuser(self, telephone, username, password=None, is_save=True, **... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class MyUserManager:
def create_user(self, telephone, username, password=None, is_save=True, **other_fields):
"""Creates and saves a User with the given email, date of birth and password."""
if not telephone:
raise ValueError(_('Users must have an telephone number'))
user = self.... | the_stack_v2_python_sparse | apps/profiles/models.py | nerosketch/djing2 | train | 7 | |
e7793c39bfbc7784f5b46083c91631e167b8f899 | [
"self.name = name\nself._type_resolver = type_resolver\nself._implementation = None\nself._schema_name = schema_name\nself._arguments_coercer = arguments_coercer\nself._list_concurrently = list_concurrently\nself._parent_concurrently = parent_concurrently",
"if not self._implementation:\n raise MissingImplemen... | <|body_start_0|>
self.name = name
self._type_resolver = type_resolver
self._implementation = None
self._schema_name = schema_name
self._arguments_coercer = arguments_coercer
self._list_concurrently = list_concurrently
self._parent_concurrently = parent_concurrentl... | This decorator allows you to link a GraphQL Schema field to a resolver. For example, for the following SDL: type SomeObject { field: Int } Use the Resolver decorator the following way: @Resolver("SomeObject.field") async def field_resolver(parent, args, ctx, info): # do your stuff return 42 | Resolver | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Resolver:
"""This decorator allows you to link a GraphQL Schema field to a resolver. For example, for the following SDL: type SomeObject { field: Int } Use the Resolver decorator the following way: @Resolver("SomeObject.field") async def field_resolver(parent, args, ctx, info): # do your stuff re... | stack_v2_sparse_classes_36k_train_010237 | 4,384 | permissive | [
{
"docstring": ":param name: name of the field to wrap :param schema_name: name of the schema to which link the resolver :param type_resolver: callable to use to resolve the type of an abstract type :param arguments_coercer: the callable to use to coerce field arguments :param list_concurrently: whether or not ... | 3 | null | Implement the Python class `Resolver` described below.
Class description:
This decorator allows you to link a GraphQL Schema field to a resolver. For example, for the following SDL: type SomeObject { field: Int } Use the Resolver decorator the following way: @Resolver("SomeObject.field") async def field_resolver(paren... | Implement the Python class `Resolver` described below.
Class description:
This decorator allows you to link a GraphQL Schema field to a resolver. For example, for the following SDL: type SomeObject { field: Int } Use the Resolver decorator the following way: @Resolver("SomeObject.field") async def field_resolver(paren... | 421c1e937f553d6a5bf2f30154022c0d77053cfb | <|skeleton|>
class Resolver:
"""This decorator allows you to link a GraphQL Schema field to a resolver. For example, for the following SDL: type SomeObject { field: Int } Use the Resolver decorator the following way: @Resolver("SomeObject.field") async def field_resolver(parent, args, ctx, info): # do your stuff re... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Resolver:
"""This decorator allows you to link a GraphQL Schema field to a resolver. For example, for the following SDL: type SomeObject { field: Int } Use the Resolver decorator the following way: @Resolver("SomeObject.field") async def field_resolver(parent, args, ctx, info): # do your stuff return 42"""
... | the_stack_v2_python_sparse | tartiflette/resolver/resolver.py | tartiflette/tartiflette | train | 586 |
999f4fc1dba89cfcc622091f1aba0e987be9ca56 | [
"if value is None:\n return None\ntry:\n return arrow.get(value)\nexcept arrow.parser.ParserError:\n return None",
"new_value = self.parse(value)\nif new_value:\n locale = get_locale()\n return new_value.humanize(locale=locale)\nreturn _(str(value))"
] | <|body_start_0|>
if value is None:
return None
try:
return arrow.get(value)
except arrow.parser.ParserError:
return None
<|end_body_0|>
<|body_start_1|>
new_value = self.parse(value)
if new_value:
locale = get_locale()
... | Custom parser to display human readable times (like '1 hour ago') | DateTimeHuman | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class DateTimeHuman:
"""Custom parser to display human readable times (like '1 hour ago')"""
def parse(self, value):
"""Parse the value"""
<|body_0|>
def format(self, value):
"""Format the value"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
if value... | stack_v2_sparse_classes_36k_train_010238 | 2,860 | permissive | [
{
"docstring": "Parse the value",
"name": "parse",
"signature": "def parse(self, value)"
},
{
"docstring": "Format the value",
"name": "format",
"signature": "def format(self, value)"
}
] | 2 | stack_v2_sparse_classes_30k_train_012135 | Implement the Python class `DateTimeHuman` described below.
Class description:
Custom parser to display human readable times (like '1 hour ago')
Method signatures and docstrings:
- def parse(self, value): Parse the value
- def format(self, value): Format the value | Implement the Python class `DateTimeHuman` described below.
Class description:
Custom parser to display human readable times (like '1 hour ago')
Method signatures and docstrings:
- def parse(self, value): Parse the value
- def format(self, value): Format the value
<|skeleton|>
class DateTimeHuman:
"""Custom pars... | 2b8c6e09a4174f2ae3545fa048f59c55c4ae7dba | <|skeleton|>
class DateTimeHuman:
"""Custom parser to display human readable times (like '1 hour ago')"""
def parse(self, value):
"""Parse the value"""
<|body_0|>
def format(self, value):
"""Format the value"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class DateTimeHuman:
"""Custom parser to display human readable times (like '1 hour ago')"""
def parse(self, value):
"""Parse the value"""
if value is None:
return None
try:
return arrow.get(value)
except arrow.parser.ParserError:
return None
... | the_stack_v2_python_sparse | burpui/api/custom/my_fields.py | ziirish/burp-ui | train | 98 |
09fee9b0000bb00c14c0c3747ea4e910cc2f87f1 | [
"pt = self.preprocess(plain_text)\nblock_size = len(self.transposition_permutation)\nblocks, remainder = divmod(len(pt), block_size)\ncipher_text = []\nif remainder:\n num_pad_chars = block_size - remainder\n pad_chars = []\n for i in range(block_size - remainder):\n c = random.choice(self.pt_alphab... | <|body_start_0|>
pt = self.preprocess(plain_text)
block_size = len(self.transposition_permutation)
blocks, remainder = divmod(len(pt), block_size)
cipher_text = []
if remainder:
num_pad_chars = block_size - remainder
pad_chars = []
for i in ran... | A block transposition cipher moves the symbols in the plain text to other positions within a block of text and can be represented as a permutation of the symbols. This is a base class and does not define the permutation. | Block_Transposition_Cipher | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Block_Transposition_Cipher:
"""A block transposition cipher moves the symbols in the plain text to other positions within a block of text and can be represented as a permutation of the symbols. This is a base class and does not define the permutation."""
def encrypt(self, plain_text):
... | stack_v2_sparse_classes_36k_train_010239 | 14,483 | permissive | [
{
"docstring": "Encrypt using a transposition permutation.",
"name": "encrypt",
"signature": "def encrypt(self, plain_text)"
},
{
"docstring": "Decrypt a transposition permutation by calculating the inverse.",
"name": "decrypt",
"signature": "def decrypt(self, cipher_text)"
},
{
... | 3 | stack_v2_sparse_classes_30k_train_002911 | Implement the Python class `Block_Transposition_Cipher` described below.
Class description:
A block transposition cipher moves the symbols in the plain text to other positions within a block of text and can be represented as a permutation of the symbols. This is a base class and does not define the permutation.
Metho... | Implement the Python class `Block_Transposition_Cipher` described below.
Class description:
A block transposition cipher moves the symbols in the plain text to other positions within a block of text and can be represented as a permutation of the symbols. This is a base class and does not define the permutation.
Metho... | 33557ee2400790d2b1296a5913d587e6f5183533 | <|skeleton|>
class Block_Transposition_Cipher:
"""A block transposition cipher moves the symbols in the plain text to other positions within a block of text and can be represented as a permutation of the symbols. This is a base class and does not define the permutation."""
def encrypt(self, plain_text):
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Block_Transposition_Cipher:
"""A block transposition cipher moves the symbols in the plain text to other positions within a block of text and can be represented as a permutation of the symbols. This is a base class and does not define the permutation."""
def encrypt(self, plain_text):
"""Encrypt ... | the_stack_v2_python_sparse | code/cipher.py | CryptoUSF/Course-Material | train | 5 |
050e0eac70a48ec3c17f8fdf17c97a36455875a4 | [
"params = kwarg['params']\ncmd = 'tc class {} '.format(command)\nreturn cmd",
"params = kwarg['params']\ncmd = 'tc class {} '.format(command)\nreturn cmd"
] | <|body_start_0|>
params = kwarg['params']
cmd = 'tc class {} '.format(command)
return cmd
<|end_body_0|>
<|body_start_1|>
params = kwarg['params']
cmd = 'tc class {} '.format(command)
return cmd
<|end_body_1|>
| LinuxTcClassImpl | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class LinuxTcClassImpl:
def format_modify(self, command, *argv, **kwarg):
"""tc [ OPTIONS ] class [ add | change | replace | delete ] dev DEV parent qdisc-id [ classid class-id ] qdisc [ qdisc specific parameters ]"""
<|body_0|>
def format_show(self, command, *argv, **kwarg):
... | stack_v2_sparse_classes_36k_train_010240 | 785 | permissive | [
{
"docstring": "tc [ OPTIONS ] class [ add | change | replace | delete ] dev DEV parent qdisc-id [ classid class-id ] qdisc [ qdisc specific parameters ]",
"name": "format_modify",
"signature": "def format_modify(self, command, *argv, **kwarg)"
},
{
"docstring": "tc [ OPTIONS ] [ FORMAT ] class ... | 2 | null | Implement the Python class `LinuxTcClassImpl` described below.
Class description:
Implement the LinuxTcClassImpl class.
Method signatures and docstrings:
- def format_modify(self, command, *argv, **kwarg): tc [ OPTIONS ] class [ add | change | replace | delete ] dev DEV parent qdisc-id [ classid class-id ] qdisc [ qd... | Implement the Python class `LinuxTcClassImpl` described below.
Class description:
Implement the LinuxTcClassImpl class.
Method signatures and docstrings:
- def format_modify(self, command, *argv, **kwarg): tc [ OPTIONS ] class [ add | change | replace | delete ] dev DEV parent qdisc-id [ classid class-id ] qdisc [ qd... | e4c8221e18cd94e7424c30e12eb0fb82f7767267 | <|skeleton|>
class LinuxTcClassImpl:
def format_modify(self, command, *argv, **kwarg):
"""tc [ OPTIONS ] class [ add | change | replace | delete ] dev DEV parent qdisc-id [ classid class-id ] qdisc [ qdisc specific parameters ]"""
<|body_0|>
def format_show(self, command, *argv, **kwarg):
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class LinuxTcClassImpl:
def format_modify(self, command, *argv, **kwarg):
"""tc [ OPTIONS ] class [ add | change | replace | delete ] dev DEV parent qdisc-id [ classid class-id ] qdisc [ qdisc specific parameters ]"""
params = kwarg['params']
cmd = 'tc class {} '.format(command)
retu... | the_stack_v2_python_sparse | Amazon_Framework/DentOsTestbedLib/src/dent_os_testbed/lib/tc/linux/linux_tc_class_impl.py | tld3daniel/testing | train | 0 | |
a7c9ebf56214233f3bcfd9741afba74a23a0cdf3 | [
"self.r, self.j, self.Avv = (r, j, Avv)\nself.M, self.N = (M, N)\nself.lam = lam\nif dtd is None:\n self.dtd = np.eye(N)\nelse:\n self.dtd = dtd\nself.atol = atol\nself.rtol = rtol\node.__init__(self, self.geodesic_rhs, jac=None)\nself.set_initial_value(x, v)\node.set_integrator(self, 'vode', atol=atol, rtol=... | <|body_start_0|>
self.r, self.j, self.Avv = (r, j, Avv)
self.M, self.N = (M, N)
self.lam = lam
if dtd is None:
self.dtd = np.eye(N)
else:
self.dtd = dtd
self.atol = atol
self.rtol = rtol
ode.__init__(self, self.geodesic_rhs, jac=Non... | geodesic | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class geodesic:
def __init__(self, r, j, Avv, M, N, x, v, lam=0.0, dtd=None, atol=1e-06, rtol=1e-06, callback=None, parameterspacenorm=False, invSVD=False):
"""Construct an instance of the geodesic object r = function for calculating the model. This is not needed for the geodesic, but is used ... | stack_v2_sparse_classes_36k_train_010241 | 5,442 | permissive | [
{
"docstring": "Construct an instance of the geodesic object r = function for calculating the model. This is not needed for the geodesic, but is used to save the geodesic path in data space. Called as r(x) j = function for calculating the jacobian of the model with respect to parameters. Called as j(x) Avv = fu... | 5 | stack_v2_sparse_classes_30k_train_019669 | Implement the Python class `geodesic` described below.
Class description:
Implement the geodesic class.
Method signatures and docstrings:
- def __init__(self, r, j, Avv, M, N, x, v, lam=0.0, dtd=None, atol=1e-06, rtol=1e-06, callback=None, parameterspacenorm=False, invSVD=False): Construct an instance of the geodesic... | Implement the Python class `geodesic` described below.
Class description:
Implement the geodesic class.
Method signatures and docstrings:
- def __init__(self, r, j, Avv, M, N, x, v, lam=0.0, dtd=None, atol=1e-06, rtol=1e-06, callback=None, parameterspacenorm=False, invSVD=False): Construct an instance of the geodesic... | 5f7fe3a4dfe0e242eb175a6299b2e4eafbcbcd6f | <|skeleton|>
class geodesic:
def __init__(self, r, j, Avv, M, N, x, v, lam=0.0, dtd=None, atol=1e-06, rtol=1e-06, callback=None, parameterspacenorm=False, invSVD=False):
"""Construct an instance of the geodesic object r = function for calculating the model. This is not needed for the geodesic, but is used ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class geodesic:
def __init__(self, r, j, Avv, M, N, x, v, lam=0.0, dtd=None, atol=1e-06, rtol=1e-06, callback=None, parameterspacenorm=False, invSVD=False):
"""Construct an instance of the geodesic object r = function for calculating the model. This is not needed for the geodesic, but is used to save the ge... | the_stack_v2_python_sparse | MBAM/toy_model/geodesic.py | CardiacModelling/model-reduction-manifold-boundaries | train | 0 | |
09ceeff88db61da4ecf6a84878bedc5302bdf39a | [
"if self.request.version == 'v6':\n return ScanDetailsSerializerV6\nelif self.request.version == 'v7':\n return ScanDetailsSerializerV6",
"if request.version == 'v6':\n return self._post_v6(request, scan_id)\nelif request.version == 'v7':\n return self._post_v6(request, scan_id)\nraise Http404()",
"... | <|body_start_0|>
if self.request.version == 'v6':
return ScanDetailsSerializerV6
elif self.request.version == 'v7':
return ScanDetailsSerializerV6
<|end_body_0|>
<|body_start_1|>
if request.version == 'v6':
return self._post_v6(request, scan_id)
elif ... | This view is the endpoint for launching a scan execution to ingest | ScansProcessView | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ScansProcessView:
"""This view is the endpoint for launching a scan execution to ingest"""
def get_serializer_class(self):
"""Returns the appropriate serializer based off the requests version of the REST API."""
<|body_0|>
def post(self, request, scan_id=None):
"... | stack_v2_sparse_classes_36k_train_010242 | 30,689 | permissive | [
{
"docstring": "Returns the appropriate serializer based off the requests version of the REST API.",
"name": "get_serializer_class",
"signature": "def get_serializer_class(self)"
},
{
"docstring": "Launches a scan to ingest from an existing scan model instance :param request: the HTTP POST reque... | 3 | stack_v2_sparse_classes_30k_train_020948 | Implement the Python class `ScansProcessView` described below.
Class description:
This view is the endpoint for launching a scan execution to ingest
Method signatures and docstrings:
- def get_serializer_class(self): Returns the appropriate serializer based off the requests version of the REST API.
- def post(self, r... | Implement the Python class `ScansProcessView` described below.
Class description:
This view is the endpoint for launching a scan execution to ingest
Method signatures and docstrings:
- def get_serializer_class(self): Returns the appropriate serializer based off the requests version of the REST API.
- def post(self, r... | 28618aee07ceed9e4a6eb7b8d0e6f05b31d8fd6b | <|skeleton|>
class ScansProcessView:
"""This view is the endpoint for launching a scan execution to ingest"""
def get_serializer_class(self):
"""Returns the appropriate serializer based off the requests version of the REST API."""
<|body_0|>
def post(self, request, scan_id=None):
"... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ScansProcessView:
"""This view is the endpoint for launching a scan execution to ingest"""
def get_serializer_class(self):
"""Returns the appropriate serializer based off the requests version of the REST API."""
if self.request.version == 'v6':
return ScanDetailsSerializerV6
... | the_stack_v2_python_sparse | scale/ingest/views.py | kfconsultant/scale | train | 0 |
45a2b73b5b66b0059ee6dcbfeac393737c946a39 | [
"super().__init__(pos_enc_class)\nself.conv = nn.Sequential(Conv2D(1, odim, 3, 2), nn.ReLU(), Conv2D(odim, odim, 3, 2), nn.ReLU())\nself.out = nn.Sequential(Linear(odim * (((idim - 1) // 2 - 1) // 2), odim))\nself.subsampling_rate = 4\nself.right_context = 6",
"x = x.unsqueeze(1)\nx = self.conv(x)\nb, c, t, f = x... | <|body_start_0|>
super().__init__(pos_enc_class)
self.conv = nn.Sequential(Conv2D(1, odim, 3, 2), nn.ReLU(), Conv2D(odim, odim, 3, 2), nn.ReLU())
self.out = nn.Sequential(Linear(odim * (((idim - 1) // 2 - 1) // 2), odim))
self.subsampling_rate = 4
self.right_context = 6
<|end_bod... | Convolutional 2D subsampling (to 1/4 length). | Conv2dSubsampling4 | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Conv2dSubsampling4:
"""Convolutional 2D subsampling (to 1/4 length)."""
def __init__(self, idim: int, odim: int, dropout_rate: float, pos_enc_class: nn.Layer=PositionalEncoding):
"""Construct an Conv2dSubsampling4 object. Args: idim (int): Input dimension. odim (int): Output dimensio... | stack_v2_sparse_classes_36k_train_010243 | 11,942 | permissive | [
{
"docstring": "Construct an Conv2dSubsampling4 object. Args: idim (int): Input dimension. odim (int): Output dimension. dropout_rate (float): Dropout rate.",
"name": "__init__",
"signature": "def __init__(self, idim: int, odim: int, dropout_rate: float, pos_enc_class: nn.Layer=PositionalEncoding)"
},... | 2 | stack_v2_sparse_classes_30k_train_005112 | Implement the Python class `Conv2dSubsampling4` described below.
Class description:
Convolutional 2D subsampling (to 1/4 length).
Method signatures and docstrings:
- def __init__(self, idim: int, odim: int, dropout_rate: float, pos_enc_class: nn.Layer=PositionalEncoding): Construct an Conv2dSubsampling4 object. Args:... | Implement the Python class `Conv2dSubsampling4` described below.
Class description:
Convolutional 2D subsampling (to 1/4 length).
Method signatures and docstrings:
- def __init__(self, idim: int, odim: int, dropout_rate: float, pos_enc_class: nn.Layer=PositionalEncoding): Construct an Conv2dSubsampling4 object. Args:... | 17854a04d43c231eff66bfed9d6aa55e94a29e79 | <|skeleton|>
class Conv2dSubsampling4:
"""Convolutional 2D subsampling (to 1/4 length)."""
def __init__(self, idim: int, odim: int, dropout_rate: float, pos_enc_class: nn.Layer=PositionalEncoding):
"""Construct an Conv2dSubsampling4 object. Args: idim (int): Input dimension. odim (int): Output dimensio... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Conv2dSubsampling4:
"""Convolutional 2D subsampling (to 1/4 length)."""
def __init__(self, idim: int, odim: int, dropout_rate: float, pos_enc_class: nn.Layer=PositionalEncoding):
"""Construct an Conv2dSubsampling4 object. Args: idim (int): Input dimension. odim (int): Output dimension. dropout_ra... | the_stack_v2_python_sparse | paddlespeech/s2t/modules/subsampling.py | anniyanvr/DeepSpeech-1 | train | 0 |
c0efc8cedf5b9fcb7b80c80d531714cc44fb6991 | [
"def rserialize(root, string):\n \"\"\" a recursive helper function for the serialize() function.\"\"\"\n if root is None:\n string += 'None,'\n else:\n string += str(root.val) + ','\n string = rserialize(root.left, string)\n string = rserialize(root.right, string)\n return s... | <|body_start_0|>
def rserialize(root, string):
""" a recursive helper function for the serialize() function."""
if root is None:
string += 'None,'
else:
string += str(root.val) + ','
string = rserialize(root.left, string)
... | 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|>
def rserialize... | stack_v2_sparse_classes_36k_train_010244 | 2,432 | no_license | [
{
"docstring": "Encodes a tree to a single string.",
"name": "serialize",
"signature": "def serialize(self, root: TreeNode) -> str"
},
{
"docstring": "Decodes your encoded data to tree.",
"name": "deserialize",
"signature": "def deserialize(self, data: str) -> TreeNode"
}
] | 2 | stack_v2_sparse_classes_30k_train_004236 | 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... | 6f8cf45c785b7b3bfe0f379375da26d5324aad25 | <|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."""
def rserialize(root, string):
""" a recursive helper function for the serialize() function."""
if root is None:
string += 'None,'
else:
... | the_stack_v2_python_sparse | Grokking/SystemDesign/449. Serialize and Deserialize BST.py | yash-bhat/Leetcode | train | 3 | |
582808c00a4b32590148ba7b0e18bf6c50edeac5 | [
"self.positives = set()\nself.negatives = set()\nwith open(positives) as p:\n for line in p:\n if line.startswith(';') or line.startswith(' '):\n continue\n else:\n self.positives.add(line.rstrip('\\n'))\n p.close()\nwith open(negatives) as n:\n for line in n:\n i... | <|body_start_0|>
self.positives = set()
self.negatives = set()
with open(positives) as p:
for line in p:
if line.startswith(';') or line.startswith(' '):
continue
else:
self.positives.add(line.rstrip('\n'))
... | Implements sentiment analysis. | Analyzer | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Analyzer:
"""Implements sentiment analysis."""
def __init__(self, positives, negatives):
"""Initialize Analyzer."""
<|body_0|>
def analyze(self, text):
"""Analyze text for sentiment, returning its score."""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
... | stack_v2_sparse_classes_36k_train_010245 | 1,568 | no_license | [
{
"docstring": "Initialize Analyzer.",
"name": "__init__",
"signature": "def __init__(self, positives, negatives)"
},
{
"docstring": "Analyze text for sentiment, returning its score.",
"name": "analyze",
"signature": "def analyze(self, text)"
}
] | 2 | stack_v2_sparse_classes_30k_train_003676 | Implement the Python class `Analyzer` described below.
Class description:
Implements sentiment analysis.
Method signatures and docstrings:
- def __init__(self, positives, negatives): Initialize Analyzer.
- def analyze(self, text): Analyze text for sentiment, returning its score. | Implement the Python class `Analyzer` described below.
Class description:
Implements sentiment analysis.
Method signatures and docstrings:
- def __init__(self, positives, negatives): Initialize Analyzer.
- def analyze(self, text): Analyze text for sentiment, returning its score.
<|skeleton|>
class Analyzer:
"""I... | 776f65777bd1710e53ce6f834f00b89aa1464348 | <|skeleton|>
class Analyzer:
"""Implements sentiment analysis."""
def __init__(self, positives, negatives):
"""Initialize Analyzer."""
<|body_0|>
def analyze(self, text):
"""Analyze text for sentiment, returning its score."""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Analyzer:
"""Implements sentiment analysis."""
def __init__(self, positives, negatives):
"""Initialize Analyzer."""
self.positives = set()
self.negatives = set()
with open(positives) as p:
for line in p:
if line.startswith(';') or line.startswit... | the_stack_v2_python_sparse | cs50/pset6/sentiments/analyzer.py | zachgoll/finance_to_code | train | 2 |
c5e0746e7b51dab290319968bcf8b9c895c9b852 | [
"if names is not None:\n names = names.split(',')\n for index, name in enumerate(names):\n names[index] = name.strip()\n queryset = queryset.filter(name__in=names)\nreturn queryset",
"queryset = Container.objects.all().order_by('name')\nnames = self.request.query_params.get('names', None)\nfiltere... | <|body_start_0|>
if names is not None:
names = names.split(',')
for index, name in enumerate(names):
names[index] = name.strip()
queryset = queryset.filter(name__in=names)
return queryset
<|end_body_0|>
<|body_start_1|>
queryset = Container.ob... | REST API for Containers. | ContainerViewSet | [
"LicenseRef-scancode-proprietary-license",
"GPL-3.0-only",
"LicenseRef-scancode-unknown-license-reference",
"GPL-1.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-copyleft",
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ContainerViewSet:
"""REST API for Containers."""
def _filter_by_names(queryset, names):
"""Takes a Queryset of Containers and a comma-separated list of Container names. Returns a filtered Queryset containing only the Containers listed."""
<|body_0|>
def _get_data_by_name... | stack_v2_sparse_classes_36k_train_010246 | 4,275 | permissive | [
{
"docstring": "Takes a Queryset of Containers and a comma-separated list of Container names. Returns a filtered Queryset containing only the Containers listed.",
"name": "_filter_by_names",
"signature": "def _filter_by_names(queryset, names)"
},
{
"docstring": "Takes a REST API request with an ... | 4 | stack_v2_sparse_classes_30k_test_000050 | Implement the Python class `ContainerViewSet` described below.
Class description:
REST API for Containers.
Method signatures and docstrings:
- def _filter_by_names(queryset, names): Takes a Queryset of Containers and a comma-separated list of Container names. Returns a filtered Queryset containing only the Containers... | Implement the Python class `ContainerViewSet` described below.
Class description:
REST API for Containers.
Method signatures and docstrings:
- def _filter_by_names(queryset, names): Takes a Queryset of Containers and a comma-separated list of Container names. Returns a filtered Queryset containing only the Containers... | a379a134c0c5af14df4ed2afa066c1626506b754 | <|skeleton|>
class ContainerViewSet:
"""REST API for Containers."""
def _filter_by_names(queryset, names):
"""Takes a Queryset of Containers and a comma-separated list of Container names. Returns a filtered Queryset containing only the Containers listed."""
<|body_0|>
def _get_data_by_name... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ContainerViewSet:
"""REST API for Containers."""
def _filter_by_names(queryset, names):
"""Takes a Queryset of Containers and a comma-separated list of Container names. Returns a filtered Queryset containing only the Containers listed."""
if names is not None:
names = names.sp... | the_stack_v2_python_sparse | Incident-Response/Tools/cyphon/cyphon/bottler/containers/views.py | foss2cyber/Incident-Playbook | train | 1 |
f800ad07d75cf146835dd03fa624eee9d9b54cea | [
"results = []\nfor arg in self.arguments:\n if arg.mention != None:\n results.append(arg)\nreturn results",
"results = []\nfor arg in self.arguments:\n if arg.value_mention != None:\n results.append(arg)\nreturn results"
] | <|body_start_0|>
results = []
for arg in self.arguments:
if arg.mention != None:
results.append(arg)
return results
<|end_body_0|>
<|body_start_1|>
results = []
for arg in self.arguments:
if arg.value_mention != None:
resul... | SerifEventMentionTheory | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SerifEventMentionTheory:
def mention_arguments(self):
"""Returns a list of just the Mention arguments in this EventMention"""
<|body_0|>
def value_mention_arguments(self):
"""Returns a list of just the ValueMention arguments in this EventMention"""
<|body_1|>... | stack_v2_sparse_classes_36k_train_010247 | 666 | permissive | [
{
"docstring": "Returns a list of just the Mention arguments in this EventMention",
"name": "mention_arguments",
"signature": "def mention_arguments(self)"
},
{
"docstring": "Returns a list of just the ValueMention arguments in this EventMention",
"name": "value_mention_arguments",
"sign... | 2 | null | Implement the Python class `SerifEventMentionTheory` described below.
Class description:
Implement the SerifEventMentionTheory class.
Method signatures and docstrings:
- def mention_arguments(self): Returns a list of just the Mention arguments in this EventMention
- def value_mention_arguments(self): Returns a list o... | Implement the Python class `SerifEventMentionTheory` described below.
Class description:
Implement the SerifEventMentionTheory class.
Method signatures and docstrings:
- def mention_arguments(self): Returns a list of just the Mention arguments in this EventMention
- def value_mention_arguments(self): Returns a list o... | b486a66339a330e94d81850e6acb3a7e34df746e | <|skeleton|>
class SerifEventMentionTheory:
def mention_arguments(self):
"""Returns a list of just the Mention arguments in this EventMention"""
<|body_0|>
def value_mention_arguments(self):
"""Returns a list of just the ValueMention arguments in this EventMention"""
<|body_1|>... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SerifEventMentionTheory:
def mention_arguments(self):
"""Returns a list of just the Mention arguments in this EventMention"""
results = []
for arg in self.arguments:
if arg.mention != None:
results.append(arg)
return results
def value_mention_ar... | the_stack_v2_python_sparse | src/python/serif/theory/serif_event_mention_theory.py | BBN-E/text-open | train | 2 | |
6510d25e3ea6fd49a9e769d1be2b267e0b0585af | [
"if len(s) == 0:\n return True\nnew_s = ''.join((i.lower for i in s if i.isalnum()))\nif new_s == new_s[::-1]:\n return True\nelse:\n return False",
"if len(s) == 0:\n return True\nnew_s = re.sub('[^A-Za-z0-9]', '', s)\nreturn s == s[::-1]"
] | <|body_start_0|>
if len(s) == 0:
return True
new_s = ''.join((i.lower for i in s if i.isalnum()))
if new_s == new_s[::-1]:
return True
else:
return False
<|end_body_0|>
<|body_start_1|>
if len(s) == 0:
return True
new_s = r... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def isPalindrome(self, s):
""":type s: str :rtype: bool"""
<|body_0|>
def isPalindrome(self, s):
""":type s: str :rtype: bool"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
if len(s) == 0:
return True
new_s = ''.join((... | stack_v2_sparse_classes_36k_train_010248 | 1,110 | no_license | [
{
"docstring": ":type s: str :rtype: bool",
"name": "isPalindrome",
"signature": "def isPalindrome(self, s)"
},
{
"docstring": ":type s: str :rtype: bool",
"name": "isPalindrome",
"signature": "def isPalindrome(self, s)"
}
] | 2 | stack_v2_sparse_classes_30k_train_007035 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def isPalindrome(self, s): :type s: str :rtype: bool
- def isPalindrome(self, s): :type s: str :rtype: bool | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def isPalindrome(self, s): :type s: str :rtype: bool
- def isPalindrome(self, s): :type s: str :rtype: bool
<|skeleton|>
class Solution:
def isPalindrome(self, s):
... | 604efd2c53c369fb262f42f7f7f31997ea4d029b | <|skeleton|>
class Solution:
def isPalindrome(self, s):
""":type s: str :rtype: bool"""
<|body_0|>
def isPalindrome(self, s):
""":type s: str :rtype: bool"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def isPalindrome(self, s):
""":type s: str :rtype: bool"""
if len(s) == 0:
return True
new_s = ''.join((i.lower for i in s if i.isalnum()))
if new_s == new_s[::-1]:
return True
else:
return False
def isPalindrome(self, ... | the_stack_v2_python_sparse | 125_Valid_Palindrome.py | fxy1018/Leetcode | train | 1 | |
e7ea4bd120e44b424738867167b890c97349557a | [
"super(Trainer, self).__init__(model, optimizer, resume, config, helios_run, experiment_folder)\nself.config = config\nsplit = config['data']['dataloader'].get('split', 0.9)\nsplitter = SplitDataset(split)\ntrain_set, valid_set = splitter(unlabelled)\ntrain_loader = DataLoader(dataset=train_set, **config['data']['d... | <|body_start_0|>
super(Trainer, self).__init__(model, optimizer, resume, config, helios_run, experiment_folder)
self.config = config
split = config['data']['dataloader'].get('split', 0.9)
splitter = SplitDataset(split)
train_set, valid_set = splitter(unlabelled)
train_loa... | Trainer class Note: Inherited from BaseTrainer. | Trainer | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Trainer:
"""Trainer class Note: Inherited from BaseTrainer."""
def __init__(self, model, optimizer, resume, config, unlabelled, helios_run, experiment_folder=None, **kwargs):
"""Initialize the trainer. :param model: model to train. :param optimizer: optimizer to use for training. :pa... | stack_v2_sparse_classes_36k_train_010249 | 5,895 | no_license | [
{
"docstring": "Initialize the trainer. :param model: model to train. :param optimizer: optimizer to use for training. :param resume: path to a checkpoint to resume training. :param config: dictionary containing the configuration. :param unlabelled: unlabelled dataset to use for training the AE. :param helios_r... | 3 | stack_v2_sparse_classes_30k_train_008155 | Implement the Python class `Trainer` described below.
Class description:
Trainer class Note: Inherited from BaseTrainer.
Method signatures and docstrings:
- def __init__(self, model, optimizer, resume, config, unlabelled, helios_run, experiment_folder=None, **kwargs): Initialize the trainer. :param model: model to tr... | Implement the Python class `Trainer` described below.
Class description:
Trainer class Note: Inherited from BaseTrainer.
Method signatures and docstrings:
- def __init__(self, model, optimizer, resume, config, unlabelled, helios_run, experiment_folder=None, **kwargs): Initialize the trainer. :param model: model to tr... | 7979099152f6d509bac4aa0dab1660988b6388ac | <|skeleton|>
class Trainer:
"""Trainer class Note: Inherited from BaseTrainer."""
def __init__(self, model, optimizer, resume, config, unlabelled, helios_run, experiment_folder=None, **kwargs):
"""Initialize the trainer. :param model: model to train. :param optimizer: optimizer to use for training. :pa... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Trainer:
"""Trainer class Note: Inherited from BaseTrainer."""
def __init__(self, model, optimizer, resume, config, unlabelled, helios_run, experiment_folder=None, **kwargs):
"""Initialize the trainer. :param model: model to train. :param optimizer: optimizer to use for training. :param resume: p... | the_stack_v2_python_sparse | trainer/trainer.py | josephdviviano/horoma | train | 1 |
bbc8bbe5f3b378a00afdf8535dae35e8e71d68f1 | [
"ledger_list = [u'业务管理', u'渠道资源管理', u'台账管理']\nself.click_button_for_one(ledger_list[0])\nsleep(2)\nself.click_more_button_for_one(ledger_list[1:])\nsleep(2)",
"if ledger_list[0] != u'':\n self.input_text_message_for_inside_text(u'请输入仓库名称', ledger_list[0])\nif ledger_list[1] != u'':\n self.click_option_by_in... | <|body_start_0|>
ledger_list = [u'业务管理', u'渠道资源管理', u'台账管理']
self.click_button_for_one(ledger_list[0])
sleep(2)
self.click_more_button_for_one(ledger_list[1:])
sleep(2)
<|end_body_0|>
<|body_start_1|>
if ledger_list[0] != u'':
self.input_text_message_for_insi... | 台账管理页面 | LedgerManagePage | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class LedgerManagePage:
"""台账管理页面"""
def open_ledger_manage(self):
"""打开台账管理页面"""
<|body_0|>
def input_ledger_search_info(self, ledger_list):
"""输入账单查询信息"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
ledger_list = [u'业务管理', u'渠道资源管理', u'台账管理']
... | stack_v2_sparse_classes_36k_train_010250 | 1,255 | no_license | [
{
"docstring": "打开台账管理页面",
"name": "open_ledger_manage",
"signature": "def open_ledger_manage(self)"
},
{
"docstring": "输入账单查询信息",
"name": "input_ledger_search_info",
"signature": "def input_ledger_search_info(self, ledger_list)"
}
] | 2 | null | Implement the Python class `LedgerManagePage` described below.
Class description:
台账管理页面
Method signatures and docstrings:
- def open_ledger_manage(self): 打开台账管理页面
- def input_ledger_search_info(self, ledger_list): 输入账单查询信息 | Implement the Python class `LedgerManagePage` described below.
Class description:
台账管理页面
Method signatures and docstrings:
- def open_ledger_manage(self): 打开台账管理页面
- def input_ledger_search_info(self, ledger_list): 输入账单查询信息
<|skeleton|>
class LedgerManagePage:
"""台账管理页面"""
def open_ledger_manage(self):
... | dcae68955b2857bbfe411145432865c57561c9ef | <|skeleton|>
class LedgerManagePage:
"""台账管理页面"""
def open_ledger_manage(self):
"""打开台账管理页面"""
<|body_0|>
def input_ledger_search_info(self, ledger_list):
"""输入账单查询信息"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class LedgerManagePage:
"""台账管理页面"""
def open_ledger_manage(self):
"""打开台账管理页面"""
ledger_list = [u'业务管理', u'渠道资源管理', u'台账管理']
self.click_button_for_one(ledger_list[0])
sleep(2)
self.click_more_button_for_one(ledger_list[1:])
sleep(2)
def input_ledger_search_... | the_stack_v2_python_sparse | genlot_vlt2/pages/Business_management/channel_resource_manage_page/channel_resource_manage_ledger_manage_page.py | bbwdi/auto | train | 1 |
c6af805e58d0e90f5167fd51297b52aa2adc3675 | [
"context = aq_inner(self.context)\nobject = IUpload(self.context)\nreturn object.upload()",
"context = aq_inner(self.context)\nobject = ISave(self.context)\nreturn object.save(text, fieldname)"
] | <|body_start_0|>
context = aq_inner(self.context)
object = IUpload(self.context)
return object.upload()
<|end_body_0|>
<|body_start_1|>
context = aq_inner(self.context)
object = ISave(self.context)
return object.save(text, fieldname)
<|end_body_1|>
| Connect Browser View | ConnectBrowserView | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ConnectBrowserView:
"""Connect Browser View"""
def upload(self):
"""Upload a file to the zodb"""
<|body_0|>
def save(self, text, fieldname):
"""Saves the specified richedit field"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
context = aq_inner... | stack_v2_sparse_classes_36k_train_010251 | 742 | no_license | [
{
"docstring": "Upload a file to the zodb",
"name": "upload",
"signature": "def upload(self)"
},
{
"docstring": "Saves the specified richedit field",
"name": "save",
"signature": "def save(self, text, fieldname)"
}
] | 2 | stack_v2_sparse_classes_30k_train_011463 | Implement the Python class `ConnectBrowserView` described below.
Class description:
Connect Browser View
Method signatures and docstrings:
- def upload(self): Upload a file to the zodb
- def save(self, text, fieldname): Saves the specified richedit field | Implement the Python class `ConnectBrowserView` described below.
Class description:
Connect Browser View
Method signatures and docstrings:
- def upload(self): Upload a file to the zodb
- def save(self, text, fieldname): Saves the specified richedit field
<|skeleton|>
class ConnectBrowserView:
"""Connect Browser ... | bc003d10ed15d6ecc5f15fdb3809e9dd53b568bd | <|skeleton|>
class ConnectBrowserView:
"""Connect Browser View"""
def upload(self):
"""Upload a file to the zodb"""
<|body_0|>
def save(self, text, fieldname):
"""Saves the specified richedit field"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ConnectBrowserView:
"""Connect Browser View"""
def upload(self):
"""Upload a file to the zodb"""
context = aq_inner(self.context)
object = IUpload(self.context)
return object.upload()
def save(self, text, fieldname):
"""Saves the specified richedit field"""
... | the_stack_v2_python_sparse | jalon.connect/jalon/connect/browser/browser.py | suipnice/Jalon | train | 0 |
d603ab78096a1feef099faa888d181caaa7b1781 | [
"response = self.testapp.get(feconf.CONTRIBUTE_GALLERY_URL)\nself.assertEqual(response.status_int, 302)\nself.assertEqual(response.location, self.get_expected_login_url(feconf.CONTRIBUTE_GALLERY_URL))\nself.login('editor@example.com')\nresponse = self.testapp.get(feconf.CONTRIBUTE_GALLERY_URL)\nself.assertEqual(res... | <|body_start_0|>
response = self.testapp.get(feconf.CONTRIBUTE_GALLERY_URL)
self.assertEqual(response.status_int, 302)
self.assertEqual(response.location, self.get_expected_login_url(feconf.CONTRIBUTE_GALLERY_URL))
self.login('editor@example.com')
response = self.testapp.get(feco... | ContributeGalleryTest | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ContributeGalleryTest:
def test_contribute_gallery_page(self):
"""Test access to the contributors' gallery page."""
<|body_0|>
def test_contribute_gallery_handler(self):
"""Test the contribute gallery data handler."""
<|body_1|>
def test_exploration_uplo... | stack_v2_sparse_classes_36k_train_010252 | 23,453 | permissive | [
{
"docstring": "Test access to the contributors' gallery page.",
"name": "test_contribute_gallery_page",
"signature": "def test_contribute_gallery_page(self)"
},
{
"docstring": "Test the contribute gallery data handler.",
"name": "test_contribute_gallery_handler",
"signature": "def test_... | 3 | stack_v2_sparse_classes_30k_test_000851 | Implement the Python class `ContributeGalleryTest` described below.
Class description:
Implement the ContributeGalleryTest class.
Method signatures and docstrings:
- def test_contribute_gallery_page(self): Test access to the contributors' gallery page.
- def test_contribute_gallery_handler(self): Test the contribute ... | Implement the Python class `ContributeGalleryTest` described below.
Class description:
Implement the ContributeGalleryTest class.
Method signatures and docstrings:
- def test_contribute_gallery_page(self): Test access to the contributors' gallery page.
- def test_contribute_gallery_handler(self): Test the contribute ... | aead304c95a282c9ca8035bc25c4794864d07578 | <|skeleton|>
class ContributeGalleryTest:
def test_contribute_gallery_page(self):
"""Test access to the contributors' gallery page."""
<|body_0|>
def test_contribute_gallery_handler(self):
"""Test the contribute gallery data handler."""
<|body_1|>
def test_exploration_uplo... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ContributeGalleryTest:
def test_contribute_gallery_page(self):
"""Test access to the contributors' gallery page."""
response = self.testapp.get(feconf.CONTRIBUTE_GALLERY_URL)
self.assertEqual(response.status_int, 302)
self.assertEqual(response.location, self.get_expected_login_... | the_stack_v2_python_sparse | core/controllers/galleries_test.py | aldeka/oppia | train | 3 | |
9d17cc3bafec477922414c1a137c623dd57c6d9d | [
"msg = MIMEMultipart('alternative')\nmsg['Subject'] = message['subject']\nmsg['From'] = message['sender']\nmsg['To'] = ', '.join(message['receivers'])\nmsg.attach(MIMEText(message['body'], 'html'))\ns = aiosmtplib.SMTP(hostname=EMAIL_HOST, port=EMAIL_PORT, loop=loop)\ntry:\n await s.connect()\n await s.login(... | <|body_start_0|>
msg = MIMEMultipart('alternative')
msg['Subject'] = message['subject']
msg['From'] = message['sender']
msg['To'] = ', '.join(message['receivers'])
msg.attach(MIMEText(message['body'], 'html'))
s = aiosmtplib.SMTP(hostname=EMAIL_HOST, port=EMAIL_PORT, loop... | Отправка электронной почты Отправка вложений пока не поддерживается | Email | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Email:
"""Отправка электронной почты Отправка вложений пока не поддерживается"""
async def send_html_email(message):
"""Отправка писем в формате HTML"""
<|body_0|>
async def send(self, message_body):
"""Отправка письма :param message_body: строка с json-описанием... | stack_v2_sparse_classes_36k_train_010253 | 3,463 | no_license | [
{
"docstring": "Отправка писем в формате HTML",
"name": "send_html_email",
"signature": "async def send_html_email(message)"
},
{
"docstring": "Отправка письма :param message_body: строка с json-описанием сообщения",
"name": "send",
"signature": "async def send(self, message_body)"
}
] | 2 | stack_v2_sparse_classes_30k_train_010278 | Implement the Python class `Email` described below.
Class description:
Отправка электронной почты Отправка вложений пока не поддерживается
Method signatures and docstrings:
- async def send_html_email(message): Отправка писем в формате HTML
- async def send(self, message_body): Отправка письма :param message_body: ст... | Implement the Python class `Email` described below.
Class description:
Отправка электронной почты Отправка вложений пока не поддерживается
Method signatures and docstrings:
- async def send_html_email(message): Отправка писем в формате HTML
- async def send(self, message_body): Отправка письма :param message_body: ст... | 8c0e8fa16588fc384979b9514d3d716713c6ea83 | <|skeleton|>
class Email:
"""Отправка электронной почты Отправка вложений пока не поддерживается"""
async def send_html_email(message):
"""Отправка писем в формате HTML"""
<|body_0|>
async def send(self, message_body):
"""Отправка письма :param message_body: строка с json-описанием... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Email:
"""Отправка электронной почты Отправка вложений пока не поддерживается"""
async def send_html_email(message):
"""Отправка писем в формате HTML"""
msg = MIMEMultipart('alternative')
msg['Subject'] = message['subject']
msg['From'] = message['sender']
msg['To']... | the_stack_v2_python_sparse | bus/handlers/email/email_handler.py | skushnerchuk/kip | train | 0 |
80e87a64aa6af33391e0055c54ed2c85cad2af2b | [
"SegmentSimMeasurement.__init__(self, source_segment, target_segment)\nself.sequence_type = sequence_type\nself.ne_disambiguation = ne_disambiguation",
"mode = 'manual' if self.sequence_type == 'manual' else 'default'\ns1_ne_syns = [token for token in self.source_segment.get_instances('ne_syn_' + mode, 'content')... | <|body_start_0|>
SegmentSimMeasurement.__init__(self, source_segment, target_segment)
self.sequence_type = sequence_type
self.ne_disambiguation = ne_disambiguation
<|end_body_0|>
<|body_start_1|>
mode = 'manual' if self.sequence_type == 'manual' else 'default'
s1_ne_syns = [toke... | NESynOverlap | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class NESynOverlap:
def __init__(self, source_segment, target_segment, sequence_type='default', ne_disambiguation=False):
""":param source_segment: Segment from source article :param target_segment: Segment from target article :param sequence_type: Sequence manual of sequence default :param ne... | stack_v2_sparse_classes_36k_train_010254 | 1,724 | permissive | [
{
"docstring": ":param source_segment: Segment from source article :param target_segment: Segment from target article :param sequence_type: Sequence manual of sequence default :param ne_disambiguation: Flag, whether to disambiguate named entities",
"name": "__init__",
"signature": "def __init__(self, so... | 2 | null | Implement the Python class `NESynOverlap` described below.
Class description:
Implement the NESynOverlap class.
Method signatures and docstrings:
- def __init__(self, source_segment, target_segment, sequence_type='default', ne_disambiguation=False): :param source_segment: Segment from source article :param target_seg... | Implement the Python class `NESynOverlap` described below.
Class description:
Implement the NESynOverlap class.
Method signatures and docstrings:
- def __init__(self, source_segment, target_segment, sequence_type='default', ne_disambiguation=False): :param source_segment: Segment from source article :param target_seg... | 2e6a85dc9e95ef94bec2339987950f4e88f5d909 | <|skeleton|>
class NESynOverlap:
def __init__(self, source_segment, target_segment, sequence_type='default', ne_disambiguation=False):
""":param source_segment: Segment from source article :param target_segment: Segment from target article :param sequence_type: Sequence manual of sequence default :param ne... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class NESynOverlap:
def __init__(self, source_segment, target_segment, sequence_type='default', ne_disambiguation=False):
""":param source_segment: Segment from source article :param target_segment: Segment from target article :param sequence_type: Sequence manual of sequence default :param ne_disambiguatio... | the_stack_v2_python_sparse | newssimilarity/segment_sim/ne_syn_overlap.py | imackerracher/NewsSimilarity | train | 0 | |
f4b7f9538553f7d5dacc0ee57aa7d8397c659e1c | [
"super(Discriminator, self).__init__()\nself.conv_dim = conv_dim\nself.conv1 = conv(3, conv_dim, 4, batch_norm=False)\nself.conv2 = conv(conv_dim, conv_dim * 2, 4, batch_norm=True)\nself.conv3 = conv(conv_dim * 2, conv_dim * 4, 4, batch_norm=True)\nself.fc1 = nn.Linear(conv_dim * 4 * 4 * 4, 1)",
"x = F.leaky_relu... | <|body_start_0|>
super(Discriminator, self).__init__()
self.conv_dim = conv_dim
self.conv1 = conv(3, conv_dim, 4, batch_norm=False)
self.conv2 = conv(conv_dim, conv_dim * 2, 4, batch_norm=True)
self.conv3 = conv(conv_dim * 2, conv_dim * 4, 4, batch_norm=True)
self.fc1 = n... | Discriminator | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Discriminator:
def __init__(self, conv_dim):
"""Initialize the Discriminator Module :param conv_dim: The depth of the first convolutional layer"""
<|body_0|>
def forward(self, x):
"""Forward propagation of the neural network :param x: The input to the neural network ... | stack_v2_sparse_classes_36k_train_010255 | 16,057 | no_license | [
{
"docstring": "Initialize the Discriminator Module :param conv_dim: The depth of the first convolutional layer",
"name": "__init__",
"signature": "def __init__(self, conv_dim)"
},
{
"docstring": "Forward propagation of the neural network :param x: The input to the neural network :return: Discri... | 2 | stack_v2_sparse_classes_30k_train_002049 | Implement the Python class `Discriminator` described below.
Class description:
Implement the Discriminator class.
Method signatures and docstrings:
- def __init__(self, conv_dim): Initialize the Discriminator Module :param conv_dim: The depth of the first convolutional layer
- def forward(self, x): Forward propagatio... | Implement the Python class `Discriminator` described below.
Class description:
Implement the Discriminator class.
Method signatures and docstrings:
- def __init__(self, conv_dim): Initialize the Discriminator Module :param conv_dim: The depth of the first convolutional layer
- def forward(self, x): Forward propagatio... | 727cedd3e3aca715b9326f625548bedb5a0c1b9b | <|skeleton|>
class Discriminator:
def __init__(self, conv_dim):
"""Initialize the Discriminator Module :param conv_dim: The depth of the first convolutional layer"""
<|body_0|>
def forward(self, x):
"""Forward propagation of the neural network :param x: The input to the neural network ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Discriminator:
def __init__(self, conv_dim):
"""Initialize the Discriminator Module :param conv_dim: The depth of the first convolutional layer"""
super(Discriminator, self).__init__()
self.conv_dim = conv_dim
self.conv1 = conv(3, conv_dim, 4, batch_norm=False)
self.con... | the_stack_v2_python_sparse | generative_adversial_networks/generate_faces/generate_faces_dcgan.py | sivaneshl/deep_learning_course | train | 0 | |
c4df2570e585536d24b7131ae5c7731ead6dc3e7 | [
"Async.__init__(self)\nself.num_cores = num_cores\nself.cores_used = 0",
"self.access_ds.acquire()\nself.waiting.append((id, hook, parameters, input_files))\nif self.cores_used < self.num_cores:\n self.cores_used += 1\n threading.Thread(target=self.start_work).run()\nself.access_ds.release()",
"self.acces... | <|body_start_0|>
Async.__init__(self)
self.num_cores = num_cores
self.cores_used = 0
<|end_body_0|>
<|body_start_1|>
self.access_ds.acquire()
self.waiting.append((id, hook, parameters, input_files))
if self.cores_used < self.num_cores:
self.cores_used += 1
... | Execution on Local machine. | Local | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Local:
"""Execution on Local machine."""
def __init__(self, num_cores=1):
"""Constructor. parameters: - num_cores - Number of cores (for multiprocessor machines, multiply accordingly)"""
<|body_0|>
def _run_program(self, id, hook, parameters, input_files):
"""Run... | stack_v2_sparse_classes_36k_train_010256 | 1,957 | permissive | [
{
"docstring": "Constructor. parameters: - num_cores - Number of cores (for multiprocessor machines, multiply accordingly)",
"name": "__init__",
"signature": "def __init__(self, num_cores=1)"
},
{
"docstring": "Run program. For parameters, please check Async.run_program. Either runs a program if... | 3 | null | Implement the Python class `Local` described below.
Class description:
Execution on Local machine.
Method signatures and docstrings:
- def __init__(self, num_cores=1): Constructor. parameters: - num_cores - Number of cores (for multiprocessor machines, multiply accordingly)
- def _run_program(self, id, hook, paramete... | Implement the Python class `Local` described below.
Class description:
Execution on Local machine.
Method signatures and docstrings:
- def __init__(self, num_cores=1): Constructor. parameters: - num_cores - Number of cores (for multiprocessor machines, multiply accordingly)
- def _run_program(self, id, hook, paramete... | 2632aa3484ef64c9539c4885026b705b737f6d1e | <|skeleton|>
class Local:
"""Execution on Local machine."""
def __init__(self, num_cores=1):
"""Constructor. parameters: - num_cores - Number of cores (for multiprocessor machines, multiply accordingly)"""
<|body_0|>
def _run_program(self, id, hook, parameters, input_files):
"""Run... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Local:
"""Execution on Local machine."""
def __init__(self, num_cores=1):
"""Constructor. parameters: - num_cores - Number of cores (for multiprocessor machines, multiply accordingly)"""
Async.__init__(self)
self.num_cores = num_cores
self.cores_used = 0
def _run_prog... | the_stack_v2_python_sparse | resources/usr/local/lib/python2.7/dist-packages/Bio/PopGen/Async/Local.py | edawson/parliament2 | train | 0 |
19cb6d2a64ebf8351cac50219797001677eb47ae | [
"MeshConverter.__init__(self, cs)\nself._percent = percent\nself._fuelLockedToClad = fuelLockedToClad",
"adjustFlags = Flags.FUEL | Flags.CLAD if self._fuelLockedToClad else Flags.FUEL\nadjustList = getAxialExpansionNuclideAdjustList(r, adjustFlags)\nrunLog.extra('Conserving mass during axial expansion for: {0}'.... | <|body_start_0|>
MeshConverter.__init__(self, cs)
self._percent = percent
self._fuelLockedToClad = fuelLockedToClad
<|end_body_0|>
<|body_start_1|>
adjustFlags = Flags.FUEL | Flags.CLAD if self._fuelLockedToClad else Flags.FUEL
adjustList = getAxialExpansionNuclideAdjustList(r, ... | Axially expand or contract a reactor. Useful for fuel performance, thermal expansion, reactivity coefficients, etc. | AxialExpansionModifier | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class AxialExpansionModifier:
"""Axially expand or contract a reactor. Useful for fuel performance, thermal expansion, reactivity coefficients, etc."""
def __init__(self, percent, fuelLockedToClad=False, cs=None):
"""Build an axial expansion converter. Parameters ---------- percent : float... | stack_v2_sparse_classes_36k_train_010257 | 18,341 | permissive | [
{
"docstring": "Build an axial expansion converter. Parameters ---------- percent : float the desired axial expansion in percent. If negative, use special treatment of down-expanding fuelLockedToClad : bool Specify whether or not to conserve mass on structure due to the fuel being locked to the clad. Note: this... | 2 | null | Implement the Python class `AxialExpansionModifier` described below.
Class description:
Axially expand or contract a reactor. Useful for fuel performance, thermal expansion, reactivity coefficients, etc.
Method signatures and docstrings:
- def __init__(self, percent, fuelLockedToClad=False, cs=None): Build an axial e... | Implement the Python class `AxialExpansionModifier` described below.
Class description:
Axially expand or contract a reactor. Useful for fuel performance, thermal expansion, reactivity coefficients, etc.
Method signatures and docstrings:
- def __init__(self, percent, fuelLockedToClad=False, cs=None): Build an axial e... | 6c4fea1ca9d256a2599efd52af5e5ebe9860d192 | <|skeleton|>
class AxialExpansionModifier:
"""Axially expand or contract a reactor. Useful for fuel performance, thermal expansion, reactivity coefficients, etc."""
def __init__(self, percent, fuelLockedToClad=False, cs=None):
"""Build an axial expansion converter. Parameters ---------- percent : float... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class AxialExpansionModifier:
"""Axially expand or contract a reactor. Useful for fuel performance, thermal expansion, reactivity coefficients, etc."""
def __init__(self, percent, fuelLockedToClad=False, cs=None):
"""Build an axial expansion converter. Parameters ---------- percent : float the desired ... | the_stack_v2_python_sparse | armi/reactor/converters/meshConverters.py | paulromano/armi | train | 1 |
5c40dd1db2ec74a107474c2445352f116b986399 | [
"try:\n self.cred = credential.Credential(secretid, secretkey)\nexcept TencentCloudSDKException as e:\n print(e)",
"try:\n client = cvm_client.CvmClient(self.cred, region)\n req = models.DescribeInstancesRequest()\n res = client.DescribeInstances(req)\n data_json = json.loads(res.to_json_string(... | <|body_start_0|>
try:
self.cred = credential.Credential(secretid, secretkey)
except TencentCloudSDKException as e:
print(e)
<|end_body_0|>
<|body_start_1|>
try:
client = cvm_client.CvmClient(self.cred, region)
req = models.DescribeInstancesRequest... | TencentYun_api | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TencentYun_api:
def __init__(self, secretid, secretkey):
"""实例化KEY认证 :param secretid: :param secretkey:"""
<|body_0|>
def get_describe_instances(self, region):
"""请求cvm实例 :param region: :return:"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
try:
... | stack_v2_sparse_classes_36k_train_010258 | 1,133 | no_license | [
{
"docstring": "实例化KEY认证 :param secretid: :param secretkey:",
"name": "__init__",
"signature": "def __init__(self, secretid, secretkey)"
},
{
"docstring": "请求cvm实例 :param region: :return:",
"name": "get_describe_instances",
"signature": "def get_describe_instances(self, region)"
}
] | 2 | stack_v2_sparse_classes_30k_train_011293 | Implement the Python class `TencentYun_api` described below.
Class description:
Implement the TencentYun_api class.
Method signatures and docstrings:
- def __init__(self, secretid, secretkey): 实例化KEY认证 :param secretid: :param secretkey:
- def get_describe_instances(self, region): 请求cvm实例 :param region: :return: | Implement the Python class `TencentYun_api` described below.
Class description:
Implement the TencentYun_api class.
Method signatures and docstrings:
- def __init__(self, secretid, secretkey): 实例化KEY认证 :param secretid: :param secretkey:
- def get_describe_instances(self, region): 请求cvm实例 :param region: :return:
<|sk... | fc565af20312410214dec638e85fc35fc85eef2d | <|skeleton|>
class TencentYun_api:
def __init__(self, secretid, secretkey):
"""实例化KEY认证 :param secretid: :param secretkey:"""
<|body_0|>
def get_describe_instances(self, region):
"""请求cvm实例 :param region: :return:"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TencentYun_api:
def __init__(self, secretid, secretkey):
"""实例化KEY认证 :param secretid: :param secretkey:"""
try:
self.cred = credential.Credential(secretid, secretkey)
except TencentCloudSDKException as e:
print(e)
def get_describe_instances(self, region):
... | the_stack_v2_python_sparse | util/tencentyun_api.py | xiaoyaolaotou/Devops | train | 6 | |
0d9e1d4253fe178e671114902d4f4eb1f8813bc1 | [
"if relationship_type not in REQUEST_RELATIONSHIPS:\n return make_response('Invalid relationship type entered', 404)\nif valid_email(requester_email) == None:\n return make_response('', 422)\nif valid_email(request_recipient_email) == None:\n return make_response('', 422)\ns_node_label = e_node_label = 'Pe... | <|body_start_0|>
if relationship_type not in REQUEST_RELATIONSHIPS:
return make_response('Invalid relationship type entered', 404)
if valid_email(requester_email) == None:
return make_response('', 422)
if valid_email(request_recipient_email) == None:
return ma... | Request | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Request:
def post(self, relationship_type: str, requester_email: str, request_recipient_email: str) -> Response:
"""Create a request relationship."""
<|body_0|>
def delete(self, relationship_type: str, requester_email: str, request_recipient_email: str) -> Response:
... | stack_v2_sparse_classes_36k_train_010259 | 3,073 | no_license | [
{
"docstring": "Create a request relationship.",
"name": "post",
"signature": "def post(self, relationship_type: str, requester_email: str, request_recipient_email: str) -> Response"
},
{
"docstring": "Delete request relationship, effectively denying the request.",
"name": "delete",
"sig... | 2 | stack_v2_sparse_classes_30k_train_006999 | Implement the Python class `Request` described below.
Class description:
Implement the Request class.
Method signatures and docstrings:
- def post(self, relationship_type: str, requester_email: str, request_recipient_email: str) -> Response: Create a request relationship.
- def delete(self, relationship_type: str, re... | Implement the Python class `Request` described below.
Class description:
Implement the Request class.
Method signatures and docstrings:
- def post(self, relationship_type: str, requester_email: str, request_recipient_email: str) -> Response: Create a request relationship.
- def delete(self, relationship_type: str, re... | 2c71a26d1efbee85d04ce9c51b209c8b97f0ec06 | <|skeleton|>
class Request:
def post(self, relationship_type: str, requester_email: str, request_recipient_email: str) -> Response:
"""Create a request relationship."""
<|body_0|>
def delete(self, relationship_type: str, requester_email: str, request_recipient_email: str) -> Response:
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Request:
def post(self, relationship_type: str, requester_email: str, request_recipient_email: str) -> Response:
"""Create a request relationship."""
if relationship_type not in REQUEST_RELATIONSHIPS:
return make_response('Invalid relationship type entered', 404)
if valid_e... | the_stack_v2_python_sparse | backend/graph/graph_api/apis/request.py | WilliamZard/PintroAppSEG-Major | train | 0 | |
6614603460b8fd51230e57809d6de1dbd62674fb | [
"super(FPN, self).__init__()\nself.num_ins = len(in_channels)\nself.num_outs = num_outs\nself.start_level = start_level\nif end_level == -1:\n self.backbone_end_level = self.num_ins\n assert self.num_outs >= self.num_ins - self.start_level\nelse:\n self.backbone_end_level = end_level\n assert end_level ... | <|body_start_0|>
super(FPN, self).__init__()
self.num_ins = len(in_channels)
self.num_outs = num_outs
self.start_level = start_level
if end_level == -1:
self.backbone_end_level = self.num_ins
assert self.num_outs >= self.num_ins - self.start_level
... | FPN. | FPN | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class FPN:
"""FPN."""
def __init__(self, in_channels=[64, 128, 256, 512], out_channels=256, num_outs=5, activation=None, start_level=0, end_level=-1):
"""Init FPN. :param desc: config dict"""
<|body_0|>
def call(self, inputs):
"""Forward compute. :param inputs: input f... | stack_v2_sparse_classes_36k_train_010260 | 12,928 | permissive | [
{
"docstring": "Init FPN. :param desc: config dict",
"name": "__init__",
"signature": "def __init__(self, in_channels=[64, 128, 256, 512], out_channels=256, num_outs=5, activation=None, start_level=0, end_level=-1)"
},
{
"docstring": "Forward compute. :param inputs: input feature map :return: tu... | 2 | null | Implement the Python class `FPN` described below.
Class description:
FPN.
Method signatures and docstrings:
- def __init__(self, in_channels=[64, 128, 256, 512], out_channels=256, num_outs=5, activation=None, start_level=0, end_level=-1): Init FPN. :param desc: config dict
- def call(self, inputs): Forward compute. :... | Implement the Python class `FPN` described below.
Class description:
FPN.
Method signatures and docstrings:
- def __init__(self, in_channels=[64, 128, 256, 512], out_channels=256, num_outs=5, activation=None, start_level=0, end_level=-1): Init FPN. :param desc: config dict
- def call(self, inputs): Forward compute. :... | e4ef3a1c92d19d1d08c3ef0e2156b6fecefdbe04 | <|skeleton|>
class FPN:
"""FPN."""
def __init__(self, in_channels=[64, 128, 256, 512], out_channels=256, num_outs=5, activation=None, start_level=0, end_level=-1):
"""Init FPN. :param desc: config dict"""
<|body_0|>
def call(self, inputs):
"""Forward compute. :param inputs: input f... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class FPN:
"""FPN."""
def __init__(self, in_channels=[64, 128, 256, 512], out_channels=256, num_outs=5, activation=None, start_level=0, end_level=-1):
"""Init FPN. :param desc: config dict"""
super(FPN, self).__init__()
self.num_ins = len(in_channels)
self.num_outs = num_outs
... | the_stack_v2_python_sparse | zeus/networks/necks.py | huawei-noah/xingtian | train | 308 |
129a7b7fcca5a229628f9da35d01fe2c68bcbb7f | [
"driver = self.driver\ndriver.get(self.base_url)\nlongin.login(self)\nhomepage = HomePage(self.driver)\nhomepage.click_ehr()\nhomepage.sleep(0.5)\nhomepage.click_jxgl()\nhomepage.sleep(0.1)\nhomepage.click_ygjxgl()\nhomepage.switch_frame(driver.find_element_by_xpath(\"//iframe[@src='http://oa2.eascs.com/eaoa/hrAsse... | <|body_start_0|>
driver = self.driver
driver.get(self.base_url)
longin.login(self)
homepage = HomePage(self.driver)
homepage.click_ehr()
homepage.sleep(0.5)
homepage.click_jxgl()
homepage.sleep(0.1)
homepage.click_ygjxgl()
homepage.switch_f... | 绩效管理 | Start | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Start:
"""绩效管理"""
def test_01(self):
"""员工绩效管理"""
<|body_0|>
def test_02(self):
"""员工年度评估"""
<|body_1|>
def test_03(self):
"""中高层目标责任书"""
<|body_2|>
def test_04(self):
"""中高层年度评估"""
<|body_3|>
def test_05(sel... | stack_v2_sparse_classes_36k_train_010261 | 5,517 | no_license | [
{
"docstring": "员工绩效管理",
"name": "test_01",
"signature": "def test_01(self)"
},
{
"docstring": "员工年度评估",
"name": "test_02",
"signature": "def test_02(self)"
},
{
"docstring": "中高层目标责任书",
"name": "test_03",
"signature": "def test_03(self)"
},
{
"docstring": "中高层年度评... | 5 | stack_v2_sparse_classes_30k_val_000258 | Implement the Python class `Start` described below.
Class description:
绩效管理
Method signatures and docstrings:
- def test_01(self): 员工绩效管理
- def test_02(self): 员工年度评估
- def test_03(self): 中高层目标责任书
- def test_04(self): 中高层年度评估
- def test_05(self): 员工等级确认 | Implement the Python class `Start` described below.
Class description:
绩效管理
Method signatures and docstrings:
- def test_01(self): 员工绩效管理
- def test_02(self): 员工年度评估
- def test_03(self): 中高层目标责任书
- def test_04(self): 中高层年度评估
- def test_05(self): 员工等级确认
<|skeleton|>
class Start:
"""绩效管理"""
def test_01(self):... | a90695147681163d45d4951f6a921eda816500bb | <|skeleton|>
class Start:
"""绩效管理"""
def test_01(self):
"""员工绩效管理"""
<|body_0|>
def test_02(self):
"""员工年度评估"""
<|body_1|>
def test_03(self):
"""中高层目标责任书"""
<|body_2|>
def test_04(self):
"""中高层年度评估"""
<|body_3|>
def test_05(sel... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Start:
"""绩效管理"""
def test_01(self):
"""员工绩效管理"""
driver = self.driver
driver.get(self.base_url)
longin.login(self)
homepage = HomePage(self.driver)
homepage.click_ehr()
homepage.sleep(0.5)
homepage.click_jxgl()
homepage.sleep(0.1)
... | the_stack_v2_python_sparse | ehr_test_case/ehr_jxgl.py | shengli520/yyt | train | 0 |
94f1c8a851cb96e5f81c8ca4d8c1bc83660438d9 | [
"rospy.init_node(node_name)\njoint_states_topic = rospy.get_namespace() + 'joint_states'\nencoders_topic = rospy.get_namespace() + 'encoders'\nrospy.Subscriber(joint_states_topic, JointState, self._joint_state_callback)\nself.encoders_msg = Float32MultiArray()\nself.encoders_msg.data = [0.0, 0.0, 0.0, 0.0]\nself.en... | <|body_start_0|>
rospy.init_node(node_name)
joint_states_topic = rospy.get_namespace() + 'joint_states'
encoders_topic = rospy.get_namespace() + 'encoders'
rospy.Subscriber(joint_states_topic, JointState, self._joint_state_callback)
self.encoders_msg = Float32MultiArray()
... | Reads the joint states of the motors and publishes the angular frequency of each motor. | Encoders | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Encoders:
"""Reads the joint states of the motors and publishes the angular frequency of each motor."""
def __init__(self, node_name='encoders'):
"""Initialize the communication with the simulated smile-robot to get joint states. Parameters: node_name: A string for the name of this r... | stack_v2_sparse_classes_36k_train_010262 | 2,704 | no_license | [
{
"docstring": "Initialize the communication with the simulated smile-robot to get joint states. Parameters: node_name: A string for the name of this ros node. Default: encoders",
"name": "__init__",
"signature": "def __init__(self, node_name='encoders')"
},
{
"docstring": "Callback function for... | 3 | stack_v2_sparse_classes_30k_train_003285 | Implement the Python class `Encoders` described below.
Class description:
Reads the joint states of the motors and publishes the angular frequency of each motor.
Method signatures and docstrings:
- def __init__(self, node_name='encoders'): Initialize the communication with the simulated smile-robot to get joint state... | Implement the Python class `Encoders` described below.
Class description:
Reads the joint states of the motors and publishes the angular frequency of each motor.
Method signatures and docstrings:
- def __init__(self, node_name='encoders'): Initialize the communication with the simulated smile-robot to get joint state... | e0768f0c9f67acafeaab954b88cb16903461d0fb | <|skeleton|>
class Encoders:
"""Reads the joint states of the motors and publishes the angular frequency of each motor."""
def __init__(self, node_name='encoders'):
"""Initialize the communication with the simulated smile-robot to get joint states. Parameters: node_name: A string for the name of this r... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Encoders:
"""Reads the joint states of the motors and publishes the angular frequency of each motor."""
def __init__(self, node_name='encoders'):
"""Initialize the communication with the simulated smile-robot to get joint states. Parameters: node_name: A string for the name of this ros node. Defa... | the_stack_v2_python_sparse | smile_mobile_sim_ws/src/smile_mobile_control/src/sensors/encoders.py | Happy-Aztec-Digging-Extraction-System/smile-mobile | train | 0 |
38b95fa3fa469d1c5838c21beb1bdcd6463c466d | [
"if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn SynchronizationSchema()",
"from .directory_definition import DirectoryDefinition\nfrom .entity import Entity\nfrom .synchronization_rule import SynchronizationRule\nfrom .directory_definition import DirectoryDefinition\nfrom .entity im... | <|body_start_0|>
if not parse_node:
raise TypeError('parse_node cannot be null.')
return SynchronizationSchema()
<|end_body_0|>
<|body_start_1|>
from .directory_definition import DirectoryDefinition
from .entity import Entity
from .synchronization_rule import Synchro... | SynchronizationSchema | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SynchronizationSchema:
def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationSchema:
"""Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create th... | stack_v2_sparse_classes_36k_train_010263 | 3,144 | 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: SynchronizationSchema",
"name": "create_from_discriminator_value",
"signature": "def create_from_discriminat... | 3 | null | Implement the Python class `SynchronizationSchema` described below.
Class description:
Implement the SynchronizationSchema class.
Method signatures and docstrings:
- def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationSchema: Creates a new instance of the appropriate class base... | Implement the Python class `SynchronizationSchema` described below.
Class description:
Implement the SynchronizationSchema class.
Method signatures and docstrings:
- def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationSchema: Creates a new instance of the appropriate class base... | 27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949 | <|skeleton|>
class SynchronizationSchema:
def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationSchema:
"""Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create th... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SynchronizationSchema:
def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationSchema:
"""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 Retur... | the_stack_v2_python_sparse | msgraph/generated/models/synchronization_schema.py | microsoftgraph/msgraph-sdk-python | train | 135 | |
7583bd639c5733a21572bcaa822ac366acc88b07 | [
"self.disk_file_name = disk_file_name\nself.disk_format = disk_format\nself.disk_uuid = disk_uuid\nself.partition_type = partition_type\nself.partition_vec = partition_vec\nself.physical_range_vec = physical_range_vec\nself.sector_size = sector_size\nself.vmdk_size = vmdk_size",
"if dictionary is None:\n retur... | <|body_start_0|>
self.disk_file_name = disk_file_name
self.disk_format = disk_format
self.disk_uuid = disk_uuid
self.partition_type = partition_type
self.partition_vec = partition_vec
self.physical_range_vec = physical_range_vec
self.sector_size = sector_size
... | Implementation of the 'VolumeInfo_DiskInfo' model. TODO: type description here. Attributes: disk_file_name (string): Disk name. This is the vmdk names, and not the flat file name. disk_format (int): Disk format type of this file. See util/disklib/base/enums.proto for available types. disk_uuid (string): Disk uuid. part... | VolumeInfo_DiskInfo | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class VolumeInfo_DiskInfo:
"""Implementation of the 'VolumeInfo_DiskInfo' model. TODO: type description here. Attributes: disk_file_name (string): Disk name. This is the vmdk names, and not the flat file name. disk_format (int): Disk format type of this file. See util/disklib/base/enums.proto for avail... | stack_v2_sparse_classes_36k_train_010264 | 4,286 | permissive | [
{
"docstring": "Constructor for the VolumeInfo_DiskInfo class",
"name": "__init__",
"signature": "def __init__(self, disk_file_name=None, disk_format=None, disk_uuid=None, partition_type=None, partition_vec=None, physical_range_vec=None, sector_size=None, vmdk_size=None)"
},
{
"docstring": "Crea... | 2 | null | Implement the Python class `VolumeInfo_DiskInfo` described below.
Class description:
Implementation of the 'VolumeInfo_DiskInfo' model. TODO: type description here. Attributes: disk_file_name (string): Disk name. This is the vmdk names, and not the flat file name. disk_format (int): Disk format type of this file. See ... | Implement the Python class `VolumeInfo_DiskInfo` described below.
Class description:
Implementation of the 'VolumeInfo_DiskInfo' model. TODO: type description here. Attributes: disk_file_name (string): Disk name. This is the vmdk names, and not the flat file name. disk_format (int): Disk format type of this file. See ... | e4973dfeb836266904d0369ea845513c7acf261e | <|skeleton|>
class VolumeInfo_DiskInfo:
"""Implementation of the 'VolumeInfo_DiskInfo' model. TODO: type description here. Attributes: disk_file_name (string): Disk name. This is the vmdk names, and not the flat file name. disk_format (int): Disk format type of this file. See util/disklib/base/enums.proto for avail... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class VolumeInfo_DiskInfo:
"""Implementation of the 'VolumeInfo_DiskInfo' model. TODO: type description here. Attributes: disk_file_name (string): Disk name. This is the vmdk names, and not the flat file name. disk_format (int): Disk format type of this file. See util/disklib/base/enums.proto for available types. d... | the_stack_v2_python_sparse | cohesity_management_sdk/models/volume_info_disk_info.py | cohesity/management-sdk-python | train | 24 |
fd47fbcb6f96bb2e6802a7c970908086b90a8a4e | [
"dt_str = request.GET.get(get_dict_key)\ndt_parsed = None\nif dt_str:\n dt_parsed = parse_to_dt(dt_str, tzinfo_=get_current_timezone())\n if not dt_parsed:\n msg_parse_failed = msg_parse_failed or _('Failed to parse the timestamp. ({})')\n messages.warning(request, msg_parse_failed.format(dt_str... | <|body_start_0|>
dt_str = request.GET.get(get_dict_key)
dt_parsed = None
if dt_str:
dt_parsed = parse_to_dt(dt_str, tzinfo_=get_current_timezone())
if not dt_parsed:
msg_parse_failed = msg_parse_failed or _('Failed to parse the timestamp. ({})')
... | View to see the channel message stats. | ChannelMessageStatsView | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ChannelMessageStatsView:
"""View to see the channel message stats."""
def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime:
"""Get the timestamp string in URL GET params of key ``get_dict_key`` and parse it to :class:`datetime`. :param... | stack_v2_sparse_classes_36k_train_010265 | 9,531 | permissive | [
{
"docstring": "Get the timestamp string in URL GET params of key ``get_dict_key`` and parse it to :class:`datetime`. :param request: web request to get URL param :param get_dict_key: key of the param :param msg_parse_failed: message to be displayed if failed to parse :param msg_out_of_range: message to be disp... | 2 | stack_v2_sparse_classes_30k_train_000485 | Implement the Python class `ChannelMessageStatsView` described below.
Class description:
View to see the channel message stats.
Method signatures and docstrings:
- def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime: Get the timestamp string in URL GET params of key `... | Implement the Python class `ChannelMessageStatsView` described below.
Class description:
View to see the channel message stats.
Method signatures and docstrings:
- def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime: Get the timestamp string in URL GET params of key `... | c7da1e91783dce3a2b71b955b3a22b68db9056cf | <|skeleton|>
class ChannelMessageStatsView:
"""View to see the channel message stats."""
def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime:
"""Get the timestamp string in URL GET params of key ``get_dict_key`` and parse it to :class:`datetime`. :param... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ChannelMessageStatsView:
"""View to see the channel message stats."""
def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime:
"""Get the timestamp string in URL GET params of key ``get_dict_key`` and parse it to :class:`datetime`. :param request: web... | the_stack_v2_python_sparse | JellyBot/views/info/msgstats.py | RxJellyBot/Jelly-Bot | train | 5 |
3dc151b6b2f3e52e809cc8fbecb3d9c507e61fd5 | [
"assert trainable in ('lpips', 'net', 'both', False)\nif trainable and back_prop != True:\n raise Exception('Enable back_prop for training.')\nconfig.validate()\nself.config = config\nif config.metric in ('vgg', 'squeeze', 'vgg_ensemble', 'squeeze_ensemble_maxpool'):\n self.network = pnetlin.PNetLin(pnet_type... | <|body_start_0|>
assert trainable in ('lpips', 'net', 'both', False)
if trainable and back_prop != True:
raise Exception('Enable back_prop for training.')
config.validate()
self.config = config
if config.metric in ('vgg', 'squeeze', 'vgg_ensemble', 'squeeze_ensemble_m... | Metric | [
"BSD-2-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Metric:
def __init__(self, config, back_prop=True, trainable=False, use_lpips_dropout=False, custom_lpips_weights=None, custom_net_weights=None, custom_sample_ensemble=None):
"""Perceptual image distance metric. PARAMS: config: Metric configuration. One of: elpips.elpips_vgg(), elpips.el... | stack_v2_sparse_classes_36k_train_010266 | 11,615 | permissive | [
{
"docstring": "Perceptual image distance metric. PARAMS: config: Metric configuration. One of: elpips.elpips_vgg(), elpips.elpips_squeeze_maxpool(), elpips.lpips_vgg(), elpips.lpips_squeeze(). back_prop: Whether to store data for back_prop. trainable: Whether to make weights trainable. Options: 'lpips', 'net',... | 2 | stack_v2_sparse_classes_30k_test_000126 | Implement the Python class `Metric` described below.
Class description:
Implement the Metric class.
Method signatures and docstrings:
- def __init__(self, config, back_prop=True, trainable=False, use_lpips_dropout=False, custom_lpips_weights=None, custom_net_weights=None, custom_sample_ensemble=None): Perceptual imag... | Implement the Python class `Metric` described below.
Class description:
Implement the Metric class.
Method signatures and docstrings:
- def __init__(self, config, back_prop=True, trainable=False, use_lpips_dropout=False, custom_lpips_weights=None, custom_net_weights=None, custom_sample_ensemble=None): Perceptual imag... | 5f14208f00fdd69e99e8b055ffe5fd3c11a6e2b6 | <|skeleton|>
class Metric:
def __init__(self, config, back_prop=True, trainable=False, use_lpips_dropout=False, custom_lpips_weights=None, custom_net_weights=None, custom_sample_ensemble=None):
"""Perceptual image distance metric. PARAMS: config: Metric configuration. One of: elpips.elpips_vgg(), elpips.el... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Metric:
def __init__(self, config, back_prop=True, trainable=False, use_lpips_dropout=False, custom_lpips_weights=None, custom_net_weights=None, custom_sample_ensemble=None):
"""Perceptual image distance metric. PARAMS: config: Metric configuration. One of: elpips.elpips_vgg(), elpips.elpips_squeeze_m... | the_stack_v2_python_sparse | SeaAsiaDX11/SeaAisa/SeaAisa/ngpt/reconstruct/elpips/elpips.py | ChengGongXTU/SeaAsia | train | 8 | |
1ab9e1704ba27d6d4d61b2718f9d1c53d61571ba | [
"if not os.path.exists(base_path):\n os.makedirs(base_path)\nfor fn in NAIPTileIndex.INDEX_FNS:\n if not os.path.exists(os.path.join(base_path, fn)):\n download_url(NAIPTileIndex.NAIP_INDEX_BLOB_ROOT + fn, os.path.join(base_path, fn), verbose)\nself.base_path = base_path\nself.tile_rtree = rtree.index.... | <|body_start_0|>
if not os.path.exists(base_path):
os.makedirs(base_path)
for fn in NAIPTileIndex.INDEX_FNS:
if not os.path.exists(os.path.join(base_path, fn)):
download_url(NAIPTileIndex.NAIP_INDEX_BLOB_ROOT + fn, os.path.join(base_path, fn), verbose)
sel... | Utility class for performing NAIP tile lookups by location | NAIPTileIndex | [
"MIT",
"LicenseRef-scancode-generic-cla"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class NAIPTileIndex:
"""Utility class for performing NAIP tile lookups by location"""
def __init__(self, base_path, verbose=False):
"""Loads the tile index into memory (~400 MB) for use by `self.lookup()`. Downloads the index files from the blob container if they do not exist in the `base_... | stack_v2_sparse_classes_36k_train_010267 | 5,605 | permissive | [
{
"docstring": "Loads the tile index into memory (~400 MB) for use by `self.lookup()`. Downloads the index files from the blob container if they do not exist in the `base_path/` directory. Args: base_path (str): The path on the local system to look for/store the three files that make up the tile index. This pat... | 3 | stack_v2_sparse_classes_30k_train_007508 | Implement the Python class `NAIPTileIndex` described below.
Class description:
Utility class for performing NAIP tile lookups by location
Method signatures and docstrings:
- def __init__(self, base_path, verbose=False): Loads the tile index into memory (~400 MB) for use by `self.lookup()`. Downloads the index files f... | Implement the Python class `NAIPTileIndex` described below.
Class description:
Utility class for performing NAIP tile lookups by location
Method signatures and docstrings:
- def __init__(self, base_path, verbose=False): Loads the tile index into memory (~400 MB) for use by `self.lookup()`. Downloads the index files f... | ff141cd6b7a7b504c18b0987fbfd58ec6552df43 | <|skeleton|>
class NAIPTileIndex:
"""Utility class for performing NAIP tile lookups by location"""
def __init__(self, base_path, verbose=False):
"""Loads the tile index into memory (~400 MB) for use by `self.lookup()`. Downloads the index files from the blob container if they do not exist in the `base_... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class NAIPTileIndex:
"""Utility class for performing NAIP tile lookups by location"""
def __init__(self, base_path, verbose=False):
"""Loads the tile index into memory (~400 MB) for use by `self.lookup()`. Downloads the index files from the blob container if they do not exist in the `base_path/` direct... | the_stack_v2_python_sparse | geospatial/data/NAIPTileIndex.py | microsoft/ai4eutils | train | 40 |
14ec8d9c4938ca7ecb0fcbb709c3492f4d317fe9 | [
"self.VER = version\nself.DIR = dirname\nself.TR_PATH = os.path.join(raw_data_path, self.VER, self.DIR, 'tracklets', 'data')\nself.INS_PATH = os.path.join(raw_data_path, self.VER, self.DIR, 'INS', 'data')",
"load_path = [os.path.join(self.TR_PATH, dataset) for dataset in os.listdir(self.TR_PATH)]\nload_path.sort(... | <|body_start_0|>
self.VER = version
self.DIR = dirname
self.TR_PATH = os.path.join(raw_data_path, self.VER, self.DIR, 'tracklets', 'data')
self.INS_PATH = os.path.join(raw_data_path, self.VER, self.DIR, 'INS', 'data')
<|end_body_0|>
<|body_start_1|>
load_path = [os.path.join(sel... | Implementation of making datasets. | load_datasets | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class load_datasets:
"""Implementation of making datasets."""
def __init__(self, version, dirname):
"""Args: version: version of raw data ex) 'v1', 'v2' dirname: directory name of tracklets ex) '2017Y03M08D11H11m07s'"""
<|body_0|>
def load_tracklets(self):
"""load trac... | stack_v2_sparse_classes_36k_train_010268 | 1,560 | no_license | [
{
"docstring": "Args: version: version of raw data ex) 'v1', 'v2' dirname: directory name of tracklets ex) '2017Y03M08D11H11m07s'",
"name": "__init__",
"signature": "def __init__(self, version, dirname)"
},
{
"docstring": "load tracklets data.",
"name": "load_tracklets",
"signature": "de... | 3 | stack_v2_sparse_classes_30k_train_018199 | Implement the Python class `load_datasets` described below.
Class description:
Implementation of making datasets.
Method signatures and docstrings:
- def __init__(self, version, dirname): Args: version: version of raw data ex) 'v1', 'v2' dirname: directory name of tracklets ex) '2017Y03M08D11H11m07s'
- def load_track... | Implement the Python class `load_datasets` described below.
Class description:
Implementation of making datasets.
Method signatures and docstrings:
- def __init__(self, version, dirname): Args: version: version of raw data ex) 'v1', 'v2' dirname: directory name of tracklets ex) '2017Y03M08D11H11m07s'
- def load_track... | 2fde7c45771047a2136f9e5842c2a78097fef13a | <|skeleton|>
class load_datasets:
"""Implementation of making datasets."""
def __init__(self, version, dirname):
"""Args: version: version of raw data ex) 'v1', 'v2' dirname: directory name of tracklets ex) '2017Y03M08D11H11m07s'"""
<|body_0|>
def load_tracklets(self):
"""load trac... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class load_datasets:
"""Implementation of making datasets."""
def __init__(self, version, dirname):
"""Args: version: version of raw data ex) 'v1', 'v2' dirname: directory name of tracklets ex) '2017Y03M08D11H11m07s'"""
self.VER = version
self.DIR = dirname
self.TR_PATH = os.pat... | the_stack_v2_python_sparse | data_preprocessing/load_datasets.py | spa-hanyang/neural-trajectory-prediction | train | 2 |
eba46e46480d888a0f259c972eb580a3dbac7ba0 | [
"self._db_facade = facade.Facade(host=host)\nff_facade = fffacade.Facade(candle_type=candle_type, coin=pair)\nc_facade = cfacade.CrossoverFacade()\nexpt_logs_dept = self._db_facade.select_department('experiment_logs')\nfitness_function = ff_facade.select_department(function_name=fitness_function_name, db_dept=expt_... | <|body_start_0|>
self._db_facade = facade.Facade(host=host)
ff_facade = fffacade.Facade(candle_type=candle_type, coin=pair)
c_facade = cfacade.CrossoverFacade()
expt_logs_dept = self._db_facade.select_department('experiment_logs')
fitness_function = ff_facade.select_department(fu... | BackTest | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class BackTest:
def __init__(self, situation, candle_type, pair, population, mutation, cross, elite_num, host, fitness_function_name, crossover_name, hyper_params=None):
""":param situation: Situation 遺伝子の要素の取りうる範囲などを表す :param candle_type: string ロウソク足データの種類 :param pair: string コインの種類 :param p... | stack_v2_sparse_classes_36k_train_010269 | 3,988 | no_license | [
{
"docstring": ":param situation: Situation 遺伝子の要素の取りうる範囲などを表す :param candle_type: string ロウソク足データの種類 :param pair: string コインの種類 :param population: int 個体数 :param mutation: int 突然変異のパーセンテージ :param cross: int 交叉のパーセンテージ :param elite_num: int 世代交代時に残すエリート個体数 :param host: string dbの接続先 :param fitness_function_name... | 2 | null | Implement the Python class `BackTest` described below.
Class description:
Implement the BackTest class.
Method signatures and docstrings:
- def __init__(self, situation, candle_type, pair, population, mutation, cross, elite_num, host, fitness_function_name, crossover_name, hyper_params=None): :param situation: Situat... | Implement the Python class `BackTest` described below.
Class description:
Implement the BackTest class.
Method signatures and docstrings:
- def __init__(self, situation, candle_type, pair, population, mutation, cross, elite_num, host, fitness_function_name, crossover_name, hyper_params=None): :param situation: Situat... | c8b013344472459b386890cacf4a39b39e9bb5a7 | <|skeleton|>
class BackTest:
def __init__(self, situation, candle_type, pair, population, mutation, cross, elite_num, host, fitness_function_name, crossover_name, hyper_params=None):
""":param situation: Situation 遺伝子の要素の取りうる範囲などを表す :param candle_type: string ロウソク足データの種類 :param pair: string コインの種類 :param p... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class BackTest:
def __init__(self, situation, candle_type, pair, population, mutation, cross, elite_num, host, fitness_function_name, crossover_name, hyper_params=None):
""":param situation: Situation 遺伝子の要素の取りうる範囲などを表す :param candle_type: string ロウソク足データの種類 :param pair: string コインの種類 :param population: int... | the_stack_v2_python_sparse | Jupyter/work/bitbank/modules/backtest/backtest.py | yamaguchi-milkcocholate/milkcocholate | train | 0 | |
f58f231b806ae477b3e7e8a2e1146509063fcee3 | [
"if columns is not None:\n if isinstance(columns, list) or isinstance(columns, tuple):\n self.columns = columns\n else:\n raise TypeError('Invalid type {}'.format(type(columns)))\nelse:\n self.columns = columns",
"if not isinstance(X, pd.core.frame.DataFrame):\n raise TypeError('Invalid ... | <|body_start_0|>
if columns is not None:
if isinstance(columns, list) or isinstance(columns, tuple):
self.columns = columns
else:
raise TypeError('Invalid type {}'.format(type(columns)))
else:
self.columns = columns
<|end_body_0|>
<|bo... | This transformer replace some categorical values with others. Attributes ---------- columns: `list` of columns to transformer [n_columns] Examples -------- For usage examples, please see https://jaisenbe58r.github.io/MLearner/user_guide/preprocessing/ReplaceMulticlass/ | ReplaceMulticlass | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ReplaceMulticlass:
"""This transformer replace some categorical values with others. Attributes ---------- columns: `list` of columns to transformer [n_columns] Examples -------- For usage examples, please see https://jaisenbe58r.github.io/MLearner/user_guide/preprocessing/ReplaceMulticlass/"""
... | stack_v2_sparse_classes_36k_train_010270 | 6,305 | permissive | [
{
"docstring": "Init replace categorical values.",
"name": "__init__",
"signature": "def __init__(self, columns=None)"
},
{
"docstring": "Gets the columns to make a replace values. Parameters ---------- X : {Dataframe}, shape = [n_samples, n_features] Dataframe, where n_samples is the number of ... | 3 | stack_v2_sparse_classes_30k_train_003969 | Implement the Python class `ReplaceMulticlass` described below.
Class description:
This transformer replace some categorical values with others. Attributes ---------- columns: `list` of columns to transformer [n_columns] Examples -------- For usage examples, please see https://jaisenbe58r.github.io/MLearner/user_guide... | Implement the Python class `ReplaceMulticlass` described below.
Class description:
This transformer replace some categorical values with others. Attributes ---------- columns: `list` of columns to transformer [n_columns] Examples -------- For usage examples, please see https://jaisenbe58r.github.io/MLearner/user_guide... | e768a4cad150b35fb5bf543ab28aa23764af51d9 | <|skeleton|>
class ReplaceMulticlass:
"""This transformer replace some categorical values with others. Attributes ---------- columns: `list` of columns to transformer [n_columns] Examples -------- For usage examples, please see https://jaisenbe58r.github.io/MLearner/user_guide/preprocessing/ReplaceMulticlass/"""
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ReplaceMulticlass:
"""This transformer replace some categorical values with others. Attributes ---------- columns: `list` of columns to transformer [n_columns] Examples -------- For usage examples, please see https://jaisenbe58r.github.io/MLearner/user_guide/preprocessing/ReplaceMulticlass/"""
def __init... | the_stack_v2_python_sparse | mlearner/preprocessing/replace_categorical.py | jaisenbe58r/MLearner | train | 9 |
ddf7e35ab627b4b4101e4d76d05daad9a17c05bc | [
"original = self.cleaned_data['original']\nif not self.request.user.can_edit(self.user):\n raise forms.ValidationError(_('You cannot edit this user.'))\nif not authenticate(username=self.user.username, password=original):\n raise forms.ValidationError(_('Wrong password'))\nreturn original",
"self.user = kwa... | <|body_start_0|>
original = self.cleaned_data['original']
if not self.request.user.can_edit(self.user):
raise forms.ValidationError(_('You cannot edit this user.'))
if not authenticate(username=self.user.username, password=original):
raise forms.ValidationError(_('Wrong p... | Formulaire de mise à jour du mot de passe | PasswordForm | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class PasswordForm:
"""Formulaire de mise à jour du mot de passe"""
def clean_original(self):
"""Valider et renvoyer les données du champ mot de passe original"""
<|body_0|>
def __init__(self, *args, **kwargs):
"""Initialiser le formulaire"""
<|body_1|>
<|end_... | stack_v2_sparse_classes_36k_train_010271 | 2,926 | no_license | [
{
"docstring": "Valider et renvoyer les données du champ mot de passe original",
"name": "clean_original",
"signature": "def clean_original(self)"
},
{
"docstring": "Initialiser le formulaire",
"name": "__init__",
"signature": "def __init__(self, *args, **kwargs)"
}
] | 2 | stack_v2_sparse_classes_30k_train_009200 | Implement the Python class `PasswordForm` described below.
Class description:
Formulaire de mise à jour du mot de passe
Method signatures and docstrings:
- def clean_original(self): Valider et renvoyer les données du champ mot de passe original
- def __init__(self, *args, **kwargs): Initialiser le formulaire | Implement the Python class `PasswordForm` described below.
Class description:
Formulaire de mise à jour du mot de passe
Method signatures and docstrings:
- def clean_original(self): Valider et renvoyer les données du champ mot de passe original
- def __init__(self, *args, **kwargs): Initialiser le formulaire
<|skele... | 8cef6f6e89c1990e2b25f83e54e0c3481d83b6d7 | <|skeleton|>
class PasswordForm:
"""Formulaire de mise à jour du mot de passe"""
def clean_original(self):
"""Valider et renvoyer les données du champ mot de passe original"""
<|body_0|>
def __init__(self, *args, **kwargs):
"""Initialiser le formulaire"""
<|body_1|>
<|end_... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class PasswordForm:
"""Formulaire de mise à jour du mot de passe"""
def clean_original(self):
"""Valider et renvoyer les données du champ mot de passe original"""
original = self.cleaned_data['original']
if not self.request.user.can_edit(self.user):
raise forms.ValidationErr... | the_stack_v2_python_sparse | scoop/user/forms/user.py | artscoop/scoop | train | 0 |
572ee8b72b3ecfe0afde9a250cefabfb32d9bd57 | [
"if not root:\n return 0\ndepth = 0\nstack = [root]\nwhile stack:\n for node in stack:\n if node.right:\n nxLevel.append(node.right)\n if node.left:\n nxLevel.append(node.left)\n depth += 1\nreturn depth",
"if not root:\n return 0\nreturn 1 + max(self.maxDepth(root.... | <|body_start_0|>
if not root:
return 0
depth = 0
stack = [root]
while stack:
for node in stack:
if node.right:
nxLevel.append(node.right)
if node.left:
nxLevel.append(node.left)
de... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def maxDepth(self, root):
""":type root: TreeNode :rtype: int"""
<|body_0|>
def maxDepth(self, root):
""":type root: TreeNode :rtype: int"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
if not root:
return 0
depth = 0
... | stack_v2_sparse_classes_36k_train_010272 | 1,708 | no_license | [
{
"docstring": ":type root: TreeNode :rtype: int",
"name": "maxDepth",
"signature": "def maxDepth(self, root)"
},
{
"docstring": ":type root: TreeNode :rtype: int",
"name": "maxDepth",
"signature": "def maxDepth(self, root)"
}
] | 2 | stack_v2_sparse_classes_30k_val_000366 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def maxDepth(self, root): :type root: TreeNode :rtype: int
- def maxDepth(self, root): :type root: TreeNode :rtype: int | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def maxDepth(self, root): :type root: TreeNode :rtype: int
- def maxDepth(self, root): :type root: TreeNode :rtype: int
<|skeleton|>
class Solution:
def maxDepth(self, root... | f8fd6bb130a4d55d83d9bc07caac53c7e0a26afd | <|skeleton|>
class Solution:
def maxDepth(self, root):
""":type root: TreeNode :rtype: int"""
<|body_0|>
def maxDepth(self, root):
""":type root: TreeNode :rtype: int"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def maxDepth(self, root):
""":type root: TreeNode :rtype: int"""
if not root:
return 0
depth = 0
stack = [root]
while stack:
for node in stack:
if node.right:
nxLevel.append(node.right)
... | the_stack_v2_python_sparse | 104. Maximum Depth of Binary Tree.py | cherryzoe/Leetcode | train | 0 | |
f8af5200aa9b837458704b819b4f6fbfd83441d0 | [
"def bisearch(lst, x, key=None):\n compare = key or (lambda a, b: a < b)\n l, r = (0, len(lst))\n while l < r:\n i = (l + r) // 2\n if compare(lst[i], x):\n l = i + 1\n else:\n r = i\n return l\ns = bisearch(intervals, newInterval, key=lambda a, b: a[1] < b[0])... | <|body_start_0|>
def bisearch(lst, x, key=None):
compare = key or (lambda a, b: a < b)
l, r = (0, len(lst))
while l < r:
i = (l + r) // 2
if compare(lst[i], x):
l = i + 1
else:
r = i
... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def insert(self, intervals, newInterval):
"""Aug 10, 2018 21:41"""
<|body_0|>
def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]:
"""Aug 20, 2020 23:45"""
<|body_1|>
def insert(self, intervals: List[List[int... | stack_v2_sparse_classes_36k_train_010273 | 4,481 | no_license | [
{
"docstring": "Aug 10, 2018 21:41",
"name": "insert",
"signature": "def insert(self, intervals, newInterval)"
},
{
"docstring": "Aug 20, 2020 23:45",
"name": "insert",
"signature": "def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]"
},
{
"do... | 4 | stack_v2_sparse_classes_30k_test_000445 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def insert(self, intervals, newInterval): Aug 10, 2018 21:41
- def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]: Aug 20, 2020 23:45
- def i... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def insert(self, intervals, newInterval): Aug 10, 2018 21:41
- def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]: Aug 20, 2020 23:45
- def i... | 1389a009a02e90e8700a7a00e0b7f797c129cdf4 | <|skeleton|>
class Solution:
def insert(self, intervals, newInterval):
"""Aug 10, 2018 21:41"""
<|body_0|>
def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]:
"""Aug 20, 2020 23:45"""
<|body_1|>
def insert(self, intervals: List[List[int... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def insert(self, intervals, newInterval):
"""Aug 10, 2018 21:41"""
def bisearch(lst, x, key=None):
compare = key or (lambda a, b: a < b)
l, r = (0, len(lst))
while l < r:
i = (l + r) // 2
if compare(lst[i], x):
... | the_stack_v2_python_sparse | leetcode/solved/57_Insert_Interval/solution.py | sungminoh/algorithms | train | 0 | |
7c4b2b3632767f64af8cf90292fb6b4a68d33f3b | [
"DataUpdateCoordinator.__init__(self, hass, _LOGGER, name=f'{DOMAIN}-{device.device_info.name}', update_interval=timedelta(seconds=60))\nself.device = device\nself._error_count = 0",
"try:\n await self.device.update_state()\nexcept DeviceNotBoundError as error:\n raise UpdateFailed(f'Device {self.name} is u... | <|body_start_0|>
DataUpdateCoordinator.__init__(self, hass, _LOGGER, name=f'{DOMAIN}-{device.device_info.name}', update_interval=timedelta(seconds=60))
self.device = device
self._error_count = 0
<|end_body_0|>
<|body_start_1|>
try:
await self.device.update_state()
ex... | Manages polling for state changes from the device. | DeviceDataUpdateCoordinator | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class DeviceDataUpdateCoordinator:
"""Manages polling for state changes from the device."""
def __init__(self, hass: HomeAssistant, device: Device) -> None:
"""Initialize the data update coordinator."""
<|body_0|>
async def _async_update_data(self):
"""Update the state... | stack_v2_sparse_classes_36k_train_010274 | 3,990 | permissive | [
{
"docstring": "Initialize the data update coordinator.",
"name": "__init__",
"signature": "def __init__(self, hass: HomeAssistant, device: Device) -> None"
},
{
"docstring": "Update the state of the device.",
"name": "_async_update_data",
"signature": "async def _async_update_data(self)... | 3 | null | Implement the Python class `DeviceDataUpdateCoordinator` described below.
Class description:
Manages polling for state changes from the device.
Method signatures and docstrings:
- def __init__(self, hass: HomeAssistant, device: Device) -> None: Initialize the data update coordinator.
- async def _async_update_data(se... | Implement the Python class `DeviceDataUpdateCoordinator` described below.
Class description:
Manages polling for state changes from the device.
Method signatures and docstrings:
- def __init__(self, hass: HomeAssistant, device: Device) -> None: Initialize the data update coordinator.
- async def _async_update_data(se... | 80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743 | <|skeleton|>
class DeviceDataUpdateCoordinator:
"""Manages polling for state changes from the device."""
def __init__(self, hass: HomeAssistant, device: Device) -> None:
"""Initialize the data update coordinator."""
<|body_0|>
async def _async_update_data(self):
"""Update the state... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class DeviceDataUpdateCoordinator:
"""Manages polling for state changes from the device."""
def __init__(self, hass: HomeAssistant, device: Device) -> None:
"""Initialize the data update coordinator."""
DataUpdateCoordinator.__init__(self, hass, _LOGGER, name=f'{DOMAIN}-{device.device_info.name... | the_stack_v2_python_sparse | homeassistant/components/gree/bridge.py | home-assistant/core | train | 35,501 |
004c0f96f3a2126bb6f9a7504eb38e9a3a65b555 | [
"url = reverse('api:relaydomain-list')\nresponse = self.client.get(url)\nself.assertEqual(response.status_code, 200)\nself.assertEqual(len(response.data), 2)",
"url = reverse('api:relaydomain-list')\nsettings = {'relay_target_host': '1.2.3.4'}\ndata = {'name': 'test3.com', 'transport': {'service': 'relay', '_sett... | <|body_start_0|>
url = reverse('api:relaydomain-list')
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data), 2)
<|end_body_0|>
<|body_start_1|>
url = reverse('api:relaydomain-list')
settings = {'relay_target_host... | API test cases. | RelayDomainAPITestCase | [
"ISC"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class RelayDomainAPITestCase:
"""API test cases."""
def test_list(self):
"""Test list service."""
<|body_0|>
def test_create(self):
"""Test create service."""
<|body_1|>
def test_update(self):
"""Test update service."""
<|body_2|>
def ... | stack_v2_sparse_classes_36k_train_010275 | 3,983 | permissive | [
{
"docstring": "Test list service.",
"name": "test_list",
"signature": "def test_list(self)"
},
{
"docstring": "Test create service.",
"name": "test_create",
"signature": "def test_create(self)"
},
{
"docstring": "Test update service.",
"name": "test_update",
"signature":... | 4 | null | Implement the Python class `RelayDomainAPITestCase` described below.
Class description:
API test cases.
Method signatures and docstrings:
- def test_list(self): Test list service.
- def test_create(self): Test create service.
- def test_update(self): Test update service.
- def test_delete(self): Test delete service. | Implement the Python class `RelayDomainAPITestCase` described below.
Class description:
API test cases.
Method signatures and docstrings:
- def test_list(self): Test list service.
- def test_create(self): Test create service.
- def test_update(self): Test update service.
- def test_delete(self): Test delete service.
... | df699aab0799ec1725b6b89be38e56285821c889 | <|skeleton|>
class RelayDomainAPITestCase:
"""API test cases."""
def test_list(self):
"""Test list service."""
<|body_0|>
def test_create(self):
"""Test create service."""
<|body_1|>
def test_update(self):
"""Test update service."""
<|body_2|>
def ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class RelayDomainAPITestCase:
"""API test cases."""
def test_list(self):
"""Test list service."""
url = reverse('api:relaydomain-list')
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data), 2)
def test_creat... | the_stack_v2_python_sparse | modoboa/relaydomains/api/v1/tests.py | modoboa/modoboa | train | 2,201 |
345d7d2a603a770fb3a1728a012fc90321502edc | [
"super(Gzip, self).__init__(connection=connection, prompt=prompt, newline_chars=newline_chars, runner=runner)\nself.file_name = file_name\nself.compressed_file_name = compressed_file_name\nself.options = options\nself.overwrite = overwrite\nself.answered_files = set()\nself.ret_required = False",
"cmd = 'gzip'\ni... | <|body_start_0|>
super(Gzip, self).__init__(connection=connection, prompt=prompt, newline_chars=newline_chars, runner=runner)
self.file_name = file_name
self.compressed_file_name = compressed_file_name
self.options = options
self.overwrite = overwrite
self.answered_files ... | Gzip | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Gzip:
def __init__(self, connection, file_name, compressed_file_name=None, options=None, overwrite=False, prompt=None, newline_chars=None, runner=None):
""":param connection: Moler connection to device, terminal when command is executed. :param file_name: Name of file to be compressed. :... | stack_v2_sparse_classes_36k_train_010276 | 4,737 | permissive | [
{
"docstring": ":param connection: Moler connection to device, terminal when command is executed. :param file_name: Name of file to be compressed. :param compressed_file_name: Name of output compressed file if you want to specify other than default. :param options: Options of command gzip. :param overwrite: If ... | 5 | null | Implement the Python class `Gzip` described below.
Class description:
Implement the Gzip class.
Method signatures and docstrings:
- def __init__(self, connection, file_name, compressed_file_name=None, options=None, overwrite=False, prompt=None, newline_chars=None, runner=None): :param connection: Moler connection to ... | Implement the Python class `Gzip` described below.
Class description:
Implement the Gzip class.
Method signatures and docstrings:
- def __init__(self, connection, file_name, compressed_file_name=None, options=None, overwrite=False, prompt=None, newline_chars=None, runner=None): :param connection: Moler connection to ... | 5a7bb06807b6e0124c77040367d0c20f42849a4c | <|skeleton|>
class Gzip:
def __init__(self, connection, file_name, compressed_file_name=None, options=None, overwrite=False, prompt=None, newline_chars=None, runner=None):
""":param connection: Moler connection to device, terminal when command is executed. :param file_name: Name of file to be compressed. :... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Gzip:
def __init__(self, connection, file_name, compressed_file_name=None, options=None, overwrite=False, prompt=None, newline_chars=None, runner=None):
""":param connection: Moler connection to device, terminal when command is executed. :param file_name: Name of file to be compressed. :param compress... | the_stack_v2_python_sparse | moler/cmd/unix/gzip.py | nokia/moler | train | 60 | |
51c5d020c2d28dcfe088718474fb2bc9c8a1c7ac | [
"if not spread:\n id_maps = PipelineTemplate.objects.unfold_subprocess(exec_data)\nelse:\n id_maps = PipelineTemplate.objects.replace_id(exec_data)\ninputs = inputs or {}\nfor key, val in list(inputs.items()):\n if key in exec_data['data']['inputs']:\n exec_data['data']['inputs'][key]['value'] = val... | <|body_start_0|>
if not spread:
id_maps = PipelineTemplate.objects.unfold_subprocess(exec_data)
else:
id_maps = PipelineTemplate.objects.replace_id(exec_data)
inputs = inputs or {}
for key, val in list(inputs.items()):
if key in exec_data['data']['inpu... | InstanceManager | [
"MIT",
"LGPL-2.1-or-later",
"LGPL-3.0-only"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class InstanceManager:
def create_instance(self, template, exec_data, spread=False, inputs=None, **kwargs):
"""创建流程实例对象 @param template: 流程模板 @param exec_data: 执行用流程数据 @param spread: exec_data 是否已经展开 @param kwargs: 其他参数 @param inputs: 自定义输入 @return: 实例对象"""
<|body_0|>
def delete_m... | stack_v2_sparse_classes_36k_train_010277 | 28,914 | permissive | [
{
"docstring": "创建流程实例对象 @param template: 流程模板 @param exec_data: 执行用流程数据 @param spread: exec_data 是否已经展开 @param kwargs: 其他参数 @param inputs: 自定义输入 @return: 实例对象",
"name": "create_instance",
"signature": "def create_instance(self, template, exec_data, spread=False, inputs=None, **kwargs)"
},
{
"do... | 5 | null | Implement the Python class `InstanceManager` described below.
Class description:
Implement the InstanceManager class.
Method signatures and docstrings:
- def create_instance(self, template, exec_data, spread=False, inputs=None, **kwargs): 创建流程实例对象 @param template: 流程模板 @param exec_data: 执行用流程数据 @param spread: exec_da... | Implement the Python class `InstanceManager` described below.
Class description:
Implement the InstanceManager class.
Method signatures and docstrings:
- def create_instance(self, template, exec_data, spread=False, inputs=None, **kwargs): 创建流程实例对象 @param template: 流程模板 @param exec_data: 执行用流程数据 @param spread: exec_da... | 2d708bd0d869d391456e0fb8d644af3b9f031acf | <|skeleton|>
class InstanceManager:
def create_instance(self, template, exec_data, spread=False, inputs=None, **kwargs):
"""创建流程实例对象 @param template: 流程模板 @param exec_data: 执行用流程数据 @param spread: exec_data 是否已经展开 @param kwargs: 其他参数 @param inputs: 自定义输入 @return: 实例对象"""
<|body_0|>
def delete_m... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class InstanceManager:
def create_instance(self, template, exec_data, spread=False, inputs=None, **kwargs):
"""创建流程实例对象 @param template: 流程模板 @param exec_data: 执行用流程数据 @param spread: exec_data 是否已经展开 @param kwargs: 其他参数 @param inputs: 自定义输入 @return: 实例对象"""
if not spread:
id_maps = Pipel... | the_stack_v2_python_sparse | pipeline/models.py | TencentBlueKing/bk-itsm | train | 100 | |
592daa4458b950c2da134bed83460a70b2106749 | [
"user = request.user\nif not order_id:\n return redirect(reverse('user:order'))\ntry:\n order = OrderInfo.objects.get(order_id=order_id, user=user)\nexcept OrderInfo.DoesNotExist:\n return redirect(reverse('user:order'))\norder.order_status_name = OrderInfo.ORDER_STATUS[order.order_status]\norder_skus = Or... | <|body_start_0|>
user = request.user
if not order_id:
return redirect(reverse('user:order'))
try:
order = OrderInfo.objects.get(order_id=order_id, user=user)
except OrderInfo.DoesNotExist:
return redirect(reverse('user:order'))
order.order_stat... | 订单评论 | OrderCommentView | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class OrderCommentView:
"""订单评论"""
def get(self, request, order_id):
"""提供评论页面"""
<|body_0|>
def post(self, request, order_id):
"""处理评论内容"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
user = request.user
if not order_id:
return r... | stack_v2_sparse_classes_36k_train_010278 | 18,227 | no_license | [
{
"docstring": "提供评论页面",
"name": "get",
"signature": "def get(self, request, order_id)"
},
{
"docstring": "处理评论内容",
"name": "post",
"signature": "def post(self, request, order_id)"
}
] | 2 | stack_v2_sparse_classes_30k_train_010795 | Implement the Python class `OrderCommentView` described below.
Class description:
订单评论
Method signatures and docstrings:
- def get(self, request, order_id): 提供评论页面
- def post(self, request, order_id): 处理评论内容 | Implement the Python class `OrderCommentView` described below.
Class description:
订单评论
Method signatures and docstrings:
- def get(self, request, order_id): 提供评论页面
- def post(self, request, order_id): 处理评论内容
<|skeleton|>
class OrderCommentView:
"""订单评论"""
def get(self, request, order_id):
"""提供评论页面"... | 96ed9be42ba487c065b5ea1783555b053f051586 | <|skeleton|>
class OrderCommentView:
"""订单评论"""
def get(self, request, order_id):
"""提供评论页面"""
<|body_0|>
def post(self, request, order_id):
"""处理评论内容"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class OrderCommentView:
"""订单评论"""
def get(self, request, order_id):
"""提供评论页面"""
user = request.user
if not order_id:
return redirect(reverse('user:order'))
try:
order = OrderInfo.objects.get(order_id=order_id, user=user)
except OrderInfo.DoesNot... | the_stack_v2_python_sparse | Web开发/02_web_django/celery_worker_env/dailyfresh/apps/order/views.py | YuanXianguo/Python-IT-Heima | train | 0 |
7bf5c66ff540902d733abd5d076f8e5109085f44 | [
"assert eta > 0, 'Efficiency of electrical heater should not be ' + 'equal to or below zero. Check your inputs.'\nassert eta <= 1, 'Efficiency of electrical heater should not' + ' exceed 1. Check your inputs.'\nsuper(ElectricalHeaterExtended, self).__init__(environment=environment, qNominal=q_nominal, tMax=t_max, l... | <|body_start_0|>
assert eta > 0, 'Efficiency of electrical heater should not be ' + 'equal to or below zero. Check your inputs.'
assert eta <= 1, 'Efficiency of electrical heater should not' + ' exceed 1. Check your inputs.'
super(ElectricalHeaterExtended, self).__init__(environment=environment,... | electricalHeaterExtended class (inheritance from electricalHeater Boiler class) self.totalPConsumption self.totalQOutput | ElectricalHeaterExtended | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ElectricalHeaterExtended:
"""electricalHeaterExtended class (inheritance from electricalHeater Boiler class) self.totalPConsumption self.totalQOutput"""
def __init__(self, environment, q_nominal, eta=1, t_max=85, lower_activation_limit=0):
"""Parameters ---------- environment : Exten... | stack_v2_sparse_classes_36k_train_010279 | 5,481 | permissive | [
{
"docstring": "Parameters ---------- environment : Extended environment object Common to all other objects. Includes time and weather instances q_nominal : float nominal heat production in W eta : float, optional nominal efficiency (without unit) (default: 1) t_max : float maximum provided temperature in °C (d... | 4 | null | Implement the Python class `ElectricalHeaterExtended` described below.
Class description:
electricalHeaterExtended class (inheritance from electricalHeater Boiler class) self.totalPConsumption self.totalQOutput
Method signatures and docstrings:
- def __init__(self, environment, q_nominal, eta=1, t_max=85, lower_activ... | Implement the Python class `ElectricalHeaterExtended` described below.
Class description:
electricalHeaterExtended class (inheritance from electricalHeater Boiler class) self.totalPConsumption self.totalQOutput
Method signatures and docstrings:
- def __init__(self, environment, q_nominal, eta=1, t_max=85, lower_activ... | 99fd0dab7f9a9030fd84ba4715753364662927ec | <|skeleton|>
class ElectricalHeaterExtended:
"""electricalHeaterExtended class (inheritance from electricalHeater Boiler class) self.totalPConsumption self.totalQOutput"""
def __init__(self, environment, q_nominal, eta=1, t_max=85, lower_activation_limit=0):
"""Parameters ---------- environment : Exten... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ElectricalHeaterExtended:
"""electricalHeaterExtended class (inheritance from electricalHeater Boiler class) self.totalPConsumption self.totalQOutput"""
def __init__(self, environment, q_nominal, eta=1, t_max=85, lower_activation_limit=0):
"""Parameters ---------- environment : Extended environme... | the_stack_v2_python_sparse | pycity_calc/energysystems/electricalHeater.py | RWTH-EBC/pyCity_calc | train | 4 |
99461a42ccc48cbb8fc9f6da454c4b1f92c321aa | [
"if not selector:\n return None\nif isinstance(selector, SelectorList):\n selector = selector[0]\nif isinstance(selector.root, str):\n return selector.root\nreturn ''.join([x.strip() for x in selector.xpath('.//text()').extract() if x.strip()])",
"day = str(date.min)\nfor arg in args:\n if isinstance(... | <|body_start_0|>
if not selector:
return None
if isinstance(selector, SelectorList):
selector = selector[0]
if isinstance(selector.root, str):
return selector.root
return ''.join([x.strip() for x in selector.xpath('.//text()').extract() if x.strip()])
... | FieldExtractor | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class FieldExtractor:
def text(cls, selector: Union[Selector, SelectorList]) -> str:
"""解析出文本内容"""
<|body_0|>
def date(cls, *args) -> date:
"""解析出日期内容"""
<|body_1|>
def money(cls, selector: Union[scrapy.Selector, List[str]]):
"""解析出金额内容"""
<|bo... | stack_v2_sparse_classes_36k_train_010280 | 17,949 | no_license | [
{
"docstring": "解析出文本内容",
"name": "text",
"signature": "def text(cls, selector: Union[Selector, SelectorList]) -> str"
},
{
"docstring": "解析出日期内容",
"name": "date",
"signature": "def date(cls, *args) -> date"
},
{
"docstring": "解析出金额内容",
"name": "money",
"signature": "def ... | 3 | stack_v2_sparse_classes_30k_train_003589 | Implement the Python class `FieldExtractor` described below.
Class description:
Implement the FieldExtractor class.
Method signatures and docstrings:
- def text(cls, selector: Union[Selector, SelectorList]) -> str: 解析出文本内容
- def date(cls, *args) -> date: 解析出日期内容
- def money(cls, selector: Union[scrapy.Selector, List[... | Implement the Python class `FieldExtractor` described below.
Class description:
Implement the FieldExtractor class.
Method signatures and docstrings:
- def text(cls, selector: Union[Selector, SelectorList]) -> str: 解析出文本内容
- def date(cls, *args) -> date: 解析出日期内容
- def money(cls, selector: Union[scrapy.Selector, List[... | 7316880e2444a8af02e2f44af38dd7ae708ccbb6 | <|skeleton|>
class FieldExtractor:
def text(cls, selector: Union[Selector, SelectorList]) -> str:
"""解析出文本内容"""
<|body_0|>
def date(cls, *args) -> date:
"""解析出日期内容"""
<|body_1|>
def money(cls, selector: Union[scrapy.Selector, List[str]]):
"""解析出金额内容"""
<|bo... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class FieldExtractor:
def text(cls, selector: Union[Selector, SelectorList]) -> str:
"""解析出文本内容"""
if not selector:
return None
if isinstance(selector, SelectorList):
selector = selector[0]
if isinstance(selector.root, str):
return selector.root
... | the_stack_v2_python_sparse | fetch_scrapy/fetch/extractors.py | aiportal/zb123 | train | 0 | |
93798abde17ade54cb4e99b13ed949f519389d80 | [
"skill_set = get_object_or_404(InstrumentAnalysis, slug=slug)\nself.check_object_permissions(request, skill_set)\nserializer = InstrumentAnalysisRetrieveUpdateSerializer(skill_set, many=False)\nreturn Response(data=serializer.data, status=status.HTTP_200_OK)",
"instrument_analysis = get_object_or_404(InstrumentAn... | <|body_start_0|>
skill_set = get_object_or_404(InstrumentAnalysis, slug=slug)
self.check_object_permissions(request, skill_set)
serializer = InstrumentAnalysisRetrieveUpdateSerializer(skill_set, many=False)
return Response(data=serializer.data, status=status.HTTP_200_OK)
<|end_body_0|>
... | InstrumentAnalysisRetrieveUpdateDestroyAPIView | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class InstrumentAnalysisRetrieveUpdateDestroyAPIView:
def get(self, request, slug=None):
"""Retrieve"""
<|body_0|>
def put(self, request, slug=None):
"""Update"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
skill_set = get_object_or_404(InstrumentAnalysi... | stack_v2_sparse_classes_36k_train_010281 | 3,789 | permissive | [
{
"docstring": "Retrieve",
"name": "get",
"signature": "def get(self, request, slug=None)"
},
{
"docstring": "Update",
"name": "put",
"signature": "def put(self, request, slug=None)"
}
] | 2 | stack_v2_sparse_classes_30k_train_011973 | Implement the Python class `InstrumentAnalysisRetrieveUpdateDestroyAPIView` described below.
Class description:
Implement the InstrumentAnalysisRetrieveUpdateDestroyAPIView class.
Method signatures and docstrings:
- def get(self, request, slug=None): Retrieve
- def put(self, request, slug=None): Update | Implement the Python class `InstrumentAnalysisRetrieveUpdateDestroyAPIView` described below.
Class description:
Implement the InstrumentAnalysisRetrieveUpdateDestroyAPIView class.
Method signatures and docstrings:
- def get(self, request, slug=None): Retrieve
- def put(self, request, slug=None): Update
<|skeleton|>
... | 98e1ff8bab7dda3492e5ff637bf5aafd111c840c | <|skeleton|>
class InstrumentAnalysisRetrieveUpdateDestroyAPIView:
def get(self, request, slug=None):
"""Retrieve"""
<|body_0|>
def put(self, request, slug=None):
"""Update"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class InstrumentAnalysisRetrieveUpdateDestroyAPIView:
def get(self, request, slug=None):
"""Retrieve"""
skill_set = get_object_or_404(InstrumentAnalysis, slug=slug)
self.check_object_permissions(request, skill_set)
serializer = InstrumentAnalysisRetrieveUpdateSerializer(skill_set, ma... | the_stack_v2_python_sparse | mikaponics/instrument/views/resource/instrument_analysis_crud_views.py | mikaponics/mikaponics-back | train | 4 | |
36ee234275edd1023fc639dfc41f3ad5b8847a55 | [
"total = 0\nfor account in accounts_JSON:\n if not account['node']['disabled']:\n total += account['node']['currentBalance']\nreturn total",
"owner = UserFactory.create()\naccount_1 = AccountFactory.create(owner=owner, disabled=True, current_balance=Decimal(100))\naccount_2 = AccountFactory.create(owner... | <|body_start_0|>
total = 0
for account in accounts_JSON:
if not account['node']['disabled']:
total += account['node']['currentBalance']
return total
<|end_body_0|>
<|body_start_1|>
owner = UserFactory.create()
account_1 = AccountFactory.create(owner=o... | Tests which check for balance in accounts based on the disabled boolean in the accounts model. Each enableAccount or disableAccount mutation changes the disabled boolean. Additionally, tests for transactions being added to an enabled account, and transactions being deleted after an account is disabled. | EnableDisableMutationsTestCase | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class EnableDisableMutationsTestCase:
"""Tests which check for balance in accounts based on the disabled boolean in the accounts model. Each enableAccount or disableAccount mutation changes the disabled boolean. Additionally, tests for transactions being added to an enabled account, and transactions be... | stack_v2_sparse_classes_36k_train_010282 | 9,961 | no_license | [
{
"docstring": "Returns the total current balance from activated accounts, based on the disabled flag.",
"name": "enabled_accounts_total",
"signature": "def enabled_accounts_total(self, accounts_JSON)"
},
{
"docstring": "Creates disabled accounts with different current_balance values, and enable... | 3 | stack_v2_sparse_classes_30k_train_009856 | Implement the Python class `EnableDisableMutationsTestCase` described below.
Class description:
Tests which check for balance in accounts based on the disabled boolean in the accounts model. Each enableAccount or disableAccount mutation changes the disabled boolean. Additionally, tests for transactions being added to ... | Implement the Python class `EnableDisableMutationsTestCase` described below.
Class description:
Tests which check for balance in accounts based on the disabled boolean in the accounts model. Each enableAccount or disableAccount mutation changes the disabled boolean. Additionally, tests for transactions being added to ... | 6289263ad899aad82d23d9a63c76bbe480e5e098 | <|skeleton|>
class EnableDisableMutationsTestCase:
"""Tests which check for balance in accounts based on the disabled boolean in the accounts model. Each enableAccount or disableAccount mutation changes the disabled boolean. Additionally, tests for transactions being added to an enabled account, and transactions be... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class EnableDisableMutationsTestCase:
"""Tests which check for balance in accounts based on the disabled boolean in the accounts model. Each enableAccount or disableAccount mutation changes the disabled boolean. Additionally, tests for transactions being added to an enabled account, and transactions being deleted a... | the_stack_v2_python_sparse | apps/accounts/tests.py | bespoke-digital/spendwell | train | 4 |
6584c32016b1dbe77f5bd43c1fdda232d6a80c72 | [
"current_app.logger.info('Method called')\ntry:\n response = g.requests.get('{}/{}/state/{}'.format(SESSION_API_URL, token_id, subsection, headers={'X-Trace-ID': g.trace_id}))\nexcept Exception as ex:\n current_app.logger.warning('Failed to get session state. TraceID : {} - Exception - {}'.format(g.trace_id, ... | <|body_start_0|>
current_app.logger.info('Method called')
try:
response = g.requests.get('{}/{}/state/{}'.format(SESSION_API_URL, token_id, subsection, headers={'X-Trace-ID': g.trace_id}))
except Exception as ex:
current_app.logger.warning('Failed to get session state. Tr... | SessionAPIService | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SessionAPIService:
def get_session_state(token_id, subsection):
"""Returns either a JSON object containing the session contents, or returns None if the session isn't found. :param token_id: Identifier for the session. :param subsection: The subsection of session state that should be retr... | stack_v2_sparse_classes_36k_train_010283 | 5,336 | permissive | [
{
"docstring": "Returns either a JSON object containing the session contents, or returns None if the session isn't found. :param token_id: Identifier for the session. :param subsection: The subsection of session state that should be retrieved. :return: Returns dictionary representation of the response or None."... | 5 | stack_v2_sparse_classes_30k_train_012100 | Implement the Python class `SessionAPIService` described below.
Class description:
Implement the SessionAPIService class.
Method signatures and docstrings:
- def get_session_state(token_id, subsection): Returns either a JSON object containing the session contents, or returns None if the session isn't found. :param to... | Implement the Python class `SessionAPIService` described below.
Class description:
Implement the SessionAPIService class.
Method signatures and docstrings:
- def get_session_state(token_id, subsection): Returns either a JSON object containing the session contents, or returns None if the session isn't found. :param to... | d92446a9972ebbcd9a43a7a7444a528aa2f30bf7 | <|skeleton|>
class SessionAPIService:
def get_session_state(token_id, subsection):
"""Returns either a JSON object containing the session contents, or returns None if the session isn't found. :param token_id: Identifier for the session. :param subsection: The subsection of session state that should be retr... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SessionAPIService:
def get_session_state(token_id, subsection):
"""Returns either a JSON object containing the session contents, or returns None if the session isn't found. :param token_id: Identifier for the session. :param subsection: The subsection of session state that should be retrieved. :return... | the_stack_v2_python_sparse | maintain_frontend/dependencies/session_api/session_service.py | uk-gov-mirror/LandRegistry.maintain-frontend | train | 0 | |
f4e3e81298062e977f3702293edda933eec20842 | [
"from elasticsearch_dsl import Q\nfrom elasticsearch_dsl.query import Terms\nsearch = super(LogEvent, cls).search()\nevent_type_query = Q(Terms(event_type__raw=cls.LOG_EVENT_TYPES))\nreturn search.query(event_type_query)",
"assert isinstance(interval, basestring), 'interval must be a string'\nsearch = base_querys... | <|body_start_0|>
from elasticsearch_dsl import Q
from elasticsearch_dsl.query import Terms
search = super(LogEvent, cls).search()
event_type_query = Q(Terms(event_type__raw=cls.LOG_EVENT_TYPES))
return search.query(event_type_query)
<|end_body_0|>
<|body_start_1|>
assert... | Logstash log entry model (intended to be read-only). | LogEvent | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class LogEvent:
"""Logstash log entry model (intended to be read-only)."""
def search(cls):
"""Return a search object with a log event query clause."""
<|body_0|>
def ranged_event_agg(cls, base_queryset, interval='1d', per_host=True):
"""Returns an aggregations by date... | stack_v2_sparse_classes_36k_train_010284 | 6,496 | permissive | [
{
"docstring": "Return a search object with a log event query clause.",
"name": "search",
"signature": "def search(cls)"
},
{
"docstring": "Returns an aggregations by date histogram and maybe event type. :type base_queryset: Search :param base_queryset: search to use as basis for aggregation :ty... | 2 | stack_v2_sparse_classes_30k_train_015927 | Implement the Python class `LogEvent` described below.
Class description:
Logstash log entry model (intended to be read-only).
Method signatures and docstrings:
- def search(cls): Return a search object with a log event query clause.
- def ranged_event_agg(cls, base_queryset, interval='1d', per_host=True): Returns an... | Implement the Python class `LogEvent` described below.
Class description:
Logstash log entry model (intended to be read-only).
Method signatures and docstrings:
- def search(cls): Return a search object with a log event query clause.
- def ranged_event_agg(cls, base_queryset, interval='1d', per_host=True): Returns an... | d7f1f1f1ff926148d2aa541d0bd4758173aa76d5 | <|skeleton|>
class LogEvent:
"""Logstash log entry model (intended to be read-only)."""
def search(cls):
"""Return a search object with a log event query clause."""
<|body_0|>
def ranged_event_agg(cls, base_queryset, interval='1d', per_host=True):
"""Returns an aggregations by date... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class LogEvent:
"""Logstash log entry model (intended to be read-only)."""
def search(cls):
"""Return a search object with a log event query clause."""
from elasticsearch_dsl import Q
from elasticsearch_dsl.query import Terms
search = super(LogEvent, cls).search()
event_... | the_stack_v2_python_sparse | goldstone/glogging/models.py | leftees/goldstone-server | train | 0 |
9aadbea14f1fceb16807ba4291434cb907f34088 | [
"self.obs_to_interprete = obs_to_interprete\nself.prediction_fn = prediction_fn\nself.method = method\nself.target_class = target_class\nself.random_state = check_random_state(random_state)\nself.methods_ = {'GS': growingspheres.GrowingSpheres}\nself.fitted = 0",
"cf = self.methods_[self.method](self.obs_to_inter... | <|body_start_0|>
self.obs_to_interprete = obs_to_interprete
self.prediction_fn = prediction_fn
self.method = method
self.target_class = target_class
self.random_state = check_random_state(random_state)
self.methods_ = {'GS': growingspheres.GrowingSpheres}
self.fit... | Class for defining a Counterfactual Explanation: this class will help point to specific counterfactual approaches | CounterfactualExplanation | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class CounterfactualExplanation:
"""Class for defining a Counterfactual Explanation: this class will help point to specific counterfactual approaches"""
def __init__(self, obs_to_interprete, prediction_fn, method='GS', target_class=None, random_state=None):
"""Init function method: algorit... | stack_v2_sparse_classes_36k_train_010285 | 1,979 | permissive | [
{
"docstring": "Init function method: algorithm to use random_state",
"name": "__init__",
"signature": "def __init__(self, obs_to_interprete, prediction_fn, method='GS', target_class=None, random_state=None)"
},
{
"docstring": "find the counterfactual with the specified method",
"name": "fit... | 3 | stack_v2_sparse_classes_30k_train_020825 | Implement the Python class `CounterfactualExplanation` described below.
Class description:
Class for defining a Counterfactual Explanation: this class will help point to specific counterfactual approaches
Method signatures and docstrings:
- def __init__(self, obs_to_interprete, prediction_fn, method='GS', target_clas... | Implement the Python class `CounterfactualExplanation` described below.
Class description:
Class for defining a Counterfactual Explanation: this class will help point to specific counterfactual approaches
Method signatures and docstrings:
- def __init__(self, obs_to_interprete, prediction_fn, method='GS', target_clas... | efc7803a1e59aac098dda06a475a4f586e73fd01 | <|skeleton|>
class CounterfactualExplanation:
"""Class for defining a Counterfactual Explanation: this class will help point to specific counterfactual approaches"""
def __init__(self, obs_to_interprete, prediction_fn, method='GS', target_class=None, random_state=None):
"""Init function method: algorit... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class CounterfactualExplanation:
"""Class for defining a Counterfactual Explanation: this class will help point to specific counterfactual approaches"""
def __init__(self, obs_to_interprete, prediction_fn, method='GS', target_class=None, random_state=None):
"""Init function method: algorithm to use ran... | the_stack_v2_python_sparse | growingspheres/growingspheres/counterfactuals.py | Poongi/Generating_counterfactual_examples | train | 0 |
c9328796db21c5430ef629e3d2009f839837cd3f | [
"i = 0\nj = len(height) - 1\nleft_bound = 0\nright_bound = 0\ntotal = 0\nwhile i < len(height) and j > 0 and (i <= j):\n if height[i] <= height[j]:\n total += max(0, left_bound - height[i])\n left_bound = max(left_bound, height[i])\n i += 1\n elif height[i] > height[j]:\n total += ... | <|body_start_0|>
i = 0
j = len(height) - 1
left_bound = 0
right_bound = 0
total = 0
while i < len(height) and j > 0 and (i <= j):
if height[i] <= height[j]:
total += max(0, left_bound - height[i])
left_bound = max(left_bound, he... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def trap(self, height):
""":type height: List[int] :rtype: int **Thought: Q: which bound matter? - only the lower of (left_bound, right_bound) matter to how much water trap at a piont - so, you have two pointers: i, j, keep track of left-bound and right bound respectively. - mo... | stack_v2_sparse_classes_36k_train_010286 | 2,815 | no_license | [
{
"docstring": ":type height: List[int] :rtype: int **Thought: Q: which bound matter? - only the lower of (left_bound, right_bound) matter to how much water trap at a piont - so, you have two pointers: i, j, keep track of left-bound and right bound respectively. - move i or j whichever one is the lower bound. (... | 2 | stack_v2_sparse_classes_30k_train_001874 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def trap(self, height): :type height: List[int] :rtype: int **Thought: Q: which bound matter? - only the lower of (left_bound, right_bound) matter to how much water trap at a pio... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def trap(self, height): :type height: List[int] :rtype: int **Thought: Q: which bound matter? - only the lower of (left_bound, right_bound) matter to how much water trap at a pio... | bf98c8fa31043a45b3d21cfe78d4e08f9cac9de6 | <|skeleton|>
class Solution:
def trap(self, height):
""":type height: List[int] :rtype: int **Thought: Q: which bound matter? - only the lower of (left_bound, right_bound) matter to how much water trap at a piont - so, you have two pointers: i, j, keep track of left-bound and right bound respectively. - mo... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def trap(self, height):
""":type height: List[int] :rtype: int **Thought: Q: which bound matter? - only the lower of (left_bound, right_bound) matter to how much water trap at a piont - so, you have two pointers: i, j, keep track of left-bound and right bound respectively. - move i or j whic... | the_stack_v2_python_sparse | dynamic_programming/42_trapping_rain_water.py | mistrydarshan99/Leetcode-3 | train | 0 | |
e3cb5d49288c0335426c48c218cd742c6a3ca0be | [
"if not action:\n return None\nreturn object.__new__(cls)",
"_msg = \"Can't parse action string %r\" % (action,)\naction = action.split()\nif len(action) < 2:\n raise ValueError(_msg)\nself.maxbytes = int(action[0])\ntokens = action[1].lower().split('/')\nself.mode = tokens.pop(0).lower()\nif self.mode not ... | <|body_start_0|>
if not action:
return None
return object.__new__(cls)
<|end_body_0|>
<|body_start_1|>
_msg = "Can't parse action string %r" % (action,)
action = action.split()
if len(action) < 2:
raise ValueError(_msg)
self.maxbytes = int(action[... | Mailaction container :Groups: - `Basic Modes`: `TRUNCATE`, `URLS`, `SPLIT` - `Scopes`: `REVPROP`, `LOCKS` :CVariables: - `TRUNCATE`: ``truncate`` token - `URLS`: ``showurls`` token - `SPLIT`: ``split`` token - `REVPROP`: ``revprop-changes`` token - `LOCKS`: ``locks`` token :IVariables: - `maxbytes`: maximum number of b... | MailAction | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class MailAction:
"""Mailaction container :Groups: - `Basic Modes`: `TRUNCATE`, `URLS`, `SPLIT` - `Scopes`: `REVPROP`, `LOCKS` :CVariables: - `TRUNCATE`: ``truncate`` token - `URLS`: ``showurls`` token - `SPLIT`: ``split`` token - `REVPROP`: ``revprop-changes`` token - `LOCKS`: ``locks`` token :IVariab... | stack_v2_sparse_classes_36k_train_010287 | 18,259 | permissive | [
{
"docstring": "Constructor :param action: The action as string :type action: ``basestring`` :return: A new `MailAction` instance or ``None`` if `action` is empty or `None` :rtype: `MailAction`",
"name": "__new__",
"signature": "def __new__(cls, action)"
},
{
"docstring": "Initialization :param ... | 3 | stack_v2_sparse_classes_30k_train_006513 | Implement the Python class `MailAction` described below.
Class description:
Mailaction container :Groups: - `Basic Modes`: `TRUNCATE`, `URLS`, `SPLIT` - `Scopes`: `REVPROP`, `LOCKS` :CVariables: - `TRUNCATE`: ``truncate`` token - `URLS`: ``showurls`` token - `SPLIT`: ``split`` token - `REVPROP`: ``revprop-changes`` to... | Implement the Python class `MailAction` described below.
Class description:
Mailaction container :Groups: - `Basic Modes`: `TRUNCATE`, `URLS`, `SPLIT` - `Scopes`: `REVPROP`, `LOCKS` :CVariables: - `TRUNCATE`: ``truncate`` token - `URLS`: ``showurls`` token - `SPLIT`: ``split`` token - `REVPROP`: ``revprop-changes`` to... | faecefdabd8fbf6d40738a24004772020c244f64 | <|skeleton|>
class MailAction:
"""Mailaction container :Groups: - `Basic Modes`: `TRUNCATE`, `URLS`, `SPLIT` - `Scopes`: `REVPROP`, `LOCKS` :CVariables: - `TRUNCATE`: ``truncate`` token - `URLS`: ``showurls`` token - `SPLIT`: ``split`` token - `REVPROP`: ``revprop-changes`` token - `LOCKS`: ``locks`` token :IVariab... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class MailAction:
"""Mailaction container :Groups: - `Basic Modes`: `TRUNCATE`, `URLS`, `SPLIT` - `Scopes`: `REVPROP`, `LOCKS` :CVariables: - `TRUNCATE`: ``truncate`` token - `URLS`: ``showurls`` token - `SPLIT`: ``split`` token - `REVPROP`: ``revprop-changes`` token - `LOCKS`: ``locks`` token :IVariables: - `maxby... | the_stack_v2_python_sparse | src/lib/svnmailer/settings/_accessors.py | m-tmatma/svnmailer | train | 1 |
e72ec70376cf2001970c58a6d49fc9bfb549dcb2 | [
"CaptchaResource.__init__(self, hmacKey, publicKey, secretKey, useForwardedHeader)\nself.captchaDir = captchaDir\nself.supportedTransports = getSupportedTransports()",
"clientIP = self.getClientIP(request)\nclientHMACKey = crypto.getHMAC(self.hmacKey, clientIP)\ncapt = captcha.GimpCaptcha(self.publicKey, self.sec... | <|body_start_0|>
CaptchaResource.__init__(self, hmacKey, publicKey, secretKey, useForwardedHeader)
self.captchaDir = captchaDir
self.supportedTransports = getSupportedTransports()
<|end_body_0|>
<|body_start_1|>
clientIP = self.getClientIP(request)
clientHMACKey = crypto.getHMAC... | A resource to retrieve a CAPTCHA challenge. | CaptchaFetchResource | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class CaptchaFetchResource:
"""A resource to retrieve a CAPTCHA challenge."""
def __init__(self, hmacKey=None, publicKey=None, secretKey=None, captchaDir='captchas', useForwardedHeader=True, skipLoopback=False):
"""DOCDOC :param bytes hmacKey: The master HMAC key, used for validating CAPTC... | stack_v2_sparse_classes_36k_train_010288 | 33,383 | permissive | [
{
"docstring": "DOCDOC :param bytes hmacKey: The master HMAC key, used for validating CAPTCHA challenge strings in :meth:`captcha.GimpCaptcha.check`. The file where this key is stored can be set via the ``GIMP_CAPTCHA_HMAC_KEYFILE`` option in the config file. are stored. See the ``GIMP_CAPTCHA_DIR`` config sett... | 5 | stack_v2_sparse_classes_30k_train_012878 | Implement the Python class `CaptchaFetchResource` described below.
Class description:
A resource to retrieve a CAPTCHA challenge.
Method signatures and docstrings:
- def __init__(self, hmacKey=None, publicKey=None, secretKey=None, captchaDir='captchas', useForwardedHeader=True, skipLoopback=False): DOCDOC :param byte... | Implement the Python class `CaptchaFetchResource` described below.
Class description:
A resource to retrieve a CAPTCHA challenge.
Method signatures and docstrings:
- def __init__(self, hmacKey=None, publicKey=None, secretKey=None, captchaDir='captchas', useForwardedHeader=True, skipLoopback=False): DOCDOC :param byte... | 191a190e61f5cb9ad1b86d8c3c207d2d9adf7ef1 | <|skeleton|>
class CaptchaFetchResource:
"""A resource to retrieve a CAPTCHA challenge."""
def __init__(self, hmacKey=None, publicKey=None, secretKey=None, captchaDir='captchas', useForwardedHeader=True, skipLoopback=False):
"""DOCDOC :param bytes hmacKey: The master HMAC key, used for validating CAPTC... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class CaptchaFetchResource:
"""A resource to retrieve a CAPTCHA challenge."""
def __init__(self, hmacKey=None, publicKey=None, secretKey=None, captchaDir='captchas', useForwardedHeader=True, skipLoopback=False):
"""DOCDOC :param bytes hmacKey: The master HMAC key, used for validating CAPTCHA challenge ... | the_stack_v2_python_sparse | bridgedb/distributors/moat/server.py | larrycameron80/bridgedb-2 | train | 0 |
5c9508b93bd508833fd8ef0ebaa2b275eb015812 | [
"self.previous = datetime.datetime.now()\nself.servo_0 = Servo(servos[0], initial_positions[0], 5)\nself.servo_1 = Servo(servos[1], initial_positions[1], 5)\nself.servo_2 = Servo(servos[2], initial_positions[2], 5)\nself.servos = [self.servo_0, self.servo_1, self.servo_2]\nself.reposition = False\nself.grabbed = Fa... | <|body_start_0|>
self.previous = datetime.datetime.now()
self.servo_0 = Servo(servos[0], initial_positions[0], 5)
self.servo_1 = Servo(servos[1], initial_positions[1], 5)
self.servo_2 = Servo(servos[2], initial_positions[2], 5)
self.servos = [self.servo_0, self.servo_1, self.serv... | Base class for grabber which directly implements servo | Grabber | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Grabber:
"""Base class for grabber which directly implements servo"""
def __init__(self, servos, initial_positions):
"""Constructor for grabber class :param servos: Array of grabber servo id`s :param initial_positions: Array of servo positions"""
<|body_0|>
def grab(self... | stack_v2_sparse_classes_36k_train_010289 | 4,112 | permissive | [
{
"docstring": "Constructor for grabber class :param servos: Array of grabber servo id`s :param initial_positions: Array of servo positions",
"name": "__init__",
"signature": "def __init__(self, servos, initial_positions)"
},
{
"docstring": "Function that contains commands to close grabber :para... | 6 | stack_v2_sparse_classes_30k_train_000293 | Implement the Python class `Grabber` described below.
Class description:
Base class for grabber which directly implements servo
Method signatures and docstrings:
- def __init__(self, servos, initial_positions): Constructor for grabber class :param servos: Array of grabber servo id`s :param initial_positions: Array of... | Implement the Python class `Grabber` described below.
Class description:
Base class for grabber which directly implements servo
Method signatures and docstrings:
- def __init__(self, servos, initial_positions): Constructor for grabber class :param servos: Array of grabber servo id`s :param initial_positions: Array of... | c8898bef493618c19ba9f3c564ee25481fd4695e | <|skeleton|>
class Grabber:
"""Base class for grabber which directly implements servo"""
def __init__(self, servos, initial_positions):
"""Constructor for grabber class :param servos: Array of grabber servo id`s :param initial_positions: Array of servo positions"""
<|body_0|>
def grab(self... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Grabber:
"""Base class for grabber which directly implements servo"""
def __init__(self, servos, initial_positions):
"""Constructor for grabber class :param servos: Array of grabber servo id`s :param initial_positions: Array of servo positions"""
self.previous = datetime.datetime.now()
... | the_stack_v2_python_sparse | src/entities/movement/grabber.py | DwarfExop/IDP | train | 0 |
dc404f94b029ad1f12ffcf84b323f0283a9d8962 | [
"self.__iterator = iterator\nself.__has_peeked = False\nself.__next_value = None",
"if not self.__has_peeked:\n self.__next_value = self.__iterator.next()\n self.__has_peeked = True\nreturn self.__next_value",
"if self.__has_peeked:\n self.__has_peeked = False\n return self.__next_value\nreturn self... | <|body_start_0|>
self.__iterator = iterator
self.__has_peeked = False
self.__next_value = None
<|end_body_0|>
<|body_start_1|>
if not self.__has_peeked:
self.__next_value = self.__iterator.next()
self.__has_peeked = True
return self.__next_value
<|end_bod... | PeekingIterator | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class PeekingIterator:
def __init__(self, iterator):
"""Initialize your data structure here. :type iterator: Iterator"""
<|body_0|>
def peek(self):
"""Returns the next element in the iteration without advancing the iterator. :rtype: int"""
<|body_1|>
def next(... | stack_v2_sparse_classes_36k_train_010290 | 2,253 | no_license | [
{
"docstring": "Initialize your data structure here. :type iterator: Iterator",
"name": "__init__",
"signature": "def __init__(self, iterator)"
},
{
"docstring": "Returns the next element in the iteration without advancing the iterator. :rtype: int",
"name": "peek",
"signature": "def pee... | 4 | stack_v2_sparse_classes_30k_train_009248 | Implement the Python class `PeekingIterator` described below.
Class description:
Implement the PeekingIterator class.
Method signatures and docstrings:
- def __init__(self, iterator): Initialize your data structure here. :type iterator: Iterator
- def peek(self): Returns the next element in the iteration without adva... | Implement the Python class `PeekingIterator` described below.
Class description:
Implement the PeekingIterator class.
Method signatures and docstrings:
- def __init__(self, iterator): Initialize your data structure here. :type iterator: Iterator
- def peek(self): Returns the next element in the iteration without adva... | e07b85a4121f2665393f1176befbdbe06f1e1ad0 | <|skeleton|>
class PeekingIterator:
def __init__(self, iterator):
"""Initialize your data structure here. :type iterator: Iterator"""
<|body_0|>
def peek(self):
"""Returns the next element in the iteration without advancing the iterator. :rtype: int"""
<|body_1|>
def next(... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class PeekingIterator:
def __init__(self, iterator):
"""Initialize your data structure here. :type iterator: Iterator"""
self.__iterator = iterator
self.__has_peeked = False
self.__next_value = None
def peek(self):
"""Returns the next element in the iteration without adv... | the_stack_v2_python_sparse | Algorithms/peeking-iterator.py | feilniu/LeetCode | train | 0 | |
a269b48ae28189a78ab5a3872f5a97437aa33052 | [
"self.act = eval(act)\nself.actstr = act\nself.n_inp = n_inp\nself.n_out = n_out\nself.params = []",
"ry = y.reshape((y.shape[0], self.n_inp, self.n_out))\nrx = x.reshape((x.shape[0], x.shape[1], 1))\nreturn self.act((rx * ry).sum(1))"
] | <|body_start_0|>
self.act = eval(act)
self.actstr = act
self.n_inp = n_inp
self.n_out = n_out
self.params = []
<|end_body_0|>
<|body_start_1|>
ry = y.reshape((y.shape[0], self.n_inp, self.n_out))
rx = x.reshape((x.shape[0], x.shape[1], 1))
return self.act... | Class for a layer with two input vectors, the 'right' member being a flat representation of a matrix on which to perform the dot product with the 'left' vector [Structured Embeddings model, Bordes et al. AAAI 2011]. | LayerMat | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class LayerMat:
"""Class for a layer with two input vectors, the 'right' member being a flat representation of a matrix on which to perform the dot product with the 'left' vector [Structured Embeddings model, Bordes et al. AAAI 2011]."""
def __init__(self, act, n_inp, n_out):
"""Constructo... | stack_v2_sparse_classes_36k_train_010291 | 46,645 | permissive | [
{
"docstring": "Constructor. :param act: name of the activation function ('lin', 'rect', 'tanh' or 'sigm'). :param n_inp: input dimension. :param n_out: output dimension. :note: there is no parameter declared in this layer, the parameters are the embeddings of the 'right' member, therefore their dimension have ... | 2 | stack_v2_sparse_classes_30k_train_005668 | Implement the Python class `LayerMat` described below.
Class description:
Class for a layer with two input vectors, the 'right' member being a flat representation of a matrix on which to perform the dot product with the 'left' vector [Structured Embeddings model, Bordes et al. AAAI 2011].
Method signatures and docstr... | Implement the Python class `LayerMat` described below.
Class description:
Class for a layer with two input vectors, the 'right' member being a flat representation of a matrix on which to perform the dot product with the 'left' vector [Structured Embeddings model, Bordes et al. AAAI 2011].
Method signatures and docstr... | 54b4c07fb9cf39a0fc84f5e384a9fc855f9d016f | <|skeleton|>
class LayerMat:
"""Class for a layer with two input vectors, the 'right' member being a flat representation of a matrix on which to perform the dot product with the 'left' vector [Structured Embeddings model, Bordes et al. AAAI 2011]."""
def __init__(self, act, n_inp, n_out):
"""Constructo... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class LayerMat:
"""Class for a layer with two input vectors, the 'right' member being a flat representation of a matrix on which to perform the dot product with the 'left' vector [Structured Embeddings model, Bordes et al. AAAI 2011]."""
def __init__(self, act, n_inp, n_out):
"""Constructor. :param act... | the_stack_v2_python_sparse | SME/model.py | thjashin/kblearn | train | 3 |
08e1035eb93b535d100b024162fe9b22452ef3b5 | [
"try:\n parameter = self.app.parameter_api.getParameter(cherrypy.request.db, name)\n response = {'globalparameter': parameter.getCleanDict()}\nexcept Exception as ex:\n self._logger.error(str(ex))\n self.handleException(ex)\n response = self.errorResponse(str(ex))\nreturn self.formatResponse(response... | <|body_start_0|>
try:
parameter = self.app.parameter_api.getParameter(cherrypy.request.db, name)
response = {'globalparameter': parameter.getCleanDict()}
except Exception as ex:
self._logger.error(str(ex))
self.handleException(ex)
response = se... | Admin parameter controller class. | ParameterController | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ParameterController:
"""Admin parameter controller class."""
def getParameter(self, name):
"""Return info for the specified parameter."""
<|body_0|>
def getParameterList(self):
"""Return all known parameters."""
<|body_1|>
def createParameter(self):
... | stack_v2_sparse_classes_36k_train_010292 | 5,620 | permissive | [
{
"docstring": "Return info for the specified parameter.",
"name": "getParameter",
"signature": "def getParameter(self, name)"
},
{
"docstring": "Return all known parameters.",
"name": "getParameterList",
"signature": "def getParameterList(self)"
},
{
"docstring": "Creates a para... | 5 | null | Implement the Python class `ParameterController` described below.
Class description:
Admin parameter controller class.
Method signatures and docstrings:
- def getParameter(self, name): Return info for the specified parameter.
- def getParameterList(self): Return all known parameters.
- def createParameter(self): Crea... | Implement the Python class `ParameterController` described below.
Class description:
Admin parameter controller class.
Method signatures and docstrings:
- def getParameter(self, name): Return info for the specified parameter.
- def getParameterList(self): Return all known parameters.
- def createParameter(self): Crea... | 56d808d7836cd15d6c6748cbf704cdea4407fef6 | <|skeleton|>
class ParameterController:
"""Admin parameter controller class."""
def getParameter(self, name):
"""Return info for the specified parameter."""
<|body_0|>
def getParameterList(self):
"""Return all known parameters."""
<|body_1|>
def createParameter(self):
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ParameterController:
"""Admin parameter controller class."""
def getParameter(self, name):
"""Return info for the specified parameter."""
try:
parameter = self.app.parameter_api.getParameter(cherrypy.request.db, name)
response = {'globalparameter': parameter.getCle... | the_stack_v2_python_sparse | src/installer/src/tortuga/web_service/controllers/parameterController.py | UnivaCorporation/tortuga | train | 33 |
6b2d1c3cdbbaec9e7c21a44fddb5607987482fbe | [
"url = f'{COZA_HOST}/exchanges'\nexchange_li = _request(url, 'GET')\nexchange_info = {}\nfor exchange in exchange_li['results']:\n currency_li = []\n if exchange['name'] not in exchange_info.keys():\n for currency in exchange['currencies']:\n currency_li.append(currency['label'])\n ex... | <|body_start_0|>
url = f'{COZA_HOST}/exchanges'
exchange_li = _request(url, 'GET')
exchange_info = {}
for exchange in exchange_li['results']:
currency_li = []
if exchange['name'] not in exchange_info.keys():
for currency in exchange['currencies']:
... | ExchangeApi | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ExchangeApi:
def get_exchange_info(cls):
"""Get COZA Service exchange and curreny info Args: None Returns: exchange_info(dict)"""
<|body_0|>
def get_ticker(cls, exchange, currency):
"""Get current ticker Args: exchange(str): Cryptocurrency exchagne name currency(str)... | stack_v2_sparse_classes_36k_train_010293 | 6,257 | permissive | [
{
"docstring": "Get COZA Service exchange and curreny info Args: None Returns: exchange_info(dict)",
"name": "get_exchange_info",
"signature": "def get_exchange_info(cls)"
},
{
"docstring": "Get current ticker Args: exchange(str): Cryptocurrency exchagne name currency(str): Cryptocurrency name R... | 4 | stack_v2_sparse_classes_30k_train_002894 | Implement the Python class `ExchangeApi` described below.
Class description:
Implement the ExchangeApi class.
Method signatures and docstrings:
- def get_exchange_info(cls): Get COZA Service exchange and curreny info Args: None Returns: exchange_info(dict)
- def get_ticker(cls, exchange, currency): Get current ticker... | Implement the Python class `ExchangeApi` described below.
Class description:
Implement the ExchangeApi class.
Method signatures and docstrings:
- def get_exchange_info(cls): Get COZA Service exchange and curreny info Args: None Returns: exchange_info(dict)
- def get_ticker(cls, exchange, currency): Get current ticker... | 1068c33fdbd55bc7e8e0968fcee62ef0786ff323 | <|skeleton|>
class ExchangeApi:
def get_exchange_info(cls):
"""Get COZA Service exchange and curreny info Args: None Returns: exchange_info(dict)"""
<|body_0|>
def get_ticker(cls, exchange, currency):
"""Get current ticker Args: exchange(str): Cryptocurrency exchagne name currency(str)... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ExchangeApi:
def get_exchange_info(cls):
"""Get COZA Service exchange and curreny info Args: None Returns: exchange_info(dict)"""
url = f'{COZA_HOST}/exchanges'
exchange_li = _request(url, 'GET')
exchange_info = {}
for exchange in exchange_li['results']:
cur... | the_stack_v2_python_sparse | coza/api/public.py | Derek-tjhwang/CATS-LAB | train | 2 | |
ce999115e2a20719a8a68a1b8221a9815fa4ff99 | [
"pairs = []\nfor i in range(len(nums1)):\n for j in range(len(nums2)):\n pairs.append([nums1[i], nums2[j]])\npairs.sort(key=lambda x: x[0] + x[1])\nres = pairs[:k]\nreturn res",
"if not nums1 or not nums2:\n return []\nn, res, cnt, heap = (len(nums2), [], 0, [(nums1[i] + nums2[0], i, 0) for i in rang... | <|body_start_0|>
pairs = []
for i in range(len(nums1)):
for j in range(len(nums2)):
pairs.append([nums1[i], nums2[j]])
pairs.sort(key=lambda x: x[0] + x[1])
res = pairs[:k]
return res
<|end_body_0|>
<|body_start_1|>
if not nums1 or not nums2:
... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def kSmallestPairs(self, nums1, nums2, k):
""":type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]]"""
<|body_0|>
def kSmallestPairs3(self, nums1, nums2, k):
""":type nums1: List[int] :type nums2: List[int] :type k: int :rtype: ... | stack_v2_sparse_classes_36k_train_010294 | 1,712 | no_license | [
{
"docstring": ":type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]]",
"name": "kSmallestPairs",
"signature": "def kSmallestPairs(self, nums1, nums2, k)"
},
{
"docstring": ":type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]]",
"nam... | 2 | stack_v2_sparse_classes_30k_train_001137 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def kSmallestPairs(self, nums1, nums2, k): :type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]]
- def kSmallestPairs3(self, nums1, nums2, k): :type ... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def kSmallestPairs(self, nums1, nums2, k): :type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]]
- def kSmallestPairs3(self, nums1, nums2, k): :type ... | 0fc4c7af59246e3064db41989a45d9db413a624b | <|skeleton|>
class Solution:
def kSmallestPairs(self, nums1, nums2, k):
""":type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]]"""
<|body_0|>
def kSmallestPairs3(self, nums1, nums2, k):
""":type nums1: List[int] :type nums2: List[int] :type k: int :rtype: ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def kSmallestPairs(self, nums1, nums2, k):
""":type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]]"""
pairs = []
for i in range(len(nums1)):
for j in range(len(nums2)):
pairs.append([nums1[i], nums2[j]])
pairs.... | the_stack_v2_python_sparse | 373. Find K Pairs with Smallest Sums/kpairs.py | Macielyoung/LeetCode | train | 1 | |
93c94f963dd159afc1f0022f299cde4d76d96c02 | [
"base_env = _DiscreteEnvironmentOneReward(action_dtype=np.int64, reward_spec=specs.Array(dtype=np.float32, shape=()))\nwrapped_env = wrappers.DelayedRewardWrapper(base_env, accumulation_period=1)\nbase_episode_reward = _episode_reward(base_env)\nwrapped_episode_reward = _episode_reward(wrapped_env)\nself.assertEqua... | <|body_start_0|>
base_env = _DiscreteEnvironmentOneReward(action_dtype=np.int64, reward_spec=specs.Array(dtype=np.float32, shape=()))
wrapped_env = wrappers.DelayedRewardWrapper(base_env, accumulation_period=1)
base_episode_reward = _episode_reward(base_env)
wrapped_episode_reward = _epi... | DelayedRewardTest | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class DelayedRewardTest:
def test_noop(self):
"""Ensure when accumulation_period=1 it does not change anything."""
<|body_0|>
def test_noop_composite_reward(self):
"""No-op test with composite rewards."""
<|body_1|>
def test_same_episode_composite_reward(self,... | stack_v2_sparse_classes_36k_train_010295 | 3,312 | permissive | [
{
"docstring": "Ensure when accumulation_period=1 it does not change anything.",
"name": "test_noop",
"signature": "def test_noop(self)"
},
{
"docstring": "No-op test with composite rewards.",
"name": "test_noop_composite_reward",
"signature": "def test_noop_composite_reward(self)"
},
... | 3 | stack_v2_sparse_classes_30k_train_006859 | Implement the Python class `DelayedRewardTest` described below.
Class description:
Implement the DelayedRewardTest class.
Method signatures and docstrings:
- def test_noop(self): Ensure when accumulation_period=1 it does not change anything.
- def test_noop_composite_reward(self): No-op test with composite rewards.
-... | Implement the Python class `DelayedRewardTest` described below.
Class description:
Implement the DelayedRewardTest class.
Method signatures and docstrings:
- def test_noop(self): Ensure when accumulation_period=1 it does not change anything.
- def test_noop_composite_reward(self): No-op test with composite rewards.
-... | 97c50eaa62c039d8f4b9efa3e80c4d80e6f40c4c | <|skeleton|>
class DelayedRewardTest:
def test_noop(self):
"""Ensure when accumulation_period=1 it does not change anything."""
<|body_0|>
def test_noop_composite_reward(self):
"""No-op test with composite rewards."""
<|body_1|>
def test_same_episode_composite_reward(self,... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class DelayedRewardTest:
def test_noop(self):
"""Ensure when accumulation_period=1 it does not change anything."""
base_env = _DiscreteEnvironmentOneReward(action_dtype=np.int64, reward_spec=specs.Array(dtype=np.float32, shape=()))
wrapped_env = wrappers.DelayedRewardWrapper(base_env, accumu... | the_stack_v2_python_sparse | acme/wrappers/delayed_reward_test.py | RaoulDrake/acme | train | 0 | |
ecf3de429a45023869936515b8287a4c11bf7fd2 | [
"self.difficulty = difficulty\nwith open('/ws/src/usercode/python/cic/bayesian_opt/content/pos.pkl', 'rb') as f:\n init_arr_params = pkl.load(f)\nwith open('/ws/src/usercode/python/cic/bayesian_opt/content/iter_idx.txt', 'r') as f:\n curr_idx = int(f.readline())\nself.init_information = np.asarray(init_arr_pa... | <|body_start_0|>
self.difficulty = difficulty
with open('/ws/src/usercode/python/cic/bayesian_opt/content/pos.pkl', 'rb') as f:
init_arr_params = pkl.load(f)
with open('/ws/src/usercode/python/cic/bayesian_opt/content/iter_idx.txt', 'r') as f:
curr_idx = int(f.readline())... | Initializer that is based on some generated file that needs to be loaded,... | BOInitializer | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class BOInitializer:
"""Initializer that is based on some generated file that needs to be loaded,..."""
def __init__(self, difficulty):
"""Initialize. Args: difficulty (int): Difficulty level for sampling goals."""
<|body_0|>
def get_initial_state(self):
"""Get the ini... | stack_v2_sparse_classes_36k_train_010296 | 8,555 | permissive | [
{
"docstring": "Initialize. Args: difficulty (int): Difficulty level for sampling goals.",
"name": "__init__",
"signature": "def __init__(self, difficulty)"
},
{
"docstring": "Get the initial position based on the information from the file. Do not read z coordinate to ensure that this position i... | 3 | null | Implement the Python class `BOInitializer` described below.
Class description:
Initializer that is based on some generated file that needs to be loaded,...
Method signatures and docstrings:
- def __init__(self, difficulty): Initialize. Args: difficulty (int): Difficulty level for sampling goals.
- def get_initial_sta... | Implement the Python class `BOInitializer` described below.
Class description:
Initializer that is based on some generated file that needs to be loaded,...
Method signatures and docstrings:
- def __init__(self, difficulty): Initialize. Args: difficulty (int): Difficulty level for sampling goals.
- def get_initial_sta... | 6fb12eecbaa778c60c5728dba4414330c901b09b | <|skeleton|>
class BOInitializer:
"""Initializer that is based on some generated file that needs to be loaded,..."""
def __init__(self, difficulty):
"""Initialize. Args: difficulty (int): Difficulty level for sampling goals."""
<|body_0|>
def get_initial_state(self):
"""Get the ini... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class BOInitializer:
"""Initializer that is based on some generated file that needs to be loaded,..."""
def __init__(self, difficulty):
"""Initialize. Args: difficulty (int): Difficulty level for sampling goals."""
self.difficulty = difficulty
with open('/ws/src/usercode/python/cic/baye... | the_stack_v2_python_sparse | python/env/initializers.py | cbschaff/benchmark-rrc | train | 12 |
bbd594ef8aebdabf65938675e2cca8ab0becc35a | [
"if self.name:\n res = self.name\nelif self.ID:\n res = self.ID\nelse:\n res = '%s_%s' % (self.__class__.__name__, '%x' % id(self))\nreturn res.encode('ascii', 'ignore')",
"try:\n return self.iterChildrenOfType(VOTable.DESCRIPTION).next().text_\nexcept StopIteration:\n return ''"
] | <|body_start_0|>
if self.name:
res = self.name
elif self.ID:
res = self.ID
else:
res = '%s_%s' % (self.__class__.__name__, '%x' % id(self))
return res.encode('ascii', 'ignore')
<|end_body_0|>
<|body_start_1|>
try:
return self.iterC... | _DescribedElement | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class _DescribedElement:
def getDesignation(self):
"""returns some name-like thing for a FIELD or PARAM."""
<|body_0|>
def getDescription(self):
"""returns the description for this element, or an empty string."""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
... | stack_v2_sparse_classes_36k_train_010297 | 10,751 | no_license | [
{
"docstring": "returns some name-like thing for a FIELD or PARAM.",
"name": "getDesignation",
"signature": "def getDesignation(self)"
},
{
"docstring": "returns the description for this element, or an empty string.",
"name": "getDescription",
"signature": "def getDescription(self)"
}
... | 2 | null | Implement the Python class `_DescribedElement` described below.
Class description:
Implement the _DescribedElement class.
Method signatures and docstrings:
- def getDesignation(self): returns some name-like thing for a FIELD or PARAM.
- def getDescription(self): returns the description for this element, or an empty s... | Implement the Python class `_DescribedElement` described below.
Class description:
Implement the _DescribedElement class.
Method signatures and docstrings:
- def getDesignation(self): returns some name-like thing for a FIELD or PARAM.
- def getDescription(self): returns the description for this element, or an empty s... | fda6229266e93826d4fed2065ac6c5228f9e0c61 | <|skeleton|>
class _DescribedElement:
def getDesignation(self):
"""returns some name-like thing for a FIELD or PARAM."""
<|body_0|>
def getDescription(self):
"""returns the description for this element, or an empty string."""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class _DescribedElement:
def getDesignation(self):
"""returns some name-like thing for a FIELD or PARAM."""
if self.name:
res = self.name
elif self.ID:
res = self.ID
else:
res = '%s_%s' % (self.__class__.__name__, '%x' % id(self))
return re... | the_stack_v2_python_sparse | votable/model.py | ChileanVirtualObservatory/vo.chivo.cl | train | 0 | |
0d7e860572fa570d766f2c195fd2d3e9d5b66f30 | [
"def helper(preorder, inorder):\n if not inorder:\n return None\n root_val = preorder.popleft()\n root = TreeNode(root_val)\n idx = inorder.index(root_val)\n root.left = helper(preorder, inorder[:idx])\n root.right = helper(preorder, inorder[idx + 1:])\n return root\nreturn helper(deque(... | <|body_start_0|>
def helper(preorder, inorder):
if not inorder:
return None
root_val = preorder.popleft()
root = TreeNode(root_val)
idx = inorder.index(root_val)
root.left = helper(preorder, inorder[:idx])
root.right = helpe... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def buildTree2(self, preorder, inorder):
""":type preorder: List[int] :type inorder: List[int] :rtype: TreeNode"""
<|body_0|>
def buildTree(self, preorder, inorder):
""":type preorder: List[int] :type inorder: List[int] :rtype: TreeNode"""
<|body_1|... | stack_v2_sparse_classes_36k_train_010298 | 2,248 | no_license | [
{
"docstring": ":type preorder: List[int] :type inorder: List[int] :rtype: TreeNode",
"name": "buildTree2",
"signature": "def buildTree2(self, preorder, inorder)"
},
{
"docstring": ":type preorder: List[int] :type inorder: List[int] :rtype: TreeNode",
"name": "buildTree",
"signature": "d... | 2 | stack_v2_sparse_classes_30k_train_001756 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def buildTree2(self, preorder, inorder): :type preorder: List[int] :type inorder: List[int] :rtype: TreeNode
- def buildTree(self, preorder, inorder): :type preorder: List[int] :... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def buildTree2(self, preorder, inorder): :type preorder: List[int] :type inorder: List[int] :rtype: TreeNode
- def buildTree(self, preorder, inorder): :type preorder: List[int] :... | b77130a0133cd40990c4d7096db5e388de67cbf2 | <|skeleton|>
class Solution:
def buildTree2(self, preorder, inorder):
""":type preorder: List[int] :type inorder: List[int] :rtype: TreeNode"""
<|body_0|>
def buildTree(self, preorder, inorder):
""":type preorder: List[int] :type inorder: List[int] :rtype: TreeNode"""
<|body_1|... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def buildTree2(self, preorder, inorder):
""":type preorder: List[int] :type inorder: List[int] :rtype: TreeNode"""
def helper(preorder, inorder):
if not inorder:
return None
root_val = preorder.popleft()
root = TreeNode(root_val)
... | the_stack_v2_python_sparse | 105.ConstructBinaryTreefromPreorderandInorderTraversal.py | flavorfan/MyLeetCode | train | 0 | |
170fa266b43c5d476390711b03c322341e98b2bb | [
"u = np.linalg.norm(x, 2)\nif u != 0:\n aux_b = x[0] + np.sign(x[0]) * u\n x = x[1:] / aux_b\n x = np.concatenate((np.array([1]), x))\nreturn x",
"b = -2 / np.dot(v.T, v)\nw = b * np.dot(RA.T, v)\nw = w.reshape(1, -1)\nv = v.reshape(-1, 1)\nRA = RA + v * w\nB = RA\nreturn B"
] | <|body_start_0|>
u = np.linalg.norm(x, 2)
if u != 0:
aux_b = x[0] + np.sign(x[0]) * u
x = x[1:] / aux_b
x = np.concatenate((np.array([1]), x))
return x
<|end_body_0|>
<|body_start_1|>
b = -2 / np.dot(v.T, v)
w = b * np.dot(RA.T, v)
w =... | Householder reflection and transformation. | Orthogonalization | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Orthogonalization:
"""Householder reflection and transformation."""
def house(self, x):
"""Perform a Householder reflection of vector. Parameters ---------- x : array-like of shape = number_of_training_samples The respective column of the matrix of regressors in each iteration of ERR... | stack_v2_sparse_classes_36k_train_010299 | 34,366 | permissive | [
{
"docstring": "Perform a Householder reflection of vector. Parameters ---------- x : array-like of shape = number_of_training_samples The respective column of the matrix of regressors in each iteration of ERR function. Returns ------- v : array-like of shape = number_of_training_samples The reflection of the a... | 2 | stack_v2_sparse_classes_30k_train_005439 | Implement the Python class `Orthogonalization` described below.
Class description:
Householder reflection and transformation.
Method signatures and docstrings:
- def house(self, x): Perform a Householder reflection of vector. Parameters ---------- x : array-like of shape = number_of_training_samples The respective co... | Implement the Python class `Orthogonalization` described below.
Class description:
Householder reflection and transformation.
Method signatures and docstrings:
- def house(self, x): Perform a Householder reflection of vector. Parameters ---------- x : array-like of shape = number_of_training_samples The respective co... | 736d9193a325d6251bd6e8e728b66ec76ba3d42d | <|skeleton|>
class Orthogonalization:
"""Householder reflection and transformation."""
def house(self, x):
"""Perform a Householder reflection of vector. Parameters ---------- x : array-like of shape = number_of_training_samples The respective column of the matrix of regressors in each iteration of ERR... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Orthogonalization:
"""Householder reflection and transformation."""
def house(self, x):
"""Perform a Householder reflection of vector. Parameters ---------- x : array-like of shape = number_of_training_samples The respective column of the matrix of regressors in each iteration of ERR function. Re... | the_stack_v2_python_sparse | sysidentpy/narmax_base.py | wilsonrljr/sysidentpy | train | 251 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.