blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
6.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
438
7.52k
id
stringlengths
40
40
length_bytes
int64
506
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.25k
prompted_full_text
stringlengths
645
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.34k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
302
7.33k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
2b51311d07af84be25efbf7608db02b427566682
[ "mocked_input_list = (n for n in command_list)\nprint_argument = 'Spam & Eggs'\n\ndef mocked_input(*_):\n return next(mocked_input_list)\nmocker.patch.object(mailroom, 'input', new=mocked_input)\nmocked_print = mocker.patch.object(mailroom, 'print')\nmocked_thank_you = mocker.patch.object(mailroom, 'thank_you', ...
<|body_start_0|> mocked_input_list = (n for n in command_list) print_argument = 'Spam & Eggs' def mocked_input(*_): return next(mocked_input_list) mocker.patch.object(mailroom, 'input', new=mocked_input) mocked_print = mocker.patch.object(mailroom, 'print') m...
Tests the mailroom.thank_you_cli function. Ensures that the user selection loop runs as expected __builtins__.input() is mocked to simulate user-interaction __builtins__.print() is mocked to simulate user-interaction
Test_Thank_You_CLI
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test_Thank_You_CLI: """Tests the mailroom.thank_you_cli function. Ensures that the user selection loop runs as expected __builtins__.input() is mocked to simulate user-interaction __builtins__.print() is mocked to simulate user-interaction""" def test_thank_you_cli_name_number(self, mocker, ...
stack_v2_sparse_classes_36k_train_017200
17,359
no_license
[ { "docstring": "Positive-Test-Cases", "name": "test_thank_you_cli_name_number", "signature": "def test_thank_you_cli_name_number(self, mocker, command_list)" }, { "docstring": "Positive-Test-Cases", "name": "test_thank_you_cli_list_quit", "signature": "def test_thank_you_cli_list_quit(se...
3
stack_v2_sparse_classes_30k_train_002408
Implement the Python class `Test_Thank_You_CLI` described below. Class description: Tests the mailroom.thank_you_cli function. Ensures that the user selection loop runs as expected __builtins__.input() is mocked to simulate user-interaction __builtins__.print() is mocked to simulate user-interaction Method signatures...
Implement the Python class `Test_Thank_You_CLI` described below. Class description: Tests the mailroom.thank_you_cli function. Ensures that the user selection loop runs as expected __builtins__.input() is mocked to simulate user-interaction __builtins__.print() is mocked to simulate user-interaction Method signatures...
76224d0fb871d0bf0b838f3fccf01022edd70f82
<|skeleton|> class Test_Thank_You_CLI: """Tests the mailroom.thank_you_cli function. Ensures that the user selection loop runs as expected __builtins__.input() is mocked to simulate user-interaction __builtins__.print() is mocked to simulate user-interaction""" def test_thank_you_cli_name_number(self, mocker, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Test_Thank_You_CLI: """Tests the mailroom.thank_you_cli function. Ensures that the user selection loop runs as expected __builtins__.input() is mocked to simulate user-interaction __builtins__.print() is mocked to simulate user-interaction""" def test_thank_you_cli_name_number(self, mocker, command_list)...
the_stack_v2_python_sparse
students/jerickson/Lesson6/test_mailroom.py
UWPCE-PythonCert-ClassRepos/SP_Online_PY210
train
19
f8ad6c24c48aae7aebae08dad359a7d659ac3098
[ "def fillST(st, cur, nums, start, end):\n if start == end:\n st[cur] = nums[start]\n return st[cur]\n mid = start + (end - start) // 2\n left = fillST(st, 2 * cur, nums, start, mid)\n right = fillST(st, 2 * cur + 1, nums, mid + 1, end)\n st[cur] = left + right\n return st[cur]\nself....
<|body_start_0|> def fillST(st, cur, nums, start, end): if start == end: st[cur] = nums[start] return st[cur] mid = start + (end - start) // 2 left = fillST(st, 2 * cur, nums, start, mid) right = fillST(st, 2 * cur + 1, nums, mid + ...
Thoughts: 1. Segment tree
NumArray
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumArray: """Thoughts: 1. Segment tree""" def __init__(self, nums): """:type nums: List[int]""" <|body_0|> def update(self, i, val): """:type i: int :type val: int :rtype: void""" <|body_1|> def sumRange(self, i, j): """:type i: int :type j: ...
stack_v2_sparse_classes_36k_train_017201
4,469
no_license
[ { "docstring": ":type nums: List[int]", "name": "__init__", "signature": "def __init__(self, nums)" }, { "docstring": ":type i: int :type val: int :rtype: void", "name": "update", "signature": "def update(self, i, val)" }, { "docstring": ":type i: int :type j: int :rtype: int", ...
3
null
Implement the Python class `NumArray` described below. Class description: Thoughts: 1. Segment tree Method signatures and docstrings: - def __init__(self, nums): :type nums: List[int] - def update(self, i, val): :type i: int :type val: int :rtype: void - def sumRange(self, i, j): :type i: int :type j: int :rtype: int
Implement the Python class `NumArray` described below. Class description: Thoughts: 1. Segment tree Method signatures and docstrings: - def __init__(self, nums): :type nums: List[int] - def update(self, i, val): :type i: int :type val: int :rtype: void - def sumRange(self, i, j): :type i: int :type j: int :rtype: int...
9190d3d178f1733aa226973757ee7e045b7bab00
<|skeleton|> class NumArray: """Thoughts: 1. Segment tree""" def __init__(self, nums): """:type nums: List[int]""" <|body_0|> def update(self, i, val): """:type i: int :type val: int :rtype: void""" <|body_1|> def sumRange(self, i, j): """:type i: int :type j: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NumArray: """Thoughts: 1. Segment tree""" def __init__(self, nums): """:type nums: List[int]""" def fillST(st, cur, nums, start, end): if start == end: st[cur] = nums[start] return st[cur] mid = start + (end - start) // 2 ...
the_stack_v2_python_sparse
RangeSumQuery-Mutable.py
ellinx/LC-python
train
1
7740d476d7cc1b61a9786784769380751a38135c
[ "try:\n uuid.UUID(self.kwargs['pk'])\nexcept ValueError:\n lookup_filter = 'code__iexact'\nelse:\n lookup_filter = 'pk'\nreturn lookup_filter", "queryset = self.filter_queryset(self.get_queryset())\nobj = get_object_or_404(queryset, **{self.lookup_filter: self.kwargs['pk']})\nself.check_object_permission...
<|body_start_0|> try: uuid.UUID(self.kwargs['pk']) except ValueError: lookup_filter = 'code__iexact' else: lookup_filter = 'pk' return lookup_filter <|end_body_0|> <|body_start_1|> queryset = self.filter_queryset(self.get_queryset()) o...
API ViewSet for all interactions with courses. GET /api/courses/ Return list of all courses related to the logged-in user. GET /api/courses/:<course_id|course_code> Return one course if an id is provided. GET /api/courses/:<course_id|course_code>/wish Return wish status on this course for the authenticated user POST /a...
CourseViewSet
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CourseViewSet: """API ViewSet for all interactions with courses. GET /api/courses/ Return list of all courses related to the logged-in user. GET /api/courses/:<course_id|course_code> Return one course if an id is provided. GET /api/courses/:<course_id|course_code>/wish Return wish status on this ...
stack_v2_sparse_classes_36k_train_017202
30,756
permissive
[ { "docstring": "Return the filter field to use to get the course object.", "name": "lookup_filter", "signature": "def lookup_filter(self)" }, { "docstring": "Allow getting a course by its pk or by its code.", "name": "get_object", "signature": "def get_object(self)" }, { "docstri...
4
stack_v2_sparse_classes_30k_train_018277
Implement the Python class `CourseViewSet` described below. Class description: API ViewSet for all interactions with courses. GET /api/courses/ Return list of all courses related to the logged-in user. GET /api/courses/:<course_id|course_code> Return one course if an id is provided. GET /api/courses/:<course_id|course...
Implement the Python class `CourseViewSet` described below. Class description: API ViewSet for all interactions with courses. GET /api/courses/ Return list of all courses related to the logged-in user. GET /api/courses/:<course_id|course_code> Return one course if an id is provided. GET /api/courses/:<course_id|course...
6571a67d020715358fec807a1137f89bdf4b305a
<|skeleton|> class CourseViewSet: """API ViewSet for all interactions with courses. GET /api/courses/ Return list of all courses related to the logged-in user. GET /api/courses/:<course_id|course_code> Return one course if an id is provided. GET /api/courses/:<course_id|course_code>/wish Return wish status on this ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CourseViewSet: """API ViewSet for all interactions with courses. GET /api/courses/ Return list of all courses related to the logged-in user. GET /api/courses/:<course_id|course_code> Return one course if an id is provided. GET /api/courses/:<course_id|course_code>/wish Return wish status on this course for th...
the_stack_v2_python_sparse
src/backend/joanie/core/api/client.py
openfun/joanie
train
13
fe9e101556bb16400f61533c4c1913d2aac1bf75
[ "await self.async_set_unique_id(config[CONF_USERNAME].lower())\nself._abort_if_unique_id_configured()\neight = EightSleep(config[CONF_USERNAME], config[CONF_PASSWORD], self.hass.config.time_zone, client_session=async_get_clientsession(self.hass))\ntry:\n await eight.fetch_token()\nexcept RequestError as err:\n ...
<|body_start_0|> await self.async_set_unique_id(config[CONF_USERNAME].lower()) self._abort_if_unique_id_configured() eight = EightSleep(config[CONF_USERNAME], config[CONF_PASSWORD], self.hass.config.time_zone, client_session=async_get_clientsession(self.hass)) try: await eigh...
Handle a config flow for Eight Sleep.
ConfigFlow
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConfigFlow: """Handle a config flow for Eight Sleep.""" async def _validate_data(self, config: dict[str, str]) -> str | None: """Validate input data and return any error.""" <|body_0|> async def async_step_user(self, user_input: dict[str, Any] | None=None) -> FlowResult:...
stack_v2_sparse_classes_36k_train_017203
2,878
permissive
[ { "docstring": "Validate input data and return any error.", "name": "_validate_data", "signature": "async def _validate_data(self, config: dict[str, str]) -> str | None" }, { "docstring": "Handle the initial step.", "name": "async_step_user", "signature": "async def async_step_user(self,...
3
null
Implement the Python class `ConfigFlow` described below. Class description: Handle a config flow for Eight Sleep. Method signatures and docstrings: - async def _validate_data(self, config: dict[str, str]) -> str | None: Validate input data and return any error. - async def async_step_user(self, user_input: dict[str, ...
Implement the Python class `ConfigFlow` described below. Class description: Handle a config flow for Eight Sleep. Method signatures and docstrings: - async def _validate_data(self, config: dict[str, str]) -> str | None: Validate input data and return any error. - async def async_step_user(self, user_input: dict[str, ...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class ConfigFlow: """Handle a config flow for Eight Sleep.""" async def _validate_data(self, config: dict[str, str]) -> str | None: """Validate input data and return any error.""" <|body_0|> async def async_step_user(self, user_input: dict[str, Any] | None=None) -> FlowResult:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ConfigFlow: """Handle a config flow for Eight Sleep.""" async def _validate_data(self, config: dict[str, str]) -> str | None: """Validate input data and return any error.""" await self.async_set_unique_id(config[CONF_USERNAME].lower()) self._abort_if_unique_id_configured() ...
the_stack_v2_python_sparse
homeassistant/components/eight_sleep/config_flow.py
home-assistant/core
train
35,501
d9c70e5bb00ef9ed10b2d616d4348538a659704b
[ "self.x = start_pos[0]\nself.y = start_pos[1]\nself.direction = start_pos[2]\nself.max_x = width\nself.max_y = height\nself.instructions = instructions", "for inst in self.instructions:\n compass_idx = const.COMPASS.index(self.direction)\n if inst == 'L':\n if compass_idx - 1 < 0:\n compas...
<|body_start_0|> self.x = start_pos[0] self.y = start_pos[1] self.direction = start_pos[2] self.max_x = width self.max_y = height self.instructions = instructions <|end_body_0|> <|body_start_1|> for inst in self.instructions: compass_idx = const.COMPA...
Rover
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Rover: def __init__(self, start_pos, instructions, height, width): """:param start_pos: rover's starting position :param instructions: instructions being executed :param height: maximum grid height :param width: maximum grid width""" <|body_0|> def move_rover(self): ...
stack_v2_sparse_classes_36k_train_017204
3,091
no_license
[ { "docstring": ":param start_pos: rover's starting position :param instructions: instructions being executed :param height: maximum grid height :param width: maximum grid width", "name": "__init__", "signature": "def __init__(self, start_pos, instructions, height, width)" }, { "docstring": ":ret...
3
null
Implement the Python class `Rover` described below. Class description: Implement the Rover class. Method signatures and docstrings: - def __init__(self, start_pos, instructions, height, width): :param start_pos: rover's starting position :param instructions: instructions being executed :param height: maximum grid hei...
Implement the Python class `Rover` described below. Class description: Implement the Rover class. Method signatures and docstrings: - def __init__(self, start_pos, instructions, height, width): :param start_pos: rover's starting position :param instructions: instructions being executed :param height: maximum grid hei...
548f6cb5038e927b54adca29caf02c981fdcecfc
<|skeleton|> class Rover: def __init__(self, start_pos, instructions, height, width): """:param start_pos: rover's starting position :param instructions: instructions being executed :param height: maximum grid height :param width: maximum grid width""" <|body_0|> def move_rover(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Rover: def __init__(self, start_pos, instructions, height, width): """:param start_pos: rover's starting position :param instructions: instructions being executed :param height: maximum grid height :param width: maximum grid width""" self.x = start_pos[0] self.y = start_pos[1] ...
the_stack_v2_python_sparse
Python/untapt/rover.py
sqlconsult/byte
train
0
157a895807d6fd8e990140e7d183caaa06b80815
[ "for item in items:\n if isinstance(item, SendStreamItems.set_xattr):\n if item.name == _SELINUX_XATTR and discard_fn(item.path, item.data):\n continue\n yield item", "def normalize_time(t):\n return start_time if start_time <= t <= end_time else t\nfor item in items:\n if isinstance...
<|body_start_0|> for item in items: if isinstance(item, SendStreamItems.set_xattr): if item.name == _SELINUX_XATTR and discard_fn(item.path, item.data): continue yield item <|end_body_0|> <|body_start_1|> def normalize_time(t): ret...
A namespace of filters for taking a just-parsed Iterable[SendStreamItems], and making it useful for filesystem testing.
ItemFilters
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ItemFilters: """A namespace of filters for taking a just-parsed Iterable[SendStreamItems], and making it useful for filesystem testing.""" def selinux_xattr(items: Iterable[SendStreamItem], discard_fn: Callable[[bytes, bytes], bool]) -> Iterable[SendStreamItem]: """SELinux always set...
stack_v2_sparse_classes_36k_train_017205
7,223
permissive
[ { "docstring": "SELinux always sets a security context on filesystem objects, but most images will not ship data with non-default contexts, so it is easiest to just filter out these `set_xattr`s", "name": "selinux_xattr", "signature": "def selinux_xattr(items: Iterable[SendStreamItem], discard_fn: Calla...
2
null
Implement the Python class `ItemFilters` described below. Class description: A namespace of filters for taking a just-parsed Iterable[SendStreamItems], and making it useful for filesystem testing. Method signatures and docstrings: - def selinux_xattr(items: Iterable[SendStreamItem], discard_fn: Callable[[bytes, bytes...
Implement the Python class `ItemFilters` described below. Class description: A namespace of filters for taking a just-parsed Iterable[SendStreamItems], and making it useful for filesystem testing. Method signatures and docstrings: - def selinux_xattr(items: Iterable[SendStreamItem], discard_fn: Callable[[bytes, bytes...
677a3c45124b57e2ea96739d5f79816a26917417
<|skeleton|> class ItemFilters: """A namespace of filters for taking a just-parsed Iterable[SendStreamItems], and making it useful for filesystem testing.""" def selinux_xattr(items: Iterable[SendStreamItem], discard_fn: Callable[[bytes, bytes], bool]) -> Iterable[SendStreamItem]: """SELinux always set...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ItemFilters: """A namespace of filters for taking a just-parsed Iterable[SendStreamItems], and making it useful for filesystem testing.""" def selinux_xattr(items: Iterable[SendStreamItem], discard_fn: Callable[[bytes, bytes], bool]) -> Iterable[SendStreamItem]: """SELinux always sets a security ...
the_stack_v2_python_sparse
antlir/btrfs_diff/send_stream.py
facebookincubator/antlir
train
52
2ed822bf062e673e96c43cb0eacff104b46ce73b
[ "super(MultiResolutionSTFTLoss, self).__init__()\nassert len(fft_sizes) == len(hop_sizes) == len(win_lengths)\nself.stft_losses = torch.nn.ModuleList()\nfor fs, ss, wl in zip(fft_sizes, hop_sizes, win_lengths):\n self.stft_losses += [STFTLoss(fs, ss, wl, window)]", "sc_loss = 0.0\nmag_loss = 0.0\nfor f in self...
<|body_start_0|> super(MultiResolutionSTFTLoss, self).__init__() assert len(fft_sizes) == len(hop_sizes) == len(win_lengths) self.stft_losses = torch.nn.ModuleList() for fs, ss, wl in zip(fft_sizes, hop_sizes, win_lengths): self.stft_losses += [STFTLoss(fs, ss, wl, window)] <...
Multi resolution STFT loss module.
MultiResolutionSTFTLoss
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiResolutionSTFTLoss: """Multi resolution STFT loss module.""" def __init__(self, fft_sizes=[1024, 2048, 512], hop_sizes=[120, 240, 50], win_lengths=[600, 1200, 240], window='hann_window'): """Initialize Multi resolution STFT loss module. Args: fft_sizes (list): List of FFT sizes....
stack_v2_sparse_classes_36k_train_017206
18,988
no_license
[ { "docstring": "Initialize Multi resolution STFT loss module. Args: fft_sizes (list): List of FFT sizes. hop_sizes (list): List of hop sizes. win_lengths (list): List of window lengths. window (str): Window function type.", "name": "__init__", "signature": "def __init__(self, fft_sizes=[1024, 2048, 512]...
2
null
Implement the Python class `MultiResolutionSTFTLoss` described below. Class description: Multi resolution STFT loss module. Method signatures and docstrings: - def __init__(self, fft_sizes=[1024, 2048, 512], hop_sizes=[120, 240, 50], win_lengths=[600, 1200, 240], window='hann_window'): Initialize Multi resolution STF...
Implement the Python class `MultiResolutionSTFTLoss` described below. Class description: Multi resolution STFT loss module. Method signatures and docstrings: - def __init__(self, fft_sizes=[1024, 2048, 512], hop_sizes=[120, 240, 50], win_lengths=[600, 1200, 240], window='hann_window'): Initialize Multi resolution STF...
7e55a422588c1d1e00f35a3d3a3ff896cce59e18
<|skeleton|> class MultiResolutionSTFTLoss: """Multi resolution STFT loss module.""" def __init__(self, fft_sizes=[1024, 2048, 512], hop_sizes=[120, 240, 50], win_lengths=[600, 1200, 240], window='hann_window'): """Initialize Multi resolution STFT loss module. Args: fft_sizes (list): List of FFT sizes....
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MultiResolutionSTFTLoss: """Multi resolution STFT loss module.""" def __init__(self, fft_sizes=[1024, 2048, 512], hop_sizes=[120, 240, 50], win_lengths=[600, 1200, 240], window='hann_window'): """Initialize Multi resolution STFT loss module. Args: fft_sizes (list): List of FFT sizes. hop_sizes (l...
the_stack_v2_python_sparse
generated/test_rishikksh20_hifigan_denoiser.py
jansel/pytorch-jit-paritybench
train
35
ade237d12ba316e5c2c53c146faab89f65382473
[ "self.account_id = account_id\nself.helios_access_grant_status = helios_access_grant_status\nself.is_d_gaa_s_user = is_d_gaa_s_user\nself.is_d_maa_s_user = is_d_maa_s_user\nself.is_draa_s_user = is_draa_s_user\nself.is_r_paa_s_user = is_r_paa_s_user\nself.is_sales_user = is_sales_user\nself.is_support_user = is_sup...
<|body_start_0|> self.account_id = account_id self.helios_access_grant_status = helios_access_grant_status self.is_d_gaa_s_user = is_d_gaa_s_user self.is_d_maa_s_user = is_d_maa_s_user self.is_draa_s_user = is_draa_s_user self.is_r_paa_s_user = is_r_paa_s_user sel...
Implementation of the 'SalesforceAccountInfo' model. Salesforce Account Information of a Helios user. Attributes: account_id (string): Specifies the Account Id assigned by Salesforce. helios_access_grant_status (string): Specifies the status of helios access. is_d_gaa_s_user (bool): Specifies whether user is a DGaaS li...
SalesforceAccountInfo
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SalesforceAccountInfo: """Implementation of the 'SalesforceAccountInfo' model. Salesforce Account Information of a Helios user. Attributes: account_id (string): Specifies the Account Id assigned by Salesforce. helios_access_grant_status (string): Specifies the status of helios access. is_d_gaa_s_...
stack_v2_sparse_classes_36k_train_017207
3,811
permissive
[ { "docstring": "Constructor for the SalesforceAccountInfo class", "name": "__init__", "signature": "def __init__(self, account_id=None, helios_access_grant_status=None, is_d_gaa_s_user=None, is_d_maa_s_user=None, is_draa_s_user=None, is_r_paa_s_user=None, is_sales_user=None, is_support_user=None, user_i...
2
null
Implement the Python class `SalesforceAccountInfo` described below. Class description: Implementation of the 'SalesforceAccountInfo' model. Salesforce Account Information of a Helios user. Attributes: account_id (string): Specifies the Account Id assigned by Salesforce. helios_access_grant_status (string): Specifies t...
Implement the Python class `SalesforceAccountInfo` described below. Class description: Implementation of the 'SalesforceAccountInfo' model. Salesforce Account Information of a Helios user. Attributes: account_id (string): Specifies the Account Id assigned by Salesforce. helios_access_grant_status (string): Specifies t...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class SalesforceAccountInfo: """Implementation of the 'SalesforceAccountInfo' model. Salesforce Account Information of a Helios user. Attributes: account_id (string): Specifies the Account Id assigned by Salesforce. helios_access_grant_status (string): Specifies the status of helios access. is_d_gaa_s_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SalesforceAccountInfo: """Implementation of the 'SalesforceAccountInfo' model. Salesforce Account Information of a Helios user. Attributes: account_id (string): Specifies the Account Id assigned by Salesforce. helios_access_grant_status (string): Specifies the status of helios access. is_d_gaa_s_user (bool): ...
the_stack_v2_python_sparse
cohesity_management_sdk/models/salesforce_account_info.py
cohesity/management-sdk-python
train
24
f7c0618e8b1af213f6594ad1a6496f5de699e589
[ "cube = _set_up_height_cube(np.array([5.0, 10.0, 20.0]))\nself.coord_name = 'height'\ndata = np.zeros(cube.shape)\ndata[0] = np.ones(cube[0].shape, dtype=np.int32)\ndata[1] = np.full(cube[1].shape, 2, dtype=np.int32)\ndata[2] = np.full(cube[2].shape, 3, dtype=np.int32)\ndata[0, 0, 0] = 6\ncube.data = data\nself.cub...
<|body_start_0|> cube = _set_up_height_cube(np.array([5.0, 10.0, 20.0])) self.coord_name = 'height' data = np.zeros(cube.shape) data[0] = np.ones(cube[0].shape, dtype=np.int32) data[1] = np.full(cube[1].shape, 2, dtype=np.int32) data[2] = np.full(cube[2].shape, 3, dtype=n...
Test the process method.
Test_process
[ "BSD-3-Clause", "LicenseRef-scancode-proprietary-license" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test_process: """Test the process method.""" def setUp(self): """Set up the cube.""" <|body_0|> def test_basic(self): """Test that a cube with the points on the chosen coordinate are in the expected order.""" <|body_1|> def test_metadata(self): ...
stack_v2_sparse_classes_36k_train_017208
25,011
permissive
[ { "docstring": "Set up the cube.", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Test that a cube with the points on the chosen coordinate are in the expected order.", "name": "test_basic", "signature": "def test_basic(self)" }, { "docstring": "Test that the ...
5
stack_v2_sparse_classes_30k_test_000252
Implement the Python class `Test_process` described below. Class description: Test the process method. Method signatures and docstrings: - def setUp(self): Set up the cube. - def test_basic(self): Test that a cube with the points on the chosen coordinate are in the expected order. - def test_metadata(self): Test that...
Implement the Python class `Test_process` described below. Class description: Test the process method. Method signatures and docstrings: - def setUp(self): Set up the cube. - def test_basic(self): Test that a cube with the points on the chosen coordinate are in the expected order. - def test_metadata(self): Test that...
cd2c9019944345df1e703bf8f625db537ad9f559
<|skeleton|> class Test_process: """Test the process method.""" def setUp(self): """Set up the cube.""" <|body_0|> def test_basic(self): """Test that a cube with the points on the chosen coordinate are in the expected order.""" <|body_1|> def test_metadata(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Test_process: """Test the process method.""" def setUp(self): """Set up the cube.""" cube = _set_up_height_cube(np.array([5.0, 10.0, 20.0])) self.coord_name = 'height' data = np.zeros(cube.shape) data[0] = np.ones(cube[0].shape, dtype=np.int32) data[1] = np...
the_stack_v2_python_sparse
improver_tests/utilities/test_mathematical_operations.py
metoppv/improver
train
101
96677fcd22f17a9574c55935317528f2edeb6955
[ "entity_definition_keyname = entity_definition_keyname.strip('/').split('/')[0]\nentity = db.Entity(user_locale=self.get_user_locale(), user_id=self.current_user.id)\nentity_definition = None\nif entity_definition_keyname:\n entity_definition = entity.get_entity_definition(entity_definition_keyname=entity_defini...
<|body_start_0|> entity_definition_keyname = entity_definition_keyname.strip('/').split('/')[0] entity = db.Entity(user_locale=self.get_user_locale(), user_id=self.current_user.id) entity_definition = None if entity_definition_keyname: entity_definition = entity.get_entity_de...
ShowGroup
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ShowGroup: def get(self, entity_definition_keyname=None): """Show entities page with menu.""" <|body_0|> def post(self, entity_definition_keyname=None): """Returns searched Entitiy IDs as JSON.""" <|body_1|> <|end_skeleton|> <|body_start_0|> entity_...
stack_v2_sparse_classes_36k_train_017209
19,683
no_license
[ { "docstring": "Show entities page with menu.", "name": "get", "signature": "def get(self, entity_definition_keyname=None)" }, { "docstring": "Returns searched Entitiy IDs as JSON.", "name": "post", "signature": "def post(self, entity_definition_keyname=None)" } ]
2
stack_v2_sparse_classes_30k_train_000864
Implement the Python class `ShowGroup` described below. Class description: Implement the ShowGroup class. Method signatures and docstrings: - def get(self, entity_definition_keyname=None): Show entities page with menu. - def post(self, entity_definition_keyname=None): Returns searched Entitiy IDs as JSON.
Implement the Python class `ShowGroup` described below. Class description: Implement the ShowGroup class. Method signatures and docstrings: - def get(self, entity_definition_keyname=None): Show entities page with menu. - def post(self, entity_definition_keyname=None): Returns searched Entitiy IDs as JSON. <|skeleton...
b1c906dbad9f0bd34fb647a69846ece192d18c86
<|skeleton|> class ShowGroup: def get(self, entity_definition_keyname=None): """Show entities page with menu.""" <|body_0|> def post(self, entity_definition_keyname=None): """Returns searched Entitiy IDs as JSON.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ShowGroup: def get(self, entity_definition_keyname=None): """Show entities page with menu.""" entity_definition_keyname = entity_definition_keyname.strip('/').split('/')[0] entity = db.Entity(user_locale=self.get_user_locale(), user_id=self.current_user.id) entity_definition = ...
the_stack_v2_python_sparse
app/entity.py
strogo/Entu
train
0
19df958b8d89de3aeff4dd122fc0510d9c68f23a
[ "person_object = PersonModel(**data)\nperson_object.save()\nreturn person_object", "try:\n PersonModel.objects.filter(person_id=person_id).update(**data)\nexcept ObjectDoesNotExist:\n raise PersonNotFound(detail=f'Person with id {person_id} does not exist')\nupdated_person = PersonModel.objects.get(person_i...
<|body_start_0|> person_object = PersonModel(**data) person_object.save() return person_object <|end_body_0|> <|body_start_1|> try: PersonModel.objects.filter(person_id=person_id).update(**data) except ObjectDoesNotExist: raise PersonNotFound(detail=f'Per...
PersonServiceManagement
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PersonServiceManagement: def create_object(data: dict) -> PersonModel: """Creates a person object in the database Args: data (dict): person information Returns: created person (PersonModel)""" <|body_0|> def update_object(*, data: dict, person_id: int) -> PersonModel: ...
stack_v2_sparse_classes_36k_train_017210
4,864
no_license
[ { "docstring": "Creates a person object in the database Args: data (dict): person information Returns: created person (PersonModel)", "name": "create_object", "signature": "def create_object(data: dict) -> PersonModel" }, { "docstring": "Updates a person object if the person id is provided Args:...
3
stack_v2_sparse_classes_30k_test_000155
Implement the Python class `PersonServiceManagement` described below. Class description: Implement the PersonServiceManagement class. Method signatures and docstrings: - def create_object(data: dict) -> PersonModel: Creates a person object in the database Args: data (dict): person information Returns: created person ...
Implement the Python class `PersonServiceManagement` described below. Class description: Implement the PersonServiceManagement class. Method signatures and docstrings: - def create_object(data: dict) -> PersonModel: Creates a person object in the database Args: data (dict): person information Returns: created person ...
84ad5886ec3cd8d2aae43f5812e2c894b71685b5
<|skeleton|> class PersonServiceManagement: def create_object(data: dict) -> PersonModel: """Creates a person object in the database Args: data (dict): person information Returns: created person (PersonModel)""" <|body_0|> def update_object(*, data: dict, person_id: int) -> PersonModel: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PersonServiceManagement: def create_object(data: dict) -> PersonModel: """Creates a person object in the database Args: data (dict): person information Returns: created person (PersonModel)""" person_object = PersonModel(**data) person_object.save() return person_object de...
the_stack_v2_python_sparse
platform_inistock/inistock/models/service_management.py
MihailButnaru/Inistock-API
train
0
3632abcc7439085ef88503d6add1e4a6ed58b512
[ "self.clumpids = np.zeros(1)\nself.parent = np.zeros(1)\nself.level = np.zeros(1)\nreturn", "if par.verbose:\n print('Reading clump data.')\nout = p.z0\nraw_data = [None for i in range(par.ncpu)]\ndirnrstr = str(par.outputnrs[out]).zfill(5)\ndirname = 'output_' + dirnrstr\ni = 0\nfor cpu in range(par.ncpu):\n ...
<|body_start_0|> self.clumpids = np.zeros(1) self.parent = np.zeros(1) self.level = np.zeros(1) return <|end_body_0|> <|body_start_1|> if par.verbose: print('Reading clump data.') out = p.z0 raw_data = [None for i in range(par.ncpu)] dirnrstr ...
Data from clump_XXXXX.txtYYYYY
clumpdata
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class clumpdata: """Data from clump_XXXXX.txtYYYYY""" def __init__(self, par): """par: params object""" <|body_0|> def read_clumpdata(self, par): """Reads in the clump data. Only for the z = 0 directory. par: params object""" <|body_1|> def cleanup_clumpda...
stack_v2_sparse_classes_36k_train_017211
36,252
no_license
[ { "docstring": "par: params object", "name": "__init__", "signature": "def __init__(self, par)" }, { "docstring": "Reads in the clump data. Only for the z = 0 directory. par: params object", "name": "read_clumpdata", "signature": "def read_clumpdata(self, par)" }, { "docstring": ...
5
stack_v2_sparse_classes_30k_val_000111
Implement the Python class `clumpdata` described below. Class description: Data from clump_XXXXX.txtYYYYY Method signatures and docstrings: - def __init__(self, par): par: params object - def read_clumpdata(self, par): Reads in the clump data. Only for the z = 0 directory. par: params object - def cleanup_clumpdata(s...
Implement the Python class `clumpdata` described below. Class description: Data from clump_XXXXX.txtYYYYY Method signatures and docstrings: - def __init__(self, par): par: params object - def read_clumpdata(self, par): Reads in the clump data. Only for the z = 0 directory. par: params object - def cleanup_clumpdata(s...
f1bd65ef106dbf5e4cefefd7d386643a6fc0ac52
<|skeleton|> class clumpdata: """Data from clump_XXXXX.txtYYYYY""" def __init__(self, par): """par: params object""" <|body_0|> def read_clumpdata(self, par): """Reads in the clump data. Only for the z = 0 directory. par: params object""" <|body_1|> def cleanup_clumpda...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class clumpdata: """Data from clump_XXXXX.txtYYYYY""" def __init__(self, par): """par: params object""" self.clumpids = np.zeros(1) self.parent = np.zeros(1) self.level = np.zeros(1) return def read_clumpdata(self, par): """Reads in the clump data. Only for ...
the_stack_v2_python_sparse
utils/py/mergertree-extract.py
ALaDyn/ramses
train
6
2bd49d51c9d5a7166300038e1a6927495bddd77a
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn ReportRoot()", "from .authentication_methods_root import AuthenticationMethodsRoot\nfrom .print_usage_by_printer import PrintUsageByPrinter\nfrom .print_usage_by_user import PrintUsageByUser\nfrom .security_reports_root import Security...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return ReportRoot() <|end_body_0|> <|body_start_1|> from .authentication_methods_root import AuthenticationMethodsRoot from .print_usage_by_printer import PrintUsageByPrinter from .prin...
ReportRoot
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReportRoot: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ReportRoot: """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: Repo...
stack_v2_sparse_classes_36k_train_017212
5,347
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: ReportRoot", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value(pa...
3
stack_v2_sparse_classes_30k_train_018052
Implement the Python class `ReportRoot` described below. Class description: Implement the ReportRoot class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ReportRoot: Creates a new instance of the appropriate class based on discriminator value Args: pa...
Implement the Python class `ReportRoot` described below. Class description: Implement the ReportRoot class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ReportRoot: Creates a new instance of the appropriate class based on discriminator value Args: pa...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class ReportRoot: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ReportRoot: """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: Repo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ReportRoot: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ReportRoot: """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: ReportRoot""" ...
the_stack_v2_python_sparse
msgraph/generated/models/report_root.py
microsoftgraph/msgraph-sdk-python
train
135
2aee99df7590ac9a3497af616c93d882ecadc554
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "conte...
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
Missing associated documentation comment in .proto file.
ResultServiceServicer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResultServiceServicer: """Missing associated documentation comment in .proto file.""" def SignalResultsReady(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def FinishSequence(self, request, context): """Missing ...
stack_v2_sparse_classes_36k_train_017213
10,385
permissive
[ { "docstring": "Missing associated documentation comment in .proto file.", "name": "SignalResultsReady", "signature": "def SignalResultsReady(self, request, context)" }, { "docstring": "Missing associated documentation comment in .proto file.", "name": "FinishSequence", "signature": "def...
4
stack_v2_sparse_classes_30k_train_007580
Implement the Python class `ResultServiceServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def SignalResultsReady(self, request, context): Missing associated documentation comment in .proto file. - def FinishSequence(self, reques...
Implement the Python class `ResultServiceServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def SignalResultsReady(self, request, context): Missing associated documentation comment in .proto file. - def FinishSequence(self, reques...
a83a60c40eda7051a73363f67cb806ad73637e7a
<|skeleton|> class ResultServiceServicer: """Missing associated documentation comment in .proto file.""" def SignalResultsReady(self, request, context): """Missing associated documentation comment in .proto file.""" <|body_0|> def FinishSequence(self, request, context): """Missing ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResultServiceServicer: """Missing associated documentation comment in .proto file.""" def SignalResultsReady(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not impl...
the_stack_v2_python_sparse
sap-toolkit/sap_toolkit/generated/eval_server_pb2_grpc.py
jelasus/sap-starterkit
train
0
07f3210294f70319c2bec0415b6d863f1e2444a8
[ "self.X = X\nself.y = y\nif X.shape[1] == 2:\n self.x_min, self.x_max = (np.floor(self.X[:, 0].min()), np.ceil(self.X[:, 0].max()))\n self.y_min, self.y_max = (np.floor(self.X[:, 1].min()), np.ceil(self.X[:, 1].max()))\nelse:\n self.x_min, self.x_max = (np.floor(self.X.min()), np.ceil(self.X.max()))\n s...
<|body_start_0|> self.X = X self.y = y if X.shape[1] == 2: self.x_min, self.x_max = (np.floor(self.X[:, 0].min()), np.ceil(self.X[:, 0].max())) self.y_min, self.y_max = (np.floor(self.X[:, 1].min()), np.ceil(self.X[:, 1].max())) else: self.x_min, self....
Class Plotter. Plots the decision boundary/regression line.
Plotter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Plotter: """Class Plotter. Plots the decision boundary/regression line.""" def __init__(self, X, y): """Constructor. :param X: data features :param y: data labels""" <|body_0|> def __prepare_plot(self, ax, xlabel='$x_1$', ylabel='$x_2$', title='Plot'): """Prepare...
stack_v2_sparse_classes_36k_train_017214
4,942
no_license
[ { "docstring": "Constructor. :param X: data features :param y: data labels", "name": "__init__", "signature": "def __init__(self, X, y)" }, { "docstring": "Prepares the plot. :param ax: pyplot axis object :param xlabel: label of the x-axis :param ylabel: label of the y-axis :param title: title o...
5
stack_v2_sparse_classes_30k_test_000066
Implement the Python class `Plotter` described below. Class description: Class Plotter. Plots the decision boundary/regression line. Method signatures and docstrings: - def __init__(self, X, y): Constructor. :param X: data features :param y: data labels - def __prepare_plot(self, ax, xlabel='$x_1$', ylabel='$x_2$', t...
Implement the Python class `Plotter` described below. Class description: Class Plotter. Plots the decision boundary/regression line. Method signatures and docstrings: - def __init__(self, X, y): Constructor. :param X: data features :param y: data labels - def __prepare_plot(self, ax, xlabel='$x_1$', ylabel='$x_2$', t...
98b71b76f664d5f6493bd7f90036531d8f6644a7
<|skeleton|> class Plotter: """Class Plotter. Plots the decision boundary/regression line.""" def __init__(self, X, y): """Constructor. :param X: data features :param y: data labels""" <|body_0|> def __prepare_plot(self, ax, xlabel='$x_1$', ylabel='$x_2$', title='Plot'): """Prepare...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Plotter: """Class Plotter. Plots the decision boundary/regression line.""" def __init__(self, X, y): """Constructor. :param X: data features :param y: data labels""" self.X = X self.y = y if X.shape[1] == 2: self.x_min, self.x_max = (np.floor(self.X[:, 0].min()...
the_stack_v2_python_sparse
06_python/utils/plotter.py
pfisterer/Applied_ML_Fundamentals
train
0
f80a07cb8763c1dd3686ec7eef68755a3c43e78b
[ "m, n = (len(s1), len(s2))\nif n < m:\n return False\nl1 = [0] * 26\nfor c in s1:\n l1[ord(c) - ord('a')] += 1\nfor c in s2[:m]:\n l1[ord(c) - ord('a')] -= 1\nif not any(l1):\n return True\ni = 0\nfor c in s2[m:]:\n l1[ord(c) - ord('a')] -= 1\n l1[ord(s2[i]) - ord('a')] += 1\n if not any(l1):\n...
<|body_start_0|> m, n = (len(s1), len(s2)) if n < m: return False l1 = [0] * 26 for c in s1: l1[ord(c) - ord('a')] += 1 for c in s2[:m]: l1[ord(c) - ord('a')] -= 1 if not any(l1): return True i = 0 for c in s...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def checkInclusion(self, s1: str, s2: str) -> bool: """CREATED AT: 2022/2/11 Runtime: 92 ms, faster than 68.01% Memory Usage: 14 MB, less than 83.82% 1 <= s1.length, s2.length <= 10^4 s1 and s2 consist of lowercase English letters. :param s1: :param s2: :return:""" <|bo...
stack_v2_sparse_classes_36k_train_017215
2,274
permissive
[ { "docstring": "CREATED AT: 2022/2/11 Runtime: 92 ms, faster than 68.01% Memory Usage: 14 MB, less than 83.82% 1 <= s1.length, s2.length <= 10^4 s1 and s2 consist of lowercase English letters. :param s1: :param s2: :return:", "name": "checkInclusion", "signature": "def checkInclusion(self, s1: str, s2: ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def checkInclusion(self, s1: str, s2: str) -> bool: CREATED AT: 2022/2/11 Runtime: 92 ms, faster than 68.01% Memory Usage: 14 MB, less than 83.82% 1 <= s1.length, s2.length <= 10...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def checkInclusion(self, s1: str, s2: str) -> bool: CREATED AT: 2022/2/11 Runtime: 92 ms, faster than 68.01% Memory Usage: 14 MB, less than 83.82% 1 <= s1.length, s2.length <= 10...
4dd1e54d8d08f7e6590bc76abd08ecaacaf775e5
<|skeleton|> class Solution: def checkInclusion(self, s1: str, s2: str) -> bool: """CREATED AT: 2022/2/11 Runtime: 92 ms, faster than 68.01% Memory Usage: 14 MB, less than 83.82% 1 <= s1.length, s2.length <= 10^4 s1 and s2 consist of lowercase English letters. :param s1: :param s2: :return:""" <|bo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def checkInclusion(self, s1: str, s2: str) -> bool: """CREATED AT: 2022/2/11 Runtime: 92 ms, faster than 68.01% Memory Usage: 14 MB, less than 83.82% 1 <= s1.length, s2.length <= 10^4 s1 and s2 consist of lowercase English letters. :param s1: :param s2: :return:""" m, n = (len(s1), l...
the_stack_v2_python_sparse
src/567-PermutationInString.py
Jiezhi/myleetcode
train
1
d8491831874b0074670a1ce0508aaeeb4338c665
[ "super().__init__(X, Y)\nself.max_iterations = max_iterations\nself.threshold = min_delta\nself.lmbda = lmbda", "i = 0\ndelta = 1.0\nold_rho = numpy.ones(self.X.shape[0])\nweights = numpy.ones((self.X.shape[1], self.X.shape[2]))\nwhile i < self.max_iterations and delta > self.threshold:\n logger.info('Iteratio...
<|body_start_0|> super().__init__(X, Y) self.max_iterations = max_iterations self.threshold = min_delta self.lmbda = lmbda <|end_body_0|> <|body_start_1|> i = 0 delta = 1.0 old_rho = numpy.ones(self.X.shape[0]) weights = numpy.ones((self.X.shape[1], self....
Antares implementation of the IR-MAD transformation IR-MAD corresponds to Iterative Reweighted Multivariate Alteration Detection (MAD), it is applied over two matching arrays It implements the method of performing several MAD transformations and re-weighting the importance of the pixels at each consecutive run. Given t...
Transform
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Transform: """Antares implementation of the IR-MAD transformation IR-MAD corresponds to Iterative Reweighted Multivariate Alteration Detection (MAD), it is applied over two matching arrays It implements the method of performing several MAD transformations and re-weighting the importance of the pi...
stack_v2_sparse_classes_36k_train_017216
2,753
no_license
[ { "docstring": "Instantiate class to run MAD transformation on two arrays Args: max_iterations (int): The maximum number of times that the process will run the MAD transform. min_delta (float): After each successive iteration of the MAD transform, the distance between the eigenvalues is measured. Min_delta is u...
2
stack_v2_sparse_classes_30k_train_003566
Implement the Python class `Transform` described below. Class description: Antares implementation of the IR-MAD transformation IR-MAD corresponds to Iterative Reweighted Multivariate Alteration Detection (MAD), it is applied over two matching arrays It implements the method of performing several MAD transformations an...
Implement the Python class `Transform` described below. Class description: Antares implementation of the IR-MAD transformation IR-MAD corresponds to Iterative Reweighted Multivariate Alteration Detection (MAD), it is applied over two matching arrays It implements the method of performing several MAD transformations an...
ab8073a4b45915ba51c718b5403795c44f9b0027
<|skeleton|> class Transform: """Antares implementation of the IR-MAD transformation IR-MAD corresponds to Iterative Reweighted Multivariate Alteration Detection (MAD), it is applied over two matching arrays It implements the method of performing several MAD transformations and re-weighting the importance of the pi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Transform: """Antares implementation of the IR-MAD transformation IR-MAD corresponds to Iterative Reweighted Multivariate Alteration Detection (MAD), it is applied over two matching arrays It implements the method of performing several MAD transformations and re-weighting the importance of the pixels at each ...
the_stack_v2_python_sparse
madmex/lcc/transform/irmad.py
ixime/antares3
train
0
f68f8a4871ae7c81ef230e96f4cf236968a7e00d
[ "\"\"\":field\n Byte data of the sound.\n \"\"\"\nself.bytes: bytes = bytes(np.array(snd * 32767, dtype='int16'))\n':field\\n A base64 string of the sound. Send this to the build.\\n '\nself.wav_str = base64.b64encode(self.bytes).decode('utf-8')\n':field\\n The length of the byte ...
<|body_start_0|> """:field Byte data of the sound. """ self.bytes: bytes = bytes(np.array(snd * 32767, dtype='int16')) ':field\n A base64 string of the sound. Send this to the build.\n ' self.wav_str = base64.b64encode(self.bytes).decode('utf...
This class is used only in PyImpact, which has been deprecated. See: [`Clatter`](../add_ons/clatter.md). A sound encoded as a base64 string.
Base64Sound
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Base64Sound: """This class is used only in PyImpact, which has been deprecated. See: [`Clatter`](../add_ons/clatter.md). A sound encoded as a base64 string.""" def __init__(self, snd: np.ndarray): """:param snd: The sound byte array.""" <|body_0|> def write(self, path: U...
stack_v2_sparse_classes_36k_train_017217
1,305
permissive
[ { "docstring": ":param snd: The sound byte array.", "name": "__init__", "signature": "def __init__(self, snd: np.ndarray)" }, { "docstring": "Write audio to disk. :param path: The path to the .wav file.", "name": "write", "signature": "def write(self, path: Union[str, Path]) -> None" }...
2
stack_v2_sparse_classes_30k_train_021498
Implement the Python class `Base64Sound` described below. Class description: This class is used only in PyImpact, which has been deprecated. See: [`Clatter`](../add_ons/clatter.md). A sound encoded as a base64 string. Method signatures and docstrings: - def __init__(self, snd: np.ndarray): :param snd: The sound byte ...
Implement the Python class `Base64Sound` described below. Class description: This class is used only in PyImpact, which has been deprecated. See: [`Clatter`](../add_ons/clatter.md). A sound encoded as a base64 string. Method signatures and docstrings: - def __init__(self, snd: np.ndarray): :param snd: The sound byte ...
9df96fba455b327bb360d8dd5886d8754046c690
<|skeleton|> class Base64Sound: """This class is used only in PyImpact, which has been deprecated. See: [`Clatter`](../add_ons/clatter.md). A sound encoded as a base64 string.""" def __init__(self, snd: np.ndarray): """:param snd: The sound byte array.""" <|body_0|> def write(self, path: U...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Base64Sound: """This class is used only in PyImpact, which has been deprecated. See: [`Clatter`](../add_ons/clatter.md). A sound encoded as a base64 string.""" def __init__(self, snd: np.ndarray): """:param snd: The sound byte array.""" """:field Byte data of the sound. ...
the_stack_v2_python_sparse
Python/tdw/physics_audio/base64_sound.py
threedworld-mit/tdw
train
427
cd9a93c932df62e1b600f78b88a8a2f7a9e7dee5
[ "super().__init__(**kwargs)\nself.storage = list(containers)\nself.transport = transport\nself.warehouses = warehouses", "for transport in self.transport:\n if transport.is_at_home:\n if self.storage:\n container = self.storage.pop(0)\n transport.move(self.warehouses[container], co...
<|body_start_0|> super().__init__(**kwargs) self.storage = list(containers) self.transport = transport self.warehouses = warehouses <|end_body_0|> <|body_start_1|> for transport in self.transport: if transport.is_at_home: if self.storage: ...
Factory
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Factory: def __init__(self, *, containers, transport: list, warehouses, **kwargs): """:param containers: queue of containers which should be delivered :param transport: transport available on Factory :param warehouses: list of Building for container of a certain type :param kwargs: name ...
stack_v2_sparse_classes_36k_train_017218
4,725
no_license
[ { "docstring": ":param containers: queue of containers which should be delivered :param transport: transport available on Factory :param warehouses: list of Building for container of a certain type :param kwargs: name and other kwargs are transferred to Building __init__", "name": "__init__", "signature...
2
stack_v2_sparse_classes_30k_test_000493
Implement the Python class `Factory` described below. Class description: Implement the Factory class. Method signatures and docstrings: - def __init__(self, *, containers, transport: list, warehouses, **kwargs): :param containers: queue of containers which should be delivered :param transport: transport available on ...
Implement the Python class `Factory` described below. Class description: Implement the Factory class. Method signatures and docstrings: - def __init__(self, *, containers, transport: list, warehouses, **kwargs): :param containers: queue of containers which should be delivered :param transport: transport available on ...
a7ddcdfcafcb21d18b131ce2bceec48c47c9a8d0
<|skeleton|> class Factory: def __init__(self, *, containers, transport: list, warehouses, **kwargs): """:param containers: queue of containers which should be delivered :param transport: transport available on Factory :param warehouses: list of Building for container of a certain type :param kwargs: name ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Factory: def __init__(self, *, containers, transport: list, warehouses, **kwargs): """:param containers: queue of containers which should be delivered :param transport: transport available on Factory :param warehouses: list of Building for container of a certain type :param kwargs: name and other kwar...
the_stack_v2_python_sparse
12-object-oriented-design/transport_problem.py
TropinNikolay/EpamPython2019
train
0
e125a49c19f46b57ecb8d88813ebb87df024a35a
[ "if self.request.method == 'POST':\n serializer_class = ResetPasswordSerializer\nelif self.request.method == 'PUT':\n serializer_class = ResetPasswordUpdateSerializer\nreturn serializer_class", "if request.version != 'v1':\n return Response(status=status.HTTP_505_HTTP_VERSION_NOT_SUPPORTED)\nserializer_c...
<|body_start_0|> if self.request.method == 'POST': serializer_class = ResetPasswordSerializer elif self.request.method == 'PUT': serializer_class = ResetPasswordUpdateSerializer return serializer_class <|end_body_0|> <|body_start_1|> if request.version != 'v1': ...
Reset password view.
ResetPasswordView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResetPasswordView: """Reset password view.""" def get_serializer_class(self, *args, **kwargs): """Get the serializer class depending of the request method.""" <|body_0|> def create(self, request, *args, **kwargs): """POST request.""" <|body_1|> def u...
stack_v2_sparse_classes_36k_train_017219
6,798
no_license
[ { "docstring": "Get the serializer class depending of the request method.", "name": "get_serializer_class", "signature": "def get_serializer_class(self, *args, **kwargs)" }, { "docstring": "POST request.", "name": "create", "signature": "def create(self, request, *args, **kwargs)" }, ...
3
stack_v2_sparse_classes_30k_train_018837
Implement the Python class `ResetPasswordView` described below. Class description: Reset password view. Method signatures and docstrings: - def get_serializer_class(self, *args, **kwargs): Get the serializer class depending of the request method. - def create(self, request, *args, **kwargs): POST request. - def updat...
Implement the Python class `ResetPasswordView` described below. Class description: Reset password view. Method signatures and docstrings: - def get_serializer_class(self, *args, **kwargs): Get the serializer class depending of the request method. - def create(self, request, *args, **kwargs): POST request. - def updat...
cd8767b5eeaef3a09d77c936781b4126fd8591de
<|skeleton|> class ResetPasswordView: """Reset password view.""" def get_serializer_class(self, *args, **kwargs): """Get the serializer class depending of the request method.""" <|body_0|> def create(self, request, *args, **kwargs): """POST request.""" <|body_1|> def u...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResetPasswordView: """Reset password view.""" def get_serializer_class(self, *args, **kwargs): """Get the serializer class depending of the request method.""" if self.request.method == 'POST': serializer_class = ResetPasswordSerializer elif self.request.method == 'PUT'...
the_stack_v2_python_sparse
api/auths/views.py
ignite7/backproject
train
0
df6ff67dee87d382183d2f54ec446b113e02bb6e
[ "self._plot_index = plot_index\nself._slice_index = slice_index\nself._bin_limits = np.linspace(bin_limits[0], bin_limits[1], num_bins + 1)\nself._slice_limits = np.linspace(bin_limits[0], bin_limits[1], num_slices + 1)\nself._slice_array = np.zeros((num_slices, num_bins), dtype=np.float64)", "this_slice = np.dig...
<|body_start_0|> self._plot_index = plot_index self._slice_index = slice_index self._bin_limits = np.linspace(bin_limits[0], bin_limits[1], num_bins + 1) self._slice_limits = np.linspace(bin_limits[0], bin_limits[1], num_slices + 1) self._slice_array = np.zeros((num_slices, num_b...
Slices
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Slices: def __init__(self, num_slices, num_bins, bin_limits, plot_index, slice_index): """Init an instance for plotting histogram projections of the plot_index'th parameter, taking slices along the slice_index'th parameter bin_limits should be an iterable (lower_limit, upper_limit)""" ...
stack_v2_sparse_classes_36k_train_017220
4,754
no_license
[ { "docstring": "Init an instance for plotting histogram projections of the plot_index'th parameter, taking slices along the slice_index'th parameter bin_limits should be an iterable (lower_limit, upper_limit)", "name": "__init__", "signature": "def __init__(self, num_slices, num_bins, bin_limits, plot_i...
3
stack_v2_sparse_classes_30k_train_010198
Implement the Python class `Slices` described below. Class description: Implement the Slices class. Method signatures and docstrings: - def __init__(self, num_slices, num_bins, bin_limits, plot_index, slice_index): Init an instance for plotting histogram projections of the plot_index'th parameter, taking slices along...
Implement the Python class `Slices` described below. Class description: Implement the Slices class. Method signatures and docstrings: - def __init__(self, num_slices, num_bins, bin_limits, plot_index, slice_index): Init an instance for plotting histogram projections of the plot_index'th parameter, taking slices along...
c38ed541e0143d0b8615035998791adf69115733
<|skeleton|> class Slices: def __init__(self, num_slices, num_bins, bin_limits, plot_index, slice_index): """Init an instance for plotting histogram projections of the plot_index'th parameter, taking slices along the slice_index'th parameter bin_limits should be an iterable (lower_limit, upper_limit)""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Slices: def __init__(self, num_slices, num_bins, bin_limits, plot_index, slice_index): """Init an instance for plotting histogram projections of the plot_index'th parameter, taking slices along the slice_index'th parameter bin_limits should be an iterable (lower_limit, upper_limit)""" self._pl...
the_stack_v2_python_sparse
efficiency/scripts/visualisations.py
richard-lane/dk3pi
train
0
e5b4f9e2ef7d1e0480bf0a77b9fc83a2bc55238a
[ "LayoutItem.__init__(self, dom, parent_element, text_object, mxd, arc_doc)\nself.dom = dom\nself.parent_element = parent_element\nself.text_object = text_object\nself.mxd = mxd\nself.arc_doc = arc_doc", "arcpy_item = LayoutItem.get_arcpy_layout_element(self, self.layout_item_object)\nLayoutItemText.set_size_and_p...
<|body_start_0|> LayoutItem.__init__(self, dom, parent_element, text_object, mxd, arc_doc) self.dom = dom self.parent_element = parent_element self.text_object = text_object self.mxd = mxd self.arc_doc = arc_doc <|end_body_0|> <|body_start_1|> arcpy_item = Layout...
LayoutItemText
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LayoutItemText: def __init__(self, dom, parent_element, text_object, mxd, arc_doc): """This function creates a Text-Item for the layout :param dom: the Document Object Model :param parent_element: the main layout element, where to put the layout-items :param text_object: The text-object ...
stack_v2_sparse_classes_36k_train_017221
3,090
permissive
[ { "docstring": "This function creates a Text-Item for the layout :param dom: the Document Object Model :param parent_element: the main layout element, where to put the layout-items :param text_object: The text-object itself as ArcObject :param mxd: the arcpy mxd-document :param arc_doc: the ArcObject IMxDocumen...
2
stack_v2_sparse_classes_30k_train_002498
Implement the Python class `LayoutItemText` described below. Class description: Implement the LayoutItemText class. Method signatures and docstrings: - def __init__(self, dom, parent_element, text_object, mxd, arc_doc): This function creates a Text-Item for the layout :param dom: the Document Object Model :param pare...
Implement the Python class `LayoutItemText` described below. Class description: Implement the LayoutItemText class. Method signatures and docstrings: - def __init__(self, dom, parent_element, text_object, mxd, arc_doc): This function creates a Text-Item for the layout :param dom: the Document Object Model :param pare...
cd0aa5f533194c85cf6e098fadc079ea61b63fce
<|skeleton|> class LayoutItemText: def __init__(self, dom, parent_element, text_object, mxd, arc_doc): """This function creates a Text-Item for the layout :param dom: the Document Object Model :param parent_element: the main layout element, where to put the layout-items :param text_object: The text-object ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LayoutItemText: def __init__(self, dom, parent_element, text_object, mxd, arc_doc): """This function creates a Text-Item for the layout :param dom: the Document Object Model :param parent_element: the main layout element, where to put the layout-items :param text_object: The text-object itself as ArcO...
the_stack_v2_python_sparse
layout/layoutItemText.py
avaldeon/mapqonverter
train
0
2a14260f08a096cfa65822b5f50104f6862a222f
[ "carry = 0\nresult = 0\nfor i in range(len(s) - 1, 0, -1):\n n = int(s[i])\n carry, sm = (carry & n, carry ^ n)\n if sm == 0:\n result += 1\n else:\n carry = 1\n result += 2\nif carry:\n result += 1\nreturn result", "n, steps = ([int(i) for i in s], 0)\nwhile n != [1]:\n if ...
<|body_start_0|> carry = 0 result = 0 for i in range(len(s) - 1, 0, -1): n = int(s[i]) carry, sm = (carry & n, carry ^ n) if sm == 0: result += 1 else: carry = 1 result += 2 if carry: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def numSteps_solution_1_bitwise_operator_without_converting_entire_string_to_int(self, s: str) -> int: """:type s: str :rtype: int""" <|body_0|> def numSteps_solution_2_bitwise_operator_odd_and_even(self, s: str) -> int: """:type s: str :rtype: int""" ...
stack_v2_sparse_classes_36k_train_017222
4,651
no_license
[ { "docstring": ":type s: str :rtype: int", "name": "numSteps_solution_1_bitwise_operator_without_converting_entire_string_to_int", "signature": "def numSteps_solution_1_bitwise_operator_without_converting_entire_string_to_int(self, s: str) -> int" }, { "docstring": ":type s: str :rtype: int", ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numSteps_solution_1_bitwise_operator_without_converting_entire_string_to_int(self, s: str) -> int: :type s: str :rtype: int - def numSteps_solution_2_bitwise_operator_odd_and...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numSteps_solution_1_bitwise_operator_without_converting_entire_string_to_int(self, s: str) -> int: :type s: str :rtype: int - def numSteps_solution_2_bitwise_operator_odd_and...
f2621cd76822a922c49b60f32931f26cce1c571d
<|skeleton|> class Solution: def numSteps_solution_1_bitwise_operator_without_converting_entire_string_to_int(self, s: str) -> int: """:type s: str :rtype: int""" <|body_0|> def numSteps_solution_2_bitwise_operator_odd_and_even(self, s: str) -> int: """:type s: str :rtype: int""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def numSteps_solution_1_bitwise_operator_without_converting_entire_string_to_int(self, s: str) -> int: """:type s: str :rtype: int""" carry = 0 result = 0 for i in range(len(s) - 1, 0, -1): n = int(s[i]) carry, sm = (carry & n, carry ^ n) ...
the_stack_v2_python_sparse
Bit_Magic/030_leetcode_P_1404_NumberOfStepsToReduceANumberInBinaryRepresentationToOne/Solution.py
Keshav1506/competitive_programming
train
0
259ba1afdb2d891da10d4b1f7cbd8dcbe2ff843f
[ "self.args = args\nself.gcp_env = gcp_env\nself.alembic_args = alembic_args\nself.output = ''", "if not self.gcp_env.activate_sql_proxy(user='alembic', project=self.gcp_env.project):\n return 1\nclr = self.gcp_env.terminal_colors\n_logger.info('\\nAlembic Process Information:')\n_logger.info('=' * 90)\n_logger...
<|body_start_0|> self.args = args self.gcp_env = gcp_env self.alembic_args = alembic_args self.output = '' <|end_body_0|> <|body_start_1|> if not self.gcp_env.activate_sql_proxy(user='alembic', project=self.gcp_env.project): return 1 clr = self.gcp_env.termin...
A thin wrapper around the Alembic executable.
AlembicManagerClass
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AlembicManagerClass: """A thin wrapper around the Alembic executable.""" def __init__(self, args, gcp_env: GCPEnvConfigObject, alembic_args: list): """:param args: command line arguments. :param gcp_env: gcp environment information, see: gcp_initialize().""" <|body_0|> d...
stack_v2_sparse_classes_36k_train_017223
3,948
permissive
[ { "docstring": ":param args: command line arguments. :param gcp_env: gcp environment information, see: gcp_initialize().", "name": "__init__", "signature": "def __init__(self, args, gcp_env: GCPEnvConfigObject, alembic_args: list)" }, { "docstring": "Main program process :return: Exit code value...
2
stack_v2_sparse_classes_30k_train_004388
Implement the Python class `AlembicManagerClass` described below. Class description: A thin wrapper around the Alembic executable. Method signatures and docstrings: - def __init__(self, args, gcp_env: GCPEnvConfigObject, alembic_args: list): :param args: command line arguments. :param gcp_env: gcp environment informa...
Implement the Python class `AlembicManagerClass` described below. Class description: A thin wrapper around the Alembic executable. Method signatures and docstrings: - def __init__(self, args, gcp_env: GCPEnvConfigObject, alembic_args: list): :param args: command line arguments. :param gcp_env: gcp environment informa...
461ae46aeda21d54de8a91aa5ef677676d5db541
<|skeleton|> class AlembicManagerClass: """A thin wrapper around the Alembic executable.""" def __init__(self, args, gcp_env: GCPEnvConfigObject, alembic_args: list): """:param args: command line arguments. :param gcp_env: gcp environment information, see: gcp_initialize().""" <|body_0|> d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AlembicManagerClass: """A thin wrapper around the Alembic executable.""" def __init__(self, args, gcp_env: GCPEnvConfigObject, alembic_args: list): """:param args: command line arguments. :param gcp_env: gcp environment information, see: gcp_initialize().""" self.args = args self....
the_stack_v2_python_sparse
rdr_service/tools/tool_libs/alembic.py
all-of-us/raw-data-repository
train
46
fe295314aa35ed17ce419841de103885e24f3f60
[ "get = StudiesGet(self.get_connection())\nstudies = get.get()\nreturn (studies, 200)", "get = StudyGet(self.get_connection())\nstudy = None\nretcode = 200\ntry:\n study = get.get(study_name)\nexcept MissingKeyException as dme:\n logging.getLogger(__name__).debug('update_study: {}'.format(repr(dme)))\n re...
<|body_start_0|> get = StudiesGet(self.get_connection()) studies = get.get() return (studies, 200) <|end_body_0|> <|body_start_1|> get = StudyGet(self.get_connection()) study = None retcode = 200 try: study = get.get(study_name) except Missing...
StudyController
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StudyController: def download_studies(self, start=None, count=None, user=None, auths=None): """fetches studies :param start: for pagination start the result set at a record x :type start: int :param count: for pagination the number of entries to return :type count: int :rtype: Studies"""...
stack_v2_sparse_classes_36k_train_017224
2,455
no_license
[ { "docstring": "fetches studies :param start: for pagination start the result set at a record x :type start: int :param count: for pagination the number of entries to return :type count: int :rtype: Studies", "name": "download_studies", "signature": "def download_studies(self, start=None, count=None, us...
3
stack_v2_sparse_classes_30k_train_011330
Implement the Python class `StudyController` described below. Class description: Implement the StudyController class. Method signatures and docstrings: - def download_studies(self, start=None, count=None, user=None, auths=None): fetches studies :param start: for pagination start the result set at a record x :type sta...
Implement the Python class `StudyController` described below. Class description: Implement the StudyController class. Method signatures and docstrings: - def download_studies(self, start=None, count=None, user=None, auths=None): fetches studies :param start: for pagination start the result set at a record x :type sta...
c79d1eeb463788fb3e7be4e3193186f3a7418c9b
<|skeleton|> class StudyController: def download_studies(self, start=None, count=None, user=None, auths=None): """fetches studies :param start: for pagination start the result set at a record x :type start: int :param count: for pagination the number of entries to return :type count: int :rtype: Studies"""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StudyController: def download_studies(self, start=None, count=None, user=None, auths=None): """fetches studies :param start: for pagination start the result set at a record x :type start: int :param count: for pagination the number of entries to return :type count: int :rtype: Studies""" get =...
the_stack_v2_python_sparse
server/backbone_server/controllers/study_controller.py
benjeffery/sims-backbone
train
0
793d178cde87f245fc482e43a7e60879e283fb97
[ "values = []\nnames = []\nif space:\n for param in space:\n if param['type'] == TYPE.FLOAT or param['type'] == TYPE.INTEGER:\n msg = 'Unsupported parameter {}'.format(param['type'])\n raise Exception(msg)\n if shuffle:\n vls = random.sample(param['values'], len(para...
<|body_start_0|> values = [] names = [] if space: for param in space: if param['type'] == TYPE.FLOAT or param['type'] == TYPE.INTEGER: msg = 'Unsupported parameter {}'.format(param['type']) raise Exception(msg) i...
Grid Search is the most basic algorithmic method for hyper-parameter optimisation. It’s like running nested loops on all possible values of your inbuilt features making combinations of them. The result of the algorithm is a grid, where each node is a combinations of the hyper-parameter values. In this version, I added ...
GridSearch
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GridSearch: """Grid Search is the most basic algorithmic method for hyper-parameter optimisation. It’s like running nested loops on all possible values of your inbuilt features making combinations of them. The result of the algorithm is a grid, where each node is a combinations of the hyper-param...
stack_v2_sparse_classes_36k_train_017225
4,451
no_license
[ { "docstring": "Set up the space for making the parameter configurations with grid search algorithm. This function can shuffle the values for each parameter for fairly sampling (default behaviour). Args: :param space: list of parameters (id, name, type, values, ...) :param shuffle: shuffle the list of values fo...
3
stack_v2_sparse_classes_30k_train_012055
Implement the Python class `GridSearch` described below. Class description: Grid Search is the most basic algorithmic method for hyper-parameter optimisation. It’s like running nested loops on all possible values of your inbuilt features making combinations of them. The result of the algorithm is a grid, where each no...
Implement the Python class `GridSearch` described below. Class description: Grid Search is the most basic algorithmic method for hyper-parameter optimisation. It’s like running nested loops on all possible values of your inbuilt features making combinations of them. The result of the algorithm is a grid, where each no...
27f861c09615aedfd96cffdebf7d9653f72b4d7b
<|skeleton|> class GridSearch: """Grid Search is the most basic algorithmic method for hyper-parameter optimisation. It’s like running nested loops on all possible values of your inbuilt features making combinations of them. The result of the algorithm is a grid, where each node is a combinations of the hyper-param...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GridSearch: """Grid Search is the most basic algorithmic method for hyper-parameter optimisation. It’s like running nested loops on all possible values of your inbuilt features making combinations of them. The result of the algorithm is a grid, where each node is a combinations of the hyper-parameter values. ...
the_stack_v2_python_sparse
API/Algorithms/GridSearch.py
AndreaCorsini1/Ahmet
train
1
b224eac4dfb3aa0ace048e9a1a177cba9b8e55c1
[ "self._cr.execute('SELECT complete_name FROM stock_location WHERE complete_name = %s', (self.complete_name,))\nres = self._cr.fetchall()\nif res:\n raise ValidationError('Please use another Location Name. The Name already exists: ' + self.complete_name)", "if default is None:\n default = {}\nif 'name' not i...
<|body_start_0|> self._cr.execute('SELECT complete_name FROM stock_location WHERE complete_name = %s', (self.complete_name,)) res = self._cr.fetchall() if res: raise ValidationError('Please use another Location Name. The Name already exists: ' + self.complete_name) <|end_body_0|> <|...
flspStockLocation
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class flspStockLocation: def _constraint_only_unique_complete_name(self): """Date: Mar/16th/2021/Tuesday Purpose: To create only unique "complete name" (complete name = Parent Location / Location Name) To raise exception if the complete name exists Assumption: There may be duplicated complete ...
stack_v2_sparse_classes_36k_train_017226
1,591
no_license
[ { "docstring": "Date: Mar/16th/2021/Tuesday Purpose: To create only unique \"complete name\" (complete name = Parent Location / Location Name) To raise exception if the complete name exists Assumption: There may be duplicated complete names existing in database, so _sql_constraints would not work Author: Perry ...
2
stack_v2_sparse_classes_30k_train_012837
Implement the Python class `flspStockLocation` described below. Class description: Implement the flspStockLocation class. Method signatures and docstrings: - def _constraint_only_unique_complete_name(self): Date: Mar/16th/2021/Tuesday Purpose: To create only unique "complete name" (complete name = Parent Location / L...
Implement the Python class `flspStockLocation` described below. Class description: Implement the flspStockLocation class. Method signatures and docstrings: - def _constraint_only_unique_complete_name(self): Date: Mar/16th/2021/Tuesday Purpose: To create only unique "complete name" (complete name = Parent Location / L...
4a82cd5cfd1898c6da860cb68dff3a14e037bbad
<|skeleton|> class flspStockLocation: def _constraint_only_unique_complete_name(self): """Date: Mar/16th/2021/Tuesday Purpose: To create only unique "complete name" (complete name = Parent Location / Location Name) To raise exception if the complete name exists Assumption: There may be duplicated complete ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class flspStockLocation: def _constraint_only_unique_complete_name(self): """Date: Mar/16th/2021/Tuesday Purpose: To create only unique "complete name" (complete name = Parent Location / Location Name) To raise exception if the complete name exists Assumption: There may be duplicated complete names existing...
the_stack_v2_python_sparse
flspstock/models/flsp_stock_location.py
odoo-smg/firstlight
train
3
35eb14f18f7d14b130427e4c9492aa8f7a77a4b4
[ "if nmax < 0:\n return ValueError('nmax must be >= 0')\nsuper().__init__(self._Ux, nf=nmax + 1, nx=1, maxderiv=None, zlevel=None)\nself.nmax = nmax\nreturn", "nd, nvar = dfun.ndnvar(deriv, var, self.nx)\nif out is None:\n base_shape = X.shape[1:]\n out = np.ndarray((nd, self.nf) + base_shape, dtype=X.dty...
<|body_start_0|> if nmax < 0: return ValueError('nmax must be >= 0') super().__init__(self._Ux, nf=nmax + 1, nx=1, maxderiv=None, zlevel=None) self.nmax = nmax return <|end_body_0|> <|body_start_1|> nd, nvar = dfun.ndnvar(deriv, var, self.nx) if out is None: ...
Chebyshev polynomials of the second kind, :math:`U_n(x)`. Attributes ---------- nmax : int The maximum degree.
ChebyshevU
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ChebyshevU: """Chebyshev polynomials of the second kind, :math:`U_n(x)`. Attributes ---------- nmax : int The maximum degree.""" def __init__(self, nmax): """Create Chebyshev polynomial basis. Parameters ---------- nmax : int The maximum degree.""" <|body_0|> def _Ux(sel...
stack_v2_sparse_classes_36k_train_017227
39,055
permissive
[ { "docstring": "Create Chebyshev polynomial basis. Parameters ---------- nmax : int The maximum degree.", "name": "__init__", "signature": "def __init__(self, nmax)" }, { "docstring": "basis evaluation function Use recursion relations for Chebyshev polynomials of the first kind", "name": "_U...
2
stack_v2_sparse_classes_30k_train_007002
Implement the Python class `ChebyshevU` described below. Class description: Chebyshev polynomials of the second kind, :math:`U_n(x)`. Attributes ---------- nmax : int The maximum degree. Method signatures and docstrings: - def __init__(self, nmax): Create Chebyshev polynomial basis. Parameters ---------- nmax : int T...
Implement the Python class `ChebyshevU` described below. Class description: Chebyshev polynomials of the second kind, :math:`U_n(x)`. Attributes ---------- nmax : int The maximum degree. Method signatures and docstrings: - def __init__(self, nmax): Create Chebyshev polynomial basis. Parameters ---------- nmax : int T...
c6341a58331deef3728cc43c627c556139deb673
<|skeleton|> class ChebyshevU: """Chebyshev polynomials of the second kind, :math:`U_n(x)`. Attributes ---------- nmax : int The maximum degree.""" def __init__(self, nmax): """Create Chebyshev polynomial basis. Parameters ---------- nmax : int The maximum degree.""" <|body_0|> def _Ux(sel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ChebyshevU: """Chebyshev polynomials of the second kind, :math:`U_n(x)`. Attributes ---------- nmax : int The maximum degree.""" def __init__(self, nmax): """Create Chebyshev polynomial basis. Parameters ---------- nmax : int The maximum degree.""" if nmax < 0: return ValueErr...
the_stack_v2_python_sparse
nitrogen/special.py
bchangala/nitrogen
train
11
a5e1ef0e38f35a1a45cb2efd7e4b1cbaf0a87011
[ "result = super(TwistedSphinxInventory, self).getLink(name)\nif result is not None:\n return result\nif name.startswith('zope.interface.'):\n baseURL, _ = self._links.get('zope.interface.interfaces.IInterface', (None, None))\n if baseURL is None:\n return None\n if name == 'zope.interface.adapter...
<|body_start_0|> result = super(TwistedSphinxInventory, self).getLink(name) if result is not None: return result if name.startswith('zope.interface.'): baseURL, _ = self._links.get('zope.interface.interfaces.IInterface', (None, None)) if baseURL is None: ...
Custom SphinxInventory to work around broken external references to Sphinx. All exceptions should be reported upstream and a comment should be created with a link to the upstream report.
TwistedSphinxInventory
[ "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-free-unknown", "GPL-1.0-or-later", "OpenSSL", "LicenseRef-scancode-newlib-historical", "LicenseRef-scancode-python-cwi", "LicenseRef-scancode-openssl", "LicenseRef-scancode-other-copyleft", "Python-2.0", "LicenseRef-...
stack_v2_sparse_python_classes_v1
<|skeleton|> class TwistedSphinxInventory: """Custom SphinxInventory to work around broken external references to Sphinx. All exceptions should be reported upstream and a comment should be created with a link to the upstream report.""" def getLink(self, name): """Resolve the full URL for a cross refere...
stack_v2_sparse_classes_36k_train_017228
8,208
permissive
[ { "docstring": "Resolve the full URL for a cross reference. @param name: Value of the cross reference. @type name: L{str} @return: A full URL for the I{name} reference or L{None} if no link was found. @rtype: L{str} or L{None}", "name": "getLink", "signature": "def getLink(self, name)" }, { "doc...
2
stack_v2_sparse_classes_30k_train_017755
Implement the Python class `TwistedSphinxInventory` described below. Class description: Custom SphinxInventory to work around broken external references to Sphinx. All exceptions should be reported upstream and a comment should be created with a link to the upstream report. Method signatures and docstrings: - def get...
Implement the Python class `TwistedSphinxInventory` described below. Class description: Custom SphinxInventory to work around broken external references to Sphinx. All exceptions should be reported upstream and a comment should be created with a link to the upstream report. Method signatures and docstrings: - def get...
095ad7a2fe583033fb7e2070f3f8920a6e88b323
<|skeleton|> class TwistedSphinxInventory: """Custom SphinxInventory to work around broken external references to Sphinx. All exceptions should be reported upstream and a comment should be created with a link to the upstream report.""" def getLink(self, name): """Resolve the full URL for a cross refere...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TwistedSphinxInventory: """Custom SphinxInventory to work around broken external references to Sphinx. All exceptions should be reported upstream and a comment should be created with a link to the upstream report.""" def getLink(self, name): """Resolve the full URL for a cross reference. @param n...
the_stack_v2_python_sparse
evennia/evenv/Lib/site-packages/twisted/python/_pydoctor.py
castlelorestudios/EvenniaPluginSampleProject
train
3
19bd48758a6421e2e7556ef332d9b50f8fe1a53f
[ "if wx.Platform == '__WXMSW__' and platform.win32_ver()[0] == 'XP' and (wx.VERSION[0] < 3):\n self.image = [wx.Image(icon_path + 'scan-stop-win.png'), wx.Image(icon_path + 'scan-start-win.png')]\nelse:\n self.image = [wx.Image(icon_path + 'scan-stop.png'), wx.Image(icon_path + 'scan-start.png')]\nmap(lambda x...
<|body_start_0|> if wx.Platform == '__WXMSW__' and platform.win32_ver()[0] == 'XP' and (wx.VERSION[0] < 3): self.image = [wx.Image(icon_path + 'scan-stop-win.png'), wx.Image(icon_path + 'scan-start-win.png')] else: self.image = [wx.Image(icon_path + 'scan-stop.png'), wx.Image(ico...
Graphical run/stop button with toggle function
RunButton
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RunButton: """Graphical run/stop button with toggle function""" def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr): """Initialization.""" <|body_0|> def Switch(self, s...
stack_v2_sparse_classes_36k_train_017229
3,587
no_license
[ { "docstring": "Initialization.", "name": "__init__", "signature": "def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr)" }, { "docstring": "Switch between run and stop states (run = True, stop ...
2
stack_v2_sparse_classes_30k_train_013615
Implement the Python class `RunButton` described below. Class description: Graphical run/stop button with toggle function Method signatures and docstrings: - def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr): Init...
Implement the Python class `RunButton` described below. Class description: Graphical run/stop button with toggle function Method signatures and docstrings: - def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr): Init...
712accd3534ca35ae4c5c7f1c9c33fc935552ca6
<|skeleton|> class RunButton: """Graphical run/stop button with toggle function""" def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr): """Initialization.""" <|body_0|> def Switch(self, s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RunButton: """Graphical run/stop button with toggle function""" def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr): """Initialization.""" if wx.Platform == '__WXMSW__' and platform.win3...
the_stack_v2_python_sparse
terapy/core/button.py
dawidgadziala/terapy
train
0
a0971427722cdcd71c00580730cc43f25105c5f4
[ "self.rects = rects\nacc = 0\nself.ranges = []\nfor x1, y1, x2, y2 in rects:\n area = (x2 - x1 + 1) * (y2 - y1 + 1)\n acc += area\n self.ranges.append(acc)", "idx = bisect.bisect_left(self.ranges, random.randint(1, self.ranges[-1]))\nx1, y1, x2, y2 = self.rects[idx]\nreturn [random.randint(x1, x2), rando...
<|body_start_0|> self.rects = rects acc = 0 self.ranges = [] for x1, y1, x2, y2 in rects: area = (x2 - x1 + 1) * (y2 - y1 + 1) acc += area self.ranges.append(acc) <|end_body_0|> <|body_start_1|> idx = bisect.bisect_left(self.ranges, random.ran...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def __init__(self, rects): """:type rects: List[List[int]]""" <|body_0|> def pick(self): """:rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.rects = rects acc = 0 self.ranges = [] for x1, y1, x...
stack_v2_sparse_classes_36k_train_017230
711
permissive
[ { "docstring": ":type rects: List[List[int]]", "name": "__init__", "signature": "def __init__(self, rects)" }, { "docstring": ":rtype: List[int]", "name": "pick", "signature": "def pick(self)" } ]
2
stack_v2_sparse_classes_30k_train_003922
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, rects): :type rects: List[List[int]] - def pick(self): :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, rects): :type rects: List[List[int]] - def pick(self): :rtype: List[int] <|skeleton|> class Solution: def __init__(self, rects): """:type rects: ...
3719f5cb059eefd66b83eb8ae990652f4b7fd124
<|skeleton|> class Solution: def __init__(self, rects): """:type rects: List[List[int]]""" <|body_0|> def pick(self): """:rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def __init__(self, rects): """:type rects: List[List[int]]""" self.rects = rects acc = 0 self.ranges = [] for x1, y1, x2, y2 in rects: area = (x2 - x1 + 1) * (y2 - y1 + 1) acc += area self.ranges.append(acc) def pick(se...
the_stack_v2_python_sparse
Python3/0497-Random-Point-in-Non-Overlapping-Rectangles/soln.py
wyaadarsh/LeetCode-Solutions
train
0
8b40ec1c8eeb6791438e2dc7605bbcc62cd94ba3
[ "if value in validators.EMPTY_VALUES:\n return {}\nelif not isinstance(value, dict):\n raise ValidationError(self.error_messages['invalid_value'], code='invalid_value')\nreturn value", "if not set(value.keys()) <= {k for k, _ in self.choices}:\n raise ValidationError(self.error_messages['invalid_choice']...
<|body_start_0|> if value in validators.EMPTY_VALUES: return {} elif not isinstance(value, dict): raise ValidationError(self.error_messages['invalid_value'], code='invalid_value') return value <|end_body_0|> <|body_start_1|> if not set(value.keys()) <= {k for k, ...
A multiple choice checkbox field where checkboxes has three states. States are: - Checked - Unchecked - Indeterminate It takes a ``dict`` instance as a value, where keys are internal values from `choices` and values are ones from following (in order respectively to states): - True - False - None
TriStateMultipleChoiceField
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TriStateMultipleChoiceField: """A multiple choice checkbox field where checkboxes has three states. States are: - Checked - Unchecked - Indeterminate It takes a ``dict`` instance as a value, where keys are internal values from `choices` and values are ones from following (in order respectively to...
stack_v2_sparse_classes_36k_train_017231
2,623
permissive
[ { "docstring": "Checks if value, that comes from widget, is a dict.", "name": "to_python", "signature": "def to_python(self, value)" }, { "docstring": "Ensures that value has only allowed values.", "name": "validate", "signature": "def validate(self, value)" } ]
2
stack_v2_sparse_classes_30k_train_009294
Implement the Python class `TriStateMultipleChoiceField` described below. Class description: A multiple choice checkbox field where checkboxes has three states. States are: - Checked - Unchecked - Indeterminate It takes a ``dict`` instance as a value, where keys are internal values from `choices` and values are ones f...
Implement the Python class `TriStateMultipleChoiceField` described below. Class description: A multiple choice checkbox field where checkboxes has three states. States are: - Checked - Unchecked - Indeterminate It takes a ``dict`` instance as a value, where keys are internal values from `choices` and values are ones f...
54e2ea8a71385b1c7624b3d2c8056bd8a2c2e2f7
<|skeleton|> class TriStateMultipleChoiceField: """A multiple choice checkbox field where checkboxes has three states. States are: - Checked - Unchecked - Indeterminate It takes a ``dict`` instance as a value, where keys are internal values from `choices` and values are ones from following (in order respectively to...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TriStateMultipleChoiceField: """A multiple choice checkbox field where checkboxes has three states. States are: - Checked - Unchecked - Indeterminate It takes a ``dict`` instance as a value, where keys are internal values from `choices` and values are ones from following (in order respectively to states): - T...
the_stack_v2_python_sparse
muranodashboard/common/fields.py
openstack/murano-dashboard
train
38
08f536014ddb6a1457d9dcd8a51983cf5316ecbe
[ "super(Decoder, self).__init__()\nself.N = N\nself.dm = dm\nself.embedding = tf.keras.layers.Embedding(target_vocab, dm)\nself.positional_encoding = positional_encoding(max_seq_len, dm)\nself.blocks = [DecoderBlock(dm, h, hidden, drop_rate) for _ in range(N)]\nself.dropout = tf.keras.layers.Dropout(drop_rate)", "...
<|body_start_0|> super(Decoder, self).__init__() self.N = N self.dm = dm self.embedding = tf.keras.layers.Embedding(target_vocab, dm) self.positional_encoding = positional_encoding(max_seq_len, dm) self.blocks = [DecoderBlock(dm, h, hidden, drop_rate) for _ in range(N)] ...
Decoder class
Decoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Decoder: """Decoder class""" def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): """Class constructor :param N: number of blocks in the encoder :param dm: dimensionality of the model :param h: number of heads :param hidden: number of hidden units in the fu...
stack_v2_sparse_classes_36k_train_017232
2,482
no_license
[ { "docstring": "Class constructor :param N: number of blocks in the encoder :param dm: dimensionality of the model :param h: number of heads :param hidden: number of hidden units in the fully connected layer :param target_vocab: size of the target vocabulary :param max_seq_len: maximum sequence length possible ...
2
stack_v2_sparse_classes_30k_val_000364
Implement the Python class `Decoder` described below. Class description: Decoder class Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): Class constructor :param N: number of blocks in the encoder :param dm: dimensionality of the model :param h: number...
Implement the Python class `Decoder` described below. Class description: Decoder class Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): Class constructor :param N: number of blocks in the encoder :param dm: dimensionality of the model :param h: number...
f83a60babb1d2a510a4a0e0f58aa3880fd9f93a7
<|skeleton|> class Decoder: """Decoder class""" def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): """Class constructor :param N: number of blocks in the encoder :param dm: dimensionality of the model :param h: number of heads :param hidden: number of hidden units in the fu...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Decoder: """Decoder class""" def __init__(self, N, dm, h, hidden, target_vocab, max_seq_len, drop_rate=0.1): """Class constructor :param N: number of blocks in the encoder :param dm: dimensionality of the model :param h: number of heads :param hidden: number of hidden units in the fully connected...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/10-transformer_decoder.py
jalondono/holbertonschool-machine_learning
train
2
9db99ac6d82dca7c63f3b7789ff86ee960227654
[ "self.name = name\nself.kernel_regularizer = kernel_regularizer\nself.bias_regularizer = bias_regularizer", "func_name = 'get_discriminator_logits'\nprint_obj('\\n' + func_name, 'source_image', source_image)\nprint_obj(func_name, 'target_image', target_image)\nkernel_initializer = tf.random_normal_initializer(mea...
<|body_start_0|> self.name = name self.kernel_regularizer = kernel_regularizer self.bias_regularizer = bias_regularizer <|end_body_0|> <|body_start_1|> func_name = 'get_discriminator_logits' print_obj('\n' + func_name, 'source_image', source_image) print_obj(func_name, '...
Discriminator that takes image input and outputs logits. Fields: name: str, name of `Discriminator`. kernel_regularizer: `l1_l2_regularizer` object, regularizar for kernel variables. bias_regularizer: `l1_l2_regularizer` object, regularizar for bias variables.
Discriminator
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Discriminator: """Discriminator that takes image input and outputs logits. Fields: name: str, name of `Discriminator`. kernel_regularizer: `l1_l2_regularizer` object, regularizar for kernel variables. bias_regularizer: `l1_l2_regularizer` object, regularizar for bias variables.""" def __init...
stack_v2_sparse_classes_36k_train_017233
7,975
permissive
[ { "docstring": "Instantiates and builds discriminator network. Args: kernel_regularizer: `l1_l2_regularizer` object, regularizar for kernel variables. bias_regularizer: `l1_l2_regularizer` object, regularizar for bias variables. name: str, name of discriminator.", "name": "__init__", "signature": "def _...
3
stack_v2_sparse_classes_30k_train_016297
Implement the Python class `Discriminator` described below. Class description: Discriminator that takes image input and outputs logits. Fields: name: str, name of `Discriminator`. kernel_regularizer: `l1_l2_regularizer` object, regularizar for kernel variables. bias_regularizer: `l1_l2_regularizer` object, regularizar...
Implement the Python class `Discriminator` described below. Class description: Discriminator that takes image input and outputs logits. Fields: name: str, name of `Discriminator`. kernel_regularizer: `l1_l2_regularizer` object, regularizar for kernel variables. bias_regularizer: `l1_l2_regularizer` object, regularizar...
f7c21af221f366b075d351deeeb00a1b266ac3e3
<|skeleton|> class Discriminator: """Discriminator that takes image input and outputs logits. Fields: name: str, name of `Discriminator`. kernel_regularizer: `l1_l2_regularizer` object, regularizar for kernel variables. bias_regularizer: `l1_l2_regularizer` object, regularizar for bias variables.""" def __init...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Discriminator: """Discriminator that takes image input and outputs logits. Fields: name: str, name of `Discriminator`. kernel_regularizer: `l1_l2_regularizer` object, regularizar for kernel variables. bias_regularizer: `l1_l2_regularizer` object, regularizar for bias variables.""" def __init__(self, kern...
the_stack_v2_python_sparse
machine_learning/gan/pix2pix/tf_pix2pix/pix2pix_module/trainer/discriminator.py
ryangillard/artificial_intelligence
train
4
5a11575d7c72aaf583c4c5de6518ce49b9ff5e39
[ "dict_ = self.to_serialize(json_)\nschema = self.__class__._schema(name=self.__class__.__name__, distribution=self.distribution._schema(name='distribution'))\nreturn schema.serialize(dict_)", "dcls = class_from_objtype(json_['distribution']['obj_type'])\nschema = cls._schema(name=cls.__name__, distribution=dcls._...
<|body_start_0|> dict_ = self.to_serialize(json_) schema = self.__class__._schema(name=self.__class__.__name__, distribution=self.distribution._schema(name='distribution')) return schema.serialize(dict_) <|end_body_0|> <|body_start_1|> dcls = class_from_objtype(json_['distribution']['ob...
Define a base class for all initializers that contain a distribution. Keep the code to serialize/deserialize distribution objects here so we only have to write it once.
DistributionBase
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DistributionBase: """Define a base class for all initializers that contain a distribution. Keep the code to serialize/deserialize distribution objects here so we only have to write it once.""" def serialize(self, json_='webapi'): """Add distribution schema based on "distribution" - t...
stack_v2_sparse_classes_36k_train_017234
13,705
no_license
[ { "docstring": "Add distribution schema based on \"distribution\" - then serialize", "name": "serialize", "signature": "def serialize(self, json_='webapi')" }, { "docstring": "Add distribution schema based on \"distribution\" - then deserialize", "name": "deserialize", "signature": "def ...
2
null
Implement the Python class `DistributionBase` described below. Class description: Define a base class for all initializers that contain a distribution. Keep the code to serialize/deserialize distribution objects here so we only have to write it once. Method signatures and docstrings: - def serialize(self, json_='weba...
Implement the Python class `DistributionBase` described below. Class description: Define a base class for all initializers that contain a distribution. Keep the code to serialize/deserialize distribution objects here so we only have to write it once. Method signatures and docstrings: - def serialize(self, json_='weba...
2e24d53b8b1099022a08ad73377ed6d1c7838f0f
<|skeleton|> class DistributionBase: """Define a base class for all initializers that contain a distribution. Keep the code to serialize/deserialize distribution objects here so we only have to write it once.""" def serialize(self, json_='webapi'): """Add distribution schema based on "distribution" - t...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DistributionBase: """Define a base class for all initializers that contain a distribution. Keep the code to serialize/deserialize distribution objects here so we only have to write it once.""" def serialize(self, json_='webapi'): """Add distribution schema based on "distribution" - then serialize...
the_stack_v2_python_sparse
py_gnome/gnome/spill/elements/initializers.py
bhattvihang/PyGnome
train
1
4a2451b6472d220d9c590f7ed3347f0091a2f559
[ "res = []\nstack = []\ncur = root\nwhile stack or cur:\n if cur:\n res.append(cur.val)\n stack.append(cur)\n cur = cur.left\n else:\n cur = stack.pop()\n cur = cur.right\nreturn ' '.join(map(str, res))", "stack = []\ndata_arr = map(int, data.split())\nif len(data_arr) == 0...
<|body_start_0|> res = [] stack = [] cur = root while stack or cur: if cur: res.append(cur.val) stack.append(cur) cur = cur.left else: cur = stack.pop() cur = cur.right return ...
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://discuss.leetcode.com/topic/80043/concise-iterative-python-solution-using-stack-beat-99/3 utilize BST feature (if-else block in deserialize() function) beats 93.27%""" ...
stack_v2_sparse_classes_36k_train_017235
5,528
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str https://discuss.leetcode.com/topic/80043/concise-iterative-python-solution-using-stack-beat-99/3 utilize BST feature (if-else block in deserialize() function) beats 93.27%", "name": "serialize", "signature": "def seriali...
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://discuss.leetcode.com/topic/80043/concise-iterative-python-solution-using-stack-be...
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://discuss.leetcode.com/topic/80043/concise-iterative-python-solution-using-stack-be...
7e0e917c15d3e35f49da3a00ef395bd5ff180d79
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str https://discuss.leetcode.com/topic/80043/concise-iterative-python-solution-using-stack-beat-99/3 utilize BST feature (if-else block in deserialize() function) beats 93.27%""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str https://discuss.leetcode.com/topic/80043/concise-iterative-python-solution-using-stack-beat-99/3 utilize BST feature (if-else block in deserialize() function) beats 93.27%""" res = [] ...
the_stack_v2_python_sparse
LeetCode/449_serialize_and_deserialize_bst.py
yao23/Machine_Learning_Playground
train
12
e9058520b951c5bb41a7fe729112c84195916f8a
[ "user = request.user\nif is_superuser_or_manager(user):\n return super(ClientAdminConfig, self).get_queryset(request)\nreturn Client.objects.filter(Q(main_sales_contact=user) | Q(contracts__sales_contact=user) | Q(contracts__event__support_contact=user)).distinct()", "if is_seller(request.user):\n return Tr...
<|body_start_0|> user = request.user if is_superuser_or_manager(user): return super(ClientAdminConfig, self).get_queryset(request) return Client.objects.filter(Q(main_sales_contact=user) | Q(contracts__sales_contact=user) | Q(contracts__event__support_contact=user)).distinct() <|end_...
Set view and CRUD permissions over the Client module for an authenticated user in the admin page. A superuser or a manager has all permissions. Any seller can create (add) a client but only the main sales contact (main seller of this client) can update and delete this client.
ClientAdminConfig
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClientAdminConfig: """Set view and CRUD permissions over the Client module for an authenticated user in the admin page. A superuser or a manager has all permissions. Any seller can create (add) a client but only the main sales contact (main seller of this client) can update and delete this client...
stack_v2_sparse_classes_36k_train_017236
2,874
no_license
[ { "docstring": "Sellers, supporters can see theirs own clients.", "name": "get_queryset", "signature": "def get_queryset(self, request)" }, { "docstring": "Superuser, member of Managers group or Sellers group can add a client.", "name": "has_add_permission", "signature": "def has_add_per...
6
stack_v2_sparse_classes_30k_val_000431
Implement the Python class `ClientAdminConfig` described below. Class description: Set view and CRUD permissions over the Client module for an authenticated user in the admin page. A superuser or a manager has all permissions. Any seller can create (add) a client but only the main sales contact (main seller of this cl...
Implement the Python class `ClientAdminConfig` described below. Class description: Set view and CRUD permissions over the Client module for an authenticated user in the admin page. A superuser or a manager has all permissions. Any seller can create (add) a client but only the main sales contact (main seller of this cl...
50c9de9cbc5f11409b6eac211503491f72e21348
<|skeleton|> class ClientAdminConfig: """Set view and CRUD permissions over the Client module for an authenticated user in the admin page. A superuser or a manager has all permissions. Any seller can create (add) a client but only the main sales contact (main seller of this client) can update and delete this client...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ClientAdminConfig: """Set view and CRUD permissions over the Client module for an authenticated user in the admin page. A superuser or a manager has all permissions. Any seller can create (add) a client but only the main sales contact (main seller of this client) can update and delete this client.""" def...
the_stack_v2_python_sparse
epicevents_project/events/admin_config/client_admin_config.py
ThiHieuLUU/OCProject12_Event_Management_with_DjangoREST
train
0
d05f400552ebf568250df561dea2196126921694
[ "super().__init__()\nif weights is not None:\n if weights.dim() != 2 or weights.shape[0] != n_w:\n raise ValueError('`weights` must be a tensor of size `n_w x m`.')\n if torch.any(weights < 0):\n raise ValueError('`weights` must be non-negative.')\nelse:\n weights = torch.ones(n_w, 1)\nweight...
<|body_start_0|> super().__init__() if weights is not None: if weights.dim() != 2 or weights.shape[0] != n_w: raise ValueError('`weights` must be a tensor of size `n_w x m`.') if torch.any(weights < 0): raise ValueError('`weights` must be non-negat...
Transform the `batch x (q * n_w) x m` posterior into a `batch x q x m` posterior of the expectation. The expectation is calculated over each consecutive `n_w` block of points in the posterior. This is intended for use with `InputPerturbation` or `AppendFeatures` for optimizing the expectation over `n_w` points. This sh...
ExpectationPosteriorTransform
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ExpectationPosteriorTransform: """Transform the `batch x (q * n_w) x m` posterior into a `batch x q x m` posterior of the expectation. The expectation is calculated over each consecutive `n_w` block of points in the posterior. This is intended for use with `InputPerturbation` or `AppendFeatures` ...
stack_v2_sparse_classes_36k_train_017237
22,827
permissive
[ { "docstring": "A posterior transform calculating the expectation over the q-batch dimension. Args: n_w: The number of points in the q-batch of the posterior to compute the expectation over. This corresponds to the size of the `feature_set` of `AppendFeatures` or the size of the `perturbation_set` of `InputPert...
3
stack_v2_sparse_classes_30k_train_008008
Implement the Python class `ExpectationPosteriorTransform` described below. Class description: Transform the `batch x (q * n_w) x m` posterior into a `batch x q x m` posterior of the expectation. The expectation is calculated over each consecutive `n_w` block of points in the posterior. This is intended for use with `...
Implement the Python class `ExpectationPosteriorTransform` described below. Class description: Transform the `batch x (q * n_w) x m` posterior into a `batch x q x m` posterior of the expectation. The expectation is calculated over each consecutive `n_w` block of points in the posterior. This is intended for use with `...
4cc5ed59b2e8a9c780f786830c548e05cc74d53c
<|skeleton|> class ExpectationPosteriorTransform: """Transform the `batch x (q * n_w) x m` posterior into a `batch x q x m` posterior of the expectation. The expectation is calculated over each consecutive `n_w` block of points in the posterior. This is intended for use with `InputPerturbation` or `AppendFeatures` ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ExpectationPosteriorTransform: """Transform the `batch x (q * n_w) x m` posterior into a `batch x q x m` posterior of the expectation. The expectation is calculated over each consecutive `n_w` block of points in the posterior. This is intended for use with `InputPerturbation` or `AppendFeatures` for optimizin...
the_stack_v2_python_sparse
botorch/acquisition/objective.py
pytorch/botorch
train
2,891
6f5dd294ad55df4bafaf58136d7f79820b3dca5a
[ "if graph.is_directed():\n raise ValueError('the graph is directed')\nself.graph = graph\nself.mst = None\nself.distance = dict(((node, float('inf')) for node in self.graph.iternodes()))\nself.parent = dict(((node, None) for node in self.graph.iternodes()))\nself._in_queue = dict(((node, True) for node in self.g...
<|body_start_0|> if graph.is_directed(): raise ValueError('the graph is directed') self.graph = graph self.mst = None self.distance = dict(((node, float('inf')) for node in self.graph.iternodes())) self.parent = dict(((node, None) for node in self.graph.iternodes())) ...
Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(V**2) time. It is suitable for dense graphs. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with nodes parent : dict with nodes (MST) _in_queue : dict, private Examples -------- >...
PrimMatrixMST
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PrimMatrixMST: """Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(V**2) time. It is suitable for dense graphs. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with nodes parent : dict with nodes (MST) _in_...
stack_v2_sparse_classes_36k_train_017238
14,685
permissive
[ { "docstring": "The algorithm initialization. Parameters ---------- graph : undirected weighted graph or multigraph", "name": "__init__", "signature": "def __init__(self, graph)" }, { "docstring": "Finding MST.", "name": "run", "signature": "def run(self, source=None)" }, { "docs...
3
stack_v2_sparse_classes_30k_train_000429
Implement the Python class `PrimMatrixMST` described below. Class description: Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(V**2) time. It is suitable for dense graphs. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with no...
Implement the Python class `PrimMatrixMST` described below. Class description: Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(V**2) time. It is suitable for dense graphs. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with no...
0ff4ae303e8824e6bb8474d23b29a7b3e5ed8e60
<|skeleton|> class PrimMatrixMST: """Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(V**2) time. It is suitable for dense graphs. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with nodes parent : dict with nodes (MST) _in_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PrimMatrixMST: """Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(V**2) time. It is suitable for dense graphs. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with nodes parent : dict with nodes (MST) _in_queue : dict,...
the_stack_v2_python_sparse
graphtheory/spanningtrees/prim.py
kgashok/graphs-dict
train
0
75f9a3e72acb528e28996dbe8b245fcee93b5ddb
[ "if isinstance(evaluable, ParameterContainer):\n self.wrappingEvaluable = evaluable.copy()\n self._wasUnwrapped = True\nelif not (evaluable is None or isinstance(evaluable, list) or isinstance(evaluable, ndarray)):\n raise ValueError('Continuous optimization algorithms require a list, array or' + ' Paramet...
<|body_start_0|> if isinstance(evaluable, ParameterContainer): self.wrappingEvaluable = evaluable.copy() self._wasUnwrapped = True elif not (evaluable is None or isinstance(evaluable, list) or isinstance(evaluable, ndarray)): raise ValueError('Continuous optimization ...
A more restricted class of black-box optimization algorithms that assume the parameters to be necessarily an array of continuous values (which can be wrapped in a ParameterContainer).
ContinuousOptimizer
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ContinuousOptimizer: """A more restricted class of black-box optimization algorithms that assume the parameters to be necessarily an array of continuous values (which can be wrapped in a ParameterContainer).""" def _setInitEvaluable(self, evaluable): """If the parameters are wrapped,...
stack_v2_sparse_classes_36k_train_017239
15,225
permissive
[ { "docstring": "If the parameters are wrapped, we keep track of the wrapper explicitly.", "name": "_setInitEvaluable", "signature": "def _setInitEvaluable(self, evaluable)" }, { "docstring": "return the best found evaluable and its associated fitness.", "name": "_bestFound", "signature":...
2
null
Implement the Python class `ContinuousOptimizer` described below. Class description: A more restricted class of black-box optimization algorithms that assume the parameters to be necessarily an array of continuous values (which can be wrapped in a ParameterContainer). Method signatures and docstrings: - def _setInitE...
Implement the Python class `ContinuousOptimizer` described below. Class description: A more restricted class of black-box optimization algorithms that assume the parameters to be necessarily an array of continuous values (which can be wrapped in a ParameterContainer). Method signatures and docstrings: - def _setInitE...
33ead60704d126e58c10d458ddd1e5e5fd17b65d
<|skeleton|> class ContinuousOptimizer: """A more restricted class of black-box optimization algorithms that assume the parameters to be necessarily an array of continuous values (which can be wrapped in a ParameterContainer).""" def _setInitEvaluable(self, evaluable): """If the parameters are wrapped,...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ContinuousOptimizer: """A more restricted class of black-box optimization algorithms that assume the parameters to be necessarily an array of continuous values (which can be wrapped in a ParameterContainer).""" def _setInitEvaluable(self, evaluable): """If the parameters are wrapped, we keep trac...
the_stack_v2_python_sparse
pybrain/optimization/optimizer.py
pybrain2/pybrain2
train
14
ccdbffe2baf6763df170dd061db57bc0425120db
[ "if not contains_empty and value is None:\n return None\nsession = session or Session()\nargs = {}\nargs[column] = value\nif not contains_deleted:\n args['deleted_at'] = None\nquery = session.query(cls).filter_by(**args)\nif for_update:\n query = query.with_for_update()\nreturn query.first()", "session =...
<|body_start_0|> if not contains_empty and value is None: return None session = session or Session() args = {} args[column] = value if not contains_deleted: args['deleted_at'] = None query = session.query(cls).filter_by(**args) if for_updat...
Query helper functions useful to all models. This class is inherited by ``IDBase`` and ``UUIDBase`` classes, so your class will not need to inherit directly from it.
QueryMixin
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class QueryMixin: """Query helper functions useful to all models. This class is inherited by ``IDBase`` and ``UUIDBase`` classes, so your class will not need to inherit directly from it.""" def get_by(cls, column, value, for_update=False, contains_deleted=False, contains_empty=False, session=None)...
stack_v2_sparse_classes_36k_train_017240
10,855
permissive
[ { "docstring": "Get the object satisfying the query condition. :param string column: The name of the column to query by. :param string value: The value of the column to query for. :param boolean for_update: Whether the query is for updating the row. :param boolean contains_deleted: Whether to contain deleted re...
2
stack_v2_sparse_classes_30k_train_004191
Implement the Python class `QueryMixin` described below. Class description: Query helper functions useful to all models. This class is inherited by ``IDBase`` and ``UUIDBase`` classes, so your class will not need to inherit directly from it. Method signatures and docstrings: - def get_by(cls, column, value, for_updat...
Implement the Python class `QueryMixin` described below. Class description: Query helper functions useful to all models. This class is inherited by ``IDBase`` and ``UUIDBase`` classes, so your class will not need to inherit directly from it. Method signatures and docstrings: - def get_by(cls, column, value, for_updat...
f296341adb0dbbfb361eaf8b815b0ffd189ebf58
<|skeleton|> class QueryMixin: """Query helper functions useful to all models. This class is inherited by ``IDBase`` and ``UUIDBase`` classes, so your class will not need to inherit directly from it.""" def get_by(cls, column, value, for_update=False, contains_deleted=False, contains_empty=False, session=None)...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class QueryMixin: """Query helper functions useful to all models. This class is inherited by ``IDBase`` and ``UUIDBase`` classes, so your class will not need to inherit directly from it.""" def get_by(cls, column, value, for_update=False, contains_deleted=False, contains_empty=False, session=None): """...
the_stack_v2_python_sparse
dq/orm.py
danqing/dqpy
train
0
cc5708aff1048b5d80701e954d8c4c8abf2ae701
[ "i, numlist = (1, [])\nwhile i ** 2 <= n:\n numlist.append(i ** 2)\n i += 1\nqueue = {n}\ncount = 0\nwhile queue:\n nextqueue = set()\n count += 1\n for i in queue:\n for k in numlist:\n if i == k:\n return count\n if i > k:\n nextqueue.add(i...
<|body_start_0|> i, numlist = (1, []) while i ** 2 <= n: numlist.append(i ** 2) i += 1 queue = {n} count = 0 while queue: nextqueue = set() count += 1 for i in queue: for k in numlist: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def numSquares1(self, n): """:type n: int :rtype: int""" <|body_0|> def numSquares(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> i, numlist = (1, []) while i ** 2 <= n: numlist.ap...
stack_v2_sparse_classes_36k_train_017241
1,327
no_license
[ { "docstring": ":type n: int :rtype: int", "name": "numSquares1", "signature": "def numSquares1(self, n)" }, { "docstring": ":type n: int :rtype: int", "name": "numSquares", "signature": "def numSquares(self, n)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numSquares1(self, n): :type n: int :rtype: int - def numSquares(self, n): :type n: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numSquares1(self, n): :type n: int :rtype: int - def numSquares(self, n): :type n: int :rtype: int <|skeleton|> class Solution: def numSquares1(self, n): """:ty...
fc5f0d70ca35789600a7e1d7ec356f648d09a7bf
<|skeleton|> class Solution: def numSquares1(self, n): """:type n: int :rtype: int""" <|body_0|> def numSquares(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def numSquares1(self, n): """:type n: int :rtype: int""" i, numlist = (1, []) while i ** 2 <= n: numlist.append(i ** 2) i += 1 queue = {n} count = 0 while queue: nextqueue = set() count += 1 f...
the_stack_v2_python_sparse
Perfect Squares.py
zpyao1996/leetcode
train
0
9f6c00c27e62b4337fb8e30581decd033654cec1
[ "if isinstance(data, dict) and ('and' in data or 'or' in data) or (isinstance(data, tuple) and data[0] in ['and', 'or']):\n return self.filter_group_transform(data)\nelif isinstance(data, dict) and ('property' in data and 'operator' in data and ('value' in data)) or (isinstance(data, tuple) and len(data) == 3):\...
<|body_start_0|> if isinstance(data, dict) and ('and' in data or 'or' in data) or (isinstance(data, tuple) and data[0] in ['and', 'or']): return self.filter_group_transform(data) elif isinstance(data, dict) and ('property' in data and 'operator' in data and ('value' in data)) or (isinstance(...
Schema supporting both the Filter and FilterGroups for V3 endpoints
FilterSchemaV3
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FilterSchemaV3: """Schema supporting both the Filter and FilterGroups for V3 endpoints""" def validate_and_transform(self, data, **kwargs): """Handles schema validation and data transform based on the data presented.""" <|body_0|> def filter_group_transform(self, data: U...
stack_v2_sparse_classes_36k_train_017242
5,674
permissive
[ { "docstring": "Handles schema validation and data transform based on the data presented.", "name": "validate_and_transform", "signature": "def validate_and_transform(self, data, **kwargs)" }, { "docstring": "Handles expanding a tuple definition of a filter group into the dictionary equivalent. ...
4
null
Implement the Python class `FilterSchemaV3` described below. Class description: Schema supporting both the Filter and FilterGroups for V3 endpoints Method signatures and docstrings: - def validate_and_transform(self, data, **kwargs): Handles schema validation and data transform based on the data presented. - def filt...
Implement the Python class `FilterSchemaV3` described below. Class description: Schema supporting both the Filter and FilterGroups for V3 endpoints Method signatures and docstrings: - def validate_and_transform(self, data, **kwargs): Handles schema validation and data transform based on the data presented. - def filt...
4e31049891f55016168b14ae30d332a965523640
<|skeleton|> class FilterSchemaV3: """Schema supporting both the Filter and FilterGroups for V3 endpoints""" def validate_and_transform(self, data, **kwargs): """Handles schema validation and data transform based on the data presented.""" <|body_0|> def filter_group_transform(self, data: U...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FilterSchemaV3: """Schema supporting both the Filter and FilterGroups for V3 endpoints""" def validate_and_transform(self, data, **kwargs): """Handles schema validation and data transform based on the data presented.""" if isinstance(data, dict) and ('and' in data or 'or' in data) or (isi...
the_stack_v2_python_sparse
tenable/io/v3/base/schema/explore/filters.py
tenable/pyTenable
train
300
07824ae51a8e02e53b60da8604ed27d196e11b17
[ "body = settings.RETRIEVAL_EMAIL_BODY % {'retrieved_by': user.user.email(), 'hostname': entity.hostname, 'platform_uuid': entity.platform_uuid, 'serial': entity.serial or '', 'hdd_serial': entity.hdd_serial, 'volume_uuid': entity.volume_uuid, 'helpdesk_name': settings.HELPDESK_NAME}\nuser_email = user.user.email()\...
<|body_start_0|> body = settings.RETRIEVAL_EMAIL_BODY % {'retrieved_by': user.user.email(), 'hostname': entity.hostname, 'platform_uuid': entity.platform_uuid, 'serial': entity.serial or '', 'hdd_serial': entity.hdd_serial, 'volume_uuid': entity.volume_uuid, 'helpdesk_name': settings.HELPDESK_NAME} user...
Handler for /filevault URL.
FileVault
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileVault: """Handler for /filevault URL.""" def SendRetrievalEmail(self, entity, user): """Sends a retrieval notification email to the owner of a Mac. Args: entity: models.FileVaultVolume object that was retrieved. user: models.User object of the user that retrieved the passphrase."...
stack_v2_sparse_classes_36k_train_017243
5,744
permissive
[ { "docstring": "Sends a retrieval notification email to the owner of a Mac. Args: entity: models.FileVaultVolume object that was retrieved. user: models.User object of the user that retrieved the passphrase.", "name": "SendRetrievalEmail", "signature": "def SendRetrievalEmail(self, entity, user)" }, ...
6
stack_v2_sparse_classes_30k_train_010963
Implement the Python class `FileVault` described below. Class description: Handler for /filevault URL. Method signatures and docstrings: - def SendRetrievalEmail(self, entity, user): Sends a retrieval notification email to the owner of a Mac. Args: entity: models.FileVaultVolume object that was retrieved. user: model...
Implement the Python class `FileVault` described below. Class description: Handler for /filevault URL. Method signatures and docstrings: - def SendRetrievalEmail(self, entity, user): Sends a retrieval notification email to the owner of a Mac. Args: entity: models.FileVaultVolume object that was retrieved. user: model...
a9bc209b610a927083bf16274d8451c6c45227bf
<|skeleton|> class FileVault: """Handler for /filevault URL.""" def SendRetrievalEmail(self, entity, user): """Sends a retrieval notification email to the owner of a Mac. Args: entity: models.FileVaultVolume object that was retrieved. user: models.User object of the user that retrieved the passphrase."...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileVault: """Handler for /filevault URL.""" def SendRetrievalEmail(self, entity, user): """Sends a retrieval notification email to the owner of a Mac. Args: entity: models.FileVaultVolume object that was retrieved. user: models.User object of the user that retrieved the passphrase.""" bo...
the_stack_v2_python_sparse
src/cauliflowervest/server/handlers/filevault.py
cooljeanius/cauliflowervest
train
1
1725f7906f08cc38f3efd5175e03938102460b2c
[ "result = []\n\ndef backtracking(list_of_numbers=[], count=0):\n if count >= len(nums):\n result.append(list_of_numbers)\n return\n new_list_of_numbers_without_item = list_of_numbers[:]\n new_list_of_numbers_with_item = list_of_numbers[:]\n new_list_of_numbers_with_item.append(nums[count])...
<|body_start_0|> result = [] def backtracking(list_of_numbers=[], count=0): if count >= len(nums): result.append(list_of_numbers) return new_list_of_numbers_without_item = list_of_numbers[:] new_list_of_numbers_with_item = list_of_numb...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def subsets_recursive(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_0|> def subsets(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|> <|body_start_0|> result = [] ...
stack_v2_sparse_classes_36k_train_017244
1,331
no_license
[ { "docstring": ":type nums: List[int] :rtype: List[List[int]]", "name": "subsets_recursive", "signature": "def subsets_recursive(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: List[List[int]]", "name": "subsets", "signature": "def subsets(self, nums)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def subsets_recursive(self, nums): :type nums: List[int] :rtype: List[List[int]] - def subsets(self, nums): :type nums: List[int] :rtype: List[List[int]]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def subsets_recursive(self, nums): :type nums: List[int] :rtype: List[List[int]] - def subsets(self, nums): :type nums: List[int] :rtype: List[List[int]] <|skeleton|> class Solu...
2f975ed494bf3eb90b46b8300331097ab6459e75
<|skeleton|> class Solution: def subsets_recursive(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_0|> def subsets(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def subsets_recursive(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" result = [] def backtracking(list_of_numbers=[], count=0): if count >= len(nums): result.append(list_of_numbers) return new_list_of_...
the_stack_v2_python_sparse
Subsets.py
mathiasarens/python-test
train
1
edee384f179c67b26eb7d89edd39919e0ddefbe3
[ "rsa_priv_file, rsa_cert_file = (1, 2)\nexpected = {}\naps = []\nfor i in range(100):\n port_id = i % 3\n ap = APInfo(port_id=port_id, ip='2.2.2.2', mac='bb:bb:bb:bb:bb:bb', radio_mac='bb:bb:bb:bb:bb:00', udp_port=12345, wlc_ip='1.1.1.1', gateway_ip='1.1.1.2', ap_mode=APMode.LOCAL, rsa_ca_priv_file=None, rsa_...
<|body_start_0|> rsa_priv_file, rsa_cert_file = (1, 2) expected = {} aps = [] for i in range(100): port_id = i % 3 ap = APInfo(port_id=port_id, ip='2.2.2.2', mac='bb:bb:bb:bb:bb:bb', radio_mac='bb:bb:bb:bb:bb:00', udp_port=12345, wlc_ip='1.1.1.1', gateway_ip='1.1....
Tests methods for the utils functions of the trex_wireless_worker file.
UtilTest
[ "Apache-2.0", "GPL-1.0-or-later", "GPL-2.0-or-later", "GPL-2.0-only" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UtilTest: """Tests methods for the utils functions of the trex_wireless_worker file.""" def test_get_ap_per_port(self): """Test the get_ap_per_port function.""" <|body_0|> def test_get_ap_per_port_none(self): """Test the get_ap_per_port function for empty input."...
stack_v2_sparse_classes_36k_train_017245
17,884
permissive
[ { "docstring": "Test the get_ap_per_port function.", "name": "test_get_ap_per_port", "signature": "def test_get_ap_per_port(self)" }, { "docstring": "Test the get_ap_per_port function for empty input.", "name": "test_get_ap_per_port_none", "signature": "def test_get_ap_per_port_none(self...
2
stack_v2_sparse_classes_30k_train_000963
Implement the Python class `UtilTest` described below. Class description: Tests methods for the utils functions of the trex_wireless_worker file. Method signatures and docstrings: - def test_get_ap_per_port(self): Test the get_ap_per_port function. - def test_get_ap_per_port_none(self): Test the get_ap_per_port funct...
Implement the Python class `UtilTest` described below. Class description: Tests methods for the utils functions of the trex_wireless_worker file. Method signatures and docstrings: - def test_get_ap_per_port(self): Test the get_ap_per_port function. - def test_get_ap_per_port_none(self): Test the get_ap_per_port funct...
3a6d63af1ff468f94887a091e3a408a8449cf832
<|skeleton|> class UtilTest: """Tests methods for the utils functions of the trex_wireless_worker file.""" def test_get_ap_per_port(self): """Test the get_ap_per_port function.""" <|body_0|> def test_get_ap_per_port_none(self): """Test the get_ap_per_port function for empty input."...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UtilTest: """Tests methods for the utils functions of the trex_wireless_worker file.""" def test_get_ap_per_port(self): """Test the get_ap_per_port function.""" rsa_priv_file, rsa_cert_file = (1, 2) expected = {} aps = [] for i in range(100): port_id = ...
the_stack_v2_python_sparse
scripts/automation/trex_control_plane/interactive/trex/wireless/unit_tests/trex_wireless_worker_test.py
elados93/trex-core
train
1
c9128af2a53d18108ffe8bffdf7904c44145f7b3
[ "if self.action in ['signup', 'login', 'verify']:\n permissions = [AllowAny]\nelif self.action in ['retrieve', 'update', 'partial_update']:\n permissions = [IsAuthenticated, IsAccountOwner]\nelse:\n permissions = [IsAuthenticated]\nreturn [permission() for permission in permissions]", "serializer = UserL...
<|body_start_0|> if self.action in ['signup', 'login', 'verify']: permissions = [AllowAny] elif self.action in ['retrieve', 'update', 'partial_update']: permissions = [IsAuthenticated, IsAccountOwner] else: permissions = [IsAuthenticated] return [permi...
User view set. For sign up, login, account verification and update Customer data. ################################################################################# Http methods and the URLs: POST /users/signup/ (After signup, token is sent to the terminal as emailconfirmation) POST /users/verify/ (Sent the token as dat...
UserViewSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserViewSet: """User view set. For sign up, login, account verification and update Customer data. ################################################################################# Http methods and the URLs: POST /users/signup/ (After signup, token is sent to the terminal as emailconfirmation) POS...
stack_v2_sparse_classes_36k_train_017246
4,198
no_license
[ { "docstring": "Assign permissions based on action.", "name": "get_permissions", "signature": "def get_permissions(self)" }, { "docstring": "User sign in.", "name": "login", "signature": "def login(self, request)" }, { "docstring": "User sign up.", "name": "signup", "sign...
5
stack_v2_sparse_classes_30k_train_000870
Implement the Python class `UserViewSet` described below. Class description: User view set. For sign up, login, account verification and update Customer data. ################################################################################# Http methods and the URLs: POST /users/signup/ (After signup, token is sent to...
Implement the Python class `UserViewSet` described below. Class description: User view set. For sign up, login, account verification and update Customer data. ################################################################################# Http methods and the URLs: POST /users/signup/ (After signup, token is sent to...
d983e9e85018cdb02554ad6815191301487ed545
<|skeleton|> class UserViewSet: """User view set. For sign up, login, account verification and update Customer data. ################################################################################# Http methods and the URLs: POST /users/signup/ (After signup, token is sent to the terminal as emailconfirmation) POS...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserViewSet: """User view set. For sign up, login, account verification and update Customer data. ################################################################################# Http methods and the URLs: POST /users/signup/ (After signup, token is sent to the terminal as emailconfirmation) POST /users/veri...
the_stack_v2_python_sparse
users/views/users.py
xmedinavei/eats-delivery-app
train
1
bee011f41b39500698f577c9c2057a317c5f5c45
[ "if job == 'sheet':\n login_url = self.sheet_url + '/login'\nelse:\n login_url = self.trade_url + '/login'\nlogin_data = {'userName': 'admin', 'password': '123456'}\nlogin_response = requests.post(url=login_url, data=login_data, headers=self.headers)\nresp_code = json.loads(login_response.content)['code']\nif...
<|body_start_0|> if job == 'sheet': login_url = self.sheet_url + '/login' else: login_url = self.trade_url + '/login' login_data = {'userName': 'admin', 'password': '123456'} login_response = requests.post(url=login_url, data=login_data, headers=self.headers) ...
sheet 19 批量定时监控 18 每日红包平台充值优惠券差错对账 17 用户登录统计 12 随机立减数据统计 11 线下清算扣款费用通知回调trade 9 每日订单对账执行器 8 线下扣款清算文件生成 7 联机扣款数据统计 6 线下扣款清算结果文件读取 5 黑名单推送trade 4 未支付订单统计 3 优惠券活动数据统计 2 支付及退款数据统计 1 运营数据统计` trade 20 应用监控数据更新 15 重试清除超时未取消接送机订单 14 退款定时任务 13 查询订单支付状态 12 交易端-强制扣款 11 删除失败及执行成功的任务 10 红包平台优惠券下发 9 下发优惠券 8 查询进行中的活动 6 接送机超时取消 3 网约车-...
XXLJob
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class XXLJob: """sheet 19 批量定时监控 18 每日红包平台充值优惠券差错对账 17 用户登录统计 12 随机立减数据统计 11 线下清算扣款费用通知回调trade 9 每日订单对账执行器 8 线下扣款清算文件生成 7 联机扣款数据统计 6 线下扣款清算结果文件读取 5 黑名单推送trade 4 未支付订单统计 3 优惠券活动数据统计 2 支付及退款数据统计 1 运营数据统计` trade 20 应用监控数据更新 15 重试清除超时未取消接送机订单 14 退款定时任务 13 查询订单支付状态 12 交易端-强制扣款 11 删除失败及执行成功的任务 10 红包平台优惠券下发 9...
stack_v2_sparse_classes_36k_train_017247
4,045
permissive
[ { "docstring": "调度平台登录 :param job: :return:", "name": "login", "signature": "def login(self, job)" }, { "docstring": "修改执行器 :param sheet_ip: :param trade_ip: :param sheet_job: :return:", "name": "edit_config", "signature": "def edit_config(self, sheet_ip='192.168.0.48:9003', trade_ip='19...
3
stack_v2_sparse_classes_30k_train_006838
Implement the Python class `XXLJob` described below. Class description: sheet 19 批量定时监控 18 每日红包平台充值优惠券差错对账 17 用户登录统计 12 随机立减数据统计 11 线下清算扣款费用通知回调trade 9 每日订单对账执行器 8 线下扣款清算文件生成 7 联机扣款数据统计 6 线下扣款清算结果文件读取 5 黑名单推送trade 4 未支付订单统计 3 优惠券活动数据统计 2 支付及退款数据统计 1 运营数据统计` trade 20 应用监控数据更新 15 重试清除超时未取消接送机订单 14 退款定时任务 13 查询订单支付状态 12 ...
Implement the Python class `XXLJob` described below. Class description: sheet 19 批量定时监控 18 每日红包平台充值优惠券差错对账 17 用户登录统计 12 随机立减数据统计 11 线下清算扣款费用通知回调trade 9 每日订单对账执行器 8 线下扣款清算文件生成 7 联机扣款数据统计 6 线下扣款清算结果文件读取 5 黑名单推送trade 4 未支付订单统计 3 优惠券活动数据统计 2 支付及退款数据统计 1 运营数据统计` trade 20 应用监控数据更新 15 重试清除超时未取消接送机订单 14 退款定时任务 13 查询订单支付状态 12 ...
7e91570fccafa69881be09a1eccb6dfa15ed9039
<|skeleton|> class XXLJob: """sheet 19 批量定时监控 18 每日红包平台充值优惠券差错对账 17 用户登录统计 12 随机立减数据统计 11 线下清算扣款费用通知回调trade 9 每日订单对账执行器 8 线下扣款清算文件生成 7 联机扣款数据统计 6 线下扣款清算结果文件读取 5 黑名单推送trade 4 未支付订单统计 3 优惠券活动数据统计 2 支付及退款数据统计 1 运营数据统计` trade 20 应用监控数据更新 15 重试清除超时未取消接送机订单 14 退款定时任务 13 查询订单支付状态 12 交易端-强制扣款 11 删除失败及执行成功的任务 10 红包平台优惠券下发 9...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class XXLJob: """sheet 19 批量定时监控 18 每日红包平台充值优惠券差错对账 17 用户登录统计 12 随机立减数据统计 11 线下清算扣款费用通知回调trade 9 每日订单对账执行器 8 线下扣款清算文件生成 7 联机扣款数据统计 6 线下扣款清算结果文件读取 5 黑名单推送trade 4 未支付订单统计 3 优惠券活动数据统计 2 支付及退款数据统计 1 运营数据统计` trade 20 应用监控数据更新 15 重试清除超时未取消接送机订单 14 退款定时任务 13 查询订单支付状态 12 交易端-强制扣款 11 删除失败及执行成功的任务 10 红包平台优惠券下发 9 下发优惠券 8 查询进行...
the_stack_v2_python_sparse
httpTest/ApiManager/utils/XXL_job.py
dufuhaoo/httptest
train
0
ead0fae3389d71eb8d925130acc3e55a94eb37a0
[ "validation_details = self._validate_keywords_extraction_params(request.data)\nif not validation_details['status']:\n return Response(validation_details['error_data'], status=status.HTTP_400_BAD_REQUEST)\nparams = validation_details['params']\ndoc = params['document']\nargs = (doc, params['max_grams']) if params...
<|body_start_0|> validation_details = self._validate_keywords_extraction_params(request.data) if not validation_details['status']: return Response(validation_details['error_data'], status=status.HTTP_400_BAD_REQUEST) params = validation_details['params'] doc = params['documen...
KeywordsExtractionView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KeywordsExtractionView: def post(self, request): """Handle API POST request""" <|body_0|> def _validate_keywords_extraction_params(self, queryparams): """Validator for params""" <|body_1|> <|end_skeleton|> <|body_start_0|> validation_details = self....
stack_v2_sparse_classes_36k_train_017248
18,288
permissive
[ { "docstring": "Handle API POST request", "name": "post", "signature": "def post(self, request)" }, { "docstring": "Validator for params", "name": "_validate_keywords_extraction_params", "signature": "def _validate_keywords_extraction_params(self, queryparams)" } ]
2
stack_v2_sparse_classes_30k_val_000470
Implement the Python class `KeywordsExtractionView` described below. Class description: Implement the KeywordsExtractionView class. Method signatures and docstrings: - def post(self, request): Handle API POST request - def _validate_keywords_extraction_params(self, queryparams): Validator for params
Implement the Python class `KeywordsExtractionView` described below. Class description: Implement the KeywordsExtractionView class. Method signatures and docstrings: - def post(self, request): Handle API POST request - def _validate_keywords_extraction_params(self, queryparams): Validator for params <|skeleton|> cla...
93f7bf7d61d7424250d01c1fc510347375d767c4
<|skeleton|> class KeywordsExtractionView: def post(self, request): """Handle API POST request""" <|body_0|> def _validate_keywords_extraction_params(self, queryparams): """Validator for params""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KeywordsExtractionView: def post(self, request): """Handle API POST request""" validation_details = self._validate_keywords_extraction_params(request.data) if not validation_details['status']: return Response(validation_details['error_data'], status=status.HTTP_400_BAD_REQU...
the_stack_v2_python_sparse
api/views/view_main.py
the-deep/DEEPL
train
6
60da923d8eb80ac48a2cf486c278fe11eeb26b99
[ "if data is not None:\n if type(data) != list:\n raise TypeError('data must be a list')\n if len(data) < 2:\n raise ValueError('data must contain multiple values')\n mean = 0.0\n count = 0\n for element in data:\n if type(element) not in {int, float}:\n raise TypeError...
<|body_start_0|> if data is not None: if type(data) != list: raise TypeError('data must be a list') if len(data) < 2: raise ValueError('data must contain multiple values') mean = 0.0 count = 0 for element in data: ...
Class that represents an Exponential distribution.
Exponential
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Exponential: """Class that represents an Exponential distribution.""" def __init__(self, data=None, lambtha=1.0): """Constructor of the class. Sets the instance attribute lambtha as float. data is a list of the data to be used to estimate the distribution. lambtha is the expected num...
stack_v2_sparse_classes_36k_train_017249
1,635
no_license
[ { "docstring": "Constructor of the class. Sets the instance attribute lambtha as float. data is a list of the data to be used to estimate the distribution. lambtha is the expected number of occurences in a given time frame.", "name": "__init__", "signature": "def __init__(self, data=None, lambtha=1.0)" ...
3
null
Implement the Python class `Exponential` described below. Class description: Class that represents an Exponential distribution. Method signatures and docstrings: - def __init__(self, data=None, lambtha=1.0): Constructor of the class. Sets the instance attribute lambtha as float. data is a list of the data to be used ...
Implement the Python class `Exponential` described below. Class description: Class that represents an Exponential distribution. Method signatures and docstrings: - def __init__(self, data=None, lambtha=1.0): Constructor of the class. Sets the instance attribute lambtha as float. data is a list of the data to be used ...
1e7cd1589e6e4896ee48a24b9ca85595e16e929d
<|skeleton|> class Exponential: """Class that represents an Exponential distribution.""" def __init__(self, data=None, lambtha=1.0): """Constructor of the class. Sets the instance attribute lambtha as float. data is a list of the data to be used to estimate the distribution. lambtha is the expected num...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Exponential: """Class that represents an Exponential distribution.""" def __init__(self, data=None, lambtha=1.0): """Constructor of the class. Sets the instance attribute lambtha as float. data is a list of the data to be used to estimate the distribution. lambtha is the expected number of occure...
the_stack_v2_python_sparse
math/0x03-probability/exponential.py
Daransoto/holbertonschool-machine_learning
train
0
585e33f6e035ea3d15fdfe9a6e74caf5c2dfb9d1
[ "n = len(s)\ns_ = s[::-1]\ndp = [[0] * (n + 1) for _ in range(n + 1)]\nfor i in range(n):\n for j in range(n):\n if s[i] == s_[j]:\n dp[i + 1][j + 1] = dp[i][j] + 1\n else:\n dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1])\nreturn n - dp[-1][-1]", "n = len(s)\ndp = [[0] *...
<|body_start_0|> n = len(s) s_ = s[::-1] dp = [[0] * (n + 1) for _ in range(n + 1)] for i in range(n): for j in range(n): if s[i] == s_[j]: dp[i + 1][j + 1] = dp[i][j] + 1 else: dp[i + 1][j + 1] = max(dp[...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def minInsertions1(self, s: str) -> int: """思路:动态规划法 1. s翻转后s_,两者求最长公共子序列,剩余的则是要插入的 @param s: @return:""" <|body_0|> def minInsertions2(self, s: str) -> int: """思路:区间dp @param s: @return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> n =...
stack_v2_sparse_classes_36k_train_017250
2,224
no_license
[ { "docstring": "思路:动态规划法 1. s翻转后s_,两者求最长公共子序列,剩余的则是要插入的 @param s: @return:", "name": "minInsertions1", "signature": "def minInsertions1(self, s: str) -> int" }, { "docstring": "思路:区间dp @param s: @return:", "name": "minInsertions2", "signature": "def minInsertions2(self, s: str) -> int" ...
2
stack_v2_sparse_classes_30k_train_000274
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minInsertions1(self, s: str) -> int: 思路:动态规划法 1. s翻转后s_,两者求最长公共子序列,剩余的则是要插入的 @param s: @return: - def minInsertions2(self, s: str) -> int: 思路:区间dp @param s: @return:
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minInsertions1(self, s: str) -> int: 思路:动态规划法 1. s翻转后s_,两者求最长公共子序列,剩余的则是要插入的 @param s: @return: - def minInsertions2(self, s: str) -> int: 思路:区间dp @param s: @return: <|skele...
e43ee86c5a8cdb808da09b4b6138e10275abadb5
<|skeleton|> class Solution: def minInsertions1(self, s: str) -> int: """思路:动态规划法 1. s翻转后s_,两者求最长公共子序列,剩余的则是要插入的 @param s: @return:""" <|body_0|> def minInsertions2(self, s: str) -> int: """思路:区间dp @param s: @return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def minInsertions1(self, s: str) -> int: """思路:动态规划法 1. s翻转后s_,两者求最长公共子序列,剩余的则是要插入的 @param s: @return:""" n = len(s) s_ = s[::-1] dp = [[0] * (n + 1) for _ in range(n + 1)] for i in range(n): for j in range(n): if s[i] == s_[j]: ...
the_stack_v2_python_sparse
LeetCode/动态规划法(dp)/1312. 让字符串成为回文串的最少插入次数.py
yiming1012/MyLeetCode
train
2
60ba4eb89bb08d2fb72f36bcf7708a81c43f02f2
[ "context = aq_inner(self.context)\nitem_ids = context.objectIds('GlossaryItem')\nitem_count = len(item_ids)\ncontext.manage_delObjects(ids=item_ids)\nreturn 'Deleted %s items.' % (item_count - len(item_ids))", "context = aq_inner(self.context)\nitems = context.objectValues('GlossaryItem')\nfor item in items:\n ...
<|body_start_0|> context = aq_inner(self.context) item_ids = context.objectIds('GlossaryItem') item_count = len(item_ids) context.manage_delObjects(ids=item_ids) return 'Deleted %s items.' % (item_count - len(item_ids)) <|end_body_0|> <|body_start_1|> context = aq_inner(...
A browser view for various maintenance tasks.
GlossaryMaintenanceView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GlossaryMaintenanceView: """A browser view for various maintenance tasks.""" def purge_all(self): """Deletes all glossary items in the current folder.""" <|body_0|> def index(self): """Catalogs all glossary items in the current folder""" <|body_1|> <|end...
stack_v2_sparse_classes_36k_train_017251
814
no_license
[ { "docstring": "Deletes all glossary items in the current folder.", "name": "purge_all", "signature": "def purge_all(self)" }, { "docstring": "Catalogs all glossary items in the current folder", "name": "index", "signature": "def index(self)" } ]
2
stack_v2_sparse_classes_30k_val_001093
Implement the Python class `GlossaryMaintenanceView` described below. Class description: A browser view for various maintenance tasks. Method signatures and docstrings: - def purge_all(self): Deletes all glossary items in the current folder. - def index(self): Catalogs all glossary items in the current folder
Implement the Python class `GlossaryMaintenanceView` described below. Class description: A browser view for various maintenance tasks. Method signatures and docstrings: - def purge_all(self): Deletes all glossary items in the current folder. - def index(self): Catalogs all glossary items in the current folder <|skel...
264c5176e8f796e93dd1198070fc7276f5d756c6
<|skeleton|> class GlossaryMaintenanceView: """A browser view for various maintenance tasks.""" def purge_all(self): """Deletes all glossary items in the current folder.""" <|body_0|> def index(self): """Catalogs all glossary items in the current folder""" <|body_1|> <|end...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GlossaryMaintenanceView: """A browser view for various maintenance tasks.""" def purge_all(self): """Deletes all glossary items in the current folder.""" context = aq_inner(self.context) item_ids = context.objectIds('GlossaryItem') item_count = len(item_ids) contex...
the_stack_v2_python_sparse
ftw/glossary/browser/maintenance.py
4teamwork/ftw.glossary
train
0
9ae0b3fb28263a0f39f769433cb5b2b3d217fe6b
[ "if not email:\n raise ValueError('Users must have an email address')\nuser = self.model(email=self.normalize_email(email), username=username)\nuser.set_password(password)\nuser.name = name\nuser.is_customer = is_customer\nuser.is_seller = is_seller\nuser.is_service_seller = is_service_seller\nuser.save(using=se...
<|body_start_0|> if not email: raise ValueError('Users must have an email address') user = self.model(email=self.normalize_email(email), username=username) user.set_password(password) user.name = name user.is_customer = is_customer user.is_seller = is_seller ...
CustomUserManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomUserManager: def create_user(self, email, username, password=None, name='', is_customer=False, is_seller=False, is_service_seller=False): """Creates and saves a User with the given email, date of birth and password.""" <|body_0|> def create_superuser(self, email, usern...
stack_v2_sparse_classes_36k_train_017252
3,138
no_license
[ { "docstring": "Creates and saves a User with the given email, date of birth and password.", "name": "create_user", "signature": "def create_user(self, email, username, password=None, name='', is_customer=False, is_seller=False, is_service_seller=False)" }, { "docstring": "Creates and saves a su...
2
stack_v2_sparse_classes_30k_train_013343
Implement the Python class `CustomUserManager` described below. Class description: Implement the CustomUserManager class. Method signatures and docstrings: - def create_user(self, email, username, password=None, name='', is_customer=False, is_seller=False, is_service_seller=False): Creates and saves a User with the g...
Implement the Python class `CustomUserManager` described below. Class description: Implement the CustomUserManager class. Method signatures and docstrings: - def create_user(self, email, username, password=None, name='', is_customer=False, is_seller=False, is_service_seller=False): Creates and saves a User with the g...
94016ef0b9c97ef5c275b49673f096c89a173a6b
<|skeleton|> class CustomUserManager: def create_user(self, email, username, password=None, name='', is_customer=False, is_seller=False, is_service_seller=False): """Creates and saves a User with the given email, date of birth and password.""" <|body_0|> def create_superuser(self, email, usern...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomUserManager: def create_user(self, email, username, password=None, name='', is_customer=False, is_seller=False, is_service_seller=False): """Creates and saves a User with the given email, date of birth and password.""" if not email: raise ValueError('Users must have an email ...
the_stack_v2_python_sparse
users/models.py
nazmulhasanDEV/Multi-vendorDjangoApp
train
0
1b7575a64366b7da437ac0ffd9fddd6860b639ac
[ "self.cutoff = cutoff\nif distance_bins is None:\n self.distance_bins = HBOND_DIST_BINS\nelse:\n self.distance_bins = distance_bins\nif angle_cutoffs is None:\n self.angle_cutoffs = HBOND_ANGLE_CUTOFFS\nelse:\n self.angle_cutoffs = angle_cutoffs\nself.reduce_to_contacts = reduce_to_contacts", "if 'com...
<|body_start_0|> self.cutoff = cutoff if distance_bins is None: self.distance_bins = HBOND_DIST_BINS else: self.distance_bins = distance_bins if angle_cutoffs is None: self.angle_cutoffs = HBOND_ANGLE_CUTOFFS else: self.angle_cutoff...
Counts hydrogen bonds between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, count the number of hydrogen bonds between atoms in the macromolecular complex. Creates a scalar output of shape `(3,)` (assuming the default value ofor `distance_bins` with 3 bins...
HydrogenBondCounter
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HydrogenBondCounter: """Counts hydrogen bonds between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, count the number of hydrogen bonds between atoms in the macromolecular complex. Creates a scalar output of shape `(3,)` (assuming the...
stack_v2_sparse_classes_36k_train_017253
27,676
permissive
[ { "docstring": "Parameters ---------- cutoff: float (default 4.5) Distance cutoff in angstroms for molecules in complex. reduce_to_contacts: bool, optional If True, reduce the atoms in the complex to those near a contact region. distance_bins: list[tuple] List of hydgrogen bond distance bins. If not specified i...
2
null
Implement the Python class `HydrogenBondCounter` described below. Class description: Counts hydrogen bonds between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, count the number of hydrogen bonds between atoms in the macromolecular complex. Creates a scal...
Implement the Python class `HydrogenBondCounter` described below. Class description: Counts hydrogen bonds between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, count the number of hydrogen bonds between atoms in the macromolecular complex. Creates a scal...
ee6e67ebcf7bf04259cf13aff6388e2b791fea3d
<|skeleton|> class HydrogenBondCounter: """Counts hydrogen bonds between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, count the number of hydrogen bonds between atoms in the macromolecular complex. Creates a scalar output of shape `(3,)` (assuming the...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HydrogenBondCounter: """Counts hydrogen bonds between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, count the number of hydrogen bonds between atoms in the macromolecular complex. Creates a scalar output of shape `(3,)` (assuming the default valu...
the_stack_v2_python_sparse
deepchem/feat/complex_featurizers/grid_featurizers.py
deepchem/deepchem
train
4,876
7576532b83517f44ac64389d03adb9edc2bbabd5
[ "RAMSTKBook.__init__(self, controller)\nself.dic_work_views = {'revision': [wvwRevisionGD(controller)], 'function': [wvwFunctionGD(controller), wvwFFMEA(controller)], 'requirement': [wvwRequirementGD(controller), wvwRequirementAnalysis(controller)], 'hardware': [wvwHardwareGD(controller), wvwAllocation(controller),...
<|body_start_0|> RAMSTKBook.__init__(self, controller) self.dic_work_views = {'revision': [wvwRevisionGD(controller)], 'function': [wvwFunctionGD(controller), wvwFFMEA(controller)], 'requirement': [wvwRequirementGD(controller), wvwRequirementAnalysis(controller)], 'hardware': [wvwHardwareGD(controller),...
This is the Work Book for the pyGTK multiple window interface.
WorkBook
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WorkBook: """This is the Work Book for the pyGTK multiple window interface.""" def __init__(self, controller): """Initialize an instance of the Work View class. :param controller: the RAMSTK master data controller. :type controller: :class:`ramstk.RAMSTK.RAMSTK`""" <|body_0|>...
stack_v2_sparse_classes_36k_train_017254
4,887
permissive
[ { "docstring": "Initialize an instance of the Work View class. :param controller: the RAMSTK master data controller. :type controller: :class:`ramstk.RAMSTK.RAMSTK`", "name": "__init__", "signature": "def __init__(self, controller)" }, { "docstring": "Load the Work Views for the RAMSTK module se...
3
stack_v2_sparse_classes_30k_train_015129
Implement the Python class `WorkBook` described below. Class description: This is the Work Book for the pyGTK multiple window interface. Method signatures and docstrings: - def __init__(self, controller): Initialize an instance of the Work View class. :param controller: the RAMSTK master data controller. :type contro...
Implement the Python class `WorkBook` described below. Class description: This is the Work Book for the pyGTK multiple window interface. Method signatures and docstrings: - def __init__(self, controller): Initialize an instance of the Work View class. :param controller: the RAMSTK master data controller. :type contro...
488ffed8b842399ddcae93007de6c6f1dda23d05
<|skeleton|> class WorkBook: """This is the Work Book for the pyGTK multiple window interface.""" def __init__(self, controller): """Initialize an instance of the Work View class. :param controller: the RAMSTK master data controller. :type controller: :class:`ramstk.RAMSTK.RAMSTK`""" <|body_0|>...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WorkBook: """This is the Work Book for the pyGTK multiple window interface.""" def __init__(self, controller): """Initialize an instance of the Work View class. :param controller: the RAMSTK master data controller. :type controller: :class:`ramstk.RAMSTK.RAMSTK`""" RAMSTKBook.__init__(sel...
the_stack_v2_python_sparse
src/ramstk/gui/gtk/mwi/WorkBook.py
JmiXIII/ramstk
train
0
2c2204cd0d4dd2e4e2dbb49447a371f13cec2f63
[ "self.cloned_db_backup_status = cloned_db_backup_status\nself.db_backup_if_not_online_status = db_backup_if_not_online_status\nself.missing_db_backup_status = missing_db_backup_status\nself.offline_restoring_db_backup_status = offline_restoring_db_backup_status\nself.read_only_db_backup_status = read_only_db_backup...
<|body_start_0|> self.cloned_db_backup_status = cloned_db_backup_status self.db_backup_if_not_online_status = db_backup_if_not_online_status self.missing_db_backup_status = missing_db_backup_status self.offline_restoring_db_backup_status = offline_restoring_db_backup_status self....
Implementation of the 'AdvancedSettings' model. Message to capture SQL gflags. Attributes: cloned_db_backup_status (int): Whether to report error if SQL database is cloned. db_backup_if_not_online_status (int): Whether to report error if SQL database is not online, it includes states such as offline, restoring as well ...
AdvancedSettings
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdvancedSettings: """Implementation of the 'AdvancedSettings' model. Message to capture SQL gflags. Attributes: cloned_db_backup_status (int): Whether to report error if SQL database is cloned. db_backup_if_not_online_status (int): Whether to report error if SQL database is not online, it include...
stack_v2_sparse_classes_36k_train_017255
3,957
permissive
[ { "docstring": "Constructor for the AdvancedSettings class", "name": "__init__", "signature": "def __init__(self, cloned_db_backup_status=None, db_backup_if_not_online_status=None, missing_db_backup_status=None, offline_restoring_db_backup_status=None, read_only_db_backup_status=None, report_all_non_aut...
2
stack_v2_sparse_classes_30k_train_003123
Implement the Python class `AdvancedSettings` described below. Class description: Implementation of the 'AdvancedSettings' model. Message to capture SQL gflags. Attributes: cloned_db_backup_status (int): Whether to report error if SQL database is cloned. db_backup_if_not_online_status (int): Whether to report error if...
Implement the Python class `AdvancedSettings` described below. Class description: Implementation of the 'AdvancedSettings' model. Message to capture SQL gflags. Attributes: cloned_db_backup_status (int): Whether to report error if SQL database is cloned. db_backup_if_not_online_status (int): Whether to report error if...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class AdvancedSettings: """Implementation of the 'AdvancedSettings' model. Message to capture SQL gflags. Attributes: cloned_db_backup_status (int): Whether to report error if SQL database is cloned. db_backup_if_not_online_status (int): Whether to report error if SQL database is not online, it include...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AdvancedSettings: """Implementation of the 'AdvancedSettings' model. Message to capture SQL gflags. Attributes: cloned_db_backup_status (int): Whether to report error if SQL database is cloned. db_backup_if_not_online_status (int): Whether to report error if SQL database is not online, it includes states such...
the_stack_v2_python_sparse
cohesity_management_sdk/models/advanced_settings.py
cohesity/management-sdk-python
train
24
7678f4c421ff69dd93275c0a0215d12d27df056e
[ "user = request.user\ndata = {}\ndata['first_name'] = user.first_name\ndata['last_name'] = user.last_name\ndata['email'] = user.email\nform = MinimalRegistrationForm(data)\ncontext = super(ProfileUpdate, self).get_context_data(**kwargs)\ncontext['form'] = form\nreturn render(request, self.template_name, context)", ...
<|body_start_0|> user = request.user data = {} data['first_name'] = user.first_name data['last_name'] = user.last_name data['email'] = user.email form = MinimalRegistrationForm(data) context = super(ProfileUpdate, self).get_context_data(**kwargs) context['...
Edit the user's profile. We cannot use the Update Template as we do not have the user id as a slug in the url.
ProfileUpdate
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProfileUpdate: """Edit the user's profile. We cannot use the Update Template as we do not have the user id as a slug in the url.""" def get(self, request, *args, **kwargs): """Overrides method from TemplateView.""" <|body_0|> def post(self, request, *args, **kwargs): ...
stack_v2_sparse_classes_36k_train_017256
21,511
permissive
[ { "docstring": "Overrides method from TemplateView.", "name": "get", "signature": "def get(self, request, *args, **kwargs)" }, { "docstring": "Overrides method from TemplateView.", "name": "post", "signature": "def post(self, request, *args, **kwargs)" } ]
2
stack_v2_sparse_classes_30k_train_021421
Implement the Python class `ProfileUpdate` described below. Class description: Edit the user's profile. We cannot use the Update Template as we do not have the user id as a slug in the url. Method signatures and docstrings: - def get(self, request, *args, **kwargs): Overrides method from TemplateView. - def post(self...
Implement the Python class `ProfileUpdate` described below. Class description: Edit the user's profile. We cannot use the Update Template as we do not have the user id as a slug in the url. Method signatures and docstrings: - def get(self, request, *args, **kwargs): Overrides method from TemplateView. - def post(self...
598b3bc10b72b7b277510cf40e1a4bc56b07452a
<|skeleton|> class ProfileUpdate: """Edit the user's profile. We cannot use the Update Template as we do not have the user id as a slug in the url.""" def get(self, request, *args, **kwargs): """Overrides method from TemplateView.""" <|body_0|> def post(self, request, *args, **kwargs): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProfileUpdate: """Edit the user's profile. We cannot use the Update Template as we do not have the user id as a slug in the url.""" def get(self, request, *args, **kwargs): """Overrides method from TemplateView.""" user = request.user data = {} data['first_name'] = user.fi...
the_stack_v2_python_sparse
jenkins_auth/views.py
antony-wilson/jenkins_auth
train
0
22575a28636580d9cdb1b0242147371eb339c52f
[ "data = {'OriginalURL': self.original_url, 'ResolvedURL': self.resolved_url, 'ServiceName': self.service_name, 'RedirectCount': len(self.redirect_history) - 1, 'RedirectHistory': self.redirect_history, 'EncounteredError': self.encountered_error}\nif self.api_usage is not None:\n data['APIUsageCount'] = self.api_...
<|body_start_0|> data = {'OriginalURL': self.original_url, 'ResolvedURL': self.resolved_url, 'ServiceName': self.service_name, 'RedirectCount': len(self.redirect_history) - 1, 'RedirectHistory': self.redirect_history, 'EncounteredError': self.encountered_error} if self.api_usage is not None: ...
A tuple containing data for unshortend URLs. Attributes: original_url (str): The original URL. resolved_url (str): The resolved URL. service_name (str): The name of the service used to resolve the URL. redirect_history (list): A list of URLs that were redirected to get to the resolved URL. raw_data (dict | list[dict] |...
URLUnshorteningData
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class URLUnshorteningData: """A tuple containing data for unshortend URLs. Attributes: original_url (str): The original URL. resolved_url (str): The resolved URL. service_name (str): The name of the service used to resolve the URL. redirect_history (list): A list of URLs that were redirected to get to ...
stack_v2_sparse_classes_36k_train_017257
14,906
permissive
[ { "docstring": "Converts the data to a dictionary that will be used as the context data. Adds recursion data only if relevant. Note: We subtract 1 from RedirectCount because the original URL is included in the recursion history. Returns: dict: A dictionary containing the data in context format.", "name": "t...
2
stack_v2_sparse_classes_30k_train_010729
Implement the Python class `URLUnshorteningData` described below. Class description: A tuple containing data for unshortend URLs. Attributes: original_url (str): The original URL. resolved_url (str): The resolved URL. service_name (str): The name of the service used to resolve the URL. redirect_history (list): A list ...
Implement the Python class `URLUnshorteningData` described below. Class description: A tuple containing data for unshortend URLs. Attributes: original_url (str): The original URL. resolved_url (str): The resolved URL. service_name (str): The name of the service used to resolve the URL. redirect_history (list): A list ...
890def5a0e0ae8d6eaa538148249ddbc851dbb6b
<|skeleton|> class URLUnshorteningData: """A tuple containing data for unshortend URLs. Attributes: original_url (str): The original URL. resolved_url (str): The resolved URL. service_name (str): The name of the service used to resolve the URL. redirect_history (list): A list of URLs that were redirected to get to ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class URLUnshorteningData: """A tuple containing data for unshortend URLs. Attributes: original_url (str): The original URL. resolved_url (str): The resolved URL. service_name (str): The name of the service used to resolve the URL. redirect_history (list): A list of URLs that were redirected to get to the resolved ...
the_stack_v2_python_sparse
Packs/CommonScripts/Scripts/ResolveShortenedURL/ResolveShortenedURL.py
demisto/content
train
1,023
8e31b14875e0b79105e52051dfff45eed0e7d626
[ "result = []\n\ndef helper(node):\n if not node:\n return\n result.append(node.val)\n if node.left:\n helper(node.left)\n if node.right:\n helper(node.right)\nhelper(root)\nreturn result", "result = []\nif root is None:\n return result\nstack = [root]\nwhile stack:\n node = ...
<|body_start_0|> result = [] def helper(node): if not node: return result.append(node.val) if node.left: helper(node.left) if node.right: helper(node.right) helper(root) return result <|end_b...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def preorderTraversal(self, root: TreeNode): """递归法""" <|body_0|> def preorderTraversal_2(self, root: TreeNode): """迭代法:栈""" <|body_1|> <|end_skeleton|> <|body_start_0|> result = [] def helper(node): if not node: ...
stack_v2_sparse_classes_36k_train_017258
1,486
no_license
[ { "docstring": "递归法", "name": "preorderTraversal", "signature": "def preorderTraversal(self, root: TreeNode)" }, { "docstring": "迭代法:栈", "name": "preorderTraversal_2", "signature": "def preorderTraversal_2(self, root: TreeNode)" } ]
2
stack_v2_sparse_classes_30k_train_016274
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def preorderTraversal(self, root: TreeNode): 递归法 - def preorderTraversal_2(self, root: TreeNode): 迭代法:栈
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def preorderTraversal(self, root: TreeNode): 递归法 - def preorderTraversal_2(self, root: TreeNode): 迭代法:栈 <|skeleton|> class Solution: def preorderTraversal(self, root: TreeN...
13e7ec9fe7a92ab13b247bd4edeb1ada5de81a08
<|skeleton|> class Solution: def preorderTraversal(self, root: TreeNode): """递归法""" <|body_0|> def preorderTraversal_2(self, root: TreeNode): """迭代法:栈""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def preorderTraversal(self, root: TreeNode): """递归法""" result = [] def helper(node): if not node: return result.append(node.val) if node.left: helper(node.left) if node.right: hel...
the_stack_v2_python_sparse
Algorithms/144_Binary_Tree_Preorder_Traversal/Binary_Tree_Preorder_Traversal.py
lirui-ML/my_leetcode
train
1
2874baaa24f1c2cdafe8577cd7b68d50be0329b1
[ "i = range(15)\nr = random_permutation(i)\neq_(set(i), set(r))\nif i == r:\n raise AssertionError('Values were not permuted')", "items = range(15)\nitem_set = set(items)\nall_items = set()\nfor _ in xrange(100):\n permutation = random_permutation(items, 5)\n eq_(len(permutation), 5)\n permutation_set ...
<|body_start_0|> i = range(15) r = random_permutation(i) eq_(set(i), set(r)) if i == r: raise AssertionError('Values were not permuted') <|end_body_0|> <|body_start_1|> items = range(15) item_set = set(items) all_items = set() for _ in xrange(...
Tests for ``random_permutation()``
RandomPermutationTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RandomPermutationTests: """Tests for ``random_permutation()``""" def test_full_permutation(self): """ensure every item from the iterable is returned in a new ordering 15 elements have a 1 in 1.3 * 10e12 of appearing in sorted order, so we fix a seed value just to be sure.""" ...
stack_v2_sparse_classes_36k_train_017259
47,145
no_license
[ { "docstring": "ensure every item from the iterable is returned in a new ordering 15 elements have a 1 in 1.3 * 10e12 of appearing in sorted order, so we fix a seed value just to be sure.", "name": "test_full_permutation", "signature": "def test_full_permutation(self)" }, { "docstring": "ensure ...
2
null
Implement the Python class `RandomPermutationTests` described below. Class description: Tests for ``random_permutation()`` Method signatures and docstrings: - def test_full_permutation(self): ensure every item from the iterable is returned in a new ordering 15 elements have a 1 in 1.3 * 10e12 of appearing in sorted o...
Implement the Python class `RandomPermutationTests` described below. Class description: Tests for ``random_permutation()`` Method signatures and docstrings: - def test_full_permutation(self): ensure every item from the iterable is returned in a new ordering 15 elements have a 1 in 1.3 * 10e12 of appearing in sorted o...
0ac6653219c2701c13c508c5c4fc9bc3437eea06
<|skeleton|> class RandomPermutationTests: """Tests for ``random_permutation()``""" def test_full_permutation(self): """ensure every item from the iterable is returned in a new ordering 15 elements have a 1 in 1.3 * 10e12 of appearing in sorted order, so we fix a seed value just to be sure.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RandomPermutationTests: """Tests for ``random_permutation()``""" def test_full_permutation(self): """ensure every item from the iterable is returned in a new ordering 15 elements have a 1 in 1.3 * 10e12 of appearing in sorted order, so we fix a seed value just to be sure.""" i = range(15)...
the_stack_v2_python_sparse
repoData/erikrose-more-itertools/allPythonContent.py
aCoffeeYin/pyreco
train
0
1be3801de92c17cbf492fd4980ff330d1a6a139b
[ "self.metric = metric\nself.has_custom_metric = False if self.metric is None else True\nself.gram = None\nself.min_size = 2", "s_ = signal.reshape(-1, 1) if signal.ndim == 1 else signal\nif self.has_custom_metric is False:\n covar = np.cov(s_.T)\n self.metric = inv(covar.reshape(1, 1) if covar.size == 1 els...
<|body_start_0|> self.metric = metric self.has_custom_metric = False if self.metric is None else True self.gram = None self.min_size = 2 <|end_body_0|> <|body_start_1|> s_ = signal.reshape(-1, 1) if signal.ndim == 1 else signal if self.has_custom_metric is False: ...
Mahalanobis-type cost function.
CostMl
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CostMl: """Mahalanobis-type cost function.""" def __init__(self, metric=None): """Create a new instance. Args: metric (ndarray, optional): PSD matrix that defines a Mahalanobis-type pseudo distance. If None, defaults to the Mahalanobis matrix. Shape (n_features, n_features).""" ...
stack_v2_sparse_classes_36k_train_017260
2,025
permissive
[ { "docstring": "Create a new instance. Args: metric (ndarray, optional): PSD matrix that defines a Mahalanobis-type pseudo distance. If None, defaults to the Mahalanobis matrix. Shape (n_features, n_features).", "name": "__init__", "signature": "def __init__(self, metric=None)" }, { "docstring":...
3
stack_v2_sparse_classes_30k_val_000617
Implement the Python class `CostMl` described below. Class description: Mahalanobis-type cost function. Method signatures and docstrings: - def __init__(self, metric=None): Create a new instance. Args: metric (ndarray, optional): PSD matrix that defines a Mahalanobis-type pseudo distance. If None, defaults to the Mah...
Implement the Python class `CostMl` described below. Class description: Mahalanobis-type cost function. Method signatures and docstrings: - def __init__(self, metric=None): Create a new instance. Args: metric (ndarray, optional): PSD matrix that defines a Mahalanobis-type pseudo distance. If None, defaults to the Mah...
0eb34388df2096d22fb1afd6e33ec511fb64cfa6
<|skeleton|> class CostMl: """Mahalanobis-type cost function.""" def __init__(self, metric=None): """Create a new instance. Args: metric (ndarray, optional): PSD matrix that defines a Mahalanobis-type pseudo distance. If None, defaults to the Mahalanobis matrix. Shape (n_features, n_features).""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CostMl: """Mahalanobis-type cost function.""" def __init__(self, metric=None): """Create a new instance. Args: metric (ndarray, optional): PSD matrix that defines a Mahalanobis-type pseudo distance. If None, defaults to the Mahalanobis matrix. Shape (n_features, n_features).""" self.metri...
the_stack_v2_python_sparse
src/ruptures/costs/costml.py
deepcharles/ruptures
train
1,299
8896115227b4c3247a2a42e536ad10b9c0f43c4e
[ "self.center = center\nself.angle = angle\nself.length = length\nself.width = width", "xo = np.cos(self.angle)\nyo = np.sin(self.angle)\ny1 = self.center[0] - self.width / 2 * xo\nx1 = self.center[1] + self.width / 2 * yo\ny2 = self.center[0] + self.width / 2 * xo\nx2 = self.center[1] - self.width / 2 * yo\nretur...
<|body_start_0|> self.center = center self.angle = angle self.length = length self.width = width <|end_body_0|> <|body_start_1|> xo = np.cos(self.angle) yo = np.sin(self.angle) y1 = self.center[0] - self.width / 2 * xo x1 = self.center[1] + self.width / 2...
前面的抓取类都是由四个角点坐标信息定义的,如果想对框进行什么操作的话,不太方便, 这里使用其中提取出的中心点坐标,角度,以及长宽来定义一个矩形,对于这个矩形的整体处 理比较方方便(比如将矩形的宽度缩小三倍),但是最终的绘制还是要通过角点坐标来实现,所以,里面还要有一个能够根据 这几个参数反求角点坐标的函数
Grasp_cpaw
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Grasp_cpaw: """前面的抓取类都是由四个角点坐标信息定义的,如果想对框进行什么操作的话,不太方便, 这里使用其中提取出的中心点坐标,角度,以及长宽来定义一个矩形,对于这个矩形的整体处 理比较方方便(比如将矩形的宽度缩小三倍),但是最终的绘制还是要通过角点坐标来实现,所以,里面还要有一个能够根据 这几个参数反求角点坐标的函数""" def __init__(self, center, angle, length=60, width=30): """:功能 :类初始化函数,进行参数传递 :参数 :这些参数是啥很明显了吧,就不再赘述了""" ...
stack_v2_sparse_classes_36k_train_017261
9,891
no_license
[ { "docstring": ":功能 :类初始化函数,进行参数传递 :参数 :这些参数是啥很明显了吧,就不再赘述了", "name": "__init__", "signature": "def __init__(self, center, angle, length=60, width=30)" }, { "docstring": ":功能 :通过这几个参数反求所定义的坐标角点,并由其建立返回Grasp对象 :返回 :由反求出的角点所定义的Grasp对象", "name": "as_gr", "signature": "def as_gr(self)" } ]
2
stack_v2_sparse_classes_30k_train_018938
Implement the Python class `Grasp_cpaw` described below. Class description: 前面的抓取类都是由四个角点坐标信息定义的,如果想对框进行什么操作的话,不太方便, 这里使用其中提取出的中心点坐标,角度,以及长宽来定义一个矩形,对于这个矩形的整体处 理比较方方便(比如将矩形的宽度缩小三倍),但是最终的绘制还是要通过角点坐标来实现,所以,里面还要有一个能够根据 这几个参数反求角点坐标的函数 Method signatures and docstrings: - def __init__(self, center, angle, length=60, width=3...
Implement the Python class `Grasp_cpaw` described below. Class description: 前面的抓取类都是由四个角点坐标信息定义的,如果想对框进行什么操作的话,不太方便, 这里使用其中提取出的中心点坐标,角度,以及长宽来定义一个矩形,对于这个矩形的整体处 理比较方方便(比如将矩形的宽度缩小三倍),但是最终的绘制还是要通过角点坐标来实现,所以,里面还要有一个能够根据 这几个参数反求角点坐标的函数 Method signatures and docstrings: - def __init__(self, center, angle, length=60, width=3...
d0b7b14fa8b76ba95118c8b1af53fbd627860c00
<|skeleton|> class Grasp_cpaw: """前面的抓取类都是由四个角点坐标信息定义的,如果想对框进行什么操作的话,不太方便, 这里使用其中提取出的中心点坐标,角度,以及长宽来定义一个矩形,对于这个矩形的整体处 理比较方方便(比如将矩形的宽度缩小三倍),但是最终的绘制还是要通过角点坐标来实现,所以,里面还要有一个能够根据 这几个参数反求角点坐标的函数""" def __init__(self, center, angle, length=60, width=30): """:功能 :类初始化函数,进行参数传递 :参数 :这些参数是啥很明显了吧,就不再赘述了""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Grasp_cpaw: """前面的抓取类都是由四个角点坐标信息定义的,如果想对框进行什么操作的话,不太方便, 这里使用其中提取出的中心点坐标,角度,以及长宽来定义一个矩形,对于这个矩形的整体处 理比较方方便(比如将矩形的宽度缩小三倍),但是最终的绘制还是要通过角点坐标来实现,所以,里面还要有一个能够根据 这几个参数反求角点坐标的函数""" def __init__(self, center, angle, length=60, width=30): """:功能 :类初始化函数,进行参数传递 :参数 :这些参数是啥很明显了吧,就不再赘述了""" self.center ...
the_stack_v2_python_sparse
3.data_augmentation/grasp_pro.py
Nhiemth1985/ggcnn_cornell_dataset
train
0
0786821ba8092e1d8819fe1f185bf4cd060da495
[ "super(MultiHeadAttention, self).__init__()\nassert n_units % h == 0\nstvd = 1.0 / np.sqrt(n_units)\nwith self.init_scope():\n self.linear_q = L.Linear(n_units, n_units, initialW=initialW(scale=stvd), initial_bias=initial_bias(scale=stvd))\n self.linear_k = L.Linear(n_units, n_units, initialW=initialW(scale=s...
<|body_start_0|> super(MultiHeadAttention, self).__init__() assert n_units % h == 0 stvd = 1.0 / np.sqrt(n_units) with self.init_scope(): self.linear_q = L.Linear(n_units, n_units, initialW=initialW(scale=stvd), initial_bias=initial_bias(scale=stvd)) self.linear_k...
Multi Head Attention Layer. Args: n_units (int): Number of input units. h (int): Number of attention heads. dropout (float): Dropout rate. initialW: Initializer to initialize the weight. initial_bias: Initializer to initialize the bias. :param int h: the number of heads :param int n_units: the number of features :param...
MultiHeadAttention
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiHeadAttention: """Multi Head Attention Layer. Args: n_units (int): Number of input units. h (int): Number of attention heads. dropout (float): Dropout rate. initialW: Initializer to initialize the weight. initial_bias: Initializer to initialize the bias. :param int h: the number of heads :pa...
stack_v2_sparse_classes_36k_train_017262
3,423
permissive
[ { "docstring": "Initialize MultiHeadAttention.", "name": "__init__", "signature": "def __init__(self, n_units, h=8, dropout=0.1, initialW=None, initial_bias=None)" }, { "docstring": "Core function of the Multi-head attention layer. Args: e_var (chainer.Variable): Variable of input array. s_var (...
2
stack_v2_sparse_classes_30k_train_001138
Implement the Python class `MultiHeadAttention` described below. Class description: Multi Head Attention Layer. Args: n_units (int): Number of input units. h (int): Number of attention heads. dropout (float): Dropout rate. initialW: Initializer to initialize the weight. initial_bias: Initializer to initialize the bias...
Implement the Python class `MultiHeadAttention` described below. Class description: Multi Head Attention Layer. Args: n_units (int): Number of input units. h (int): Number of attention heads. dropout (float): Dropout rate. initialW: Initializer to initialize the weight. initial_bias: Initializer to initialize the bias...
bcd20948db7846ee523443ef9fd78c7a1248c95e
<|skeleton|> class MultiHeadAttention: """Multi Head Attention Layer. Args: n_units (int): Number of input units. h (int): Number of attention heads. dropout (float): Dropout rate. initialW: Initializer to initialize the weight. initial_bias: Initializer to initialize the bias. :param int h: the number of heads :pa...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MultiHeadAttention: """Multi Head Attention Layer. Args: n_units (int): Number of input units. h (int): Number of attention heads. dropout (float): Dropout rate. initialW: Initializer to initialize the weight. initial_bias: Initializer to initialize the bias. :param int h: the number of heads :param int n_uni...
the_stack_v2_python_sparse
espnet/nets/chainer_backend/transformer/attention.py
espnet/espnet
train
7,242
a57d4e67407b9b80f9d803eaa7e69a1c7513a62e
[ "self._args = kwargs.pop('fnargs', [])\nself._kwargs = kwargs.pop('fnkwargs', {})\nself._fn = fn", "if signals is None:\n signals = {}\nif symbols is None:\n symbols = {}\nif not callable(self._fn):\n if self._fn not in symbols or not callable(symbols[self._fn]):\n raise RuntimeError(\"unresolved ...
<|body_start_0|> self._args = kwargs.pop('fnargs', []) self._kwargs = kwargs.pop('fnkwargs', {}) self._fn = fn <|end_body_0|> <|body_start_1|> if signals is None: signals = {} if symbols is None: symbols = {} if not callable(self._fn): ...
Lazy evaluated value.
HDLLazyValue
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HDLLazyValue: """Lazy evaluated value.""" def __init__(self, fn, *args, **kwargs): """Initialize.""" <|body_0|> def evaluate(self, signals=None, symbols=None): """Evaluate.""" <|body_1|> <|end_skeleton|> <|body_start_0|> self._args = kwargs.pop(...
stack_v2_sparse_classes_36k_train_017263
4,511
permissive
[ { "docstring": "Initialize.", "name": "__init__", "signature": "def __init__(self, fn, *args, **kwargs)" }, { "docstring": "Evaluate.", "name": "evaluate", "signature": "def evaluate(self, signals=None, symbols=None)" } ]
2
null
Implement the Python class `HDLLazyValue` described below. Class description: Lazy evaluated value. Method signatures and docstrings: - def __init__(self, fn, *args, **kwargs): Initialize. - def evaluate(self, signals=None, symbols=None): Evaluate.
Implement the Python class `HDLLazyValue` described below. Class description: Lazy evaluated value. Method signatures and docstrings: - def __init__(self, fn, *args, **kwargs): Initialize. - def evaluate(self, signals=None, symbols=None): Evaluate. <|skeleton|> class HDLLazyValue: """Lazy evaluated value.""" ...
463412cf6a72456acc8cb99569e7dc9c9d472f6d
<|skeleton|> class HDLLazyValue: """Lazy evaluated value.""" def __init__(self, fn, *args, **kwargs): """Initialize.""" <|body_0|> def evaluate(self, signals=None, symbols=None): """Evaluate.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HDLLazyValue: """Lazy evaluated value.""" def __init__(self, fn, *args, **kwargs): """Initialize.""" self._args = kwargs.pop('fnargs', []) self._kwargs = kwargs.pop('fnkwargs', {}) self._fn = fn def evaluate(self, signals=None, symbols=None): """Evaluate.""" ...
the_stack_v2_python_sparse
hdltools/abshdl/assign.py
brunosmmm/hdltools
train
2
aa066272064ae6d8963e1367bc71819e5fbdea45
[ "super().__init__()\nself.in_features = in_features\nself.gate = torch.nn.Sequential(torch.nn.Linear(in_features=in_features, out_features=1), torch.nn.Sigmoid())\nself.apply(initialise_layer_weights)", "item = input[0]\nchannels = item.shape[1]\nkernel_size = item.shape[2:]\ngating_weights = self.gate(item.resha...
<|body_start_0|> super().__init__() self.in_features = in_features self.gate = torch.nn.Sequential(torch.nn.Linear(in_features=in_features, out_features=1), torch.nn.Sigmoid()) self.apply(initialise_layer_weights) <|end_body_0|> <|body_start_1|> item = input[0] channels ...
Gated pooling. Flatten each volume x [1, ZYX], feed through a one layer NN yield one weight per image. This weight is used as the mixing proportion for max_pooling features and average pooling features similar to what is done in MixPooling.
Gated3dPoolingLayer
[ "MIT", "LicenseRef-scancode-generic-cla" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Gated3dPoolingLayer: """Gated pooling. Flatten each volume x [1, ZYX], feed through a one layer NN yield one weight per image. This weight is used as the mixing proportion for max_pooling features and average pooling features similar to what is done in MixPooling.""" def __init__(self, in_fe...
stack_v2_sparse_classes_36k_train_017264
4,772
permissive
[ { "docstring": ":param in_features: should be the size of the flatten volume X*Y*Z", "name": "__init__", "signature": "def __init__(self, in_features: int) -> None" }, { "docstring": ":param input: batch of size [B, C, Z, X, Y", "name": "forward", "signature": "def forward(self, *input: ...
2
stack_v2_sparse_classes_30k_train_001284
Implement the Python class `Gated3dPoolingLayer` described below. Class description: Gated pooling. Flatten each volume x [1, ZYX], feed through a one layer NN yield one weight per image. This weight is used as the mixing proportion for max_pooling features and average pooling features similar to what is done in MixPo...
Implement the Python class `Gated3dPoolingLayer` described below. Class description: Gated pooling. Flatten each volume x [1, ZYX], feed through a one layer NN yield one weight per image. This weight is used as the mixing proportion for max_pooling features and average pooling features similar to what is done in MixPo...
2877002d50d3a34d80f647c18cb561025d9066cc
<|skeleton|> class Gated3dPoolingLayer: """Gated pooling. Flatten each volume x [1, ZYX], feed through a one layer NN yield one weight per image. This weight is used as the mixing proportion for max_pooling features and average pooling features similar to what is done in MixPooling.""" def __init__(self, in_fe...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Gated3dPoolingLayer: """Gated pooling. Flatten each volume x [1, ZYX], feed through a one layer NN yield one weight per image. This weight is used as the mixing proportion for max_pooling features and average pooling features similar to what is done in MixPooling.""" def __init__(self, in_features: int) ...
the_stack_v2_python_sparse
InnerEye/ML/models/layers/pooling_layers.py
microsoft/InnerEye-DeepLearning
train
511
bae80197544cbf18f48a07764f8173d1257b9c45
[ "super(ResNet, self).__init__()\nself.expansion = block.expansion\ndepths = [64, 128, 256, 512]\nself.in_channels = depths[0]\nself.conv1 = nn.Conv2d(3, self.in_channels, kernel_size=7, stride=2, padding=3, bias=False)\nself.bn1 = nn.BatchNorm2d(self.in_channels)\nself.relu = nn.ReLU(inplace=True)\nself.maxpool = n...
<|body_start_0|> super(ResNet, self).__init__() self.expansion = block.expansion depths = [64, 128, 256, 512] self.in_channels = depths[0] self.conv1 = nn.Conv2d(3, self.in_channels, kernel_size=7, stride=2, padding=3, bias=False) self.bn1 = nn.BatchNorm2d(self.in_channel...
ResNet architecture. Implements a ResNet given the type of block and the depth of the layers. If you provide the number of classes it can be used as a classifier, if not it return the output of each layer starting from the deepest. Keep in mind that for the first layer the stride is 2 ** 2 = 4, and the consecutive ones...
ResNet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResNet: """ResNet architecture. Implements a ResNet given the type of block and the depth of the layers. If you provide the number of classes it can be used as a classifier, if not it return the output of each layer starting from the deepest. Keep in mind that for the first layer the stride is 2 ...
stack_v2_sparse_classes_36k_train_017265
14,825
no_license
[ { "docstring": "Initialize the network. Args: block (torch.nn.Module): Indicates the block to use in the network. Must be a BasicBlock or a Bottleneck. layers (seq): Sequence to indicate the number of blocks per each layer. It must have length 4. num_classes (int, optional): If present initialize the architectu...
3
stack_v2_sparse_classes_30k_train_007396
Implement the Python class `ResNet` described below. Class description: ResNet architecture. Implements a ResNet given the type of block and the depth of the layers. If you provide the number of classes it can be used as a classifier, if not it return the output of each layer starting from the deepest. Keep in mind th...
Implement the Python class `ResNet` described below. Class description: ResNet architecture. Implements a ResNet given the type of block and the depth of the layers. If you provide the number of classes it can be used as a classifier, if not it return the output of each layer starting from the deepest. Keep in mind th...
a22aa5b00369c2692bf4fa537bce20144d14d5cb
<|skeleton|> class ResNet: """ResNet architecture. Implements a ResNet given the type of block and the depth of the layers. If you provide the number of classes it can be used as a classifier, if not it return the output of each layer starting from the deepest. Keep in mind that for the first layer the stride is 2 ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResNet: """ResNet architecture. Implements a ResNet given the type of block and the depth of the layers. If you provide the number of classes it can be used as a classifier, if not it return the output of each layer starting from the deepest. Keep in mind that for the first layer the stride is 2 ** 2 = 4, and...
the_stack_v2_python_sparse
torchsight/models/resnet.py
SetaSouto/torchsight
train
2
793161ebc46374fe2aedfe8e5fac4623fca6c260
[ "results = []\nif not contract.is_erc20():\n return results\nfor event in contract.events_declared:\n if event.full_name in ['Transfer(address,address,uint256)', 'Approval(address,address,uint256)']:\n if not event.elems[0].indexed:\n results.append((event, event.elems[0]))\n if not e...
<|body_start_0|> results = [] if not contract.is_erc20(): return results for event in contract.events_declared: if event.full_name in ['Transfer(address,address,uint256)', 'Approval(address,address,uint256)']: if not event.elems[0].indexed: ...
Un-indexed ERC20 event parameters
UnindexedERC20EventParameters
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UnindexedERC20EventParameters: """Un-indexed ERC20 event parameters""" def detect_erc20_unindexed_event_params(contract): """Detect un-indexed ERC20 event parameters in a given contract. :param contract: The contract to check ERC20 events for un-indexed parameters in. :return: A list...
stack_v2_sparse_classes_36k_train_017266
3,597
no_license
[ { "docstring": "Detect un-indexed ERC20 event parameters in a given contract. :param contract: The contract to check ERC20 events for un-indexed parameters in. :return: A list of tuple(event, parameter) of parameters which should be indexed.", "name": "detect_erc20_unindexed_event_params", "signature": ...
2
null
Implement the Python class `UnindexedERC20EventParameters` described below. Class description: Un-indexed ERC20 event parameters Method signatures and docstrings: - def detect_erc20_unindexed_event_params(contract): Detect un-indexed ERC20 event parameters in a given contract. :param contract: The contract to check E...
Implement the Python class `UnindexedERC20EventParameters` described below. Class description: Un-indexed ERC20 event parameters Method signatures and docstrings: - def detect_erc20_unindexed_event_params(contract): Detect un-indexed ERC20 event parameters in a given contract. :param contract: The contract to check E...
7a55877bdde0d6adabe3ce9c4f92e8ba20b4b3cc
<|skeleton|> class UnindexedERC20EventParameters: """Un-indexed ERC20 event parameters""" def detect_erc20_unindexed_event_params(contract): """Detect un-indexed ERC20 event parameters in a given contract. :param contract: The contract to check ERC20 events for un-indexed parameters in. :return: A list...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UnindexedERC20EventParameters: """Un-indexed ERC20 event parameters""" def detect_erc20_unindexed_event_params(contract): """Detect un-indexed ERC20 event parameters in a given contract. :param contract: The contract to check ERC20 events for un-indexed parameters in. :return: A list of tuple(eve...
the_stack_v2_python_sparse
fortress/detectors/erc/unindexed_event_parameters.py
bydolson/fortress-security-audit-engine
train
0
e082dafc4eb0fad89a239f1636e6556668d91463
[ "n, m = (len(A), len(B))\ndp = [[0] * (m + 1) for _ in range(n + 1)]\nans = 0\nfor i in range(n - 1, -1, -1):\n for j in range(m - 1, -1, -1):\n dp[i][j] = dp[i + 1][j + 1] + 1 if A[i] == B[j] else 0\n ans = max(dp[i][j], ans)\nreturn ans", "n, m = (len(A), len(B))\nans = 0\nfor i in range(n):\n ...
<|body_start_0|> n, m = (len(A), len(B)) dp = [[0] * (m + 1) for _ in range(n + 1)] ans = 0 for i in range(n - 1, -1, -1): for j in range(m - 1, -1, -1): dp[i][j] = dp[i + 1][j + 1] + 1 if A[i] == B[j] else 0 ans = max(dp[i][j], ans) re...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findLength(self, A: List[int], B: List[int]) -> int: """dp解法:状态转移方程 dp[i][j] = dp[i+1][j+1] + 1 因为dp[i][j]是由dp[i+1][j+1]+1得来的 所以我们从后往前遍历 :param A: :param B: :return:""" <|body_0|> def findLength2(self, A: List[int], B: List[int]) -> int: """暴力法 三重循环 严重超...
stack_v2_sparse_classes_36k_train_017267
1,445
no_license
[ { "docstring": "dp解法:状态转移方程 dp[i][j] = dp[i+1][j+1] + 1 因为dp[i][j]是由dp[i+1][j+1]+1得来的 所以我们从后往前遍历 :param A: :param B: :return:", "name": "findLength", "signature": "def findLength(self, A: List[int], B: List[int]) -> int" }, { "docstring": "暴力法 三重循环 严重超时 :param A: :param B: :return:", "name":...
2
stack_v2_sparse_classes_30k_train_013270
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findLength(self, A: List[int], B: List[int]) -> int: dp解法:状态转移方程 dp[i][j] = dp[i+1][j+1] + 1 因为dp[i][j]是由dp[i+1][j+1]+1得来的 所以我们从后往前遍历 :param A: :param B: :return: - def findL...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findLength(self, A: List[int], B: List[int]) -> int: dp解法:状态转移方程 dp[i][j] = dp[i+1][j+1] + 1 因为dp[i][j]是由dp[i+1][j+1]+1得来的 所以我们从后往前遍历 :param A: :param B: :return: - def findL...
578cacff5851c5c2522981693c34e3c318002d30
<|skeleton|> class Solution: def findLength(self, A: List[int], B: List[int]) -> int: """dp解法:状态转移方程 dp[i][j] = dp[i+1][j+1] + 1 因为dp[i][j]是由dp[i+1][j+1]+1得来的 所以我们从后往前遍历 :param A: :param B: :return:""" <|body_0|> def findLength2(self, A: List[int], B: List[int]) -> int: """暴力法 三重循环 严重超...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findLength(self, A: List[int], B: List[int]) -> int: """dp解法:状态转移方程 dp[i][j] = dp[i+1][j+1] + 1 因为dp[i][j]是由dp[i+1][j+1]+1得来的 所以我们从后往前遍历 :param A: :param B: :return:""" n, m = (len(A), len(B)) dp = [[0] * (m + 1) for _ in range(n + 1)] ans = 0 for i in ran...
the_stack_v2_python_sparse
最长重复子数组.py
cjrzs/MyLeetCode
train
8
95e1460df1f9aff8745396fcb7e722c1fc505805
[ "userid = int(userid)\nif userid in self:\n return super(_DictionaryOfPlayers, self).__getitem__(userid)\nuniqueid = getPlayer(userid).uniqueid(True)\nfor player in list(self):\n if self[player].gg_player.steamid != uniqueid:\n continue\n value = self[userid] = Player(userid)\n value.reconnect = ...
<|body_start_0|> userid = int(userid) if userid in self: return super(_DictionaryOfPlayers, self).__getitem__(userid) uniqueid = getPlayer(userid).uniqueid(True) for player in list(self): if self[player].gg_player.steamid != uniqueid: continue ...
Class that stores Player instances
_DictionaryOfPlayers
[ "Artistic-1.0", "LicenseRef-scancode-public-domain" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _DictionaryOfPlayers: """Class that stores Player instances""" def __getitem__(self, userid): """Returns the Player instance for the given userid""" <|body_0|> def clear(self): """Method used to clear the dictionary and cancel all player delays""" <|body_...
stack_v2_sparse_classes_36k_train_017268
2,523
permissive
[ { "docstring": "Returns the Player instance for the given userid", "name": "__getitem__", "signature": "def __getitem__(self, userid)" }, { "docstring": "Method used to clear the dictionary and cancel all player delays", "name": "clear", "signature": "def clear(self)" } ]
2
null
Implement the Python class `_DictionaryOfPlayers` described below. Class description: Class that stores Player instances Method signatures and docstrings: - def __getitem__(self, userid): Returns the Player instance for the given userid - def clear(self): Method used to clear the dictionary and cancel all player dela...
Implement the Python class `_DictionaryOfPlayers` described below. Class description: Class that stores Player instances Method signatures and docstrings: - def __getitem__(self, userid): Returns the Player instance for the given userid - def clear(self): Method used to clear the dictionary and cancel all player dela...
ebf4624626266f552189a32612b8d09cd5b4c5a3
<|skeleton|> class _DictionaryOfPlayers: """Class that stores Player instances""" def __getitem__(self, userid): """Returns the Player instance for the given userid""" <|body_0|> def clear(self): """Method used to clear the dictionary and cancel all player delays""" <|body_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _DictionaryOfPlayers: """Class that stores Player instances""" def __getitem__(self, userid): """Returns the Player instance for the given userid""" userid = int(userid) if userid in self: return super(_DictionaryOfPlayers, self).__getitem__(userid) uniqueid = ...
the_stack_v2_python_sparse
cstrike/addons/eventscripts/gungame51/scripts/included/gg_elimination/modules/dictionary.py
GunGame-Dev-Team/GunGame51
train
0
cc02d81e6d57350938162687aa8a64426c7b34e6
[ "previou = None\ncurrent = head\nwhile current:\n tmp_next = current.next\n current.next = previou\n previou = current\n current = tmp_next\nreturn previou", "if head is None:\n return True\nfast = slow = head\nwhile fast.next and fast.next.next:\n fast = fast.next.next\n slow = slow.next\nre...
<|body_start_0|> previou = None current = head while current: tmp_next = current.next current.next = previou previou = current current = tmp_next return previou <|end_body_0|> <|body_start_1|> if head is None: return Tr...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def reverseList(self, head): """:type head: ListNode :rtype: ListNode""" <|body_0|> def isPalindrome(self, head): """:type head: ListNode :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> previou = None current = head ...
stack_v2_sparse_classes_36k_train_017269
2,545
no_license
[ { "docstring": ":type head: ListNode :rtype: ListNode", "name": "reverseList", "signature": "def reverseList(self, head)" }, { "docstring": ":type head: ListNode :rtype: bool", "name": "isPalindrome", "signature": "def isPalindrome(self, head)" } ]
2
stack_v2_sparse_classes_30k_train_007103
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverseList(self, head): :type head: ListNode :rtype: ListNode - def isPalindrome(self, head): :type head: ListNode :rtype: bool
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverseList(self, head): :type head: ListNode :rtype: ListNode - def isPalindrome(self, head): :type head: ListNode :rtype: bool <|skeleton|> class Solution: def revers...
852fad258f5070c7b93c35252f7404e85e709ea6
<|skeleton|> class Solution: def reverseList(self, head): """:type head: ListNode :rtype: ListNode""" <|body_0|> def isPalindrome(self, head): """:type head: ListNode :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def reverseList(self, head): """:type head: ListNode :rtype: ListNode""" previou = None current = head while current: tmp_next = current.next current.next = previou previou = current current = tmp_next return pre...
the_stack_v2_python_sparse
201-300/234. Palindrome Linked List.py
SunnyMarkLiu/LeetCode
train
1
6402121c456d18f9e6c64407ba1c7da1ea588025
[ "biz_reviews = db.filter_by(ReviewModel, 'business', businessId)\nif biz_reviews:\n return (biz_reviews, 200)\nelse:\n return ({'message': 'business has no reviews'}, 400)", "self.businessId = businessId\nargs = review_parser.parse_args()\nnew_review = args\nis_not_valid_input = validate_review_payload(args...
<|body_start_0|> biz_reviews = db.filter_by(ReviewModel, 'business', businessId) if biz_reviews: return (biz_reviews, 200) else: return ({'message': 'business has no reviews'}, 400) <|end_body_0|> <|body_start_1|> self.businessId = businessId args = revie...
this class handles the business reviews endpoints
Review
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Review: """this class handles the business reviews endpoints""" def get(self, current_user, token, businessId): """returns a specific business's reviews""" <|body_0|> def post(self, current_user, token, businessId): """handles posting a review to a specific busin...
stack_v2_sparse_classes_36k_train_017270
1,994
permissive
[ { "docstring": "returns a specific business's reviews", "name": "get", "signature": "def get(self, current_user, token, businessId)" }, { "docstring": "handles posting a review to a specific business", "name": "post", "signature": "def post(self, current_user, token, businessId)" } ]
2
stack_v2_sparse_classes_30k_train_016140
Implement the Python class `Review` described below. Class description: this class handles the business reviews endpoints Method signatures and docstrings: - def get(self, current_user, token, businessId): returns a specific business's reviews - def post(self, current_user, token, businessId): handles posting a revie...
Implement the Python class `Review` described below. Class description: this class handles the business reviews endpoints Method signatures and docstrings: - def get(self, current_user, token, businessId): returns a specific business's reviews - def post(self, current_user, token, businessId): handles posting a revie...
6a36b51876479adf99874d91dd0bc765f4839dd6
<|skeleton|> class Review: """this class handles the business reviews endpoints""" def get(self, current_user, token, businessId): """returns a specific business's reviews""" <|body_0|> def post(self, current_user, token, businessId): """handles posting a review to a specific busin...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Review: """this class handles the business reviews endpoints""" def get(self, current_user, token, businessId): """returns a specific business's reviews""" biz_reviews = db.filter_by(ReviewModel, 'business', businessId) if biz_reviews: return (biz_reviews, 200) ...
the_stack_v2_python_sparse
apis/v1/weconnect_api/reviews_api.py
tibetegya/WeConnect
train
1
dd101b8047c97837e0ae80d2386b04fcb877fd76
[ "if file_name.lower().endswith('.csv'):\n return SchemaGenerator.__csv_schema_generator(file)\nelif file_name.lower().endswith('.json'):\n return SchemaGenerator.__json_schema_generator(file)\nelif file_name.lower().endswith('.xlsx'):\n return SchemaGenerator.__xlsx_schema_generator(file)\nlogging.error('N...
<|body_start_0|> if file_name.lower().endswith('.csv'): return SchemaGenerator.__csv_schema_generator(file) elif file_name.lower().endswith('.json'): return SchemaGenerator.__json_schema_generator(file) elif file_name.lower().endswith('.xlsx'): return SchemaGe...
Takes in a file and parses it and generates a schema.
SchemaGenerator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SchemaGenerator: """Takes in a file and parses it and generates a schema.""" def build(file, file_name): """Depending on the type of the file, it uses a different function to generate the schema.""" <|body_0|> def __csv_schema_generator(file): """Takes in a given...
stack_v2_sparse_classes_36k_train_017271
4,801
no_license
[ { "docstring": "Depending on the type of the file, it uses a different function to generate the schema.", "name": "build", "signature": "def build(file, file_name)" }, { "docstring": "Takes in a given csv file and returns the schema for it. We are assuming that the top row contains the headers f...
5
stack_v2_sparse_classes_30k_train_006487
Implement the Python class `SchemaGenerator` described below. Class description: Takes in a file and parses it and generates a schema. Method signatures and docstrings: - def build(file, file_name): Depending on the type of the file, it uses a different function to generate the schema. - def __csv_schema_generator(fi...
Implement the Python class `SchemaGenerator` described below. Class description: Takes in a file and parses it and generates a schema. Method signatures and docstrings: - def build(file, file_name): Depending on the type of the file, it uses a different function to generate the schema. - def __csv_schema_generator(fi...
873c96bdf5fd07ddc986d3944a90c5bcfa898b2d
<|skeleton|> class SchemaGenerator: """Takes in a file and parses it and generates a schema.""" def build(file, file_name): """Depending on the type of the file, it uses a different function to generate the schema.""" <|body_0|> def __csv_schema_generator(file): """Takes in a given...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SchemaGenerator: """Takes in a file and parses it and generates a schema.""" def build(file, file_name): """Depending on the type of the file, it uses a different function to generate the schema.""" if file_name.lower().endswith('.csv'): return SchemaGenerator.__csv_schema_gen...
the_stack_v2_python_sparse
cataloger/utilities/schema_generator.py
timeonator/opendatapdx
train
1
ad2cf5ed5bf84c172cb0aa1eaac2f3cd983f6298
[ "super().__init__()\nself.encoder = TransformerSRUEncoder(input_size, d_model, nhead, dim_feedforward, num_encoder_layers, dropout, sru_dropout, bidrectional, **kwargs)\nself.decoder = TransformerSRUDecoder(input_size, d_model, nhead, dim_feedforward, num_encoder_layers, dropout, sru_dropout, **kwargs)", "if src....
<|body_start_0|> super().__init__() self.encoder = TransformerSRUEncoder(input_size, d_model, nhead, dim_feedforward, num_encoder_layers, dropout, sru_dropout, bidrectional, **kwargs) self.decoder = TransformerSRUDecoder(input_size, d_model, nhead, dim_feedforward, num_encoder_layers, dropout, s...
A Transformer with an SRU replacing the FFN.
TransformerSRU
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TransformerSRU: """A Transformer with an SRU replacing the FFN.""" def __init__(self, input_size: int=512, d_model: int=512, nhead: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, dim_feedforward: int=2048, dropout: float=0.1, sru_dropout: Optional[float]=None, bidrectional: boo...
stack_v2_sparse_classes_36k_train_017272
23,050
permissive
[ { "docstring": "Initialize the TransformerSRU Model. Parameters ---------- input_size : int, optional dimension of embeddings (default=512). if different from d_model, then a linear layer is added to project from input_size to d_model. d_model : int, optional the number of expected features in the encoder/decod...
2
null
Implement the Python class `TransformerSRU` described below. Class description: A Transformer with an SRU replacing the FFN. Method signatures and docstrings: - def __init__(self, input_size: int=512, d_model: int=512, nhead: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, dim_feedforward: int=2048, drop...
Implement the Python class `TransformerSRU` described below. Class description: A Transformer with an SRU replacing the FFN. Method signatures and docstrings: - def __init__(self, input_size: int=512, d_model: int=512, nhead: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, dim_feedforward: int=2048, drop...
0dc2f5b2b286694defe8abf450fe5be9ae12c097
<|skeleton|> class TransformerSRU: """A Transformer with an SRU replacing the FFN.""" def __init__(self, input_size: int=512, d_model: int=512, nhead: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, dim_feedforward: int=2048, dropout: float=0.1, sru_dropout: Optional[float]=None, bidrectional: boo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TransformerSRU: """A Transformer with an SRU replacing the FFN.""" def __init__(self, input_size: int=512, d_model: int=512, nhead: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, dim_feedforward: int=2048, dropout: float=0.1, sru_dropout: Optional[float]=None, bidrectional: bool=False, **kw...
the_stack_v2_python_sparse
flambe/nn/transformer_sru.py
cle-ros/flambe
train
1
284f75f406ede2da6352055b0e1be7fcefbebfbe
[ "ret = {'code': constant.BACKEND_CODE_DELETED, 'message': '删除服务器组成功'}\nmodels.ServerGroup.objects.filter(id=self.request.query_params['id']).delete()\nreturn JsonResponse(ret, safe=False)", "ret = {'code': constant.BACKEND_CODE_OPT_FAIL, 'message': '创建服务器组失败'}\ndata = JSONParser().parse(request)\ntry:\n new_gr...
<|body_start_0|> ret = {'code': constant.BACKEND_CODE_DELETED, 'message': '删除服务器组成功'} models.ServerGroup.objects.filter(id=self.request.query_params['id']).delete() return JsonResponse(ret, safe=False) <|end_body_0|> <|body_start_1|> ret = {'code': constant.BACKEND_CODE_OPT_FAIL, 'messa...
ServerGroupInfo
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ServerGroupInfo: def delete(self, *args, **kwargs): """删除服务器组""" <|body_0|> def post(self, request, *args, **kwargs): """创建服务器组""" <|body_1|> <|end_skeleton|> <|body_start_0|> ret = {'code': constant.BACKEND_CODE_DELETED, 'message': '删除服务器组成功'} ...
stack_v2_sparse_classes_36k_train_017273
23,670
no_license
[ { "docstring": "删除服务器组", "name": "delete", "signature": "def delete(self, *args, **kwargs)" }, { "docstring": "创建服务器组", "name": "post", "signature": "def post(self, request, *args, **kwargs)" } ]
2
stack_v2_sparse_classes_30k_train_007900
Implement the Python class `ServerGroupInfo` described below. Class description: Implement the ServerGroupInfo class. Method signatures and docstrings: - def delete(self, *args, **kwargs): 删除服务器组 - def post(self, request, *args, **kwargs): 创建服务器组
Implement the Python class `ServerGroupInfo` described below. Class description: Implement the ServerGroupInfo class. Method signatures and docstrings: - def delete(self, *args, **kwargs): 删除服务器组 - def post(self, request, *args, **kwargs): 创建服务器组 <|skeleton|> class ServerGroupInfo: def delete(self, *args, **kwa...
b7018a9357a7d71acd1cd5eb0b8e0f6dc8016a88
<|skeleton|> class ServerGroupInfo: def delete(self, *args, **kwargs): """删除服务器组""" <|body_0|> def post(self, request, *args, **kwargs): """创建服务器组""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ServerGroupInfo: def delete(self, *args, **kwargs): """删除服务器组""" ret = {'code': constant.BACKEND_CODE_DELETED, 'message': '删除服务器组成功'} models.ServerGroup.objects.filter(id=self.request.query_params['id']).delete() return JsonResponse(ret, safe=False) def post(self, request,...
the_stack_v2_python_sparse
monitor_api2/monitor_web/views/server_view.py
evoup/monitor_pass
train
0
dc840657645421dbdce14ac53e42865e44af777d
[ "global gf\nclocks_to_check = self.SYSTEM_CLOCK_SOURCES.keys()\nfrequencies = gf.apis.selftest.measure_clock_frequencies(*clocks_to_check)\nfor clock_number, measured_frequency in zip(clocks_to_check, frequencies):\n parameters = self.SYSTEM_CLOCK_SOURCES[clock_number]\n with self.subTest(parameters['name']):...
<|body_start_0|> global gf clocks_to_check = self.SYSTEM_CLOCK_SOURCES.keys() frequencies = gf.apis.selftest.measure_clock_frequencies(*clocks_to_check) for clock_number, measured_frequency in zip(clocks_to_check, frequencies): parameters = self.SYSTEM_CLOCK_SOURCES[clock_num...
Ensures each of the GreatFET's clocks are up and running.
ValidateSystemClocks
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ValidateSystemClocks: """Ensures each of the GreatFET's clocks are up and running.""" def test_system_clocks(self): """Test of each of the system's clocks""" <|body_0|> def test_usb_pll_stability(self): """Test that the USB-PLL is exactly in spec.""" <|bo...
stack_v2_sparse_classes_36k_train_017274
4,375
permissive
[ { "docstring": "Test of each of the system's clocks", "name": "test_system_clocks", "signature": "def test_system_clocks(self)" }, { "docstring": "Test that the USB-PLL is exactly in spec.", "name": "test_usb_pll_stability", "signature": "def test_usb_pll_stability(self)" } ]
2
stack_v2_sparse_classes_30k_train_020397
Implement the Python class `ValidateSystemClocks` described below. Class description: Ensures each of the GreatFET's clocks are up and running. Method signatures and docstrings: - def test_system_clocks(self): Test of each of the system's clocks - def test_usb_pll_stability(self): Test that the USB-PLL is exactly in ...
Implement the Python class `ValidateSystemClocks` described below. Class description: Ensures each of the GreatFET's clocks are up and running. Method signatures and docstrings: - def test_system_clocks(self): Test of each of the system's clocks - def test_usb_pll_stability(self): Test that the USB-PLL is exactly in ...
2409575d28fc7c9cae44c9085c7457ddfb54f893
<|skeleton|> class ValidateSystemClocks: """Ensures each of the GreatFET's clocks are up and running.""" def test_system_clocks(self): """Test of each of the system's clocks""" <|body_0|> def test_usb_pll_stability(self): """Test that the USB-PLL is exactly in spec.""" <|bo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ValidateSystemClocks: """Ensures each of the GreatFET's clocks are up and running.""" def test_system_clocks(self): """Test of each of the system's clocks""" global gf clocks_to_check = self.SYSTEM_CLOCK_SOURCES.keys() frequencies = gf.apis.selftest.measure_clock_frequenci...
the_stack_v2_python_sparse
host/greatfet/commands/greatfet_selftest.py
greatscottgadgets/greatfet
train
273
6becc63491afcea8937d74abc009985e95b5ae98
[ "ls = list(s.strip())\nif len(ls) == 0:\n return 0\nsign = -1 if ls[0] == '-' else 1\nif ls[0] in ['-', '+']:\n del ls[0]\nret, i = (0, 0)\nwhile i < len(ls) and ls[i].isdigit():\n ret = ret * 10 + ord(ls[i]) - ord('0')\n i += 1\nreturn max(-2 ** 31, min(sign * ret, 2 ** 31 - 1))", "num = ['0', '1', '...
<|body_start_0|> ls = list(s.strip()) if len(ls) == 0: return 0 sign = -1 if ls[0] == '-' else 1 if ls[0] in ['-', '+']: del ls[0] ret, i = (0, 0) while i < len(ls) and ls[i].isdigit(): ret = ret * 10 + ord(ls[i]) - ord('0') ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def myAtoi(self, s): """:type str: str :rtype: int""" <|body_0|> def myAtoi2(self, str): """:type str: str :rtype: int""" <|body_1|> def myAtoi3(self, str): """:type str: str :rtype: int""" <|body_2|> <|end_skeleton|> <|body_s...
stack_v2_sparse_classes_36k_train_017275
4,256
no_license
[ { "docstring": ":type str: str :rtype: int", "name": "myAtoi", "signature": "def myAtoi(self, s)" }, { "docstring": ":type str: str :rtype: int", "name": "myAtoi2", "signature": "def myAtoi2(self, str)" }, { "docstring": ":type str: str :rtype: int", "name": "myAtoi3", "s...
3
stack_v2_sparse_classes_30k_train_001583
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def myAtoi(self, s): :type str: str :rtype: int - def myAtoi2(self, str): :type str: str :rtype: int - def myAtoi3(self, str): :type str: str :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def myAtoi(self, s): :type str: str :rtype: int - def myAtoi2(self, str): :type str: str :rtype: int - def myAtoi3(self, str): :type str: str :rtype: int <|skeleton|> class Solu...
132d3d901a1e9bb027fc32e2269bc6efc170eee9
<|skeleton|> class Solution: def myAtoi(self, s): """:type str: str :rtype: int""" <|body_0|> def myAtoi2(self, str): """:type str: str :rtype: int""" <|body_1|> def myAtoi3(self, str): """:type str: str :rtype: int""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def myAtoi(self, s): """:type str: str :rtype: int""" ls = list(s.strip()) if len(ls) == 0: return 0 sign = -1 if ls[0] == '-' else 1 if ls[0] in ['-', '+']: del ls[0] ret, i = (0, 0) while i < len(ls) and ls[i].isdigit(...
the_stack_v2_python_sparse
Leetcode/8. String to Integer (atoi).py
simple5510/Leetcode
train
0
340f07d55df95c7f874f3ff5d959c609c3b975a0
[ "if issubclass(model, NetworkLocation):\n return NETWORK_LOCATION\nreturn None", "if issubclass(model, NetworkLocation):\n return NETWORK_LOCATION\nreturn None", "obj1_instance = isinstance(obj1, NetworkLocation)\nobj2_instance = isinstance(obj2, NetworkLocation)\nif obj1_instance and obj2_instance:\n ...
<|body_start_0|> if issubclass(model, NetworkLocation): return NETWORK_LOCATION return None <|end_body_0|> <|body_start_1|> if issubclass(model, NetworkLocation): return NETWORK_LOCATION return None <|end_body_1|> <|body_start_2|> obj1_instance = isinsta...
Determine how to route database calls for the Network Location models. All other models will be routed to the default database.
NetworkLocationRouter
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NetworkLocationRouter: """Determine how to route database calls for the Network Location models. All other models will be routed to the default database.""" def db_for_read(self, model, **hints): """Send all read operations on Notifications app models to NETWORK_LOCATION.""" ...
stack_v2_sparse_classes_36k_train_017276
6,259
permissive
[ { "docstring": "Send all read operations on Notifications app models to NETWORK_LOCATION.", "name": "db_for_read", "signature": "def db_for_read(self, model, **hints)" }, { "docstring": "Send all write operations on Notifications app models to NETWORK_LOCATION.", "name": "db_for_write", ...
4
stack_v2_sparse_classes_30k_train_004055
Implement the Python class `NetworkLocationRouter` described below. Class description: Determine how to route database calls for the Network Location models. All other models will be routed to the default database. Method signatures and docstrings: - def db_for_read(self, model, **hints): Send all read operations on ...
Implement the Python class `NetworkLocationRouter` described below. Class description: Determine how to route database calls for the Network Location models. All other models will be routed to the default database. Method signatures and docstrings: - def db_for_read(self, model, **hints): Send all read operations on ...
c87008905afa785dce06e63e5189358abd5113cc
<|skeleton|> class NetworkLocationRouter: """Determine how to route database calls for the Network Location models. All other models will be routed to the default database.""" def db_for_read(self, model, **hints): """Send all read operations on Notifications app models to NETWORK_LOCATION.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NetworkLocationRouter: """Determine how to route database calls for the Network Location models. All other models will be routed to the default database.""" def db_for_read(self, model, **hints): """Send all read operations on Notifications app models to NETWORK_LOCATION.""" if issubclass...
the_stack_v2_python_sparse
kolibri/core/discovery/models.py
swiftugandan/kolibri
train
0
c36ea0829047d4bebdf8d60fa3a1cf947994a168
[ "super(FCCritic, self).__init__()\nself.img_size = img_size\nself.channels = channels\nself.fc1 = nn.Linear(img_size * img_size * channels, 512)\nself.fc2 = nn.Linear(512, 512)\nself.fc3 = nn.Linear(512, 1)\nself.relu = nn.ReLU()", "x = image_batch.reshape(-1, self.img_size * self.img_size * self.channels)\nx = s...
<|body_start_0|> super(FCCritic, self).__init__() self.img_size = img_size self.channels = channels self.fc1 = nn.Linear(img_size * img_size * channels, 512) self.fc2 = nn.Linear(512, 512) self.fc3 = nn.Linear(512, 1) self.relu = nn.ReLU() <|end_body_0|> <|body_s...
FCCritic
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FCCritic: def __init__(self, img_size, channels): """Neural network which takes a batch of images and creates a batch of scalars which represent a score for how real the image looks. Uses just several fully connected layers. Works for arbitrary image size and number of channels, because ...
stack_v2_sparse_classes_36k_train_017277
2,726
no_license
[ { "docstring": "Neural network which takes a batch of images and creates a batch of scalars which represent a score for how real the image looks. Uses just several fully connected layers. Works for arbitrary image size and number of channels, because it flattens them first. :param img_size: :param channels: num...
2
stack_v2_sparse_classes_30k_test_000012
Implement the Python class `FCCritic` described below. Class description: Implement the FCCritic class. Method signatures and docstrings: - def __init__(self, img_size, channels): Neural network which takes a batch of images and creates a batch of scalars which represent a score for how real the image looks. Uses jus...
Implement the Python class `FCCritic` described below. Class description: Implement the FCCritic class. Method signatures and docstrings: - def __init__(self, img_size, channels): Neural network which takes a batch of images and creates a batch of scalars which represent a score for how real the image looks. Uses jus...
43a453a03060c2adf6bf16302d5138cfa77a30d1
<|skeleton|> class FCCritic: def __init__(self, img_size, channels): """Neural network which takes a batch of images and creates a batch of scalars which represent a score for how real the image looks. Uses just several fully connected layers. Works for arbitrary image size and number of channels, because ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FCCritic: def __init__(self, img_size, channels): """Neural network which takes a batch of images and creates a batch of scalars which represent a score for how real the image looks. Uses just several fully connected layers. Works for arbitrary image size and number of channels, because it flattens th...
the_stack_v2_python_sparse
workshops/gan/src/critics.py
Petlja/PSIML
train
17
c884dd266eb3c1cecf302774bc47e794f5bd24f2
[ "matcher = ContainsAllIPs(['10.0.0.1', '10.0.0.2', '10.0.0.2'])\nmismatch = matcher.match([{'id': i, 'address': '10.0.0.{0}'.format(i)} for i in (1, 2)])\nself.assertEqual(None, mismatch)", "matcher = ContainsAllIPs(['10.0.0.1', '10.0.0.2', '10.0.0.2'])\nself.assertNotEqual(None, matcher.match([{'id': i, 'address...
<|body_start_0|> matcher = ContainsAllIPs(['10.0.0.1', '10.0.0.2', '10.0.0.2']) mismatch = matcher.match([{'id': i, 'address': '10.0.0.{0}'.format(i)} for i in (1, 2)]) self.assertEqual(None, mismatch) <|end_body_0|> <|body_start_1|> matcher = ContainsAllIPs(['10.0.0.1', '10.0.0.2', '10...
Tests for the CLB matchers.
MatcherTestCase
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MatcherTestCase: """Tests for the CLB matchers.""" def test_contains_all_ips_success(self): """:class:`ContainsAllIPs` succeeds when the nodes contain all the IPs given.""" <|body_0|> def test_contains_all_ips_failure(self): """:class:`ContainsAllIPs` fail when t...
stack_v2_sparse_classes_36k_train_017278
18,654
permissive
[ { "docstring": ":class:`ContainsAllIPs` succeeds when the nodes contain all the IPs given.", "name": "test_contains_all_ips_success", "signature": "def test_contains_all_ips_success(self)" }, { "docstring": ":class:`ContainsAllIPs` fail when the nodes contain only some or none of the all the IPs...
5
stack_v2_sparse_classes_30k_test_000940
Implement the Python class `MatcherTestCase` described below. Class description: Tests for the CLB matchers. Method signatures and docstrings: - def test_contains_all_ips_success(self): :class:`ContainsAllIPs` succeeds when the nodes contain all the IPs given. - def test_contains_all_ips_failure(self): :class:`Contai...
Implement the Python class `MatcherTestCase` described below. Class description: Tests for the CLB matchers. Method signatures and docstrings: - def test_contains_all_ips_success(self): :class:`ContainsAllIPs` succeeds when the nodes contain all the IPs given. - def test_contains_all_ips_failure(self): :class:`Contai...
7199cdd67255fe116dbcbedea660c13453671134
<|skeleton|> class MatcherTestCase: """Tests for the CLB matchers.""" def test_contains_all_ips_success(self): """:class:`ContainsAllIPs` succeeds when the nodes contain all the IPs given.""" <|body_0|> def test_contains_all_ips_failure(self): """:class:`ContainsAllIPs` fail when t...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MatcherTestCase: """Tests for the CLB matchers.""" def test_contains_all_ips_success(self): """:class:`ContainsAllIPs` succeeds when the nodes contain all the IPs given.""" matcher = ContainsAllIPs(['10.0.0.1', '10.0.0.2', '10.0.0.2']) mismatch = matcher.match([{'id': i, 'address'...
the_stack_v2_python_sparse
otter/integration/lib/test_cloud_load_balancer.py
rackerlabs/otter
train
20
97698dfefc49ef2c6f9d6ccea623b779fa658274
[ "if 'action' in request.POST and request.POST['action'] in self.actions:\n if not request.POST.getlist(admin.ACTION_CHECKBOX_NAME):\n post = request.POST.copy()\n post.update({admin.ACTION_CHECKBOX_NAME: 0})\n request._set_post(post)\nreturn super(OfficerPositionAdmin, self).changelist_view(...
<|body_start_0|> if 'action' in request.POST and request.POST['action'] in self.actions: if not request.POST.getlist(admin.ACTION_CHECKBOX_NAME): post = request.POST.copy() post.update({admin.ACTION_CHECKBOX_NAME: 0}) request._set_post(post) re...
OfficerPositionAdmin
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OfficerPositionAdmin: def changelist_view(self, request, extra_context=None): """Overwrites the changelist view to allow custom actions to be deleted when no items in the list are selected.""" <|body_0|> def rebase_order(self, request, queryset): """Rebase the list s...
stack_v2_sparse_classes_36k_train_017279
4,069
permissive
[ { "docstring": "Overwrites the changelist view to allow custom actions to be deleted when no items in the list are selected.", "name": "changelist_view", "signature": "def changelist_view(self, request, extra_context=None)" }, { "docstring": "Rebase the list starting at the highest order, rebasi...
2
stack_v2_sparse_classes_30k_train_018706
Implement the Python class `OfficerPositionAdmin` described below. Class description: Implement the OfficerPositionAdmin class. Method signatures and docstrings: - def changelist_view(self, request, extra_context=None): Overwrites the changelist view to allow custom actions to be deleted when no items in the list are...
Implement the Python class `OfficerPositionAdmin` described below. Class description: Implement the OfficerPositionAdmin class. Method signatures and docstrings: - def changelist_view(self, request, extra_context=None): Overwrites the changelist view to allow custom actions to be deleted when no items in the list are...
0f7c62bdad58c9907c903899cd12555f07584d37
<|skeleton|> class OfficerPositionAdmin: def changelist_view(self, request, extra_context=None): """Overwrites the changelist view to allow custom actions to be deleted when no items in the list are selected.""" <|body_0|> def rebase_order(self, request, queryset): """Rebase the list s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OfficerPositionAdmin: def changelist_view(self, request, extra_context=None): """Overwrites the changelist view to allow custom actions to be deleted when no items in the list are selected.""" if 'action' in request.POST and request.POST['action'] in self.actions: if not request.PO...
the_stack_v2_python_sparse
codedevils_org/users/admin.py
KevinThePepper/codedevils.org
train
0
2e1656933d19b2ad59dc152e0587970177766c81
[ "out_list = []\nfor inc_base in self.series:\n for param in param_list:\n inc_new = copy.deepcopy(inc_base)\n inc_new['incar'][key] = param\n inc_new.update({key: param})\n dst_path = os.path.join(inc_new['path'], '{0}_{1}'.format(key, param))\n inc_new.update({'path': dst_path...
<|body_start_0|> out_list = [] for inc_base in self.series: for param in param_list: inc_new = copy.deepcopy(inc_base) inc_new['incar'][key] = param inc_new.update({key: param}) dst_path = os.path.join(inc_new['path'], '{0}_{1}'...
Alt parameters of INCAR file. Control below attribute. KPOINTSもここで変更する
IncarMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IncarMixin: """Alt parameters of INCAR file. Control below attribute. KPOINTSもここで変更する""" def set_incar_tag(self, key, param_list): """incarパラメータの変更""" <|body_0|> def set_incar_fixedtag(self, key, param_list): """incarのfixedtagを変更 すべてのINCARファイルで共通になる""" <|...
stack_v2_sparse_classes_36k_train_017280
7,518
no_license
[ { "docstring": "incarパラメータの変更", "name": "set_incar_tag", "signature": "def set_incar_tag(self, key, param_list)" }, { "docstring": "incarのfixedtagを変更 すべてのINCARファイルで共通になる", "name": "set_incar_fixedtag", "signature": "def set_incar_fixedtag(self, key, param_list)" } ]
2
stack_v2_sparse_classes_30k_train_020658
Implement the Python class `IncarMixin` described below. Class description: Alt parameters of INCAR file. Control below attribute. KPOINTSもここで変更する Method signatures and docstrings: - def set_incar_tag(self, key, param_list): incarパラメータの変更 - def set_incar_fixedtag(self, key, param_list): incarのfixedtagを変更 すべてのINCARファイ...
Implement the Python class `IncarMixin` described below. Class description: Alt parameters of INCAR file. Control below attribute. KPOINTSもここで変更する Method signatures and docstrings: - def set_incar_tag(self, key, param_list): incarパラメータの変更 - def set_incar_fixedtag(self, key, param_list): incarのfixedtagを変更 すべてのINCARファイ...
d210cf6f8fb370ff6deecc949c7dcb3df653d1ca
<|skeleton|> class IncarMixin: """Alt parameters of INCAR file. Control below attribute. KPOINTSもここで変更する""" def set_incar_tag(self, key, param_list): """incarパラメータの変更""" <|body_0|> def set_incar_fixedtag(self, key, param_list): """incarのfixedtagを変更 すべてのINCARファイルで共通になる""" <|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class IncarMixin: """Alt parameters of INCAR file. Control below attribute. KPOINTSもここで変更する""" def set_incar_tag(self, key, param_list): """incarパラメータの変更""" out_list = [] for inc_base in self.series: for param in param_list: inc_new = copy.deepcopy(inc_base) ...
the_stack_v2_python_sparse
module/series_vasp.py
buriedwood/00_workSpace
train
0
d2adb7515c3325b99272d0bde593db0043e8739c
[ "res = 0\nfor i in range(n + 1):\n for j in range(n // 2 + 1):\n for k in range(n // 5 + 1):\n if i + j * 2 + k * 5 == n:\n res += 1\nreturn res", "w = [1, 2, 5]\nm = 3\ndp = [[0] * (n + 1) for _ in range(m + 1)]\nfor i in range(m + 1):\n dp[i][0] = 1\nfor i in range(1, m + ...
<|body_start_0|> res = 0 for i in range(n + 1): for j in range(n // 2 + 1): for k in range(n // 5 + 1): if i + j * 2 + k * 5 == n: res += 1 return res <|end_body_0|> <|body_start_1|> w = [1, 2, 5] m = 3 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def numOfsum1(self, n): """n 分钱 1_最短回文串.py 2 5 分硬币不限,凑成1元有多少种方法. 暴力 O(n^3)""" <|body_0|> def numOfsum1_dp(self, n): """n 元钱 1_最短回文串.py 2 5 分硬币不限,凑成100分有多少种方法. w[3] = [1_最短回文串.py, 2, 5] 动态规划 dp[i][j] 把第一个硬币凑成j分钱一共有多少种方法。 sum = n1*1_最短回文串.py+n2*2+n5*5 dp[i][j...
stack_v2_sparse_classes_36k_train_017281
2,299
no_license
[ { "docstring": "n 分钱 1_最短回文串.py 2 5 分硬币不限,凑成1元有多少种方法. 暴力 O(n^3)", "name": "numOfsum1", "signature": "def numOfsum1(self, n)" }, { "docstring": "n 元钱 1_最短回文串.py 2 5 分硬币不限,凑成100分有多少种方法. w[3] = [1_最短回文串.py, 2, 5] 动态规划 dp[i][j] 把第一个硬币凑成j分钱一共有多少种方法。 sum = n1*1_最短回文串.py+n2*2+n5*5 dp[i][j] = dp[i-1_最短回...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numOfsum1(self, n): n 分钱 1_最短回文串.py 2 5 分硬币不限,凑成1元有多少种方法. 暴力 O(n^3) - def numOfsum1_dp(self, n): n 元钱 1_最短回文串.py 2 5 分硬币不限,凑成100分有多少种方法. w[3] = [1_最短回文串.py, 2, 5] 动态规划 dp[i][...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numOfsum1(self, n): n 分钱 1_最短回文串.py 2 5 分硬币不限,凑成1元有多少种方法. 暴力 O(n^3) - def numOfsum1_dp(self, n): n 元钱 1_最短回文串.py 2 5 分硬币不限,凑成100分有多少种方法. w[3] = [1_最短回文串.py, 2, 5] 动态规划 dp[i][...
57f303aa6e76f7c5292fa60bffdfddcb4ff9ddfb
<|skeleton|> class Solution: def numOfsum1(self, n): """n 分钱 1_最短回文串.py 2 5 分硬币不限,凑成1元有多少种方法. 暴力 O(n^3)""" <|body_0|> def numOfsum1_dp(self, n): """n 元钱 1_最短回文串.py 2 5 分硬币不限,凑成100分有多少种方法. w[3] = [1_最短回文串.py, 2, 5] 动态规划 dp[i][j] 把第一个硬币凑成j分钱一共有多少种方法。 sum = n1*1_最短回文串.py+n2*2+n5*5 dp[i][j...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def numOfsum1(self, n): """n 分钱 1_最短回文串.py 2 5 分硬币不限,凑成1元有多少种方法. 暴力 O(n^3)""" res = 0 for i in range(n + 1): for j in range(n // 2 + 1): for k in range(n // 5 + 1): if i + j * 2 + k * 5 == n: res += 1 ...
the_stack_v2_python_sparse
4_LEETCODE/11_Interview/字节跳动/凑成1元的个数.py
fzingithub/SwordRefers2Offer
train
1
3416fd1f94d60129a3c69a010a8d82051781b894
[ "try:\n resource = Resource.objects.get(pk=pk)\n serializer = ResourceSerializer(resource, context={'request': request})\n return Response(serializer.data)\nexcept Exception as ex:\n return HttpResponseServerError(ex)", "resources = Resource.objects.all()\nserializer = ResourceSerializer(resources, ma...
<|body_start_0|> try: resource = Resource.objects.get(pk=pk) serializer = ResourceSerializer(resource, context={'request': request}) return Response(serializer.data) except Exception as ex: return HttpResponseServerError(ex) <|end_body_0|> <|body_start_1|...
Journey Resources
ResourcesViewSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResourcesViewSet: """Journey Resources""" def retrieve(self, request, pk=None): """Handle GET requests for single resource returns: Response -- JSON serialized subject""" <|body_0|> def list(self, request): """Handle GET requests to get all resources Returns: Res...
stack_v2_sparse_classes_36k_train_017282
2,111
no_license
[ { "docstring": "Handle GET requests for single resource returns: Response -- JSON serialized subject", "name": "retrieve", "signature": "def retrieve(self, request, pk=None)" }, { "docstring": "Handle GET requests to get all resources Returns: Response -- JSON serialized list of resources", ...
3
stack_v2_sparse_classes_30k_train_003348
Implement the Python class `ResourcesViewSet` described below. Class description: Journey Resources Method signatures and docstrings: - def retrieve(self, request, pk=None): Handle GET requests for single resource returns: Response -- JSON serialized subject - def list(self, request): Handle GET requests to get all r...
Implement the Python class `ResourcesViewSet` described below. Class description: Journey Resources Method signatures and docstrings: - def retrieve(self, request, pk=None): Handle GET requests for single resource returns: Response -- JSON serialized subject - def list(self, request): Handle GET requests to get all r...
bd996853f6bd9a95d15115248300e6d801c0dc47
<|skeleton|> class ResourcesViewSet: """Journey Resources""" def retrieve(self, request, pk=None): """Handle GET requests for single resource returns: Response -- JSON serialized subject""" <|body_0|> def list(self, request): """Handle GET requests to get all resources Returns: Res...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResourcesViewSet: """Journey Resources""" def retrieve(self, request, pk=None): """Handle GET requests for single resource returns: Response -- JSON serialized subject""" try: resource = Resource.objects.get(pk=pk) serializer = ResourceSerializer(resource, context=...
the_stack_v2_python_sparse
capstoneapi/views/resource.py
jeaninebeckle/backend-capstone-api
train
0
185ba6894ea91cda94e50b7bbb4f2c71af57f4fa
[ "h5py.File.__init__(self, photo_file, 'r')\nself.filtersystems = self.keys()\nself.filtersystems.remove('ini_file')\nself.ccds = [key for key in self[self.filtersystems[0]].keys()]", "log = logger(__name__)\nif fsys in self.filtersystems:\n self.ccd = ccd\n self.fsys = fsys\n self.data = self['/%s/%s/dat...
<|body_start_0|> h5py.File.__init__(self, photo_file, 'r') self.filtersystems = self.keys() self.filtersystems.remove('ini_file') self.ccds = [key for key in self[self.filtersystems[0]].keys()] <|end_body_0|> <|body_start_1|> log = logger(__name__) if fsys in self.filter...
Reads a .hdf5 Input photometry file.
Input
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Input: """Reads a .hdf5 Input photometry file.""" def __init__(self, photo_file): """Reads a.hdf5 input photometry file. Parameters ---------- photo_file: string Photometry input file.""" <|body_0|> def get_filtersys(self, fsys, ccd): """Select a filter system an...
stack_v2_sparse_classes_36k_train_017283
1,829
no_license
[ { "docstring": "Reads a.hdf5 input photometry file. Parameters ---------- photo_file: string Photometry input file.", "name": "__init__", "signature": "def __init__(self, photo_file)" }, { "docstring": "Select a filter system and a ccd on the inputfile. Will raise an exception if ccd or filtersy...
2
stack_v2_sparse_classes_30k_train_004633
Implement the Python class `Input` described below. Class description: Reads a .hdf5 Input photometry file. Method signatures and docstrings: - def __init__(self, photo_file): Reads a.hdf5 input photometry file. Parameters ---------- photo_file: string Photometry input file. - def get_filtersys(self, fsys, ccd): Sele...
Implement the Python class `Input` described below. Class description: Reads a .hdf5 Input photometry file. Method signatures and docstrings: - def __init__(self, photo_file): Reads a.hdf5 input photometry file. Parameters ---------- photo_file: string Photometry input file. - def get_filtersys(self, fsys, ccd): Sele...
90083c46bedcb8b03a3411a4661a8990a2ef4d8c
<|skeleton|> class Input: """Reads a .hdf5 Input photometry file.""" def __init__(self, photo_file): """Reads a.hdf5 input photometry file. Parameters ---------- photo_file: string Photometry input file.""" <|body_0|> def get_filtersys(self, fsys, ccd): """Select a filter system an...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Input: """Reads a .hdf5 Input photometry file.""" def __init__(self, photo_file): """Reads a.hdf5 input photometry file. Parameters ---------- photo_file: string Photometry input file.""" h5py.File.__init__(self, photo_file, 'r') self.filtersystems = self.keys() self.filte...
the_stack_v2_python_sparse
src/magal/io/readinput.py
wschoenell/magal
train
0
aa8641619b070bf77a8497fd833efa1f85a3efbd
[ "app = app or flask.current_app\nnow = int(time.time())\ncount = 0\nfor key in app.session_store.list():\n if key.startswith(b'token-'):\n if (sessid := app.session_store.get(key)):\n if not app.session_config.parse_key(sessid, app, now=now):\n app.session_store.delete(sessid)\n ...
<|body_start_0|> app = app or flask.current_app now = int(time.time()) count = 0 for key in app.session_store.list(): if key.startswith(b'token-'): if (sessid := app.session_store.get(key)): if not app.session_config.parse_key(sessid, app, ...
Server side session handling
MailuSessionExtension
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MailuSessionExtension: """Server side session handling""" def cleanup_sessions(app=None): """Remove invalid or expired sessions.""" <|body_0|> def prune_sessions(uid=None, keep=None, app=None): """Remove sessions uid: remove all sessions (NONE) or sessions belong...
stack_v2_sparse_classes_36k_train_017284
17,772
permissive
[ { "docstring": "Remove invalid or expired sessions.", "name": "cleanup_sessions", "signature": "def cleanup_sessions(app=None)" }, { "docstring": "Remove sessions uid: remove all sessions (NONE) or sessions belonging to a specific user keep: keep listed sessions", "name": "prune_sessions", ...
3
null
Implement the Python class `MailuSessionExtension` described below. Class description: Server side session handling Method signatures and docstrings: - def cleanup_sessions(app=None): Remove invalid or expired sessions. - def prune_sessions(uid=None, keep=None, app=None): Remove sessions uid: remove all sessions (NON...
Implement the Python class `MailuSessionExtension` described below. Class description: Server side session handling Method signatures and docstrings: - def cleanup_sessions(app=None): Remove invalid or expired sessions. - def prune_sessions(uid=None, keep=None, app=None): Remove sessions uid: remove all sessions (NON...
683c28ea6319eae55270c5f5d7ea95cc888860e7
<|skeleton|> class MailuSessionExtension: """Server side session handling""" def cleanup_sessions(app=None): """Remove invalid or expired sessions.""" <|body_0|> def prune_sessions(uid=None, keep=None, app=None): """Remove sessions uid: remove all sessions (NONE) or sessions belong...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MailuSessionExtension: """Server side session handling""" def cleanup_sessions(app=None): """Remove invalid or expired sessions.""" app = app or flask.current_app now = int(time.time()) count = 0 for key in app.session_store.list(): if key.startswith(b'...
the_stack_v2_python_sparse
core/admin/mailu/utils.py
Mailu/Mailu
train
5,017
02742114a035b880d00d29f71c167467f7f152eb
[ "self.config = cp.ConfigParser(interpolation=cp.ExtendedInterpolation())\nself.config.read(config_path)\nself.feature_funcs = list(self.config['features'])\nself.column_names = [f + str(i) for f in self.feature_funcs for i in range(self.config.getint('features', f))]\nself.hobj = None\nself.stopws = None\nself.word...
<|body_start_0|> self.config = cp.ConfigParser(interpolation=cp.ExtendedInterpolation()) self.config.read(config_path) self.feature_funcs = list(self.config['features']) self.column_names = [f + str(i) for f in self.feature_funcs for i in range(self.config.getint('features', f))] ...
FeatureExtractor
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FeatureExtractor: def __init__(self, config_path): """Initialize feature functions and config file. Args: config_path (str): path to configuration file""" <|body_0|> def in_common_dict(self, n_gram): """Return whether the word occurs in a common dictionary.""" ...
stack_v2_sparse_classes_36k_train_017285
3,175
no_license
[ { "docstring": "Initialize feature functions and config file. Args: config_path (str): path to configuration file", "name": "__init__", "signature": "def __init__(self, config_path)" }, { "docstring": "Return whether the word occurs in a common dictionary.", "name": "in_common_dict", "si...
6
stack_v2_sparse_classes_30k_train_017792
Implement the Python class `FeatureExtractor` described below. Class description: Implement the FeatureExtractor class. Method signatures and docstrings: - def __init__(self, config_path): Initialize feature functions and config file. Args: config_path (str): path to configuration file - def in_common_dict(self, n_gr...
Implement the Python class `FeatureExtractor` described below. Class description: Implement the FeatureExtractor class. Method signatures and docstrings: - def __init__(self, config_path): Initialize feature functions and config file. Args: config_path (str): path to configuration file - def in_common_dict(self, n_gr...
aaf81263a44097643c6162f54ea44cc9eb02e64a
<|skeleton|> class FeatureExtractor: def __init__(self, config_path): """Initialize feature functions and config file. Args: config_path (str): path to configuration file""" <|body_0|> def in_common_dict(self, n_gram): """Return whether the word occurs in a common dictionary.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FeatureExtractor: def __init__(self, config_path): """Initialize feature functions and config file. Args: config_path (str): path to configuration file""" self.config = cp.ConfigParser(interpolation=cp.ExtendedInterpolation()) self.config.read(config_path) self.feature_funcs = ...
the_stack_v2_python_sparse
feature_extractor.py
OntoGene/OGER-filter
train
0
e1dcd597813897649453c77834bb00ad67677135
[ "data: type_data = {'time': [], 'data': []}\nself.__displayed_seconds: float = 10.0\nsuper().__init__(data, item)", "self._ax.clear()\nself._ax.get_yaxis().set_major_formatter(func_format)\nself._ax.set_title(Translator.tr(self._item.name))\nself._ax.set_xlabel('s')\nself._ax.set_ylabel(self._item.unit[0])\nt = s...
<|body_start_0|> data: type_data = {'time': [], 'data': []} self.__displayed_seconds: float = 10.0 super().__init__(data, item) <|end_body_0|> <|body_start_1|> self._ax.clear() self._ax.get_yaxis().set_major_formatter(func_format) self._ax.set_title(Translator.tr(self._i...
this class represents a time diagram
TimeDiagram
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TimeDiagram: """this class represents a time diagram""" def __init__(self, item: TimeDiagramItem): """Initialising an TimeDiagram object Args: item (TimeDiagramItem): time plot diagram item""" <|body_0|> def _draw_diagram(self) -> NoReturn: """draws a diagram wit...
stack_v2_sparse_classes_36k_train_017286
9,833
permissive
[ { "docstring": "Initialising an TimeDiagram object Args: item (TimeDiagramItem): time plot diagram item", "name": "__init__", "signature": "def __init__(self, item: TimeDiagramItem)" }, { "docstring": "draws a diagram with its labels and title", "name": "_draw_diagram", "signature": "def...
4
null
Implement the Python class `TimeDiagram` described below. Class description: this class represents a time diagram Method signatures and docstrings: - def __init__(self, item: TimeDiagramItem): Initialising an TimeDiagram object Args: item (TimeDiagramItem): time plot diagram item - def _draw_diagram(self) -> NoReturn...
Implement the Python class `TimeDiagram` described below. Class description: this class represents a time diagram Method signatures and docstrings: - def __init__(self, item: TimeDiagramItem): Initialising an TimeDiagram object Args: item (TimeDiagramItem): time plot diagram item - def _draw_diagram(self) -> NoReturn...
5c4f19b1dbce8facd87919dc81d7d1eccb16b552
<|skeleton|> class TimeDiagram: """this class represents a time diagram""" def __init__(self, item: TimeDiagramItem): """Initialising an TimeDiagram object Args: item (TimeDiagramItem): time plot diagram item""" <|body_0|> def _draw_diagram(self) -> NoReturn: """draws a diagram wit...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TimeDiagram: """this class represents a time diagram""" def __init__(self, item: TimeDiagramItem): """Initialising an TimeDiagram object Args: item (TimeDiagramItem): time plot diagram item""" data: type_data = {'time': [], 'data': []} self.__displayed_seconds: float = 10.0 ...
the_stack_v2_python_sparse
phypigui/python/src/view/DiagramField/DiagramView.py
osl2/PhyPiDAQ
train
3
321811d8aa35a3d729bad9bde4ccdd04d1a0c8e1
[ "id = range(N + 1)\nsize = [1] * (N + 1)\n\ndef union(a, b):\n i, j = (root(a), root(b))\n if i == j:\n return False\n if size[i] < size[j]:\n size[j] += size[i]\n id[i] = j\n else:\n size[i] += size[j]\n id[j] = i\n return True\n\ndef root(a):\n while id[a] != a...
<|body_start_0|> id = range(N + 1) size = [1] * (N + 1) def union(a, b): i, j = (root(a), root(b)) if i == j: return False if size[i] < size[j]: size[j] += size[i] id[i] = j else: siz...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def minimumCost_union_find(self, N, connections): """:type N: int :type connections: List[List[int]] :rtype: int""" <|body_0|> def minimumCost_bfs(self, N, connections): """:type N: int :type connections: List[List[int]] :rtype: int""" <|body_1|> <...
stack_v2_sparse_classes_36k_train_017287
2,038
no_license
[ { "docstring": ":type N: int :type connections: List[List[int]] :rtype: int", "name": "minimumCost_union_find", "signature": "def minimumCost_union_find(self, N, connections)" }, { "docstring": ":type N: int :type connections: List[List[int]] :rtype: int", "name": "minimumCost_bfs", "sig...
2
stack_v2_sparse_classes_30k_train_010324
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minimumCost_union_find(self, N, connections): :type N: int :type connections: List[List[int]] :rtype: int - def minimumCost_bfs(self, N, connections): :type N: int :type conn...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minimumCost_union_find(self, N, connections): :type N: int :type connections: List[List[int]] :rtype: int - def minimumCost_bfs(self, N, connections): :type N: int :type conn...
3a7f20f79281fcaedb10696723dcb39c816ce258
<|skeleton|> class Solution: def minimumCost_union_find(self, N, connections): """:type N: int :type connections: List[List[int]] :rtype: int""" <|body_0|> def minimumCost_bfs(self, N, connections): """:type N: int :type connections: List[List[int]] :rtype: int""" <|body_1|> <...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def minimumCost_union_find(self, N, connections): """:type N: int :type connections: List[List[int]] :rtype: int""" id = range(N + 1) size = [1] * (N + 1) def union(a, b): i, j = (root(a), root(b)) if i == j: return False ...
the_stack_v2_python_sparse
1135_min_spanning_tree_union_find_bfs.py
haohanz/Leetcode-Solution
train
1
37692d0d51389e5217f9510986731c316deb1738
[ "if needle:\n for index, value in enumerate(haystack):\n if value == needle[0]:\n if haystack[index:index + len(needle)] == needle:\n return index\nreturn -1 if needle else 0", "for i in range(len(haystack) - len(needle) + 1):\n if haystack[i:i + len(needle)] == needle:\n ...
<|body_start_0|> if needle: for index, value in enumerate(haystack): if value == needle[0]: if haystack[index:index + len(needle)] == needle: return index return -1 if needle else 0 <|end_body_0|> <|body_start_1|> for i in ...
从字符串中找出目标子串,并返回其第一次出现的位置,如果找不到,则返回-1,如果目标子串是空,则返回0 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example 2: Input: haystack = "aaaaa", needle = "bba" Output: -1 Clarification: Wha...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """从字符串中找出目标子串,并返回其第一次出现的位置,如果找不到,则返回-1,如果目标子串是空,则返回0 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example 2: Input: haystack = "aaaaa", needle =...
stack_v2_sparse_classes_36k_train_017288
1,878
no_license
[ { "docstring": ":type haystack: str :type needle: str :rtype: int", "name": "symb", "signature": "def symb(self, haystack, needle)" }, { "docstring": ":type haystack: str :type needle: str :rtype: int", "name": "strStr", "signature": "def strStr(self, haystack, needle)" } ]
2
stack_v2_sparse_classes_30k_train_008444
Implement the Python class `Solution` described below. Class description: 从字符串中找出目标子串,并返回其第一次出现的位置,如果找不到,则返回-1,如果目标子串是空,则返回0 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example...
Implement the Python class `Solution` described below. Class description: 从字符串中找出目标子串,并返回其第一次出现的位置,如果找不到,则返回-1,如果目标子串是空,则返回0 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example...
7a6de1767eaabb6464ea4c90756606d59b868d7c
<|skeleton|> class Solution: """从字符串中找出目标子串,并返回其第一次出现的位置,如果找不到,则返回-1,如果目标子串是空,则返回0 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example 2: Input: haystack = "aaaaa", needle =...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: """从字符串中找出目标子串,并返回其第一次出现的位置,如果找不到,则返回-1,如果目标子串是空,则返回0 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example 2: Input: haystack = "aaaaa", needle = "bba" Output...
the_stack_v2_python_sparse
demo/28.Implement_strStr().py
symbooo/LeetCodeSymb
train
0
da46558971628c1f98ba16647fabcc0f96b4f8a8
[ "Canvas.__init__(self)\nself.configure(width=larg, height=haut)\nself.larg, self.haut = (larg, haut)\npas = (larg - 25) / 8.0\nfor t in range(0, 9):\n stx = 10 + t * pas\n self.create_line(stx, haut / 10, stx, haut * 9 / 10, fill='grey')\nself.create_line(10 + 4 * pas, haut - 5, 10 + 4 * pas, 5, fill='grey90'...
<|body_start_0|> Canvas.__init__(self) self.configure(width=larg, height=haut) self.larg, self.haut = (larg, haut) pas = (larg - 25) / 8.0 for t in range(0, 9): stx = 10 + t * pas self.create_line(stx, haut / 10, stx, haut * 9 / 10, fill='grey') se...
Canevas spcialis, pour dessiner des courbes longation/temps
OscilloGraphe
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OscilloGraphe: """Canevas spcialis, pour dessiner des courbes longation/temps""" def __init__(self, master=None, larg=200, haut=150): """Constructeur du graphique : axes et chelle horiz.""" <|body_0|> def traceCourbe(self, freq=1, phase=0, ampl=10, coul='red'): "...
stack_v2_sparse_classes_36k_train_017289
7,288
no_license
[ { "docstring": "Constructeur du graphique : axes et chelle horiz.", "name": "__init__", "signature": "def __init__(self, master=None, larg=200, haut=150)" }, { "docstring": "trac d'un graphique longation/temps sur 1 seconde", "name": "traceCourbe", "signature": "def traceCourbe(self, fre...
2
null
Implement the Python class `OscilloGraphe` described below. Class description: Canevas spcialis, pour dessiner des courbes longation/temps Method signatures and docstrings: - def __init__(self, master=None, larg=200, haut=150): Constructeur du graphique : axes et chelle horiz. - def traceCourbe(self, freq=1, phase=0,...
Implement the Python class `OscilloGraphe` described below. Class description: Canevas spcialis, pour dessiner des courbes longation/temps Method signatures and docstrings: - def __init__(self, master=None, larg=200, haut=150): Constructeur du graphique : axes et chelle horiz. - def traceCourbe(self, freq=1, phase=0,...
67bdb548574f4feecb99b60995238f12f4ef26da
<|skeleton|> class OscilloGraphe: """Canevas spcialis, pour dessiner des courbes longation/temps""" def __init__(self, master=None, larg=200, haut=150): """Constructeur du graphique : axes et chelle horiz.""" <|body_0|> def traceCourbe(self, freq=1, phase=0, ampl=10, coul='red'): "...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OscilloGraphe: """Canevas spcialis, pour dessiner des courbes longation/temps""" def __init__(self, master=None, larg=200, haut=150): """Constructeur du graphique : axes et chelle horiz.""" Canvas.__init__(self) self.configure(width=larg, height=haut) self.larg, self.haut ...
the_stack_v2_python_sparse
python/oreilly/cours_python/solutions/exercice_13_16.py
scls19fr/openphysic
train
1
122279ded3abdf1de173dbd827b45cadff4b74e6
[ "super().__init__()\nself.length = length\nself.table_id = table_id\nself.match = match\nself.duration_sec = duration_sec\nself.duration_nsec = duration_nsec\nself.priority = priority\nself.idle_timeout = idle_timeout\nself.hard_timeout = hard_timeout\nself.cookie = cookie\nself.packet_count = packet_count\nself.by...
<|body_start_0|> super().__init__() self.length = length self.table_id = table_id self.match = match self.duration_sec = duration_sec self.duration_nsec = duration_nsec self.priority = priority self.idle_timeout = idle_timeout self.hard_timeout = h...
Body of reply to OFPST_FLOW request.
FlowStats
[ "MIT", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FlowStats: """Body of reply to OFPST_FLOW request.""" def __init__(self, length=None, table_id=None, match=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, cookie=None, packet_count=None, byte_count=None, actions=None): """Create a Flo...
stack_v2_sparse_classes_36k_train_017290
16,355
permissive
[ { "docstring": "Create a FlowStats with the optional parameters below. Args: length (int): Length of this entry. table_id (int): ID of table flow came from. match (~pyof.v0x01.common.flow_match.Match): Description of fields. duration_sec (int): Time flow has been alive in seconds. duration_nsec (int): Time flow...
2
null
Implement the Python class `FlowStats` described below. Class description: Body of reply to OFPST_FLOW request. Method signatures and docstrings: - def __init__(self, length=None, table_id=None, match=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, cookie=None, packet...
Implement the Python class `FlowStats` described below. Class description: Body of reply to OFPST_FLOW request. Method signatures and docstrings: - def __init__(self, length=None, table_id=None, match=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, cookie=None, packet...
89940bed83f8e792f5ed5c9f12346016cd380d6f
<|skeleton|> class FlowStats: """Body of reply to OFPST_FLOW request.""" def __init__(self, length=None, table_id=None, match=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, cookie=None, packet_count=None, byte_count=None, actions=None): """Create a Flo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FlowStats: """Body of reply to OFPST_FLOW request.""" def __init__(self, length=None, table_id=None, match=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, cookie=None, packet_count=None, byte_count=None, actions=None): """Create a FlowStats with t...
the_stack_v2_python_sparse
pyof/v0x01/controller2switch/common.py
kytos/python-openflow
train
53
3571fe525cc229d60ac2beecc85b12280658eea6
[ "site = models.SiteSettings.objects.get()\ndata = {'form': forms.RegistrationForm(instance=site)}\nreturn TemplateResponse(request, 'settings/registration.html', data)", "site = models.SiteSettings.objects.get()\nform = forms.RegistrationForm(request.POST, request.FILES, instance=site)\nif not form.is_valid():\n ...
<|body_start_0|> site = models.SiteSettings.objects.get() data = {'form': forms.RegistrationForm(instance=site)} return TemplateResponse(request, 'settings/registration.html', data) <|end_body_0|> <|body_start_1|> site = models.SiteSettings.objects.get() form = forms.Registratio...
Control everything about registration
Registration
[ "LicenseRef-scancode-warranty-disclaimer" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Registration: """Control everything about registration""" def get(self, request): """edit form""" <|body_0|> def post(self, request): """edit the site settings""" <|body_1|> <|end_skeleton|> <|body_start_0|> site = models.SiteSettings.objects.ge...
stack_v2_sparse_classes_36k_train_017291
3,435
no_license
[ { "docstring": "edit form", "name": "get", "signature": "def get(self, request)" }, { "docstring": "edit the site settings", "name": "post", "signature": "def post(self, request)" } ]
2
stack_v2_sparse_classes_30k_train_011634
Implement the Python class `Registration` described below. Class description: Control everything about registration Method signatures and docstrings: - def get(self, request): edit form - def post(self, request): edit the site settings
Implement the Python class `Registration` described below. Class description: Control everything about registration Method signatures and docstrings: - def get(self, request): edit form - def post(self, request): edit the site settings <|skeleton|> class Registration: """Control everything about registration""" ...
0f8da5b738047f3c34d60d93f59bdedd8f797224
<|skeleton|> class Registration: """Control everything about registration""" def get(self, request): """edit form""" <|body_0|> def post(self, request): """edit the site settings""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Registration: """Control everything about registration""" def get(self, request): """edit form""" site = models.SiteSettings.objects.get() data = {'form': forms.RegistrationForm(instance=site)} return TemplateResponse(request, 'settings/registration.html', data) def p...
the_stack_v2_python_sparse
bookwyrm/views/admin/site.py
bookwyrm-social/bookwyrm
train
1,398
2d86d4782d610f3d325c06000d3846a6b9879646
[ "try:\n try:\n pObject = PTJInfo.objects.get(id=pid)\n except:\n return JsonResponse({'status': False, 'err': '内容不存在'}, status=404)\n ptjResult = model_to_dict(pObject)\n return JsonResponse({'status': True, 'ptj': ptjResult})\nexcept:\n return JsonResponse({'status': False, 'err': '出现未...
<|body_start_0|> try: try: pObject = PTJInfo.objects.get(id=pid) except: return JsonResponse({'status': False, 'err': '内容不存在'}, status=404) ptjResult = model_to_dict(pObject) return JsonResponse({'status': True, 'ptj': ptjResult}) ...
PTJInfoView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PTJInfoView: def get(self, requests, pid): """获得兼职消息详情 :param requests: :param pid: ptj id :return:""" <|body_0|> def delete(self, requests, pid): """删除兼职消息 :param requests: :param pid: :return:""" <|body_1|> def post(self, requests): """新增兼职信息 :...
stack_v2_sparse_classes_36k_train_017292
2,987
no_license
[ { "docstring": "获得兼职消息详情 :param requests: :param pid: ptj id :return:", "name": "get", "signature": "def get(self, requests, pid)" }, { "docstring": "删除兼职消息 :param requests: :param pid: :return:", "name": "delete", "signature": "def delete(self, requests, pid)" }, { "docstring": ...
3
stack_v2_sparse_classes_30k_train_006846
Implement the Python class `PTJInfoView` described below. Class description: Implement the PTJInfoView class. Method signatures and docstrings: - def get(self, requests, pid): 获得兼职消息详情 :param requests: :param pid: ptj id :return: - def delete(self, requests, pid): 删除兼职消息 :param requests: :param pid: :return: - def po...
Implement the Python class `PTJInfoView` described below. Class description: Implement the PTJInfoView class. Method signatures and docstrings: - def get(self, requests, pid): 获得兼职消息详情 :param requests: :param pid: ptj id :return: - def delete(self, requests, pid): 删除兼职消息 :param requests: :param pid: :return: - def po...
526dea540048fc92260bce611c520c50af744e0b
<|skeleton|> class PTJInfoView: def get(self, requests, pid): """获得兼职消息详情 :param requests: :param pid: ptj id :return:""" <|body_0|> def delete(self, requests, pid): """删除兼职消息 :param requests: :param pid: :return:""" <|body_1|> def post(self, requests): """新增兼职信息 :...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PTJInfoView: def get(self, requests, pid): """获得兼职消息详情 :param requests: :param pid: ptj id :return:""" try: try: pObject = PTJInfo.objects.get(id=pid) except: return JsonResponse({'status': False, 'err': '内容不存在'}, status=404) ...
the_stack_v2_python_sparse
apps/PTJ/views/PTJInfo.py
DICKQI/ALGYunXS
train
0
af645303b47a64cdd303fd34a197c529cc28f97e
[ "super().__init__(entity_ids, unique_id, group_id, zha_device, **kwargs)\nself._available: bool = False\ngroup = self.zha_device.gateway.get_group(self._group_id)\nself._fan_channel = group.endpoint[hvac.Fan.cluster_id]\n\nasync def async_set_speed(value) -> None:\n \"\"\"Set the speed of the fan.\"\"\"\n try...
<|body_start_0|> super().__init__(entity_ids, unique_id, group_id, zha_device, **kwargs) self._available: bool = False group = self.zha_device.gateway.get_group(self._group_id) self._fan_channel = group.endpoint[hvac.Fan.cluster_id] async def async_set_speed(value) -> None: ...
Representation of a fan group.
FanGroup
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FanGroup: """Representation of a fan group.""" def __init__(self, entity_ids: List[str], unique_id: str, group_id: int, zha_device, **kwargs) -> None: """Initialize a fan group.""" <|body_0|> async def async_update(self): """Attempt to retrieve on off state from ...
stack_v2_sparse_classes_36k_train_017293
6,291
permissive
[ { "docstring": "Initialize a fan group.", "name": "__init__", "signature": "def __init__(self, entity_ids: List[str], unique_id: str, group_id: int, zha_device, **kwargs) -> None" }, { "docstring": "Attempt to retrieve on off state from the fan.", "name": "async_update", "signature": "as...
2
null
Implement the Python class `FanGroup` described below. Class description: Representation of a fan group. Method signatures and docstrings: - def __init__(self, entity_ids: List[str], unique_id: str, group_id: int, zha_device, **kwargs) -> None: Initialize a fan group. - async def async_update(self): Attempt to retrie...
Implement the Python class `FanGroup` described below. Class description: Representation of a fan group. Method signatures and docstrings: - def __init__(self, entity_ids: List[str], unique_id: str, group_id: int, zha_device, **kwargs) -> None: Initialize a fan group. - async def async_update(self): Attempt to retrie...
ed4ab403deaed9e8c95e0db728477fcb012bf4fa
<|skeleton|> class FanGroup: """Representation of a fan group.""" def __init__(self, entity_ids: List[str], unique_id: str, group_id: int, zha_device, **kwargs) -> None: """Initialize a fan group.""" <|body_0|> async def async_update(self): """Attempt to retrieve on off state from ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FanGroup: """Representation of a fan group.""" def __init__(self, entity_ids: List[str], unique_id: str, group_id: int, zha_device, **kwargs) -> None: """Initialize a fan group.""" super().__init__(entity_ids, unique_id, group_id, zha_device, **kwargs) self._available: bool = Fals...
the_stack_v2_python_sparse
homeassistant/components/zha/fan.py
tchellomello/home-assistant
train
8
40e198602353e77b64080812be3ba2809408dbbe
[ "super().__init__(**kwargs)\ntry:\n import sentence_transformers\n self.client = sentence_transformers.SentenceTransformer(self.model_name)\nexcept ImportError:\n raise ValueError('Could not import sentence_transformers python package. Please install it with `pip install sentence_transformers`.')", "text...
<|body_start_0|> super().__init__(**kwargs) try: import sentence_transformers self.client = sentence_transformers.SentenceTransformer(self.model_name) except ImportError: raise ValueError('Could not import sentence_transformers python package. Please install i...
Wrapper around sentence_transformers embedding models. To use, you should have the ``sentence_transformers`` python package installed. Example: .. code-block:: python from langchain.embeddings import HuggingFaceEmbeddings model_name = "sentence-transformers/all-mpnet-base-v2" hf = HuggingFaceEmbeddings(model_name=model...
HuggingFaceEmbeddings
[ "LicenseRef-scancode-generic-cla", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HuggingFaceEmbeddings: """Wrapper around sentence_transformers embedding models. To use, you should have the ``sentence_transformers`` python package installed. Example: .. code-block:: python from langchain.embeddings import HuggingFaceEmbeddings model_name = "sentence-transformers/all-mpnet-bas...
stack_v2_sparse_classes_36k_train_017294
4,545
permissive
[ { "docstring": "Initialize the sentence_transformer.", "name": "__init__", "signature": "def __init__(self, **kwargs: Any)" }, { "docstring": "Compute doc embeddings using a HuggingFace transformer model. Args: texts: The list of texts to embed. Returns: List of embeddings, one for each text.", ...
3
null
Implement the Python class `HuggingFaceEmbeddings` described below. Class description: Wrapper around sentence_transformers embedding models. To use, you should have the ``sentence_transformers`` python package installed. Example: .. code-block:: python from langchain.embeddings import HuggingFaceEmbeddings model_name...
Implement the Python class `HuggingFaceEmbeddings` described below. Class description: Wrapper around sentence_transformers embedding models. To use, you should have the ``sentence_transformers`` python package installed. Example: .. code-block:: python from langchain.embeddings import HuggingFaceEmbeddings model_name...
b8f29af7f3c24cf3a4554bebfa2053064467fbdb
<|skeleton|> class HuggingFaceEmbeddings: """Wrapper around sentence_transformers embedding models. To use, you should have the ``sentence_transformers`` python package installed. Example: .. code-block:: python from langchain.embeddings import HuggingFaceEmbeddings model_name = "sentence-transformers/all-mpnet-bas...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HuggingFaceEmbeddings: """Wrapper around sentence_transformers embedding models. To use, you should have the ``sentence_transformers`` python package installed. Example: .. code-block:: python from langchain.embeddings import HuggingFaceEmbeddings model_name = "sentence-transformers/all-mpnet-base-v2" hf = Hu...
the_stack_v2_python_sparse
langchain/embeddings/huggingface.py
microsoft/MM-REACT
train
705
4796e987feda21e99189f35b56757f0fb37e63b7
[ "self.vocab = ['</s>', '<unk>', 'hello', '你好', 'world']\nself.vocab_filepath = tempfile.mktemp(suffix='vocab.txt')\nwith open(self.vocab_filepath, mode='w', encoding='utf-8') as fobj:\n for token in self.vocab:\n fobj.write(token)\n fobj.write('\\n')", "with self.session(use_gpu=False) as sess:\n...
<|body_start_0|> self.vocab = ['</s>', '<unk>', 'hello', '你好', 'world'] self.vocab_filepath = tempfile.mktemp(suffix='vocab.txt') with open(self.vocab_filepath, mode='w', encoding='utf-8') as fobj: for token in self.vocab: fobj.write(token) fobj.write(...
tokenizer op test
TokenizerOpsTest
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TokenizerOpsTest: """tokenizer op test""" def setUp(self): """set up""" <|body_0|> def test_text_to_tokenid_with_vocab_file(self): """test label to token id""" <|body_1|> def test_text_to_tokenid(self): """test label to token id""" <|...
stack_v2_sparse_classes_36k_train_017295
5,928
permissive
[ { "docstring": "set up", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "test label to token id", "name": "test_text_to_tokenid_with_vocab_file", "signature": "def test_text_to_tokenid_with_vocab_file(self)" }, { "docstring": "test label to token id", "name...
3
null
Implement the Python class `TokenizerOpsTest` described below. Class description: tokenizer op test Method signatures and docstrings: - def setUp(self): set up - def test_text_to_tokenid_with_vocab_file(self): test label to token id - def test_text_to_tokenid(self): test label to token id
Implement the Python class `TokenizerOpsTest` described below. Class description: tokenizer op test Method signatures and docstrings: - def setUp(self): set up - def test_text_to_tokenid_with_vocab_file(self): test label to token id - def test_text_to_tokenid(self): test label to token id <|skeleton|> class Tokenize...
7eb4e3be578a680737616efff6858d280595ff48
<|skeleton|> class TokenizerOpsTest: """tokenizer op test""" def setUp(self): """set up""" <|body_0|> def test_text_to_tokenid_with_vocab_file(self): """test label to token id""" <|body_1|> def test_text_to_tokenid(self): """test label to token id""" <|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TokenizerOpsTest: """tokenizer op test""" def setUp(self): """set up""" self.vocab = ['</s>', '<unk>', 'hello', '你好', 'world'] self.vocab_filepath = tempfile.mktemp(suffix='vocab.txt') with open(self.vocab_filepath, mode='w', encoding='utf-8') as fobj: for toke...
the_stack_v2_python_sparse
delta/layers/ops/kernels/tokenizer_ops_test.py
luffywalf/delta
train
1
6ddf1f7c9ebc7a3851f10c78ec7b609492da640f
[ "try_number = req.get_param_as_int('try', required=False)\naction_id = ActionsHelper.parse_action_id(**kwargs)\nstep_id = ActionsHelper.parse_step_id(**kwargs)\nresp.body = self.get_action_step_logs(action_id, step_id, try_number)\nresp.status = falcon.HTTP_200", "self.actions_helper = ActionsHelper(action_id=act...
<|body_start_0|> try_number = req.get_param_as_int('try', required=False) action_id = ActionsHelper.parse_action_id(**kwargs) step_id = ActionsHelper.parse_step_id(**kwargs) resp.body = self.get_action_step_logs(action_id, step_id, try_number) resp.status = falcon.HTTP_200 <|end_...
The actions steps logs resource retrieves the logs for a particular step of an action. By default, it will retrieve the logs from the last attempt. Note that a workflow step can retry multiple times with the names of the logs as 1.log, 2.log, 3.log, etc.
ActionsStepsLogsResource
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ActionsStepsLogsResource: """The actions steps logs resource retrieves the logs for a particular step of an action. By default, it will retrieve the logs from the last attempt. Note that a workflow step can retry multiple times with the names of the logs as 1.log, 2.log, 3.log, etc.""" def o...
stack_v2_sparse_classes_36k_train_017296
4,551
permissive
[ { "docstring": "Returns the logs of an action step :returns: logs of an action step", "name": "on_get", "signature": "def on_get(self, req, resp, **kwargs)" }, { "docstring": "Retrieve Airflow Logs", "name": "get_action_step_logs", "signature": "def get_action_step_logs(self, action_id, ...
4
stack_v2_sparse_classes_30k_train_009547
Implement the Python class `ActionsStepsLogsResource` described below. Class description: The actions steps logs resource retrieves the logs for a particular step of an action. By default, it will retrieve the logs from the last attempt. Note that a workflow step can retry multiple times with the names of the logs as ...
Implement the Python class `ActionsStepsLogsResource` described below. Class description: The actions steps logs resource retrieves the logs for a particular step of an action. By default, it will retrieve the logs from the last attempt. Note that a workflow step can retry multiple times with the names of the logs as ...
14d66afb012025a5289818d8e8d2092ccce19ffa
<|skeleton|> class ActionsStepsLogsResource: """The actions steps logs resource retrieves the logs for a particular step of an action. By default, it will retrieve the logs from the last attempt. Note that a workflow step can retry multiple times with the names of the logs as 1.log, 2.log, 3.log, etc.""" def o...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ActionsStepsLogsResource: """The actions steps logs resource retrieves the logs for a particular step of an action. By default, it will retrieve the logs from the last attempt. Note that a workflow step can retry multiple times with the names of the logs as 1.log, 2.log, 3.log, etc.""" def on_get(self, r...
the_stack_v2_python_sparse
src/bin/shipyard_airflow/shipyard_airflow/control/action/actions_steps_id_logs_api.py
att-comdev/shipyard
train
14
2cb80e1bcc8046168061edb78acc8389fb88c62e
[ "assert isinstance(stabilize, bool), '\"stabilize\" should be a bool value.'\nassert mode in ['mean', 'sum'], '\"mode\" should be either \"mean\" or \"sum\".'\nself.stabilize = stabilize\nself.mode = mode", "if mask is None:\n if self.mode == 'mean':\n if self.stabilize:\n return T.mean(T.nne...
<|body_start_0|> assert isinstance(stabilize, bool), '"stabilize" should be a bool value.' assert mode in ['mean', 'sum'], '"mode" should be either "mean" or "sum".' self.stabilize = stabilize self.mode = mode <|end_body_0|> <|body_start_1|> if mask is None: if self....
BinaryCrossentropy
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BinaryCrossentropy: def __init__(self, stabilize=False, mode='mean'): """This function initializes the class. Parameters ---------- stabilize: bool, default: False a bool value to use stabilization or not. if yes, input_ions are clipped to small, nonnegative values to prevent NaNs. the i...
stack_v2_sparse_classes_36k_train_017297
19,014
permissive
[ { "docstring": "This function initializes the class. Parameters ---------- stabilize: bool, default: False a bool value to use stabilization or not. if yes, input_ions are clipped to small, nonnegative values to prevent NaNs. the input_ion slightly ignores the probability distribution assumtion of sum = 1. for ...
2
null
Implement the Python class `BinaryCrossentropy` described below. Class description: Implement the BinaryCrossentropy class. Method signatures and docstrings: - def __init__(self, stabilize=False, mode='mean'): This function initializes the class. Parameters ---------- stabilize: bool, default: False a bool value to u...
Implement the Python class `BinaryCrossentropy` described below. Class description: Implement the BinaryCrossentropy class. Method signatures and docstrings: - def __init__(self, stabilize=False, mode='mean'): This function initializes the class. Parameters ---------- stabilize: bool, default: False a bool value to u...
7585261dd1b1c6c99dada5d2d1aabf482e89e880
<|skeleton|> class BinaryCrossentropy: def __init__(self, stabilize=False, mode='mean'): """This function initializes the class. Parameters ---------- stabilize: bool, default: False a bool value to use stabilization or not. if yes, input_ions are clipped to small, nonnegative values to prevent NaNs. the i...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BinaryCrossentropy: def __init__(self, stabilize=False, mode='mean'): """This function initializes the class. Parameters ---------- stabilize: bool, default: False a bool value to use stabilization or not. if yes, input_ions are clipped to small, nonnegative values to prevent NaNs. the input_ion sligh...
the_stack_v2_python_sparse
lemontree/objectives.py
khshim/lemontree
train
3
4597107861402e54888b6bc2db301738da8f28a1
[ "num = len(nums)\nif k >= num - 1:\n num2 = len(set(nums))\n res = True if num > num2 else False\n return res\nelse:\n for i in range(num):\n if i < num - k:\n if len(set(nums[i:i + k + 1])) < k + 1:\n return True\n elif len(set(nums[i:])) < len(nums[i:]):\n ...
<|body_start_0|> num = len(nums) if k >= num - 1: num2 = len(set(nums)) res = True if num > num2 else False return res else: for i in range(num): if i < num - k: if len(set(nums[i:i + k + 1])) < k + 1: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def containsNearbyDuplicate(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" <|body_0|> def containsNearbyDuplicate2(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_star...
stack_v2_sparse_classes_36k_train_017298
1,319
no_license
[ { "docstring": ":type nums: List[int] :type k: int :rtype: bool", "name": "containsNearbyDuplicate", "signature": "def containsNearbyDuplicate(self, nums, k)" }, { "docstring": ":type nums: List[int] :type k: int :rtype: bool", "name": "containsNearbyDuplicate2", "signature": "def contai...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsNearbyDuplicate(self, nums, k): :type nums: List[int] :type k: int :rtype: bool - def containsNearbyDuplicate2(self, nums, k): :type nums: List[int] :type k: int :rty...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsNearbyDuplicate(self, nums, k): :type nums: List[int] :type k: int :rtype: bool - def containsNearbyDuplicate2(self, nums, k): :type nums: List[int] :type k: int :rty...
0fc4c7af59246e3064db41989a45d9db413a624b
<|skeleton|> class Solution: def containsNearbyDuplicate(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" <|body_0|> def containsNearbyDuplicate2(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def containsNearbyDuplicate(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" num = len(nums) if k >= num - 1: num2 = len(set(nums)) res = True if num > num2 else False return res else: for i in range...
the_stack_v2_python_sparse
219. Contains Duplicate II/contain2.py
Macielyoung/LeetCode
train
1
17a73ebcc05ebf02a87feb052c1f9715547b7422
[ "sense_hat = humidity_sensor\nself.__humidity_sensor = humidity_sensor\nself.__co2_sensor = co2_sensor\nself.__address = address\nself.__hardware_id = uuid.getnode()\nself.__location = location\nself.__screen = None\nself.__receiver = None\nif self.__address:\n self.__pi_socket = s.socket(s.AF_INET, s.SOCK_DGRAM...
<|body_start_0|> sense_hat = humidity_sensor self.__humidity_sensor = humidity_sensor self.__co2_sensor = co2_sensor self.__address = address self.__hardware_id = uuid.getnode() self.__location = location self.__screen = None self.__receiver = None ...
Class for the IoT Hardware
Hardware
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Hardware: """Class for the IoT Hardware""" def __init__(self, location, humidity=True, co2=True, address=None, humidity_sensor=None, co2_sensor=None, display=False): """Create humidity & CO2 sensor objects Parameters ---------- location : str humidity : bool True if humidity sensor i...
stack_v2_sparse_classes_36k_train_017299
9,813
no_license
[ { "docstring": "Create humidity & CO2 sensor objects Parameters ---------- location : str humidity : bool True if humidity sensor is to run co2 : bool True if CO2 sensor is to run address : tuple (str, int) for the IP address & port of server humidity_sensor : SenseHat co2_sensor : CCS811 display : bool", "...
6
stack_v2_sparse_classes_30k_train_001230
Implement the Python class `Hardware` described below. Class description: Class for the IoT Hardware Method signatures and docstrings: - def __init__(self, location, humidity=True, co2=True, address=None, humidity_sensor=None, co2_sensor=None, display=False): Create humidity & CO2 sensor objects Parameters ----------...
Implement the Python class `Hardware` described below. Class description: Class for the IoT Hardware Method signatures and docstrings: - def __init__(self, location, humidity=True, co2=True, address=None, humidity_sensor=None, co2_sensor=None, display=False): Create humidity & CO2 sensor objects Parameters ----------...
a89013a73a8cb27e7c72d7837e9038f7f2020ead
<|skeleton|> class Hardware: """Class for the IoT Hardware""" def __init__(self, location, humidity=True, co2=True, address=None, humidity_sensor=None, co2_sensor=None, display=False): """Create humidity & CO2 sensor objects Parameters ---------- location : str humidity : bool True if humidity sensor i...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Hardware: """Class for the IoT Hardware""" def __init__(self, location, humidity=True, co2=True, address=None, humidity_sensor=None, co2_sensor=None, display=False): """Create humidity & CO2 sensor objects Parameters ---------- location : str humidity : bool True if humidity sensor is to run co2 ...
the_stack_v2_python_sparse
iot/hardware.py
marianarafaelwhite/SYSC4907-Group-58
train
0