blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
7.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
467
8.64k
id
stringlengths
40
40
length_bytes
int64
515
49.7k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
160
3.93k
prompted_full_text
stringlengths
681
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.09k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
331
8.3k
source
stringclasses
1 value
source_path
stringlengths
5
177
source_repo
stringlengths
6
88
split
stringclasses
1 value
star_events_count
int64
0
209k
18d716877f083c49a62db27fb61836cb05c93ddc
[ "l = len(nums)\ni = 0\nwhile i < l:\n j = i + 1\n while j < l:\n if nums[i] == nums[j]:\n return nums[i]\n j += 1\n i += 1\nreturn 0", "l = len(nums)\nfast = nums[nums[0]]\nslow = nums[0]\nwhile fast != slow:\n fast = nums[nums[fast]]\n slow = nums[slow]\nfast = 0\nwhile fa...
<|body_start_0|> l = len(nums) i = 0 while i < l: j = i + 1 while j < l: if nums[i] == nums[j]: return nums[i] j += 1 i += 1 return 0 <|end_body_0|> <|body_start_1|> l = len(nums) fas...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findDuplicate1(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findDuplicate(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> l = len(nums) i = 0 whil...
stack_v2_sparse_classes_10k_train_008000
1,495
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "findDuplicate1", "signature": "def findDuplicate1(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "findDuplicate", "signature": "def findDuplicate(self, nums)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findDuplicate1(self, nums): :type nums: List[int] :rtype: int - def findDuplicate(self, nums): :type nums: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findDuplicate1(self, nums): :type nums: List[int] :rtype: int - def findDuplicate(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: def findDu...
e5b018493bbd12edcdcd0434f35d9c358106d391
<|skeleton|> class Solution: def findDuplicate1(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findDuplicate(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def findDuplicate1(self, nums): """:type nums: List[int] :rtype: int""" l = len(nums) i = 0 while i < l: j = i + 1 while j < l: if nums[i] == nums[j]: return nums[i] j += 1 i += 1 ...
the_stack_v2_python_sparse
py/leetcode/287.py
wfeng1991/learnpy
train
0
594f253eadf5775d70fc88558aaf3ed584f45560
[ "random.seed(102938482634)\npoint_cloud = load(os.path.join('testdata', 'AHN3.las'))\nnum_all_pc_points = len(point_cloud[keys.point]['x']['data'])\nrand_indices = [random.randint(0, num_all_pc_points) for _ in range(20)]\ntarget_point_cloud = utils.copy_point_cloud(point_cloud, rand_indices)\nradius = 2.5\nneighbo...
<|body_start_0|> random.seed(102938482634) point_cloud = load(os.path.join('testdata', 'AHN3.las')) num_all_pc_points = len(point_cloud[keys.point]['x']['data']) rand_indices = [random.randint(0, num_all_pc_points) for _ in range(20)] target_point_cloud = utils.copy_point_cloud(p...
TestExtractEigenValues
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestExtractEigenValues: def test_eigenvalues_in_cylinders(self): """Test provenance added (This should actually be part the general feature extractor test suite).""" <|body_0|> def test_eigenvalues_of_too_few_points_results_in_0(): """If there are too few points to c...
stack_v2_sparse_classes_10k_train_008001
11,643
permissive
[ { "docstring": "Test provenance added (This should actually be part the general feature extractor test suite).", "name": "test_eigenvalues_in_cylinders", "signature": "def test_eigenvalues_in_cylinders(self)" }, { "docstring": "If there are too few points to calculate the eigen values don't outp...
2
stack_v2_sparse_classes_30k_val_000139
Implement the Python class `TestExtractEigenValues` described below. Class description: Implement the TestExtractEigenValues class. Method signatures and docstrings: - def test_eigenvalues_in_cylinders(self): Test provenance added (This should actually be part the general feature extractor test suite). - def test_eig...
Implement the Python class `TestExtractEigenValues` described below. Class description: Implement the TestExtractEigenValues class. Method signatures and docstrings: - def test_eigenvalues_in_cylinders(self): Test provenance added (This should actually be part the general feature extractor test suite). - def test_eig...
f6c22841dcbd375639c7f7aecec70f2602b91ee4
<|skeleton|> class TestExtractEigenValues: def test_eigenvalues_in_cylinders(self): """Test provenance added (This should actually be part the general feature extractor test suite).""" <|body_0|> def test_eigenvalues_of_too_few_points_results_in_0(): """If there are too few points to c...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TestExtractEigenValues: def test_eigenvalues_in_cylinders(self): """Test provenance added (This should actually be part the general feature extractor test suite).""" random.seed(102938482634) point_cloud = load(os.path.join('testdata', 'AHN3.las')) num_all_pc_points = len(point...
the_stack_v2_python_sparse
laserchicken/feature_extractor/test_eigenvals_feature_extractor.py
eEcoLiDAR/laserchicken
train
28
fe73898049aeb6bce9342b9ae04cba78be372394
[ "self.gettext_domain = 'screen-resolution-extra'\ngettext.textdomain(self.gettext_domain)\nself.init_strings()", "result = unicode(gettext.gettext(str), 'UTF-8')\nif convert_keybindings:\n result = self.convert_keybindings(result)\nreturn result", "self.string_permission_text = self._('Monitor Resolution Set...
<|body_start_0|> self.gettext_domain = 'screen-resolution-extra' gettext.textdomain(self.gettext_domain) self.init_strings() <|end_body_0|> <|body_start_1|> result = unicode(gettext.gettext(str), 'UTF-8') if convert_keybindings: result = self.convert_keybindings(resu...
Abstract user interface. This encapsulates the entire program logic and all strings, but does not implement any concrete user interface.
AbstractUI
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AbstractUI: """Abstract user interface. This encapsulates the entire program logic and all strings, but does not implement any concrete user interface.""" def __init__(self): """Initialize system.""" <|body_0|> def _(self, str, convert_keybindings=False): """Keyb...
stack_v2_sparse_classes_10k_train_008002
2,804
no_license
[ { "docstring": "Initialize system.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Keyboard accelerator aware gettext() wrapper. This optionally converts keyboard accelerators to the appropriate format for the frontend. All strings in the source code should use the '_'...
3
null
Implement the Python class `AbstractUI` described below. Class description: Abstract user interface. This encapsulates the entire program logic and all strings, but does not implement any concrete user interface. Method signatures and docstrings: - def __init__(self): Initialize system. - def _(self, str, convert_key...
Implement the Python class `AbstractUI` described below. Class description: Abstract user interface. This encapsulates the entire program logic and all strings, but does not implement any concrete user interface. Method signatures and docstrings: - def __init__(self): Initialize system. - def _(self, str, convert_key...
d08f7bf370a82b6970387bb9f165d374a9d9092b
<|skeleton|> class AbstractUI: """Abstract user interface. This encapsulates the entire program logic and all strings, but does not implement any concrete user interface.""" def __init__(self): """Initialize system.""" <|body_0|> def _(self, str, convert_keybindings=False): """Keyb...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AbstractUI: """Abstract user interface. This encapsulates the entire program logic and all strings, but does not implement any concrete user interface.""" def __init__(self): """Initialize system.""" self.gettext_domain = 'screen-resolution-extra' gettext.textdomain(self.gettext_d...
the_stack_v2_python_sparse
usr/share/pyshared/ScreenResolution/ui.py
haniokasai/netwalker-rootfs
train
2
7a87f9c55b7753fd63557ef72ee8a5708aa00ffb
[ "self.num_spkrs = num_spkrs\nself.perm_choices = []\ninitial_seq = np.linspace(0, num_spkrs - 1, num_spkrs, dtype=np.int64)\nself.permutationDFS(initial_seq, 0)\nself.loss_perm_idx = np.linspace(0, num_spkrs * (num_spkrs - 1), num_spkrs, dtype=np.int64).reshape(1, num_spkrs)\nself.loss_perm_idx = (self.loss_perm_id...
<|body_start_0|> self.num_spkrs = num_spkrs self.perm_choices = [] initial_seq = np.linspace(0, num_spkrs - 1, num_spkrs, dtype=np.int64) self.permutationDFS(initial_seq, 0) self.loss_perm_idx = np.linspace(0, num_spkrs * (num_spkrs - 1), num_spkrs, dtype=np.int64).reshape(1, num...
Permutation Invariant Training (PIT) module. :parameter int num_spkrs: number of speakers for PIT process (2 or 3)
PIT
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PIT: """Permutation Invariant Training (PIT) module. :parameter int num_spkrs: number of speakers for PIT process (2 or 3)""" def __init__(self, num_spkrs): """Initialize PIT module.""" <|body_0|> def min_pit_sample(self, loss): """Compute the PIT loss for each s...
stack_v2_sparse_classes_10k_train_008003
30,819
permissive
[ { "docstring": "Initialize PIT module.", "name": "__init__", "signature": "def __init__(self, num_spkrs)" }, { "docstring": "Compute the PIT loss for each sample. :param 1-D torch.Tensor loss: list of losses for one sample, including [h1r1, h1r2, h2r1, h2r2] or [h1r1, h1r2, h1r3, h2r1, h2r2, h2r...
4
stack_v2_sparse_classes_30k_train_004805
Implement the Python class `PIT` described below. Class description: Permutation Invariant Training (PIT) module. :parameter int num_spkrs: number of speakers for PIT process (2 or 3) Method signatures and docstrings: - def __init__(self, num_spkrs): Initialize PIT module. - def min_pit_sample(self, loss): Compute th...
Implement the Python class `PIT` described below. Class description: Permutation Invariant Training (PIT) module. :parameter int num_spkrs: number of speakers for PIT process (2 or 3) Method signatures and docstrings: - def __init__(self, num_spkrs): Initialize PIT module. - def min_pit_sample(self, loss): Compute th...
bcd20948db7846ee523443ef9fd78c7a1248c95e
<|skeleton|> class PIT: """Permutation Invariant Training (PIT) module. :parameter int num_spkrs: number of speakers for PIT process (2 or 3)""" def __init__(self, num_spkrs): """Initialize PIT module.""" <|body_0|> def min_pit_sample(self, loss): """Compute the PIT loss for each s...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PIT: """Permutation Invariant Training (PIT) module. :parameter int num_spkrs: number of speakers for PIT process (2 or 3)""" def __init__(self, num_spkrs): """Initialize PIT module.""" self.num_spkrs = num_spkrs self.perm_choices = [] initial_seq = np.linspace(0, num_spkr...
the_stack_v2_python_sparse
espnet/nets/pytorch_backend/e2e_asr_mix.py
espnet/espnet
train
7,242
975272fb32d6b908e02ef46ab80f47a3c88b4f48
[ "mod = 10 ** 9 + 7\ndp = [[0] * (k + 1) for _ in range(n + 1)]\nfor i in range(n + 1):\n dp[i][0] = 1\nfor i in range(2, n + 1):\n for j in range(1, k + 1):\n for p in range(max(j - i + 1, 0), j + 1):\n dp[i][j] += dp[i - 1][p]\nreturn dp[n][k] % mod", "mod = 10 ** 9 + 7\ndp = [[0] * (k + ...
<|body_start_0|> mod = 10 ** 9 + 7 dp = [[0] * (k + 1) for _ in range(n + 1)] for i in range(n + 1): dp[i][0] = 1 for i in range(2, n + 1): for j in range(1, k + 1): for p in range(max(j - i + 1, 0), j + 1): dp[i][j] += dp[i - 1...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def kInversePairs(self, n, k): """:type n: int :type k: int :rtype: int""" <|body_0|> def kInversePairs_(self, n, k): """:type n: int :type k: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> mod = 10 ** 9 + 7 dp = [...
stack_v2_sparse_classes_10k_train_008004
1,427
no_license
[ { "docstring": ":type n: int :type k: int :rtype: int", "name": "kInversePairs", "signature": "def kInversePairs(self, n, k)" }, { "docstring": ":type n: int :type k: int :rtype: int", "name": "kInversePairs_", "signature": "def kInversePairs_(self, n, k)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def kInversePairs(self, n, k): :type n: int :type k: int :rtype: int - def kInversePairs_(self, n, k): :type n: int :type k: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def kInversePairs(self, n, k): :type n: int :type k: int :rtype: int - def kInversePairs_(self, n, k): :type n: int :type k: int :rtype: int <|skeleton|> class Solution: de...
768edc4a5526c8972fec66c6a71a38c0b24a1451
<|skeleton|> class Solution: def kInversePairs(self, n, k): """:type n: int :type k: int :rtype: int""" <|body_0|> def kInversePairs_(self, n, k): """:type n: int :type k: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def kInversePairs(self, n, k): """:type n: int :type k: int :rtype: int""" mod = 10 ** 9 + 7 dp = [[0] * (k + 1) for _ in range(n + 1)] for i in range(n + 1): dp[i][0] = 1 for i in range(2, n + 1): for j in range(1, k + 1): ...
the_stack_v2_python_sparse
leetcode(多线程,DP,贪心,SQL)/二刷DP与贪心LeetCode/动态规划/629. K个逆序对数组/solution.py
faker-hong/testOne
train
1
d35203e58402430788deb9c5905e15c3a603bd1b
[ "super().__init__()\nself.name = name\nself.type = type\nself.description = description", "result = {}\nresult['type'] = self.type\nif self.description is not None:\n result['description'] = self.description\nreturn result" ]
<|body_start_0|> super().__init__() self.name = name self.type = type self.description = description <|end_body_0|> <|body_start_1|> result = {} result['type'] = self.type if self.description is not None: result['description'] = self.description ...
Base class for security schemes. A security scheme is required if security requirements and security schemes should be published in OpenAPI documents.
SecurityScheme
[ "Python-2.0", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SecurityScheme: """Base class for security schemes. A security scheme is required if security requirements and security schemes should be published in OpenAPI documents.""" def __init__(self, name, type, *, description=None, **kwargs): """Initialize the security scheme. :param name: ...
stack_v2_sparse_classes_10k_train_008005
3,415
permissive
[ { "docstring": "Initialize the security scheme. :param name: The name of the security scheme. :param type: The type of security scheme.", "name": "__init__", "signature": "def __init__(self, name, type, *, description=None, **kwargs)" }, { "docstring": "JSON representation of the security scheme...
2
stack_v2_sparse_classes_30k_train_000179
Implement the Python class `SecurityScheme` described below. Class description: Base class for security schemes. A security scheme is required if security requirements and security schemes should be published in OpenAPI documents. Method signatures and docstrings: - def __init__(self, name, type, *, description=None,...
Implement the Python class `SecurityScheme` described below. Class description: Base class for security schemes. A security scheme is required if security requirements and security schemes should be published in OpenAPI documents. Method signatures and docstrings: - def __init__(self, name, type, *, description=None,...
19e8d396aa9f3b6df28f773d06846d2bb58d1674
<|skeleton|> class SecurityScheme: """Base class for security schemes. A security scheme is required if security requirements and security schemes should be published in OpenAPI documents.""" def __init__(self, name, type, *, description=None, **kwargs): """Initialize the security scheme. :param name: ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SecurityScheme: """Base class for security schemes. A security scheme is required if security requirements and security schemes should be published in OpenAPI documents.""" def __init__(self, name, type, *, description=None, **kwargs): """Initialize the security scheme. :param name: The name of t...
the_stack_v2_python_sparse
src/roax/security.py
lliu8080/roax
train
0
ba095f8d49006181f7700d1b4b4db7099af1f932
[ "context = super(NewUserView, self).get_context_data(**kwargs)\nif 'user_is_active' in self.request.session:\n context['user_is_active'] = self.request.session['user_is_active']\nif 'user_is_none' in self.request.session:\n context['user_is_none'] = self.request.session['user_is_none']\nreturn context", "ne...
<|body_start_0|> context = super(NewUserView, self).get_context_data(**kwargs) if 'user_is_active' in self.request.session: context['user_is_active'] = self.request.session['user_is_active'] if 'user_is_none' in self.request.session: context['user_is_none'] = self.request...
Base generic view for user login or registration.
NewUserView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NewUserView: """Base generic view for user login or registration.""" def get_context_data(self, **kwargs): """Method for get_context_date implementing from generic.DetailView class.""" <|body_0|> def new_user_form_valid(self, form): """Method for new user registr...
stack_v2_sparse_classes_10k_train_008006
5,315
permissive
[ { "docstring": "Method for get_context_date implementing from generic.DetailView class.", "name": "get_context_data", "signature": "def get_context_data(self, **kwargs)" }, { "docstring": "Method for new user registration.", "name": "new_user_form_valid", "signature": "def new_user_form_...
3
stack_v2_sparse_classes_30k_train_000487
Implement the Python class `NewUserView` described below. Class description: Base generic view for user login or registration. Method signatures and docstrings: - def get_context_data(self, **kwargs): Method for get_context_date implementing from generic.DetailView class. - def new_user_form_valid(self, form): Method...
Implement the Python class `NewUserView` described below. Class description: Base generic view for user login or registration. Method signatures and docstrings: - def get_context_data(self, **kwargs): Method for get_context_date implementing from generic.DetailView class. - def new_user_form_valid(self, form): Method...
5effabfaee8ff5d1294d1b4de576cde718cd24ae
<|skeleton|> class NewUserView: """Base generic view for user login or registration.""" def get_context_data(self, **kwargs): """Method for get_context_date implementing from generic.DetailView class.""" <|body_0|> def new_user_form_valid(self, form): """Method for new user registr...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class NewUserView: """Base generic view for user login or registration.""" def get_context_data(self, **kwargs): """Method for get_context_date implementing from generic.DetailView class.""" context = super(NewUserView, self).get_context_data(**kwargs) if 'user_is_active' in self.reques...
the_stack_v2_python_sparse
user_account/views.py
piemar1/Schedule_django
train
0
b39c2636ecc0a419bab3a42117f8392ed86c90ea
[ "if not isinstance(q, np.ndarray):\n q = np.array(q)\nif q[0] != 0.0 or q[-1] != 1.0:\n raise RuntimeError('Invalid quantiles boundaries [' + ','.join([str(q[i]) for i in range(q.shape[0])]) + ']')\nif np.any(q[:-1] > q[1:]):\n raise RuntimeError('Quantile edges not increasing [' + ','.join([str(q[i]) for ...
<|body_start_0|> if not isinstance(q, np.ndarray): q = np.array(q) if q[0] != 0.0 or q[-1] != 1.0: raise RuntimeError('Invalid quantiles boundaries [' + ','.join([str(q[i]) for i in range(q.shape[0])]) + ']') if np.any(q[:-1] > q[1:]): raise RuntimeError('Quan...
Applies quantile binning -> provide quantile boundaries and bin histogram accordingly list of quantile values need to be optimized
Quantile
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Quantile: """Applies quantile binning -> provide quantile boundaries and bin histogram accordingly list of quantile values need to be optimized""" def __init__(self, h, q): """h : either TH1 or list of TH1 q : quantiles list [0 , ... 1]""" <|body_0|> def rebin_method(x, ...
stack_v2_sparse_classes_10k_train_008007
35,100
no_license
[ { "docstring": "h : either TH1 or list of TH1 q : quantiles list [0 , ... 1]", "name": "__init__", "signature": "def __init__(self, h, q)" }, { "docstring": "x: bin centers w: bin heights (bin content) q: quantiles", "name": "rebin_method", "signature": "def rebin_method(x, w, q)" } ]
2
stack_v2_sparse_classes_30k_train_002650
Implement the Python class `Quantile` described below. Class description: Applies quantile binning -> provide quantile boundaries and bin histogram accordingly list of quantile values need to be optimized Method signatures and docstrings: - def __init__(self, h, q): h : either TH1 or list of TH1 q : quantiles list [0...
Implement the Python class `Quantile` described below. Class description: Applies quantile binning -> provide quantile boundaries and bin histogram accordingly list of quantile values need to be optimized Method signatures and docstrings: - def __init__(self, h, q): h : either TH1 or list of TH1 q : quantiles list [0...
30df434202df51017309b5bf88a1d9b94041b6ef
<|skeleton|> class Quantile: """Applies quantile binning -> provide quantile boundaries and bin histogram accordingly list of quantile values need to be optimized""" def __init__(self, h, q): """h : either TH1 or list of TH1 q : quantiles list [0 , ... 1]""" <|body_0|> def rebin_method(x, ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Quantile: """Applies quantile binning -> provide quantile boundaries and bin histogram accordingly list of quantile values need to be optimized""" def __init__(self, h, q): """h : either TH1 or list of TH1 q : quantiles list [0 , ... 1]""" if not isinstance(q, np.ndarray): q =...
the_stack_v2_python_sparse
ZAStatAnalysis/Rebinning.py
kjaffel/ZA_FullAnalysis
train
11
71e1e1077b3efbd4d4171f92b6f98250f65a2cf9
[ "pygame.init()\nself.surface = pygame.display.set_mode((800, 600))\nnr_molecules = 50\nself.molecules = Molecules(nr_molecules, self.surface.get_size())", "clock = pygame.time.Clock()\nrunning = True\nwhile running:\n self.surface.fill((0, 0, 0))\n for event in pygame.event.get():\n if event.type == ...
<|body_start_0|> pygame.init() self.surface = pygame.display.set_mode((800, 600)) nr_molecules = 50 self.molecules = Molecules(nr_molecules, self.surface.get_size()) <|end_body_0|> <|body_start_1|> clock = pygame.time.Clock() running = True while running: ...
Gas_Simulation that simulates molecules moving and colliding
Gas_Simulation
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Gas_Simulation: """Gas_Simulation that simulates molecules moving and colliding""" def __init__(self): """Initalizes the Simulation""" <|body_0|> def run(self): """Runs the simulation until the program ends""" <|body_1|> <|end_skeleton|> <|body_start_0|...
stack_v2_sparse_classes_10k_train_008008
5,895
no_license
[ { "docstring": "Initalizes the Simulation", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Runs the simulation until the program ends", "name": "run", "signature": "def run(self)" } ]
2
stack_v2_sparse_classes_30k_train_007112
Implement the Python class `Gas_Simulation` described below. Class description: Gas_Simulation that simulates molecules moving and colliding Method signatures and docstrings: - def __init__(self): Initalizes the Simulation - def run(self): Runs the simulation until the program ends
Implement the Python class `Gas_Simulation` described below. Class description: Gas_Simulation that simulates molecules moving and colliding Method signatures and docstrings: - def __init__(self): Initalizes the Simulation - def run(self): Runs the simulation until the program ends <|skeleton|> class Gas_Simulation:...
dd8fec6f71b18aaa4a78e26a4afefc8c70327093
<|skeleton|> class Gas_Simulation: """Gas_Simulation that simulates molecules moving and colliding""" def __init__(self): """Initalizes the Simulation""" <|body_0|> def run(self): """Runs the simulation until the program ends""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Gas_Simulation: """Gas_Simulation that simulates molecules moving and colliding""" def __init__(self): """Initalizes the Simulation""" pygame.init() self.surface = pygame.display.set_mode((800, 600)) nr_molecules = 50 self.molecules = Molecules(nr_molecules, self.s...
the_stack_v2_python_sparse
Gas_Simulation.py
bterwijn/python
train
0
11d226e25ba32a603eb54d13f6d6f50cd7eec202
[ "if not root:\n return ''\nqueue = deque()\nqueue.append(root)\nres = str(root.val) + '_'\nwhile len(queue) > 0:\n node = queue.popleft()\n if node.left:\n queue.append(node.left)\n res += str(node.left.val) + '_'\n else:\n res += '#_'\n if node.right:\n queue.append(node....
<|body_start_0|> if not root: return '' queue = deque() queue.append(root) res = str(root.val) + '_' while len(queue) > 0: node = queue.popleft() if node.left: queue.append(node.left) res += str(node.left.val) + ...
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 前序遍历进行序列化https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/solution/er-cha-shu-de-xu-lie-hua-yu-fan-xu-lie-hua-by-leet/ :desc 对树的序列号和反序列化""" <|body_0|> ...
stack_v2_sparse_classes_10k_train_008009
2,880
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str 前序遍历进行序列化https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/solution/er-cha-shu-de-xu-lie-hua-yu-fan-xu-lie-hua-by-leet/ :desc 对树的序列号和反序列化", "name": "serialize", "signature": "def serialize(self, root...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str 前序遍历进行序列化https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/solution/...
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 前序遍历进行序列化https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/solution/...
08b3d9cab3c1806c37d36587372b1e8fb1683f64
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str 前序遍历进行序列化https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/solution/er-cha-shu-de-xu-lie-hua-yu-fan-xu-lie-hua-by-leet/ :desc 对树的序列号和反序列化""" <|body_0|> ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str 前序遍历进行序列化https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/solution/er-cha-shu-de-xu-lie-hua-yu-fan-xu-lie-hua-by-leet/ :desc 对树的序列号和反序列化""" if not root: re...
the_stack_v2_python_sparse
tree/297.Serialize-and-Deserialize-Binary-Tree.py
HonniLin/leetcode
train
0
7fbe69881af241448c7d33658d310a283fc0da69
[ "with Session() as lib:\n table_context = lib.virtualfile_from_data(check_kind='vector', data=data, x=x, y=y, z=z, required_z=False)\n with table_context as infile:\n if (outgrid := kwargs.get('G')) is None:\n kwargs.update({'>': outfile})\n lib.call_module(module='triangulate', args=...
<|body_start_0|> with Session() as lib: table_context = lib.virtualfile_from_data(check_kind='vector', data=data, x=x, y=y, z=z, required_z=False) with table_context as infile: if (outgrid := kwargs.get('G')) is None: kwargs.update({'>': outfile}) ...
Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data. Triangulate reads in x,y[,z] data and performs Delaunay triangulation, i.e., it finds how the points should be connected to give the most equilateral triangulation possible. If a map projection (give ``region`` and ``projection``) is chosen ...
triangulate
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class triangulate: """Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data. Triangulate reads in x,y[,z] data and performs Delaunay triangulation, i.e., it finds how the points should be connected to give the most equilateral triangulation possible. If a map projection (give ``...
stack_v2_sparse_classes_10k_train_008010
14,373
permissive
[ { "docstring": "Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data. Must provide ``outfile`` or ``outgrid``. Full option list at :gmt-docs:`triangulate.html` {aliases} Parameters ---------- x/y/z : np.ndarray Arrays of x and y coordinates and values z of the data points. data : str or...
3
stack_v2_sparse_classes_30k_train_006573
Implement the Python class `triangulate` described below. Class description: Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data. Triangulate reads in x,y[,z] data and performs Delaunay triangulation, i.e., it finds how the points should be connected to give the most equilateral triangulation...
Implement the Python class `triangulate` described below. Class description: Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data. Triangulate reads in x,y[,z] data and performs Delaunay triangulation, i.e., it finds how the points should be connected to give the most equilateral triangulation...
e4ee800e8045aa5f94ddaf7ad821421d007ab279
<|skeleton|> class triangulate: """Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data. Triangulate reads in x,y[,z] data and performs Delaunay triangulation, i.e., it finds how the points should be connected to give the most equilateral triangulation possible. If a map projection (give ``...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class triangulate: """Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data. Triangulate reads in x,y[,z] data and performs Delaunay triangulation, i.e., it finds how the points should be connected to give the most equilateral triangulation possible. If a map projection (give ``region`` and ...
the_stack_v2_python_sparse
pygmt/src/triangulate.py
GenericMappingTools/pygmt
train
490
b0a147986ae90d6e0274dac8275669288a44ea59
[ "self.max_length = max_length\nself.tmto_lookup = []\nfor i in range(self.max_length + 1):\n self.tmto_lookup.append({})", "try:\n return (True, self.custom_copy(self.tmto_lookup[length][ip_ngram][target_level]))\nexcept KeyError:\n return (False, None)", "if ip_ngram not in self.tmto_lookup[length]:\n...
<|body_start_0|> self.max_length = max_length self.tmto_lookup = [] for i in range(self.max_length + 1): self.tmto_lookup.append({}) <|end_body_0|> <|body_start_1|> try: return (True, self.custom_copy(self.tmto_lookup[length][ip_ngram][target_level])) exc...
Contains all the logic to speed up guess generation by using tmto tricks Creating this as a class so I can easily pass it around
Optimizer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Optimizer: """Contains all the logic to speed up guess generation by using tmto tricks Creating this as a class so I can easily pass it around""" def __init__(self, max_length): """Initializes the optimizer Inputs: max_length: The maximum length of strings to optimize. Increasing thi...
stack_v2_sparse_classes_10k_train_008011
3,380
no_license
[ { "docstring": "Initializes the optimizer Inputs: max_length: The maximum length of strings to optimize. Increasing this increases memory requirements", "name": "__init__", "signature": "def __init__(self, max_length)" }, { "docstring": "Look up a previous result Inputs: ip_ngram: The initial st...
4
stack_v2_sparse_classes_30k_val_000152
Implement the Python class `Optimizer` described below. Class description: Contains all the logic to speed up guess generation by using tmto tricks Creating this as a class so I can easily pass it around Method signatures and docstrings: - def __init__(self, max_length): Initializes the optimizer Inputs: max_length: ...
Implement the Python class `Optimizer` described below. Class description: Contains all the logic to speed up guess generation by using tmto tricks Creating this as a class so I can easily pass it around Method signatures and docstrings: - def __init__(self, max_length): Initializes the optimizer Inputs: max_length: ...
6fed1047838091edec7ce96679c3d0887073ed3b
<|skeleton|> class Optimizer: """Contains all the logic to speed up guess generation by using tmto tricks Creating this as a class so I can easily pass it around""" def __init__(self, max_length): """Initializes the optimizer Inputs: max_length: The maximum length of strings to optimize. Increasing thi...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Optimizer: """Contains all the logic to speed up guess generation by using tmto tricks Creating this as a class so I can easily pass it around""" def __init__(self, max_length): """Initializes the optimizer Inputs: max_length: The maximum length of strings to optimize. Increasing this increases m...
the_stack_v2_python_sparse
lib_guesser/omen/optimizer.py
lakiw/pcfg_cracker
train
286
d68d59000ec06311e17d7c2fac817326491c0eb4
[ "sigma_0 = (ScoremapFOVProjParams & 'proj_sigma < 0.00001').proj()\nlen_session = (ScoremapFOV & 'no_sessions > 0').proj()\nkeys = super().key_source & sigma_0 & len_session\nreturn keys", "params = (ScoremapFOVProjParams & key).fetch1()\nscore_map_dict, score_map_dict_shuff = (ScoremapFOV & key).fetch1('aligned_...
<|body_start_0|> sigma_0 = (ScoremapFOVProjParams & 'proj_sigma < 0.00001').proj() len_session = (ScoremapFOV & 'no_sessions > 0').proj() keys = super().key_source & sigma_0 & len_session return keys <|end_body_0|> <|body_start_1|> params = (ScoremapFOVProjParams & key).fetch1()...
ScoremapFOVMoran
[ "CC-BY-4.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ScoremapFOVMoran: def key_source(self): """For Moran's I calculation do NOT take any parameter sets (ScoremapFOVProjParams) that smooth the score maps. This will lead to wrong assumptions.""" <|body_0|> def make(self, key): """Perform Moran’s I global autocorrelation...
stack_v2_sparse_classes_10k_train_008012
42,527
permissive
[ { "docstring": "For Moran's I calculation do NOT take any parameter sets (ScoremapFOVProjParams) that smooth the score maps. This will lead to wrong assumptions.", "name": "key_source", "signature": "def key_source(self)" }, { "docstring": "Perform Moran’s I global autocorrelation statistic calc...
2
stack_v2_sparse_classes_30k_train_001453
Implement the Python class `ScoremapFOVMoran` described below. Class description: Implement the ScoremapFOVMoran class. Method signatures and docstrings: - def key_source(self): For Moran's I calculation do NOT take any parameter sets (ScoremapFOVProjParams) that smooth the score maps. This will lead to wrong assumpt...
Implement the Python class `ScoremapFOVMoran` described below. Class description: Implement the ScoremapFOVMoran class. Method signatures and docstrings: - def key_source(self): For Moran's I calculation do NOT take any parameter sets (ScoremapFOVProjParams) that smooth the score maps. This will lead to wrong assumpt...
83c2dfc8597f9b7f4918f27b735420c4a0cc3415
<|skeleton|> class ScoremapFOVMoran: def key_source(self): """For Moran's I calculation do NOT take any parameter sets (ScoremapFOVProjParams) that smooth the score maps. This will lead to wrong assumptions.""" <|body_0|> def make(self, key): """Perform Moran’s I global autocorrelation...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ScoremapFOVMoran: def key_source(self): """For Moran's I calculation do NOT take any parameter sets (ScoremapFOVProjParams) that smooth the score maps. This will lead to wrong assumptions.""" sigma_0 = (ScoremapFOVProjParams & 'proj_sigma < 0.00001').proj() len_session = (ScoremapFOV &...
the_stack_v2_python_sparse
dj_schemas/anatomical_alignment.py
kavli-ntnu/mini2p_topography
train
2
af213e2ea812ebfbb776c17c400731a5544f6bf7
[ "self.matrix = matrix\nself.m, self.n = (len(matrix), len(matrix[0]))\nself.right = [[0] * self.n for i in range(self.m)]\nfor i in range(self.n - 1, -1, -1):\n for j in range(self.m):\n if i == self.n - 1:\n self.right[j][i] = self.matrix[j][i]\n else:\n self.right[j][i] = se...
<|body_start_0|> self.matrix = matrix self.m, self.n = (len(matrix), len(matrix[0])) self.right = [[0] * self.n for i in range(self.m)] for i in range(self.n - 1, -1, -1): for j in range(self.m): if i == self.n - 1: self.right[j][i] = self....
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_10k_train_008013
1,544
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:...
6e18c5d257840489cc3fb1079ae3804c743982a4
<|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_10k
data/stack_v2_sparse_classes_30k
class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" self.matrix = matrix self.m, self.n = (len(matrix), len(matrix[0])) self.right = [[0] * self.n for i in range(self.m)] for i in range(self.n - 1, -1, -1): for j in range(self.m): ...
the_stack_v2_python_sparse
剑指 Offer II 013. 二维子矩阵的和.py
yangyuxiang1996/leetcode
train
0
8706418d80a22006c4432b5d9cb8e0e556ea38bd
[ "self.learning_rate = learning_rate\nself.mu = mu\nself.rho = rho\nself.k = 0\nself.first_moment = 0\nself.second_moment = 0\nself.epsilon = np.finfo(float).eps", "self.k += 1\nself.first_moment = self.mu * self.first_moment + (1 - self.mu) * gradient_tensor\nself.second_moment = self.rho * self.second_moment + (...
<|body_start_0|> self.learning_rate = learning_rate self.mu = mu self.rho = rho self.k = 0 self.first_moment = 0 self.second_moment = 0 self.epsilon = np.finfo(float).eps <|end_body_0|> <|body_start_1|> self.k += 1 self.first_moment = self.mu * se...
Implementation of the "Adaptive Moment Estimation (Adam)"-method.
Adam
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Adam: """Implementation of the "Adaptive Moment Estimation (Adam)"-method.""" def __init__(self, learning_rate, mu, rho): """Constructor for the "Adaptive Moment Estimation (Adam)"-method. :param learning_rate: Learning rate. :param mu: Hyperparameter for the calculation of the first...
stack_v2_sparse_classes_10k_train_008014
3,815
no_license
[ { "docstring": "Constructor for the \"Adaptive Moment Estimation (Adam)\"-method. :param learning_rate: Learning rate. :param mu: Hyperparameter for the calculation of the first moment (v). :param rho: Hyperparamter for the calculation of the second moment (r).", "name": "__init__", "signature": "def __...
2
stack_v2_sparse_classes_30k_train_002791
Implement the Python class `Adam` described below. Class description: Implementation of the "Adaptive Moment Estimation (Adam)"-method. Method signatures and docstrings: - def __init__(self, learning_rate, mu, rho): Constructor for the "Adaptive Moment Estimation (Adam)"-method. :param learning_rate: Learning rate. :...
Implement the Python class `Adam` described below. Class description: Implementation of the "Adaptive Moment Estimation (Adam)"-method. Method signatures and docstrings: - def __init__(self, learning_rate, mu, rho): Constructor for the "Adaptive Moment Estimation (Adam)"-method. :param learning_rate: Learning rate. :...
1d2d990c75bb7977d76430a50a31bd9ce31da37d
<|skeleton|> class Adam: """Implementation of the "Adaptive Moment Estimation (Adam)"-method.""" def __init__(self, learning_rate, mu, rho): """Constructor for the "Adaptive Moment Estimation (Adam)"-method. :param learning_rate: Learning rate. :param mu: Hyperparameter for the calculation of the first...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Adam: """Implementation of the "Adaptive Moment Estimation (Adam)"-method.""" def __init__(self, learning_rate, mu, rho): """Constructor for the "Adaptive Moment Estimation (Adam)"-method. :param learning_rate: Learning rate. :param mu: Hyperparameter for the calculation of the first moment (v). ...
the_stack_v2_python_sparse
Exercise 2/src_to_implement/Optimization/Optimizers.py
StefanFischer/Deep-Learning-Framework
train
0
d8a27c8ecacd6d6c983ab807a9cdcc471b726370
[ "method = 'chart.gettopartists'\nurl_params = {'method': method}\nif page is not None:\n url_params['page'] = page\nif limit is not None:\n url_params['limit'] = limit\nquery = parse.urlencode(url_params)\nreturn query", "method = 'chart.gettoptags'\nurl_params = {'method': method}\nif page is not None:\n ...
<|body_start_0|> method = 'chart.gettopartists' url_params = {'method': method} if page is not None: url_params['page'] = page if limit is not None: url_params['limit'] = limit query = parse.urlencode(url_params) return query <|end_body_0|> <|body...
ChartClient
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ChartClient: def get_top_artists(self, page=None, limit=10): """Get the top artists chart Params: page (Optional) : The page number to fetch. Defaults to first page. limit (Optional) : The number of results to fetch per page.""" <|body_0|> def get_top_tags(self, page=None, l...
stack_v2_sparse_classes_10k_train_008015
1,751
no_license
[ { "docstring": "Get the top artists chart Params: page (Optional) : The page number to fetch. Defaults to first page. limit (Optional) : The number of results to fetch per page.", "name": "get_top_artists", "signature": "def get_top_artists(self, page=None, limit=10)" }, { "docstring": "Get the ...
3
stack_v2_sparse_classes_30k_train_001068
Implement the Python class `ChartClient` described below. Class description: Implement the ChartClient class. Method signatures and docstrings: - def get_top_artists(self, page=None, limit=10): Get the top artists chart Params: page (Optional) : The page number to fetch. Defaults to first page. limit (Optional) : The...
Implement the Python class `ChartClient` described below. Class description: Implement the ChartClient class. Method signatures and docstrings: - def get_top_artists(self, page=None, limit=10): Get the top artists chart Params: page (Optional) : The page number to fetch. Defaults to first page. limit (Optional) : The...
5311236c98274d4e4a6f2c09c6bf021b3f195e66
<|skeleton|> class ChartClient: def get_top_artists(self, page=None, limit=10): """Get the top artists chart Params: page (Optional) : The page number to fetch. Defaults to first page. limit (Optional) : The number of results to fetch per page.""" <|body_0|> def get_top_tags(self, page=None, l...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ChartClient: def get_top_artists(self, page=None, limit=10): """Get the top artists chart Params: page (Optional) : The page number to fetch. Defaults to first page. limit (Optional) : The number of results to fetch per page.""" method = 'chart.gettopartists' url_params = {'method': me...
the_stack_v2_python_sparse
apiClients/chart_client.py
zflake1208/last-fm-analyzer
train
0
da86dbe5eaadb3c7609d51c6d8365536a2a5f98a
[ "sk_idx = {v: i for i, v in enumerate(req_skills)}\ndp = {0: []}\nfor i, p in enumerate(people):\n sks = 0\n for sk in p:\n if sk in sk_idx:\n sks |= 1 << sk_idx[sk]\n for k, v in list(dp.items()):\n incld = k | sks\n if incld != k and (incld not in dp or len(dp[incld]) > le...
<|body_start_0|> sk_idx = {v: i for i, v in enumerate(req_skills)} dp = {0: []} for i, p in enumerate(people): sks = 0 for sk in p: if sk in sk_idx: sks |= 1 << sk_idx[sk] for k, v in list(dp.items()): incld ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def smallestSufficientTeam(self, req_skills, people): """:type req_skills: List[str] :type people: List[List[str]] :rtype: List[int]""" <|body_0|> def smallestSufficientTeam2(self, req_skills, people): """:type req_skills: List[str] :type people: List[List[...
stack_v2_sparse_classes_10k_train_008016
1,971
no_license
[ { "docstring": ":type req_skills: List[str] :type people: List[List[str]] :rtype: List[int]", "name": "smallestSufficientTeam", "signature": "def smallestSufficientTeam(self, req_skills, people)" }, { "docstring": ":type req_skills: List[str] :type people: List[List[str]] :rtype: List[int]", ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def smallestSufficientTeam(self, req_skills, people): :type req_skills: List[str] :type people: List[List[str]] :rtype: List[int] - def smallestSufficientTeam2(self, req_skills, ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def smallestSufficientTeam(self, req_skills, people): :type req_skills: List[str] :type people: List[List[str]] :rtype: List[int] - def smallestSufficientTeam2(self, req_skills, ...
dbdb227e12f329e4ca064b338f1fbdca42f3a848
<|skeleton|> class Solution: def smallestSufficientTeam(self, req_skills, people): """:type req_skills: List[str] :type people: List[List[str]] :rtype: List[int]""" <|body_0|> def smallestSufficientTeam2(self, req_skills, people): """:type req_skills: List[str] :type people: List[List[...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def smallestSufficientTeam(self, req_skills, people): """:type req_skills: List[str] :type people: List[List[str]] :rtype: List[int]""" sk_idx = {v: i for i, v in enumerate(req_skills)} dp = {0: []} for i, p in enumerate(people): sks = 0 for sk...
the_stack_v2_python_sparse
LC1125.py
Qiao-Liang/LeetCode
train
0
10ec79b81992964c09d8dd1830229b7b322274fc
[ "super().__init__()\nself.lstm_cell = tf.keras.layers.LSTMCell(lstm_units, dropout=0.3, kernel_regularizer=tf.keras.regularizers.l2(l=0.02), recurrent_regularizer=tf.keras.regularizers.l2(l=0.02))\nself.dense1 = tf.keras.layers.Dense(1)\nself.dense2 = tf.keras.layers.Dense(10, activation='relu', kernel_regularizer=...
<|body_start_0|> super().__init__() self.lstm_cell = tf.keras.layers.LSTMCell(lstm_units, dropout=0.3, kernel_regularizer=tf.keras.regularizers.l2(l=0.02), recurrent_regularizer=tf.keras.regularizers.l2(l=0.02)) self.dense1 = tf.keras.layers.Dense(1) self.dense2 = tf.keras.layers.Dense(1...
Simple RNN based CF model.
RNNCFModel
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RNNCFModel: """Simple RNN based CF model.""" def __init__(self, maxhd, maxv, mina, maxa, lstm_units=20, dt=0.1): """Inits RNN based CF model. Args: maxhd: max headway (for nomalization of inputs) maxv: max velocity (for nomalization of inputs) mina: minimum acceleration (for nomaliza...
stack_v2_sparse_classes_10k_train_008017
20,223
permissive
[ { "docstring": "Inits RNN based CF model. Args: maxhd: max headway (for nomalization of inputs) maxv: max velocity (for nomalization of inputs) mina: minimum acceleration (for nomalization of outputs) maxa: maximum acceleration (for nomalization of outputs) dt: timestep", "name": "__init__", "signature"...
2
stack_v2_sparse_classes_30k_train_001650
Implement the Python class `RNNCFModel` described below. Class description: Simple RNN based CF model. Method signatures and docstrings: - def __init__(self, maxhd, maxv, mina, maxa, lstm_units=20, dt=0.1): Inits RNN based CF model. Args: maxhd: max headway (for nomalization of inputs) maxv: max velocity (for nomaliz...
Implement the Python class `RNNCFModel` described below. Class description: Simple RNN based CF model. Method signatures and docstrings: - def __init__(self, maxhd, maxv, mina, maxa, lstm_units=20, dt=0.1): Inits RNN based CF model. Args: maxhd: max headway (for nomalization of inputs) maxv: max velocity (for nomaliz...
0aaf9674e987822ff2dc90c74613d5e68e8ef0ce
<|skeleton|> class RNNCFModel: """Simple RNN based CF model.""" def __init__(self, maxhd, maxv, mina, maxa, lstm_units=20, dt=0.1): """Inits RNN based CF model. Args: maxhd: max headway (for nomalization of inputs) maxv: max velocity (for nomalization of inputs) mina: minimum acceleration (for nomaliza...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class RNNCFModel: """Simple RNN based CF model.""" def __init__(self, maxhd, maxv, mina, maxa, lstm_units=20, dt=0.1): """Inits RNN based CF model. Args: maxhd: max headway (for nomalization of inputs) maxv: max velocity (for nomalization of inputs) mina: minimum acceleration (for nomalization of outpu...
the_stack_v2_python_sparse
scripts/meng/deep learning/DL2_relax.py
seccode/havsim
train
0
8a105f7e25566198b7b23bb0f50aae758ce128e3
[ "super(ResNet_Det, self).__init__()\nself.net_desc = desc\nself.depth = desc['depth']\nself.num_stages = desc['num_stages'] if 'num_stages' in desc else 4\nself.strides = desc['strides'] if 'strides' in desc else (1, 2, 2, 2)\nself.dilations = desc['dilations'] if 'dilations' in desc else (1, 1, 1, 1)\nself.out_ind...
<|body_start_0|> super(ResNet_Det, self).__init__() self.net_desc = desc self.depth = desc['depth'] self.num_stages = desc['num_stages'] if 'num_stages' in desc else 4 self.strides = desc['strides'] if 'strides' in desc else (1, 2, 2, 2) self.dilations = desc['dilations']...
ResNet for detection.
ResNet_Det
[ "Apache-2.0", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResNet_Det: """ResNet for detection.""" def __init__(self, desc): """Init ResNet.""" <|body_0|> def _make_stem_layer(self): """Make stem layer.""" <|body_1|> def _freeze_stages(self): """Freeze stages.""" <|body_2|> def init_weig...
stack_v2_sparse_classes_10k_train_008018
6,387
permissive
[ { "docstring": "Init ResNet.", "name": "__init__", "signature": "def __init__(self, desc)" }, { "docstring": "Make stem layer.", "name": "_make_stem_layer", "signature": "def _make_stem_layer(self)" }, { "docstring": "Freeze stages.", "name": "_freeze_stages", "signature"...
6
null
Implement the Python class `ResNet_Det` described below. Class description: ResNet for detection. Method signatures and docstrings: - def __init__(self, desc): Init ResNet. - def _make_stem_layer(self): Make stem layer. - def _freeze_stages(self): Freeze stages. - def init_weights(self, pretrained=None): Init weight....
Implement the Python class `ResNet_Det` described below. Class description: ResNet for detection. Method signatures and docstrings: - def __init__(self, desc): Init ResNet. - def _make_stem_layer(self): Make stem layer. - def _freeze_stages(self): Freeze stages. - def init_weights(self, pretrained=None): Init weight....
df51ed9c1d6dbde1deef63f2a037a369f8554406
<|skeleton|> class ResNet_Det: """ResNet for detection.""" def __init__(self, desc): """Init ResNet.""" <|body_0|> def _make_stem_layer(self): """Make stem layer.""" <|body_1|> def _freeze_stages(self): """Freeze stages.""" <|body_2|> def init_weig...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ResNet_Det: """ResNet for detection.""" def __init__(self, desc): """Init ResNet.""" super(ResNet_Det, self).__init__() self.net_desc = desc self.depth = desc['depth'] self.num_stages = desc['num_stages'] if 'num_stages' in desc else 4 self.strides = desc['...
the_stack_v2_python_sparse
built-in/TensorFlow/Research/cv/image_classification/Cars_for_TensorFlow/automl/vega/search_space/networks/pytorch/backbones/resnet_det.py
Huawei-Ascend/modelzoo
train
1
221e8ebeb1db9a394dc7f7653982818ff025649d
[ "self.meta = {}\nself.meta['ra'] = dict(ext=0, card='RA')\nself.meta['dec'] = dict(ext=0, card='DEC')\nself.meta['target'] = dict(ext=0, card='OBJECT')\nself.meta['decker'] = dict(ext=0, card=None, default='default')\nself.meta['dichroic'] = dict(ext=0, card=None, default='default')\nself.meta['binning'] = dict(ext...
<|body_start_0|> self.meta = {} self.meta['ra'] = dict(ext=0, card='RA') self.meta['dec'] = dict(ext=0, card='DEC') self.meta['target'] = dict(ext=0, card='OBJECT') self.meta['decker'] = dict(ext=0, card=None, default='default') self.meta['dichroic'] = dict(ext=0, card=No...
Child to handle Magellan/FIRE specific code .. note:: For FIRE Echelle, we usually use high gain and SUTR read mode. The exposure time is usually around 900s. The detector parameters below are based on such mode. Standard star and calibrations are usually use Fowler 1 read mode in which case the read noise is ~20 elect...
MagellanFIRESpectrograph
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MagellanFIRESpectrograph: """Child to handle Magellan/FIRE specific code .. note:: For FIRE Echelle, we usually use high gain and SUTR read mode. The exposure time is usually around 900s. The detector parameters below are based on such mode. Standard star and calibrations are usually use Fowler 1...
stack_v2_sparse_classes_10k_train_008019
18,946
permissive
[ { "docstring": "Define how metadata are derived from the spectrograph files. That is, this associates the PypeIt-specific metadata keywords with the instrument-specific header cards using :attr:`meta`.", "name": "init_meta", "signature": "def init_meta(self)" }, { "docstring": "Define the list o...
2
stack_v2_sparse_classes_30k_val_000145
Implement the Python class `MagellanFIRESpectrograph` described below. Class description: Child to handle Magellan/FIRE specific code .. note:: For FIRE Echelle, we usually use high gain and SUTR read mode. The exposure time is usually around 900s. The detector parameters below are based on such mode. Standard star an...
Implement the Python class `MagellanFIRESpectrograph` described below. Class description: Child to handle Magellan/FIRE specific code .. note:: For FIRE Echelle, we usually use high gain and SUTR read mode. The exposure time is usually around 900s. The detector parameters below are based on such mode. Standard star an...
0d2e2196afc6904050b1af4d572f5c643bb07e38
<|skeleton|> class MagellanFIRESpectrograph: """Child to handle Magellan/FIRE specific code .. note:: For FIRE Echelle, we usually use high gain and SUTR read mode. The exposure time is usually around 900s. The detector parameters below are based on such mode. Standard star and calibrations are usually use Fowler 1...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MagellanFIRESpectrograph: """Child to handle Magellan/FIRE specific code .. note:: For FIRE Echelle, we usually use high gain and SUTR read mode. The exposure time is usually around 900s. The detector parameters below are based on such mode. Standard star and calibrations are usually use Fowler 1 read mode in...
the_stack_v2_python_sparse
pypeit/spectrographs/magellan_fire.py
pypeit/PypeIt
train
136
8730d3e1b6dfef1fcbd2adfda165902a4367bae6
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')" ]
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
Missing associated documentation comment in .proto file.
LegoCaptureServicer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LegoCaptureServicer: """Missing associated documentation comment in .proto file.""" def CollectImages(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def CollectCroppedImages(self, request, context): """Missing a...
stack_v2_sparse_classes_10k_train_008020
4,069
no_license
[ { "docstring": "Missing associated documentation comment in .proto file.", "name": "CollectImages", "signature": "def CollectImages(self, request, context)" }, { "docstring": "Missing associated documentation comment in .proto file.", "name": "CollectCroppedImages", "signature": "def Col...
2
stack_v2_sparse_classes_30k_train_002717
Implement the Python class `LegoCaptureServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def CollectImages(self, request, context): Missing associated documentation comment in .proto file. - def CollectCroppedImages(self, request...
Implement the Python class `LegoCaptureServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def CollectImages(self, request, context): Missing associated documentation comment in .proto file. - def CollectCroppedImages(self, request...
2fca34564d865bbf28c4cddc7665d0276f7e0cf2
<|skeleton|> class LegoCaptureServicer: """Missing associated documentation comment in .proto file.""" def CollectImages(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def CollectCroppedImages(self, request, context): """Missing a...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LegoCaptureServicer: """Missing associated documentation comment in .proto file.""" def CollectImages(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented...
the_stack_v2_python_sparse
lego_sorter_server/generated/LegoCapture_pb2_grpc.py
etusien/LegoSorterServer
train
0
d9e557ec3e189281715e55d81fa18c5f3dcfe623
[ "super().__init__()\nif dim == 1:\n conv = nn.Conv1d\n bn = nn.BatchNorm1d\nelif dim == 2:\n conv = nn.Conv2d\n bn = nn.BatchNorm2d\nelse:\n raise ValueError\nif not isinstance(out_channels, (list, tuple)):\n out_channels = [out_channels]\nlayers = []\nfor oc in out_channels:\n layers.extend([c...
<|body_start_0|> super().__init__() if dim == 1: conv = nn.Conv1d bn = nn.BatchNorm1d elif dim == 2: conv = nn.Conv2d bn = nn.BatchNorm2d else: raise ValueError if not isinstance(out_channels, (list, tuple)): ...
SharedMLP Module, comprising Conv2d, BatchNorm and ReLU blocks.
SharedMLP
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SharedMLP: """SharedMLP Module, comprising Conv2d, BatchNorm and ReLU blocks.""" def __init__(self, in_channels, out_channels, dim=1): """Constructor for SharedMLP Block. Args: in_channels: Number of input channels. out_channels: Number of output channels. dim: Input dimension""" ...
stack_v2_sparse_classes_10k_train_008021
22,879
permissive
[ { "docstring": "Constructor for SharedMLP Block. Args: in_channels: Number of input channels. out_channels: Number of output channels. dim: Input dimension", "name": "__init__", "signature": "def __init__(self, in_channels, out_channels, dim=1)" }, { "docstring": "Forward pass for SharedMLP Args...
2
stack_v2_sparse_classes_30k_train_000005
Implement the Python class `SharedMLP` described below. Class description: SharedMLP Module, comprising Conv2d, BatchNorm and ReLU blocks. Method signatures and docstrings: - def __init__(self, in_channels, out_channels, dim=1): Constructor for SharedMLP Block. Args: in_channels: Number of input channels. out_channel...
Implement the Python class `SharedMLP` described below. Class description: SharedMLP Module, comprising Conv2d, BatchNorm and ReLU blocks. Method signatures and docstrings: - def __init__(self, in_channels, out_channels, dim=1): Constructor for SharedMLP Block. Args: in_channels: Number of input channels. out_channel...
51482281dc180786e7563c73c12ac5df89289748
<|skeleton|> class SharedMLP: """SharedMLP Module, comprising Conv2d, BatchNorm and ReLU blocks.""" def __init__(self, in_channels, out_channels, dim=1): """Constructor for SharedMLP Block. Args: in_channels: Number of input channels. out_channels: Number of output channels. dim: Input dimension""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SharedMLP: """SharedMLP Module, comprising Conv2d, BatchNorm and ReLU blocks.""" def __init__(self, in_channels, out_channels, dim=1): """Constructor for SharedMLP Block. Args: in_channels: Number of input channels. out_channels: Number of output channels. dim: Input dimension""" super()....
the_stack_v2_python_sparse
ml3d/torch/models/pvcnn.py
CosmosHua/Open3D-ML
train
0
2c6248d15f6e826b54efdc24b94d6134a0146782
[ "if not heights:\n return 0\nminl = []\nminh = float('inf')\nfor i in range(len(heights)):\n if heights[i] < minh:\n minh = heights[i]\n minl = [i]\n elif heights[i] == minh:\n minl.append(i)\narea_list = [minh * len(heights), self.largestRectangleArea(heights[:minl[0]]), self.largestR...
<|body_start_0|> if not heights: return 0 minl = [] minh = float('inf') for i in range(len(heights)): if heights[i] < minh: minh = heights[i] minl = [i] elif heights[i] == minh: minl.append(i) are...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def largestRectangleArea1(self, heights) -> int: """:param heights: :return: int 用小数分割递归求解,OT""" <|body_0|> def largestRectangleArea(self, heights): """:type heights: List[int] :rtype: int 利用栈构造升序序列,若下一个数是升序则进栈,否则开始退栈,直到出现小于等于当前数的元素。注意栈内是升序序列, 这就找到了介于两个小数之间...
stack_v2_sparse_classes_10k_train_008022
2,140
no_license
[ { "docstring": ":param heights: :return: int 用小数分割递归求解,OT", "name": "largestRectangleArea1", "signature": "def largestRectangleArea1(self, heights) -> int" }, { "docstring": ":type heights: List[int] :rtype: int 利用栈构造升序序列,若下一个数是升序则进栈,否则开始退栈,直到出现小于等于当前数的元素。注意栈内是升序序列, 这就找到了介于两个小数之间的一个序列,计算这个序列的面积,...
2
stack_v2_sparse_classes_30k_train_003915
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def largestRectangleArea1(self, heights) -> int: :param heights: :return: int 用小数分割递归求解,OT - def largestRectangleArea(self, heights): :type heights: List[int] :rtype: int 利用栈构造升序...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def largestRectangleArea1(self, heights) -> int: :param heights: :return: int 用小数分割递归求解,OT - def largestRectangleArea(self, heights): :type heights: List[int] :rtype: int 利用栈构造升序...
2306c494ea8f754aa4b954732f1331f3922235c1
<|skeleton|> class Solution: def largestRectangleArea1(self, heights) -> int: """:param heights: :return: int 用小数分割递归求解,OT""" <|body_0|> def largestRectangleArea(self, heights): """:type heights: List[int] :rtype: int 利用栈构造升序序列,若下一个数是升序则进栈,否则开始退栈,直到出现小于等于当前数的元素。注意栈内是升序序列, 这就找到了介于两个小数之间...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def largestRectangleArea1(self, heights) -> int: """:param heights: :return: int 用小数分割递归求解,OT""" if not heights: return 0 minl = [] minh = float('inf') for i in range(len(heights)): if heights[i] < minh: minh = heights[i...
the_stack_v2_python_sparse
84_LargestRectangleInHistogram.py
ZhangNANPy/LeetCode
train
0
1afa1c6a694d315ade76cf6f35a6e7ac68991a10
[ "for parent_id_option_expression in PARENT_ID_OPTION_EXPRESSIONS:\n if parent_id_option_expression.match(option):\n return True\nreturn False", "for parent_id_option_expression in PARENT_ID_OPTION_EXPRESSIONS:\n match = parent_id_option_expression.match(option)\n if match is not None:\n ret...
<|body_start_0|> for parent_id_option_expression in PARENT_ID_OPTION_EXPRESSIONS: if parent_id_option_expression.match(option): return True return False <|end_body_0|> <|body_start_1|> for parent_id_option_expression in PARENT_ID_OPTION_EXPRESSIONS: match...
OptionHelper
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OptionHelper: def is_parent_id_option(option): """Checks if the given option name is a reference to a parent entity.""" <|body_0|> def get_parent_id_type(option): """Extracts the name of the type from an option that is a reference to a parent entity. For example, if ...
stack_v2_sparse_classes_10k_train_008023
1,932
permissive
[ { "docstring": "Checks if the given option name is a reference to a parent entity.", "name": "is_parent_id_option", "signature": "def is_parent_id_option(option)" }, { "docstring": "Extracts the name of the type from an option that is a reference to a parent entity. For example, if the option is...
2
stack_v2_sparse_classes_30k_train_004312
Implement the Python class `OptionHelper` described below. Class description: Implement the OptionHelper class. Method signatures and docstrings: - def is_parent_id_option(option): Checks if the given option name is a reference to a parent entity. - def get_parent_id_type(option): Extracts the name of the type from a...
Implement the Python class `OptionHelper` described below. Class description: Implement the OptionHelper class. Method signatures and docstrings: - def is_parent_id_option(option): Checks if the given option name is a reference to a parent entity. - def get_parent_id_type(option): Extracts the name of the type from a...
422d70e1dc422f0ca248abea47a472e3605caa4b
<|skeleton|> class OptionHelper: def is_parent_id_option(option): """Checks if the given option name is a reference to a parent entity.""" <|body_0|> def get_parent_id_type(option): """Extracts the name of the type from an option that is a reference to a parent entity. For example, if ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class OptionHelper: def is_parent_id_option(option): """Checks if the given option name is a reference to a parent entity.""" for parent_id_option_expression in PARENT_ID_OPTION_EXPRESSIONS: if parent_id_option_expression.match(option): return True return False ...
the_stack_v2_python_sparse
src/ovirtcli/utils/optionhelper.py
minqf/ovirt-engine-cli
train
0
2dd4f6e20db4d88065973a37c85d97d1f5c66709
[ "self.conf = conf\nself.transport = transport\nself.target = target\nself.RPC = self.target.topic_class", "check_interval = self.conf.messaging_server.check_interval\ntime.sleep(check_interval)\nif self.conf.messaging_server.debug:\n LOG.debug('Checking status for message {} method {} on topic {}'.format(rpc_i...
<|body_start_0|> self.conf = conf self.transport = transport self.target = target self.RPC = self.target.topic_class <|end_body_0|> <|body_start_1|> check_interval = self.conf.messaging_server.check_interval time.sleep(check_interval) if self.conf.messaging_serve...
Returns an RPC client using Music as a transport. The RPC client is responsible for sending method invocations to remote servers via a messaging transport. A method invocation consists of a request context dictionary a method name, and a dictionary of arguments. A cast() invocation just sends the request and returns im...
RPCClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RPCClient: """Returns an RPC client using Music as a transport. The RPC client is responsible for sending method invocations to remote servers via a messaging transport. A method invocation consists of a request context dictionary a method name, and a dictionary of arguments. A cast() invocation ...
stack_v2_sparse_classes_10k_train_008024
18,894
permissive
[ { "docstring": "Set the transport and target", "name": "__init__", "signature": "def __init__(self, conf, transport, target)" }, { "docstring": "Check status for a given message id", "name": "__check_rpc_status", "signature": "def __check_rpc_status(self, rpc_id, rpc_method)" }, { ...
4
stack_v2_sparse_classes_30k_train_000163
Implement the Python class `RPCClient` described below. Class description: Returns an RPC client using Music as a transport. The RPC client is responsible for sending method invocations to remote servers via a messaging transport. A method invocation consists of a request context dictionary a method name, and a dictio...
Implement the Python class `RPCClient` described below. Class description: Returns an RPC client using Music as a transport. The RPC client is responsible for sending method invocations to remote servers via a messaging transport. A method invocation consists of a request context dictionary a method name, and a dictio...
9c828b70d48d6c7d6668eda4d61239cfb2b28570
<|skeleton|> class RPCClient: """Returns an RPC client using Music as a transport. The RPC client is responsible for sending method invocations to remote servers via a messaging transport. A method invocation consists of a request context dictionary a method name, and a dictionary of arguments. A cast() invocation ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class RPCClient: """Returns an RPC client using Music as a transport. The RPC client is responsible for sending method invocations to remote servers via a messaging transport. A method invocation consists of a request context dictionary a method name, and a dictionary of arguments. A cast() invocation just sends th...
the_stack_v2_python_sparse
conductor/conductor/common/music/messaging/component.py
onap/optf-has
train
5
71938574137ab9b0df5c1b16301b1795a23a8fea
[ "if self.master:\n if hasattr(self.master, 'notify_task'):\n self.master.notify_task(_task, _progress)\n else:\n print(self.__class__.__name__ + ': Internal deficiency, ' + self.master.__class__.__name__ + ' should have a notify_task function\\nTask:\\n' + _task + '\\n' + str(_progress))\nelse:\...
<|body_start_0|> if self.master: if hasattr(self.master, 'notify_task'): self.master.notify_task(_task, _progress) else: print(self.__class__.__name__ + ': Internal deficiency, ' + self.master.__class__.__name__ + ' should have a notify_task function\nTask...
This class introduces all properties that a frame in BPM tools should hold.
BPMFrame
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BPMFrame: """This class introduces all properties that a frame in BPM tools should hold.""" def notify_task(self, _task, _progress): """This function checks if the master widget has a notify_task function, and if so, calls it. This way, notifications travel upwards in the widget stru...
stack_v2_sparse_classes_10k_train_008025
11,721
permissive
[ { "docstring": "This function checks if the master widget has a notify_task function, and if so, calls it. This way, notifications travel upwards in the widget structure until someone has a notify_task that's different. See the main_tk_replicator.ReplicatorMain for an example, :param _task: Text that defines th...
2
stack_v2_sparse_classes_30k_train_001792
Implement the Python class `BPMFrame` described below. Class description: This class introduces all properties that a frame in BPM tools should hold. Method signatures and docstrings: - def notify_task(self, _task, _progress): This function checks if the master widget has a notify_task function, and if so, calls it. ...
Implement the Python class `BPMFrame` described below. Class description: This class introduces all properties that a frame in BPM tools should hold. Method signatures and docstrings: - def notify_task(self, _task, _progress): This function checks if the master widget has a notify_task function, and if so, calls it. ...
4d7a31c0d68042b4110e1fa3e733711e0fdd473e
<|skeleton|> class BPMFrame: """This class introduces all properties that a frame in BPM tools should hold.""" def notify_task(self, _task, _progress): """This function checks if the master widget has a notify_task function, and if so, calls it. This way, notifications travel upwards in the widget stru...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class BPMFrame: """This class introduces all properties that a frame in BPM tools should hold.""" def notify_task(self, _task, _progress): """This function checks if the master widget has a notify_task function, and if so, calls it. This way, notifications travel upwards in the widget structure until s...
the_stack_v2_python_sparse
qal/tools/gui/widgets_misc.py
OptimalBPM/qal
train
3
09acf4bd8667cd25a043564452c6daf34b567b14
[ "m, n = pic_dt.shape\nif resize is None:\n n_new, m_new = (np.round(x_scale * n).astype(int), np.round(y_scale * m).astype(int))\nelse:\n n_new, m_new = resize\nfx, fy = (n / n_new, m / m_new)\nidx_x_orign = np.array(list(range(n_new)) * m_new).reshape(m_new, n_new)\nidx_y_orign = np.repeat(list(range(m_new))...
<|body_start_0|> m, n = pic_dt.shape if resize is None: n_new, m_new = (np.round(x_scale * n).astype(int), np.round(y_scale * m).astype(int)) else: n_new, m_new = resize fx, fy = (n / n_new, m / m_new) idx_x_orign = np.array(list(range(n_new)) * m_new).res...
图片缩放:包含两个方法 INTER_NEAREST 最近邻插值 INTER_LINEAR 双线性插值 例子: pic_sc = pic_scale() pic_sc.pic_resize(img_dt, resize, fx=None, fy=None, interpolation = pic_sc.INTER_LINEAR)
pic_scale
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class pic_scale: """图片缩放:包含两个方法 INTER_NEAREST 最近邻插值 INTER_LINEAR 双线性插值 例子: pic_sc = pic_scale() pic_sc.pic_resize(img_dt, resize, fx=None, fy=None, interpolation = pic_sc.INTER_LINEAR)""" def INTER_NEAREST(self, pic_dt, resize, x_scale=None, y_scale=None): """最近邻插值(图片 m * n * 图层) param pic...
stack_v2_sparse_classes_10k_train_008026
5,079
no_license
[ { "docstring": "最近邻插值(图片 m * n * 图层) param pic_dt: 为一个图片的一个图层的数据 len(pic_dt) == 2 param resize: set (长, 宽) param x_scale: float 长度缩放大小 param y_scale: float 宽带缩放大小", "name": "INTER_NEAREST", "signature": "def INTER_NEAREST(self, pic_dt, resize, x_scale=None, y_scale=None)" }, { "docstring": "找位置,...
4
stack_v2_sparse_classes_30k_train_004928
Implement the Python class `pic_scale` described below. Class description: 图片缩放:包含两个方法 INTER_NEAREST 最近邻插值 INTER_LINEAR 双线性插值 例子: pic_sc = pic_scale() pic_sc.pic_resize(img_dt, resize, fx=None, fy=None, interpolation = pic_sc.INTER_LINEAR) Method signatures and docstrings: - def INTER_NEAREST(self, pic_dt, resize, x_...
Implement the Python class `pic_scale` described below. Class description: 图片缩放:包含两个方法 INTER_NEAREST 最近邻插值 INTER_LINEAR 双线性插值 例子: pic_sc = pic_scale() pic_sc.pic_resize(img_dt, resize, fx=None, fy=None, interpolation = pic_sc.INTER_LINEAR) Method signatures and docstrings: - def INTER_NEAREST(self, pic_dt, resize, x_...
122c43776c2b10bd5f9b9a299bdbf9739173ad46
<|skeleton|> class pic_scale: """图片缩放:包含两个方法 INTER_NEAREST 最近邻插值 INTER_LINEAR 双线性插值 例子: pic_sc = pic_scale() pic_sc.pic_resize(img_dt, resize, fx=None, fy=None, interpolation = pic_sc.INTER_LINEAR)""" def INTER_NEAREST(self, pic_dt, resize, x_scale=None, y_scale=None): """最近邻插值(图片 m * n * 图层) param pic...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class pic_scale: """图片缩放:包含两个方法 INTER_NEAREST 最近邻插值 INTER_LINEAR 双线性插值 例子: pic_sc = pic_scale() pic_sc.pic_resize(img_dt, resize, fx=None, fy=None, interpolation = pic_sc.INTER_LINEAR)""" def INTER_NEAREST(self, pic_dt, resize, x_scale=None, y_scale=None): """最近邻插值(图片 m * n * 图层) param pic_dt: 为一个图片的一个...
the_stack_v2_python_sparse
DataWhale计算机视觉入门/图片缩放.py
scchy/My_Learn
train
4
1e7c09fbab53137d472dc26fb752c5fe458a4540
[ "BaseResource.__init__(self, *args, **kw)\nself._rsc = eval(open('%s.txt' % self.basesourcefile, 'r').read().replace('\\r\\n', '\\n'))\nself._code = open('%s.py' % self.basesourcefile, 'r').read()", "fle = open(os.path.join(basedir, self.name) + '.rsrc.py', 'w')\nlog.info(\"Writing '%s'\" % os.path.join(basedir, ...
<|body_start_0|> BaseResource.__init__(self, *args, **kw) self._rsc = eval(open('%s.txt' % self.basesourcefile, 'r').read().replace('\r\n', '\n')) self._code = open('%s.py' % self.basesourcefile, 'r').read() <|end_body_0|> <|body_start_1|> fle = open(os.path.join(basedir, self.name) + '...
Represents a Python Card resource object
Resource
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Resource: """Represents a Python Card resource object""" def __init__(self, *args, **kw): """Initialize the PythonCard resource""" <|body_0|> def writeToFile(self, basedir, write_code=0): """Write ourselves out to a directory""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_10k_train_008027
2,155
permissive
[ { "docstring": "Initialize the PythonCard resource", "name": "__init__", "signature": "def __init__(self, *args, **kw)" }, { "docstring": "Write ourselves out to a directory", "name": "writeToFile", "signature": "def writeToFile(self, basedir, write_code=0)" } ]
2
stack_v2_sparse_classes_30k_train_001905
Implement the Python class `Resource` described below. Class description: Represents a Python Card resource object Method signatures and docstrings: - def __init__(self, *args, **kw): Initialize the PythonCard resource - def writeToFile(self, basedir, write_code=0): Write ourselves out to a directory
Implement the Python class `Resource` described below. Class description: Represents a Python Card resource object Method signatures and docstrings: - def __init__(self, *args, **kw): Initialize the PythonCard resource - def writeToFile(self, basedir, write_code=0): Write ourselves out to a directory <|skeleton|> cl...
847ce71e85093ea5ee668ec61dbfba760ffa6bbd
<|skeleton|> class Resource: """Represents a Python Card resource object""" def __init__(self, *args, **kw): """Initialize the PythonCard resource""" <|body_0|> def writeToFile(self, basedir, write_code=0): """Write ourselves out to a directory""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Resource: """Represents a Python Card resource object""" def __init__(self, *args, **kw): """Initialize the PythonCard resource""" BaseResource.__init__(self, *args, **kw) self._rsc = eval(open('%s.txt' % self.basesourcefile, 'r').read().replace('\r\n', '\n')) self._code =...
the_stack_v2_python_sparse
vb2py/targets/pythoncard/resource.py
rayzamgh/sumurProjection
train
1
82ae17cdc5863bf5bf0f52f8fd4bc6763614ff28
[ "self.parent = parent\nself.press = None\nself.background = None\nself.y = y\nself.line = Axis.axhline(y)\nself.line.set_linewidth(0.2)\nself.connect()", "self.cidpress1 = self.line.figure.canvas.mpl_connect('button_press_event', self.on_press)\nself.cidrelease1 = self.line.figure.canvas.mpl_connect('button_relea...
<|body_start_0|> self.parent = parent self.press = None self.background = None self.y = y self.line = Axis.axhline(y) self.line.set_linewidth(0.2) self.connect() <|end_body_0|> <|body_start_1|> self.cidpress1 = self.line.figure.canvas.mpl_connect('button_...
This is a class to create an horizontal line that can be drag in a vertical fashion. Documentation of this part is not torough as it does not come from me. I took some part of another code and adapted it to this one. Attributes: parent : tkinter frame in which the matplotlib pyplot is gridded into. press : This attribu...
HorizontalDraggableLine
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HorizontalDraggableLine: """This is a class to create an horizontal line that can be drag in a vertical fashion. Documentation of this part is not torough as it does not come from me. I took some part of another code and adapted it to this one. Attributes: parent : tkinter frame in which the matp...
stack_v2_sparse_classes_10k_train_008028
32,818
no_license
[ { "docstring": "The constructor for the HorizontalDraggableLine Class. Parameters: parent : tkinter Frame object where the object is placed in. y : Initial position of your horizontal line on the y axis Axis : axis of your pyplot graphic that will contain this line.", "name": "__init__", "signature": "d...
6
stack_v2_sparse_classes_30k_train_000460
Implement the Python class `HorizontalDraggableLine` described below. Class description: This is a class to create an horizontal line that can be drag in a vertical fashion. Documentation of this part is not torough as it does not come from me. I took some part of another code and adapted it to this one. Attributes: p...
Implement the Python class `HorizontalDraggableLine` described below. Class description: This is a class to create an horizontal line that can be drag in a vertical fashion. Documentation of this part is not torough as it does not come from me. I took some part of another code and adapted it to this one. Attributes: p...
6e479850a21c337c0c47379538f002bca97e03f1
<|skeleton|> class HorizontalDraggableLine: """This is a class to create an horizontal line that can be drag in a vertical fashion. Documentation of this part is not torough as it does not come from me. I took some part of another code and adapted it to this one. Attributes: parent : tkinter frame in which the matp...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class HorizontalDraggableLine: """This is a class to create an horizontal line that can be drag in a vertical fashion. Documentation of this part is not torough as it does not come from me. I took some part of another code and adapted it to this one. Attributes: parent : tkinter frame in which the matplotlib pyplot...
the_stack_v2_python_sparse
Labo_Env/ultrafastGUI/Graphic.py
UltraFastQ/femtoQ-Intruments
train
2
8827f0c25cbdc0b7e78b07033b627e2cf07a33a2
[ "fn_id = id(fn)\nif cls.tick_threads.get(fn_id, None) is not None:\n logger.warning('{} already registered with PythonTickNotifier'.format(str(fn)))\n return None\nrepeater = cls._tick(fn_id)\ncls.tick_threads[fn_id] = (fn, repeater)\nreturn fn_id", "pair = cls.tick_threads.get(token, None)\nif pair:\n p...
<|body_start_0|> fn_id = id(fn) if cls.tick_threads.get(fn_id, None) is not None: logger.warning('{} already registered with PythonTickNotifier'.format(str(fn))) return None repeater = cls._tick(fn_id) cls.tick_threads[fn_id] = (fn, repeater) return fn_id ...
This notifier implements a Tick notifier
PythonTickCallback
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PythonTickCallback: """This notifier implements a Tick notifier""" def register(cls, fn): """Register the given Python function :param fn: function, python function to register :return: token of non defined type to later unregister the function""" <|body_0|> def unregist...
stack_v2_sparse_classes_10k_train_008029
21,288
permissive
[ { "docstring": "Register the given Python function :param fn: function, python function to register :return: token of non defined type to later unregister the function", "name": "register", "signature": "def register(cls, fn)" }, { "docstring": "Unregister the given Python function :param token:...
3
stack_v2_sparse_classes_30k_train_000739
Implement the Python class `PythonTickCallback` described below. Class description: This notifier implements a Tick notifier Method signatures and docstrings: - def register(cls, fn): Register the given Python function :param fn: function, python function to register :return: token of non defined type to later unregi...
Implement the Python class `PythonTickCallback` described below. Class description: This notifier implements a Tick notifier Method signatures and docstrings: - def register(cls, fn): Register the given Python function :param fn: function, python function to register :return: token of non defined type to later unregi...
a4f77a3fdd981eac494331e429c92bd3e4a87d3b
<|skeleton|> class PythonTickCallback: """This notifier implements a Tick notifier""" def register(cls, fn): """Register the given Python function :param fn: function, python function to register :return: token of non defined type to later unregister the function""" <|body_0|> def unregist...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PythonTickCallback: """This notifier implements a Tick notifier""" def register(cls, fn): """Register the given Python function :param fn: function, python function to register :return: token of non defined type to later unregister the function""" fn_id = id(fn) if cls.tick_thread...
the_stack_v2_python_sparse
tpDcc/abstract/callback.py
OmniZ3D/tpDcc-core
train
0
b2e0fe2f6f67ebeabd8733a92d188cd605929882
[ "parser = ParlaiParser(True, True, 'Generate Dense Embs')\nparser.add_argument('--passages-file', type=str, help='file containing passages to encode. file should be a tsv file.')\nparser.add_argument('--outfile', type=str, help='where to save the passage embeddings')\nparser.add_argument('--num-shards', type=int, d...
<|body_start_0|> parser = ParlaiParser(True, True, 'Generate Dense Embs') parser.add_argument('--passages-file', type=str, help='file containing passages to encode. file should be a tsv file.') parser.add_argument('--outfile', type=str, help='where to save the passage embeddings') parser...
Generate Dense Embeddings.
Generator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Generator: """Generate Dense Embeddings.""" def setup_args(cls): """File in/out args, and sharding args.""" <|body_0|> def run(self): """1) load model 2) generate embeddings 3) save embeddings.""" <|body_1|> def encode_passages(self, agent: TorchRank...
stack_v2_sparse_classes_10k_train_008030
7,678
permissive
[ { "docstring": "File in/out args, and sharding args.", "name": "setup_args", "signature": "def setup_args(cls)" }, { "docstring": "1) load model 2) generate embeddings 3) save embeddings.", "name": "run", "signature": "def run(self)" }, { "docstring": "Encode passages with model,...
5
null
Implement the Python class `Generator` described below. Class description: Generate Dense Embeddings. Method signatures and docstrings: - def setup_args(cls): File in/out args, and sharding args. - def run(self): 1) load model 2) generate embeddings 3) save embeddings. - def encode_passages(self, agent: TorchRankerAg...
Implement the Python class `Generator` described below. Class description: Generate Dense Embeddings. Method signatures and docstrings: - def setup_args(cls): File in/out args, and sharding args. - def run(self): 1) load model 2) generate embeddings 3) save embeddings. - def encode_passages(self, agent: TorchRankerAg...
e1d899edfb92471552bae153f59ad30aa7fca468
<|skeleton|> class Generator: """Generate Dense Embeddings.""" def setup_args(cls): """File in/out args, and sharding args.""" <|body_0|> def run(self): """1) load model 2) generate embeddings 3) save embeddings.""" <|body_1|> def encode_passages(self, agent: TorchRank...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Generator: """Generate Dense Embeddings.""" def setup_args(cls): """File in/out args, and sharding args.""" parser = ParlaiParser(True, True, 'Generate Dense Embs') parser.add_argument('--passages-file', type=str, help='file containing passages to encode. file should be a tsv file...
the_stack_v2_python_sparse
parlai/agents/rag/scripts/generate_dense_embeddings.py
facebookresearch/ParlAI
train
10,943
5387360372fa674be695cc9aa2ef1c0cb4c8a047
[ "self.assertTrue(geneutil.longestRun('AAAAA', 'A') == 5)\nself.assertTrue(geneutil.longestRun('AAATAA', 'A', 1) == 6)\nself.assertTrue(geneutil.longestRun('AAATTAA', 'A', 1) == 3)\nself.assertTrue(geneutil.longestRun('AAATTAA', 'A', 2) == 7)\nself.assertTrue(geneutil.longestRun('TAAATAA', 'A', 1) == 6)\nself.assert...
<|body_start_0|> self.assertTrue(geneutil.longestRun('AAAAA', 'A') == 5) self.assertTrue(geneutil.longestRun('AAATAA', 'A', 1) == 6) self.assertTrue(geneutil.longestRun('AAATTAA', 'A', 1) == 3) self.assertTrue(geneutil.longestRun('AAATTAA', 'A', 2) == 7) self.assertTrue(geneutil....
test001
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class test001: def test_longest_run(self): """Longest run testcases""" <|body_0|> def test_longest_run_mult(self): """Longest run testcases with more than one target""" <|body_1|> def test_max_sliding_count(self): """Max Sliding Count testcases""" ...
stack_v2_sparse_classes_10k_train_008031
2,692
no_license
[ { "docstring": "Longest run testcases", "name": "test_longest_run", "signature": "def test_longest_run(self)" }, { "docstring": "Longest run testcases with more than one target", "name": "test_longest_run_mult", "signature": "def test_longest_run_mult(self)" }, { "docstring": "Ma...
3
stack_v2_sparse_classes_30k_train_004017
Implement the Python class `test001` described below. Class description: Implement the test001 class. Method signatures and docstrings: - def test_longest_run(self): Longest run testcases - def test_longest_run_mult(self): Longest run testcases with more than one target - def test_max_sliding_count(self): Max Sliding...
Implement the Python class `test001` described below. Class description: Implement the test001 class. Method signatures and docstrings: - def test_longest_run(self): Longest run testcases - def test_longest_run_mult(self): Longest run testcases with more than one target - def test_max_sliding_count(self): Max Sliding...
d7ddd2b585a841c6d986974a24a53e4d1abe71ba
<|skeleton|> class test001: def test_longest_run(self): """Longest run testcases""" <|body_0|> def test_longest_run_mult(self): """Longest run testcases with more than one target""" <|body_1|> def test_max_sliding_count(self): """Max Sliding Count testcases""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class test001: def test_longest_run(self): """Longest run testcases""" self.assertTrue(geneutil.longestRun('AAAAA', 'A') == 5) self.assertTrue(geneutil.longestRun('AAATAA', 'A', 1) == 6) self.assertTrue(geneutil.longestRun('AAATTAA', 'A', 1) == 3) self.assertTrue(geneutil.lon...
the_stack_v2_python_sparse
src/geneutil_test.py
dad/base
train
0
33142880108efb5e0838fa3eb24363da09e0985a
[ "left = 0\nright = len(s) - 1\nif not s == s[::-1]:\n while left < right:\n if s[left] == s[right]:\n left += 1\n right -= 1\n else:\n str1 = s[:left] + s[left + 1:]\n str2 = s[:right] + s[right + 1:]\n return str1 == str1[::-1] or str2 == str2...
<|body_start_0|> left = 0 right = len(s) - 1 if not s == s[::-1]: while left < right: if s[left] == s[right]: left += 1 right -= 1 else: str1 = s[:left] + s[left + 1:] str2...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def validPalindrome(self, s): """:type s: str :rtype: bool""" <|body_0|> def validPalindrome2(self, s): """:type s: str :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> left = 0 right = len(s) - 1 if not s == s[...
stack_v2_sparse_classes_10k_train_008032
2,011
no_license
[ { "docstring": ":type s: str :rtype: bool", "name": "validPalindrome", "signature": "def validPalindrome(self, s)" }, { "docstring": ":type s: str :rtype: bool", "name": "validPalindrome2", "signature": "def validPalindrome2(self, s)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def validPalindrome(self, s): :type s: str :rtype: bool - def validPalindrome2(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 validPalindrome(self, s): :type s: str :rtype: bool - def validPalindrome2(self, s): :type s: str :rtype: bool <|skeleton|> class Solution: def validPalindrome(self, s)...
3f0ffd519404165fd1a735441b212c801fd1ad1e
<|skeleton|> class Solution: def validPalindrome(self, s): """:type s: str :rtype: bool""" <|body_0|> def validPalindrome2(self, s): """:type s: str :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def validPalindrome(self, s): """:type s: str :rtype: bool""" left = 0 right = len(s) - 1 if not s == s[::-1]: while left < right: if s[left] == s[right]: left += 1 right -= 1 else: ...
the_stack_v2_python_sparse
Problems/0600_0699/0680_Valid_Palindrome2/Project_Python3/Valid_Palindrome2.py
NobuyukiInoue/LeetCode
train
0
1c8c929ab841d566a7478ce99b3b02fe5071e1b9
[ "output_buffers = {}\nfor name, shape in output_shapes.items():\n ort_type = TypeHelper.get_output_type(ort_session, name)\n torch_type = TypeHelper.ort_type_to_torch_type(ort_type)\n output_buffers[name] = torch.empty(numpy.prod(shape), dtype=torch_type, device=device)\nreturn output_buffers", "if name_...
<|body_start_0|> output_buffers = {} for name, shape in output_shapes.items(): ort_type = TypeHelper.get_output_type(ort_session, name) torch_type = TypeHelper.ort_type_to_torch_type(ort_type) output_buffers[name] = torch.empty(numpy.prod(shape), dtype=torch_type, dev...
IOBindingHelper
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IOBindingHelper: def get_output_buffers(ort_session: InferenceSession, output_shapes, device): """Returns a dictionary of output name as key, and 1D tensor as value. The tensor has enough space for given shape.""" <|body_0|> def prepare_io_binding(ort_session, input_ids: tor...
stack_v2_sparse_classes_10k_train_008033
12,305
permissive
[ { "docstring": "Returns a dictionary of output name as key, and 1D tensor as value. The tensor has enough space for given shape.", "name": "get_output_buffers", "signature": "def get_output_buffers(ort_session: InferenceSession, output_shapes, device)" }, { "docstring": "Returnas IO binding obje...
3
null
Implement the Python class `IOBindingHelper` described below. Class description: Implement the IOBindingHelper class. Method signatures and docstrings: - def get_output_buffers(ort_session: InferenceSession, output_shapes, device): Returns a dictionary of output name as key, and 1D tensor as value. The tensor has eno...
Implement the Python class `IOBindingHelper` described below. Class description: Implement the IOBindingHelper class. Method signatures and docstrings: - def get_output_buffers(ort_session: InferenceSession, output_shapes, device): Returns a dictionary of output name as key, and 1D tensor as value. The tensor has eno...
5e747071be882efd6b54d7a7421042e68dcd6aff
<|skeleton|> class IOBindingHelper: def get_output_buffers(ort_session: InferenceSession, output_shapes, device): """Returns a dictionary of output name as key, and 1D tensor as value. The tensor has enough space for given shape.""" <|body_0|> def prepare_io_binding(ort_session, input_ids: tor...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class IOBindingHelper: def get_output_buffers(ort_session: InferenceSession, output_shapes, device): """Returns a dictionary of output name as key, and 1D tensor as value. The tensor has enough space for given shape.""" output_buffers = {} for name, shape in output_shapes.items(): ...
the_stack_v2_python_sparse
onnxruntime/python/tools/transformers/io_binding_helper.py
microsoft/onnxruntime
train
9,912
d5bf0f7dde159b5b620f956cacabdaa0a3c3f8a2
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn EventPropagationResult()", "from .event_propagation_status import EventPropagationStatus\nfrom .event_propagation_status import EventPropagationStatus\nfields: Dict[str, Callable[[Any], None]] = {'location': lambda n: setattr(self, 'lo...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return EventPropagationResult() <|end_body_0|> <|body_start_1|> from .event_propagation_status import EventPropagationStatus from .event_propagation_status import EventPropagationStatus ...
EventPropagationResult
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EventPropagationResult: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventPropagationResult: """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 ...
stack_v2_sparse_classes_10k_train_008034
3,642
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: EventPropagationResult", "name": "create_from_discriminator_value", "signature": "def create_from_discrimina...
3
null
Implement the Python class `EventPropagationResult` described below. Class description: Implement the EventPropagationResult class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventPropagationResult: Creates a new instance of the appropriate class b...
Implement the Python class `EventPropagationResult` described below. Class description: Implement the EventPropagationResult class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventPropagationResult: Creates a new instance of the appropriate class b...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class EventPropagationResult: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventPropagationResult: """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 ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class EventPropagationResult: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventPropagationResult: """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 Ret...
the_stack_v2_python_sparse
msgraph/generated/models/security/event_propagation_result.py
microsoftgraph/msgraph-sdk-python
train
135
cd9aaae27ac8885e03fe3de25078bc4c80ae173e
[ "match = self.rx_interface_name.match(s)\nif not match:\n raise InterfaceTypeError(\"Invalid interface '%s'\" % s)\nt = match.group(1)[:2]\nif t.lower() == 'bu':\n t = 'BE'\nreturn '%s%s' % (t, match.group(2))", "me = ' %s'\nmne = ' %s le %d'\nr = []\nfor prefix, min_len, max_len in pl:\n if min_len == m...
<|body_start_0|> match = self.rx_interface_name.match(s) if not match: raise InterfaceTypeError("Invalid interface '%s'" % s) t = match.group(1)[:2] if t.lower() == 'bu': t = 'BE' return '%s%s' % (t, match.group(2)) <|end_body_0|> <|body_start_1|> ...
Profile
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Profile: def convert_interface_name(self, s): """MgmtEth0/1/CPU0/0 GigabitEthernet0/2/0/0.1000 Te0/0/1/3 Bundle-Ether1.5011035 Bundle-Ether1.10231016.ip18484""" <|body_0|> def generate_prefix_list(self, name, pl): """Generate prefix list _name_. pl is a list of (pref...
stack_v2_sparse_classes_10k_train_008035
2,215
permissive
[ { "docstring": "MgmtEth0/1/CPU0/0 GigabitEthernet0/2/0/0.1000 Te0/0/1/3 Bundle-Ether1.5011035 Bundle-Ether1.10231016.ip18484", "name": "convert_interface_name", "signature": "def convert_interface_name(self, s)" }, { "docstring": "Generate prefix list _name_. pl is a list of (prefix, min_len, ma...
2
stack_v2_sparse_classes_30k_train_004032
Implement the Python class `Profile` described below. Class description: Implement the Profile class. Method signatures and docstrings: - def convert_interface_name(self, s): MgmtEth0/1/CPU0/0 GigabitEthernet0/2/0/0.1000 Te0/0/1/3 Bundle-Ether1.5011035 Bundle-Ether1.10231016.ip18484 - def generate_prefix_list(self, n...
Implement the Python class `Profile` described below. Class description: Implement the Profile class. Method signatures and docstrings: - def convert_interface_name(self, s): MgmtEth0/1/CPU0/0 GigabitEthernet0/2/0/0.1000 Te0/0/1/3 Bundle-Ether1.5011035 Bundle-Ether1.10231016.ip18484 - def generate_prefix_list(self, n...
aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb
<|skeleton|> class Profile: def convert_interface_name(self, s): """MgmtEth0/1/CPU0/0 GigabitEthernet0/2/0/0.1000 Te0/0/1/3 Bundle-Ether1.5011035 Bundle-Ether1.10231016.ip18484""" <|body_0|> def generate_prefix_list(self, name, pl): """Generate prefix list _name_. pl is a list of (pref...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Profile: def convert_interface_name(self, s): """MgmtEth0/1/CPU0/0 GigabitEthernet0/2/0/0.1000 Te0/0/1/3 Bundle-Ether1.5011035 Bundle-Ether1.10231016.ip18484""" match = self.rx_interface_name.match(s) if not match: raise InterfaceTypeError("Invalid interface '%s'" % s) ...
the_stack_v2_python_sparse
sa/profiles/Cisco/IOSXR/profile.py
ewwwcha/noc
train
1
80de1261b3d77078d8170d185334f9fb64778e32
[ "try:\n return_data = WorkFlowSimpleManager().create_workflow(nnid, wfver, request.data['type'])\n return Response(json.dumps(return_data))\nexcept Exception as e:\n return_data = {'status': '404', 'result': str(e)}\n return Response(json.dumps(return_data))", "try:\n return_data = NNCommonManager(...
<|body_start_0|> try: return_data = WorkFlowSimpleManager().create_workflow(nnid, wfver, request.data['type']) return Response(json.dumps(return_data)) except Exception as e: return_data = {'status': '404', 'result': str(e)} return Response(json.dumps(retu...
WorkFlowInitSimple
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WorkFlowInitSimple: def post(self, request, nnid, wfver): """Simply initialize fixed graph flow which is preefined You can choose process with network id and data type There are several processes already designed --- # Class Name : WorkFlowInitSimple # Description: Set graph flow with gi...
stack_v2_sparse_classes_10k_train_008036
2,447
permissive
[ { "docstring": "Simply initialize fixed graph flow which is preefined You can choose process with network id and data type There are several processes already designed --- # Class Name : WorkFlowInitSimple # Description: Set graph flow with given name and data type", "name": "post", "signature": "def po...
3
stack_v2_sparse_classes_30k_test_000165
Implement the Python class `WorkFlowInitSimple` described below. Class description: Implement the WorkFlowInitSimple class. Method signatures and docstrings: - def post(self, request, nnid, wfver): Simply initialize fixed graph flow which is preefined You can choose process with network id and data type There are sev...
Implement the Python class `WorkFlowInitSimple` described below. Class description: Implement the WorkFlowInitSimple class. Method signatures and docstrings: - def post(self, request, nnid, wfver): Simply initialize fixed graph flow which is preefined You can choose process with network id and data type There are sev...
6ad2fbc7384e4dbe7e3e63bdb44c8ce0387f4b7f
<|skeleton|> class WorkFlowInitSimple: def post(self, request, nnid, wfver): """Simply initialize fixed graph flow which is preefined You can choose process with network id and data type There are several processes already designed --- # Class Name : WorkFlowInitSimple # Description: Set graph flow with gi...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class WorkFlowInitSimple: def post(self, request, nnid, wfver): """Simply initialize fixed graph flow which is preefined You can choose process with network id and data type There are several processes already designed --- # Class Name : WorkFlowInitSimple # Description: Set graph flow with given name and d...
the_stack_v2_python_sparse
api/views/workflow_init_simple.py
yurimkoo/tensormsa
train
1
c194d7084b8230c7c9c73e2f2d8d4015261c2c79
[ "self.SetStartDate(2010, 1, 1)\nself.SetEndDate(2013, 12, 31)\nself.SetCash(100000)\nIntrinioConfig.SetUserAndPassword('intrinio-username', 'intrinio-password')\nIntrinioConfig.SetTimeIntervalBetweenCalls(timedelta(minutes=1))\nself.uso = self.AddEquity('USO', Resolution.Daily).Symbol\nself.Securities[self.uso].Set...
<|body_start_0|> self.SetStartDate(2010, 1, 1) self.SetEndDate(2013, 12, 31) self.SetCash(100000) IntrinioConfig.SetUserAndPassword('intrinio-username', 'intrinio-password') IntrinioConfig.SetTimeIntervalBetweenCalls(timedelta(minutes=1)) self.uso = self.AddEquity('USO', ...
BasicTemplateIntrinioEconomicData
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BasicTemplateIntrinioEconomicData: def Initialize(self): """Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.""" <|body_0|> def OnData(self, slice): """OnData event is the primary...
stack_v2_sparse_classes_10k_train_008037
2,830
permissive
[ { "docstring": "Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.", "name": "Initialize", "signature": "def Initialize(self)" }, { "docstring": "OnData event is the primary entry point for your algorithm. Eac...
2
null
Implement the Python class `BasicTemplateIntrinioEconomicData` described below. Class description: Implement the BasicTemplateIntrinioEconomicData class. Method signatures and docstrings: - def Initialize(self): Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. A...
Implement the Python class `BasicTemplateIntrinioEconomicData` described below. Class description: Implement the BasicTemplateIntrinioEconomicData class. Method signatures and docstrings: - def Initialize(self): Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. A...
b33dd3bc140e14b883f39ecf848a793cf7292277
<|skeleton|> class BasicTemplateIntrinioEconomicData: def Initialize(self): """Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.""" <|body_0|> def OnData(self, slice): """OnData event is the primary...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class BasicTemplateIntrinioEconomicData: def Initialize(self): """Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.""" self.SetStartDate(2010, 1, 1) self.SetEndDate(2013, 12, 31) self.SetCash(1000...
the_stack_v2_python_sparse
Algorithm.Python/BasicTemplateIntrinioEconomicData.py
Capnode/Algoloop
train
87
60e1981a427bc6783307ac4b7812390681fd4801
[ "if data is None:\n if lambtha <= 0:\n raise ValueError('lambtha must be a positive value')\n else:\n self.lambtha = float(lambtha)\nelif type(data) is not list:\n raise TypeError('data must be a list')\nelif len(data) < 2:\n raise ValueError('data must contain multiple values')\nelse:\n ...
<|body_start_0|> if data is None: if lambtha <= 0: raise ValueError('lambtha must be a positive value') else: self.lambtha = float(lambtha) elif type(data) is not list: raise TypeError('data must be a list') elif len(data) < 2: ...
This class represents an exponential distribution
Exponential
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Exponential: """This class represents an exponential distribution""" def __init__(self, data=None, lambtha=1.0): """This function initializes the Exponential class""" <|body_0|> def pdf(self, x): """Calculates the value of the PDF for a given time period""" ...
stack_v2_sparse_classes_10k_train_008038
1,261
no_license
[ { "docstring": "This function initializes the Exponential class", "name": "__init__", "signature": "def __init__(self, data=None, lambtha=1.0)" }, { "docstring": "Calculates the value of the PDF for a given time period", "name": "pdf", "signature": "def pdf(self, x)" }, { "docstr...
3
stack_v2_sparse_classes_30k_train_006638
Implement the Python class `Exponential` described below. Class description: This class represents an exponential distribution Method signatures and docstrings: - def __init__(self, data=None, lambtha=1.0): This function initializes the Exponential class - def pdf(self, x): Calculates the value of the PDF for a given...
Implement the Python class `Exponential` described below. Class description: This class represents an exponential distribution Method signatures and docstrings: - def __init__(self, data=None, lambtha=1.0): This function initializes the Exponential class - def pdf(self, x): Calculates the value of the PDF for a given...
ac4f79965e65b7716029cd31a9b026c904bdef09
<|skeleton|> class Exponential: """This class represents an exponential distribution""" def __init__(self, data=None, lambtha=1.0): """This function initializes the Exponential class""" <|body_0|> def pdf(self, x): """Calculates the value of the PDF for a given time period""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Exponential: """This class represents an exponential distribution""" def __init__(self, data=None, lambtha=1.0): """This function initializes the Exponential class""" if data is None: if lambtha <= 0: raise ValueError('lambtha must be a positive value') ...
the_stack_v2_python_sparse
math/0x03-probability/exponential.py
tyedge/holbertonschool-machine_learning
train
0
800e89db03c0091e696d9ee58a97ffd90de94cbb
[ "if isinstance(key, int):\n return TransType(key)\nif key not in TransType._member_map_:\n extend_enum(TransType, key, default)\nreturn TransType[key]", "if not (isinstance(value, int) and 0 <= value <= 255):\n raise ValueError('%r is not a valid %s' % (value, cls.__name__))\nif 144 <= value <= 252:\n ...
<|body_start_0|> if isinstance(key, int): return TransType(key) if key not in TransType._member_map_: extend_enum(TransType, key, default) return TransType[key] <|end_body_0|> <|body_start_1|> if not (isinstance(value, int) and 0 <= value <= 255): rai...
[TransType] Transport Layer Protocol Numbers
TransType
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TransType: """[TransType] Transport Layer Protocol Numbers""" def get(key, default=-1): """Backport support for original codes.""" <|body_0|> def _missing_(cls, value): """Lookup function used when value is not found.""" <|body_1|> <|end_skeleton|> <|bo...
stack_v2_sparse_classes_10k_train_008039
13,924
permissive
[ { "docstring": "Backport support for original codes.", "name": "get", "signature": "def get(key, default=-1)" }, { "docstring": "Lookup function used when value is not found.", "name": "_missing_", "signature": "def _missing_(cls, value)" } ]
2
stack_v2_sparse_classes_30k_train_006854
Implement the Python class `TransType` described below. Class description: [TransType] Transport Layer Protocol Numbers Method signatures and docstrings: - def get(key, default=-1): Backport support for original codes. - def _missing_(cls, value): Lookup function used when value is not found.
Implement the Python class `TransType` described below. Class description: [TransType] Transport Layer Protocol Numbers Method signatures and docstrings: - def get(key, default=-1): Backport support for original codes. - def _missing_(cls, value): Lookup function used when value is not found. <|skeleton|> class Tran...
71363d7948003fec88cedcf5bc80b6befa2ba244
<|skeleton|> class TransType: """[TransType] Transport Layer Protocol Numbers""" def get(key, default=-1): """Backport support for original codes.""" <|body_0|> def _missing_(cls, value): """Lookup function used when value is not found.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TransType: """[TransType] Transport Layer Protocol Numbers""" def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return TransType(key) if key not in TransType._member_map_: extend_enum(TransType, key, default) ...
the_stack_v2_python_sparse
pcapkit/const/reg/transtype.py
hiok2000/PyPCAPKit
train
0
7217847836d8fea86df27c06c7dfa923abecadbe
[ "self.zeroth_coefficient = zeroth_coefficient\nself.zeroth_signal_scale = zeroth_signal_scale\nsuper().__init__(inner_coefficient=inner_coefficient, outer_coefficient=outer_coefficient, signal_scale=signal_scale)", "regularization_weights = self.regularization_weights_from(linear_obj=linear_obj)\npix_sub_weights_...
<|body_start_0|> self.zeroth_coefficient = zeroth_coefficient self.zeroth_signal_scale = zeroth_signal_scale super().__init__(inner_coefficient=inner_coefficient, outer_coefficient=outer_coefficient, signal_scale=signal_scale) <|end_body_0|> <|body_start_1|> regularization_weights = sel...
AdaptiveBrightnessSplitZeroth
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdaptiveBrightnessSplitZeroth: def __init__(self, zeroth_coefficient: float=1.0, zeroth_signal_scale: float=1.0, inner_coefficient: float=1.0, outer_coefficient: float=1.0, signal_scale: float=1.0): """An adaptive regularization scheme which splits every source pixel into a cross of four...
stack_v2_sparse_classes_10k_train_008040
5,208
permissive
[ { "docstring": "An adaptive regularization scheme which splits every source pixel into a cross of four regularization points (regularization is described in the `Regularization` class above) and interpolates to these points in order to apply smoothing on the solution of an `Inversion`. The size of this cross is...
2
stack_v2_sparse_classes_30k_train_001542
Implement the Python class `AdaptiveBrightnessSplitZeroth` described below. Class description: Implement the AdaptiveBrightnessSplitZeroth class. Method signatures and docstrings: - def __init__(self, zeroth_coefficient: float=1.0, zeroth_signal_scale: float=1.0, inner_coefficient: float=1.0, outer_coefficient: float...
Implement the Python class `AdaptiveBrightnessSplitZeroth` described below. Class description: Implement the AdaptiveBrightnessSplitZeroth class. Method signatures and docstrings: - def __init__(self, zeroth_coefficient: float=1.0, zeroth_signal_scale: float=1.0, inner_coefficient: float=1.0, outer_coefficient: float...
6639dd86d21ea28e942155753ec556752735b4e4
<|skeleton|> class AdaptiveBrightnessSplitZeroth: def __init__(self, zeroth_coefficient: float=1.0, zeroth_signal_scale: float=1.0, inner_coefficient: float=1.0, outer_coefficient: float=1.0, signal_scale: float=1.0): """An adaptive regularization scheme which splits every source pixel into a cross of four...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AdaptiveBrightnessSplitZeroth: def __init__(self, zeroth_coefficient: float=1.0, zeroth_signal_scale: float=1.0, inner_coefficient: float=1.0, outer_coefficient: float=1.0, signal_scale: float=1.0): """An adaptive regularization scheme which splits every source pixel into a cross of four regularizatio...
the_stack_v2_python_sparse
autoarray/inversion/regularization/adaptive_brightness_split_zeroth.py
Jammy2211/PyAutoArray
train
6
435f48322403ca8e571f3bccfe8cc3a0a1677b7e
[ "super().__init__()\ncheck_boundaries(boundaries)\nself.boundaries = boundaries\nself.frequencies = frequencies", "self.randomize(None)\nself.magnitude = self.R.uniform(low=self.boundaries[0], high=self.boundaries[1])\nself.freqs = self.R.uniform(low=self.frequencies[0], high=self.frequencies[1])\nlength = signal...
<|body_start_0|> super().__init__() check_boundaries(boundaries) self.boundaries = boundaries self.frequencies = frequencies <|end_body_0|> <|body_start_1|> self.randomize(None) self.magnitude = self.R.uniform(low=self.boundaries[0], high=self.boundaries[1]) self...
Add a random sinusoidal signal to the input signal
SignalRandAddSine
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SignalRandAddSine: """Add a random sinusoidal signal to the input signal""" def __init__(self, boundaries: Sequence[float]=(0.1, 0.3), frequencies: Sequence[float]=(0.001, 0.02)) -> None: """Args: boundaries: list defining lower and upper boundaries for the sinusoidal magnitude, lowe...
stack_v2_sparse_classes_10k_train_008041
16,322
permissive
[ { "docstring": "Args: boundaries: list defining lower and upper boundaries for the sinusoidal magnitude, lower and upper values need to be positive ,default : ``[0.1, 0.3]`` frequencies: list defining lower and upper frequencies for sinusoidal signal generation ,default : ``[0.001, 0.02]``", "name": "__init...
2
stack_v2_sparse_classes_30k_val_000395
Implement the Python class `SignalRandAddSine` described below. Class description: Add a random sinusoidal signal to the input signal Method signatures and docstrings: - def __init__(self, boundaries: Sequence[float]=(0.1, 0.3), frequencies: Sequence[float]=(0.001, 0.02)) -> None: Args: boundaries: list defining lowe...
Implement the Python class `SignalRandAddSine` described below. Class description: Add a random sinusoidal signal to the input signal Method signatures and docstrings: - def __init__(self, boundaries: Sequence[float]=(0.1, 0.3), frequencies: Sequence[float]=(0.001, 0.02)) -> None: Args: boundaries: list defining lowe...
e48c3e2c741fa3fc705c4425d17ac4a5afac6c47
<|skeleton|> class SignalRandAddSine: """Add a random sinusoidal signal to the input signal""" def __init__(self, boundaries: Sequence[float]=(0.1, 0.3), frequencies: Sequence[float]=(0.001, 0.02)) -> None: """Args: boundaries: list defining lower and upper boundaries for the sinusoidal magnitude, lowe...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SignalRandAddSine: """Add a random sinusoidal signal to the input signal""" def __init__(self, boundaries: Sequence[float]=(0.1, 0.3), frequencies: Sequence[float]=(0.001, 0.02)) -> None: """Args: boundaries: list defining lower and upper boundaries for the sinusoidal magnitude, lower and upper v...
the_stack_v2_python_sparse
monai/transforms/signal/array.py
Project-MONAI/MONAI
train
4,805
4f17f068614e5feb117feee18b2a075bc575141c
[ "for row in matrix:\n for col in range(1, len(row)):\n row[col] += row[col - 1]\nself.matrix = matrix", "original = self.matrix[row][col]\nif col != 0:\n original -= self.matrix[row][col - 1]\ndiff = original - val\nfor y in range(col, len(self.matrix[0])):\n self.matrix[row][y] -= diff", "sum_ ...
<|body_start_0|> for row in matrix: for col in range(1, len(row)): row[col] += row[col - 1] self.matrix = matrix <|end_body_0|> <|body_start_1|> original = self.matrix[row][col] if col != 0: original -= self.matrix[row][col - 1] diff = ori...
NumMatrix1
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumMatrix1: def __init__(self, matrix): """initialize your data structure here.""" <|body_0|> def update(self, row, col, val): """update the element at matrix[row,col] to val.""" <|body_1|> def sumRegion(self, row1, col1, row2, col2): """sum of e...
stack_v2_sparse_classes_10k_train_008042
3,097
no_license
[ { "docstring": "initialize your data structure here.", "name": "__init__", "signature": "def __init__(self, matrix)" }, { "docstring": "update the element at matrix[row,col] to val.", "name": "update", "signature": "def update(self, row, col, val)" }, { "docstring": "sum of eleme...
3
stack_v2_sparse_classes_30k_train_004612
Implement the Python class `NumMatrix1` described below. Class description: Implement the NumMatrix1 class. Method signatures and docstrings: - def __init__(self, matrix): initialize your data structure here. - def update(self, row, col, val): update the element at matrix[row,col] to val. - def sumRegion(self, row1, ...
Implement the Python class `NumMatrix1` described below. Class description: Implement the NumMatrix1 class. Method signatures and docstrings: - def __init__(self, matrix): initialize your data structure here. - def update(self, row, col, val): update the element at matrix[row,col] to val. - def sumRegion(self, row1, ...
502e121cc25fcd81afe3d029145aeee56db794f0
<|skeleton|> class NumMatrix1: def __init__(self, matrix): """initialize your data structure here.""" <|body_0|> def update(self, row, col, val): """update the element at matrix[row,col] to val.""" <|body_1|> def sumRegion(self, row1, col1, row2, col2): """sum of e...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class NumMatrix1: def __init__(self, matrix): """initialize your data structure here.""" for row in matrix: for col in range(1, len(row)): row[col] += row[col - 1] self.matrix = matrix def update(self, row, col, val): """update the element at matrix[r...
the_stack_v2_python_sparse
308NumMatrix.py
qinzhouhit/leetcode
train
0
ff79daf1a4ef52b2731218f8f93fbd105208a5a0
[ "self.data_dir = data_dir\nself.dims = dims\nself.channels = channels", "keys_to_features = {'volume': tf.FixedLenFeature(self.dims + [1], tf.float32), 'label': tf.FixedLenFeature(self.dims + [self.channels], tf.float32)}\nparsed = tf.parse_single_example(value, keys_to_features)\nprint(parsed['volume'].shape)\np...
<|body_start_0|> self.data_dir = data_dir self.dims = dims self.channels = channels <|end_body_0|> <|body_start_1|> keys_to_features = {'volume': tf.FixedLenFeature(self.dims + [1], tf.float32), 'label': tf.FixedLenFeature(self.dims + [self.channels], tf.float32)} parsed = tf.pa...
Reader reads from a tfrecord file to produce an image.
Reader
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Reader: """Reader reads from a tfrecord file to produce an image.""" def __init__(self, data_dir, dims, channels): """initialize the reader with a tfrecord dir and dims.""" <|body_0|> def dataset_parser(self, value): """parse the tfrecords.""" <|body_1|> ...
stack_v2_sparse_classes_10k_train_008043
2,755
no_license
[ { "docstring": "initialize the reader with a tfrecord dir and dims.", "name": "__init__", "signature": "def __init__(self, data_dir, dims, channels)" }, { "docstring": "parse the tfrecords.", "name": "dataset_parser", "signature": "def dataset_parser(self, value)" }, { "docstring...
4
stack_v2_sparse_classes_30k_train_001164
Implement the Python class `Reader` described below. Class description: Reader reads from a tfrecord file to produce an image. Method signatures and docstrings: - def __init__(self, data_dir, dims, channels): initialize the reader with a tfrecord dir and dims. - def dataset_parser(self, value): parse the tfrecords. -...
Implement the Python class `Reader` described below. Class description: Reader reads from a tfrecord file to produce an image. Method signatures and docstrings: - def __init__(self, data_dir, dims, channels): initialize the reader with a tfrecord dir and dims. - def dataset_parser(self, value): parse the tfrecords. -...
a7273c01d02528f5c547992fda482bbfb690fa6c
<|skeleton|> class Reader: """Reader reads from a tfrecord file to produce an image.""" def __init__(self, data_dir, dims, channels): """initialize the reader with a tfrecord dir and dims.""" <|body_0|> def dataset_parser(self, value): """parse the tfrecords.""" <|body_1|> ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Reader: """Reader reads from a tfrecord file to produce an image.""" def __init__(self, data_dir, dims, channels): """initialize the reader with a tfrecord dir and dims.""" self.data_dir = data_dir self.dims = dims self.channels = channels def dataset_parser(self, val...
the_stack_v2_python_sparse
records.py
drewlinsley/tpu_connectomics
train
0
1fd41dbcbb07d51ddf961e62787d70ad5a2a23e1
[ "m, n = (len(grid), len(grid[0]))\ndirs = [(-1, 0), (1, 0), (0, -1), (0, 1)]\n\ndef dfs(cur, pre, visited, mark):\n visited[cur[0]][cur[1]] = True\n for dx, dy in dirs:\n i, j = (cur[0] + dx, cur[1] + dy)\n if i < 0 or i >= m or j < 0 or (j >= n) or (grid[i][j] != mark):\n continue\n ...
<|body_start_0|> m, n = (len(grid), len(grid[0])) dirs = [(-1, 0), (1, 0), (0, -1), (0, 1)] def dfs(cur, pre, visited, mark): visited[cur[0]][cur[1]] = True for dx, dy in dirs: i, j = (cur[0] + dx, cur[1] + dy) if i < 0 or i >= m or j < 0 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def containsCycle(self, grid): """:type grid: List[List[str]] :rtype: bool""" <|body_0|> def containsCycleUF(self, grid): """:type grid: List[List[str]] :rtype: bool""" <|body_1|> def containsCycleTLE(self, grid): """:type grid: List[Li...
stack_v2_sparse_classes_10k_train_008044
28,242
no_license
[ { "docstring": ":type grid: List[List[str]] :rtype: bool", "name": "containsCycle", "signature": "def containsCycle(self, grid)" }, { "docstring": ":type grid: List[List[str]] :rtype: bool", "name": "containsCycleUF", "signature": "def containsCycleUF(self, grid)" }, { "docstring...
3
stack_v2_sparse_classes_30k_train_004617
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsCycle(self, grid): :type grid: List[List[str]] :rtype: bool - def containsCycleUF(self, grid): :type grid: List[List[str]] :rtype: bool - def containsCycleTLE(self, g...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsCycle(self, grid): :type grid: List[List[str]] :rtype: bool - def containsCycleUF(self, grid): :type grid: List[List[str]] :rtype: bool - def containsCycleTLE(self, g...
810575368ecffa97677bdb51744d1f716140bbb1
<|skeleton|> class Solution: def containsCycle(self, grid): """:type grid: List[List[str]] :rtype: bool""" <|body_0|> def containsCycleUF(self, grid): """:type grid: List[List[str]] :rtype: bool""" <|body_1|> def containsCycleTLE(self, grid): """:type grid: List[Li...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def containsCycle(self, grid): """:type grid: List[List[str]] :rtype: bool""" m, n = (len(grid), len(grid[0])) dirs = [(-1, 0), (1, 0), (0, -1), (0, 1)] def dfs(cur, pre, visited, mark): visited[cur[0]][cur[1]] = True for dx, dy in dirs: ...
the_stack_v2_python_sparse
D/DetectCyclesin2DGrid.py
bssrdf/pyleet
train
2
706e065d5a7f1fe0b5b92beff9432613340340a9
[ "data = []\ndata.append(scheduler_id)\nres = requests.post(url=enable_scheduler_url, headers=get_headers(HOST_189), data=json.dumps(data))\nself.assertEqual(res.status_code, 204, msg='启用计划接口调用失败')", "data = []\ndata.append(scheduler_id)\nres = requests.post(url=disable_scheduler_url, headers=get_headers(HOST_189)...
<|body_start_0|> data = [] data.append(scheduler_id) res = requests.post(url=enable_scheduler_url, headers=get_headers(HOST_189), data=json.dumps(data)) self.assertEqual(res.status_code, 204, msg='启用计划接口调用失败') <|end_body_0|> <|body_start_1|> data = [] data.append(schedul...
测试启用停用、批量删除schedulers接口
EnableDisable
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EnableDisable: """测试启用停用、批量删除schedulers接口""" def test_case01(self): """启用计划""" <|body_0|> def test_case02(self): """停用计划""" <|body_1|> def test_case03(self): """批量删除计划""" <|body_2|> <|end_skeleton|> <|body_start_0|> data = [...
stack_v2_sparse_classes_10k_train_008045
15,511
no_license
[ { "docstring": "启用计划", "name": "test_case01", "signature": "def test_case01(self)" }, { "docstring": "停用计划", "name": "test_case02", "signature": "def test_case02(self)" }, { "docstring": "批量删除计划", "name": "test_case03", "signature": "def test_case03(self)" } ]
3
stack_v2_sparse_classes_30k_train_004650
Implement the Python class `EnableDisable` described below. Class description: 测试启用停用、批量删除schedulers接口 Method signatures and docstrings: - def test_case01(self): 启用计划 - def test_case02(self): 停用计划 - def test_case03(self): 批量删除计划
Implement the Python class `EnableDisable` described below. Class description: 测试启用停用、批量删除schedulers接口 Method signatures and docstrings: - def test_case01(self): 启用计划 - def test_case02(self): 停用计划 - def test_case03(self): 批量删除计划 <|skeleton|> class EnableDisable: """测试启用停用、批量删除schedulers接口""" def test_case01...
fc41513af3063169ff1b17d6f01f7074057ceb1f
<|skeleton|> class EnableDisable: """测试启用停用、批量删除schedulers接口""" def test_case01(self): """启用计划""" <|body_0|> def test_case02(self): """停用计划""" <|body_1|> def test_case03(self): """批量删除计划""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class EnableDisable: """测试启用停用、批量删除schedulers接口""" def test_case01(self): """启用计划""" data = [] data.append(scheduler_id) res = requests.post(url=enable_scheduler_url, headers=get_headers(HOST_189), data=json.dumps(data)) self.assertEqual(res.status_code, 204, msg='启用计划接口...
the_stack_v2_python_sparse
singl_api/api_test_cases/cases_for_schedulers_api.py
bingjiegu/For_API
train
0
6de0436abd47ba94fac9bb05fdbe77550bf7c91f
[ "self.action: Action = kwargs.pop('action', None)\nself.column_name: str = kwargs.pop('column_name', None)\nself.exclude_init: List[str] = kwargs.pop('exclude_values', list)\nsuper().__init__(form_data, *args, **kwargs)\nself.set_field_from_dict('exclude_values')\nself.fields['exclude_values'].choices = get_rows(se...
<|body_start_0|> self.action: Action = kwargs.pop('action', None) self.column_name: str = kwargs.pop('column_name', None) self.exclude_init: List[str] = kwargs.pop('exclude_values', list) super().__init__(form_data, *args, **kwargs) self.set_field_from_dict('exclude_values') ...
Form to select a few fields to exclude.
ValueExcludeForm
[ "MIT", "LGPL-2.0-or-later", "Python-2.0", "BSD-3-Clause", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ValueExcludeForm: """Form to select a few fields to exclude.""" def __init__(self, form_data, *args, **kwargs): """Store action, column name and exclude init, adjust fields.""" <|body_0|> def clean(self): """Store the values in the field in the dictionary.""" ...
stack_v2_sparse_classes_10k_train_008046
20,237
permissive
[ { "docstring": "Store action, column name and exclude init, adjust fields.", "name": "__init__", "signature": "def __init__(self, form_data, *args, **kwargs)" }, { "docstring": "Store the values in the field in the dictionary.", "name": "clean", "signature": "def clean(self)" } ]
2
stack_v2_sparse_classes_30k_val_000388
Implement the Python class `ValueExcludeForm` described below. Class description: Form to select a few fields to exclude. Method signatures and docstrings: - def __init__(self, form_data, *args, **kwargs): Store action, column name and exclude init, adjust fields. - def clean(self): Store the values in the field in t...
Implement the Python class `ValueExcludeForm` described below. Class description: Form to select a few fields to exclude. Method signatures and docstrings: - def __init__(self, form_data, *args, **kwargs): Store action, column name and exclude init, adjust fields. - def clean(self): Store the values in the field in t...
5473e9faa24c71a2a1102d47ebc2cbf27608e42a
<|skeleton|> class ValueExcludeForm: """Form to select a few fields to exclude.""" def __init__(self, form_data, *args, **kwargs): """Store action, column name and exclude init, adjust fields.""" <|body_0|> def clean(self): """Store the values in the field in the dictionary.""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ValueExcludeForm: """Form to select a few fields to exclude.""" def __init__(self, form_data, *args, **kwargs): """Store action, column name and exclude init, adjust fields.""" self.action: Action = kwargs.pop('action', None) self.column_name: str = kwargs.pop('column_name', None)...
the_stack_v2_python_sparse
ontask/action/forms/run.py
LucasFranciscoCorreia/ontask_b
train
0
76f8c05b4d88a698dd9f078ca275b3866ebba2b8
[ "Parametre.__init__(self, 'emote', 'emote')\nself.schema = '<nom_familier> <message>'\nself.aide_courte = 'fait agir votre familier'\nself.aide_longue = \"Cette commande est identique à la commande %emote% mais pour votre familier : elle vous permet de donner un ordre, comme si le familier faisait un %emote%. Les m...
<|body_start_0|> Parametre.__init__(self, 'emote', 'emote') self.schema = '<nom_familier> <message>' self.aide_courte = 'fait agir votre familier' self.aide_longue = "Cette commande est identique à la commande %emote% mais pour votre familier : elle vous permet de donner un ordre, comme ...
Commande 'familier emote'.
PrmEmote
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PrmEmote: """Commande 'familier emote'.""" def __init__(self): """Constructeur du paramètre""" <|body_0|> def interpreter(self, personnage, dic_masques): """Interprétation du paramètre""" <|body_1|> <|end_skeleton|> <|body_start_0|> Parametre.__...
stack_v2_sparse_classes_10k_train_008047
3,084
permissive
[ { "docstring": "Constructeur du paramètre", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Interprétation du paramètre", "name": "interpreter", "signature": "def interpreter(self, personnage, dic_masques)" } ]
2
null
Implement the Python class `PrmEmote` described below. Class description: Commande 'familier emote'. Method signatures and docstrings: - def __init__(self): Constructeur du paramètre - def interpreter(self, personnage, dic_masques): Interprétation du paramètre
Implement the Python class `PrmEmote` described below. Class description: Commande 'familier emote'. Method signatures and docstrings: - def __init__(self): Constructeur du paramètre - def interpreter(self, personnage, dic_masques): Interprétation du paramètre <|skeleton|> class PrmEmote: """Commande 'familier e...
7e93bff08cdf891352efba587e89c40f3b4a2301
<|skeleton|> class PrmEmote: """Commande 'familier emote'.""" def __init__(self): """Constructeur du paramètre""" <|body_0|> def interpreter(self, personnage, dic_masques): """Interprétation du paramètre""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PrmEmote: """Commande 'familier emote'.""" def __init__(self): """Constructeur du paramètre""" Parametre.__init__(self, 'emote', 'emote') self.schema = '<nom_familier> <message>' self.aide_courte = 'fait agir votre familier' self.aide_longue = "Cette commande est i...
the_stack_v2_python_sparse
src/secondaires/familier/commandes/familier/emote.py
vincent-lg/tsunami
train
5
ba27ba73c8af398383de5b82b993ee9c2890c3cc
[ "for k, v in params.items():\n if v == str(None):\n params[k] = None\nnetworks = cxmate.Adapter.to_networkx(input_stream)\nnodedata_tmp = []\nnet = networks[0]\nnet.graph['label'] = OUTPUT_LABEL\nif params['prog'] == 'twopi' and 'root' in net.graph.keys():\n params['root'] = net.graph['root']\nfor n, n...
<|body_start_0|> for k, v in params.items(): if v == str(None): params[k] = None networks = cxmate.Adapter.to_networkx(input_stream) nodedata_tmp = [] net = networks[0] net.graph['label'] = OUTPUT_LABEL if params['prog'] == 'twopi' and 'root' i...
NxLayoutService
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NxLayoutService: def process(self, params, input_stream): """CI service for creating node positions for the given network data using Graphviz.""" <|body_0|> def outputStream(self, networks, pos): """Creates a CX element generator added cartesianCoordinate from a list...
stack_v2_sparse_classes_10k_train_008048
2,430
permissive
[ { "docstring": "CI service for creating node positions for the given network data using Graphviz.", "name": "process", "signature": "def process(self, params, input_stream)" }, { "docstring": "Creates a CX element generator added cartesianCoordinate from a list of networkx objects. :params netwo...
2
stack_v2_sparse_classes_30k_train_005738
Implement the Python class `NxLayoutService` described below. Class description: Implement the NxLayoutService class. Method signatures and docstrings: - def process(self, params, input_stream): CI service for creating node positions for the given network data using Graphviz. - def outputStream(self, networks, pos): ...
Implement the Python class `NxLayoutService` described below. Class description: Implement the NxLayoutService class. Method signatures and docstrings: - def process(self, params, input_stream): CI service for creating node positions for the given network data using Graphviz. - def outputStream(self, networks, pos): ...
97c0237381528ac72f76c600071573fd1cbcdce6
<|skeleton|> class NxLayoutService: def process(self, params, input_stream): """CI service for creating node positions for the given network data using Graphviz.""" <|body_0|> def outputStream(self, networks, pos): """Creates a CX element generator added cartesianCoordinate from a list...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class NxLayoutService: def process(self, params, input_stream): """CI service for creating node positions for the given network data using Graphviz.""" for k, v in params.items(): if v == str(None): params[k] = None networks = cxmate.Adapter.to_networkx(input_stre...
the_stack_v2_python_sparse
services/nx_layout/service/service.py
idekerlab/graph-services
train
0
c3e0ec8e769fac78c27f034ae5662ddd58b220d0
[ "super().__init__(parent, store)\nself.frame1_label = tk.Label(self.frame1, text='Login with password', font=('Arial', 20, 'bold'))\nself.password_label = tk.Label(self.frame1, text='Password: ')\nself.password_field = tk.StringVar()\nself.password_entry = tk.Entry(self.frame1, textvariable=self.password_field, sho...
<|body_start_0|> super().__init__(parent, store) self.frame1_label = tk.Label(self.frame1, text='Login with password', font=('Arial', 20, 'bold')) self.password_label = tk.Label(self.frame1, text='Password: ') self.password_field = tk.StringVar() self.password_entry = tk.Entry(se...
The second screen when the app opens. It has 2 frame, the left frame is for login normally, and the right frame is for login with face. User can click on the open cam button to use this feature. Attributes: ---------- frame1 : tkinter frame The container for the left page frame2 : tkinter frame The container for the ri...
Screen2
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Screen2: """The second screen when the app opens. It has 2 frame, the left frame is for login normally, and the right frame is for login with face. User can click on the open cam button to use this feature. Attributes: ---------- frame1 : tkinter frame The container for the left page frame2 : tki...
stack_v2_sparse_classes_10k_train_008049
8,263
permissive
[ { "docstring": "Init the screen 2 with 2 frame on. The first frame is for login with password and the second frame is for login with face. This only load the recognizer and pca if the user has the face added and the device has camera. Params: ------- parent: tkinter frame or tk() The parent frame attach to this...
4
stack_v2_sparse_classes_30k_train_005762
Implement the Python class `Screen2` described below. Class description: The second screen when the app opens. It has 2 frame, the left frame is for login normally, and the right frame is for login with face. User can click on the open cam button to use this feature. Attributes: ---------- frame1 : tkinter frame The c...
Implement the Python class `Screen2` described below. Class description: The second screen when the app opens. It has 2 frame, the left frame is for login normally, and the right frame is for login with face. User can click on the open cam button to use this feature. Attributes: ---------- frame1 : tkinter frame The c...
e4478a6ca8ca15ab99fc251b40e64307302bffeb
<|skeleton|> class Screen2: """The second screen when the app opens. It has 2 frame, the left frame is for login normally, and the right frame is for login with face. User can click on the open cam button to use this feature. Attributes: ---------- frame1 : tkinter frame The container for the left page frame2 : tki...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Screen2: """The second screen when the app opens. It has 2 frame, the left frame is for login normally, and the right frame is for login with face. User can click on the open cam button to use this feature. Attributes: ---------- frame1 : tkinter frame The container for the left page frame2 : tkinter frame Th...
the_stack_v2_python_sparse
screen2.py
athan37/LoginSystemWithFace
train
1
6686b9ffc6573f146a957b5eb063297d49c57622
[ "result = {'result': 'NG'}\ncontent = CtrlDSSection().get_usecase_by_doc_id(doc_id, 'USERCASE')\nif content:\n result = {'result': 'OK', 'content': content}\nreturn result", "result = {'result': 'NG', 'error': ''}\ndata_json = request.get_json()\nsec_obj = CtrlDSSection()\nflag, error = sec_obj.usecase_add(dat...
<|body_start_0|> result = {'result': 'NG'} content = CtrlDSSection().get_usecase_by_doc_id(doc_id, 'USERCASE') if content: result = {'result': 'OK', 'content': content} return result <|end_body_0|> <|body_start_1|> result = {'result': 'NG', 'error': ''} data_...
ApiDSDocUsecase
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ApiDSDocUsecase: def get(self, doc_id): """获取文档下所有usecase的说明 :param doc_id: :return:""" <|body_0|> def post(self): """保存和修改文档下usecase的说明 :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> result = {'result': 'NG'} content = CtrlDSSecti...
stack_v2_sparse_classes_10k_train_008050
31,026
no_license
[ { "docstring": "获取文档下所有usecase的说明 :param doc_id: :return:", "name": "get", "signature": "def get(self, doc_id)" }, { "docstring": "保存和修改文档下usecase的说明 :return:", "name": "post", "signature": "def post(self)" } ]
2
null
Implement the Python class `ApiDSDocUsecase` described below. Class description: Implement the ApiDSDocUsecase class. Method signatures and docstrings: - def get(self, doc_id): 获取文档下所有usecase的说明 :param doc_id: :return: - def post(self): 保存和修改文档下usecase的说明 :return:
Implement the Python class `ApiDSDocUsecase` described below. Class description: Implement the ApiDSDocUsecase class. Method signatures and docstrings: - def get(self, doc_id): 获取文档下所有usecase的说明 :param doc_id: :return: - def post(self): 保存和修改文档下usecase的说明 :return: <|skeleton|> class ApiDSDocUsecase: def get(sel...
64b31e7bdfcb8a4c95f0a8a607f0bcff576cec11
<|skeleton|> class ApiDSDocUsecase: def get(self, doc_id): """获取文档下所有usecase的说明 :param doc_id: :return:""" <|body_0|> def post(self): """保存和修改文档下usecase的说明 :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ApiDSDocUsecase: def get(self, doc_id): """获取文档下所有usecase的说明 :param doc_id: :return:""" result = {'result': 'NG'} content = CtrlDSSection().get_usecase_by_doc_id(doc_id, 'USERCASE') if content: result = {'result': 'OK', 'content': content} return result ...
the_stack_v2_python_sparse
Source/collaboration_2/app/api_1_0/api_ds_doc.py
lsn1183/web_project
train
0
efa8c265f300f619381be34ccb5b36ef6605feb4
[ "self.event_threshold = event_threshold\nself._label_indices = {name: i for i, name in enumerate(label_names)}\nself.perf_data = {}\nfor label in label_names:\n for bench_name, bench_iterations in benchmark_names_and_iterations:\n for i in xrange(bench_iterations):\n report = read_perf_report(l...
<|body_start_0|> self.event_threshold = event_threshold self._label_indices = {name: i for i, name in enumerate(label_names)} self.perf_data = {} for label in label_names: for bench_name, bench_iterations in benchmark_names_and_iterations: for i in xrange(benc...
Generates dicts from a perf table. Dicts look like: {'benchmark_name': {'perf_event_name': [LabelData]}} where LabelData is a list of perf dicts, each perf dict coming from the same label. Each perf dict looks like {'function_name': 0.10, ...} (where 0.10 is the percentage of time spent in function_name).
_PerfTable
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _PerfTable: """Generates dicts from a perf table. Dicts look like: {'benchmark_name': {'perf_event_name': [LabelData]}} where LabelData is a list of perf dicts, each perf dict coming from the same label. Each perf dict looks like {'function_name': 0.10, ...} (where 0.10 is the percentage of time ...
stack_v2_sparse_classes_10k_train_008051
25,882
permissive
[ { "docstring": "Constructor. read_perf_report is a function that takes a label name, benchmark name, and benchmark iteration, and returns a dictionary describing the perf output for that given run.", "name": "__init__", "signature": "def __init__(self, benchmark_names_and_iterations, label_names, read_p...
2
null
Implement the Python class `_PerfTable` described below. Class description: Generates dicts from a perf table. Dicts look like: {'benchmark_name': {'perf_event_name': [LabelData]}} where LabelData is a list of perf dicts, each perf dict coming from the same label. Each perf dict looks like {'function_name': 0.10, ...}...
Implement the Python class `_PerfTable` described below. Class description: Generates dicts from a perf table. Dicts look like: {'benchmark_name': {'perf_event_name': [LabelData]}} where LabelData is a list of perf dicts, each perf dict coming from the same label. Each perf dict looks like {'function_name': 0.10, ...}...
e2745b756317aac3c7a27a4c10bdfe0921a82a1c
<|skeleton|> class _PerfTable: """Generates dicts from a perf table. Dicts look like: {'benchmark_name': {'perf_event_name': [LabelData]}} where LabelData is a list of perf dicts, each perf dict coming from the same label. Each perf dict looks like {'function_name': 0.10, ...} (where 0.10 is the percentage of time ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class _PerfTable: """Generates dicts from a perf table. Dicts look like: {'benchmark_name': {'perf_event_name': [LabelData]}} where LabelData is a list of perf dicts, each perf dict coming from the same label. Each perf dict looks like {'function_name': 0.10, ...} (where 0.10 is the percentage of time spent in func...
the_stack_v2_python_sparse
app/src/main/java/com/syd/source/aosp/external/toolchain-utils/crosperf/results_report.py
lz-purple/Source
train
4
b194fd6ef5edaca01839b82883d5fd101d0e7493
[ "self.cache = {}\nself.order = []\nself.capacity = capacity", "if key in self.cache:\n if key != self.order[-1]:\n self.order.remove(key)\n self.order.append(key)\n return self.cache[key]\nelse:\n return -1", "if key in self.cache:\n self.cache[key] = value\n if key != self.order[-1...
<|body_start_0|> self.cache = {} self.order = [] self.capacity = capacity <|end_body_0|> <|body_start_1|> if key in self.cache: if key != self.order[-1]: self.order.remove(key) self.order.append(key) return self.cache[key] ...
LRUCache
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: void""" <|body_2|> <|end_s...
stack_v2_sparse_classes_10k_train_008052
2,489
no_license
[ { "docstring": ":type capacity: int", "name": "__init__", "signature": "def __init__(self, capacity)" }, { "docstring": ":type key: int :rtype: int", "name": "get", "signature": "def get(self, key)" }, { "docstring": ":type key: int :type value: int :rtype: void", "name": "pu...
3
null
Implement the Python class `LRUCache` described below. Class description: Implement the LRUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: void
Implement the Python class `LRUCache` described below. Class description: Implement the LRUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: void <|sk...
7a459e9742958e63be8886874904e5ab2489411a
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: void""" <|body_2|> <|end_s...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LRUCache: def __init__(self, capacity): """:type capacity: int""" self.cache = {} self.order = [] self.capacity = capacity def get(self, key): """:type key: int :rtype: int""" if key in self.cache: if key != self.order[-1]: self....
the_stack_v2_python_sparse
Hard/146.py
Hellofafar/Leetcode
train
6
89f507bc0e205ae3fc33ab4b8d80c3be9424c360
[ "super(MidasNet_ASPP, self).__init__()\nuse_pretrained = False if path else True\nself.pretrained, self.scratch = _make_encoder('resnext101_wsl_aspp', features, use_pretrained)\nself.scratch.refinenet4 = FeatureFusionBlock(features)\nself.scratch.refinenet3 = FeatureFusionBlock(features)\nself.scratch.refinenet2 = ...
<|body_start_0|> super(MidasNet_ASPP, self).__init__() use_pretrained = False if path else True self.pretrained, self.scratch = _make_encoder('resnext101_wsl_aspp', features, use_pretrained) self.scratch.refinenet4 = FeatureFusionBlock(features) self.scratch.refinenet3 = FeatureF...
Network for monocular depth estimation.
MidasNet_ASPP
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MidasNet_ASPP: """Network for monocular depth estimation.""" def __init__(self, path=None, features=256): """Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features. Defaults to 256. backbone (str, optional): Backbone netw...
stack_v2_sparse_classes_10k_train_008053
13,019
permissive
[ { "docstring": "Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features. Defaults to 256. backbone (str, optional): Backbone network for encoder. Defaults to resnet50", "name": "__init__", "signature": "def __init__(self, path=None, features=...
2
null
Implement the Python class `MidasNet_ASPP` described below. Class description: Network for monocular depth estimation. Method signatures and docstrings: - def __init__(self, path=None, features=256): Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features....
Implement the Python class `MidasNet_ASPP` described below. Class description: Network for monocular depth estimation. Method signatures and docstrings: - def __init__(self, path=None, features=256): Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features....
a00c3619bf4042e446e1919087f0b09fe9fa3a65
<|skeleton|> class MidasNet_ASPP: """Network for monocular depth estimation.""" def __init__(self, path=None, features=256): """Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features. Defaults to 256. backbone (str, optional): Backbone netw...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MidasNet_ASPP: """Network for monocular depth estimation.""" def __init__(self, path=None, features=256): """Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features. Defaults to 256. backbone (str, optional): Backbone network for encod...
the_stack_v2_python_sparse
nasws/cnn/search_space/monodepth/models/midas_net.py
kcyu2014/nas-landmarkreg
train
10
caf54cd1807dcacbf822584c08e45d9933187b6e
[ "if n == 1:\n return 1\nfirst, second = (1, 2)\nfor i in range(3, n + 1):\n third = first + second\n first = second\n second = third\nreturn second", "cache = {0: 1, 1: 1}\nfor i in range(2, n + 1):\n cache[i] = cache[i - 1] + cache[i - 2]\nreturn cache[n]", "if n in self.cache:\n return self....
<|body_start_0|> if n == 1: return 1 first, second = (1, 2) for i in range(3, n + 1): third = first + second first = second second = third return second <|end_body_0|> <|body_start_1|> cache = {0: 1, 1: 1} for i in range(2,...
ClimbingStairs
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClimbingStairs: def total_ways(self, n: int) -> int: """Approach: Fibonacci Number Time Complexity: O(N) Space Complexity: O(1) :param n: :param int: :return:""" <|body_0|> def total_ways_(self, n: int) -> int: """Approach: DP Time Complexity: O(N) Space Complexity: ...
stack_v2_sparse_classes_10k_train_008054
1,757
no_license
[ { "docstring": "Approach: Fibonacci Number Time Complexity: O(N) Space Complexity: O(1) :param n: :param int: :return:", "name": "total_ways", "signature": "def total_ways(self, n: int) -> int" }, { "docstring": "Approach: DP Time Complexity: O(N) Space Complexity: O(N) :param n: :return:", ...
4
null
Implement the Python class `ClimbingStairs` described below. Class description: Implement the ClimbingStairs class. Method signatures and docstrings: - def total_ways(self, n: int) -> int: Approach: Fibonacci Number Time Complexity: O(N) Space Complexity: O(1) :param n: :param int: :return: - def total_ways_(self, n:...
Implement the Python class `ClimbingStairs` described below. Class description: Implement the ClimbingStairs class. Method signatures and docstrings: - def total_ways(self, n: int) -> int: Approach: Fibonacci Number Time Complexity: O(N) Space Complexity: O(1) :param n: :param int: :return: - def total_ways_(self, n:...
65cc78b5afa0db064f9fe8f06597e3e120f7363d
<|skeleton|> class ClimbingStairs: def total_ways(self, n: int) -> int: """Approach: Fibonacci Number Time Complexity: O(N) Space Complexity: O(1) :param n: :param int: :return:""" <|body_0|> def total_ways_(self, n: int) -> int: """Approach: DP Time Complexity: O(N) Space Complexity: ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ClimbingStairs: def total_ways(self, n: int) -> int: """Approach: Fibonacci Number Time Complexity: O(N) Space Complexity: O(1) :param n: :param int: :return:""" if n == 1: return 1 first, second = (1, 2) for i in range(3, n + 1): third = first + second ...
the_stack_v2_python_sparse
revisited_2021/dp/climbing_stairs.py
Shiv2157k/leet_code
train
1
2f2dfb0b8031d58b5d6d87465367928fd01a259d
[ "try:\n value = get_user_preference(request.user, preference_key, username=username)\n if value is None:\n return Response(status=status.HTTP_404_NOT_FOUND)\nexcept UserNotAuthorized:\n return Response(status=status.HTTP_403_FORBIDDEN)\nexcept UserNotFound:\n return Response(status=status.HTTP_40...
<|body_start_0|> try: value = get_user_preference(request.user, preference_key, username=username) if value is None: return Response(status=status.HTTP_404_NOT_FOUND) except UserNotAuthorized: return Response(status=status.HTTP_403_FORBIDDEN) e...
**Use Cases** Get, create, update, or delete a specific user preference. **Example Requests** GET /api/user/v1/preferences/{username}/{preference_key} PUT /api/user/v1/preferences/{username}/{preference_key} DELETE /api/user/v1/preferences/{username}/{preference_key} **Response Values for GET** If the specified usernam...
PreferencesDetailView
[ "AGPL-3.0-only", "AGPL-3.0-or-later", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PreferencesDetailView: """**Use Cases** Get, create, update, or delete a specific user preference. **Example Requests** GET /api/user/v1/preferences/{username}/{preference_key} PUT /api/user/v1/preferences/{username}/{preference_key} DELETE /api/user/v1/preferences/{username}/{preference_key} **R...
stack_v2_sparse_classes_10k_train_008055
11,020
permissive
[ { "docstring": "GET /api/user/v1/preferences/{username}/{preference_key}", "name": "get", "signature": "def get(self, request, username, preference_key)" }, { "docstring": "PUT /api/user/v1/preferences/{username}/{preference_key}", "name": "put", "signature": "def put(self, request, user...
3
null
Implement the Python class `PreferencesDetailView` described below. Class description: **Use Cases** Get, create, update, or delete a specific user preference. **Example Requests** GET /api/user/v1/preferences/{username}/{preference_key} PUT /api/user/v1/preferences/{username}/{preference_key} DELETE /api/user/v1/pref...
Implement the Python class `PreferencesDetailView` described below. Class description: **Use Cases** Get, create, update, or delete a specific user preference. **Example Requests** GET /api/user/v1/preferences/{username}/{preference_key} PUT /api/user/v1/preferences/{username}/{preference_key} DELETE /api/user/v1/pref...
5809eaca7079a15ee56b0b7fcfea425337046c97
<|skeleton|> class PreferencesDetailView: """**Use Cases** Get, create, update, or delete a specific user preference. **Example Requests** GET /api/user/v1/preferences/{username}/{preference_key} PUT /api/user/v1/preferences/{username}/{preference_key} DELETE /api/user/v1/preferences/{username}/{preference_key} **R...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PreferencesDetailView: """**Use Cases** Get, create, update, or delete a specific user preference. **Example Requests** GET /api/user/v1/preferences/{username}/{preference_key} PUT /api/user/v1/preferences/{username}/{preference_key} DELETE /api/user/v1/preferences/{username}/{preference_key} **Response Value...
the_stack_v2_python_sparse
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/user_api/preferences/views.py
luque/better-ways-of-thinking-about-software
train
3
df1d3f4f4ff2800213a045e5c8f45224dfbb726f
[ "key = cls.des_key\nlength = len(reqdata)\nif length < cls.block_size:\n add = cls.block_size - length\nelif length > cls.block_size:\n add = cls.block_size - length % cls.block_size\nelse:\n add = 8\nreqdata = reqdata + cls.pad_str[add - 1] * add\ndes = DES.new(key, DES.MODE_ECB)\nencrypt_data = des.encry...
<|body_start_0|> key = cls.des_key length = len(reqdata) if length < cls.block_size: add = cls.block_size - length elif length > cls.block_size: add = cls.block_size - length % cls.block_size else: add = 8 reqdata = reqdata + cls.pad_st...
加密和解密工具类
Crypt
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Crypt: """加密和解密工具类""" def des_base64_encrypt(cls, reqdata): """基于DES和base64的加密算法 @:param reqdata 需要加密的请求数据""" <|body_0|> def des_base64_decrypt(cls, retdata): """DES解密 @:param retdata: lakala reponse retData""" <|body_1|> <|end_skeleton|> <|body_start_0...
stack_v2_sparse_classes_10k_train_008056
1,265
no_license
[ { "docstring": "基于DES和base64的加密算法 @:param reqdata 需要加密的请求数据", "name": "des_base64_encrypt", "signature": "def des_base64_encrypt(cls, reqdata)" }, { "docstring": "DES解密 @:param retdata: lakala reponse retData", "name": "des_base64_decrypt", "signature": "def des_base64_decrypt(cls, retda...
2
stack_v2_sparse_classes_30k_train_006604
Implement the Python class `Crypt` described below. Class description: 加密和解密工具类 Method signatures and docstrings: - def des_base64_encrypt(cls, reqdata): 基于DES和base64的加密算法 @:param reqdata 需要加密的请求数据 - def des_base64_decrypt(cls, retdata): DES解密 @:param retdata: lakala reponse retData
Implement the Python class `Crypt` described below. Class description: 加密和解密工具类 Method signatures and docstrings: - def des_base64_encrypt(cls, reqdata): 基于DES和base64的加密算法 @:param reqdata 需要加密的请求数据 - def des_base64_decrypt(cls, retdata): DES解密 @:param retdata: lakala reponse retData <|skeleton|> class Crypt: """...
92358511e1de06d8bf93888128576c32f226a26b
<|skeleton|> class Crypt: """加密和解密工具类""" def des_base64_encrypt(cls, reqdata): """基于DES和base64的加密算法 @:param reqdata 需要加密的请求数据""" <|body_0|> def des_base64_decrypt(cls, retdata): """DES解密 @:param retdata: lakala reponse retData""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Crypt: """加密和解密工具类""" def des_base64_encrypt(cls, reqdata): """基于DES和base64的加密算法 @:param reqdata 需要加密的请求数据""" key = cls.des_key length = len(reqdata) if length < cls.block_size: add = cls.block_size - length elif length > cls.block_size: add...
the_stack_v2_python_sparse
加密隐藏/DES/des_ecb.py
KnowNo/CTF-LEARN
train
0
8f8df6a5d0f59e6f22f400809bd4bf2087368e4a
[ "self.image_list = image_list\nself.base_num = base_num\nself.pxpys = pxpys\nself.bss = bss\nself.scale = scale\nself.shift = shift\nself.method = method\nself.fit = Fitting(fit_method=fit_method, shift=self.shift, fit_range=self.scale).fit()\nself.one_point_calculation = self.with_eec if eec else self.without_eec\...
<|body_start_0|> self.image_list = image_list self.base_num = base_num self.pxpys = pxpys self.bss = bss self.scale = scale self.shift = shift self.method = method self.fit = Fitting(fit_method=fit_method, shift=self.shift, fit_range=self.scale).fit() ...
変位計測用クラス
Displacement
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Displacement: """変位計測用クラス""" def __init__(self, image_list, base_num, pxpys, bss, scale, shift, fit_method='para', eec=True, method='abs'): """:param image_list: 画像のファイルパスリスト :param base_num: 基準フレームの番号 :param pxpys: 計測点の座標 :param bss: ブロックサイズ :param scale: 画像拡大率 :param shift: 探索範囲 :p...
stack_v2_sparse_classes_10k_train_008057
16,682
no_license
[ { "docstring": ":param image_list: 画像のファイルパスリスト :param base_num: 基準フレームの番号 :param pxpys: 計測点の座標 :param bss: ブロックサイズ :param scale: 画像拡大率 :param shift: 探索範囲 :param fit_method: フィッティング手法 :param eec: Estimate Error Cancellation :param method: 基準フレームからの絶対変位 or 前後フレームでの相対変位", "name": "__init__", "signature": ...
6
stack_v2_sparse_classes_30k_train_002605
Implement the Python class `Displacement` described below. Class description: 変位計測用クラス Method signatures and docstrings: - def __init__(self, image_list, base_num, pxpys, bss, scale, shift, fit_method='para', eec=True, method='abs'): :param image_list: 画像のファイルパスリスト :param base_num: 基準フレームの番号 :param pxpys: 計測点の座標 :par...
Implement the Python class `Displacement` described below. Class description: 変位計測用クラス Method signatures and docstrings: - def __init__(self, image_list, base_num, pxpys, bss, scale, shift, fit_method='para', eec=True, method='abs'): :param image_list: 画像のファイルパスリスト :param base_num: 基準フレームの番号 :param pxpys: 計測点の座標 :par...
dd0b0f1310c7a3eb5a5a589bb86d24486cbb37b1
<|skeleton|> class Displacement: """変位計測用クラス""" def __init__(self, image_list, base_num, pxpys, bss, scale, shift, fit_method='para', eec=True, method='abs'): """:param image_list: 画像のファイルパスリスト :param base_num: 基準フレームの番号 :param pxpys: 計測点の座標 :param bss: ブロックサイズ :param scale: 画像拡大率 :param shift: 探索範囲 :p...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Displacement: """変位計測用クラス""" def __init__(self, image_list, base_num, pxpys, bss, scale, shift, fit_method='para', eec=True, method='abs'): """:param image_list: 画像のファイルパスリスト :param base_num: 基準フレームの番号 :param pxpys: 計測点の座標 :param bss: ブロックサイズ :param scale: 画像拡大率 :param shift: 探索範囲 :param fit_meth...
the_stack_v2_python_sparse
my_utils/displacement/displacement.py
salem7mg/test4
train
0
503c72178d8d2931ae0e3700e7ee3a0b5478a821
[ "result = {'result': 'NG'}\ndata = request.get_json(force=True)\nif data:\n succsee, message = CtrlQuotations().add_quotation(data)\n if succsee:\n result = {'result': 'OK', 'content': message}\n else:\n result['error'] = message\nelse:\n result['error'] = '请不要传空数据'\nreturn result", "res...
<|body_start_0|> result = {'result': 'NG'} data = request.get_json(force=True) if data: succsee, message = CtrlQuotations().add_quotation(data) if succsee: result = {'result': 'OK', 'content': message} else: result['error'] = me...
ApiQuotationInfo
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ApiQuotationInfo: def post(self): """发起报价 :return:""" <|body_0|> def get(self, pro_id): """获取所有base版本 :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> result = {'result': 'NG'} data = request.get_json(force=True) if data: ...
stack_v2_sparse_classes_10k_train_008058
10,406
no_license
[ { "docstring": "发起报价 :return:", "name": "post", "signature": "def post(self)" }, { "docstring": "获取所有base版本 :return:", "name": "get", "signature": "def get(self, pro_id)" } ]
2
null
Implement the Python class `ApiQuotationInfo` described below. Class description: Implement the ApiQuotationInfo class. Method signatures and docstrings: - def post(self): 发起报价 :return: - def get(self, pro_id): 获取所有base版本 :return:
Implement the Python class `ApiQuotationInfo` described below. Class description: Implement the ApiQuotationInfo class. Method signatures and docstrings: - def post(self): 发起报价 :return: - def get(self, pro_id): 获取所有base版本 :return: <|skeleton|> class ApiQuotationInfo: def post(self): """发起报价 :return:""" ...
64b31e7bdfcb8a4c95f0a8a607f0bcff576cec11
<|skeleton|> class ApiQuotationInfo: def post(self): """发起报价 :return:""" <|body_0|> def get(self, pro_id): """获取所有base版本 :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ApiQuotationInfo: def post(self): """发起报价 :return:""" result = {'result': 'NG'} data = request.get_json(force=True) if data: succsee, message = CtrlQuotations().add_quotation(data) if succsee: result = {'result': 'OK', 'content': message}...
the_stack_v2_python_sparse
koala/koala_server/app/api_1_0/api_quotations.py
lsn1183/web_project
train
0
cd35bc9d28049344fd3cfaaf3b6885ad02ac5583
[ "profile.addListsToCraftTypeRepository('skeinforge_tools.craft_plugins.feed.html', self)\nself.fileNameInput = settings.FileNameInput().getFromFileName(interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Feed', self, '')\nself.activateFeed = settings.BooleanSetting().getFromValue('Activate Feed:', self,...
<|body_start_0|> profile.addListsToCraftTypeRepository('skeinforge_tools.craft_plugins.feed.html', self) self.fileNameInput = settings.FileNameInput().getFromFileName(interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Feed', self, '') self.activateFeed = settings.BooleanSetting().ge...
A class to handle the feed settings.
FeedRepository
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FeedRepository: """A class to handle the feed settings.""" def __init__(self): """Set the default settings, execute title & settings fileName.""" <|body_0|> def execute(self): """Feed button has been clicked.""" <|body_1|> <|end_skeleton|> <|body_start_...
stack_v2_sparse_classes_10k_train_008059
8,389
no_license
[ { "docstring": "Set the default settings, execute title & settings fileName.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Feed button has been clicked.", "name": "execute", "signature": "def execute(self)" } ]
2
stack_v2_sparse_classes_30k_train_001937
Implement the Python class `FeedRepository` described below. Class description: A class to handle the feed settings. Method signatures and docstrings: - def __init__(self): Set the default settings, execute title & settings fileName. - def execute(self): Feed button has been clicked.
Implement the Python class `FeedRepository` described below. Class description: A class to handle the feed settings. Method signatures and docstrings: - def __init__(self): Set the default settings, execute title & settings fileName. - def execute(self): Feed button has been clicked. <|skeleton|> class FeedRepositor...
fd69d8e856780c826386dc973ceabcc03623f3e8
<|skeleton|> class FeedRepository: """A class to handle the feed settings.""" def __init__(self): """Set the default settings, execute title & settings fileName.""" <|body_0|> def execute(self): """Feed button has been clicked.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class FeedRepository: """A class to handle the feed settings.""" def __init__(self): """Set the default settings, execute title & settings fileName.""" profile.addListsToCraftTypeRepository('skeinforge_tools.craft_plugins.feed.html', self) self.fileNameInput = settings.FileNameInput().g...
the_stack_v2_python_sparse
skeinforge_tools/craft_plugins/feed.py
bmander/skeinforge
train
34
33dba0c9cc5193a336cd06e95c3352ab78557a52
[ "for i in range(len(nums)):\n for j in range(i + 1, i + k + 1):\n if j >= len(nums):\n break\n if abs(nums[i] - nums[j]) <= t:\n return True\nreturn False", "if t < 0:\n return False\nbucket = {}\nw = t + 1\nfor i in range(len(nums)):\n m = nums[i] // w\n if m in bu...
<|body_start_0|> for i in range(len(nums)): for j in range(i + 1, i + k + 1): if j >= len(nums): break if abs(nums[i] - nums[j]) <= t: return True return False <|end_body_0|> <|body_start_1|> if t < 0: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def containsNearbyAlmostDuplicate(self, nums, k, t): """brute force :type nums: List[int] :type k: int :type t: int :rtype: bool""" <|body_0|> def containsNearbyAlmostDuplicate2(self, nums, k, t): """bucket :type nums: List[int] :type k: int :type t: int :r...
stack_v2_sparse_classes_10k_train_008060
1,195
no_license
[ { "docstring": "brute force :type nums: List[int] :type k: int :type t: int :rtype: bool", "name": "containsNearbyAlmostDuplicate", "signature": "def containsNearbyAlmostDuplicate(self, nums, k, t)" }, { "docstring": "bucket :type nums: List[int] :type k: int :type t: int :rtype: bool", "nam...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsNearbyAlmostDuplicate(self, nums, k, t): brute force :type nums: List[int] :type k: int :type t: int :rtype: bool - def containsNearbyAlmostDuplicate2(self, nums, k, ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsNearbyAlmostDuplicate(self, nums, k, t): brute force :type nums: List[int] :type k: int :type t: int :rtype: bool - def containsNearbyAlmostDuplicate2(self, nums, k, ...
e16702d2b3ec4e5054baad56f4320bc3b31676ad
<|skeleton|> class Solution: def containsNearbyAlmostDuplicate(self, nums, k, t): """brute force :type nums: List[int] :type k: int :type t: int :rtype: bool""" <|body_0|> def containsNearbyAlmostDuplicate2(self, nums, k, t): """bucket :type nums: List[int] :type k: int :type t: int :r...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def containsNearbyAlmostDuplicate(self, nums, k, t): """brute force :type nums: List[int] :type k: int :type t: int :rtype: bool""" for i in range(len(nums)): for j in range(i + 1, i + k + 1): if j >= len(nums): break if...
the_stack_v2_python_sparse
leetcode/hard/contains_duplicate3.py
SuperMartinYang/learning_algorithm
train
0
fe26f067060659ce6fe991b23286025bff38467f
[ "self._embeddings_index = {}\nself.embedding_dimension = embedding_dimension\nself.embedding_matrix = np.zeros((len(word_idx) + 1, self.embedding_dimension))\nself.__read_vectors__()\nself.__populate_embedding__(word_idx)", "path = get_file(self.__GLOVE_FILE__, origin=self.__URL__, cache_subdir=self.__EMBEDDING_C...
<|body_start_0|> self._embeddings_index = {} self.embedding_dimension = embedding_dimension self.embedding_matrix = np.zeros((len(word_idx) + 1, self.embedding_dimension)) self.__read_vectors__() self.__populate_embedding__(word_idx) <|end_body_0|> <|body_start_1|> path ...
GloveLoader
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GloveLoader: def __init__(self, word_idx, embedding_dimension=100): """Read glove vectors from file. It creates a cache on home folder using Keras function :param embedding_dimension: (dimensions of glove 50,100,)""" <|body_0|> def __read_vectors__(self): """Read vec...
stack_v2_sparse_classes_10k_train_008061
1,919
permissive
[ { "docstring": "Read glove vectors from file. It creates a cache on home folder using Keras function :param embedding_dimension: (dimensions of glove 50,100,)", "name": "__init__", "signature": "def __init__(self, word_idx, embedding_dimension=100)" }, { "docstring": "Read vectors from glove", ...
3
stack_v2_sparse_classes_30k_train_001423
Implement the Python class `GloveLoader` described below. Class description: Implement the GloveLoader class. Method signatures and docstrings: - def __init__(self, word_idx, embedding_dimension=100): Read glove vectors from file. It creates a cache on home folder using Keras function :param embedding_dimension: (dim...
Implement the Python class `GloveLoader` described below. Class description: Implement the GloveLoader class. Method signatures and docstrings: - def __init__(self, word_idx, embedding_dimension=100): Read glove vectors from file. It creates a cache on home folder using Keras function :param embedding_dimension: (dim...
01214cf44f9e69b64c341c4b6676db73e5ca7966
<|skeleton|> class GloveLoader: def __init__(self, word_idx, embedding_dimension=100): """Read glove vectors from file. It creates a cache on home folder using Keras function :param embedding_dimension: (dimensions of glove 50,100,)""" <|body_0|> def __read_vectors__(self): """Read vec...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class GloveLoader: def __init__(self, word_idx, embedding_dimension=100): """Read glove vectors from file. It creates a cache on home folder using Keras function :param embedding_dimension: (dimensions of glove 50,100,)""" self._embeddings_index = {} self.embedding_dimension = embedding_dime...
the_stack_v2_python_sparse
pypagai/util/glove.py
gcouti/pypagAI
train
1
bdf1846a15040aad5e9e839466171a5537aa62b8
[ "m, n = (len(text1), len(text2))\ndp = [[0] * (n + 1) for _ in range(m + 1)]\nfor i in range(1, m + 1):\n for j in range(1, n + 1):\n if text1[i - 1] == text2[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n else:\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\nreturn dp[-1][-1]", ...
<|body_start_0|> m, n = (len(text1), len(text2)) dp = [[0] * (n + 1) for _ in range(m + 1)] for i in range(1, m + 1): for j in range(1, n + 1): if text1[i - 1] == text2[j - 1]: dp[i][j] = 1 + dp[i - 1][j - 1] else: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longestCommonSubsequence(self, text1, text2): """:type text1: str :type text2: str :rtype: int :desc 最长公共子序列 不连续""" <|body_0|> def LCstring(string1, string2): """最长公共子串 连续""" <|body_1|> <|end_skeleton|> <|body_start_0|> m, n = (len(tex...
stack_v2_sparse_classes_10k_train_008062
1,358
no_license
[ { "docstring": ":type text1: str :type text2: str :rtype: int :desc 最长公共子序列 不连续", "name": "longestCommonSubsequence", "signature": "def longestCommonSubsequence(self, text1, text2)" }, { "docstring": "最长公共子串 连续", "name": "LCstring", "signature": "def LCstring(string1, string2)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestCommonSubsequence(self, text1, text2): :type text1: str :type text2: str :rtype: int :desc 最长公共子序列 不连续 - def LCstring(string1, string2): 最长公共子串 连续
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestCommonSubsequence(self, text1, text2): :type text1: str :type text2: str :rtype: int :desc 最长公共子序列 不连续 - def LCstring(string1, string2): 最长公共子串 连续 <|skeleton|> class ...
08b3d9cab3c1806c37d36587372b1e8fb1683f64
<|skeleton|> class Solution: def longestCommonSubsequence(self, text1, text2): """:type text1: str :type text2: str :rtype: int :desc 最长公共子序列 不连续""" <|body_0|> def LCstring(string1, string2): """最长公共子串 连续""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def longestCommonSubsequence(self, text1, text2): """:type text1: str :type text2: str :rtype: int :desc 最长公共子序列 不连续""" m, n = (len(text1), len(text2)) dp = [[0] * (n + 1) for _ in range(m + 1)] for i in range(1, m + 1): for j in range(1, n + 1): ...
the_stack_v2_python_sparse
history/1143.Longest-Common-Subsequence.py
HonniLin/leetcode
train
0
0d0002a74f37d3a84129a14afe25fe6cb477cfc8
[ "super(PrintPopulationTypeClusters, self).__init__(experiment, name='PrintPopulationTypeClusters', label=label)\nself.epoch_start = self.experiment.config.getint(self.config_section, 'epoch_start', 0)\nself.epoch_end = self.experiment.config.getint(self.config_section, 'epoch_end', default=self.experiment.config.ge...
<|body_start_0|> super(PrintPopulationTypeClusters, self).__init__(experiment, name='PrintPopulationTypeClusters', label=label) self.epoch_start = self.experiment.config.getint(self.config_section, 'epoch_start', 0) self.epoch_end = self.experiment.config.getint(self.config_section, 'epoch_end',...
Write a data file containing the numbers of clusters of each Cell type, as well as their mean size and the standard deviation in size Configuration is done in the [PrintPopulationTypeClusters] section Configuration Options: epoch_start The epoch at which to start executing (default: 0) epoch_end The epoch at which to s...
PrintPopulationTypeClusters
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PrintPopulationTypeClusters: """Write a data file containing the numbers of clusters of each Cell type, as well as their mean size and the standard deviation in size Configuration is done in the [PrintPopulationTypeClusters] section Configuration Options: epoch_start The epoch at which to start e...
stack_v2_sparse_classes_10k_train_008063
4,832
permissive
[ { "docstring": "Initialize the PrintPopulationTypeClusters Action", "name": "__init__", "signature": "def __init__(self, experiment, label=None)" }, { "docstring": "Execute the Action", "name": "update", "signature": "def update(self)" } ]
2
stack_v2_sparse_classes_30k_train_006874
Implement the Python class `PrintPopulationTypeClusters` described below. Class description: Write a data file containing the numbers of clusters of each Cell type, as well as their mean size and the standard deviation in size Configuration is done in the [PrintPopulationTypeClusters] section Configuration Options: ep...
Implement the Python class `PrintPopulationTypeClusters` described below. Class description: Write a data file containing the numbers of clusters of each Cell type, as well as their mean size and the standard deviation in size Configuration is done in the [PrintPopulationTypeClusters] section Configuration Options: ep...
a114ac66e62a960e18127faf52cff9e48831e212
<|skeleton|> class PrintPopulationTypeClusters: """Write a data file containing the numbers of clusters of each Cell type, as well as their mean size and the standard deviation in size Configuration is done in the [PrintPopulationTypeClusters] section Configuration Options: epoch_start The epoch at which to start e...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PrintPopulationTypeClusters: """Write a data file containing the numbers of clusters of each Cell type, as well as their mean size and the standard deviation in size Configuration is done in the [PrintPopulationTypeClusters] section Configuration Options: epoch_start The epoch at which to start executing (def...
the_stack_v2_python_sparse
seeds/plugins/action/PrintPopulationTypeClusters.py
namlehai/seeds
train
0
ed0af6b1fc923c0c58411385cac89997e2a9a99c
[ "self.log = logging.getLogger('lapis.gyazo')\nself.headers = {'User-Agent': useragent}\nself.regex = re.compile('^(.*?\\\\.)?gyazo\\\\.com$')", "try:\n if not self.regex.match(urlsplit(submission.url).netloc):\n return None\n data = {'author': 'a gyazo.com user', 'source': submission.url, 'importer_d...
<|body_start_0|> self.log = logging.getLogger('lapis.gyazo') self.headers = {'User-Agent': useragent} self.regex = re.compile('^(.*?\\.)?gyazo\\.com$') <|end_body_0|> <|body_start_1|> try: if not self.regex.match(urlsplit(submission.url).netloc): return None ...
A gyazo.com import plugin. gyazo.com is a site for quickly uploading screen shots.
GyazoPlugin
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GyazoPlugin: """A gyazo.com import plugin. gyazo.com is a site for quickly uploading screen shots.""" def __init__(self, useragent: str, **options): """Initialize the gyazo import API. :param useragent: The useragent to use for querying gyazo. :param options: Other options in the con...
stack_v2_sparse_classes_10k_train_008064
2,843
permissive
[ { "docstring": "Initialize the gyazo import API. :param useragent: The useragent to use for querying gyazo. :param options: Other options in the configuration. Ignored.", "name": "__init__", "signature": "def __init__(self, useragent: str, **options)" }, { "docstring": "Import a submission from ...
2
stack_v2_sparse_classes_30k_val_000287
Implement the Python class `GyazoPlugin` described below. Class description: A gyazo.com import plugin. gyazo.com is a site for quickly uploading screen shots. Method signatures and docstrings: - def __init__(self, useragent: str, **options): Initialize the gyazo import API. :param useragent: The useragent to use for...
Implement the Python class `GyazoPlugin` described below. Class description: A gyazo.com import plugin. gyazo.com is a site for quickly uploading screen shots. Method signatures and docstrings: - def __init__(self, useragent: str, **options): Initialize the gyazo import API. :param useragent: The useragent to use for...
29503bb70b7b9e47a5cea1ea03098543b1a01efb
<|skeleton|> class GyazoPlugin: """A gyazo.com import plugin. gyazo.com is a site for quickly uploading screen shots.""" def __init__(self, useragent: str, **options): """Initialize the gyazo import API. :param useragent: The useragent to use for querying gyazo. :param options: Other options in the con...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class GyazoPlugin: """A gyazo.com import plugin. gyazo.com is a site for quickly uploading screen shots.""" def __init__(self, useragent: str, **options): """Initialize the gyazo import API. :param useragent: The useragent to use for querying gyazo. :param options: Other options in the configuration. I...
the_stack_v2_python_sparse
plugins/gyazo.py
spiral6/VelvetBot
train
0
25d97f1cabf98aeee8ec31a1a997c9826212b5d9
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')" ]
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
Auth Registry API The Auth Registry API is meant to as registry to obtain information of available auth providers. For example, to use OIDC or Kerberos for authentication. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document ar...
AuthRegistryServiceServicer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AuthRegistryServiceServicer: """Auth Registry API The Auth Registry API is meant to as registry to obtain information of available auth providers. For example, to use OIDC or Kerberos for authentication. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "...
stack_v2_sparse_classes_10k_train_008065
4,150
no_license
[ { "docstring": "Returns the auth provider that is reponsible for the given resource reference. MUST return CODE_NOT_FOUND if the reference does not exist.", "name": "GetAuthProvider", "signature": "def GetAuthProvider(self, request, context)" }, { "docstring": "Returns a list of the available au...
2
stack_v2_sparse_classes_30k_train_002906
Implement the Python class `AuthRegistryServiceServicer` described below. Class description: Auth Registry API The Auth Registry API is meant to as registry to obtain information of available auth providers. For example, to use OIDC or Kerberos for authentication. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",...
Implement the Python class `AuthRegistryServiceServicer` described below. Class description: Auth Registry API The Auth Registry API is meant to as registry to obtain information of available auth providers. For example, to use OIDC or Kerberos for authentication. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",...
dad1a042b38db5f8bedcac3b6af25066f4d6eef9
<|skeleton|> class AuthRegistryServiceServicer: """Auth Registry API The Auth Registry API is meant to as registry to obtain information of available auth providers. For example, to use OIDC or Kerberos for authentication. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AuthRegistryServiceServicer: """Auth Registry API The Auth Registry API is meant to as registry to obtain information of available auth providers. For example, to use OIDC or Kerberos for authentication. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",...
the_stack_v2_python_sparse
cs3/authregistry/v0alpha/authregistry_pb2_grpc.py
SamuAlfageme/python-cs3apis
train
0
c6ede396fad99534e4d0a7f6161c53c2b2640c5d
[ "super(Actor, self).__init__()\nself.state_dim = state_dim\nself.action_dim = action_dim\nself.action_lim = action_lim\nself.hidden = 128\nself.usecuda = usecuda\nself.rnn = nn.LSTMCell(self.state_dim, self.hidden, bias=True)\nself.fc1 = nn.Linear(self.hidden, action_dim)\nself.fc1.weight.data.uniform_(-EPS, EPS)\n...
<|body_start_0|> super(Actor, self).__init__() self.state_dim = state_dim self.action_dim = action_dim self.action_lim = action_lim self.hidden = 128 self.usecuda = usecuda self.rnn = nn.LSTMCell(self.state_dim, self.hidden, bias=True) self.fc1 = nn.Linear...
Actor
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Actor: def __init__(self, state_dim, action_dim, action_lim, usecuda=False): """Special method for class initialisation. :param state_dim: Dimension of input state. :type state_dim: int. :param action_dim: Dimension of output action. :type action_dim: int. :param action_lim: Used to limi...
stack_v2_sparse_classes_10k_train_008066
3,704
permissive
[ { "docstring": "Special method for class initialisation. :param state_dim: Dimension of input state. :type state_dim: int. :param action_dim: Dimension of output action. :type action_dim: int. :param action_lim: Used to limit action. :type action_lim: float. :return:", "name": "__init__", "signature": "...
3
stack_v2_sparse_classes_30k_test_000322
Implement the Python class `Actor` described below. Class description: Implement the Actor class. Method signatures and docstrings: - def __init__(self, state_dim, action_dim, action_lim, usecuda=False): Special method for class initialisation. :param state_dim: Dimension of input state. :type state_dim: int. :param ...
Implement the Python class `Actor` described below. Class description: Implement the Actor class. Method signatures and docstrings: - def __init__(self, state_dim, action_dim, action_lim, usecuda=False): Special method for class initialisation. :param state_dim: Dimension of input state. :type state_dim: int. :param ...
a02bdb1754e9bae1c2448e4bccec795c739b3e6f
<|skeleton|> class Actor: def __init__(self, state_dim, action_dim, action_lim, usecuda=False): """Special method for class initialisation. :param state_dim: Dimension of input state. :type state_dim: int. :param action_dim: Dimension of output action. :type action_dim: int. :param action_lim: Used to limi...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Actor: def __init__(self, state_dim, action_dim, action_lim, usecuda=False): """Special method for class initialisation. :param state_dim: Dimension of input state. :type state_dim: int. :param action_dim: Dimension of output action. :type action_dim: int. :param action_lim: Used to limit action. :typ...
the_stack_v2_python_sparse
notebook/njord-ddpg/model.py
LUOFENGZHOU/njord
train
0
74f615ec2c283c321e8402c2c06786ff109a796f
[ "kwargs['max_digits'] = kwargs.get('max_digits', 19)\nself.decimal_places = kwargs['decimal_places'] = kwargs.get('decimal_places', 6)\nkwargs['required'] = kwargs.get('required', False)\nsuper().__init__(*args, **kwargs)", "amount = super(DecimalField, self).get_value(data)\nif len(str(amount).strip()) == 0:\n ...
<|body_start_0|> kwargs['max_digits'] = kwargs.get('max_digits', 19) self.decimal_places = kwargs['decimal_places'] = kwargs.get('decimal_places', 6) kwargs['required'] = kwargs.get('required', False) super().__init__(*args, **kwargs) <|end_body_0|> <|body_start_1|> amount = sup...
Custom serializer for 'MoneyField', which ensures that passed values are numerically valid. Ref: https://github.com/django-money/django-money/blob/master/djmoney/contrib/django_rest_framework/fields.py
InvenTreeMoneySerializer
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class InvenTreeMoneySerializer: """Custom serializer for 'MoneyField', which ensures that passed values are numerically valid. Ref: https://github.com/django-money/django-money/blob/master/djmoney/contrib/django_rest_framework/fields.py""" def __init__(self, *args, **kwargs): """Override d...
stack_v2_sparse_classes_10k_train_008067
22,975
permissive
[ { "docstring": "Override default values.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Test that the returned amount is a valid Decimal.", "name": "get_value", "signature": "def get_value(self, data)" } ]
2
null
Implement the Python class `InvenTreeMoneySerializer` described below. Class description: Custom serializer for 'MoneyField', which ensures that passed values are numerically valid. Ref: https://github.com/django-money/django-money/blob/master/djmoney/contrib/django_rest_framework/fields.py Method signatures and docs...
Implement the Python class `InvenTreeMoneySerializer` described below. Class description: Custom serializer for 'MoneyField', which ensures that passed values are numerically valid. Ref: https://github.com/django-money/django-money/blob/master/djmoney/contrib/django_rest_framework/fields.py Method signatures and docs...
e88a8e99a5f0b201c67a95cba097c729f090d5e2
<|skeleton|> class InvenTreeMoneySerializer: """Custom serializer for 'MoneyField', which ensures that passed values are numerically valid. Ref: https://github.com/django-money/django-money/blob/master/djmoney/contrib/django_rest_framework/fields.py""" def __init__(self, *args, **kwargs): """Override d...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class InvenTreeMoneySerializer: """Custom serializer for 'MoneyField', which ensures that passed values are numerically valid. Ref: https://github.com/django-money/django-money/blob/master/djmoney/contrib/django_rest_framework/fields.py""" def __init__(self, *args, **kwargs): """Override default values...
the_stack_v2_python_sparse
InvenTree/InvenTree/serializers.py
inventree/InvenTree
train
3,077
48966475e1d1fa8435d560a77c1235ed4d73ef1c
[ "super().__init__()\nself.experiment_name = experiment_name\nself.default_rec_name = default_rec_name\nself.train_func = train_func\nself._call_in_subproc = call_in_subproc", "if isinstance(tasks, dict):\n tasks = [tasks]\nif len(tasks) == 0:\n return []\nif train_func is None:\n train_func = self.train_...
<|body_start_0|> super().__init__() self.experiment_name = experiment_name self.default_rec_name = default_rec_name self.train_func = train_func self._call_in_subproc = call_in_subproc <|end_body_0|> <|body_start_1|> if isinstance(tasks, dict): tasks = [tasks...
Trainer based on (R)ecorder. It will train a list of tasks and return a list of model recorders in a linear way. Assumption: models were defined by `task` and the results will be saved to `Recorder`.
TrainerR
[ "LicenseRef-scancode-generic-cla", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TrainerR: """Trainer based on (R)ecorder. It will train a list of tasks and return a list of model recorders in a linear way. Assumption: models were defined by `task` and the results will be saved to `Recorder`.""" def __init__(self, experiment_name: Optional[str]=None, train_func: Callable...
stack_v2_sparse_classes_10k_train_008068
22,767
permissive
[ { "docstring": "Init TrainerR. Args: experiment_name (str, optional): the default name of experiment. train_func (Callable, optional): default training method. Defaults to `task_train`. call_in_subproc (bool): call the process in subprocess to force memory release", "name": "__init__", "signature": "def...
3
stack_v2_sparse_classes_30k_test_000265
Implement the Python class `TrainerR` described below. Class description: Trainer based on (R)ecorder. It will train a list of tasks and return a list of model recorders in a linear way. Assumption: models were defined by `task` and the results will be saved to `Recorder`. Method signatures and docstrings: - def __in...
Implement the Python class `TrainerR` described below. Class description: Trainer based on (R)ecorder. It will train a list of tasks and return a list of model recorders in a linear way. Assumption: models were defined by `task` and the results will be saved to `Recorder`. Method signatures and docstrings: - def __in...
4c30e5827b74bcc45f14cf3ae0c1715459ed09ae
<|skeleton|> class TrainerR: """Trainer based on (R)ecorder. It will train a list of tasks and return a list of model recorders in a linear way. Assumption: models were defined by `task` and the results will be saved to `Recorder`.""" def __init__(self, experiment_name: Optional[str]=None, train_func: Callable...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TrainerR: """Trainer based on (R)ecorder. It will train a list of tasks and return a list of model recorders in a linear way. Assumption: models were defined by `task` and the results will be saved to `Recorder`.""" def __init__(self, experiment_name: Optional[str]=None, train_func: Callable=task_train, ...
the_stack_v2_python_sparse
qlib/model/trainer.py
microsoft/qlib
train
12,822
56a0455a817f3a826b40815bfa69794b0c496e07
[ "pre = ListNode(-1)\npre.next = head\ncurr = pre\nwhile curr.next and curr.next.next:\n forward = curr.next\n curr.next = forward.next\n forward.next = forward.next.next\n curr.next.next = forward\n curr = forward\nreturn pre.next", "ret_head = head.next if head and head.next else head\npp_head = N...
<|body_start_0|> pre = ListNode(-1) pre.next = head curr = pre while curr.next and curr.next.next: forward = curr.next curr.next = forward.next forward.next = forward.next.next curr.next.next = forward curr = forward ret...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def swapPairs(self, head): """:type head: ListNode :rtype: ListNode Fast solution, but hard to fathom.""" <|body_0|> def rewrite(self, head): """:type head: ListNode :rtype: ListNode""" <|body_1|> def rewrite2(self, head): """:type head...
stack_v2_sparse_classes_10k_train_008069
3,942
no_license
[ { "docstring": ":type head: ListNode :rtype: ListNode Fast solution, but hard to fathom.", "name": "swapPairs", "signature": "def swapPairs(self, head)" }, { "docstring": ":type head: ListNode :rtype: ListNode", "name": "rewrite", "signature": "def rewrite(self, head)" }, { "docs...
4
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def swapPairs(self, head): :type head: ListNode :rtype: ListNode Fast solution, but hard to fathom. - def rewrite(self, head): :type head: ListNode :rtype: ListNode - def rewrite...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def swapPairs(self, head): :type head: ListNode :rtype: ListNode Fast solution, but hard to fathom. - def rewrite(self, head): :type head: ListNode :rtype: ListNode - def rewrite...
6350568d16b0f8c49a020f055bb6d72e2705ea56
<|skeleton|> class Solution: def swapPairs(self, head): """:type head: ListNode :rtype: ListNode Fast solution, but hard to fathom.""" <|body_0|> def rewrite(self, head): """:type head: ListNode :rtype: ListNode""" <|body_1|> def rewrite2(self, head): """:type head...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def swapPairs(self, head): """:type head: ListNode :rtype: ListNode Fast solution, but hard to fathom.""" pre = ListNode(-1) pre.next = head curr = pre while curr.next and curr.next.next: forward = curr.next curr.next = forward.next ...
the_stack_v2_python_sparse
co_fb/24_Swap_Nodes_in_Pairs.py
vsdrun/lc_public
train
6
64c2d34275e82de1920fa87b88c8f5db79128076
[ "def driver(start, target, cnt):\n res = []\n if cnt == 0 and target > 0:\n res.append([])\n for i in range(start, len(nums)):\n subsets = driver(i + 1, target - nums[i], cnt - 1)\n for subset in subsets:\n subset.append(i)\n res.extend(subsets)\n return res\nres =...
<|body_start_0|> def driver(start, target, cnt): res = [] if cnt == 0 and target > 0: res.append([]) for i in range(start, len(nums)): subsets = driver(i + 1, target - nums[i], cnt - 1) for subset in subsets: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def threeSumSmaller(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def threeSumSmaller2(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> def threeSumSmallerTwoP...
stack_v2_sparse_classes_10k_train_008070
2,140
no_license
[ { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "threeSumSmaller", "signature": "def threeSumSmaller(self, nums, target)" }, { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "threeSumSmaller2", "signature": "def threeSumSmaller2(...
3
stack_v2_sparse_classes_30k_train_004716
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def threeSumSmaller(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def threeSumSmaller2(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 threeSumSmaller(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def threeSumSmaller2(self, nums, target): :type nums: List[int] :type target: int :...
11d6bf2ba7b50c07e048df37c4e05c8f46b92241
<|skeleton|> class Solution: def threeSumSmaller(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def threeSumSmaller2(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> def threeSumSmallerTwoP...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def threeSumSmaller(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" def driver(start, target, cnt): res = [] if cnt == 0 and target > 0: res.append([]) for i in range(start, len(nums)): ...
the_stack_v2_python_sparse
LeetCodes/Google/3Sum Smaller.py
chutianwen/LeetCodes
train
0
dafb1f7aa0db15d840753ed05a1c2566698d1113
[ "result = []\nroot = {'parent': None, 'state': list(), 'positives': nums, 'negatives': list()}\ntemp_node = root\nwhile temp_node is not None:\n if temp_node['positives']:\n item = temp_node['positives'].pop()\n next_node = {'parent': temp_node, 'state': temp_node['state'] + [item], 'positives': te...
<|body_start_0|> result = [] root = {'parent': None, 'state': list(), 'positives': nums, 'negatives': list()} temp_node = root while temp_node is not None: if temp_node['positives']: item = temp_node['positives'].pop() next_node = {'parent': te...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def permute_backtracking(self, nums): """根据题目的提示,可以使用回溯法来生成所有的可能的结果。 :type nums: List[int] :rtype: List[List[int]]""" <|body_0|> def permute(self, nums): """从我们的第一直觉上来说,permutations很简单,只不过是所有数字的排列而已, 因此总共有len(nums)!种结果。现在的问题是怎么将这么多种结果生成出来。 在这里借用beam search的...
stack_v2_sparse_classes_10k_train_008071
2,369
no_license
[ { "docstring": "根据题目的提示,可以使用回溯法来生成所有的可能的结果。 :type nums: List[int] :rtype: List[List[int]]", "name": "permute_backtracking", "signature": "def permute_backtracking(self, nums)" }, { "docstring": "从我们的第一直觉上来说,permutations很简单,只不过是所有数字的排列而已, 因此总共有len(nums)!种结果。现在的问题是怎么将这么多种结果生成出来。 在这里借用beam search的方...
2
stack_v2_sparse_classes_30k_train_001797
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def permute_backtracking(self, nums): 根据题目的提示,可以使用回溯法来生成所有的可能的结果。 :type nums: List[int] :rtype: List[List[int]] - def permute(self, nums): 从我们的第一直觉上来说,permutations很简单,只不过是所有数字的排列...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def permute_backtracking(self, nums): 根据题目的提示,可以使用回溯法来生成所有的可能的结果。 :type nums: List[int] :rtype: List[List[int]] - def permute(self, nums): 从我们的第一直觉上来说,permutations很简单,只不过是所有数字的排列...
45d116d790075b1583af6aecd00f8babfe2c3107
<|skeleton|> class Solution: def permute_backtracking(self, nums): """根据题目的提示,可以使用回溯法来生成所有的可能的结果。 :type nums: List[int] :rtype: List[List[int]]""" <|body_0|> def permute(self, nums): """从我们的第一直觉上来说,permutations很简单,只不过是所有数字的排列而已, 因此总共有len(nums)!种结果。现在的问题是怎么将这么多种结果生成出来。 在这里借用beam search的...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def permute_backtracking(self, nums): """根据题目的提示,可以使用回溯法来生成所有的可能的结果。 :type nums: List[int] :rtype: List[List[int]]""" result = [] root = {'parent': None, 'state': list(), 'positives': nums, 'negatives': list()} temp_node = root while temp_node is not None: ...
the_stack_v2_python_sparse
leetcode/misc/exercise_46.py
YinongLong/Data-Structures-and-Algorithm-Analysis
train
0
5542b90fccd52b06da458f3baf60faf126d05868
[ "self.time = deque()\nself.lookup = defaultdict(int)\nself.now = 0", "while self.time and timestamp - self.time[-1] + 1 > 300:\n self.lookup.pop(self.time.pop())\nif timestamp > self.now:\n self.time.appendleft(timestamp)\n self.now = timestamp\nself.lookup[timestamp] += 1", "while self.time and timest...
<|body_start_0|> self.time = deque() self.lookup = defaultdict(int) self.now = 0 <|end_body_0|> <|body_start_1|> while self.time and timestamp - self.time[-1] + 1 > 300: self.lookup.pop(self.time.pop()) if timestamp > self.now: self.time.appendleft(timest...
HitCounter1
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HitCounter1: def __init__(self): """Initialize your data structure here.""" <|body_0|> def hit(self, timestamp: int) -> None: """Record a hit. @param timestamp - The current timestamp (in seconds granularity).""" <|body_1|> def getHits(self, timestamp: i...
stack_v2_sparse_classes_10k_train_008072
1,884
no_license
[ { "docstring": "Initialize your data structure here.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Record a hit. @param timestamp - The current timestamp (in seconds granularity).", "name": "hit", "signature": "def hit(self, timestamp: int) -> None" }, { ...
3
stack_v2_sparse_classes_30k_val_000390
Implement the Python class `HitCounter1` described below. Class description: Implement the HitCounter1 class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def hit(self, timestamp: int) -> None: Record a hit. @param timestamp - The current timestamp (in seconds granula...
Implement the Python class `HitCounter1` described below. Class description: Implement the HitCounter1 class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def hit(self, timestamp: int) -> None: Record a hit. @param timestamp - The current timestamp (in seconds granula...
631df2ce6892a6fbb3e435f57e90d85f8200d125
<|skeleton|> class HitCounter1: def __init__(self): """Initialize your data structure here.""" <|body_0|> def hit(self, timestamp: int) -> None: """Record a hit. @param timestamp - The current timestamp (in seconds granularity).""" <|body_1|> def getHits(self, timestamp: i...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class HitCounter1: def __init__(self): """Initialize your data structure here.""" self.time = deque() self.lookup = defaultdict(int) self.now = 0 def hit(self, timestamp: int) -> None: """Record a hit. @param timestamp - The current timestamp (in seconds granularity)."""...
the_stack_v2_python_sparse
362. Design Hit Counter.py
c940606/leetcode
train
3
aa23c08a92b938eed93e0900debebda960f76beb
[ "txt.replace('&', '&amp;')\nfor entity, code in XML.entities.items():\n txt.replace(entity, code)\nreturn txt", "for entity, code in XML.entities.items():\n txt.replace(code, entity)\ntxt.replace('&amp;', '&')\nreturn txt" ]
<|body_start_0|> txt.replace('&', '&amp;') for entity, code in XML.entities.items(): txt.replace(entity, code) return txt <|end_body_0|> <|body_start_1|> for entity, code in XML.entities.items(): txt.replace(code, entity) txt.replace('&amp;', '&') ...
a class containing usefull method for XML
XML
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class XML: """a class containing usefull method for XML""" def encode(txt): """a method to replace XML entities by XML representation""" <|body_0|> def decode(txt): """a method to replace XML representation of entities by the original entities""" <|body_1|> <|...
stack_v2_sparse_classes_10k_train_008073
1,137
permissive
[ { "docstring": "a method to replace XML entities by XML representation", "name": "encode", "signature": "def encode(txt)" }, { "docstring": "a method to replace XML representation of entities by the original entities", "name": "decode", "signature": "def decode(txt)" } ]
2
stack_v2_sparse_classes_30k_train_006259
Implement the Python class `XML` described below. Class description: a class containing usefull method for XML Method signatures and docstrings: - def encode(txt): a method to replace XML entities by XML representation - def decode(txt): a method to replace XML representation of entities by the original entities
Implement the Python class `XML` described below. Class description: a class containing usefull method for XML Method signatures and docstrings: - def encode(txt): a method to replace XML entities by XML representation - def decode(txt): a method to replace XML representation of entities by the original entities <|s...
39082e7833383bbe7dd414381f1b295e3b778439
<|skeleton|> class XML: """a class containing usefull method for XML""" def encode(txt): """a method to replace XML entities by XML representation""" <|body_0|> def decode(txt): """a method to replace XML representation of entities by the original entities""" <|body_1|> <|...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class XML: """a class containing usefull method for XML""" def encode(txt): """a method to replace XML entities by XML representation""" txt.replace('&', '&amp;') for entity, code in XML.entities.items(): txt.replace(entity, code) return txt def decode(txt): ...
the_stack_v2_python_sparse
usefullFunctions.py
chankeh/Blender-Render-Manager
train
0
90b380c2f84d1b9d56d68224aaae9d58e31ae7ba
[ "if 0 <= x < len(self.grid) and 0 <= y < len(self.grid[0]):\n if self.grid[x][y] == '1':\n queue.append((x, y))", "queue = deque()\nqueue.append((row, col))\nwhile queue:\n x, y = queue.pop()\n self.grid[x][y] = '2'\n self.append_if(queue, x - 1, y)\n self.append_if(queue, x, y - 1)\n sel...
<|body_start_0|> if 0 <= x < len(self.grid) and 0 <= y < len(self.grid[0]): if self.grid[x][y] == '1': queue.append((x, y)) <|end_body_0|> <|body_start_1|> queue = deque() queue.append((row, col)) while queue: x, y = queue.pop() self.g...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def append_if(self, queue, x, y): """Append to the queue only if in bounds of the grid and the cell value is 1.""" <|body_0|> def mark_neighbors(self, row, col): """Mark all the cells in the current island with value = 2. Breadth-first search.""" <|...
stack_v2_sparse_classes_10k_train_008074
1,558
no_license
[ { "docstring": "Append to the queue only if in bounds of the grid and the cell value is 1.", "name": "append_if", "signature": "def append_if(self, queue, x, y)" }, { "docstring": "Mark all the cells in the current island with value = 2. Breadth-first search.", "name": "mark_neighbors", ...
3
stack_v2_sparse_classes_30k_train_000458
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def append_if(self, queue, x, y): Append to the queue only if in bounds of the grid and the cell value is 1. - def mark_neighbors(self, row, col): Mark all the cells in the curre...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def append_if(self, queue, x, y): Append to the queue only if in bounds of the grid and the cell value is 1. - def mark_neighbors(self, row, col): Mark all the cells in the curre...
0864b4f8a52d9463d09def8d54a9b852e4073dcc
<|skeleton|> class Solution: def append_if(self, queue, x, y): """Append to the queue only if in bounds of the grid and the cell value is 1.""" <|body_0|> def mark_neighbors(self, row, col): """Mark all the cells in the current island with value = 2. Breadth-first search.""" <|...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def append_if(self, queue, x, y): """Append to the queue only if in bounds of the grid and the cell value is 1.""" if 0 <= x < len(self.grid) and 0 <= y < len(self.grid[0]): if self.grid[x][y] == '1': queue.append((x, y)) def mark_neighbors(self, row,...
the_stack_v2_python_sparse
islands2.py
Sammyuel/LeetcodeSolutions
train
0
11d7ad0146b63656733bc07d42cab8febb365031
[ "super().__init__()\nself._cardinality = cardinality\nself._width = width\nself._start_filts = start_filts\nself._num_classes = num_classes\nself._block = block\nself._block.start_filts = start_filts\nself._layers = layers\nself.inplanes = copy.deepcopy(self._start_filts)\nself.conv1 = _StartConv(n_dim, norm_layer,...
<|body_start_0|> super().__init__() self._cardinality = cardinality self._width = width self._start_filts = start_filts self._num_classes = num_classes self._block = block self._block.start_filts = start_filts self._layers = layers self.inplanes = ...
ResNeXt model architecture
_ResNeXt
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _ResNeXt: """ResNeXt model architecture""" def __init__(self, block: torch.nn.Module, layers: Sequence[int], num_classes: int, in_channels: int, cardinality: int, width: int=4, start_filts: int=64, start_mode: str='7x7', n_dim: int=2, norm_layer: str='Batch'): """Parameters ---------...
stack_v2_sparse_classes_10k_train_008075
12,047
permissive
[ { "docstring": "Parameters ---------- block : nn.Module ResNeXt block used to build network layers : list of int defines how many blocks should be used in each stage num_classes : int number of classes in_channels : int number of input channels cardinality : int cardinality (number of groups) width : int width ...
3
stack_v2_sparse_classes_30k_train_006037
Implement the Python class `_ResNeXt` described below. Class description: ResNeXt model architecture Method signatures and docstrings: - def __init__(self, block: torch.nn.Module, layers: Sequence[int], num_classes: int, in_channels: int, cardinality: int, width: int=4, start_filts: int=64, start_mode: str='7x7', n_d...
Implement the Python class `_ResNeXt` described below. Class description: ResNeXt model architecture Method signatures and docstrings: - def __init__(self, block: torch.nn.Module, layers: Sequence[int], num_classes: int, in_channels: int, cardinality: int, width: int=4, start_filts: int=64, start_mode: str='7x7', n_d...
1078f5030b8aac2bf022daf5fa14d66f74c3c893
<|skeleton|> class _ResNeXt: """ResNeXt model architecture""" def __init__(self, block: torch.nn.Module, layers: Sequence[int], num_classes: int, in_channels: int, cardinality: int, width: int=4, start_filts: int=64, start_mode: str='7x7', n_dim: int=2, norm_layer: str='Batch'): """Parameters ---------...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class _ResNeXt: """ResNeXt model architecture""" def __init__(self, block: torch.nn.Module, layers: Sequence[int], num_classes: int, in_channels: int, cardinality: int, width: int=4, start_filts: int=64, start_mode: str='7x7', n_dim: int=2, norm_layer: str='Batch'): """Parameters ---------- block : nn....
the_stack_v2_python_sparse
dlutils/models/resnext.py
justusschock/dl-utils
train
15
c5531fb392267ddeeff02183b2cc622e0ffd8e01
[ "try:\n ectool_output = self._device.CallOutput(['ectool', 'pwmgetfanrpm'] + (['%d' % fan_id] if fan_id is not None else []))\n return [int(rpm[1]) for rpm in self.GET_FAN_SPEED_RE.findall(ectool_output)]\nexcept Exception as e:\n raise self.Error('Unable to get fan speed: %s' % e)", "try:\n if rpm ==...
<|body_start_0|> try: ectool_output = self._device.CallOutput(['ectool', 'pwmgetfanrpm'] + (['%d' % fan_id] if fan_id is not None else [])) return [int(rpm[1]) for rpm in self.GET_FAN_SPEED_RE.findall(ectool_output)] except Exception as e: raise self.Error('Unable to ...
System module for thermal control (temperature sensors, fans). Implementation for systems with 'ectool' and able to control thermal with EC.
ECToolFanControl
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ECToolFanControl: """System module for thermal control (temperature sensors, fans). Implementation for systems with 'ectool' and able to control thermal with EC.""" def GetFanRPM(self, fan_id=None): """Gets the fan RPM. Args: fan_id: The id of the fan. Returns: A list of int indicati...
stack_v2_sparse_classes_10k_train_008076
5,738
permissive
[ { "docstring": "Gets the fan RPM. Args: fan_id: The id of the fan. Returns: A list of int indicating the RPM of each fan.", "name": "GetFanRPM", "signature": "def GetFanRPM(self, fan_id=None)" }, { "docstring": "Sets the target fan RPM. Args: rpm: Target fan RPM, or FanControl.AUTO for auto fan ...
2
stack_v2_sparse_classes_30k_val_000140
Implement the Python class `ECToolFanControl` described below. Class description: System module for thermal control (temperature sensors, fans). Implementation for systems with 'ectool' and able to control thermal with EC. Method signatures and docstrings: - def GetFanRPM(self, fan_id=None): Gets the fan RPM. Args: f...
Implement the Python class `ECToolFanControl` described below. Class description: System module for thermal control (temperature sensors, fans). Implementation for systems with 'ectool' and able to control thermal with EC. Method signatures and docstrings: - def GetFanRPM(self, fan_id=None): Gets the fan RPM. Args: f...
a1b0fccd68987d8cd9c89710adc3c04b868347ec
<|skeleton|> class ECToolFanControl: """System module for thermal control (temperature sensors, fans). Implementation for systems with 'ectool' and able to control thermal with EC.""" def GetFanRPM(self, fan_id=None): """Gets the fan RPM. Args: fan_id: The id of the fan. Returns: A list of int indicati...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ECToolFanControl: """System module for thermal control (temperature sensors, fans). Implementation for systems with 'ectool' and able to control thermal with EC.""" def GetFanRPM(self, fan_id=None): """Gets the fan RPM. Args: fan_id: The id of the fan. Returns: A list of int indicating the RPM of...
the_stack_v2_python_sparse
py/device/fan.py
bridder/factory
train
0
d3282307ef6ab6885b00a49eea9b3477644a4f65
[ "if nums == []:\n return\nroot_val = max(nums)\nroot_idx = nums.index(root_val)\nroot = TreeNode(root_val)\nroot.left = self.constructMaximumBinaryTree(nums[:root_idx])\nroot.right = self.constructMaximumBinaryTree(nums[root_idx + 1:])\nreturn root", "if len(nums) == 0:\n return None\nstack = []\nfor num in...
<|body_start_0|> if nums == []: return root_val = max(nums) root_idx = nums.index(root_val) root = TreeNode(root_val) root.left = self.constructMaximumBinaryTree(nums[:root_idx]) root.right = self.constructMaximumBinaryTree(nums[root_idx + 1:]) return ...
Recursive solution Stats: O(n^2) runtime -- need to find max for every single num in worse case
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """Recursive solution Stats: O(n^2) runtime -- need to find max for every single num in worse case""" def constructMaximumBinaryTree(self, nums): """:type nums: List[int] :rtype: TreeNode""" <|body_0|> def constructMaximumBinaryTree(self, nums): """:typ...
stack_v2_sparse_classes_10k_train_008077
1,897
no_license
[ { "docstring": ":type nums: List[int] :rtype: TreeNode", "name": "constructMaximumBinaryTree", "signature": "def constructMaximumBinaryTree(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: TreeNode", "name": "constructMaximumBinaryTree", "signature": "def constructMaximumBin...
2
null
Implement the Python class `Solution` described below. Class description: Recursive solution Stats: O(n^2) runtime -- need to find max for every single num in worse case Method signatures and docstrings: - def constructMaximumBinaryTree(self, nums): :type nums: List[int] :rtype: TreeNode - def constructMaximumBinaryT...
Implement the Python class `Solution` described below. Class description: Recursive solution Stats: O(n^2) runtime -- need to find max for every single num in worse case Method signatures and docstrings: - def constructMaximumBinaryTree(self, nums): :type nums: List[int] :rtype: TreeNode - def constructMaximumBinaryT...
844f502da4d6fb9cd69cf0a1ef71da3385a4d2b4
<|skeleton|> class Solution: """Recursive solution Stats: O(n^2) runtime -- need to find max for every single num in worse case""" def constructMaximumBinaryTree(self, nums): """:type nums: List[int] :rtype: TreeNode""" <|body_0|> def constructMaximumBinaryTree(self, nums): """:typ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: """Recursive solution Stats: O(n^2) runtime -- need to find max for every single num in worse case""" def constructMaximumBinaryTree(self, nums): """:type nums: List[int] :rtype: TreeNode""" if nums == []: return root_val = max(nums) root_idx = nums.i...
the_stack_v2_python_sparse
654-max-binary_tree.py
stevestar888/leetcode-problems
train
2
d441b85e15392c2057bfe64dde8c30c8d627129b
[ "subcategory = self.cleaned_data['subcategory']\nif subcategory.parent_category is None:\n raise forms.ValidationError(INVALID_SUBCATEGORY, code='invalid')\nreturn subcategory", "images = self.data.get('images', [])\ncurrent_images = Image.objects.filter(offer_id=offer.id)\nif current_images:\n excluded_ima...
<|body_start_0|> subcategory = self.cleaned_data['subcategory'] if subcategory.parent_category is None: raise forms.ValidationError(INVALID_SUBCATEGORY, code='invalid') return subcategory <|end_body_0|> <|body_start_1|> images = self.data.get('images', []) current_im...
Form to create an offer from admin
AdminCreateOfferForm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdminCreateOfferForm: """Form to create an offer from admin""" def clean_subcategory(self): """Validate subcategory is actually a subcategory, not a parent category""" <|body_0|> def clean_images(self, offer): """Clean images""" <|body_1|> def clean_...
stack_v2_sparse_classes_10k_train_008078
8,911
no_license
[ { "docstring": "Validate subcategory is actually a subcategory, not a parent category", "name": "clean_subcategory", "signature": "def clean_subcategory(self)" }, { "docstring": "Clean images", "name": "clean_images", "signature": "def clean_images(self, offer)" }, { "docstring":...
4
stack_v2_sparse_classes_30k_train_006687
Implement the Python class `AdminCreateOfferForm` described below. Class description: Form to create an offer from admin Method signatures and docstrings: - def clean_subcategory(self): Validate subcategory is actually a subcategory, not a parent category - def clean_images(self, offer): Clean images - def clean_mate...
Implement the Python class `AdminCreateOfferForm` described below. Class description: Form to create an offer from admin Method signatures and docstrings: - def clean_subcategory(self): Validate subcategory is actually a subcategory, not a parent category - def clean_images(self, offer): Clean images - def clean_mate...
4dc6362ef624eb6591aad9d5c7de95eee40a01c9
<|skeleton|> class AdminCreateOfferForm: """Form to create an offer from admin""" def clean_subcategory(self): """Validate subcategory is actually a subcategory, not a parent category""" <|body_0|> def clean_images(self, offer): """Clean images""" <|body_1|> def clean_...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AdminCreateOfferForm: """Form to create an offer from admin""" def clean_subcategory(self): """Validate subcategory is actually a subcategory, not a parent category""" subcategory = self.cleaned_data['subcategory'] if subcategory.parent_category is None: raise forms.Va...
the_stack_v2_python_sparse
app/offers/forms.py
arielMilan1899/orbita-api
train
0
7fecd064d69a3d30af08fe173ca7eb6930b698a9
[ "if filename is None:\n self.filename = DEFAULT_FILENAME\nelse:\n self.filename = filename\nself.settings = {}\nself.config_parser = configparser.ConfigParser()", "if not os.path.isfile(self.filename):\n return\nself.config_parser.read(self.filename)\nif 'default' in self.config_parser.sections():\n c...
<|body_start_0|> if filename is None: self.filename = DEFAULT_FILENAME else: self.filename = filename self.settings = {} self.config_parser = configparser.ConfigParser() <|end_body_0|> <|body_start_1|> if not os.path.isfile(self.filename): ret...
Class representing a user config file The config file format should look like: [default] circuit_drawer = mpl circuit_mpl_style = default
UserConfig
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserConfig: """Class representing a user config file The config file format should look like: [default] circuit_drawer = mpl circuit_mpl_style = default""" def __init__(self, filename=None): """Create a UserConfig Args: filename (str): The path to the user config file. If one isn't s...
stack_v2_sparse_classes_10k_train_008079
3,452
permissive
[ { "docstring": "Create a UserConfig Args: filename (str): The path to the user config file. If one isn't specified ~/.qiskit/settings.conf is used.", "name": "__init__", "signature": "def __init__(self, filename=None)" }, { "docstring": "Read config file and parse the contents into the settings ...
2
null
Implement the Python class `UserConfig` described below. Class description: Class representing a user config file The config file format should look like: [default] circuit_drawer = mpl circuit_mpl_style = default Method signatures and docstrings: - def __init__(self, filename=None): Create a UserConfig Args: filenam...
Implement the Python class `UserConfig` described below. Class description: Class representing a user config file The config file format should look like: [default] circuit_drawer = mpl circuit_mpl_style = default Method signatures and docstrings: - def __init__(self, filename=None): Create a UserConfig Args: filenam...
abf6c23d4ab6c63f9c01c7434fb46321e6a69200
<|skeleton|> class UserConfig: """Class representing a user config file The config file format should look like: [default] circuit_drawer = mpl circuit_mpl_style = default""" def __init__(self, filename=None): """Create a UserConfig Args: filename (str): The path to the user config file. If one isn't s...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class UserConfig: """Class representing a user config file The config file format should look like: [default] circuit_drawer = mpl circuit_mpl_style = default""" def __init__(self, filename=None): """Create a UserConfig Args: filename (str): The path to the user config file. If one isn't specified ~/.q...
the_stack_v2_python_sparse
qiskit/user_config.py
indian-institute-of-science-qc/qiskit-aakash
train
37
2968db61b8fc3770939093a7c18a4e2a1e312257
[ "from collections import deque\ntree_list = deque()\ntree_list.append(root)\ns = []\nwhile tree_list:\n if tree_list[0]:\n s.append(str(tree_list[0].val))\n tree_list.append(tree_list[0].left)\n tree_list.append(tree_list[0].right)\n else:\n s.append('null')\n tree_list.popleft(...
<|body_start_0|> from collections import deque tree_list = deque() tree_list.append(root) s = [] while tree_list: if tree_list[0]: s.append(str(tree_list[0].val)) tree_list.append(tree_list[0].left) tree_list.append(tree...
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_10k_train_008080
2,902
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_002183
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:...
2d7cb909535c6ea88c3b1c5e3123f75debaae188
<|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_10k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" from collections import deque tree_list = deque() tree_list.append(root) s = [] while tree_list: if tree_list[0]: s.append(str...
the_stack_v2_python_sparse
LeetCode297.py
wangyu33/LeetCode
train
0
ece536c11d7a919bca43def97670c44dd71fee57
[ "ans = 0\nfor i in range(32):\n sm = 0\n for j in nums:\n sm += j >> i & 1\n ans |= sm % 3 << i\nreturn ans - 2 ** 32 if ans >= 2 ** 31 else ans", "one = 0\ntwo = 0\nthree = 0\nfor i in range(len(nums)):\n two |= one & nums[i]\n one ^= nums[i]\n three = one & two\n one &= ~three\n t...
<|body_start_0|> ans = 0 for i in range(32): sm = 0 for j in nums: sm += j >> i & 1 ans |= sm % 3 << i return ans - 2 ** 32 if ans >= 2 ** 31 else ans <|end_body_0|> <|body_start_1|> one = 0 two = 0 three = 0 fo...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def singleNumberSlow(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def singleNumber(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def singleNumberGeneral(self, nums): """:type nums: List[int] :rtype: ...
stack_v2_sparse_classes_10k_train_008081
1,972
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "singleNumberSlow", "signature": "def singleNumberSlow(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "singleNumber", "signature": "def singleNumber(self, nums)" }, { "docstring": ":type nums...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def singleNumberSlow(self, nums): :type nums: List[int] :rtype: int - def singleNumber(self, nums): :type nums: List[int] :rtype: int - def singleNumberGeneral(self, nums): :type...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def singleNumberSlow(self, nums): :type nums: List[int] :rtype: int - def singleNumber(self, nums): :type nums: List[int] :rtype: int - def singleNumberGeneral(self, nums): :type...
810575368ecffa97677bdb51744d1f716140bbb1
<|skeleton|> class Solution: def singleNumberSlow(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def singleNumber(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def singleNumberGeneral(self, nums): """:type nums: List[int] :rtype: ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def singleNumberSlow(self, nums): """:type nums: List[int] :rtype: int""" ans = 0 for i in range(32): sm = 0 for j in nums: sm += j >> i & 1 ans |= sm % 3 << i return ans - 2 ** 32 if ans >= 2 ** 31 else ans def...
the_stack_v2_python_sparse
S/SingleNumberII.py
bssrdf/pyleet
train
2
876d1c05948421aead858f1c7a1a03ed90a14848
[ "minheap = []\nM, N = (len(matrix), len(matrix[0]))\nfor r in range(min(k, M)):\n heapq.heappush(minheap, (matrix[r][0], r, 0))\nfor i in range(k):\n ans, r, c = heapq.heappop(minheap)\n if c + 1 < N:\n heapq.heappush(minheap, (matrix[r][c + 1], r, c + 1))\nreturn ans", "M, N = (len(matrix), len(m...
<|body_start_0|> minheap = [] M, N = (len(matrix), len(matrix[0])) for r in range(min(k, M)): heapq.heappush(minheap, (matrix[r][0], r, 0)) for i in range(k): ans, r, c = heapq.heappop(minheap) if c + 1 < N: heapq.heappush(minheap, (mat...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def kthSmallest(self, matrix: List[List[int]], k: int) -> int: """한 줄을 더해놓고, 그로부터 오른쪽으로 이동하게 heap을 구현 O(klogk) / O(k)""" <|body_0|> def kthSmallest(self, matrix: List[List[int]], k: int) -> int: """Binary Search 로 최대 범위의 값을 이동해나아가면서 그 값이 몇번째인지 매번 계산 O((M+N)...
stack_v2_sparse_classes_10k_train_008082
1,440
no_license
[ { "docstring": "한 줄을 더해놓고, 그로부터 오른쪽으로 이동하게 heap을 구현 O(klogk) / O(k)", "name": "kthSmallest", "signature": "def kthSmallest(self, matrix: List[List[int]], k: int) -> int" }, { "docstring": "Binary Search 로 최대 범위의 값을 이동해나아가면서 그 값이 몇번째인지 매번 계산 O((M+N)logD) / O(1)", "name": "kthSmallest", "s...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def kthSmallest(self, matrix: List[List[int]], k: int) -> int: 한 줄을 더해놓고, 그로부터 오른쪽으로 이동하게 heap을 구현 O(klogk) / O(k) - def kthSmallest(self, matrix: List[List[int]], k: int) -> int...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def kthSmallest(self, matrix: List[List[int]], k: int) -> int: 한 줄을 더해놓고, 그로부터 오른쪽으로 이동하게 heap을 구현 O(klogk) / O(k) - def kthSmallest(self, matrix: List[List[int]], k: int) -> int...
c26aef2a59e5cc2d9b0658b9c7386a43267ff8a1
<|skeleton|> class Solution: def kthSmallest(self, matrix: List[List[int]], k: int) -> int: """한 줄을 더해놓고, 그로부터 오른쪽으로 이동하게 heap을 구현 O(klogk) / O(k)""" <|body_0|> def kthSmallest(self, matrix: List[List[int]], k: int) -> int: """Binary Search 로 최대 범위의 값을 이동해나아가면서 그 값이 몇번째인지 매번 계산 O((M+N)...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def kthSmallest(self, matrix: List[List[int]], k: int) -> int: """한 줄을 더해놓고, 그로부터 오른쪽으로 이동하게 heap을 구현 O(klogk) / O(k)""" minheap = [] M, N = (len(matrix), len(matrix[0])) for r in range(min(k, M)): heapq.heappush(minheap, (matrix[r][0], r, 0)) for ...
the_stack_v2_python_sparse
Leetcode/378.py
hanwgyu/algorithm_problem_solving
train
5
286d748e23d5e038635e94147652c49421c6195f
[ "m = max(persons) + 1\nself.v = [0] * m\nself.t = []\nself.s = min(persons)\nmax_c = 0\nmax_t = min(persons)\nfor i in range(len(persons)):\n self.v[persons[i]] += 1\n if self.v[persons[i]] >= max_c:\n max_t = persons[i]\n max_c = self.v[persons[i]]\n self.t.append(max_t)\nself.n = len(times)...
<|body_start_0|> m = max(persons) + 1 self.v = [0] * m self.t = [] self.s = min(persons) max_c = 0 max_t = min(persons) for i in range(len(persons)): self.v[persons[i]] += 1 if self.v[persons[i]] >= max_c: max_t = persons[i]...
TopVotedCandidate
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TopVotedCandidate: def __init__(self, persons, times): """:type persons: List[int] :type times: List[int]""" <|body_0|> def q(self, t): """:type t: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> m = max(persons) + 1 self.v =...
stack_v2_sparse_classes_10k_train_008083
1,161
no_license
[ { "docstring": ":type persons: List[int] :type times: List[int]", "name": "__init__", "signature": "def __init__(self, persons, times)" }, { "docstring": ":type t: int :rtype: int", "name": "q", "signature": "def q(self, t)" } ]
2
stack_v2_sparse_classes_30k_train_002030
Implement the Python class `TopVotedCandidate` described below. Class description: Implement the TopVotedCandidate class. Method signatures and docstrings: - def __init__(self, persons, times): :type persons: List[int] :type times: List[int] - def q(self, t): :type t: int :rtype: int
Implement the Python class `TopVotedCandidate` described below. Class description: Implement the TopVotedCandidate class. Method signatures and docstrings: - def __init__(self, persons, times): :type persons: List[int] :type times: List[int] - def q(self, t): :type t: int :rtype: int <|skeleton|> class TopVotedCandi...
72d172ea25777980a49439042dbc39448fcad73d
<|skeleton|> class TopVotedCandidate: def __init__(self, persons, times): """:type persons: List[int] :type times: List[int]""" <|body_0|> def q(self, t): """:type t: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TopVotedCandidate: def __init__(self, persons, times): """:type persons: List[int] :type times: List[int]""" m = max(persons) + 1 self.v = [0] * m self.t = [] self.s = min(persons) max_c = 0 max_t = min(persons) for i in range(len(persons)): ...
the_stack_v2_python_sparse
src/leetcode/P911.py
stupidchen/leetcode
train
7
f13262169ff2b2ebb71dd80fd461a27bfaa49897
[ "self.network = network\nself.planes = planes\nself.preimages = preimages\nself.partially_computed = False\nself.transformed_planes = None\nself.computed = False\nself.classifications = None", "if self.partially_computed:\n return\nself.transformed_planes = self.network.transform_planes(self.planes, self.preim...
<|body_start_0|> self.network = network self.planes = planes self.preimages = preimages self.partially_computed = False self.transformed_planes = None self.computed = False self.classifications = None <|end_body_0|> <|body_start_1|> if self.partially_comp...
Handles classifying a set of planes using SyReNN.
PlanesClassifier
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PlanesClassifier: """Handles classifying a set of planes using SyReNN.""" def __init__(self, network, planes, preimages=True): """Creates a new PlanesClassifier for the given @network and @planes. @planes should be a list of Numpy arrays with each one representing a V-representation ...
stack_v2_sparse_classes_10k_train_008084
3,410
permissive
[ { "docstring": "Creates a new PlanesClassifier for the given @network and @planes. @planes should be a list of Numpy arrays with each one representing a V-representation polytope with (n_vertices, n_dims). If preimages=True is set, preimages of the endpoints of each classification region will be returned (other...
4
stack_v2_sparse_classes_30k_train_000820
Implement the Python class `PlanesClassifier` described below. Class description: Handles classifying a set of planes using SyReNN. Method signatures and docstrings: - def __init__(self, network, planes, preimages=True): Creates a new PlanesClassifier for the given @network and @planes. @planes should be a list of Nu...
Implement the Python class `PlanesClassifier` described below. Class description: Handles classifying a set of planes using SyReNN. Method signatures and docstrings: - def __init__(self, network, planes, preimages=True): Creates a new PlanesClassifier for the given @network and @planes. @planes should be a list of Nu...
19abf589e84ee67317134573054c648bb25c244d
<|skeleton|> class PlanesClassifier: """Handles classifying a set of planes using SyReNN.""" def __init__(self, network, planes, preimages=True): """Creates a new PlanesClassifier for the given @network and @planes. @planes should be a list of Numpy arrays with each one representing a V-representation ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PlanesClassifier: """Handles classifying a set of planes using SyReNN.""" def __init__(self, network, planes, preimages=True): """Creates a new PlanesClassifier for the given @network and @planes. @planes should be a list of Numpy arrays with each one representing a V-representation polytope with...
the_stack_v2_python_sparse
pysyrenn/helpers/classify_planes.py
95616ARG/SyReNN
train
38
fb804ebc23fc595a76f2a18d3ba4d87bc9b9b9fa
[ "AGG_LIST_SIZE = 50\nes_client = elasticsearch_factory.get_client()\nes_profile_search = {'query': {'bool': {'must': [{'term': {'author_id': profile_id}}]}}}\nes_search_result = es_client.search(index=settings.ES_RECOMMEND_USER, body=es_profile_search)\nagg_query_term = {}\nif len(es_search_result['hits']['hits']) ...
<|body_start_0|> AGG_LIST_SIZE = 50 es_client = elasticsearch_factory.get_client() es_profile_search = {'query': {'bool': {'must': [{'term': {'author_id': profile_id}}]}}} es_search_result = es_client.search(index=settings.ES_RECOMMEND_USER, body=es_profile_search) agg_query_term...
Elasticsearch User based recommendation engine Steps: - Perform aggregations on data to obtain recommendation list - Need to ensure that user apps and bookmarked apps are not in list - Output with query and put into recommendation table: See: https://github.com/aml-development/ozp-backend/wiki/Elasticsearch-Recommendat...
ElasticsearchUserBaseRecommender
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ElasticsearchUserBaseRecommender: """Elasticsearch User based recommendation engine Steps: - Perform aggregations on data to obtain recommendation list - Need to ensure that user apps and bookmarked apps are not in list - Output with query and put into recommendation table: See: https://github.co...
stack_v2_sparse_classes_10k_train_008085
31,247
permissive
[ { "docstring": "Recommendation Logic for Collaborative/User Based Recommendations: Recommendation logic - Take profile id passed in - Get User Profile information based on id - Get Categories, Bookmarks, Rated Apps (all and ones only greater than MIN_ES_RATING) - Compose Query to match profile of bookmarked and...
2
null
Implement the Python class `ElasticsearchUserBaseRecommender` described below. Class description: Elasticsearch User based recommendation engine Steps: - Perform aggregations on data to obtain recommendation list - Need to ensure that user apps and bookmarked apps are not in list - Output with query and put into recom...
Implement the Python class `ElasticsearchUserBaseRecommender` described below. Class description: Elasticsearch User based recommendation engine Steps: - Perform aggregations on data to obtain recommendation list - Need to ensure that user apps and bookmarked apps are not in list - Output with query and put into recom...
d31d00bb8a28a8d0c999813f616b398f41516244
<|skeleton|> class ElasticsearchUserBaseRecommender: """Elasticsearch User based recommendation engine Steps: - Perform aggregations on data to obtain recommendation list - Need to ensure that user apps and bookmarked apps are not in list - Output with query and put into recommendation table: See: https://github.co...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ElasticsearchUserBaseRecommender: """Elasticsearch User based recommendation engine Steps: - Perform aggregations on data to obtain recommendation list - Need to ensure that user apps and bookmarked apps are not in list - Output with query and put into recommendation table: See: https://github.com/aml-develop...
the_stack_v2_python_sparse
ozpcenter/recommend/recommend_es.py
ozoneplatform/ozp-backend
train
1
11af807d4c795e1dc52c10bc098ecc1c3c2b8c65
[ "if delta_r is None:\n delta_r = 0\nif offset is None:\n offset = Point(0, 0, 0)\nif angle is None:\n angle = 0\nif weld_params is None:\n weld_params = WeldingState()\nself.offset = offset\nself.delta_r = delta_r\nself.angle = angle\nself.welding_parameters = weld_params", "if not mod.offset.is_zero(...
<|body_start_0|> if delta_r is None: delta_r = 0 if offset is None: offset = Point(0, 0, 0) if angle is None: angle = 0 if weld_params is None: weld_params = WeldingState() self.offset = offset self.delta_r = delta_r ...
Modification
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Modification: def __init__(self, offset=None, delta_r=None, angle=None, weld_params=None): """Initalize a Modification object Arguments: object {Modification} -- self Keyword Arguments: offset {Point} -- offset (x,y,z) in meters (default: Point(0,0,0)) delta_r {float} -- delta r angle (d...
stack_v2_sparse_classes_10k_train_008086
2,560
permissive
[ { "docstring": "Initalize a Modification object Arguments: object {Modification} -- self Keyword Arguments: offset {Point} -- offset (x,y,z) in meters (default: Point(0,0,0)) delta_r {float} -- delta r angle (default: 0) angle {float} -- torch angle (default: 0) weld_params {WeldingState} -- welding parameters ...
2
stack_v2_sparse_classes_30k_test_000194
Implement the Python class `Modification` described below. Class description: Implement the Modification class. Method signatures and docstrings: - def __init__(self, offset=None, delta_r=None, angle=None, weld_params=None): Initalize a Modification object Arguments: object {Modification} -- self Keyword Arguments: o...
Implement the Python class `Modification` described below. Class description: Implement the Modification class. Method signatures and docstrings: - def __init__(self, offset=None, delta_r=None, angle=None, weld_params=None): Initalize a Modification object Arguments: object {Modification} -- self Keyword Arguments: o...
7c39e1e5a6e98fc6c8dfcae6abf033f5d961b16c
<|skeleton|> class Modification: def __init__(self, offset=None, delta_r=None, angle=None, weld_params=None): """Initalize a Modification object Arguments: object {Modification} -- self Keyword Arguments: offset {Point} -- offset (x,y,z) in meters (default: Point(0,0,0)) delta_r {float} -- delta r angle (d...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Modification: def __init__(self, offset=None, delta_r=None, angle=None, weld_params=None): """Initalize a Modification object Arguments: object {Modification} -- self Keyword Arguments: offset {Point} -- offset (x,y,z) in meters (default: Point(0,0,0)) delta_r {float} -- delta r angle (default: 0) ang...
the_stack_v2_python_sparse
src/rosweld/modification.py
HuaiLeiTang/rosweld_tools
train
0
324403c2c62528c8abb75599efdfa27c65cb4b32
[ "if not cls.objects.filter(user=user, external_id_type__name=type_name).exists():\n return False\nreturn True", "try:\n type_obj = ExternalIdType.objects.get(name=type_name)\nexcept ExternalIdType.DoesNotExist:\n LOGGER.info('External ID Creation failed for user {user}, no external id type of {type}'.for...
<|body_start_0|> if not cls.objects.filter(user=user, external_id_type__name=type_name).exists(): return False return True <|end_body_0|> <|body_start_1|> try: type_obj = ExternalIdType.objects.get(name=type_name) except ExternalIdType.DoesNotExist: L...
External ids are sent to systems or companies outside of Open edX. This allows us to limit the exposure of any given id. An external id is linked to an internal id, so that users may be re-identified if the external id is sent back to Open edX. .. no_pii: We store external_user_id here, but do not consider that PII und...
ExternalId
[ "AGPL-3.0-only", "AGPL-3.0-or-later", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ExternalId: """External ids are sent to systems or companies outside of Open edX. This allows us to limit the exposure of any given id. An external id is linked to an internal id, so that users may be re-identified if the external id is sent back to Open edX. .. no_pii: We store external_user_id ...
stack_v2_sparse_classes_10k_train_008087
5,662
permissive
[ { "docstring": "Checks if a user has an ExternalId of the type_name provided Arguments: user: User to search for type_name (str): Name of the type of ExternalId Returns: (Bool): True if the user already has an external ID, False otherwise.", "name": "user_has_external_id", "signature": "def user_has_ext...
3
stack_v2_sparse_classes_30k_train_001906
Implement the Python class `ExternalId` described below. Class description: External ids are sent to systems or companies outside of Open edX. This allows us to limit the exposure of any given id. An external id is linked to an internal id, so that users may be re-identified if the external id is sent back to Open edX...
Implement the Python class `ExternalId` described below. Class description: External ids are sent to systems or companies outside of Open edX. This allows us to limit the exposure of any given id. An external id is linked to an internal id, so that users may be re-identified if the external id is sent back to Open edX...
5809eaca7079a15ee56b0b7fcfea425337046c97
<|skeleton|> class ExternalId: """External ids are sent to systems or companies outside of Open edX. This allows us to limit the exposure of any given id. An external id is linked to an internal id, so that users may be re-identified if the external id is sent back to Open edX. .. no_pii: We store external_user_id ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ExternalId: """External ids are sent to systems or companies outside of Open edX. This allows us to limit the exposure of any given id. An external id is linked to an internal id, so that users may be re-identified if the external id is sent back to Open edX. .. no_pii: We store external_user_id here, but do ...
the_stack_v2_python_sparse
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/external_user_ids/models.py
luque/better-ways-of-thinking-about-software
train
3
2d3f210806d7d8e410e5754bd532370f6c94fc0c
[ "self.basedir = util.createdir(basedir)\nself.decoder = decoder if decoder is not None else default_decoder\nself.encoder = encoder if encoder is not None else DefaultEncoder", "filename = os.path.join(self.basedir, FILE(column_id, row_id))\nif os.path.exists(filename):\n with open(filename, 'r') as f:\n ...
<|body_start_0|> self.basedir = util.createdir(basedir) self.decoder = decoder if decoder is not None else default_decoder self.encoder = encoder if encoder is not None else DefaultEncoder <|end_body_0|> <|body_start_1|> filename = os.path.join(self.basedir, FILE(column_id, row_id)) ...
Metadata store that maintains annotations for a dataset snapshot in JSON files with a given base directory. The files that maintain annotations are named using the FileSystemMetadataStoreFactory resource identifier. The following are the file names of metadata files for different types of resources: - ds.json: Dataset ...
FileSystemMetadataStore
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileSystemMetadataStore: """Metadata store that maintains annotations for a dataset snapshot in JSON files with a given base directory. The files that maintain annotations are named using the FileSystemMetadataStoreFactory resource identifier. The following are the file names of metadata files fo...
stack_v2_sparse_classes_10k_train_008088
7,066
permissive
[ { "docstring": "Initialize the base directory and the optional JSON encoder and decoder. Parameters ---------- basedir: string Path to the base directory for all annotation files. The directory is created if it does not exist. encoder: json.JSONEncoder, default=None Encoder for JSON objects. decoder: callable: ...
3
stack_v2_sparse_classes_30k_train_004784
Implement the Python class `FileSystemMetadataStore` described below. Class description: Metadata store that maintains annotations for a dataset snapshot in JSON files with a given base directory. The files that maintain annotations are named using the FileSystemMetadataStoreFactory resource identifier. The following ...
Implement the Python class `FileSystemMetadataStore` described below. Class description: Metadata store that maintains annotations for a dataset snapshot in JSON files with a given base directory. The files that maintain annotations are named using the FileSystemMetadataStoreFactory resource identifier. The following ...
e3d0e04f90468c49f29ca53edc2feb12465c24d5
<|skeleton|> class FileSystemMetadataStore: """Metadata store that maintains annotations for a dataset snapshot in JSON files with a given base directory. The files that maintain annotations are named using the FileSystemMetadataStoreFactory resource identifier. The following are the file names of metadata files fo...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class FileSystemMetadataStore: """Metadata store that maintains annotations for a dataset snapshot in JSON files with a given base directory. The files that maintain annotations are named using the FileSystemMetadataStoreFactory resource identifier. The following are the file names of metadata files for different t...
the_stack_v2_python_sparse
openclean/data/metadata/fs.py
Denisfench/openclean-core
train
0
dd61656fd3c151a1e02beae894ea6e432780eaa2
[ "super(Bottleneck, self).__init__()\nself.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False, groups=args.num_groups)\nself.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, padding=1, bias=False, groups=args.num_groups)\nself.conv3 = nn.Conv2d(planes, planes * 4, kernel_size=1, bias=False,...
<|body_start_0|> super(Bottleneck, self).__init__() self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False, groups=args.num_groups) self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, padding=1, bias=False, groups=args.num_groups) self.conv3 = nn.Conv2d(plane...
A bottleneck block for Resnets. Used in Resnet-50, Resnet-101, and Resnet-152.
Bottleneck
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Bottleneck: """A bottleneck block for Resnets. Used in Resnet-50, Resnet-101, and Resnet-152.""" def __init__(self, args, inplanes, planes, stride=1, downsample=None): """Initializes the Bottleneck. Arguments: inplanes(int): The depth (number of channels) of the input. planes(int): T...
stack_v2_sparse_classes_10k_train_008089
2,091
permissive
[ { "docstring": "Initializes the Bottleneck. Arguments: inplanes(int): The depth (number of channels) of the input. planes(int): The number of filters to use in convolutions and therefore the depth (number of channels) of the output. stride(int): The stride to use in the convolutions. downsample(func): The downs...
2
stack_v2_sparse_classes_30k_train_006281
Implement the Python class `Bottleneck` described below. Class description: A bottleneck block for Resnets. Used in Resnet-50, Resnet-101, and Resnet-152. Method signatures and docstrings: - def __init__(self, args, inplanes, planes, stride=1, downsample=None): Initializes the Bottleneck. Arguments: inplanes(int): Th...
Implement the Python class `Bottleneck` described below. Class description: A bottleneck block for Resnets. Used in Resnet-50, Resnet-101, and Resnet-152. Method signatures and docstrings: - def __init__(self, args, inplanes, planes, stride=1, downsample=None): Initializes the Bottleneck. Arguments: inplanes(int): Th...
12bace8fd6ce9c5bb129fd0d30a46a00a2f7b054
<|skeleton|> class Bottleneck: """A bottleneck block for Resnets. Used in Resnet-50, Resnet-101, and Resnet-152.""" def __init__(self, args, inplanes, planes, stride=1, downsample=None): """Initializes the Bottleneck. Arguments: inplanes(int): The depth (number of channels) of the input. planes(int): T...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Bottleneck: """A bottleneck block for Resnets. Used in Resnet-50, Resnet-101, and Resnet-152.""" def __init__(self, args, inplanes, planes, stride=1, downsample=None): """Initializes the Bottleneck. Arguments: inplanes(int): The depth (number of channels) of the input. planes(int): The number of ...
the_stack_v2_python_sparse
onconet/models/blocks/bottleneck.py
yala/Mirai
train
66
601f92dec65beefe5d0cdc00b202c756c69ae660
[ "official_account = OfficialAccount.manager.add(level=OfficialAccount.LEVEL_3, name='name', email='email@email.com', original='original', wechat='wechat')\nrule = Rule.manager.add(official_account=official_account, name='rule test', reply_pattern=Rule.REPLY_PATTERN_ALL)\nkeyword = Keyword.manager.add(rule, keyword=...
<|body_start_0|> official_account = OfficialAccount.manager.add(level=OfficialAccount.LEVEL_3, name='name', email='email@email.com', original='original', wechat='wechat') rule = Rule.manager.add(official_account=official_account, name='rule test', reply_pattern=Rule.REPLY_PATTERN_ALL) keyword = ...
KeywordTest
[ "BSD-3-Clause", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KeywordTest: def test_add_keyword(self): """测试添加关键字""" <|body_0|> def test_keyword_search(self): """测试关键字搜索""" <|body_1|> <|end_skeleton|> <|body_start_0|> official_account = OfficialAccount.manager.add(level=OfficialAccount.LEVEL_3, name='name', em...
stack_v2_sparse_classes_10k_train_008090
4,271
permissive
[ { "docstring": "测试添加关键字", "name": "test_add_keyword", "signature": "def test_add_keyword(self)" }, { "docstring": "测试关键字搜索", "name": "test_keyword_search", "signature": "def test_keyword_search(self)" } ]
2
stack_v2_sparse_classes_30k_train_002928
Implement the Python class `KeywordTest` described below. Class description: Implement the KeywordTest class. Method signatures and docstrings: - def test_add_keyword(self): 测试添加关键字 - def test_keyword_search(self): 测试关键字搜索
Implement the Python class `KeywordTest` described below. Class description: Implement the KeywordTest class. Method signatures and docstrings: - def test_add_keyword(self): 测试添加关键字 - def test_keyword_search(self): 测试关键字搜索 <|skeleton|> class KeywordTest: def test_add_keyword(self): """测试添加关键字""" ...
37a6cd54584a2e1229c943c569daed7227d9f318
<|skeleton|> class KeywordTest: def test_add_keyword(self): """测试添加关键字""" <|body_0|> def test_keyword_search(self): """测试关键字搜索""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class KeywordTest: def test_add_keyword(self): """测试添加关键字""" official_account = OfficialAccount.manager.add(level=OfficialAccount.LEVEL_3, name='name', email='email@email.com', original='original', wechat='wechat') rule = Rule.manager.add(official_account=official_account, name='rule test', ...
the_stack_v2_python_sparse
wechat_platform/system/keyword/tests.py
qiyeboy/wechat-platform
train
1
fffed213ed11b43a5328b06caca1320208cf87be
[ "self.allowed_items = {}\nself.matches = {}\nself.allowed_items['Category'] = PartCategory.objects.all()\nself.matches['Category'] = ['name__contains']\nself.allowed_items['default_location'] = StockLocation.objects.all()\nself.matches['default_location'] = ['name__contains']\nself.allowed_items['default_supplier']...
<|body_start_0|> self.allowed_items = {} self.matches = {} self.allowed_items['Category'] = PartCategory.objects.all() self.matches['Category'] = ['name__contains'] self.allowed_items['default_location'] = StockLocation.objects.all() self.matches['default_location'] = ['n...
Part: Upload file, match to fields and import parts(using multi-Step form)
PartImport
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PartImport: """Part: Upload file, match to fields and import parts(using multi-Step form)""" def get_field_selection(self): """Fill the form fields for step 3.""" <|body_0|> def done(self, form_list, **kwargs): """Create items.""" <|body_1|> <|end_skelet...
stack_v2_sparse_classes_10k_train_008091
28,283
permissive
[ { "docstring": "Fill the form fields for step 3.", "name": "get_field_selection", "signature": "def get_field_selection(self)" }, { "docstring": "Create items.", "name": "done", "signature": "def done(self, form_list, **kwargs)" } ]
2
stack_v2_sparse_classes_30k_train_004337
Implement the Python class `PartImport` described below. Class description: Part: Upload file, match to fields and import parts(using multi-Step form) Method signatures and docstrings: - def get_field_selection(self): Fill the form fields for step 3. - def done(self, form_list, **kwargs): Create items.
Implement the Python class `PartImport` described below. Class description: Part: Upload file, match to fields and import parts(using multi-Step form) Method signatures and docstrings: - def get_field_selection(self): Fill the form fields for step 3. - def done(self, form_list, **kwargs): Create items. <|skeleton|> ...
5a08ef908dd5344b4433436a4679d122f7f99e41
<|skeleton|> class PartImport: """Part: Upload file, match to fields and import parts(using multi-Step form)""" def get_field_selection(self): """Fill the form fields for step 3.""" <|body_0|> def done(self, form_list, **kwargs): """Create items.""" <|body_1|> <|end_skelet...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PartImport: """Part: Upload file, match to fields and import parts(using multi-Step form)""" def get_field_selection(self): """Fill the form fields for step 3.""" self.allowed_items = {} self.matches = {} self.allowed_items['Category'] = PartCategory.objects.all() ...
the_stack_v2_python_sparse
InvenTree/part/views.py
onurtatli/InvenTree
train
0
2a5f15a9846f30d15ab904103118b4c1aaa34bb8
[ "vocab_size = 100\nsequence_length = 512\ntest_network = networks.BertEncoder(vocab_size=vocab_size, num_layers=2, hidden_size=hidden_size, sequence_length=sequence_length, dict_outputs=True)\ndual_encoder_model = dual_encoder.DualEncoder(test_network, max_seq_length=sequence_length, output=output)\nleft_word_ids =...
<|body_start_0|> vocab_size = 100 sequence_length = 512 test_network = networks.BertEncoder(vocab_size=vocab_size, num_layers=2, hidden_size=hidden_size, sequence_length=sequence_length, dict_outputs=True) dual_encoder_model = dual_encoder.DualEncoder(test_network, max_seq_length=sequenc...
DualEncoderTest
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DualEncoderTest: def test_dual_encoder(self, hidden_size, output): """Validate that the Keras object can be created.""" <|body_0|> def test_dual_encoder_tensor_call(self, hidden_size, output): """Validate that the Keras object can be invoked.""" <|body_1|> ...
stack_v2_sparse_classes_10k_train_008092
5,709
permissive
[ { "docstring": "Validate that the Keras object can be created.", "name": "test_dual_encoder", "signature": "def test_dual_encoder(self, hidden_size, output)" }, { "docstring": "Validate that the Keras object can be invoked.", "name": "test_dual_encoder_tensor_call", "signature": "def tes...
3
stack_v2_sparse_classes_30k_train_003864
Implement the Python class `DualEncoderTest` described below. Class description: Implement the DualEncoderTest class. Method signatures and docstrings: - def test_dual_encoder(self, hidden_size, output): Validate that the Keras object can be created. - def test_dual_encoder_tensor_call(self, hidden_size, output): Val...
Implement the Python class `DualEncoderTest` described below. Class description: Implement the DualEncoderTest class. Method signatures and docstrings: - def test_dual_encoder(self, hidden_size, output): Validate that the Keras object can be created. - def test_dual_encoder_tensor_call(self, hidden_size, output): Val...
6fc53292b1d3ce3c0340ce724c2c11c77e663d27
<|skeleton|> class DualEncoderTest: def test_dual_encoder(self, hidden_size, output): """Validate that the Keras object can be created.""" <|body_0|> def test_dual_encoder_tensor_call(self, hidden_size, output): """Validate that the Keras object can be invoked.""" <|body_1|> ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class DualEncoderTest: def test_dual_encoder(self, hidden_size, output): """Validate that the Keras object can be created.""" vocab_size = 100 sequence_length = 512 test_network = networks.BertEncoder(vocab_size=vocab_size, num_layers=2, hidden_size=hidden_size, sequence_length=seque...
the_stack_v2_python_sparse
models/official/nlp/modeling/models/dual_encoder_test.py
aboerzel/German_License_Plate_Recognition
train
34
bd4e9bd5fa99ae3f31eeb99e60615c067f8daf18
[ "self._dt_fmt = dt_fmt\nself._data_header = data_header\nself._footer_header = footer_header\nself._columns = columns\nself._sep = sep\nself._nr_cols = 3\nself._current_line = None", "self._current_line = 0\nwith open(file_name, 'r', encoding=encoding) as agt_file:\n self._parse_meta_data(agt_file)\n df = s...
<|body_start_0|> self._dt_fmt = dt_fmt self._data_header = data_header self._footer_header = footer_header self._columns = columns self._sep = sep self._nr_cols = 3 self._current_line = None <|end_body_0|> <|body_start_1|> self._current_line = 0 w...
Parser for agt files that contain sensor data, i.e., timestamps, temerature, and pressure. These files also contain meta-inforamtion that is ignored.
AgtParser
[ "CC-BY-4.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AgtParser: """Parser for agt files that contain sensor data, i.e., timestamps, temerature, and pressure. These files also contain meta-inforamtion that is ignored.""" def __init__(self, dt_fmt='%Y/%m/%d %H:%M:%S', sep=';', data_header='[Data]', footer_header='END OF DATA', columns=('pressure...
stack_v2_sparse_classes_10k_train_008093
6,235
permissive
[ { "docstring": "Constructor for a new parser, optionally specify a timestamp format.", "name": "__init__", "signature": "def __init__(self, dt_fmt='%Y/%m/%d %H:%M:%S', sep=';', data_header='[Data]', footer_header='END OF DATA', columns=('pressure', 'temperature'))" }, { "docstring": "parse the f...
6
null
Implement the Python class `AgtParser` described below. Class description: Parser for agt files that contain sensor data, i.e., timestamps, temerature, and pressure. These files also contain meta-inforamtion that is ignored. Method signatures and docstrings: - def __init__(self, dt_fmt='%Y/%m/%d %H:%M:%S', sep=';', d...
Implement the Python class `AgtParser` described below. Class description: Parser for agt files that contain sensor data, i.e., timestamps, temerature, and pressure. These files also contain meta-inforamtion that is ignored. Method signatures and docstrings: - def __init__(self, dt_fmt='%Y/%m/%d %H:%M:%S', sep=';', d...
e748466a2af9f3388a8b0ed091aa061dbfc752d6
<|skeleton|> class AgtParser: """Parser for agt files that contain sensor data, i.e., timestamps, temerature, and pressure. These files also contain meta-inforamtion that is ignored.""" def __init__(self, dt_fmt='%Y/%m/%d %H:%M:%S', sep=';', data_header='[Data]', footer_header='END OF DATA', columns=('pressure...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AgtParser: """Parser for agt files that contain sensor data, i.e., timestamps, temerature, and pressure. These files also contain meta-inforamtion that is ignored.""" def __init__(self, dt_fmt='%Y/%m/%d %H:%M:%S', sep=';', data_header='[Data]', footer_header='END OF DATA', columns=('pressure', 'temperatu...
the_stack_v2_python_sparse
Python/DataFormats/agt_parser.py
gjbex/training-material
train
130
a83cd5f7267b566e3b482e1ab6acec71a54a0d8c
[ "data = parse(filename)\ntotal = 0\nfor equation in data:\n total += p1_eval(equation)\nreturn total", "data = parse(filename)\ntotal = 0\nfor equation in data:\n total += p2_eval(equation)\nreturn total" ]
<|body_start_0|> data = parse(filename) total = 0 for equation in data: total += p1_eval(equation) return total <|end_body_0|> <|body_start_1|> data = parse(filename) total = 0 for equation in data: total += p2_eval(equation) retur...
AoC 2020 Day 18
Day18
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Day18: """AoC 2020 Day 18""" def part1(filename: str) -> int: """Given a filename, solve 2020 day 18 part 1""" <|body_0|> def part2(filename: str) -> int: """Given a filename, solve 2020 day 18 part 2""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_10k_train_008094
3,361
no_license
[ { "docstring": "Given a filename, solve 2020 day 18 part 1", "name": "part1", "signature": "def part1(filename: str) -> int" }, { "docstring": "Given a filename, solve 2020 day 18 part 2", "name": "part2", "signature": "def part2(filename: str) -> int" } ]
2
stack_v2_sparse_classes_30k_train_000479
Implement the Python class `Day18` described below. Class description: AoC 2020 Day 18 Method signatures and docstrings: - def part1(filename: str) -> int: Given a filename, solve 2020 day 18 part 1 - def part2(filename: str) -> int: Given a filename, solve 2020 day 18 part 2
Implement the Python class `Day18` described below. Class description: AoC 2020 Day 18 Method signatures and docstrings: - def part1(filename: str) -> int: Given a filename, solve 2020 day 18 part 1 - def part2(filename: str) -> int: Given a filename, solve 2020 day 18 part 2 <|skeleton|> class Day18: """AoC 202...
e89db235837d2d05848210a18c9c2a4456085570
<|skeleton|> class Day18: """AoC 2020 Day 18""" def part1(filename: str) -> int: """Given a filename, solve 2020 day 18 part 1""" <|body_0|> def part2(filename: str) -> int: """Given a filename, solve 2020 day 18 part 2""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Day18: """AoC 2020 Day 18""" def part1(filename: str) -> int: """Given a filename, solve 2020 day 18 part 1""" data = parse(filename) total = 0 for equation in data: total += p1_eval(equation) return total def part2(filename: str) -> int: "...
the_stack_v2_python_sparse
2020/python2020/aoc/day18.py
mreishus/aoc
train
16
f4d8b32220926433d2d1a23a2e1371ff284c648b
[ "super(ClassificationModelWrapper, self).__init__()\nself.model: SwinTransformerV2 = model\nself.pooling: nn.Module = nn.AdaptiveAvgPool2d(1)\nself.classification_head: nn.Module = nn.Linear(in_features=output_channels, out_features=number_of_classes)", "features: List[torch.Tensor] = self.model(input)\nclassific...
<|body_start_0|> super(ClassificationModelWrapper, self).__init__() self.model: SwinTransformerV2 = model self.pooling: nn.Module = nn.AdaptiveAvgPool2d(1) self.classification_head: nn.Module = nn.Linear(in_features=output_channels, out_features=number_of_classes) <|end_body_0|> <|body_...
Wraps a Swin Transformer V2 model to perform image classification.
ClassificationModelWrapper
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClassificationModelWrapper: """Wraps a Swin Transformer V2 model to perform image classification.""" def __init__(self, model: SwinTransformerV2, number_of_classes: int=10, output_channels: int=768) -> None: """Constructor method :param model: (SwinTransformerV2) Swin Transformer V2 ...
stack_v2_sparse_classes_10k_train_008095
41,159
no_license
[ { "docstring": "Constructor method :param model: (SwinTransformerV2) Swin Transformer V2 model :param number_of_classes: (int) Number of classes to predict :param output_channels: (int) Output channels of the last feature map of the Swin Transformer V2 model", "name": "__init__", "signature": "def __ini...
2
stack_v2_sparse_classes_30k_train_002301
Implement the Python class `ClassificationModelWrapper` described below. Class description: Wraps a Swin Transformer V2 model to perform image classification. Method signatures and docstrings: - def __init__(self, model: SwinTransformerV2, number_of_classes: int=10, output_channels: int=768) -> None: Constructor meth...
Implement the Python class `ClassificationModelWrapper` described below. Class description: Wraps a Swin Transformer V2 model to perform image classification. Method signatures and docstrings: - def __init__(self, model: SwinTransformerV2, number_of_classes: int=10, output_channels: int=768) -> None: Constructor meth...
7e55a422588c1d1e00f35a3d3a3ff896cce59e18
<|skeleton|> class ClassificationModelWrapper: """Wraps a Swin Transformer V2 model to perform image classification.""" def __init__(self, model: SwinTransformerV2, number_of_classes: int=10, output_channels: int=768) -> None: """Constructor method :param model: (SwinTransformerV2) Swin Transformer V2 ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ClassificationModelWrapper: """Wraps a Swin Transformer V2 model to perform image classification.""" def __init__(self, model: SwinTransformerV2, number_of_classes: int=10, output_channels: int=768) -> None: """Constructor method :param model: (SwinTransformerV2) Swin Transformer V2 model :param ...
the_stack_v2_python_sparse
generated/test_ChristophReich1996_Swin_Transformer_V2.py
jansel/pytorch-jit-paritybench
train
35
919f38b4ae8c468d533312f6e7077cc19dc6fa1b
[ "try:\n state = self.add_model_schema.load(request.json)\n key = CreateDashboardPermalinkCommand(dashboard_id=pk, state=state).run()\n http_origin = request.headers.environ.get('HTTP_ORIGIN')\n url = f'{http_origin}/superset/dashboard/p/{key}/'\n return self.response(201, key=key, url=url)\nexcept (V...
<|body_start_0|> try: state = self.add_model_schema.load(request.json) key = CreateDashboardPermalinkCommand(dashboard_id=pk, state=state).run() http_origin = request.headers.environ.get('HTTP_ORIGIN') url = f'{http_origin}/superset/dashboard/p/{key}/' ...
DashboardPermalinkRestApi
[ "Apache-2.0", "OFL-1.1" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DashboardPermalinkRestApi: def post(self, pk: str) -> Response: """Stores a new permanent link. --- post: description: >- Stores a new permanent link. parameters: - in: path schema: type: string name: pk requestBody: required: true content: application/json: schema: $ref: '#/components/s...
stack_v2_sparse_classes_10k_train_008096
6,224
permissive
[ { "docstring": "Stores a new permanent link. --- post: description: >- Stores a new permanent link. parameters: - in: path schema: type: string name: pk requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DashboardPermalinkPostSchema' responses: 201: description: The perma...
2
stack_v2_sparse_classes_30k_train_006377
Implement the Python class `DashboardPermalinkRestApi` described below. Class description: Implement the DashboardPermalinkRestApi class. Method signatures and docstrings: - def post(self, pk: str) -> Response: Stores a new permanent link. --- post: description: >- Stores a new permanent link. parameters: - in: path ...
Implement the Python class `DashboardPermalinkRestApi` described below. Class description: Implement the DashboardPermalinkRestApi class. Method signatures and docstrings: - def post(self, pk: str) -> Response: Stores a new permanent link. --- post: description: >- Stores a new permanent link. parameters: - in: path ...
0945d4a2f46667aebb9b93d0d7685215627ad237
<|skeleton|> class DashboardPermalinkRestApi: def post(self, pk: str) -> Response: """Stores a new permanent link. --- post: description: >- Stores a new permanent link. parameters: - in: path schema: type: string name: pk requestBody: required: true content: application/json: schema: $ref: '#/components/s...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class DashboardPermalinkRestApi: def post(self, pk: str) -> Response: """Stores a new permanent link. --- post: description: >- Stores a new permanent link. parameters: - in: path schema: type: string name: pk requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Dashboa...
the_stack_v2_python_sparse
superset/dashboards/permalink/api.py
apache-superset/incubator-superset
train
21
b7fb5916f850092f066f97069ca3f8650d7dae24
[ "self.locale = locale\nself.participant = participant\nself.utterancetierTypes = utterancetierTypes\nself.wordtierTypes = wordtierTypes\nself.postierTypes = postierTypes\nself.morphemetierTypes = None\nself.glosstierTypes = None\nself.translationtierTypes = translationtierTypes\nself.interlineartype = POS\nself.ann...
<|body_start_0|> self.locale = locale self.participant = participant self.utterancetierTypes = utterancetierTypes self.wordtierTypes = wordtierTypes self.postierTypes = postierTypes self.morphemetierTypes = None self.glosstierTypes = None self.translationt...
The class EafPosCorpusReader implements a part of the corpus reader API described in the Natual Language Toolkit (NLTK). The class reads in all the .eaf files (from the linguistics annotation software called Elan) in a given directory and makes this data accessible through several functions. The data contains "tags", w...
PosCorpusReader
[ "CC-BY-3.0", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PosCorpusReader: """The class EafPosCorpusReader implements a part of the corpus reader API described in the Natual Language Toolkit (NLTK). The class reads in all the .eaf files (from the linguistics annotation software called Elan) in a given directory and makes this data accessible through sev...
stack_v2_sparse_classes_10k_train_008097
20,569
permissive
[ { "docstring": "root: is the directory where your .eaf files are stored. Only the files in the given directory are read, there is no recursive reading right now. This parameter is obligatory. files: a regular expression for the filenames to read. The default value is \"*.eaf\" locale: restricts the corpus data ...
4
stack_v2_sparse_classes_30k_train_006641
Implement the Python class `PosCorpusReader` described below. Class description: The class EafPosCorpusReader implements a part of the corpus reader API described in the Natual Language Toolkit (NLTK). The class reads in all the .eaf files (from the linguistics annotation software called Elan) in a given directory and...
Implement the Python class `PosCorpusReader` described below. Class description: The class EafPosCorpusReader implements a part of the corpus reader API described in the Natual Language Toolkit (NLTK). The class reads in all the .eaf files (from the linguistics annotation software called Elan) in a given directory and...
ac2bed9b6e759033d17b6ed9e8fa1e79dad68ae6
<|skeleton|> class PosCorpusReader: """The class EafPosCorpusReader implements a part of the corpus reader API described in the Natual Language Toolkit (NLTK). The class reads in all the .eaf files (from the linguistics annotation software called Elan) in a given directory and makes this data accessible through sev...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class PosCorpusReader: """The class EafPosCorpusReader implements a part of the corpus reader API described in the Natual Language Toolkit (NLTK). The class reads in all the .eaf files (from the linguistics annotation software called Elan) in a given directory and makes this data accessible through several function...
the_stack_v2_python_sparse
src/poioapi/corpusreader.py
IgorBMSTU/poio-api
train
0
8df1f5685a66075b63f50c260dcaf7e6c866f776
[ "self.types = {}\nwith open('resources/types.txt') as file:\n for line in file:\n if not line.startswith('#'):\n tokens = line.split('\\t')\n self.types[tokens[0]] = tokens[1].strip()", "clausetypes = {'p': 'dcl', 's': 'dcl', 'f': 'dcl', 'r': 'rel', 'd': 'dep'}\nclausetype = clause...
<|body_start_0|> self.types = {} with open('resources/types.txt') as file: for line in file: if not line.startswith('#'): tokens = line.split('\t') self.types[tokens[0]] = tokens[1].strip() <|end_body_0|> <|body_start_1|> claus...
Adds CCG features
CCGTyper
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CCGTyper: """Adds CCG features""" def __init__(self): """Adds CCG features""" <|body_0|> def type_verb(self, surface, pos, tag): """Adds CCG features""" <|body_1|> def type(self, surface, pos, tag): """Retypes it as a verb if it's a verb, cop...
stack_v2_sparse_classes_10k_train_008098
24,263
no_license
[ { "docstring": "Adds CCG features", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Adds CCG features", "name": "type_verb", "signature": "def type_verb(self, surface, pos, tag)" }, { "docstring": "Retypes it as a verb if it's a verb, copula or verbal nou...
3
stack_v2_sparse_classes_30k_train_007338
Implement the Python class `CCGTyper` described below. Class description: Adds CCG features Method signatures and docstrings: - def __init__(self): Adds CCG features - def type_verb(self, surface, pos, tag): Adds CCG features - def type(self, surface, pos, tag): Retypes it as a verb if it's a verb, copula or verbal n...
Implement the Python class `CCGTyper` described below. Class description: Adds CCG features Method signatures and docstrings: - def __init__(self): Adds CCG features - def type_verb(self, surface, pos, tag): Adds CCG features - def type(self, surface, pos, tag): Retypes it as a verb if it's a verb, copula or verbal n...
0f6e943c2bf639f2bdad278145f6fa25502a02df
<|skeleton|> class CCGTyper: """Adds CCG features""" def __init__(self): """Adds CCG features""" <|body_0|> def type_verb(self, surface, pos, tag): """Adds CCG features""" <|body_1|> def type(self, surface, pos, tag): """Retypes it as a verb if it's a verb, cop...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class CCGTyper: """Adds CCG features""" def __init__(self): """Adds CCG features""" self.types = {} with open('resources/types.txt') as file: for line in file: if not line.startswith('#'): tokens = line.split('\t') self...
the_stack_v2_python_sparse
innealan/acainn.py
colinbatchelor/gdbank
train
4
b21620639463b2e4632c167fabfe9d5edc10f3c7
[ "nums.sort()\nidx = 1\nwhile idx < len(nums):\n if nums[idx] != nums[idx - 1]:\n return nums[idx - 1]\n else:\n idx += 2\nelse:\n return nums[-1]", "sumof = 0\ni = 0\nwhile i < len(nums):\n sumof = sumof ^ nums[i]\n print(sumof)\n i = i + 1\nreturn sumof" ]
<|body_start_0|> nums.sort() idx = 1 while idx < len(nums): if nums[idx] != nums[idx - 1]: return nums[idx - 1] else: idx += 2 else: return nums[-1] <|end_body_0|> <|body_start_1|> sumof = 0 i = 0 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def singleNumber(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def _singleNumber(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> nums.sort() idx = 1 while ...
stack_v2_sparse_classes_10k_train_008099
1,064
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "singleNumber", "signature": "def singleNumber(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "_singleNumber", "signature": "def _singleNumber(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_000240
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def singleNumber(self, nums): :type nums: List[int] :rtype: int - def _singleNumber(self, nums): :type nums: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def singleNumber(self, nums): :type nums: List[int] :rtype: int - def _singleNumber(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: def singleNu...
3e72dcaa579f4ae6f587898dd316fce8189b3d6a
<|skeleton|> class Solution: def singleNumber(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def _singleNumber(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def singleNumber(self, nums): """:type nums: List[int] :rtype: int""" nums.sort() idx = 1 while idx < len(nums): if nums[idx] != nums[idx - 1]: return nums[idx - 1] else: idx += 2 else: return...
the_stack_v2_python_sparse
problems100_200/136_Single_Number.py
Provinm/leetcode_archive
train
0