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
427e87b8c23f922fc6dd3a79c450d236349ffd05
[ "self.address = address\nself.port = port\nself.SOCK = None\nself.connected = False", "if self.connected:\n return True\ntry:\n self.SOCK = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n self.connected = True\n return True\nexcept:\n logger.error('Could not open UDP socket')\n return False",...
<|body_start_0|> self.address = address self.port = port self.SOCK = None self.connected = False <|end_body_0|> <|body_start_1|> if self.connected: return True try: self.SOCK = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.conn...
LogUDP
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LogUDP: def __init__(self, address, port): """Intialize our UDP logger @param address: Address of remote server @param port: port of listening server""" <|body_0|> def _connect(self): """Create our socket""" <|body_1|> def append(self, data): """...
stack_v2_sparse_classes_36k_train_001000
1,294
no_license
[ { "docstring": "Intialize our UDP logger @param address: Address of remote server @param port: port of listening server", "name": "__init__", "signature": "def __init__(self, address, port)" }, { "docstring": "Create our socket", "name": "_connect", "signature": "def _connect(self)" },...
3
null
Implement the Python class `LogUDP` described below. Class description: Implement the LogUDP class. Method signatures and docstrings: - def __init__(self, address, port): Intialize our UDP logger @param address: Address of remote server @param port: port of listening server - def _connect(self): Create our socket - d...
Implement the Python class `LogUDP` described below. Class description: Implement the LogUDP class. Method signatures and docstrings: - def __init__(self, address, port): Intialize our UDP logger @param address: Address of remote server @param port: port of listening server - def _connect(self): Create our socket - d...
8f92c4efb94061cb08b7e9b0ff96346565c12653
<|skeleton|> class LogUDP: def __init__(self, address, port): """Intialize our UDP logger @param address: Address of remote server @param port: port of listening server""" <|body_0|> def _connect(self): """Create our socket""" <|body_1|> def append(self, data): """...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LogUDP: def __init__(self, address, port): """Intialize our UDP logger @param address: Address of remote server @param port: port of listening server""" self.address = address self.port = port self.SOCK = None self.connected = False def _connect(self): """C...
the_stack_v2_python_sparse
lophi-automation/lophi_automation/dataconsumers/logudp.py
puppycodes/LO-PHI
train
0
213d40a0ee761a9adba16e95b30d63937da0cc0d
[ "try:\n return blob_api.get_by_id(pk, request.user)\nexcept exceptions.DoesNotExist:\n raise Http404", "try:\n blob_object = self.get_object(request, pk)\n serializer = BlobSerializer(blob_object, context={'request': request})\n return Response(serializer.data)\nexcept AccessControlError as e:\n ...
<|body_start_0|> try: return blob_api.get_by_id(pk, request.user) except exceptions.DoesNotExist: raise Http404 <|end_body_0|> <|body_start_1|> try: blob_object = self.get_object(request, pk) serializer = BlobSerializer(blob_object, context={'requ...
Retrieve, update or delete a Blob
BlobDetail
[ "LicenseRef-scancode-public-domain" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BlobDetail: """Retrieve, update or delete a Blob""" def get_object(self, request, pk): """Get Blob from db Args: request: HTTP request pk: ObjectId Returns: Blob""" <|body_0|> def get(self, request, pk): """Retrieve Blob Args: request: HTTP request pk: ObjectId R...
stack_v2_sparse_classes_36k_train_001001
11,564
permissive
[ { "docstring": "Get Blob from db Args: request: HTTP request pk: ObjectId Returns: Blob", "name": "get_object", "signature": "def get_object(self, request, pk)" }, { "docstring": "Retrieve Blob Args: request: HTTP request pk: ObjectId Returns: - code: 200 content: Blob - code: 403 content: Authe...
3
stack_v2_sparse_classes_30k_train_008780
Implement the Python class `BlobDetail` described below. Class description: Retrieve, update or delete a Blob Method signatures and docstrings: - def get_object(self, request, pk): Get Blob from db Args: request: HTTP request pk: ObjectId Returns: Blob - def get(self, request, pk): Retrieve Blob Args: request: HTTP r...
Implement the Python class `BlobDetail` described below. Class description: Retrieve, update or delete a Blob Method signatures and docstrings: - def get_object(self, request, pk): Get Blob from db Args: request: HTTP request pk: ObjectId Returns: Blob - def get(self, request, pk): Retrieve Blob Args: request: HTTP r...
568cb75a40ccff1d74a1a757866112535efd769a
<|skeleton|> class BlobDetail: """Retrieve, update or delete a Blob""" def get_object(self, request, pk): """Get Blob from db Args: request: HTTP request pk: ObjectId Returns: Blob""" <|body_0|> def get(self, request, pk): """Retrieve Blob Args: request: HTTP request pk: ObjectId R...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BlobDetail: """Retrieve, update or delete a Blob""" def get_object(self, request, pk): """Get Blob from db Args: request: HTTP request pk: ObjectId Returns: Blob""" try: return blob_api.get_by_id(pk, request.user) except exceptions.DoesNotExist: raise Http4...
the_stack_v2_python_sparse
core_main_app/rest/blob/views.py
adilmania/core_main_app
train
0
8ef4e2c8a66b23fffd05394de4111ee6cfc2a2e3
[ "if not self._device.supports_set_brightness():\n raise HomeAssistantError('This device does not support setting brightness')\nif brightness == 0:\n await self.async_set_power_belief(False)\n return\ntry:\n await self._hub.bond.action(self._device.device_id, Action.set_brightness_belief(round(brightness...
<|body_start_0|> if not self._device.supports_set_brightness(): raise HomeAssistantError('This device does not support setting brightness') if brightness == 0: await self.async_set_power_belief(False) return try: await self._hub.bond.action(self._d...
Representation of a Bond light.
BondBaseLight
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BondBaseLight: """Representation of a Bond light.""" async def async_set_brightness_belief(self, brightness: int) -> None: """Set the belief state of the light.""" <|body_0|> async def async_set_power_belief(self, power_state: bool) -> None: """Set the belief sta...
stack_v2_sparse_classes_36k_train_001002
12,277
permissive
[ { "docstring": "Set the belief state of the light.", "name": "async_set_brightness_belief", "signature": "async def async_set_brightness_belief(self, brightness: int) -> None" }, { "docstring": "Set the belief state of the light.", "name": "async_set_power_belief", "signature": "async de...
2
null
Implement the Python class `BondBaseLight` described below. Class description: Representation of a Bond light. Method signatures and docstrings: - async def async_set_brightness_belief(self, brightness: int) -> None: Set the belief state of the light. - async def async_set_power_belief(self, power_state: bool) -> Non...
Implement the Python class `BondBaseLight` described below. Class description: Representation of a Bond light. Method signatures and docstrings: - async def async_set_brightness_belief(self, brightness: int) -> None: Set the belief state of the light. - async def async_set_power_belief(self, power_state: bool) -> Non...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class BondBaseLight: """Representation of a Bond light.""" async def async_set_brightness_belief(self, brightness: int) -> None: """Set the belief state of the light.""" <|body_0|> async def async_set_power_belief(self, power_state: bool) -> None: """Set the belief sta...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BondBaseLight: """Representation of a Bond light.""" async def async_set_brightness_belief(self, brightness: int) -> None: """Set the belief state of the light.""" if not self._device.supports_set_brightness(): raise HomeAssistantError('This device does not support setting bri...
the_stack_v2_python_sparse
homeassistant/components/bond/light.py
home-assistant/core
train
35,501
1eb378f92879565898c3ac1f32e1f68b7c4acdf4
[ "if obj:\n return settings.REVEAL_OPENSRP_ACTIVE\nreturn None", "if obj and obj.parent:\n return obj.parent.id\nreturn None", "if obj:\n if obj.level == settings.REVEAL_DISTRICT:\n return settings.REVEAL_OPENSRP_DISTRICT\n if obj.level == settings.REVEAL_RHC:\n return settings.REVEAL_O...
<|body_start_0|> if obj: return settings.REVEAL_OPENSRP_ACTIVE return None <|end_body_0|> <|body_start_1|> if obj and obj.parent: return obj.parent.id return None <|end_body_1|> <|body_start_2|> if obj: if obj.level == settings.REVEAL_DISTRIC...
A class to serialize locations as OpenSRP GeoJSON compatible data
LocationSerializer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LocationSerializer: """A class to serialize locations as OpenSRP GeoJSON compatible data""" def get_status(self, obj): """get location_type""" <|body_0|> def get_parentId(self, obj): """get parentId""" <|body_1|> def get_geographicLevel(self, obj): ...
stack_v2_sparse_classes_36k_train_001003
2,106
permissive
[ { "docstring": "get location_type", "name": "get_status", "signature": "def get_status(self, obj)" }, { "docstring": "get parentId", "name": "get_parentId", "signature": "def get_parentId(self, obj)" }, { "docstring": "get geographicLevel", "name": "get_geographicLevel", ...
3
stack_v2_sparse_classes_30k_train_006560
Implement the Python class `LocationSerializer` described below. Class description: A class to serialize locations as OpenSRP GeoJSON compatible data Method signatures and docstrings: - def get_status(self, obj): get location_type - def get_parentId(self, obj): get parentId - def get_geographicLevel(self, obj): get g...
Implement the Python class `LocationSerializer` described below. Class description: A class to serialize locations as OpenSRP GeoJSON compatible data Method signatures and docstrings: - def get_status(self, obj): get location_type - def get_parentId(self, obj): get parentId - def get_geographicLevel(self, obj): get g...
b3e0f4b5855abbf0298de6b66f2e9f472f2bf838
<|skeleton|> class LocationSerializer: """A class to serialize locations as OpenSRP GeoJSON compatible data""" def get_status(self, obj): """get location_type""" <|body_0|> def get_parentId(self, obj): """get parentId""" <|body_1|> def get_geographicLevel(self, obj): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LocationSerializer: """A class to serialize locations as OpenSRP GeoJSON compatible data""" def get_status(self, obj): """get location_type""" if obj: return settings.REVEAL_OPENSRP_ACTIVE return None def get_parentId(self, obj): """get parentId""" ...
the_stack_v2_python_sparse
mspray/apps/reveal/serializers.py
Frazerbesa/mspray
train
0
fdd1a9132780130bacd70bb4c9446a4484b80b12
[ "if id is not None:\n self.id = id\nelse:\n Base.__nb_objects += 1\n self.id = Base.__nb_objects", "if list_dictionaries is None or len(list_dictionaries) is 0:\n return '[]'\nelse:\n return json.dumps(list_dictionaries)", "if json_string is None or len(json_string) is 0:\n return []\nelse:\n ...
<|body_start_0|> if id is not None: self.id = id else: Base.__nb_objects += 1 self.id = Base.__nb_objects <|end_body_0|> <|body_start_1|> if list_dictionaries is None or len(list_dictionaries) is 0: return '[]' else: return jso...
This class forms the base of all shape classes
Base
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Base: """This class forms the base of all shape classes""" def __init__(self, id=None): """initializes the class Args: id(int): shape id, defaults to nb if None""" <|body_0|> def to_json_string(list_dictionaries): """Sends the dictionary to a json string""" ...
stack_v2_sparse_classes_36k_train_001004
2,087
no_license
[ { "docstring": "initializes the class Args: id(int): shape id, defaults to nb if None", "name": "__init__", "signature": "def __init__(self, id=None)" }, { "docstring": "Sends the dictionary to a json string", "name": "to_json_string", "signature": "def to_json_string(list_dictionaries)"...
6
stack_v2_sparse_classes_30k_train_009569
Implement the Python class `Base` described below. Class description: This class forms the base of all shape classes Method signatures and docstrings: - def __init__(self, id=None): initializes the class Args: id(int): shape id, defaults to nb if None - def to_json_string(list_dictionaries): Sends the dictionary to a...
Implement the Python class `Base` described below. Class description: This class forms the base of all shape classes Method signatures and docstrings: - def __init__(self, id=None): initializes the class Args: id(int): shape id, defaults to nb if None - def to_json_string(list_dictionaries): Sends the dictionary to a...
37477d021ddc909a622bd944003eabb3478c8a2a
<|skeleton|> class Base: """This class forms the base of all shape classes""" def __init__(self, id=None): """initializes the class Args: id(int): shape id, defaults to nb if None""" <|body_0|> def to_json_string(list_dictionaries): """Sends the dictionary to a json string""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Base: """This class forms the base of all shape classes""" def __init__(self, id=None): """initializes the class Args: id(int): shape id, defaults to nb if None""" if id is not None: self.id = id else: Base.__nb_objects += 1 self.id = Base.__nb_...
the_stack_v2_python_sparse
0x0C-python-almost_a_circle/models/base.py
Selidex/holbertonschool-higher_level_programming
train
0
eb1dfe920f25681e1b757850b76d5a609398a60e
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn SynchronizationTaskExecution()", "from .synchronization_error import SynchronizationError\nfrom .synchronization_task_execution_result import SynchronizationTaskExecutionResult\nfrom .synchronization_error import SynchronizationError\n...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return SynchronizationTaskExecution() <|end_body_0|> <|body_start_1|> from .synchronization_error import SynchronizationError from .synchronization_task_execution_result import SynchronizationT...
SynchronizationTaskExecution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SynchronizationTaskExecution: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationTaskExecution: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value...
stack_v2_sparse_classes_36k_train_001005
6,954
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: SynchronizationTaskExecution", "name": "create_from_discriminator_value", "signature": "def create_from_disc...
3
null
Implement the Python class `SynchronizationTaskExecution` described below. Class description: Implement the SynchronizationTaskExecution class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationTaskExecution: Creates a new instance of the a...
Implement the Python class `SynchronizationTaskExecution` described below. Class description: Implement the SynchronizationTaskExecution class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationTaskExecution: Creates a new instance of the a...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class SynchronizationTaskExecution: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationTaskExecution: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SynchronizationTaskExecution: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> SynchronizationTaskExecution: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create th...
the_stack_v2_python_sparse
msgraph/generated/models/synchronization_task_execution.py
microsoftgraph/msgraph-sdk-python
train
135
6a8cd2950f6b94c5d9344334fede04012c162db9
[ "alpha = np.where(x < x_break, alpha_1, alpha_2)\nxx = x / x_break\nreturn amplitude * xx ** (-alpha)", "alpha = np.where(x < x_break, alpha_1, alpha_2)\nxx = x / x_break\nd_amplitude = xx ** (-alpha)\nd_x_break = amplitude * alpha * d_amplitude / x_break\nd_alpha = -amplitude * d_amplitude * np.log(xx)\nd_alpha_...
<|body_start_0|> alpha = np.where(x < x_break, alpha_1, alpha_2) xx = x / x_break return amplitude * xx ** (-alpha) <|end_body_0|> <|body_start_1|> alpha = np.where(x < x_break, alpha_1, alpha_2) xx = x / x_break d_amplitude = xx ** (-alpha) d_x_break = amplitude...
One dimensional power law model with a break. Parameters ---------- amplitude : float Model amplitude at the break point x_break : float Break point alpha_1 : float Power law index for x < x_break alpha_2 : float Power law index for x > x_break See Also -------- PowerLaw1D, ExponentialCutoffPowerLaw1D, LogParabola1D No...
BrokenPowerLaw1D
[ "Python-2.0", "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-unknown" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BrokenPowerLaw1D: """One dimensional power law model with a break. Parameters ---------- amplitude : float Model amplitude at the break point x_break : float Break point alpha_1 : float Power law index for x < x_break alpha_2 : float Power law index for x > x_break See Also -------- PowerLaw1D, E...
stack_v2_sparse_classes_36k_train_001006
6,539
permissive
[ { "docstring": "One dimensional broken power law model function", "name": "evaluate", "signature": "def evaluate(x, amplitude, x_break, alpha_1, alpha_2)" }, { "docstring": "One dimensional broken power law derivative with respect to parameters", "name": "fit_deriv", "signature": "def fi...
2
stack_v2_sparse_classes_30k_test_000210
Implement the Python class `BrokenPowerLaw1D` described below. Class description: One dimensional power law model with a break. Parameters ---------- amplitude : float Model amplitude at the break point x_break : float Break point alpha_1 : float Power law index for x < x_break alpha_2 : float Power law index for x > ...
Implement the Python class `BrokenPowerLaw1D` described below. Class description: One dimensional power law model with a break. Parameters ---------- amplitude : float Model amplitude at the break point x_break : float Break point alpha_1 : float Power law index for x < x_break alpha_2 : float Power law index for x > ...
2c9002f16bb5c265e0d14f4a2314c86eeaa35cb6
<|skeleton|> class BrokenPowerLaw1D: """One dimensional power law model with a break. Parameters ---------- amplitude : float Model amplitude at the break point x_break : float Break point alpha_1 : float Power law index for x < x_break alpha_2 : float Power law index for x > x_break See Also -------- PowerLaw1D, E...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BrokenPowerLaw1D: """One dimensional power law model with a break. Parameters ---------- amplitude : float Model amplitude at the break point x_break : float Break point alpha_1 : float Power law index for x < x_break alpha_2 : float Power law index for x > x_break See Also -------- PowerLaw1D, ExponentialCut...
the_stack_v2_python_sparse
lib/python2.7/site-packages/astropy/modeling/powerlaws.py
wangyum/Anaconda
train
11
0852949b3fe023ac1a58c58cc878eeaec2885fb4
[ "query_filter = LineageFilter(entities=[LineageEntityEnum.ARTIFACT], sources=[LineageSourceEnum.DATASET])\nquery_result = LineageQuery(self.sagemaker_session).query(start_arns=[self.action_arn], query_filter=query_filter, direction=direction, include_edges=False)\nreturn [vertex.to_lineage_object() for vertex in qu...
<|body_start_0|> query_filter = LineageFilter(entities=[LineageEntityEnum.ARTIFACT], sources=[LineageSourceEnum.DATASET]) query_result = LineageQuery(self.sagemaker_session).query(start_arns=[self.action_arn], query_filter=query_filter, direction=direction, include_edges=False) return [vertex.to...
An Amazon SageMaker model package approval action, which is part of a SageMaker lineage.
ModelPackageApprovalAction
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ModelPackageApprovalAction: """An Amazon SageMaker model package approval action, which is part of a SageMaker lineage.""" def datasets(self, direction: LineageQueryDirectionEnum=LineageQueryDirectionEnum.ASCENDANTS) -> List[Artifact]: """Use a lineage query to retrieve all upstream ...
stack_v2_sparse_classes_36k_train_001007
12,422
permissive
[ { "docstring": "Use a lineage query to retrieve all upstream datasets that use this action. Args: direction (LineageQueryDirectionEnum, optional): The query direction. Returns: list of Artifacts: Artifacts representing a dataset.", "name": "datasets", "signature": "def datasets(self, direction: LineageQ...
3
null
Implement the Python class `ModelPackageApprovalAction` described below. Class description: An Amazon SageMaker model package approval action, which is part of a SageMaker lineage. Method signatures and docstrings: - def datasets(self, direction: LineageQueryDirectionEnum=LineageQueryDirectionEnum.ASCENDANTS) -> List...
Implement the Python class `ModelPackageApprovalAction` described below. Class description: An Amazon SageMaker model package approval action, which is part of a SageMaker lineage. Method signatures and docstrings: - def datasets(self, direction: LineageQueryDirectionEnum=LineageQueryDirectionEnum.ASCENDANTS) -> List...
8d5d7fd8ae1a917ed3e2b988d5e533bce244fd85
<|skeleton|> class ModelPackageApprovalAction: """An Amazon SageMaker model package approval action, which is part of a SageMaker lineage.""" def datasets(self, direction: LineageQueryDirectionEnum=LineageQueryDirectionEnum.ASCENDANTS) -> List[Artifact]: """Use a lineage query to retrieve all upstream ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ModelPackageApprovalAction: """An Amazon SageMaker model package approval action, which is part of a SageMaker lineage.""" def datasets(self, direction: LineageQueryDirectionEnum=LineageQueryDirectionEnum.ASCENDANTS) -> List[Artifact]: """Use a lineage query to retrieve all upstream datasets that...
the_stack_v2_python_sparse
src/sagemaker/lineage/action.py
aws/sagemaker-python-sdk
train
2,050
79c6dcf36a28b214983ccc7cef64c1052c0c04ab
[ "temp = sorted(nums)\nstart = -1\nend = -2\nfor i in range(len(nums)):\n if temp[i] != nums[i]:\n start = i\n break\nfor j in range(len(nums))[::-1]:\n if temp[j] != nums[j]:\n end = j\n break\nreturn end - start + 1", "start = -1\nend = -2\nn = len(nums)\nmaxcur = nums[0]\nmincu...
<|body_start_0|> temp = sorted(nums) start = -1 end = -2 for i in range(len(nums)): if temp[i] != nums[i]: start = i break for j in range(len(nums))[::-1]: if temp[j] != nums[j]: end = j break...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findUnsortedSubarray(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findUnsortedSubarray(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> temp = sorted(nums) ...
stack_v2_sparse_classes_36k_train_001008
1,527
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "findUnsortedSubarray", "signature": "def findUnsortedSubarray(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "findUnsortedSubarray", "signature": "def findUnsortedSubarray(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_002026
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findUnsortedSubarray(self, nums): :type nums: List[int] :rtype: int - def findUnsortedSubarray(self, nums): :type nums: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findUnsortedSubarray(self, nums): :type nums: List[int] :rtype: int - def findUnsortedSubarray(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: ...
6698f83614b01e43147f869a342e0e30943f4cf3
<|skeleton|> class Solution: def findUnsortedSubarray(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findUnsortedSubarray(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findUnsortedSubarray(self, nums): """:type nums: List[int] :rtype: int""" temp = sorted(nums) start = -1 end = -2 for i in range(len(nums)): if temp[i] != nums[i]: start = i break for j in range(len(nums)...
the_stack_v2_python_sparse
LeetCode/Easy/Shortest_Unsorted_Continuous_Subarray.py
kongyitian/coding_interviews
train
0
f2a7002db877d3ca46d3b3749af4876ae0da4027
[ "self.conv1 = ConvModule(self.in_channels, 64, kernel_size=7, stride=2, padding=3, bias=False, conv_cfg=self.conv_cfg, norm_cfg=self.norm_cfg, act_cfg=self.act_cfg)\nself.maxpool3d_1 = nn.MaxPool3d(kernel_size=(1, 3, 3), stride=(1, 2, 2), padding=(0, 0, 0))\nself.maxpool3d_2 = nn.MaxPool3d(kernel_size=(2, 1, 1), st...
<|body_start_0|> self.conv1 = ConvModule(self.in_channels, 64, kernel_size=7, stride=2, padding=3, bias=False, conv_cfg=self.conv_cfg, norm_cfg=self.norm_cfg, act_cfg=self.act_cfg) self.maxpool3d_1 = nn.MaxPool3d(kernel_size=(1, 3, 3), stride=(1, 2, 2), padding=(0, 0, 0)) self.maxpool3d_2 = nn.M...
C2D backbone. Compared to ResNet-50, a temporal-pool is added after the first bottleneck. Detailed structure is kept same as "video-nonlocal-net" repo. Please refer to https://github.com/facebookresearch/video-nonlocal-net/blob /main/scripts/run_c2d_baseline_400k.sh. Please note that there are some improvements compare...
C2D
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class C2D: """C2D backbone. Compared to ResNet-50, a temporal-pool is added after the first bottleneck. Detailed structure is kept same as "video-nonlocal-net" repo. Please refer to https://github.com/facebookresearch/video-nonlocal-net/blob /main/scripts/run_c2d_baseline_400k.sh. Please note that ther...
stack_v2_sparse_classes_36k_train_001009
3,040
permissive
[ { "docstring": "Construct the stem layers consists of a conv+norm+act module and a pooling layer.", "name": "_make_stem_layer", "signature": "def _make_stem_layer(self) -> None" }, { "docstring": "Defines the computation performed at every call. Args: x (torch.Tensor): The input data. Returns: U...
2
null
Implement the Python class `C2D` described below. Class description: C2D backbone. Compared to ResNet-50, a temporal-pool is added after the first bottleneck. Detailed structure is kept same as "video-nonlocal-net" repo. Please refer to https://github.com/facebookresearch/video-nonlocal-net/blob /main/scripts/run_c2d_...
Implement the Python class `C2D` described below. Class description: C2D backbone. Compared to ResNet-50, a temporal-pool is added after the first bottleneck. Detailed structure is kept same as "video-nonlocal-net" repo. Please refer to https://github.com/facebookresearch/video-nonlocal-net/blob /main/scripts/run_c2d_...
582b78fd6c3240500d5cacd292339d7d1ddbb056
<|skeleton|> class C2D: """C2D backbone. Compared to ResNet-50, a temporal-pool is added after the first bottleneck. Detailed structure is kept same as "video-nonlocal-net" repo. Please refer to https://github.com/facebookresearch/video-nonlocal-net/blob /main/scripts/run_c2d_baseline_400k.sh. Please note that ther...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class C2D: """C2D backbone. Compared to ResNet-50, a temporal-pool is added after the first bottleneck. Detailed structure is kept same as "video-nonlocal-net" repo. Please refer to https://github.com/facebookresearch/video-nonlocal-net/blob /main/scripts/run_c2d_baseline_400k.sh. Please note that there are some im...
the_stack_v2_python_sparse
mmaction/models/backbones/c2d.py
open-mmlab/mmaction2
train
3,498
f71d46c318b9366ee0575837d8cf89fe149d40a0
[ "dic = collections.Counter(nums)\nmaxValue = 0\nfor i in dic:\n if dic[i] > maxValue:\n maxValue = dic[i]\nres = len(nums)\nfor i in dic:\n if dic[i] == maxValue:\n index_left = nums.index(i)\n index_right = nums[::-1].index(i)\n length = len(nums) - (index_left + index_right)\n ...
<|body_start_0|> dic = collections.Counter(nums) maxValue = 0 for i in dic: if dic[i] > maxValue: maxValue = dic[i] res = len(nums) for i in dic: if dic[i] == maxValue: index_left = nums.index(i) index_right ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findShortestSubArray(self, nums: List[int]) -> int: """执行用时 :1672 ms, 在所有 Python3 提交中击败了13.05%的用户 内存消耗 :14.7 MB, 在所有 Python3 提交中击败了12.50%的用户 第一遍的答案 :param nums: :return:""" <|body_0|> def findShortestSubArray2(self, nums: List[int]) -> int: """执行用时 :260...
stack_v2_sparse_classes_36k_train_001010
3,311
no_license
[ { "docstring": "执行用时 :1672 ms, 在所有 Python3 提交中击败了13.05%的用户 内存消耗 :14.7 MB, 在所有 Python3 提交中击败了12.50%的用户 第一遍的答案 :param nums: :return:", "name": "findShortestSubArray", "signature": "def findShortestSubArray(self, nums: List[int]) -> int" }, { "docstring": "执行用时 :260 ms, 在所有 Python3 提交中击败了93.81%的用户 ...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findShortestSubArray(self, nums: List[int]) -> int: 执行用时 :1672 ms, 在所有 Python3 提交中击败了13.05%的用户 内存消耗 :14.7 MB, 在所有 Python3 提交中击败了12.50%的用户 第一遍的答案 :param nums: :return: - def f...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findShortestSubArray(self, nums: List[int]) -> int: 执行用时 :1672 ms, 在所有 Python3 提交中击败了13.05%的用户 内存消耗 :14.7 MB, 在所有 Python3 提交中击败了12.50%的用户 第一遍的答案 :param nums: :return: - def f...
e43ee86c5a8cdb808da09b4b6138e10275abadb5
<|skeleton|> class Solution: def findShortestSubArray(self, nums: List[int]) -> int: """执行用时 :1672 ms, 在所有 Python3 提交中击败了13.05%的用户 内存消耗 :14.7 MB, 在所有 Python3 提交中击败了12.50%的用户 第一遍的答案 :param nums: :return:""" <|body_0|> def findShortestSubArray2(self, nums: List[int]) -> int: """执行用时 :260...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findShortestSubArray(self, nums: List[int]) -> int: """执行用时 :1672 ms, 在所有 Python3 提交中击败了13.05%的用户 内存消耗 :14.7 MB, 在所有 Python3 提交中击败了12.50%的用户 第一遍的答案 :param nums: :return:""" dic = collections.Counter(nums) maxValue = 0 for i in dic: if dic[i] > maxValue...
the_stack_v2_python_sparse
LeetCode/697. Degree of an Array.py
yiming1012/MyLeetCode
train
2
f720b5011987aa38eaca3b0ccf778cb043c22c57
[ "super(Encoder, self).__init__()\nself.N = N\nself.dm = dm\nself.embedding = tf.keras.layers.Embedding(input_vocab, dm)\nself.positional_encoding = positional_encoding(max_seq_len, self.dm)\nself.blocks = [EncoderBlock(dm, h, hidden, drop_rate) for n in range(self.N)]\nself.dropout = tf.keras.layers.Dropout(drop_ra...
<|body_start_0|> super(Encoder, self).__init__() self.N = N self.dm = dm self.embedding = tf.keras.layers.Embedding(input_vocab, dm) self.positional_encoding = positional_encoding(max_seq_len, self.dm) self.blocks = [EncoderBlock(dm, h, hidden, drop_rate) for n in range(s...
Encoder Class
Encoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Encoder: """Encoder Class""" def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): """Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (int): the number of heads. hidden (int): the number of hi...
stack_v2_sparse_classes_36k_train_001011
2,055
no_license
[ { "docstring": "Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (int): the number of heads. hidden (int): the number of hidden units in the fully connected layer. input_vocab (int): the size of the input vocabulary. max_seq_len (int): the maximu...
2
null
Implement the Python class `Encoder` described below. Class description: Encoder Class Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (...
Implement the Python class `Encoder` described below. Class description: Encoder Class Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (...
5aff923277cfe9f2b5324a773e4e5c3cac810a0c
<|skeleton|> class Encoder: """Encoder Class""" def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): """Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (int): the number of heads. hidden (int): the number of hi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Encoder: """Encoder Class""" def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): """Class constructor Args: N (int): the number of blocks in the encoder. dm (int): the dimensionality of the model. h (int): the number of heads. hidden (int): the number of hidden units in...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/9-transformer_encoder.py
cmmolanos1/holbertonschool-machine_learning
train
1
bb91cbc762751f307b2ddc76f1a358afd5daa74d
[ "rset = ResultSet(names=('uuid', 'provider_id', 'av_zone', 'addresses'), types=(str, str, str, str))\nif not skip_store:\n if generic_filters or meta_filters:\n raise _errors.ConfigurationError(\"Filters are only supported when the 'skip_store' option is set.\")\n provider = _retrieve_provider(provider...
<|body_start_0|> rset = ResultSet(names=('uuid', 'provider_id', 'av_zone', 'addresses'), types=(str, str, str, str)) if not skip_store: if generic_filters or meta_filters: raise _errors.ConfigurationError("Filters are only supported when the 'skip_store' option is set.") ...
Return information on existing machine(s) created by a provider.
MachineLookup
[ "Apache-2.0", "LicenseRef-scancode-python-cwi", "LGPL-2.0-or-later", "BSD-3-Clause", "bzip2-1.0.6", "LicenseRef-scancode-free-unknown", "GPL-2.0-only", "LicenseRef-scancode-other-copyleft", "Sleepycat", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-unknown-license-reference", ...
stack_v2_sparse_python_classes_v1
<|skeleton|> class MachineLookup: """Return information on existing machine(s) created by a provider.""" def execute(self, provider_id, generic_filters=None, meta_filters=None, skip_store=False): """Return information on existing machine(s). :param provider_id: Provider's Id. :param generic_filters: Fi...
stack_v2_sparse_classes_36k_train_001012
19,734
permissive
[ { "docstring": "Return information on existing machine(s). :param provider_id: Provider's Id. :param generic_filters: Filter returned machines by some properites but metadata properties. :param meta_filters: Filter returned machines by metadata properties. :param skip_store: Proceed anyway if there is no inform...
2
stack_v2_sparse_classes_30k_train_011720
Implement the Python class `MachineLookup` described below. Class description: Return information on existing machine(s) created by a provider. Method signatures and docstrings: - def execute(self, provider_id, generic_filters=None, meta_filters=None, skip_store=False): Return information on existing machine(s). :par...
Implement the Python class `MachineLookup` described below. Class description: Return information on existing machine(s) created by a provider. Method signatures and docstrings: - def execute(self, provider_id, generic_filters=None, meta_filters=None, skip_store=False): Return information on existing machine(s). :par...
1e912fd87282be3b3bed48487e6beb0ecb1de339
<|skeleton|> class MachineLookup: """Return information on existing machine(s) created by a provider.""" def execute(self, provider_id, generic_filters=None, meta_filters=None, skip_store=False): """Return information on existing machine(s). :param provider_id: Provider's Id. :param generic_filters: Fi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MachineLookup: """Return information on existing machine(s) created by a provider.""" def execute(self, provider_id, generic_filters=None, meta_filters=None, skip_store=False): """Return information on existing machine(s). :param provider_id: Provider's Id. :param generic_filters: Filter returned...
the_stack_v2_python_sparse
mysql-utilities-1.6.0/mysql/fabric/services/machine.py
scavarda/mysql-dbcompare
train
2
f3796b5ce9e7e3df872886bef92f085c57425ddc
[ "if self.action == 'retrieve':\n permission_classes = [IsAuthenticated]\nelse:\n permission_classes = [IsAdminUser]\nreturn [permission() for permission in permission_classes]", "if pk == 'i':\n return response.Response(UserSerializer(request.user, context={'request': request}).data)\nreturn super(UserVi...
<|body_start_0|> if self.action == 'retrieve': permission_classes = [IsAuthenticated] else: permission_classes = [IsAdminUser] return [permission() for permission in permission_classes] <|end_body_0|> <|body_start_1|> if pk == 'i': return response.Res...
UserViewSet
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserViewSet: def get_permissions(self): """Instantiates and returns the list of permissions that this view requires.""" <|body_0|> def retrieve(self, request, pk=None): """este metodo serve para retornar informacoes do usuario logado e so retorna informacao se o id p...
stack_v2_sparse_classes_36k_train_001013
42,051
permissive
[ { "docstring": "Instantiates and returns the list of permissions that this view requires.", "name": "get_permissions", "signature": "def get_permissions(self)" }, { "docstring": "este metodo serve para retornar informacoes do usuario logado e so retorna informacao se o id passado por 'i'", "...
2
stack_v2_sparse_classes_30k_train_006762
Implement the Python class `UserViewSet` described below. Class description: Implement the UserViewSet class. Method signatures and docstrings: - def get_permissions(self): Instantiates and returns the list of permissions that this view requires. - def retrieve(self, request, pk=None): este metodo serve para retornar...
Implement the Python class `UserViewSet` described below. Class description: Implement the UserViewSet class. Method signatures and docstrings: - def get_permissions(self): Instantiates and returns the list of permissions that this view requires. - def retrieve(self, request, pk=None): este metodo serve para retornar...
54c63d84c81cc3d2ca12485f932f12b46d0603e1
<|skeleton|> class UserViewSet: def get_permissions(self): """Instantiates and returns the list of permissions that this view requires.""" <|body_0|> def retrieve(self, request, pk=None): """este metodo serve para retornar informacoes do usuario logado e so retorna informacao se o id p...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserViewSet: def get_permissions(self): """Instantiates and returns the list of permissions that this view requires.""" if self.action == 'retrieve': permission_classes = [IsAuthenticated] else: permission_classes = [IsAdminUser] return [permission() for...
the_stack_v2_python_sparse
core_admin/tno/views.py
linea-it/tno
train
1
b95402d7cc07ea2f776eec712fe032acd4793238
[ "url = os.path.join(prefix, filename)\nresponse = self.client.get(url)\nhere = os.path.abspath(os.path.dirname(__file__))\noutput_dir = os.path.join(here, '..', '..', 'js_tmp')\noutput_dir = os.path.abspath(output_dir)\nif not os.path.exists(output_dir):\n os.mkdir(output_dir)\noutput_file = os.path.join(output_...
<|body_start_0|> url = os.path.join(prefix, filename) response = self.client.get(url) here = os.path.abspath(os.path.dirname(__file__)) output_dir = os.path.join(here, '..', '..', 'js_tmp') output_dir = os.path.abspath(output_dir) if not os.path.exists(output_dir): ...
A unit test to "render" javascript files. The server renders templated javascript files, we need the fully-rendered files for linting and static tests.
RenderJavascriptFiles
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RenderJavascriptFiles: """A unit test to "render" javascript files. The server renders templated javascript files, we need the fully-rendered files for linting and static tests.""" def download_file(self, filename, prefix): """Function to `download`(copy) a file to a temporary firect...
stack_v2_sparse_classes_36k_train_001014
2,122
permissive
[ { "docstring": "Function to `download`(copy) a file to a temporary firectory.", "name": "download_file", "signature": "def download_file(self, filename, prefix)" }, { "docstring": "Download files in directory.", "name": "download_files", "signature": "def download_files(self, subdir, pre...
3
stack_v2_sparse_classes_30k_train_008027
Implement the Python class `RenderJavascriptFiles` described below. Class description: A unit test to "render" javascript files. The server renders templated javascript files, we need the fully-rendered files for linting and static tests. Method signatures and docstrings: - def download_file(self, filename, prefix): ...
Implement the Python class `RenderJavascriptFiles` described below. Class description: A unit test to "render" javascript files. The server renders templated javascript files, we need the fully-rendered files for linting and static tests. Method signatures and docstrings: - def download_file(self, filename, prefix): ...
e88a8e99a5f0b201c67a95cba097c729f090d5e2
<|skeleton|> class RenderJavascriptFiles: """A unit test to "render" javascript files. The server renders templated javascript files, we need the fully-rendered files for linting and static tests.""" def download_file(self, filename, prefix): """Function to `download`(copy) a file to a temporary firect...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RenderJavascriptFiles: """A unit test to "render" javascript files. The server renders templated javascript files, we need the fully-rendered files for linting and static tests.""" def download_file(self, filename, prefix): """Function to `download`(copy) a file to a temporary firectory.""" ...
the_stack_v2_python_sparse
InvenTree/InvenTree/ci_render_js.py
inventree/InvenTree
train
3,077
be326aa2f6a61e1638659defe1e51d619a434f98
[ "super().__init__(im_ids=im_ids, pos_slice_dict=pos_slice_dict, transforms=transforms, preprocessing=preprocessing, p_pos_per_sample=p_pos_per_sample, mode=mode, num_classes=num_classes)\nself.num_pseudo_slices = num_pseudo_slices\nassert num_pseudo_slices % 2 == 1, '`num_pseudo_slices` must be odd. i.e. 7 -> 3 abo...
<|body_start_0|> super().__init__(im_ids=im_ids, pos_slice_dict=pos_slice_dict, transforms=transforms, preprocessing=preprocessing, p_pos_per_sample=p_pos_per_sample, mode=mode, num_classes=num_classes) self.num_pseudo_slices = num_pseudo_slices assert num_pseudo_slices % 2 == 1, '`num_pseudo_sl...
PseudoSliceDataset
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PseudoSliceDataset: def __init__(self, im_ids: np.array, pos_slice_dict: dict, transforms=None, preprocessing=None, p_pos_per_sample: float=0.33, mode: str='segmentation', num_classes: int=3, num_pseudo_slices=1): """Reads from a directory of 2D slice numpy arrays and samples positive sl...
stack_v2_sparse_classes_36k_train_001015
10,666
permissive
[ { "docstring": "Reads from a directory of 2D slice numpy arrays and samples positive slices. Assumes the data directory contains 2D slices processed by `io.Preprocessor.save_dir_as_2d()`. Attributes im_ids (np.ndarray): of image names. pos_slice_dict (dict): dictionary generated by `io.Preprocessor.save_dir_as_...
3
stack_v2_sparse_classes_30k_train_016224
Implement the Python class `PseudoSliceDataset` described below. Class description: Implement the PseudoSliceDataset class. Method signatures and docstrings: - def __init__(self, im_ids: np.array, pos_slice_dict: dict, transforms=None, preprocessing=None, p_pos_per_sample: float=0.33, mode: str='segmentation', num_cl...
Implement the Python class `PseudoSliceDataset` described below. Class description: Implement the PseudoSliceDataset class. Method signatures and docstrings: - def __init__(self, im_ids: np.array, pos_slice_dict: dict, transforms=None, preprocessing=None, p_pos_per_sample: float=0.33, mode: str='segmentation', num_cl...
0c1c861ca1a211a840a77e52895548e8d8033470
<|skeleton|> class PseudoSliceDataset: def __init__(self, im_ids: np.array, pos_slice_dict: dict, transforms=None, preprocessing=None, p_pos_per_sample: float=0.33, mode: str='segmentation', num_classes: int=3, num_pseudo_slices=1): """Reads from a directory of 2D slice numpy arrays and samples positive sl...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PseudoSliceDataset: def __init__(self, im_ids: np.array, pos_slice_dict: dict, transforms=None, preprocessing=None, p_pos_per_sample: float=0.33, mode: str='segmentation', num_classes: int=3, num_pseudo_slices=1): """Reads from a directory of 2D slice numpy arrays and samples positive slices. Assumes ...
the_stack_v2_python_sparse
kits19cnn/io/dataset_2d.py
Ramsha04/kits19_cnn
train
0
c783eac9327ad43e302fbfb66b43e5ec7bc3c1bf
[ "if not quota_max_calls:\n use_rate_limiter = False\nself._instances = None\nsuper(CloudSqlRepositoryClient, self).__init__(API_NAME, versions=['v1beta4'], quota_max_calls=quota_max_calls, quota_period=quota_period, use_rate_limiter=use_rate_limiter)", "if not self._instances:\n self._instances = self._init...
<|body_start_0|> if not quota_max_calls: use_rate_limiter = False self._instances = None super(CloudSqlRepositoryClient, self).__init__(API_NAME, versions=['v1beta4'], quota_max_calls=quota_max_calls, quota_period=quota_period, use_rate_limiter=use_rate_limiter) <|end_body_0|> <|bod...
Cloud SQL Admin API Respository.
CloudSqlRepositoryClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CloudSqlRepositoryClient: """Cloud SQL Admin API Respository.""" def __init__(self, quota_max_calls=None, quota_period=1.0, use_rate_limiter=True): """Constructor. Args: quota_max_calls (int): Allowed requests per <quota_period> for the API. quota_period (float): The time period to t...
stack_v2_sparse_classes_36k_train_001016
4,834
permissive
[ { "docstring": "Constructor. Args: quota_max_calls (int): Allowed requests per <quota_period> for the API. quota_period (float): The time period to track requests over. use_rate_limiter (bool): Set to false to disable the use of a rate limiter for this service.", "name": "__init__", "signature": "def __...
2
stack_v2_sparse_classes_30k_train_018218
Implement the Python class `CloudSqlRepositoryClient` described below. Class description: Cloud SQL Admin API Respository. Method signatures and docstrings: - def __init__(self, quota_max_calls=None, quota_period=1.0, use_rate_limiter=True): Constructor. Args: quota_max_calls (int): Allowed requests per <quota_period...
Implement the Python class `CloudSqlRepositoryClient` described below. Class description: Cloud SQL Admin API Respository. Method signatures and docstrings: - def __init__(self, quota_max_calls=None, quota_period=1.0, use_rate_limiter=True): Constructor. Args: quota_max_calls (int): Allowed requests per <quota_period...
d4421afa50a17ed47cbebe942044ebab3720e0f5
<|skeleton|> class CloudSqlRepositoryClient: """Cloud SQL Admin API Respository.""" def __init__(self, quota_max_calls=None, quota_period=1.0, use_rate_limiter=True): """Constructor. Args: quota_max_calls (int): Allowed requests per <quota_period> for the API. quota_period (float): The time period to t...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CloudSqlRepositoryClient: """Cloud SQL Admin API Respository.""" def __init__(self, quota_max_calls=None, quota_period=1.0, use_rate_limiter=True): """Constructor. Args: quota_max_calls (int): Allowed requests per <quota_period> for the API. quota_period (float): The time period to track requests...
the_stack_v2_python_sparse
google/cloud/forseti/common/gcp_api/cloudsql.py
kevensen/forseti-security
train
1
37cf30dadce3f1ff1c8fb8ef0e729a578a2cbdd8
[ "self.auth = auth\nif isinstance(rid, FaceUDistinguishRecord):\n self.record = rid\nelse:\n self.record = self.get_record_model(rid)", "if not rid:\n return None\nrecord = FaceUDistinguishRecord.objects.get_once(pk=rid)\nif not record:\n raise FaceURecordInfoExcept.record_is_not_exists()\nreturn recor...
<|body_start_0|> self.auth = auth if isinstance(rid, FaceUDistinguishRecord): self.record = rid else: self.record = self.get_record_model(rid) <|end_body_0|> <|body_start_1|> if not rid: return None record = FaceUDistinguishRecord.objects.get_...
FaceURecordLogic
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FaceURecordLogic: def __init__(self, auth, rid=''): """INIT :param auth: :param rid:""" <|body_0|> def get_record_model(self, rid): """获取记录model :param rid: :return:""" <|body_1|> def get_record_info(self): """获取记录信息 :return:""" <|body_2|...
stack_v2_sparse_classes_36k_train_001017
1,633
no_license
[ { "docstring": "INIT :param auth: :param rid:", "name": "__init__", "signature": "def __init__(self, auth, rid='')" }, { "docstring": "获取记录model :param rid: :return:", "name": "get_record_model", "signature": "def get_record_model(self, rid)" }, { "docstring": "获取记录信息 :return:", ...
3
stack_v2_sparse_classes_30k_train_005110
Implement the Python class `FaceURecordLogic` described below. Class description: Implement the FaceURecordLogic class. Method signatures and docstrings: - def __init__(self, auth, rid=''): INIT :param auth: :param rid: - def get_record_model(self, rid): 获取记录model :param rid: :return: - def get_record_info(self): 获取记...
Implement the Python class `FaceURecordLogic` described below. Class description: Implement the FaceURecordLogic class. Method signatures and docstrings: - def __init__(self, auth, rid=''): INIT :param auth: :param rid: - def get_record_model(self, rid): 获取记录model :param rid: :return: - def get_record_info(self): 获取记...
7467cd66e1fc91f0b3a264f8fc9b93f22f09fe7b
<|skeleton|> class FaceURecordLogic: def __init__(self, auth, rid=''): """INIT :param auth: :param rid:""" <|body_0|> def get_record_model(self, rid): """获取记录model :param rid: :return:""" <|body_1|> def get_record_info(self): """获取记录信息 :return:""" <|body_2|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FaceURecordLogic: def __init__(self, auth, rid=''): """INIT :param auth: :param rid:""" self.auth = auth if isinstance(rid, FaceUDistinguishRecord): self.record = rid else: self.record = self.get_record_model(rid) def get_record_model(self, rid): ...
the_stack_v2_python_sparse
FireHydrant/server/faceU/logic/record.py
shoogoome/FireHydrant
train
4
4fd8d489c42581bf70adb761c29d8bce9950ee4e
[ "super().__init__()\nself.use_regex = use_regex\nself._exceptions = exceptions\nself.exceptions = None\nself.case_insensitive = case_insensitive\nself.edit_summary = edit_summary\nself.name = name", "if not self.exceptions and self._exceptions is not None:\n self.exceptions = dict(self._exceptions)\n precom...
<|body_start_0|> super().__init__() self.use_regex = use_regex self._exceptions = exceptions self.exceptions = None self.case_insensitive = case_insensitive self.edit_summary = edit_summary self.name = name <|end_body_0|> <|body_start_1|> if not self.exce...
A list of replacements which all share some properties. The shared properties are: * use_regex * exceptions * case_insensitive Each entry in this list should be a ReplacementListEntry. The exceptions are compiled only once.
ReplacementList
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReplacementList: """A list of replacements which all share some properties. The shared properties are: * use_regex * exceptions * case_insensitive Each entry in this list should be a ReplacementListEntry. The exceptions are compiled only once.""" def __init__(self, use_regex, exceptions, cas...
stack_v2_sparse_classes_36k_train_001018
42,775
permissive
[ { "docstring": "Create a fix list which can contain multiple replacements.", "name": "__init__", "signature": "def __init__(self, use_regex, exceptions, case_insensitive, edit_summary, name) -> None" }, { "docstring": "Compile the exceptions if not already done.", "name": "_compile_exception...
2
stack_v2_sparse_classes_30k_train_007307
Implement the Python class `ReplacementList` described below. Class description: A list of replacements which all share some properties. The shared properties are: * use_regex * exceptions * case_insensitive Each entry in this list should be a ReplacementListEntry. The exceptions are compiled only once. Method signat...
Implement the Python class `ReplacementList` described below. Class description: A list of replacements which all share some properties. The shared properties are: * use_regex * exceptions * case_insensitive Each entry in this list should be a ReplacementListEntry. The exceptions are compiled only once. Method signat...
5c01e6bfcd328bc6eae643e661f1a0ae57612808
<|skeleton|> class ReplacementList: """A list of replacements which all share some properties. The shared properties are: * use_regex * exceptions * case_insensitive Each entry in this list should be a ReplacementListEntry. The exceptions are compiled only once.""" def __init__(self, use_regex, exceptions, cas...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ReplacementList: """A list of replacements which all share some properties. The shared properties are: * use_regex * exceptions * case_insensitive Each entry in this list should be a ReplacementListEntry. The exceptions are compiled only once.""" def __init__(self, use_regex, exceptions, case_insensitive...
the_stack_v2_python_sparse
scripts/replace.py
wikimedia/pywikibot
train
432
eb61fcc3acc3bd9619406313a1e48c7f64e90ef5
[ "self.multiengine = multiengine\nself.dist = dist\nself.targets = targets\nself.block = block", "max_len = max((len(s) for s in sequences))\nfor s in sequences:\n if len(s) != max_len:\n raise ValueError('all sequences must have equal length')\nassert isinstance(func, (str, FunctionType)), 'func must be...
<|body_start_0|> self.multiengine = multiengine self.dist = dist self.targets = targets self.block = block <|end_body_0|> <|body_start_1|> max_len = max((len(s) for s in sequences)) for s in sequences: if len(s) != max_len: raise ValueError('a...
A Mapper for `IMultiEngine` implementers.
MultiEngineMapper
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiEngineMapper: """A Mapper for `IMultiEngine` implementers.""" def __init__(self, multiengine, dist='b', targets='all', block=True): """Create a Mapper for a multiengine. The value of all arguments are used for all calls to `map`. This class allows these arguemnts to be set for a...
stack_v2_sparse_classes_36k_train_001019
8,554
permissive
[ { "docstring": "Create a Mapper for a multiengine. The value of all arguments are used for all calls to `map`. This class allows these arguemnts to be set for a series of map calls. :Parameters: multiengine : `IMultiEngine` implementer The multiengine to use for running the map commands dist : str The type of d...
2
stack_v2_sparse_classes_30k_train_010460
Implement the Python class `MultiEngineMapper` described below. Class description: A Mapper for `IMultiEngine` implementers. Method signatures and docstrings: - def __init__(self, multiengine, dist='b', targets='all', block=True): Create a Mapper for a multiengine. The value of all arguments are used for all calls to...
Implement the Python class `MultiEngineMapper` described below. Class description: A Mapper for `IMultiEngine` implementers. Method signatures and docstrings: - def __init__(self, multiengine, dist='b', targets='all', block=True): Create a Mapper for a multiengine. The value of all arguments are used for all calls to...
1cf44de3833929a4cf9e0069e8c75ef9086eeaca
<|skeleton|> class MultiEngineMapper: """A Mapper for `IMultiEngine` implementers.""" def __init__(self, multiengine, dist='b', targets='all', block=True): """Create a Mapper for a multiengine. The value of all arguments are used for all calls to `map`. This class allows these arguemnts to be set for a...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MultiEngineMapper: """A Mapper for `IMultiEngine` implementers.""" def __init__(self, multiengine, dist='b', targets='all', block=True): """Create a Mapper for a multiengine. The value of all arguments are used for all calls to `map`. This class allows these arguemnts to be set for a series of ma...
the_stack_v2_python_sparse
IPython/kernel/mapper.py
omazapa/ipython
train
3
35b569df012d50638e88f5b01e9ce6e990a15d51
[ "slow = 0\nfor fast in range(len(nums)):\n if nums[fast] != val:\n nums[slow] = nums[fast]\n slow += 1\nreturn slow", "start, end = (0, len(nums) - 1)\nwhile start <= end:\n if nums[start] == val:\n nums[start], nums[end] = (nums[end], nums[start])\n end -= 1\n else:\n ...
<|body_start_0|> slow = 0 for fast in range(len(nums)): if nums[fast] != val: nums[slow] = nums[fast] slow += 1 return slow <|end_body_0|> <|body_start_1|> start, end = (0, len(nums) - 1) while start <= end: if nums[start] ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def removeElement(self, nums, val): """:type nums: List[int] :type val: int :rtype: int 快慢指针""" <|body_0|> def removeElement1(self, nums, val): """:type nums: List[int] :type val: int :rtype: int 双指针""" <|body_1|> def removeElement0(self, nums,...
stack_v2_sparse_classes_36k_train_001020
1,558
no_license
[ { "docstring": ":type nums: List[int] :type val: int :rtype: int 快慢指针", "name": "removeElement", "signature": "def removeElement(self, nums, val)" }, { "docstring": ":type nums: List[int] :type val: int :rtype: int 双指针", "name": "removeElement1", "signature": "def removeElement1(self, nu...
3
stack_v2_sparse_classes_30k_train_000734
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeElement(self, nums, val): :type nums: List[int] :type val: int :rtype: int 快慢指针 - def removeElement1(self, nums, val): :type nums: List[int] :type val: int :rtype: int ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def removeElement(self, nums, val): :type nums: List[int] :type val: int :rtype: int 快慢指针 - def removeElement1(self, nums, val): :type nums: List[int] :type val: int :rtype: int ...
6e18c5d257840489cc3fb1079ae3804c743982a4
<|skeleton|> class Solution: def removeElement(self, nums, val): """:type nums: List[int] :type val: int :rtype: int 快慢指针""" <|body_0|> def removeElement1(self, nums, val): """:type nums: List[int] :type val: int :rtype: int 双指针""" <|body_1|> def removeElement0(self, nums,...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def removeElement(self, nums, val): """:type nums: List[int] :type val: int :rtype: int 快慢指针""" slow = 0 for fast in range(len(nums)): if nums[fast] != val: nums[slow] = nums[fast] slow += 1 return slow def removeElemen...
the_stack_v2_python_sparse
27.移除元素.py
yangyuxiang1996/leetcode
train
0
793cf1e354c383c49617a82de8a30d5c251cffae
[ "address = address.lower()\nverify_existing_address(address)\nactivehome.action.send('sendplc', address, 'on')", "address = address.lower()\nverify_existing_address(address)\nactivehome.action.send('sendplc', address, 'off')" ]
<|body_start_0|> address = address.lower() verify_existing_address(address) activehome.action.send('sendplc', address, 'on') <|end_body_0|> <|body_start_1|> address = address.lower() verify_existing_address(address) activehome.action.send('sendplc', address, 'off') <|end...
The home daemon is a higher-level interface to ActiveHome. It allows modules to be configured, turned on, and turned off. It supports various types of modules, such as cameras (turning on any camera will cause all other cameras to be turned off) and chimes (turning off a chime has no effect, but it can be turned on mul...
Interface
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Interface: """The home daemon is a higher-level interface to ActiveHome. It allows modules to be configured, turned on, and turned off. It supports various types of modules, such as cameras (turning on any camera will cause all other cameras to be turned off) and chimes (turning off a chime has n...
stack_v2_sparse_classes_36k_train_001021
2,335
no_license
[ { "docstring": "Turns the specified module on. This module must be in the configuration file. This function will take special module types into effect; for example, calling this function on a camera will automatically turn all other cameras off.", "name": "on", "signature": "def on(self, address)" }, ...
2
null
Implement the Python class `Interface` described below. Class description: The home daemon is a higher-level interface to ActiveHome. It allows modules to be configured, turned on, and turned off. It supports various types of modules, such as cameras (turning on any camera will cause all other cameras to be turned off...
Implement the Python class `Interface` described below. Class description: The home daemon is a higher-level interface to ActiveHome. It allows modules to be configured, turned on, and turned off. It supports various types of modules, such as cameras (turning on any camera will cause all other cameras to be turned off...
d9d95e24673794a20bb8138ce44d5bac236e07ed
<|skeleton|> class Interface: """The home daemon is a higher-level interface to ActiveHome. It allows modules to be configured, turned on, and turned off. It supports various types of modules, such as cameras (turning on any camera will cause all other cameras to be turned off) and chimes (turning off a chime has n...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Interface: """The home daemon is a higher-level interface to ActiveHome. It allows modules to be configured, turned on, and turned off. It supports various types of modules, such as cameras (turning on any camera will cause all other cameras to be turned off) and chimes (turning off a chime has no effect, but...
the_stack_v2_python_sparse
afn/python/src/homed.py
javawizard/afn
train
0
f87425751fa98f2c33671d5fa3caa80064e6460f
[ "self.s1 = []\nself.s2 = []\nself.front = None", "if not self.s1:\n self.front = x\nself.s1.append(x)", "if not self.s2:\n while self.s1:\n self.s2.append(self.s1.pop())\nreturn self.s2.pop()", "if self.s2:\n return self.s2[-1]\nreturn self.front", "if not self.s1 and (not self.s2):\n ret...
<|body_start_0|> self.s1 = [] self.s2 = [] self.front = None <|end_body_0|> <|body_start_1|> if not self.s1: self.front = x self.s1.append(x) <|end_body_1|> <|body_start_2|> if not self.s2: while self.s1: self.s2.append(self.s1.po...
MyQueue
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyQueue: def __init__(self): """Initialize your data structure here.""" <|body_0|> def push(self, x: int) -> None: """Push element x to the back of queue.""" <|body_1|> def pop(self) -> int: """Removes the element from in front of queue and retur...
stack_v2_sparse_classes_36k_train_001022
3,995
no_license
[ { "docstring": "Initialize your data structure here.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Push element x to the back of queue.", "name": "push", "signature": "def push(self, x: int) -> None" }, { "docstring": "Removes the element from in fron...
5
stack_v2_sparse_classes_30k_train_012994
Implement the Python class `MyQueue` described below. Class description: Implement the MyQueue class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def push(self, x: int) -> None: Push element x to the back of queue. - def pop(self) -> int: Removes the element from in ...
Implement the Python class `MyQueue` described below. Class description: Implement the MyQueue class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def push(self, x: int) -> None: Push element x to the back of queue. - def pop(self) -> int: Removes the element from in ...
2e68822e82df37e8347a7c16616a0a99a8075c3f
<|skeleton|> class MyQueue: def __init__(self): """Initialize your data structure here.""" <|body_0|> def push(self, x: int) -> None: """Push element x to the back of queue.""" <|body_1|> def pop(self) -> int: """Removes the element from in front of queue and retur...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MyQueue: def __init__(self): """Initialize your data structure here.""" self.s1 = [] self.s2 = [] self.front = None def push(self, x: int) -> None: """Push element x to the back of queue.""" if not self.s1: self.front = x self.s1.append(...
the_stack_v2_python_sparse
leet_code/232. 用栈实现队列.py
muyisanshuiliang/python
train
0
399e33108e8183e8a5a282f9388dd0dc383ea088
[ "super(DecodeLeaf, self).__init__()\nself.in_channel = in_channel\nself.conv1x1 = nn.Conv1d(in_channel, 1, 1, 1, 0)\nself.scale = Parameter(0.5 * torch.ones(1))", "x = self.conv1x1(x).squeeze(1)\nx = self.scale * 0.5 * torch.tanh(x)\nreturn x" ]
<|body_start_0|> super(DecodeLeaf, self).__init__() self.in_channel = in_channel self.conv1x1 = nn.Conv1d(in_channel, 1, 1, 1, 0) self.scale = Parameter(0.5 * torch.ones(1)) <|end_body_0|> <|body_start_1|> x = self.conv1x1(x).squeeze(1) x = self.scale * 0.5 * torch.tanh(...
DecodeLeaf
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DecodeLeaf: def __init__(self, in_channel): """:param in_channel: input planes""" <|body_0|> def forward(self, x): """:param x: tensor of shape (N, C, L) :return tensor of shape (N, L)""" <|body_1|> <|end_skeleton|> <|body_start_0|> super(DecodeLeaf...
stack_v2_sparse_classes_36k_train_001023
7,677
no_license
[ { "docstring": ":param in_channel: input planes", "name": "__init__", "signature": "def __init__(self, in_channel)" }, { "docstring": ":param x: tensor of shape (N, C, L) :return tensor of shape (N, L)", "name": "forward", "signature": "def forward(self, x)" } ]
2
stack_v2_sparse_classes_30k_train_018628
Implement the Python class `DecodeLeaf` described below. Class description: Implement the DecodeLeaf class. Method signatures and docstrings: - def __init__(self, in_channel): :param in_channel: input planes - def forward(self, x): :param x: tensor of shape (N, C, L) :return tensor of shape (N, L)
Implement the Python class `DecodeLeaf` described below. Class description: Implement the DecodeLeaf class. Method signatures and docstrings: - def __init__(self, in_channel): :param in_channel: input planes - def forward(self, x): :param x: tensor of shape (N, C, L) :return tensor of shape (N, L) <|skeleton|> class...
666bbecd9f9b2c9bebaf82deab3ccb8586d60dca
<|skeleton|> class DecodeLeaf: def __init__(self, in_channel): """:param in_channel: input planes""" <|body_0|> def forward(self, x): """:param x: tensor of shape (N, C, L) :return tensor of shape (N, L)""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DecodeLeaf: def __init__(self, in_channel): """:param in_channel: input planes""" super(DecodeLeaf, self).__init__() self.in_channel = in_channel self.conv1x1 = nn.Conv1d(in_channel, 1, 1, 1, 0) self.scale = Parameter(0.5 * torch.ones(1)) def forward(self, x): ...
the_stack_v2_python_sparse
experiments/exp3_segmentation/model.py
maxjiang93/DDSL
train
55
983143aa0915f882aeaee564716774482ff8c522
[ "self.url = cmds.url\nresponse = requests.get(f'{self.url}').text\nself.htmlcontent = BeautifulSoup(response, 'html.parser')", "dwnload = cmds.download\nanchors = self.htmlcontent.find_all('img')\nfiltered_list = list(set(anchors))\nfor images in filtered_list:\n print(self.url + images['src'])\n'If --download...
<|body_start_0|> self.url = cmds.url response = requests.get(f'{self.url}').text self.htmlcontent = BeautifulSoup(response, 'html.parser') <|end_body_0|> <|body_start_1|> dwnload = cmds.download anchors = self.htmlcontent.find_all('img') filtered_list = list(set(anchors)...
Fetch
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Fetch: def __init__(self): """Requests passed urls and Store Response for Further use""" <|body_0|> def pull_images(self): """Scrapes all Images links found in img tage""" <|body_1|> def get_all_links(self): """Get Scrapes All links found in anch...
stack_v2_sparse_classes_36k_train_001024
2,996
permissive
[ { "docstring": "Requests passed urls and Store Response for Further use", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Scrapes all Images links found in img tage", "name": "pull_images", "signature": "def pull_images(self)" }, { "docstring": "Get Scrap...
3
stack_v2_sparse_classes_30k_train_010687
Implement the Python class `Fetch` described below. Class description: Implement the Fetch class. Method signatures and docstrings: - def __init__(self): Requests passed urls and Store Response for Further use - def pull_images(self): Scrapes all Images links found in img tage - def get_all_links(self): Get Scrapes A...
Implement the Python class `Fetch` described below. Class description: Implement the Fetch class. Method signatures and docstrings: - def __init__(self): Requests passed urls and Store Response for Further use - def pull_images(self): Scrapes all Images links found in img tage - def get_all_links(self): Get Scrapes A...
70a3d5d798e2987d37e7562d2e556f364627a59c
<|skeleton|> class Fetch: def __init__(self): """Requests passed urls and Store Response for Further use""" <|body_0|> def pull_images(self): """Scrapes all Images links found in img tage""" <|body_1|> def get_all_links(self): """Get Scrapes All links found in anch...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Fetch: def __init__(self): """Requests passed urls and Store Response for Further use""" self.url = cmds.url response = requests.get(f'{self.url}').text self.htmlcontent = BeautifulSoup(response, 'html.parser') def pull_images(self): """Scrapes all Images links fou...
the_stack_v2_python_sparse
Python-Programs/webpage-link-image-scraper/webpage-link-image-scraper/fetch.py
MMVonnSeek/Hacktoberfest-2021
train
5
b4fd9bffee583db8cc45237db4c0604fa3a2c574
[ "super(AddNoiseToVehicle, self).__init__(name)\nself.logger.debug('%s.__init__()' % self.__class__.__name__)\nself._control = carla.VehicleControl()\nself._actor = actor\nself._steer_value = steer_value\nself._throttle_value = throttle_value", "self._control = self._actor.get_control()\nself._control.steer = self...
<|body_start_0|> super(AddNoiseToVehicle, self).__init__(name) self.logger.debug('%s.__init__()' % self.__class__.__name__) self._control = carla.VehicleControl() self._actor = actor self._steer_value = steer_value self._throttle_value = throttle_value <|end_body_0|> <|b...
This class contains an atomic jitter behavior. To add noise to steer as well as throttle of the vehicle. Important parameters: - actor: CARLA actor to execute the behavior - steer_value: Applied steering noise in [0,1] - throttle_value: Applied throttle noise in [0,1] The behavior terminates after setting the new actor...
AddNoiseToVehicle
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AddNoiseToVehicle: """This class contains an atomic jitter behavior. To add noise to steer as well as throttle of the vehicle. Important parameters: - actor: CARLA actor to execute the behavior - steer_value: Applied steering noise in [0,1] - throttle_value: Applied throttle noise in [0,1] The be...
stack_v2_sparse_classes_36k_train_001025
39,839
permissive
[ { "docstring": "Setup actor , maximum steer value and throttle value", "name": "__init__", "signature": "def __init__(self, actor, steer_value, throttle_value, name='Jittering')" }, { "docstring": "Set steer to steer_value and throttle to throttle_value until reaching full stop", "name": "up...
2
null
Implement the Python class `AddNoiseToVehicle` described below. Class description: This class contains an atomic jitter behavior. To add noise to steer as well as throttle of the vehicle. Important parameters: - actor: CARLA actor to execute the behavior - steer_value: Applied steering noise in [0,1] - throttle_value:...
Implement the Python class `AddNoiseToVehicle` described below. Class description: This class contains an atomic jitter behavior. To add noise to steer as well as throttle of the vehicle. Important parameters: - actor: CARLA actor to execute the behavior - steer_value: Applied steering noise in [0,1] - throttle_value:...
8ab0894b92e1f994802a218002021ee075c405bf
<|skeleton|> class AddNoiseToVehicle: """This class contains an atomic jitter behavior. To add noise to steer as well as throttle of the vehicle. Important parameters: - actor: CARLA actor to execute the behavior - steer_value: Applied steering noise in [0,1] - throttle_value: Applied throttle noise in [0,1] The be...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AddNoiseToVehicle: """This class contains an atomic jitter behavior. To add noise to steer as well as throttle of the vehicle. Important parameters: - actor: CARLA actor to execute the behavior - steer_value: Applied steering noise in [0,1] - throttle_value: Applied throttle noise in [0,1] The behavior termin...
the_stack_v2_python_sparse
carla_rllib/carla_rllib-prak_evaluator-carla_rllib-prak_evaluator/carla_rllib/prak_evaluator/srunner/scenarioconfigs/scenariomanager/scenarioatomics/atomic_behaviors.py
TinaMenke/Deep-Reinforcement-Learning
train
9
20d5095d9f428e5cf571296bdb759f3fbbe2c270
[ "if root is None:\n return 0\nres_list = []\nqueue = [root]\nwhile queue:\n res = []\n node_list = []\n for node in queue:\n res.append(node.val)\n if node.children:\n node_list.extend(node.children)\n queue = node_list\n res_list.append(res)\nreturn len(res_list)", "if ...
<|body_start_0|> if root is None: return 0 res_list = [] queue = [root] while queue: res = [] node_list = [] for node in queue: res.append(node.val) if node.children: node_list.extend(node...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxDepth(self, root): """广度优先,层序遍历 :type root: Node :rtype: int""" <|body_0|> def maxDepth2(self, root): """深度优先 :type root: Node :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if root is None: return 0 ...
stack_v2_sparse_classes_36k_train_001026
1,952
no_license
[ { "docstring": "广度优先,层序遍历 :type root: Node :rtype: int", "name": "maxDepth", "signature": "def maxDepth(self, root)" }, { "docstring": "深度优先 :type root: Node :rtype: int", "name": "maxDepth2", "signature": "def maxDepth2(self, root)" } ]
2
stack_v2_sparse_classes_30k_train_000153
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxDepth(self, root): 广度优先,层序遍历 :type root: Node :rtype: int - def maxDepth2(self, root): 深度优先 :type root: Node :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxDepth(self, root): 广度优先,层序遍历 :type root: Node :rtype: int - def maxDepth2(self, root): 深度优先 :type root: Node :rtype: int <|skeleton|> class Solution: def maxDepth(se...
3b13b36f37eb364410b3b5b4f10a1808d8b1111e
<|skeleton|> class Solution: def maxDepth(self, root): """广度优先,层序遍历 :type root: Node :rtype: int""" <|body_0|> def maxDepth2(self, root): """深度优先 :type root: Node :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxDepth(self, root): """广度优先,层序遍历 :type root: Node :rtype: int""" if root is None: return 0 res_list = [] queue = [root] while queue: res = [] node_list = [] for node in queue: res.append(nod...
the_stack_v2_python_sparse
leetcode/559.py
yanggelinux/algorithm-data-structure
train
0
c7ebeb7082d5ebac1e4aca2f8b739b0b030e0694
[ "try:\n payload = jwt.decode(data, settings.SECRET_KEY, algorithm=['HS256'])\nexcept jwt.ExpiredSignatureError:\n raise serializers.ValidationError('Verificacion link has expired')\nexcept jwt.PyJWTError:\n raise serializers.ValidationError('Invalid token')\nif payload['type'] != 'email_confirmation':\n ...
<|body_start_0|> try: payload = jwt.decode(data, settings.SECRET_KEY, algorithm=['HS256']) except jwt.ExpiredSignatureError: raise serializers.ValidationError('Verificacion link has expired') except jwt.PyJWTError: raise serializers.ValidationError('Invalid to...
Account verification serializer
AccountVerificationSerializer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AccountVerificationSerializer: """Account verification serializer""" def validate_token(self, data): """Verify token is valid""" <|body_0|> def save(self): """Update users verified status""" <|body_1|> <|end_skeleton|> <|body_start_0|> try: ...
stack_v2_sparse_classes_36k_train_001027
5,109
no_license
[ { "docstring": "Verify token is valid", "name": "validate_token", "signature": "def validate_token(self, data)" }, { "docstring": "Update users verified status", "name": "save", "signature": "def save(self)" } ]
2
stack_v2_sparse_classes_30k_train_006253
Implement the Python class `AccountVerificationSerializer` described below. Class description: Account verification serializer Method signatures and docstrings: - def validate_token(self, data): Verify token is valid - def save(self): Update users verified status
Implement the Python class `AccountVerificationSerializer` described below. Class description: Account verification serializer Method signatures and docstrings: - def validate_token(self, data): Verify token is valid - def save(self): Update users verified status <|skeleton|> class AccountVerificationSerializer: ...
0cede53169041667bd40bbce3c4774af84ffc2fa
<|skeleton|> class AccountVerificationSerializer: """Account verification serializer""" def validate_token(self, data): """Verify token is valid""" <|body_0|> def save(self): """Update users verified status""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AccountVerificationSerializer: """Account verification serializer""" def validate_token(self, data): """Verify token is valid""" try: payload = jwt.decode(data, settings.SECRET_KEY, algorithm=['HS256']) except jwt.ExpiredSignatureError: raise serializers.Va...
the_stack_v2_python_sparse
users/serializers/users.py
KrystellCR/DjangoRF
train
0
84f0181cd48491109c751a518356c6176ca7c44e
[ "super(Inclusive, self).__init__()\ninclusivespec = cfnlint.helpers.load_resource(AdditionalSpecs, 'Inclusive.json')\nself.resource_types_specs = inclusivespec['ResourceTypes']\nself.property_types_specs = inclusivespec['PropertyTypes']\nfor resource_type_spec in self.resource_types_specs:\n self.resource_proper...
<|body_start_0|> super(Inclusive, self).__init__() inclusivespec = cfnlint.helpers.load_resource(AdditionalSpecs, 'Inclusive.json') self.resource_types_specs = inclusivespec['ResourceTypes'] self.property_types_specs = inclusivespec['PropertyTypes'] for resource_type_spec in self...
Check Properties Resource Configuration
Inclusive
[ "MIT-0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Inclusive: """Check Properties Resource Configuration""" def __init__(self): """Init""" <|body_0|> def check(self, properties, inclusions, path, cfn): """Check itself""" <|body_1|> def match_resource_sub_properties(self, properties, property_type, pa...
stack_v2_sparse_classes_36k_train_001028
3,327
permissive
[ { "docstring": "Init", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Check itself", "name": "check", "signature": "def check(self, properties, inclusions, path, cfn)" }, { "docstring": "Match for sub properties", "name": "match_resource_sub_properti...
4
null
Implement the Python class `Inclusive` described below. Class description: Check Properties Resource Configuration Method signatures and docstrings: - def __init__(self): Init - def check(self, properties, inclusions, path, cfn): Check itself - def match_resource_sub_properties(self, properties, property_type, path, ...
Implement the Python class `Inclusive` described below. Class description: Check Properties Resource Configuration Method signatures and docstrings: - def __init__(self): Init - def check(self, properties, inclusions, path, cfn): Check itself - def match_resource_sub_properties(self, properties, property_type, path, ...
5176573c2f4cb7313998b4bc0bcb0716b58ea380
<|skeleton|> class Inclusive: """Check Properties Resource Configuration""" def __init__(self): """Init""" <|body_0|> def check(self, properties, inclusions, path, cfn): """Check itself""" <|body_1|> def match_resource_sub_properties(self, properties, property_type, pa...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Inclusive: """Check Properties Resource Configuration""" def __init__(self): """Init""" super(Inclusive, self).__init__() inclusivespec = cfnlint.helpers.load_resource(AdditionalSpecs, 'Inclusive.json') self.resource_types_specs = inclusivespec['ResourceTypes'] sel...
the_stack_v2_python_sparse
src/cfnlint/rules/resources/properties/Inclusive.py
rene84/cfn-python-lint
train
1
5d88a606103eced4a00d2ac8bd19e6b727ff1827
[ "sleep(2)\nslot1_number = SC.PUBLIC_SLOT1_PHONE_NUMBER\nhold_time = int(SC.PRIVATE_PHONE_CALL_TIME)\nno_answer_wait_time = int(SC.PRIVATE_PHONE_NO_ANSWER_WAIT_TIME)\ninterval_time = hold_time + no_answer_wait_time + 15\ncall_repeat_times = int(SC.PRIVATE_PHONE_CALL_REPEAT_TIMES)\ndefine_case_success_times = int(SC....
<|body_start_0|> sleep(2) slot1_number = SC.PUBLIC_SLOT1_PHONE_NUMBER hold_time = int(SC.PRIVATE_PHONE_CALL_TIME) no_answer_wait_time = int(SC.PRIVATE_PHONE_NO_ANSWER_WAIT_TIME) interval_time = hold_time + no_answer_wait_time + 15 call_repeat_times = int(SC.PRIVATE_PHONE_...
test_suit_phone_case3 is a class for phone case. @see: L{TestCaseBase <TestCaseBase>}
test_suit_phone_case3
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class test_suit_phone_case3: """test_suit_phone_case3 is a class for phone case. @see: L{TestCaseBase <TestCaseBase>}""" def test_case_main(self, case_results): """main entry. @type case_results: tuple @param case_results: record some case result information""" <|body_0|> def ...
stack_v2_sparse_classes_36k_train_001029
3,571
no_license
[ { "docstring": "main entry. @type case_results: tuple @param case_results: record some case result information", "name": "test_case_main", "signature": "def test_case_main(self, case_results)" }, { "docstring": "record the case result", "name": "test_case_end", "signature": "def test_cas...
2
null
Implement the Python class `test_suit_phone_case3` described below. Class description: test_suit_phone_case3 is a class for phone case. @see: L{TestCaseBase <TestCaseBase>} Method signatures and docstrings: - def test_case_main(self, case_results): main entry. @type case_results: tuple @param case_results: record som...
Implement the Python class `test_suit_phone_case3` described below. Class description: test_suit_phone_case3 is a class for phone case. @see: L{TestCaseBase <TestCaseBase>} Method signatures and docstrings: - def test_case_main(self, case_results): main entry. @type case_results: tuple @param case_results: record som...
a04b717ae437511abae1e7e9e399373c161a7b65
<|skeleton|> class test_suit_phone_case3: """test_suit_phone_case3 is a class for phone case. @see: L{TestCaseBase <TestCaseBase>}""" def test_case_main(self, case_results): """main entry. @type case_results: tuple @param case_results: record some case result information""" <|body_0|> def ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class test_suit_phone_case3: """test_suit_phone_case3 is a class for phone case. @see: L{TestCaseBase <TestCaseBase>}""" def test_case_main(self, case_results): """main entry. @type case_results: tuple @param case_results: record some case result information""" sleep(2) slot1_number = S...
the_stack_v2_python_sparse
test_env/test_suit_phone/test_suit_phone_case3.py
wwlwwlqaz/Qualcomm
train
1
15a33f3fd93703409a0fe7597f24a7ee84e5a6f6
[ "if self.is_active(global_step):\n tic = self._compute(global_step, params, batch_loss).item()\n if self._verbose:\n print(f'[Step {global_step}] TICDiag: {tic:.4f}')\n self.output[global_step]['tic_diag'] = tic\n if self._check:\n self.__run_check(global_step, params, batch_loss)", "sum...
<|body_start_0|> if self.is_active(global_step): tic = self._compute(global_step, params, batch_loss).item() if self._verbose: print(f'[Step {global_step}] TICDiag: {tic:.4f}') self.output[global_step]['tic_diag'] = tic if self._check: ...
TIC with diagonal curvature approximation for cheap inversion.
TICDiag
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TICDiag: """TIC with diagonal curvature approximation for cheap inversion.""" def compute(self, global_step, params, batch_loss): """Compute the TICDiag. Args: global_step (int): The current iteration number. params ([torch.Tensor]): List of torch.Tensors holding the network's parame...
stack_v2_sparse_classes_36k_train_001030
9,326
permissive
[ { "docstring": "Compute the TICDiag. Args: global_step (int): The current iteration number. params ([torch.Tensor]): List of torch.Tensors holding the network's parameters. batch_loss (torch.Tensor): Mini-batch loss from current step.", "name": "compute", "signature": "def compute(self, global_step, par...
3
stack_v2_sparse_classes_30k_train_004761
Implement the Python class `TICDiag` described below. Class description: TIC with diagonal curvature approximation for cheap inversion. Method signatures and docstrings: - def compute(self, global_step, params, batch_loss): Compute the TICDiag. Args: global_step (int): The current iteration number. params ([torch.Ten...
Implement the Python class `TICDiag` described below. Class description: TIC with diagonal curvature approximation for cheap inversion. Method signatures and docstrings: - def compute(self, global_step, params, batch_loss): Compute the TICDiag. Args: global_step (int): The current iteration number. params ([torch.Ten...
5bd5ab3cda03eda0b0bf276f29d5c28b83d70b06
<|skeleton|> class TICDiag: """TIC with diagonal curvature approximation for cheap inversion.""" def compute(self, global_step, params, batch_loss): """Compute the TICDiag. Args: global_step (int): The current iteration number. params ([torch.Tensor]): List of torch.Tensors holding the network's parame...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TICDiag: """TIC with diagonal curvature approximation for cheap inversion.""" def compute(self, global_step, params, batch_loss): """Compute the TICDiag. Args: global_step (int): The current iteration number. params ([torch.Tensor]): List of torch.Tensors holding the network's parameters. batch_l...
the_stack_v2_python_sparse
cockpit/quantities/tic.py
MeNicefellow/cockpit
train
0
96be437b242dfe48977008a9770755fb83548c87
[ "self.win = grid.win\nself.grid = grid\nself.row = row\nself.col = col\nself.value = value\nul, lr = grid.tile_corners(row, col)\nbackground = graphics.Rectangle(ul, lr)\nbackground.setFill(RAMP[value])\nbackground.setOutline(TILE_OUTLINE_NEW)\nself.background = background\ncx = (ul.getX() + lr.getX()) / 2.0\ncy = ...
<|body_start_0|> self.win = grid.win self.grid = grid self.row = row self.col = col self.value = value ul, lr = grid.tile_corners(row, col) background = graphics.Rectangle(ul, lr) background.setFill(RAMP[value]) background.setOutline(TILE_OUTLINE_N...
A tile is the thing with a number that slides around the grid
Tile
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Tile: """A tile is the thing with a number that slides around the grid""" def __init__(self, grid, row, col, value=2): """Display the tile on the grid. Internally there are actually two graphics objects: A background rectangle and text within it. The background rectangle has a visibl...
stack_v2_sparse_classes_36k_train_001031
7,288
no_license
[ { "docstring": "Display the tile on the grid. Internally there are actually two graphics objects: A background rectangle and text within it. The background rectangle has a visible outline until the first time it moves.", "name": "__init__", "signature": "def __init__(self, grid, row, col, value=2)" },...
3
stack_v2_sparse_classes_30k_train_004705
Implement the Python class `Tile` described below. Class description: A tile is the thing with a number that slides around the grid Method signatures and docstrings: - def __init__(self, grid, row, col, value=2): Display the tile on the grid. Internally there are actually two graphics objects: A background rectangle ...
Implement the Python class `Tile` described below. Class description: A tile is the thing with a number that slides around the grid Method signatures and docstrings: - def __init__(self, grid, row, col, value=2): Display the tile on the grid. Internally there are actually two graphics objects: A background rectangle ...
559f81086bd3495348aa605da66117cb0fbc7277
<|skeleton|> class Tile: """A tile is the thing with a number that slides around the grid""" def __init__(self, grid, row, col, value=2): """Display the tile on the grid. Internally there are actually two graphics objects: A background rectangle and text within it. The background rectangle has a visibl...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Tile: """A tile is the thing with a number that slides around the grid""" def __init__(self, grid, row, col, value=2): """Display the tile on the grid. Internally there are actually two graphics objects: A background rectangle and text within it. The background rectangle has a visible outline unt...
the_stack_v2_python_sparse
CIS 211 - CS II/Proj 3 - FiveTwelve-master/view.py
noahtigner/UO-ComputerScience-DataScience
train
3
687f63423d7be487d2047d7ce4d0d016350369ce
[ "self._logger = logging.getLogger(__name__)\nself.temp_file = str(uuid.uuid4()) + '.tar.gz'\nself.source_gzip = os.path.join(temp_folder, self.temp_file)", "if not (os.path.exists(source_dir_path) and os.access(source_dir_path, os.R_OK)):\n raise MLOpsException('Path: {} does not exist or not readable'.format(...
<|body_start_0|> self._logger = logging.getLogger(__name__) self.temp_file = str(uuid.uuid4()) + '.tar.gz' self.source_gzip = os.path.join(temp_folder, self.temp_file) <|end_body_0|> <|body_start_1|> if not (os.path.exists(source_dir_path) and os.access(source_dir_path, os.R_OK)): ...
Provides API to pack a folder as tar gz archive. This is an internal class which should not be exposed to users of MLOps.
DirectoryPack
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DirectoryPack: """Provides API to pack a folder as tar gz archive. This is an internal class which should not be exposed to users of MLOps.""" def __init__(self, temp_folder='/tmp'): """Perform initialization of the DirectoryPack. :param temp_folder: folder to save a tar gz file :ret...
stack_v2_sparse_classes_36k_train_001032
2,096
permissive
[ { "docstring": "Perform initialization of the DirectoryPack. :param temp_folder: folder to save a tar gz file :return:", "name": "__init__", "signature": "def __init__(self, temp_folder='/tmp')" }, { "docstring": "Packs a folder :param source_dir_path: folder to pack :return: path to created tar...
3
stack_v2_sparse_classes_30k_train_000086
Implement the Python class `DirectoryPack` described below. Class description: Provides API to pack a folder as tar gz archive. This is an internal class which should not be exposed to users of MLOps. Method signatures and docstrings: - def __init__(self, temp_folder='/tmp'): Perform initialization of the DirectoryPa...
Implement the Python class `DirectoryPack` described below. Class description: Provides API to pack a folder as tar gz archive. This is an internal class which should not be exposed to users of MLOps. Method signatures and docstrings: - def __init__(self, temp_folder='/tmp'): Perform initialization of the DirectoryPa...
738356ce6d5e691a5d813acafa3f0ff730e76136
<|skeleton|> class DirectoryPack: """Provides API to pack a folder as tar gz archive. This is an internal class which should not be exposed to users of MLOps.""" def __init__(self, temp_folder='/tmp'): """Perform initialization of the DirectoryPack. :param temp_folder: folder to save a tar gz file :ret...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DirectoryPack: """Provides API to pack a folder as tar gz archive. This is an internal class which should not be exposed to users of MLOps.""" def __init__(self, temp_folder='/tmp'): """Perform initialization of the DirectoryPack. :param temp_folder: folder to save a tar gz file :return:""" ...
the_stack_v2_python_sparse
mlops/parallelm/mlops/packer.py
theromis/mlpiper
train
0
ca569650d5c812c2bf3e2bd042061bbacbb3965b
[ "if R <= 1:\n sys.exit('Error: you must initialize R>0.')\nif R > 300000000.0:\n sys.exit('Error: R^2 too large for double format.')\nelse:\n self.R = R\n self.Rvar = 4 * R ** 2 / 3\n self.minN = math.ceil(R / math.sqrt(3))\n self.maxN = math.floor(2 * R / 3)", "if a < 0:\n sys.exit('Error: w...
<|body_start_0|> if R <= 1: sys.exit('Error: you must initialize R>0.') if R > 300000000.0: sys.exit('Error: R^2 too large for double format.') else: self.R = R self.Rvar = 4 * R ** 2 / 3 self.minN = math.ceil(R / math.sqrt(3)) ...
Rotated Ellipse satisfying a^2+b^2+ab=R^2/3. (a,b) cell address of unit-side honeycomb N=a+b cell column index
RotatedEllipse
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RotatedEllipse: """Rotated Ellipse satisfying a^2+b^2+ab=R^2/3. (a,b) cell address of unit-side honeycomb N=a+b cell column index""" def __init__(self, R): """Set initial radius, R""" <|body_0|> def b(self, a): """Compute b=sqrt(4R^2/3-3a^2)/2-a""" <|body...
stack_v2_sparse_classes_36k_train_001033
1,436
permissive
[ { "docstring": "Set initial radius, R", "name": "__init__", "signature": "def __init__(self, R)" }, { "docstring": "Compute b=sqrt(4R^2/3-3a^2)/2-a", "name": "b", "signature": "def b(self, a)" } ]
2
stack_v2_sparse_classes_30k_train_011319
Implement the Python class `RotatedEllipse` described below. Class description: Rotated Ellipse satisfying a^2+b^2+ab=R^2/3. (a,b) cell address of unit-side honeycomb N=a+b cell column index Method signatures and docstrings: - def __init__(self, R): Set initial radius, R - def b(self, a): Compute b=sqrt(4R^2/3-3a^2)/...
Implement the Python class `RotatedEllipse` described below. Class description: Rotated Ellipse satisfying a^2+b^2+ab=R^2/3. (a,b) cell address of unit-side honeycomb N=a+b cell column index Method signatures and docstrings: - def __init__(self, R): Set initial radius, R - def b(self, a): Compute b=sqrt(4R^2/3-3a^2)/...
af88bdeded262bce42d52f309075b036cc638880
<|skeleton|> class RotatedEllipse: """Rotated Ellipse satisfying a^2+b^2+ab=R^2/3. (a,b) cell address of unit-side honeycomb N=a+b cell column index""" def __init__(self, R): """Set initial radius, R""" <|body_0|> def b(self, a): """Compute b=sqrt(4R^2/3-3a^2)/2-a""" <|body...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RotatedEllipse: """Rotated Ellipse satisfying a^2+b^2+ab=R^2/3. (a,b) cell address of unit-side honeycomb N=a+b cell column index""" def __init__(self, R): """Set initial radius, R""" if R <= 1: sys.exit('Error: you must initialize R>0.') if R > 300000000.0: ...
the_stack_v2_python_sparse
ProjectEuler/honeycomb.py
mbdeaton/BrettCodeProjects
train
2
ee2c16e77bae27854b7f286bbcd6490cc65b4467
[ "dict_q = {}\nheaders = quanta_headers(int_fmt)\ncount = min(int_fmt % 10, len(str_quanta) // 3)\nfor i in range(0, count):\n str_q = str_quanta[i * 3:(i + 1) * 3]\n dict_q[headers[i]] = int(str_q)\nreturn dict_q", "str_quanta = ''\nheaders = quanta_headers(int_fmt)[0:len(dict_q)]\nfor str_q in ['%3d' % dic...
<|body_start_0|> dict_q = {} headers = quanta_headers(int_fmt) count = min(int_fmt % 10, len(str_quanta) // 3) for i in range(0, count): str_q = str_quanta[i * 3:(i + 1) * 3] dict_q[headers[i]] = int(str_q) return dict_q <|end_body_0|> <|body_start_1|> ...
Manages entries of .egy files.
EgyConverter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EgyConverter: """Manages entries of .egy files.""" def __read_quanta(str_quanta, int_fmt): """convert quanta from .egy to dict""" <|body_0|> def __write_quanta(dict_q, int_fmt): """convert quanta from dict to .egy str""" <|body_1|> def str2state(str_...
stack_v2_sparse_classes_36k_train_001034
11,597
no_license
[ { "docstring": "convert quanta from .egy to dict", "name": "__read_quanta", "signature": "def __read_quanta(str_quanta, int_fmt)" }, { "docstring": "convert quanta from dict to .egy str", "name": "__write_quanta", "signature": "def __write_quanta(dict_q, int_fmt)" }, { "docstring...
4
stack_v2_sparse_classes_30k_train_016318
Implement the Python class `EgyConverter` described below. Class description: Manages entries of .egy files. Method signatures and docstrings: - def __read_quanta(str_quanta, int_fmt): convert quanta from .egy to dict - def __write_quanta(dict_q, int_fmt): convert quanta from dict to .egy str - def str2state(str_stat...
Implement the Python class `EgyConverter` described below. Class description: Manages entries of .egy files. Method signatures and docstrings: - def __read_quanta(str_quanta, int_fmt): convert quanta from .egy to dict - def __write_quanta(dict_q, int_fmt): convert quanta from dict to .egy str - def str2state(str_stat...
57bda76b211c8efd3bd24bd2895bd57ea855003e
<|skeleton|> class EgyConverter: """Manages entries of .egy files.""" def __read_quanta(str_quanta, int_fmt): """convert quanta from .egy to dict""" <|body_0|> def __write_quanta(dict_q, int_fmt): """convert quanta from dict to .egy str""" <|body_1|> def str2state(str_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EgyConverter: """Manages entries of .egy files.""" def __read_quanta(str_quanta, int_fmt): """convert quanta from .egy to dict""" dict_q = {} headers = quanta_headers(int_fmt) count = min(int_fmt % 10, len(str_quanta) // 3) for i in range(0, count): str...
the_stack_v2_python_sparse
pickett/converters.py
kiraboris/scanner
train
0
f841bbd7e7c9a9ec4c96e9e92ce8c41b201d5da3
[ "logger.info('开始获取token的url地址:')\nself.url = KFPT_IP + ':' + PORT1 + '/pm-oauth/oauth/token'\nlogger.info('获取token的url地址为:{}'.format(self.url))", "params = {'grant_type': grant_type, 'username': data['username'], 'password': data['password'], 'client_id': client_id, 'client_secret': client_secret}\nlogger.info('准...
<|body_start_0|> logger.info('开始获取token的url地址:') self.url = KFPT_IP + ':' + PORT1 + '/pm-oauth/oauth/token' logger.info('获取token的url地址为:{}'.format(self.url)) <|end_body_0|> <|body_start_1|> params = {'grant_type': grant_type, 'username': data['username'], 'password': data['password'], '...
ApiGetToken
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ApiGetToken: def __init__(self): """todo 初始化""" <|body_0|> def get_token(self, session, data): """todo 对获取token接口进行自动化操作,并根据响应获取返回值中的”access_token“值 data: 动态传参,由于用户名和密码是动态的其他参数都是固定的,这里只需要动态传用户名和密码""" <|body_1|> def get_token_success(self, session): ...
stack_v2_sparse_classes_36k_train_001035
3,125
no_license
[ { "docstring": "todo 初始化", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "todo 对获取token接口进行自动化操作,并根据响应获取返回值中的”access_token“值 data: 动态传参,由于用户名和密码是动态的其他参数都是固定的,这里只需要动态传用户名和密码", "name": "get_token", "signature": "def get_token(self, session, data)" }, { "do...
3
stack_v2_sparse_classes_30k_train_010299
Implement the Python class `ApiGetToken` described below. Class description: Implement the ApiGetToken class. Method signatures and docstrings: - def __init__(self): todo 初始化 - def get_token(self, session, data): todo 对获取token接口进行自动化操作,并根据响应获取返回值中的”access_token“值 data: 动态传参,由于用户名和密码是动态的其他参数都是固定的,这里只需要动态传用户名和密码 - def ...
Implement the Python class `ApiGetToken` described below. Class description: Implement the ApiGetToken class. Method signatures and docstrings: - def __init__(self): todo 初始化 - def get_token(self, session, data): todo 对获取token接口进行自动化操作,并根据响应获取返回值中的”access_token“值 data: 动态传参,由于用户名和密码是动态的其他参数都是固定的,这里只需要动态传用户名和密码 - def ...
5a2e26de65097827482dc7cc02b579d866e3a3c5
<|skeleton|> class ApiGetToken: def __init__(self): """todo 初始化""" <|body_0|> def get_token(self, session, data): """todo 对获取token接口进行自动化操作,并根据响应获取返回值中的”access_token“值 data: 动态传参,由于用户名和密码是动态的其他参数都是固定的,这里只需要动态传用户名和密码""" <|body_1|> def get_token_success(self, session): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ApiGetToken: def __init__(self): """todo 初始化""" logger.info('开始获取token的url地址:') self.url = KFPT_IP + ':' + PORT1 + '/pm-oauth/oauth/token' logger.info('获取token的url地址为:{}'.format(self.url)) def get_token(self, session, data): """todo 对获取token接口进行自动化操作,并根据响应获取返回值中的”a...
the_stack_v2_python_sparse
api/api_get_token.py
zuochen0806/icdm_Interface
train
0
8b1e6b5431e8dfdc593dd53cca768c42e8f4e2b8
[ "if not head:\n return True\ncur = head\nvalues = []\nwhile cur:\n values.append(cur.val)\n cur = cur.next\nif values == values[::-1]:\n return True\nelse:\n return False", "fast = slow = head\nwhile fast and fast.next:\n fast = fast.next.next\n slow = slow.next\nnode = None\nwhile slow:\n ...
<|body_start_0|> if not head: return True cur = head values = [] while cur: values.append(cur.val) cur = cur.next if values == values[::-1]: return True else: return False <|end_body_0|> <|body_start_1|> ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def isPalindrome(self, head): """:type head: ListNode :rtype: bool""" <|body_0|> def isPalindrome2(self, head): """:type head: ListNode :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not head: return True ...
stack_v2_sparse_classes_36k_train_001036
1,364
no_license
[ { "docstring": ":type head: ListNode :rtype: bool", "name": "isPalindrome", "signature": "def isPalindrome(self, head)" }, { "docstring": ":type head: ListNode :rtype: bool", "name": "isPalindrome2", "signature": "def isPalindrome2(self, head)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def isPalindrome(self, head): :type head: ListNode :rtype: bool - def isPalindrome2(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 isPalindrome(self, head): :type head: ListNode :rtype: bool - def isPalindrome2(self, head): :type head: ListNode :rtype: bool <|skeleton|> class Solution: def isPalind...
0fc4c7af59246e3064db41989a45d9db413a624b
<|skeleton|> class Solution: def isPalindrome(self, head): """:type head: ListNode :rtype: bool""" <|body_0|> def isPalindrome2(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 isPalindrome(self, head): """:type head: ListNode :rtype: bool""" if not head: return True cur = head values = [] while cur: values.append(cur.val) cur = cur.next if values == values[::-1]: return Tru...
the_stack_v2_python_sparse
234. Palindrome Linked List/isPalindrome.py
Macielyoung/LeetCode
train
1
5c35c89a4f1e8eee365fe7636fab6132cc236834
[ "super(Pollution, self).__init__(*args, **kwargs)\nself._host_name = socket.gethostname()\nself._client_random_id = ''.join((random.choice(string.ascii_lowercase) for i in range(4)))\nself._client_id = '[{}]-{}'.format(self._client_random_id, self._host_name)", "print('Start injecting messages ...')\ndata = 0\nwh...
<|body_start_0|> super(Pollution, self).__init__(*args, **kwargs) self._host_name = socket.gethostname() self._client_random_id = ''.join((random.choice(string.ascii_lowercase) for i in range(4))) self._client_id = '[{}]-{}'.format(self._client_random_id, self._host_name) <|end_body_0|> ...
Pollute the `junk` channel.
Pollution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Pollution: """Pollute the `junk` channel.""" def __init__(self, *args, **kwargs): """Initialize the pollution client.""" <|body_0|> async def work(self): """Inject a number in the `junk` channel.""" <|body_1|> <|end_skeleton|> <|body_start_0|> s...
stack_v2_sparse_classes_36k_train_001037
1,054
no_license
[ { "docstring": "Initialize the pollution client.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Inject a number in the `junk` channel.", "name": "work", "signature": "async def work(self)" } ]
2
stack_v2_sparse_classes_30k_train_001687
Implement the Python class `Pollution` described below. Class description: Pollute the `junk` channel. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Initialize the pollution client. - async def work(self): Inject a number in the `junk` channel.
Implement the Python class `Pollution` described below. Class description: Pollute the `junk` channel. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Initialize the pollution client. - async def work(self): Inject a number in the `junk` channel. <|skeleton|> class Pollution: """Pollute ...
40a0aaf9b10cf510eebb16d16e6021fb98ae51bd
<|skeleton|> class Pollution: """Pollute the `junk` channel.""" def __init__(self, *args, **kwargs): """Initialize the pollution client.""" <|body_0|> async def work(self): """Inject a number in the `junk` channel.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Pollution: """Pollute the `junk` channel.""" def __init__(self, *args, **kwargs): """Initialize the pollution client.""" super(Pollution, self).__init__(*args, **kwargs) self._host_name = socket.gethostname() self._client_random_id = ''.join((random.choice(string.ascii_low...
the_stack_v2_python_sparse
nats_overlay_broker/pollution.py
mateimicu/nats-overlay-broker
train
0
0c2cd98161d69fdcdcebda67e9497789e7c637b2
[ "res = []\n\ndef _dfs(root):\n if root:\n res.append(str(root.val))\n _dfs(root.left)\n _dfs(root.right)\n_dfs(root)\nreturn ''.join(res)", "def _build(k, parent):\n if k >= len(data):\n return (None, k)\n root = TreeNode(int(data[k]))\n val = int(data[k + 1])\n parent =...
<|body_start_0|> res = [] def _dfs(root): if root: res.append(str(root.val)) _dfs(root.left) _dfs(root.right) _dfs(root) return ''.join(res) <|end_body_0|> <|body_start_1|> def _build(k, parent): if k >= le...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_001038
2,230
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
stack_v2_sparse_classes_30k_train_020232
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
085b8dfa8e12f7c39107bab60110cd3b182f0c13
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" res = [] def _dfs(root): if root: res.append(str(root.val)) _dfs(root.left) _dfs(root.right) _dfs(root) ...
the_stack_v2_python_sparse
eet/Serialize_and_Deserialize_BST.py
wangyunge/algorithmpractice
train
0
934cf366ac9b71bcf7dabcc9f4804d57eb82f32c
[ "package = handlers.request().package\nuser_to_add = users.User(email)\nif package.has_uploader(user_to_add):\n handlers.http_error(400, \"User '%s' is already an uploader for package '%s'.\" % (email, package.name))\npackage.uploaders.append(user_to_add)\npackage.put()\nreturn handlers.json_success(\"'%s' added...
<|body_start_0|> package = handlers.request().package user_to_add = users.User(email) if package.has_uploader(user_to_add): handlers.http_error(400, "User '%s' is already an uploader for package '%s'." % (email, package.name)) package.uploaders.append(user_to_add) pac...
The handler for /api/packages/*/uploaders/*.
PackageUploaders
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PackageUploaders: """The handler for /api/packages/*/uploaders/*.""" def create(self, package_id, email): """Add a new uploader for this package. Only other uploaders may add new uploaders.""" <|body_0|> def delete(self, package_id, id, format=None): """Delete on...
stack_v2_sparse_classes_36k_train_001039
2,401
permissive
[ { "docstring": "Add a new uploader for this package. Only other uploaders may add new uploaders.", "name": "create", "signature": "def create(self, package_id, email)" }, { "docstring": "Delete one of this package's uploaders. Only uploaders may delete uploaders. If only one uploader remains, th...
2
stack_v2_sparse_classes_30k_train_000061
Implement the Python class `PackageUploaders` described below. Class description: The handler for /api/packages/*/uploaders/*. Method signatures and docstrings: - def create(self, package_id, email): Add a new uploader for this package. Only other uploaders may add new uploaders. - def delete(self, package_id, id, fo...
Implement the Python class `PackageUploaders` described below. Class description: The handler for /api/packages/*/uploaders/*. Method signatures and docstrings: - def create(self, package_id, email): Add a new uploader for this package. Only other uploaders may add new uploaders. - def delete(self, package_id, id, fo...
5701b2a6ef4c94a3026f03e1bbea09cd999e9d88
<|skeleton|> class PackageUploaders: """The handler for /api/packages/*/uploaders/*.""" def create(self, package_id, email): """Add a new uploader for this package. Only other uploaders may add new uploaders.""" <|body_0|> def delete(self, package_id, id, format=None): """Delete on...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PackageUploaders: """The handler for /api/packages/*/uploaders/*.""" def create(self, package_id, email): """Add a new uploader for this package. Only other uploaders may add new uploaders.""" package = handlers.request().package user_to_add = users.User(email) if package....
the_stack_v2_python_sparse
app/handlers/api/package_uploaders.py
tapted/pub-dartlang
train
0
f0eee202a7d54235a3d24e3e083b2fa78f78bcce
[ "if num1 == '0' or num2 == '0':\n return '0'\nl1 = len(num1)\nl2 = len(num2)\nres = '0'\nnum2 = num2[::-1]\nnum1 = num1[::-1]\nfor i in range(l2):\n n2 = num2[i]\n carry = 0\n s = ''\n for j in range(l1):\n n1 = num1[j]\n tmp = int(n1) * int(n2) + carry\n carry = tmp // 10\n ...
<|body_start_0|> if num1 == '0' or num2 == '0': return '0' l1 = len(num1) l2 = len(num2) res = '0' num2 = num2[::-1] num1 = num1[::-1] for i in range(l2): n2 = num2[i] carry = 0 s = '' for j in range(l1):...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def multiply(self, num1, num2): """:type num1: str :type num2: str :rtype: str""" <|body_0|> def addStrings(self, num1, num2): """:type num1: str :type num2: str :rtype: str""" <|body_1|> <|end_skeleton|> <|body_start_0|> if num1 == '0' or...
stack_v2_sparse_classes_36k_train_001040
1,654
no_license
[ { "docstring": ":type num1: str :type num2: str :rtype: str", "name": "multiply", "signature": "def multiply(self, num1, num2)" }, { "docstring": ":type num1: str :type num2: str :rtype: str", "name": "addStrings", "signature": "def addStrings(self, num1, num2)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def multiply(self, num1, num2): :type num1: str :type num2: str :rtype: str - def addStrings(self, num1, num2): :type num1: str :type num2: str :rtype: str
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def multiply(self, num1, num2): :type num1: str :type num2: str :rtype: str - def addStrings(self, num1, num2): :type num1: str :type num2: str :rtype: str <|skeleton|> class So...
b049816905f3ea19707577d07f4b414147da3cfb
<|skeleton|> class Solution: def multiply(self, num1, num2): """:type num1: str :type num2: str :rtype: str""" <|body_0|> def addStrings(self, num1, num2): """:type num1: str :type num2: str :rtype: str""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def multiply(self, num1, num2): """:type num1: str :type num2: str :rtype: str""" if num1 == '0' or num2 == '0': return '0' l1 = len(num1) l2 = len(num2) res = '0' num2 = num2[::-1] num1 = num1[::-1] for i in range(l2): ...
the_stack_v2_python_sparse
0043multiply.py
mondon11/leetcode
train
0
c6ca08765c9a4de633916902e384d1b66479a6bb
[ "if self.isEmpty():\n self._head = self._Item(k, v)\n self._tail = self._head\n return\nitem = self._Item(k, v)\nwalk = self._head\nwhile walk.getNext():\n if walk.getNext().getVal() >= item.getVal():\n break\n walk = walk.getNext()\nitem.setNext(walk.getNext())\nwalk.setNext(item)", "item =...
<|body_start_0|> if self.isEmpty(): self._head = self._Item(k, v) self._tail = self._head return item = self._Item(k, v) walk = self._head while walk.getNext(): if walk.getNext().getVal() >= item.getVal(): break ...
A min-oriented priority queue implemented with an unsorted list
SortedPriorityQueue
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SortedPriorityQueue: """A min-oriented priority queue implemented with an unsorted list""" def add(self, k, v): """Add a key-value pair (unsorted order)""" <|body_0|> def min_(self): """Return but do not remove (k,v) tuple with minimun key""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_001041
4,764
no_license
[ { "docstring": "Add a key-value pair (unsorted order)", "name": "add", "signature": "def add(self, k, v)" }, { "docstring": "Return but do not remove (k,v) tuple with minimun key", "name": "min_", "signature": "def min_(self)" }, { "docstring": "Remove and return (k,v) tuple with...
3
stack_v2_sparse_classes_30k_val_000218
Implement the Python class `SortedPriorityQueue` described below. Class description: A min-oriented priority queue implemented with an unsorted list Method signatures and docstrings: - def add(self, k, v): Add a key-value pair (unsorted order) - def min_(self): Return but do not remove (k,v) tuple with minimun key - ...
Implement the Python class `SortedPriorityQueue` described below. Class description: A min-oriented priority queue implemented with an unsorted list Method signatures and docstrings: - def add(self, k, v): Add a key-value pair (unsorted order) - def min_(self): Return but do not remove (k,v) tuple with minimun key - ...
783daaca7c9b716f080df43c7aa581add3b86a46
<|skeleton|> class SortedPriorityQueue: """A min-oriented priority queue implemented with an unsorted list""" def add(self, k, v): """Add a key-value pair (unsorted order)""" <|body_0|> def min_(self): """Return but do not remove (k,v) tuple with minimun key""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SortedPriorityQueue: """A min-oriented priority queue implemented with an unsorted list""" def add(self, k, v): """Add a key-value pair (unsorted order)""" if self.isEmpty(): self._head = self._Item(k, v) self._tail = self._head return item = se...
the_stack_v2_python_sparse
labs/P-QueueBase.py
pithecuse527/Algorithms-MUN
train
4
ea2abb05e7b0dc9927ed6bf05e6f00404c80a095
[ "self.model = K.models.load_model(model_path)\nwith open(classes_path, 'r') as f:\n data = f.read()\nself.class_names = data.split()\nself.class_t = class_t\nself.nms_t = nms_t\nself.anchors = anchors", "boxes = [output[:, :, :, 0:4] for output in outputs]\nfor oidx, output in enumerate(boxes):\n for y in r...
<|body_start_0|> self.model = K.models.load_model(model_path) with open(classes_path, 'r') as f: data = f.read() self.class_names = data.split() self.class_t = class_t self.nms_t = nms_t self.anchors = anchors <|end_body_0|> <|body_start_1|> boxes = [...
Yolo v3 algorithm
Yolo
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Yolo: """Yolo v3 algorithm""" def __init__(self, model_path, classes_path, class_t, nms_t, anchors): """class constructor""" <|body_0|> def process_outputs(self, outputs, image_size): """Process Darknet outputs""" <|body_1|> <|end_skeleton|> <|body_star...
stack_v2_sparse_classes_36k_train_001042
2,207
no_license
[ { "docstring": "class constructor", "name": "__init__", "signature": "def __init__(self, model_path, classes_path, class_t, nms_t, anchors)" }, { "docstring": "Process Darknet outputs", "name": "process_outputs", "signature": "def process_outputs(self, outputs, image_size)" } ]
2
stack_v2_sparse_classes_30k_train_005893
Implement the Python class `Yolo` described below. Class description: Yolo v3 algorithm Method signatures and docstrings: - def __init__(self, model_path, classes_path, class_t, nms_t, anchors): class constructor - def process_outputs(self, outputs, image_size): Process Darknet outputs
Implement the Python class `Yolo` described below. Class description: Yolo v3 algorithm Method signatures and docstrings: - def __init__(self, model_path, classes_path, class_t, nms_t, anchors): class constructor - def process_outputs(self, outputs, image_size): Process Darknet outputs <|skeleton|> class Yolo: "...
a51fbcb76dae9281ff34ace0fb762ef899b4c380
<|skeleton|> class Yolo: """Yolo v3 algorithm""" def __init__(self, model_path, classes_path, class_t, nms_t, anchors): """class constructor""" <|body_0|> def process_outputs(self, outputs, image_size): """Process Darknet outputs""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Yolo: """Yolo v3 algorithm""" def __init__(self, model_path, classes_path, class_t, nms_t, anchors): """class constructor""" self.model = K.models.load_model(model_path) with open(classes_path, 'r') as f: data = f.read() self.class_names = data.split() ...
the_stack_v2_python_sparse
supervised_learning/0x0A-object_detection/1-yolo.py
Diegokernel/holbertonschool-machine_learning
train
0
651e6dbe6deae95f463dd2e2991942f62c671b31
[ "if any(((lot.lending_lot_type_id.medical_audit or lot.lending_lot_type_id.dental_audit) and lot.state == 'in_progress' for lot in self)):\n raise ValidationError('Los lotes deben ser revisados por la auditoría antes de finalizarlos.')\nreturn super(LendingLot, self).finish_lot()", "for lot in self:\n if lo...
<|body_start_0|> if any(((lot.lending_lot_type_id.medical_audit or lot.lending_lot_type_id.dental_audit) and lot.state == 'in_progress' for lot in self)): raise ValidationError('Los lotes deben ser revisados por la auditoría antes de finalizarlos.') return super(LendingLot, self).finish_lot(...
LendingLot
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LendingLot: def finish_lot(self): """Cambio de estado de lote a finalizado""" <|body_0|> def revised_lot(self): """Cambio de estado de lote a Revisado""" <|body_1|> def unlink(self): """Se redefine la eliminacion de lote""" <|body_2|> <|...
stack_v2_sparse_classes_36k_train_001043
2,197
no_license
[ { "docstring": "Cambio de estado de lote a finalizado", "name": "finish_lot", "signature": "def finish_lot(self)" }, { "docstring": "Cambio de estado de lote a Revisado", "name": "revised_lot", "signature": "def revised_lot(self)" }, { "docstring": "Se redefine la eliminacion de ...
3
null
Implement the Python class `LendingLot` described below. Class description: Implement the LendingLot class. Method signatures and docstrings: - def finish_lot(self): Cambio de estado de lote a finalizado - def revised_lot(self): Cambio de estado de lote a Revisado - def unlink(self): Se redefine la eliminacion de lot...
Implement the Python class `LendingLot` described below. Class description: Implement the LendingLot class. Method signatures and docstrings: - def finish_lot(self): Cambio de estado de lote a finalizado - def revised_lot(self): Cambio de estado de lote a Revisado - def unlink(self): Se redefine la eliminacion de lot...
77921b4d965f2e4c081d523b373eb306a450a873
<|skeleton|> class LendingLot: def finish_lot(self): """Cambio de estado de lote a finalizado""" <|body_0|> def revised_lot(self): """Cambio de estado de lote a Revisado""" <|body_1|> def unlink(self): """Se redefine la eliminacion de lote""" <|body_2|> <|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LendingLot: def finish_lot(self): """Cambio de estado de lote a finalizado""" if any(((lot.lending_lot_type_id.medical_audit or lot.lending_lot_type_id.dental_audit) and lot.state == 'in_progress' for lot in self)): raise ValidationError('Los lotes deben ser revisados por la audito...
the_stack_v2_python_sparse
odoo_addons_customization/lending_medical_audit/models/lending_lot.py
test-odoorosario/opt
train
0
c651747cbea5fc8e3c760d64e20a847004586ec9
[ "ub = self.app.module_map.userbase\nevent = self.barcamp.get_event(eid)\nrooms = event.timetable.get('rooms', [])\ntimeslots = event.timetable.get('timeslots', [])\nsessions = event.timetable.get('sessions', {})\nif self.barcamp.ticketmode_enabled:\n tdb = self.config.dbs.tickets\n tickets = tdb.get_tickets(b...
<|body_start_0|> ub = self.app.module_map.userbase event = self.barcamp.get_event(eid) rooms = event.timetable.get('rooms', []) timeslots = event.timetable.get('timeslots', []) sessions = event.timetable.get('sessions', {}) if self.barcamp.ticketmode_enabled: ...
handles all AJAX related session board data
SessionBoardData
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SessionBoardData: """handles all AJAX related session board data""" def get(self, slug=None, eid=None): """return rooms and timeslots""" <|body_0|> def post(self, slug=None, eid=None): """store room and timetable data""" <|body_1|> <|end_skeleton|> <|bo...
stack_v2_sparse_classes_36k_train_001044
5,339
permissive
[ { "docstring": "return rooms and timeslots", "name": "get", "signature": "def get(self, slug=None, eid=None)" }, { "docstring": "store room and timetable data", "name": "post", "signature": "def post(self, slug=None, eid=None)" } ]
2
null
Implement the Python class `SessionBoardData` described below. Class description: handles all AJAX related session board data Method signatures and docstrings: - def get(self, slug=None, eid=None): return rooms and timeslots - def post(self, slug=None, eid=None): store room and timetable data
Implement the Python class `SessionBoardData` described below. Class description: handles all AJAX related session board data Method signatures and docstrings: - def get(self, slug=None, eid=None): return rooms and timeslots - def post(self, slug=None, eid=None): store room and timetable data <|skeleton|> class Sess...
9b45664e46c451b2cbe00bb55583b043e769083d
<|skeleton|> class SessionBoardData: """handles all AJAX related session board data""" def get(self, slug=None, eid=None): """return rooms and timeslots""" <|body_0|> def post(self, slug=None, eid=None): """store room and timetable data""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SessionBoardData: """handles all AJAX related session board data""" def get(self, slug=None, eid=None): """return rooms and timeslots""" ub = self.app.module_map.userbase event = self.barcamp.get_event(eid) rooms = event.timetable.get('rooms', []) timeslots = event...
the_stack_v2_python_sparse
camper/barcamps/sessionboard.py
comlounge/camper
train
14
eccde246da6de1858ae7c1d888a31f1151cb821c
[ "super(TfdsInput, self).__init__(*args, **kwargs)\nself.dataset_name = dataset_name\nself.split = split\nself.data_dir = data_dir", "if 'image' in value:\n images = value['image']\nelif 'video' in value:\n images = value['video']\nelse:\n raise ValueError('No \"image\" or \"video\" key found in TFDS datu...
<|body_start_0|> super(TfdsInput, self).__init__(*args, **kwargs) self.dataset_name = dataset_name self.split = split self.data_dir = data_dir <|end_body_0|> <|body_start_1|> if 'image' in value: images = value['image'] elif 'video' in value: imag...
Generates an input_fn that works with TFDS datasets.
TfdsInput
[ "Apache-2.0", "CC-BY-4.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TfdsInput: """Generates an input_fn that works with TFDS datasets.""" def __init__(self, dataset_name, split, *args, data_dir=None, **kwargs): """Creates an input_fn for a TFDS dataset. Args: dataset_name: The name of the TFDS dataset, passed as the `name` argument of tfds.load(). sp...
stack_v2_sparse_classes_36k_train_001045
16,226
permissive
[ { "docstring": "Creates an input_fn for a TFDS dataset. Args: dataset_name: The name of the TFDS dataset, passed as the `name` argument of tfds.load(). split: The split name passed as the `split` argument to tfds.load(). *args: Arguments passed on to CommonInput. data_dir: The directory passed as the `data_dir`...
3
stack_v2_sparse_classes_30k_train_018481
Implement the Python class `TfdsInput` described below. Class description: Generates an input_fn that works with TFDS datasets. Method signatures and docstrings: - def __init__(self, dataset_name, split, *args, data_dir=None, **kwargs): Creates an input_fn for a TFDS dataset. Args: dataset_name: The name of the TFDS ...
Implement the Python class `TfdsInput` described below. Class description: Generates an input_fn that works with TFDS datasets. Method signatures and docstrings: - def __init__(self, dataset_name, split, *args, data_dir=None, **kwargs): Creates an input_fn for a TFDS dataset. Args: dataset_name: The name of the TFDS ...
5573d9c5822f4e866b6692769963ae819cb3f10d
<|skeleton|> class TfdsInput: """Generates an input_fn that works with TFDS datasets.""" def __init__(self, dataset_name, split, *args, data_dir=None, **kwargs): """Creates an input_fn for a TFDS dataset. Args: dataset_name: The name of the TFDS dataset, passed as the `name` argument of tfds.load(). sp...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TfdsInput: """Generates an input_fn that works with TFDS datasets.""" def __init__(self, dataset_name, split, *args, data_dir=None, **kwargs): """Creates an input_fn for a TFDS dataset. Args: dataset_name: The name of the TFDS dataset, passed as the `name` argument of tfds.load(). split: The spli...
the_stack_v2_python_sparse
supcon/inputs.py
Jimmy-INL/google-research
train
1
c76a056c9bbde16bc6d50fadcb44081f3c54c2fd
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')" ]
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
Proto file describing the Shared Set service. Service to manage shared sets.
SharedSetServiceServicer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SharedSetServiceServicer: """Proto file describing the Shared Set service. Service to manage shared sets.""" def GetSharedSet(self, request, context): """Returns the requested shared set in full detail.""" <|body_0|> def MutateSharedSets(self, request, context): ...
stack_v2_sparse_classes_36k_train_001046
5,356
permissive
[ { "docstring": "Returns the requested shared set in full detail.", "name": "GetSharedSet", "signature": "def GetSharedSet(self, request, context)" }, { "docstring": "Creates, updates, or removes shared sets. Operation statuses are returned.", "name": "MutateSharedSets", "signature": "def...
2
stack_v2_sparse_classes_30k_train_010525
Implement the Python class `SharedSetServiceServicer` described below. Class description: Proto file describing the Shared Set service. Service to manage shared sets. Method signatures and docstrings: - def GetSharedSet(self, request, context): Returns the requested shared set in full detail. - def MutateSharedSets(s...
Implement the Python class `SharedSetServiceServicer` described below. Class description: Proto file describing the Shared Set service. Service to manage shared sets. Method signatures and docstrings: - def GetSharedSet(self, request, context): Returns the requested shared set in full detail. - def MutateSharedSets(s...
969eff5b6c3cec59d21191fa178cffb6270074c3
<|skeleton|> class SharedSetServiceServicer: """Proto file describing the Shared Set service. Service to manage shared sets.""" def GetSharedSet(self, request, context): """Returns the requested shared set in full detail.""" <|body_0|> def MutateSharedSets(self, request, context): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SharedSetServiceServicer: """Proto file describing the Shared Set service. Service to manage shared sets.""" def GetSharedSet(self, request, context): """Returns the requested shared set in full detail.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method...
the_stack_v2_python_sparse
google/ads/google_ads/v6/proto/services/shared_set_service_pb2_grpc.py
VincentFritzsche/google-ads-python
train
0
3f974777ea280d77a299b0a0076475abc6c06ba2
[ "self.image = pygame.Surface((100, 100))\nself.image.fill(pygame.Color('White'))\nself.rect = self.image.get_rect()", "self.velocity[0] = 10 * (pygame.key.get_pressed()[pygame.K_RIGHT] - pygame.key.get_pressed()[pygame.K_LEFT])\nif not pygame.key.get_pressed()[pygame.K_UP]:\n self.hold = False\nif self.rect.bo...
<|body_start_0|> self.image = pygame.Surface((100, 100)) self.image.fill(pygame.Color('White')) self.rect = self.image.get_rect() <|end_body_0|> <|body_start_1|> self.velocity[0] = 10 * (pygame.key.get_pressed()[pygame.K_RIGHT] - pygame.key.get_pressed()[pygame.K_LEFT]) if not p...
Class for the player's attributes.
Player
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Player: """Class for the player's attributes.""" def __init__(self): """Initialise the player object.""" <|body_0|> def update(self, display): """Check the current situation and update the player to match.""" <|body_1|> <|end_skeleton|> <|body_start_0|>...
stack_v2_sparse_classes_36k_train_001047
1,912
no_license
[ { "docstring": "Initialise the player object.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Check the current situation and update the player to match.", "name": "update", "signature": "def update(self, display)" } ]
2
stack_v2_sparse_classes_30k_train_000663
Implement the Python class `Player` described below. Class description: Class for the player's attributes. Method signatures and docstrings: - def __init__(self): Initialise the player object. - def update(self, display): Check the current situation and update the player to match.
Implement the Python class `Player` described below. Class description: Class for the player's attributes. Method signatures and docstrings: - def __init__(self): Initialise the player object. - def update(self, display): Check the current situation and update the player to match. <|skeleton|> class Player: """C...
e7bbc0f7cfab13a2e16baa4c931d3a412c86277c
<|skeleton|> class Player: """Class for the player's attributes.""" def __init__(self): """Initialise the player object.""" <|body_0|> def update(self, display): """Check the current situation and update the player to match.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Player: """Class for the player's attributes.""" def __init__(self): """Initialise the player object.""" self.image = pygame.Surface((100, 100)) self.image.fill(pygame.Color('White')) self.rect = self.image.get_rect() def update(self, display): """Check the cu...
the_stack_v2_python_sparse
SideScrollSim.py
Chig00/Python
train
1
f302ff91b67f2495e28cceca992ad3117e2a3b54
[ "super(HPMLoss, self).__init__(dataset, None, norm, weight)\nself.hpm_input = hpm_input\nself.hpm_model = hpm_model", "x.requires_grad = True\nprediction_u = model(x)\nhpm_input = self.hpm_input(x, prediction_u)\ntime_derivative = hpm_input[:, -1]\ninput = hpm_input[:, :-1]\nhpm_output = self.hpm_model(input)\nre...
<|body_start_0|> super(HPMLoss, self).__init__(dataset, None, norm, weight) self.hpm_input = hpm_input self.hpm_model = hpm_model <|end_body_0|> <|body_start_1|> x.requires_grad = True prediction_u = model(x) hpm_input = self.hpm_input(x, prediction_u) time_deriv...
HPMLoss
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HPMLoss: def __init__(self, dataset, hpm_input, hpm_model, norm='L2', weight=1.0): """Constructor of the HPM loss Args: dataset (torch.utils.Dataset): dataset that provides the residual points hpm_input(function): function that calculates the needed input for the HPM model. The hpm_input...
stack_v2_sparse_classes_36k_train_001048
1,361
permissive
[ { "docstring": "Constructor of the HPM loss Args: dataset (torch.utils.Dataset): dataset that provides the residual points hpm_input(function): function that calculates the needed input for the HPM model. The hpm_input function should return a list of tensors, where the last entry is the time_derivative hpm_mod...
2
stack_v2_sparse_classes_30k_train_011774
Implement the Python class `HPMLoss` described below. Class description: Implement the HPMLoss class. Method signatures and docstrings: - def __init__(self, dataset, hpm_input, hpm_model, norm='L2', weight=1.0): Constructor of the HPM loss Args: dataset (torch.utils.Dataset): dataset that provides the residual points...
Implement the Python class `HPMLoss` described below. Class description: Implement the HPMLoss class. Method signatures and docstrings: - def __init__(self, dataset, hpm_input, hpm_model, norm='L2', weight=1.0): Constructor of the HPM loss Args: dataset (torch.utils.Dataset): dataset that provides the residual points...
2a6a20bf01bf355476272a0e622085e298d78112
<|skeleton|> class HPMLoss: def __init__(self, dataset, hpm_input, hpm_model, norm='L2', weight=1.0): """Constructor of the HPM loss Args: dataset (torch.utils.Dataset): dataset that provides the residual points hpm_input(function): function that calculates the needed input for the HPM model. The hpm_input...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HPMLoss: def __init__(self, dataset, hpm_input, hpm_model, norm='L2', weight=1.0): """Constructor of the HPM loss Args: dataset (torch.utils.Dataset): dataset that provides the residual points hpm_input(function): function that calculates the needed input for the HPM model. The hpm_input function shou...
the_stack_v2_python_sparse
PINNS/NeuralSolvers/PINNFramework/HPMLoss.py
juesuarezca/PhD_PINNs
train
1
72940c3351ed8d5acead4df7899c98379352d6c8
[ "self.numsIter = iter(nums)\nself._hasNext = None\nself._nextVal = None", "if self._hasNext is None:\n try:\n self._nextVal = next(self.numsIter)\n except StopIteration:\n self._hasNext = False\n else:\n self._hasNext = True\nreturn self._hasNext", "if self._hasNext:\n result = ...
<|body_start_0|> self.numsIter = iter(nums) self._hasNext = None self._nextVal = None <|end_body_0|> <|body_start_1|> if self._hasNext is None: try: self._nextVal = next(self.numsIter) except StopIteration: self._hasNext = False ...
Iterator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Iterator: def __init__(self, nums): """Initializes an iterator object to the beginning of a list. :type nums: List[int]""" <|body_0|> def hasNext(self): """Returns true if the iteration has more elements. :rtype: bool""" <|body_1|> def next(self): ...
stack_v2_sparse_classes_36k_train_001049
6,268
no_license
[ { "docstring": "Initializes an iterator object to the beginning of a list. :type nums: List[int]", "name": "__init__", "signature": "def __init__(self, nums)" }, { "docstring": "Returns true if the iteration has more elements. :rtype: bool", "name": "hasNext", "signature": "def hasNext(s...
3
stack_v2_sparse_classes_30k_train_012299
Implement the Python class `Iterator` described below. Class description: Implement the Iterator class. Method signatures and docstrings: - def __init__(self, nums): Initializes an iterator object to the beginning of a list. :type nums: List[int] - def hasNext(self): Returns true if the iteration has more elements. :...
Implement the Python class `Iterator` described below. Class description: Implement the Iterator class. Method signatures and docstrings: - def __init__(self, nums): Initializes an iterator object to the beginning of a list. :type nums: List[int] - def hasNext(self): Returns true if the iteration has more elements. :...
2d5fa4cd696d5035ea8859befeadc5cc436959c9
<|skeleton|> class Iterator: def __init__(self, nums): """Initializes an iterator object to the beginning of a list. :type nums: List[int]""" <|body_0|> def hasNext(self): """Returns true if the iteration has more elements. :rtype: bool""" <|body_1|> def next(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Iterator: def __init__(self, nums): """Initializes an iterator object to the beginning of a list. :type nums: List[int]""" self.numsIter = iter(nums) self._hasNext = None self._nextVal = None def hasNext(self): """Returns true if the iteration has more elements. :r...
the_stack_v2_python_sparse
SourceCode/Python/Problem/00284.Peeking Iterator.py
roger6blog/LeetCode
train
0
dd11cd6e20e69b2c1173c9ef1e25b4d6a30fd312
[ "self.max_data_reads = cnt_to_reach\nself.curr_data_reads = 0\nself.status_update = status_update", "if self.status_update is True:\n self.curr_data_reads += 1\n log_text = text_to_print + ' ' + str(self.curr_data_reads) + '/' + str(self.max_data_reads) + ' done.'\n Utils.Logger_Instance.logger.info('Sta...
<|body_start_0|> self.max_data_reads = cnt_to_reach self.curr_data_reads = 0 self.status_update = status_update <|end_body_0|> <|body_start_1|> if self.status_update is True: self.curr_data_reads += 1 log_text = text_to_print + ' ' + str(self.curr_data_reads) + '...
StatusUpdate
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StatusUpdate: def __init__(self, cnt_to_reach, status_update=True): """:param cnt_to_reach: number to show the current status, ex: 1/100 stocks read""" <|body_0|> def update_status(self, text_to_print): """update the read status and print it :return:""" <|bod...
stack_v2_sparse_classes_36k_train_001050
737
no_license
[ { "docstring": ":param cnt_to_reach: number to show the current status, ex: 1/100 stocks read", "name": "__init__", "signature": "def __init__(self, cnt_to_reach, status_update=True)" }, { "docstring": "update the read status and print it :return:", "name": "update_status", "signature": ...
2
stack_v2_sparse_classes_30k_train_003240
Implement the Python class `StatusUpdate` described below. Class description: Implement the StatusUpdate class. Method signatures and docstrings: - def __init__(self, cnt_to_reach, status_update=True): :param cnt_to_reach: number to show the current status, ex: 1/100 stocks read - def update_status(self, text_to_prin...
Implement the Python class `StatusUpdate` described below. Class description: Implement the StatusUpdate class. Method signatures and docstrings: - def __init__(self, cnt_to_reach, status_update=True): :param cnt_to_reach: number to show the current status, ex: 1/100 stocks read - def update_status(self, text_to_prin...
b6925f948c5f4a3fa6aedd1cd581e1c62defb305
<|skeleton|> class StatusUpdate: def __init__(self, cnt_to_reach, status_update=True): """:param cnt_to_reach: number to show the current status, ex: 1/100 stocks read""" <|body_0|> def update_status(self, text_to_print): """update the read status and print it :return:""" <|bod...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StatusUpdate: def __init__(self, cnt_to_reach, status_update=True): """:param cnt_to_reach: number to show the current status, ex: 1/100 stocks read""" self.max_data_reads = cnt_to_reach self.curr_data_reads = 0 self.status_update = status_update def update_status(self, te...
the_stack_v2_python_sparse
Utils/StatusUpdate.py
hicode/pythonFinance
train
0
7973725eb750939927e0d0ef6dd74e79938d277a
[ "res = 0\ncnt = 0\nfor i in range(len(nums)):\n if nums[i] == 1:\n cnt += 1\n res = max(res, cnt)\n else:\n cnt = 0\nreturn res", "res = 0\ncnt = 0\nfor i in range(len(nums)):\n if nums[i] == 1:\n cnt += 1\n else:\n res = max(res, cnt)\n cnt = 0\nreturn max(re...
<|body_start_0|> res = 0 cnt = 0 for i in range(len(nums)): if nums[i] == 1: cnt += 1 res = max(res, cnt) else: cnt = 0 return res <|end_body_0|> <|body_start_1|> res = 0 cnt = 0 for i in ran...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findMaxConsecutiveOnes(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findMaxConsecutiveOnes(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def findMaxConsecutiveOnes(self, nums): """:type nums:...
stack_v2_sparse_classes_36k_train_001051
1,411
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "findMaxConsecutiveOnes", "signature": "def findMaxConsecutiveOnes(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "findMaxConsecutiveOnes", "signature": "def findMaxConsecutiveOnes(self, nums)" }, ...
4
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findMaxConsecutiveOnes(self, nums): :type nums: List[int] :rtype: int - def findMaxConsecutiveOnes(self, nums): :type nums: List[int] :rtype: int - def findMaxConsecutiveOnes...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findMaxConsecutiveOnes(self, nums): :type nums: List[int] :rtype: int - def findMaxConsecutiveOnes(self, nums): :type nums: List[int] :rtype: int - def findMaxConsecutiveOnes...
a509b383a42f54313970168d9faa11f088f18708
<|skeleton|> class Solution: def findMaxConsecutiveOnes(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findMaxConsecutiveOnes(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def findMaxConsecutiveOnes(self, nums): """:type nums:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findMaxConsecutiveOnes(self, nums): """:type nums: List[int] :rtype: int""" res = 0 cnt = 0 for i in range(len(nums)): if nums[i] == 1: cnt += 1 res = max(res, cnt) else: cnt = 0 retur...
the_stack_v2_python_sparse
0485_Max_Consecutive_Ones.py
bingli8802/leetcode
train
0
ce5ff41227402d99412c197b2dcfd4a113492449
[ "super(FLAMELayer, self).__init__(*args, **kwargs)\nself.keypoint_src = keypoint_src\nself.keypoint_dst = keypoint_dst\nself.keypoint_approximate = keypoint_approximate\nself.num_verts = self.get_num_verts()\nself.num_faces = self.get_num_faces()\nself.num_joints = get_keypoint_num(convention=self.keypoint_dst)", ...
<|body_start_0|> super(FLAMELayer, self).__init__(*args, **kwargs) self.keypoint_src = keypoint_src self.keypoint_dst = keypoint_dst self.keypoint_approximate = keypoint_approximate self.num_verts = self.get_num_verts() self.num_faces = self.get_num_faces() self.n...
Extension of the official FLAME implementation.
FLAMELayer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FLAMELayer: """Extension of the official FLAME implementation.""" def __init__(self, *args, keypoint_src: str='flame', keypoint_dst: str='human_data', keypoint_approximate: bool=False, **kwargs): """Args: *args: extra arguments for FLAME initialization. keypoint_src: source conventio...
stack_v2_sparse_classes_36k_train_001052
6,673
permissive
[ { "docstring": "Args: *args: extra arguments for FLAME initialization. keypoint_src: source convention of keypoints. This convention is used for keypoints obtained from joint regressors. Keypoints then undergo conversion into keypoint_dst convention. keypoint_dst: destination convention of keypoints. This conve...
2
stack_v2_sparse_classes_30k_train_006547
Implement the Python class `FLAMELayer` described below. Class description: Extension of the official FLAME implementation. Method signatures and docstrings: - def __init__(self, *args, keypoint_src: str='flame', keypoint_dst: str='human_data', keypoint_approximate: bool=False, **kwargs): Args: *args: extra arguments...
Implement the Python class `FLAMELayer` described below. Class description: Extension of the official FLAME implementation. Method signatures and docstrings: - def __init__(self, *args, keypoint_src: str='flame', keypoint_dst: str='human_data', keypoint_approximate: bool=False, **kwargs): Args: *args: extra arguments...
9431addec32f7fbeffa1786927a854c0ab79d9ea
<|skeleton|> class FLAMELayer: """Extension of the official FLAME implementation.""" def __init__(self, *args, keypoint_src: str='flame', keypoint_dst: str='human_data', keypoint_approximate: bool=False, **kwargs): """Args: *args: extra arguments for FLAME initialization. keypoint_src: source conventio...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FLAMELayer: """Extension of the official FLAME implementation.""" def __init__(self, *args, keypoint_src: str='flame', keypoint_dst: str='human_data', keypoint_approximate: bool=False, **kwargs): """Args: *args: extra arguments for FLAME initialization. keypoint_src: source convention of keypoint...
the_stack_v2_python_sparse
mmhuman3d/models/body_models/flame.py
open-mmlab/mmhuman3d
train
966
efdfd77feb771c8d8cc5f65aa9b027ee486c143d
[ "testName = 'meter_to_millimeter'\ntry:\n log.print_test_begin(testName)\n meters = 1\n millimeters = sc_Length.meter_to_millimeter(meters)\n self.assertEquals(millimeters, 1000)\n log.print_test_success(testName)\nexcept:\n log.print_test_failure(testName)\n self.fail(msg=testName[testName.rfi...
<|body_start_0|> testName = 'meter_to_millimeter' try: log.print_test_begin(testName) meters = 1 millimeters = sc_Length.meter_to_millimeter(meters) self.assertEquals(millimeters, 1000) log.print_test_success(testName) except: ...
TestCalculations_length
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestCalculations_length: def meterToMillimeter(self): """Are meters correctly converted to millimeters?""" <|body_0|> def millimeterToMeter(self): """Are millimeters correctly converted to meters?""" <|body_1|> <|end_skeleton|> <|body_start_0|> test...
stack_v2_sparse_classes_36k_train_001053
2,102
permissive
[ { "docstring": "Are meters correctly converted to millimeters?", "name": "meterToMillimeter", "signature": "def meterToMillimeter(self)" }, { "docstring": "Are millimeters correctly converted to meters?", "name": "millimeterToMeter", "signature": "def millimeterToMeter(self)" } ]
2
stack_v2_sparse_classes_30k_val_001136
Implement the Python class `TestCalculations_length` described below. Class description: Implement the TestCalculations_length class. Method signatures and docstrings: - def meterToMillimeter(self): Are meters correctly converted to millimeters? - def millimeterToMeter(self): Are millimeters correctly converted to me...
Implement the Python class `TestCalculations_length` described below. Class description: Implement the TestCalculations_length class. Method signatures and docstrings: - def meterToMillimeter(self): Are meters correctly converted to millimeters? - def millimeterToMeter(self): Are millimeters correctly converted to me...
6a5bfbb459f5a1309fdace4e38b44e8274c497db
<|skeleton|> class TestCalculations_length: def meterToMillimeter(self): """Are meters correctly converted to millimeters?""" <|body_0|> def millimeterToMeter(self): """Are millimeters correctly converted to meters?""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestCalculations_length: def meterToMillimeter(self): """Are meters correctly converted to millimeters?""" testName = 'meter_to_millimeter' try: log.print_test_begin(testName) meters = 1 millimeters = sc_Length.meter_to_millimeter(meters) ...
the_stack_v2_python_sparse
testCalculations/length.py
sativa/SPEED
train
0
915325a01da957c180772a309228c6dad07752e8
[ "if not root:\n return ''\nres = str(root.val)\nif root.left:\n res += ',(' + self.serialize(root.left) + ')'\nif root.right:\n if not root.left:\n res += ',()'\n res += ',(' + self.serialize(root.right) + ')'\nreturn res", "if not data:\n return\nif ',' not in data:\n return TreeNode(int...
<|body_start_0|> if not root: return '' res = str(root.val) if root.left: res += ',(' + self.serialize(root.left) + ')' if root.right: if not root.left: res += ',()' res += ',(' + self.serialize(root.right) + ')' ret...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_001054
1,935
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
25e5caf324e25edfdf0a7a3be1e572f5d4c88837
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" if not root: return '' res = str(root.val) if root.left: res += ',(' + self.serialize(root.left) + ')' if root.right: if not r...
the_stack_v2_python_sparse
Trees/serialize_and_deserialize_bst.py
msraju2009/CodingProblemsPractice
train
0
2ef5a697b1f5d3a1870f107696efcbf58e5e0c73
[ "try:\n courses = (yield Course.get_courses_from_ids(self.handler.room.courses))\n ids = {c['user_id'] for c in courses}\n names = (yield {id_: User.get_name(id_) for id_ in ids})\n for course in courses:\n course['owner'] = names[course['user_id']]\n del course['user_id']\n self.pub_su...
<|body_start_0|> try: courses = (yield Course.get_courses_from_ids(self.handler.room.courses)) ids = {c['user_id'] for c in courses} names = (yield {id_: User.get_name(id_) for id_ in ids}) for course in courses: course['owner'] = names[course['use...
CoursesWSC
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CoursesWSC: def send_room_courses(self, message): """Send current room's courses to the client. This method is subscribed to the ``courses.room.get`` message type. The ``user_id`` field of each course is replaced by the ``owner`` field. The ``owner`` field contains the name of the user, ...
stack_v2_sparse_classes_36k_train_001055
2,550
no_license
[ { "docstring": "Send current room's courses to the client. This method is subscribed to the ``courses.room.get`` message type. The ``user_id`` field of each course is replaced by the ``owner`` field. The ``owner`` field contains the name of the user, instead of it's ID. :param dict message: The client's message...
2
stack_v2_sparse_classes_30k_train_013605
Implement the Python class `CoursesWSC` described below. Class description: Implement the CoursesWSC class. Method signatures and docstrings: - def send_room_courses(self, message): Send current room's courses to the client. This method is subscribed to the ``courses.room.get`` message type. The ``user_id`` field of ...
Implement the Python class `CoursesWSC` described below. Class description: Implement the CoursesWSC class. Method signatures and docstrings: - def send_room_courses(self, message): Send current room's courses to the client. This method is subscribed to the ``courses.room.get`` message type. The ``user_id`` field of ...
bc3870f809ad43feb78fbc39e7a4cead62207b27
<|skeleton|> class CoursesWSC: def send_room_courses(self, message): """Send current room's courses to the client. This method is subscribed to the ``courses.room.get`` message type. The ``user_id`` field of each course is replaced by the ``owner`` field. The ``owner`` field contains the name of the user, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CoursesWSC: def send_room_courses(self, message): """Send current room's courses to the client. This method is subscribed to the ``courses.room.get`` message type. The ``user_id`` field of each course is replaced by the ``owner`` field. The ``owner`` field contains the name of the user, instead of it'...
the_stack_v2_python_sparse
backend_modules/courses/wsclass.py
pipegreyback/artificialAlan
train
1
6260698a778091b1c0d836752927da6b53939092
[ "snap = super(FlowArea, self).snapshot()\nsnap['direction'] = self.direction\nsnap['align'] = self.align\nsnap['horizontal_spacing'] = self.horizontal_spacing\nsnap['vertical_spacing'] = self.vertical_spacing\nsnap['margins'] = self.margins\nreturn snap", "super(FlowArea, self).bind()\nattrs = ('direction', 'alig...
<|body_start_0|> snap = super(FlowArea, self).snapshot() snap['direction'] = self.direction snap['align'] = self.align snap['horizontal_spacing'] = self.horizontal_spacing snap['vertical_spacing'] = self.vertical_spacing snap['margins'] = self.margins return snap ...
A widget which lays out its children in flowing manner, wrapping around at the end of the available space.
FlowArea
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FlowArea: """A widget which lays out its children in flowing manner, wrapping around at the end of the available space.""" def snapshot(self): """Returns the snapshot dict for the FlowArea.""" <|body_0|> def bind(self): """Bind the change handler for the FlowItem...
stack_v2_sparse_classes_36k_train_001056
2,869
permissive
[ { "docstring": "Returns the snapshot dict for the FlowArea.", "name": "snapshot", "signature": "def snapshot(self)" }, { "docstring": "Bind the change handler for the FlowItem.", "name": "bind", "signature": "def bind(self)" }, { "docstring": "The getter for the 'flow_items' prop...
3
stack_v2_sparse_classes_30k_train_011142
Implement the Python class `FlowArea` described below. Class description: A widget which lays out its children in flowing manner, wrapping around at the end of the available space. Method signatures and docstrings: - def snapshot(self): Returns the snapshot dict for the FlowArea. - def bind(self): Bind the change han...
Implement the Python class `FlowArea` described below. Class description: A widget which lays out its children in flowing manner, wrapping around at the end of the available space. Method signatures and docstrings: - def snapshot(self): Returns the snapshot dict for the FlowArea. - def bind(self): Bind the change han...
424bba29219de58fe9e47196de6763de8b2009f2
<|skeleton|> class FlowArea: """A widget which lays out its children in flowing manner, wrapping around at the end of the available space.""" def snapshot(self): """Returns the snapshot dict for the FlowArea.""" <|body_0|> def bind(self): """Bind the change handler for the FlowItem...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FlowArea: """A widget which lays out its children in flowing manner, wrapping around at the end of the available space.""" def snapshot(self): """Returns the snapshot dict for the FlowArea.""" snap = super(FlowArea, self).snapshot() snap['direction'] = self.direction snap[...
the_stack_v2_python_sparse
enaml/widgets/flow_area.py
enthought/enaml
train
17
0f027012c4cc833d629e898c23a42b744f558beb
[ "while True:\n try:\n move = random.choice(moves)\n return move\n except ValueError:\n continue", "result = [elements[0]]\nfor index in range(1, len(elements)):\n if elements[index][0] > result[0][0]:\n result = [elements[index]]\n elif elements[index] == result[0][0]:\n ...
<|body_start_0|> while True: try: move = random.choice(moves) return move except ValueError: continue <|end_body_0|> <|body_start_1|> result = [elements[0]] for index in range(1, len(elements)): if elements[inde...
Bot
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Bot: def generate_move(moves): """Generates random move. :param moves: list of possible moves :return: int""" <|body_0|> def biggest_elements(elements): """Returns the biggest elements from elements. :param elements: list of elements :return: list of elements""" ...
stack_v2_sparse_classes_36k_train_001057
1,585
no_license
[ { "docstring": "Generates random move. :param moves: list of possible moves :return: int", "name": "generate_move", "signature": "def generate_move(moves)" }, { "docstring": "Returns the biggest elements from elements. :param elements: list of elements :return: list of elements", "name": "bi...
3
stack_v2_sparse_classes_30k_train_002949
Implement the Python class `Bot` described below. Class description: Implement the Bot class. Method signatures and docstrings: - def generate_move(moves): Generates random move. :param moves: list of possible moves :return: int - def biggest_elements(elements): Returns the biggest elements from elements. :param elem...
Implement the Python class `Bot` described below. Class description: Implement the Bot class. Method signatures and docstrings: - def generate_move(moves): Generates random move. :param moves: list of possible moves :return: int - def biggest_elements(elements): Returns the biggest elements from elements. :param elem...
8367786a919b9566ed7e3378f0675872d539895d
<|skeleton|> class Bot: def generate_move(moves): """Generates random move. :param moves: list of possible moves :return: int""" <|body_0|> def biggest_elements(elements): """Returns the biggest elements from elements. :param elements: list of elements :return: list of elements""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Bot: def generate_move(moves): """Generates random move. :param moves: list of possible moves :return: int""" while True: try: move = random.choice(moves) return move except ValueError: continue def biggest_elements(e...
the_stack_v2_python_sparse
base_tree_bot.py
borsukvasyl/NoughtsAndCrosses
train
1
9f698b853477b6f876f0a946e8dad425a05bedb7
[ "if not date_string and (not time_string):\n raise errors.ParseError('Missing date or time string.')\ntry:\n month_string, day_of_month_string, year_string = date_string.split('/')\n year = int(year_string, 10)\n month = int(month_string, 10)\n day_of_month = int(day_of_month_string, 10)\nexcept (Att...
<|body_start_0|> if not date_string and (not time_string): raise errors.ParseError('Missing date or time string.') try: month_string, day_of_month_string, year_string = date_string.split('/') year = int(year_string, 10) month = int(month_string, 10) ...
Parses the McAfee AV Access Protection Log.
McafeeAccessProtectionParser
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class McafeeAccessProtectionParser: """Parses the McAfee AV Access Protection Log.""" def _CreateDateTime(self, date_string, time_string): """Creates a date time value from the date time strings. The format stores the date and time as 2 separate strings separated by a tab. The time is in l...
stack_v2_sparse_classes_36k_train_001058
6,022
permissive
[ { "docstring": "Creates a date time value from the date time strings. The format stores the date and time as 2 separate strings separated by a tab. The time is in local time. The month and day can be either 1 or 2 characters long, for example: \"7/30/2013\\\\t10:22:48 AM\" Args: date_string (str): date string. ...
3
stack_v2_sparse_classes_30k_train_011027
Implement the Python class `McafeeAccessProtectionParser` described below. Class description: Parses the McAfee AV Access Protection Log. Method signatures and docstrings: - def _CreateDateTime(self, date_string, time_string): Creates a date time value from the date time strings. The format stores the date and time a...
Implement the Python class `McafeeAccessProtectionParser` described below. Class description: Parses the McAfee AV Access Protection Log. Method signatures and docstrings: - def _CreateDateTime(self, date_string, time_string): Creates a date time value from the date time strings. The format stores the date and time a...
d6022f8cfebfddf2d08ab2d300a41b61f3349933
<|skeleton|> class McafeeAccessProtectionParser: """Parses the McAfee AV Access Protection Log.""" def _CreateDateTime(self, date_string, time_string): """Creates a date time value from the date time strings. The format stores the date and time as 2 separate strings separated by a tab. The time is in l...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class McafeeAccessProtectionParser: """Parses the McAfee AV Access Protection Log.""" def _CreateDateTime(self, date_string, time_string): """Creates a date time value from the date time strings. The format stores the date and time as 2 separate strings separated by a tab. The time is in local time. Th...
the_stack_v2_python_sparse
plaso/parsers/mcafeeav.py
log2timeline/plaso
train
1,506
7e7b95a1aeebee239801632cfe9bedf2a848ed8c
[ "self.address = address\nself.is_cluster_auditing_enabled = is_cluster_auditing_enabled\nself.is_data_protection_enabled = is_data_protection_enabled\nself.is_filer_auditing_enabled = is_filer_auditing_enabled\nself.is_ssh_log_enabled = is_ssh_log_enabled\nself.name = name\nself.port = port\nself.protocol = protoco...
<|body_start_0|> self.address = address self.is_cluster_auditing_enabled = is_cluster_auditing_enabled self.is_data_protection_enabled = is_data_protection_enabled self.is_filer_auditing_enabled = is_filer_auditing_enabled self.is_ssh_log_enabled = is_ssh_log_enabled self...
Implementation of the 'SyslogServer' model. Specifies the syslog servers configuration to upload Cluster audit logs and filer audit logs. Attributes: address (string): Specifies the IP address or hostname of the syslog server. is_cluster_auditing_enabled (bool): Specifies if Cluster audit logs should be sent to this sy...
SyslogServer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SyslogServer: """Implementation of the 'SyslogServer' model. Specifies the syslog servers configuration to upload Cluster audit logs and filer audit logs. Attributes: address (string): Specifies the IP address or hostname of the syslog server. is_cluster_auditing_enabled (bool): Specifies if Clus...
stack_v2_sparse_classes_36k_train_001059
4,641
permissive
[ { "docstring": "Constructor for the SyslogServer class", "name": "__init__", "signature": "def __init__(self, address=None, port=None, protocol=None, is_cluster_auditing_enabled=None, is_data_protection_enabled=None, is_filer_auditing_enabled=None, is_ssh_log_enabled=None, name=None)" }, { "docs...
2
stack_v2_sparse_classes_30k_train_020709
Implement the Python class `SyslogServer` described below. Class description: Implementation of the 'SyslogServer' model. Specifies the syslog servers configuration to upload Cluster audit logs and filer audit logs. Attributes: address (string): Specifies the IP address or hostname of the syslog server. is_cluster_aud...
Implement the Python class `SyslogServer` described below. Class description: Implementation of the 'SyslogServer' model. Specifies the syslog servers configuration to upload Cluster audit logs and filer audit logs. Attributes: address (string): Specifies the IP address or hostname of the syslog server. is_cluster_aud...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class SyslogServer: """Implementation of the 'SyslogServer' model. Specifies the syslog servers configuration to upload Cluster audit logs and filer audit logs. Attributes: address (string): Specifies the IP address or hostname of the syslog server. is_cluster_auditing_enabled (bool): Specifies if Clus...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SyslogServer: """Implementation of the 'SyslogServer' model. Specifies the syslog servers configuration to upload Cluster audit logs and filer audit logs. Attributes: address (string): Specifies the IP address or hostname of the syslog server. is_cluster_auditing_enabled (bool): Specifies if Cluster audit log...
the_stack_v2_python_sparse
cohesity_management_sdk/models/syslog_server.py
cohesity/management-sdk-python
train
24
b6211839220b437251d0b8fd96cd5c83d37ba005
[ "if not username:\n raise ValueError('Users must have an username')\nuser = self.model(username=username)\nuser.set_password(password)\nuser.save(using=self._db)\nreturn user", "user = self.create_user(username=username, password=password)\nuser.is_admin = True\nuser.is_staff = True\nuser.save(using=self._db)\...
<|body_start_0|> if not username: raise ValueError('Users must have an username') user = self.model(username=username) user.set_password(password) user.save(using=self._db) return user <|end_body_0|> <|body_start_1|> user = self.create_user(username=username,...
UserProfileManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserProfileManager: def create_user(self, username, password=None): """Creates and saves a User with the given email, date of birth and password.""" <|body_0|> def create_superuser(self, email, username, password): """Creates and saves a superuser with the given emai...
stack_v2_sparse_classes_36k_train_001060
12,800
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, username, password=None)" }, { "docstring": "Creates and saves a superuser with the given email, date of birth and password.", "name": "crea...
2
stack_v2_sparse_classes_30k_train_009589
Implement the Python class `UserProfileManager` described below. Class description: Implement the UserProfileManager class. Method signatures and docstrings: - def create_user(self, username, password=None): Creates and saves a User with the given email, date of birth and password. - def create_superuser(self, email,...
Implement the Python class `UserProfileManager` described below. Class description: Implement the UserProfileManager class. Method signatures and docstrings: - def create_user(self, username, password=None): Creates and saves a User with the given email, date of birth and password. - def create_superuser(self, email,...
57eeaa273c006af941be41499d2294d93105cf50
<|skeleton|> class UserProfileManager: def create_user(self, username, password=None): """Creates and saves a User with the given email, date of birth and password.""" <|body_0|> def create_superuser(self, email, username, password): """Creates and saves a superuser with the given emai...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserProfileManager: def create_user(self, username, password=None): """Creates and saves a User with the given email, date of birth and password.""" if not username: raise ValueError('Users must have an username') user = self.model(username=username) user.set_passwo...
the_stack_v2_python_sparse
cmdb/models.py
hardyxia/AutoOps
train
3
9a943f8483c16ec0854de9637d8f8c0982661c67
[ "num_subjects = len(extracted)\nnum_features = len(pipeline)\nfeatures = [[subject['features'][feature] for subject in extracted] for feature in range(num_features)]\nconsolidated = []\nfor feature in features:\n max_length = max((len(subject) for subject in feature))\n if all((len(subject) == max_length for ...
<|body_start_0|> num_subjects = len(extracted) num_features = len(pipeline) features = [[subject['features'][feature] for subject in extracted] for feature in range(num_features)] consolidated = [] for feature in features: max_length = max((len(subject) for subject in...
Class implementing multi-subject feature values/labels utils
MultiSubjectFeatureUtils
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiSubjectFeatureUtils: """Class implementing multi-subject feature values/labels utils""" def prepare_feature_values(cls, extracted, pipeline): """Prepares the feature values. :param extracted: extracted features :type extracted: list :param pipeline: pipeline of the features to b...
stack_v2_sparse_classes_36k_train_001061
8,503
permissive
[ { "docstring": "Prepares the feature values. :param extracted: extracted features :type extracted: list :param pipeline: pipeline of the features to be extracted :type pipeline: list :return: finalized feature values :rtype: numpy.ndarray", "name": "prepare_feature_values", "signature": "def prepare_fea...
2
stack_v2_sparse_classes_30k_train_006878
Implement the Python class `MultiSubjectFeatureUtils` described below. Class description: Class implementing multi-subject feature values/labels utils Method signatures and docstrings: - def prepare_feature_values(cls, extracted, pipeline): Prepares the feature values. :param extracted: extracted features :type extra...
Implement the Python class `MultiSubjectFeatureUtils` described below. Class description: Class implementing multi-subject feature values/labels utils Method signatures and docstrings: - def prepare_feature_values(cls, extracted, pipeline): Prepares the feature values. :param extracted: extracted features :type extra...
0545ade5be63db78c99da9eb156a7be96ce63445
<|skeleton|> class MultiSubjectFeatureUtils: """Class implementing multi-subject feature values/labels utils""" def prepare_feature_values(cls, extracted, pipeline): """Prepares the feature values. :param extracted: extracted features :type extracted: list :param pipeline: pipeline of the features to b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MultiSubjectFeatureUtils: """Class implementing multi-subject feature values/labels utils""" def prepare_feature_values(cls, extracted, pipeline): """Prepares the feature values. :param extracted: extracted features :type extracted: list :param pipeline: pipeline of the features to be extracted :...
the_stack_v2_python_sparse
src/handwriting_features/interface/featurizer/utils.py
BDALab/handwriting-features
train
6
6100f1a09996674b67a958a7026ada368ae699fb
[ "nn.Module.__init__(self)\nself.c = c\nself.nu = nu\nself.eps = eps\nself.soft_boundary = soft_boundary", "dist = torch.sum((self.c - input) ** 2, dim=1)\nif self.soft_boundary:\n scores = dist - R ** 2\n loss = R ** 2 + 1 / self.nu * torch.mean(torch.max(torch.zeros_like(scores), scores))\nelse:\n loss ...
<|body_start_0|> nn.Module.__init__(self) self.c = c self.nu = nu self.eps = eps self.soft_boundary = soft_boundary <|end_body_0|> <|body_start_1|> dist = torch.sum((self.c - input) ** 2, dim=1) if self.soft_boundary: scores = dist - R ** 2 ...
Implementation of the DeepSVDD loss proposed by Lukas Ruff et al. (2019)
DeepSVDDLoss
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DeepSVDDLoss: """Implementation of the DeepSVDD loss proposed by Lukas Ruff et al. (2019)""" def __init__(self, c, nu, eps=1e-06, soft_boundary=False): """Constructor of the DeepSVDD loss. ---------- INPUT |---- c (torch.Tensor) the center of the hypersphere as a multidimensional vec...
stack_v2_sparse_classes_36k_train_001062
18,386
permissive
[ { "docstring": "Constructor of the DeepSVDD loss. ---------- INPUT |---- c (torch.Tensor) the center of the hypersphere as a multidimensional vector. |---- nu (float) a priory fraction of outliers. |---- eps (float) epsilon to ensure numerical stability in the | inverse distance. |---- soft_boundary (bool) whet...
2
stack_v2_sparse_classes_30k_train_009211
Implement the Python class `DeepSVDDLoss` described below. Class description: Implementation of the DeepSVDD loss proposed by Lukas Ruff et al. (2019) Method signatures and docstrings: - def __init__(self, c, nu, eps=1e-06, soft_boundary=False): Constructor of the DeepSVDD loss. ---------- INPUT |---- c (torch.Tensor...
Implement the Python class `DeepSVDDLoss` described below. Class description: Implementation of the DeepSVDD loss proposed by Lukas Ruff et al. (2019) Method signatures and docstrings: - def __init__(self, c, nu, eps=1e-06, soft_boundary=False): Constructor of the DeepSVDD loss. ---------- INPUT |---- c (torch.Tensor...
850b6195d6290a50eee865b4d5a66f5db5260e8f
<|skeleton|> class DeepSVDDLoss: """Implementation of the DeepSVDD loss proposed by Lukas Ruff et al. (2019)""" def __init__(self, c, nu, eps=1e-06, soft_boundary=False): """Constructor of the DeepSVDD loss. ---------- INPUT |---- c (torch.Tensor) the center of the hypersphere as a multidimensional vec...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DeepSVDDLoss: """Implementation of the DeepSVDD loss proposed by Lukas Ruff et al. (2019)""" def __init__(self, c, nu, eps=1e-06, soft_boundary=False): """Constructor of the DeepSVDD loss. ---------- INPUT |---- c (torch.Tensor) the center of the hypersphere as a multidimensional vector. |---- nu...
the_stack_v2_python_sparse
Code/src/models/optim/CustomLosses.py
antoine-spahr/X-ray-Anomaly-Detection
train
3
94e23ec24848e91906a5b33dba2072a562252fa2
[ "MyInterestPage(app_page).login_user(data['username'], data['password'])\nMyInterestPage(app_page).my_interest()\nsuccess = MyInterestPage(app_page).confirm_my_interest()\nlogging.info('开始断言')\ntry:\n assert success == data['check']\n logging.info('我的兴趣页面跳转成功')\nexcept:\n print('我的兴趣页面跳转失败')\n common.sa...
<|body_start_0|> MyInterestPage(app_page).login_user(data['username'], data['password']) MyInterestPage(app_page).my_interest() success = MyInterestPage(app_page).confirm_my_interest() logging.info('开始断言') try: assert success == data['check'] logging.info(...
TestLoginUser
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestLoginUser: def test_login_my_interest(self, data, app_page): """确认我的兴趣页面跳转是否成功""" <|body_0|> def test_my_interest_add(self, data, app_page): """我的兴趣-添加兴趣""" <|body_1|> def test_my_interest_del(self, data, app_page): """我的兴趣-删除兴趣""" <|...
stack_v2_sparse_classes_36k_train_001063
4,839
no_license
[ { "docstring": "确认我的兴趣页面跳转是否成功", "name": "test_login_my_interest", "signature": "def test_login_my_interest(self, data, app_page)" }, { "docstring": "我的兴趣-添加兴趣", "name": "test_my_interest_add", "signature": "def test_my_interest_add(self, data, app_page)" }, { "docstring": "我的兴趣-...
5
null
Implement the Python class `TestLoginUser` described below. Class description: Implement the TestLoginUser class. Method signatures and docstrings: - def test_login_my_interest(self, data, app_page): 确认我的兴趣页面跳转是否成功 - def test_my_interest_add(self, data, app_page): 我的兴趣-添加兴趣 - def test_my_interest_del(self, data, app_...
Implement the Python class `TestLoginUser` described below. Class description: Implement the TestLoginUser class. Method signatures and docstrings: - def test_login_my_interest(self, data, app_page): 确认我的兴趣页面跳转是否成功 - def test_my_interest_add(self, data, app_page): 我的兴趣-添加兴趣 - def test_my_interest_del(self, data, app_...
b262c13e55a6e9eae1d4fa11d50b71814028261c
<|skeleton|> class TestLoginUser: def test_login_my_interest(self, data, app_page): """确认我的兴趣页面跳转是否成功""" <|body_0|> def test_my_interest_add(self, data, app_page): """我的兴趣-添加兴趣""" <|body_1|> def test_my_interest_del(self, data, app_page): """我的兴趣-删除兴趣""" <|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestLoginUser: def test_login_my_interest(self, data, app_page): """确认我的兴趣页面跳转是否成功""" MyInterestPage(app_page).login_user(data['username'], data['password']) MyInterestPage(app_page).my_interest() success = MyInterestPage(app_page).confirm_my_interest() logging.info('开始...
the_stack_v2_python_sparse
TestCase/test_app/test_my_interest.py
xjx985426946/Test_UI
train
0
fd190641c192e92d030316541d6db73178fe703a
[ "self.bytes_transferred = bytes_transferred\nself.end_timestamp_usecs = end_timestamp_usecs\nself.entity = entity\nself.error = error\nself.logical_bytes_transferred = logical_bytes_transferred\nself.logical_size_bytes = logical_size_bytes\nself.progress_monitor_task_path = progress_monitor_task_path\nself.relative...
<|body_start_0|> self.bytes_transferred = bytes_transferred self.end_timestamp_usecs = end_timestamp_usecs self.entity = entity self.error = error self.logical_bytes_transferred = logical_bytes_transferred self.logical_size_bytes = logical_size_bytes self.progress...
Implementation of the 'RetrieveArchiveInfo_RetrievedEntity' model. Proto to define the info about the entity that was retrieved from an archive. Attributes: bytes_transferred (long|int): Number of physical bytes transferred over wire for this entity. end_timestamp_usecs (long|int): Time in microseconds when retrieve of...
RetrieveArchiveInfo_RetrievedEntity
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RetrieveArchiveInfo_RetrievedEntity: """Implementation of the 'RetrieveArchiveInfo_RetrievedEntity' model. Proto to define the info about the entity that was retrieved from an archive. Attributes: bytes_transferred (long|int): Number of physical bytes transferred over wire for this entity. end_ti...
stack_v2_sparse_classes_36k_train_001064
5,441
permissive
[ { "docstring": "Constructor for the RetrieveArchiveInfo_RetrievedEntity class", "name": "__init__", "signature": "def __init__(self, bytes_transferred=None, end_timestamp_usecs=None, entity=None, error=None, logical_bytes_transferred=None, logical_size_bytes=None, progress_monitor_task_path=None, relati...
2
null
Implement the Python class `RetrieveArchiveInfo_RetrievedEntity` described below. Class description: Implementation of the 'RetrieveArchiveInfo_RetrievedEntity' model. Proto to define the info about the entity that was retrieved from an archive. Attributes: bytes_transferred (long|int): Number of physical bytes transf...
Implement the Python class `RetrieveArchiveInfo_RetrievedEntity` described below. Class description: Implementation of the 'RetrieveArchiveInfo_RetrievedEntity' model. Proto to define the info about the entity that was retrieved from an archive. Attributes: bytes_transferred (long|int): Number of physical bytes transf...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class RetrieveArchiveInfo_RetrievedEntity: """Implementation of the 'RetrieveArchiveInfo_RetrievedEntity' model. Proto to define the info about the entity that was retrieved from an archive. Attributes: bytes_transferred (long|int): Number of physical bytes transferred over wire for this entity. end_ti...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RetrieveArchiveInfo_RetrievedEntity: """Implementation of the 'RetrieveArchiveInfo_RetrievedEntity' model. Proto to define the info about the entity that was retrieved from an archive. Attributes: bytes_transferred (long|int): Number of physical bytes transferred over wire for this entity. end_timestamp_usecs...
the_stack_v2_python_sparse
cohesity_management_sdk/models/retrieve_archive_info_retrieved_entity.py
cohesity/management-sdk-python
train
24
d16c3c98671ff4be5693211dcd690bfd8a091c34
[ "self.nums = []\nfor i in range(0, len(A), 2):\n cnt, val = (A[i], A[i + 1])\n if cnt > 0:\n self.nums.append([cnt, val])\nself.nums = self.nums[::-1]", "while len(self.nums) > 0 and n > 0:\n c, v = self.nums[-1]\n if c > n:\n c -= n\n self.nums[-1][0] -= n\n return v\n ...
<|body_start_0|> self.nums = [] for i in range(0, len(A), 2): cnt, val = (A[i], A[i + 1]) if cnt > 0: self.nums.append([cnt, val]) self.nums = self.nums[::-1] <|end_body_0|> <|body_start_1|> while len(self.nums) > 0 and n > 0: c, v = s...
RLEIterator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RLEIterator: def __init__(self, A): """:type A: List[int]""" <|body_0|> def next(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.nums = [] for i in range(0, len(A), 2): cnt, val = (A[i],...
stack_v2_sparse_classes_36k_train_001065
2,706
no_license
[ { "docstring": ":type A: List[int]", "name": "__init__", "signature": "def __init__(self, A)" }, { "docstring": ":type n: int :rtype: int", "name": "next", "signature": "def next(self, n)" } ]
2
null
Implement the Python class `RLEIterator` described below. Class description: Implement the RLEIterator class. Method signatures and docstrings: - def __init__(self, A): :type A: List[int] - def next(self, n): :type n: int :rtype: int
Implement the Python class `RLEIterator` described below. Class description: Implement the RLEIterator class. Method signatures and docstrings: - def __init__(self, A): :type A: List[int] - def next(self, n): :type n: int :rtype: int <|skeleton|> class RLEIterator: def __init__(self, A): """:type A: Lis...
a5cb862f0c5a3cfd21468141800568c2dedded0a
<|skeleton|> class RLEIterator: def __init__(self, A): """:type A: List[int]""" <|body_0|> def next(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RLEIterator: def __init__(self, A): """:type A: List[int]""" self.nums = [] for i in range(0, len(A), 2): cnt, val = (A[i], A[i + 1]) if cnt > 0: self.nums.append([cnt, val]) self.nums = self.nums[::-1] def next(self, n): """...
the_stack_v2_python_sparse
python/leetcode/design/900_RLE_iterator.py
Levintsky/topcoder
train
0
a1985af3fd7ab6331761630e066f5825900bbe66
[ "ns_url = 'http://www.example.com/foo/namespace.txt'\nrelative_url = 'bar.txt'\nfinal_url = 'http://www.example.com/foo/bar.txt'\nx = lncore.basic_relative_url_handling_behavior(relative_url, ns_url)\nassert x == final_url", "ns_url = 'http://www.example.com/foo/namespace.txt'\nabsolute_url = 'http://www.example....
<|body_start_0|> ns_url = 'http://www.example.com/foo/namespace.txt' relative_url = 'bar.txt' final_url = 'http://www.example.com/foo/bar.txt' x = lncore.basic_relative_url_handling_behavior(relative_url, ns_url) assert x == final_url <|end_body_0|> <|body_start_1|> ns_u...
DOC DOC DOC
TestBasicRelativeURLHandlingBehavior
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestBasicRelativeURLHandlingBehavior: """DOC DOC DOC""" def testBasic(self): """Test that basic relative URL handling behavior works.""" <|body_0|> def testPassingAnAbsolute(self): """Test that absolute URLs are not handled specially.""" <|body_1|> <|end...
stack_v2_sparse_classes_36k_train_001066
34,773
no_license
[ { "docstring": "Test that basic relative URL handling behavior works.", "name": "testBasic", "signature": "def testBasic(self)" }, { "docstring": "Test that absolute URLs are not handled specially.", "name": "testPassingAnAbsolute", "signature": "def testPassingAnAbsolute(self)" } ]
2
stack_v2_sparse_classes_30k_train_003537
Implement the Python class `TestBasicRelativeURLHandlingBehavior` described below. Class description: DOC DOC DOC Method signatures and docstrings: - def testBasic(self): Test that basic relative URL handling behavior works. - def testPassingAnAbsolute(self): Test that absolute URLs are not handled specially.
Implement the Python class `TestBasicRelativeURLHandlingBehavior` described below. Class description: DOC DOC DOC Method signatures and docstrings: - def testBasic(self): Test that basic relative URL handling behavior works. - def testPassingAnAbsolute(self): Test that absolute URLs are not handled specially. <|skel...
da65d948b346d3f455e79168a8753b2b16d8fc5f
<|skeleton|> class TestBasicRelativeURLHandlingBehavior: """DOC DOC DOC""" def testBasic(self): """Test that basic relative URL handling behavior works.""" <|body_0|> def testPassingAnAbsolute(self): """Test that absolute URLs are not handled specially.""" <|body_1|> <|end...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestBasicRelativeURLHandlingBehavior: """DOC DOC DOC""" def testBasic(self): """Test that basic relative URL handling behavior works.""" ns_url = 'http://www.example.com/foo/namespace.txt' relative_url = 'bar.txt' final_url = 'http://www.example.com/foo/bar.txt' x ...
the_stack_v2_python_sparse
pre2007/lncore/test.py
BackupTheBerlios/onebigsoup-svn
train
0
a977567ffb25d182a782c53a33554d4c720f1903
[ "if head is None:\n return None\nhead_old = head\nnew_node = head.next\nwhile new_node:\n tmp = new_node.next\n new_node.next = head\n head = new_node\n new_node = tmp\nhead_old.next = None\nreturn head", "if head is None or head.next is None:\n return head\np = head\nrev = None\nwhile p:\n t...
<|body_start_0|> if head is None: return None head_old = head new_node = head.next while new_node: tmp = new_node.next new_node.next = head head = new_node new_node = tmp head_old.next = None return head <|end_bo...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def reverseList1(self, head): """modify list in place, needs three pointers. 1). Old head, which will become the tail at the end. old head.next should be the future head node 2). Next node: The one gonna become the new head, then back pointing to the next one in original list. ...
stack_v2_sparse_classes_36k_train_001067
2,049
no_license
[ { "docstring": "modify list in place, needs three pointers. 1). Old head, which will become the tail at the end. old head.next should be the future head node 2). Next node: The one gonna become the new head, then back pointing to the next one in original list. 3). New Head: The new head of reversed list. :type ...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverseList1(self, head): modify list in place, needs three pointers. 1). Old head, which will become the tail at the end. old head.next should be the future head node 2). Ne...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverseList1(self, head): modify list in place, needs three pointers. 1). Old head, which will become the tail at the end. old head.next should be the future head node 2). Ne...
11d6bf2ba7b50c07e048df37c4e05c8f46b92241
<|skeleton|> class Solution: def reverseList1(self, head): """modify list in place, needs three pointers. 1). Old head, which will become the tail at the end. old head.next should be the future head node 2). Next node: The one gonna become the new head, then back pointing to the next one in original list. ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def reverseList1(self, head): """modify list in place, needs three pointers. 1). Old head, which will become the tail at the end. old head.next should be the future head node 2). Next node: The one gonna become the new head, then back pointing to the next one in original list. 3). New Head: ...
the_stack_v2_python_sparse
LeetCodes/LinkedList/ReverseLinkedList.py
chutianwen/LeetCodes
train
0
3c5fbc0bef2154d6a23d67b22beda73d26d1aa73
[ "super().__init__(parent)\nself.parent = parent\nself.setupUi(self)\nself.search_btn.clicked.connect(self.search_city)\nself.search_inp.setText('')", "self.error_label.setText('')\nself.label_name.setText('')\nself.label_place.setText('')\nself.label_v1.setText('')\nself.label_v2.setText('')\nself.label_v3.setTex...
<|body_start_0|> super().__init__(parent) self.parent = parent self.setupUi(self) self.search_btn.clicked.connect(self.search_city) self.search_inp.setText('') <|end_body_0|> <|body_start_1|> self.error_label.setText('') self.label_name.setText('') self.l...
SearchWindow
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SearchWindow: def __init__(self, parent=None): """:does: init Search Window""" <|body_0|> def search_city(self): """:does: search city by name in dataframe""" <|body_1|> <|end_skeleton|> <|body_start_0|> super().__init__(parent) self.parent ...
stack_v2_sparse_classes_36k_train_001068
11,130
no_license
[ { "docstring": ":does: init Search Window", "name": "__init__", "signature": "def __init__(self, parent=None)" }, { "docstring": ":does: search city by name in dataframe", "name": "search_city", "signature": "def search_city(self)" } ]
2
stack_v2_sparse_classes_30k_train_017757
Implement the Python class `SearchWindow` described below. Class description: Implement the SearchWindow class. Method signatures and docstrings: - def __init__(self, parent=None): :does: init Search Window - def search_city(self): :does: search city by name in dataframe
Implement the Python class `SearchWindow` described below. Class description: Implement the SearchWindow class. Method signatures and docstrings: - def __init__(self, parent=None): :does: init Search Window - def search_city(self): :does: search city by name in dataframe <|skeleton|> class SearchWindow: def __i...
5b2e4d0b63318c4d8c32c3e546cfef84e1006eed
<|skeleton|> class SearchWindow: def __init__(self, parent=None): """:does: init Search Window""" <|body_0|> def search_city(self): """:does: search city by name in dataframe""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SearchWindow: def __init__(self, parent=None): """:does: init Search Window""" super().__init__(parent) self.parent = parent self.setupUi(self) self.search_btn.clicked.connect(self.search_city) self.search_inp.setText('') def search_city(self): """:...
the_stack_v2_python_sparse
menu.py
vodovozovaliza/SmartCity
train
0
01a7bb3feae367edaef34dd5332a413a141475b6
[ "total_size = sum([c[0] for c in counts])\navg_bin_size = total_size / K\nself.partitionAssignment = {}\npartitionSize = [0] * K\ncounts.sort(key=lambda k: k[0], reverse=True)\ni = 0\nfor count, partitionColumnStr in counts:\n jumps = 0\n while count + partitionSize[i] > avg_bin_size and jumps < K:\n i...
<|body_start_0|> total_size = sum([c[0] for c in counts]) avg_bin_size = total_size / K self.partitionAssignment = {} partitionSize = [0] * K counts.sort(key=lambda k: k[0], reverse=True) i = 0 for count, partitionColumnStr in counts: jumps = 0 ...
FirstFitPartitioner
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FirstFitPartitioner: def __init__(self, K: int, counts: List[Tuple[int, str]]): """Initializer for the FirstFitPartitioner, which constructs a map of partitioner strings, and assigns them a parition id Keyword argument: K: number of partitions available counts: A list of entries of count...
stack_v2_sparse_classes_36k_train_001069
2,680
no_license
[ { "docstring": "Initializer for the FirstFitPartitioner, which constructs a map of partitioner strings, and assigns them a parition id Keyword argument: K: number of partitions available counts: A list of entries of counts of partitioning column string. When the column is user_id for example, it will be (counts...
3
stack_v2_sparse_classes_30k_train_002263
Implement the Python class `FirstFitPartitioner` described below. Class description: Implement the FirstFitPartitioner class. Method signatures and docstrings: - def __init__(self, K: int, counts: List[Tuple[int, str]]): Initializer for the FirstFitPartitioner, which constructs a map of partitioner strings, and assig...
Implement the Python class `FirstFitPartitioner` described below. Class description: Implement the FirstFitPartitioner class. Method signatures and docstrings: - def __init__(self, K: int, counts: List[Tuple[int, str]]): Initializer for the FirstFitPartitioner, which constructs a map of partitioner strings, and assig...
f219dae1cbfb0f94789ca73982c90d999be048ed
<|skeleton|> class FirstFitPartitioner: def __init__(self, K: int, counts: List[Tuple[int, str]]): """Initializer for the FirstFitPartitioner, which constructs a map of partitioner strings, and assigns them a parition id Keyword argument: K: number of partitions available counts: A list of entries of count...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FirstFitPartitioner: def __init__(self, K: int, counts: List[Tuple[int, str]]): """Initializer for the FirstFitPartitioner, which constructs a map of partitioner strings, and assigns them a parition id Keyword argument: K: number of partitions available counts: A list of entries of counts of partition...
the_stack_v2_python_sparse
fruit-phone-maker/Question2/Partitioner/FirstFitPartitioner.py
bhaavanmerchant/challenge-problems
train
0
d169f06c49e9beae3dc4d69b030f5ba9b0cf214c
[ "self.file_select_policy = file_select_policy\nself.file_size = file_size\nself.file_size_policy = file_size_policy\nself.hot_file_window = hot_file_window\nself.nfs_mount_path = nfs_mount_path\nself.num_file_access = num_file_access\nself.source_view_name = source_view_name\nself.uptier_all_files = uptier_all_file...
<|body_start_0|> self.file_select_policy = file_select_policy self.file_size = file_size self.file_size_policy = file_size_policy self.hot_file_window = hot_file_window self.nfs_mount_path = nfs_mount_path self.num_file_access = num_file_access self.source_view_na...
Implementation of the 'FileUptieringParams' model. File Uptiering Parameters for NAS migration. Attributes: file_select_policy (int): File uptier policy based on file access/modify time. file_size (int): Gives the size criteria to be used for selecting the files to be uptiered. The hot files, which are greater or small...
FileUptieringParams
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileUptieringParams: """Implementation of the 'FileUptieringParams' model. File Uptiering Parameters for NAS migration. Attributes: file_select_policy (int): File uptier policy based on file access/modify time. file_size (int): Gives the size criteria to be used for selecting the files to be upti...
stack_v2_sparse_classes_36k_train_001070
4,196
permissive
[ { "docstring": "Constructor for the FileUptieringParams class", "name": "__init__", "signature": "def __init__(self, file_select_policy=None, file_size=None, file_size_policy=None, hot_file_window=None, nfs_mount_path=None, num_file_access=None, source_view_name=None, uptier_all_files=None)" }, { ...
2
stack_v2_sparse_classes_30k_train_020575
Implement the Python class `FileUptieringParams` described below. Class description: Implementation of the 'FileUptieringParams' model. File Uptiering Parameters for NAS migration. Attributes: file_select_policy (int): File uptier policy based on file access/modify time. file_size (int): Gives the size criteria to be ...
Implement the Python class `FileUptieringParams` described below. Class description: Implementation of the 'FileUptieringParams' model. File Uptiering Parameters for NAS migration. Attributes: file_select_policy (int): File uptier policy based on file access/modify time. file_size (int): Gives the size criteria to be ...
0093194d125fc6746f55b8499da1270c64f473fc
<|skeleton|> class FileUptieringParams: """Implementation of the 'FileUptieringParams' model. File Uptiering Parameters for NAS migration. Attributes: file_select_policy (int): File uptier policy based on file access/modify time. file_size (int): Gives the size criteria to be used for selecting the files to be upti...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileUptieringParams: """Implementation of the 'FileUptieringParams' model. File Uptiering Parameters for NAS migration. Attributes: file_select_policy (int): File uptier policy based on file access/modify time. file_size (int): Gives the size criteria to be used for selecting the files to be uptiered. The hot...
the_stack_v2_python_sparse
cohesity_management_sdk/models/file_uptiering_params.py
hsantoyo2/management-sdk-python
train
0
732df77d54a71c973574ed090dcd6bbb10b283a1
[ "super().__init__()\nself.in_chans = in_chans\nself.out_chans = out_chans\nself.chans = chans\nself.num_pool_layers = num_pool_layers\nself.drop_prob = drop_prob\nself.down_sample_layers = nn.ModuleList([ConvBlock(in_chans, chans, drop_prob, variant=variant, ks=kernel_size, pad=padding, dil=dilation, num_group=grou...
<|body_start_0|> super().__init__() self.in_chans = in_chans self.out_chans = out_chans self.chans = chans self.num_pool_layers = num_pool_layers self.drop_prob = drop_prob self.down_sample_layers = nn.ModuleList([ConvBlock(in_chans, chans, drop_prob, variant=vari...
PyTorch implementation of a U-Net model. This is based on: Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234–241. Springer, 2015.
UnetModel
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UnetModel: """PyTorch implementation of a U-Net model. This is based on: Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234–241. S...
stack_v2_sparse_classes_36k_train_001071
7,919
permissive
[ { "docstring": "Args: in_chans (int): Number of channels in the input to the U-Net model. out_chans (int): Number of channels in the output to the U-Net model. chans (int): Number of output channels of the first convolution layer. num_pool_layers (int): Number of down-sampling and up-sampling layers. drop_prob ...
2
stack_v2_sparse_classes_30k_train_011262
Implement the Python class `UnetModel` described below. Class description: PyTorch implementation of a U-Net model. This is based on: Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-...
Implement the Python class `UnetModel` described below. Class description: PyTorch implementation of a U-Net model. This is based on: Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-...
84ab6e57748c2631b0e780255dcbc1d6e372269d
<|skeleton|> class UnetModel: """PyTorch implementation of a U-Net model. This is based on: Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234–241. S...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UnetModel: """PyTorch implementation of a U-Net model. This is based on: Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234–241. Springer, 2015...
the_stack_v2_python_sparse
banding_removal/fastmri/model/public_unet.py
facebookresearch/fastMRI
train
1,174
5d5cb8e6f60ffb6771aa1745b38aad782f530a31
[ "object.__init__(self)\nself.stateLock = threading.Condition() if lock is None else lock\nself.msg = msg", "self.stateLock.acquire()\ntry:\n self.msg = msg\nfinally:\n self.stateLock.notify()\n self.stateLock.release()", "self.stateLock.acquire()\nwhile self.msg is None:\n self.stateLock.wait(timeOu...
<|body_start_0|> object.__init__(self) self.stateLock = threading.Condition() if lock is None else lock self.msg = msg <|end_body_0|> <|body_start_1|> self.stateLock.acquire() try: self.msg = msg finally: self.stateLock.notify() self.s...
Used when a worker thread is told to do lengthy things to a shared resource (say a gui window) and only the last (whenever that may arrive) one matters. Like a 1 deep queue which only contains the last added entry.
LatestMessage
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LatestMessage: """Used when a worker thread is told to do lengthy things to a shared resource (say a gui window) and only the last (whenever that may arrive) one matters. Like a 1 deep queue which only contains the last added entry.""" def __init__(self, msg=None, lock=None): """'msg...
stack_v2_sparse_classes_36k_train_001072
4,351
no_license
[ { "docstring": "'msg' is an initial value. 'lock' is an optional lock to be used else a new one is allocated.", "name": "__init__", "signature": "def __init__(self, msg=None, lock=None)" }, { "docstring": "place the message and ensure the worker thread is notified is waiting", "name": "setMs...
3
stack_v2_sparse_classes_30k_train_019685
Implement the Python class `LatestMessage` described below. Class description: Used when a worker thread is told to do lengthy things to a shared resource (say a gui window) and only the last (whenever that may arrive) one matters. Like a 1 deep queue which only contains the last added entry. Method signatures and do...
Implement the Python class `LatestMessage` described below. Class description: Used when a worker thread is told to do lengthy things to a shared resource (say a gui window) and only the last (whenever that may arrive) one matters. Like a 1 deep queue which only contains the last added entry. Method signatures and do...
b54f23c6c5f1f19e426ee06c9e9faf9f561ee9a9
<|skeleton|> class LatestMessage: """Used when a worker thread is told to do lengthy things to a shared resource (say a gui window) and only the last (whenever that may arrive) one matters. Like a 1 deep queue which only contains the last added entry.""" def __init__(self, msg=None, lock=None): """'msg...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LatestMessage: """Used when a worker thread is told to do lengthy things to a shared resource (say a gui window) and only the last (whenever that may arrive) one matters. Like a 1 deep queue which only contains the last added entry.""" def __init__(self, msg=None, lock=None): """'msg' is an initi...
the_stack_v2_python_sparse
pylib/thread.py
chyser/bin
train
1
326194bb2c87f4e67c20d817b10398053d16a00a
[ "length = 0\nfor a in args:\n if a:\n length = len(a)\nreturn length", "self.image_id = image_id\nlength = self._get_length(question_ids, questions, answers, captions)\nself.question_ids = question_ids or [-1] * length\nself.questions = questions or ['_'] * length\nself.answers = answers or ['_'] * leng...
<|body_start_0|> length = 0 for a in args: if a: length = len(a) return length <|end_body_0|> <|body_start_1|> self.image_id = image_id length = self._get_length(question_ids, questions, answers, captions) self.question_ids = question_ids or [...
Wrapper with defaults around image metadata (for both captions and QA).
ImageMetadata
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageMetadata: """Wrapper with defaults around image metadata (for both captions and QA).""" def _get_length(*args): """Helper to establish length of arguments.""" <|body_0|> def __init__(self, image_id=-1, question_ids=None, questions=None, answers=None, captions=None, ...
stack_v2_sparse_classes_36k_train_001073
4,191
permissive
[ { "docstring": "Helper to establish length of arguments.", "name": "_get_length", "signature": "def _get_length(*args)" }, { "docstring": "Initialization. Args: image_id: (optional) Identifier for the image. question_ids: (optional) List of unique identifiers for the questions. questions: (optio...
2
null
Implement the Python class `ImageMetadata` described below. Class description: Wrapper with defaults around image metadata (for both captions and QA). Method signatures and docstrings: - def _get_length(*args): Helper to establish length of arguments. - def __init__(self, image_id=-1, question_ids=None, questions=Non...
Implement the Python class `ImageMetadata` described below. Class description: Wrapper with defaults around image metadata (for both captions and QA). Method signatures and docstrings: - def _get_length(*args): Helper to establish length of arguments. - def __init__(self, image_id=-1, question_ids=None, questions=Non...
ac9447064195e06de48cc91ff642f7fffa28ffe8
<|skeleton|> class ImageMetadata: """Wrapper with defaults around image metadata (for both captions and QA).""" def _get_length(*args): """Helper to establish length of arguments.""" <|body_0|> def __init__(self, image_id=-1, question_ids=None, questions=None, answers=None, captions=None, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImageMetadata: """Wrapper with defaults around image metadata (for both captions and QA).""" def _get_length(*args): """Helper to establish length of arguments.""" length = 0 for a in args: if a: length = len(a) return length def __init__(s...
the_stack_v2_python_sparse
language/capwap/utils/image_utils.py
google-research/language
train
1,567
3a022f3842aafbe513a4591d1ea30a49f76bff70
[ "BEGIN = 'pg1'\nfor city in self.cities:\n print(self.lianjia_url.format(city=city, page=BEGIN))\n yield Request(self.lianjia_url.format(city=city, page=BEGIN), meta={'city': city}, callback=self.parse_start, dont_filter=True)", "RP = 'rp'\ncity = response.meta['city']\nzone_lis = response.css('#filter ul:n...
<|body_start_0|> BEGIN = 'pg1' for city in self.cities: print(self.lianjia_url.format(city=city, page=BEGIN)) yield Request(self.lianjia_url.format(city=city, page=BEGIN), meta={'city': city}, callback=self.parse_start, dont_filter=True) <|end_body_0|> <|body_start_1|> R...
爬取链家的出租房源,去重中介重复发的信息,如朝阳区有5266房源,但是重复的这有1000多条信息 就是中介重复发同一条房源信息,提高流量。
RenthouseSpider
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RenthouseSpider: """爬取链家的出租房源,去重中介重复发的信息,如朝阳区有5266房源,但是重复的这有1000多条信息 就是中介重复发同一条房源信息,提高流量。""" def start_requests(self): """对每一个city进行请求 分析主页面""" <|body_0|> def parse_start(self, response): """获取主页的地区和价格分区 然后分类进行爬虫. 特殊逻辑:因为linajia只是吐出3000条数据一次性,不分类拿不到全部数据. 很多城市的房源都...
stack_v2_sparse_classes_36k_train_001074
6,571
no_license
[ { "docstring": "对每一个city进行请求 分析主页面", "name": "start_requests", "signature": "def start_requests(self)" }, { "docstring": "获取主页的地区和价格分区 然后分类进行爬虫. 特殊逻辑:因为linajia只是吐出3000条数据一次性,不分类拿不到全部数据. 很多城市的房源都是大于3000套的", "name": "parse_start", "signature": "def parse_start(self, response)" }, { ...
4
stack_v2_sparse_classes_30k_train_011078
Implement the Python class `RenthouseSpider` described below. Class description: 爬取链家的出租房源,去重中介重复发的信息,如朝阳区有5266房源,但是重复的这有1000多条信息 就是中介重复发同一条房源信息,提高流量。 Method signatures and docstrings: - def start_requests(self): 对每一个city进行请求 分析主页面 - def parse_start(self, response): 获取主页的地区和价格分区 然后分类进行爬虫. 特殊逻辑:因为linajia只是吐出3000条数据一次性...
Implement the Python class `RenthouseSpider` described below. Class description: 爬取链家的出租房源,去重中介重复发的信息,如朝阳区有5266房源,但是重复的这有1000多条信息 就是中介重复发同一条房源信息,提高流量。 Method signatures and docstrings: - def start_requests(self): 对每一个city进行请求 分析主页面 - def parse_start(self, response): 获取主页的地区和价格分区 然后分类进行爬虫. 特殊逻辑:因为linajia只是吐出3000条数据一次性...
63b540cd60abf67dfe84d87d8c219075ccddc28a
<|skeleton|> class RenthouseSpider: """爬取链家的出租房源,去重中介重复发的信息,如朝阳区有5266房源,但是重复的这有1000多条信息 就是中介重复发同一条房源信息,提高流量。""" def start_requests(self): """对每一个city进行请求 分析主页面""" <|body_0|> def parse_start(self, response): """获取主页的地区和价格分区 然后分类进行爬虫. 特殊逻辑:因为linajia只是吐出3000条数据一次性,不分类拿不到全部数据. 很多城市的房源都...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RenthouseSpider: """爬取链家的出租房源,去重中介重复发的信息,如朝阳区有5266房源,但是重复的这有1000多条信息 就是中介重复发同一条房源信息,提高流量。""" def start_requests(self): """对每一个city进行请求 分析主页面""" BEGIN = 'pg1' for city in self.cities: print(self.lianjia_url.format(city=city, page=BEGIN)) yield Request(self.l...
the_stack_v2_python_sparse
lianjia/build/lib/lianjia/spiders/renthouse.py
Schneizelw/supreme
train
0
48c465e44c706d49317aa6a4b55332d23166d421
[ "super(CNN, self).__init__()\nself.input_channel_count = input_channel_count\nself.output_channel_count = output_channel_count\nself.conv = nn.Conv1d(in_channels=input_channel_count, out_channels=output_channel_count, kernel_size=kernel_size)\nself.max_pool = nn.AdaptiveMaxPool1d(output_size=1)\nself.relu = nn.ReLU...
<|body_start_0|> super(CNN, self).__init__() self.input_channel_count = input_channel_count self.output_channel_count = output_channel_count self.conv = nn.Conv1d(in_channels=input_channel_count, out_channels=output_channel_count, kernel_size=kernel_size) self.max_pool = nn.Adapt...
CNN Layer, i.e. a layer of cnn network that takes the output of convolutional network as input
CNN
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CNN: """CNN Layer, i.e. a layer of cnn network that takes the output of convolutional network as input""" def __init__(self, input_channel_count, output_channel_count, kernel_size=5): """Init HighWay Instance. @param input_channel_count: int @param output_channel_count: int @param ke...
stack_v2_sparse_classes_36k_train_001075
2,032
no_license
[ { "docstring": "Init HighWay Instance. @param input_channel_count: int @param output_channel_count: int @param kernel_size: int", "name": "__init__", "signature": "def __init__(self, input_channel_count, output_channel_count, kernel_size=5)" }, { "docstring": "Run a forward step that map a batch...
2
stack_v2_sparse_classes_30k_train_006314
Implement the Python class `CNN` described below. Class description: CNN Layer, i.e. a layer of cnn network that takes the output of convolutional network as input Method signatures and docstrings: - def __init__(self, input_channel_count, output_channel_count, kernel_size=5): Init HighWay Instance. @param input_chan...
Implement the Python class `CNN` described below. Class description: CNN Layer, i.e. a layer of cnn network that takes the output of convolutional network as input Method signatures and docstrings: - def __init__(self, input_channel_count, output_channel_count, kernel_size=5): Init HighWay Instance. @param input_chan...
a883935d779dca3a3cc443c3fa6d6a455f21e87a
<|skeleton|> class CNN: """CNN Layer, i.e. a layer of cnn network that takes the output of convolutional network as input""" def __init__(self, input_channel_count, output_channel_count, kernel_size=5): """Init HighWay Instance. @param input_channel_count: int @param output_channel_count: int @param ke...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CNN: """CNN Layer, i.e. a layer of cnn network that takes the output of convolutional network as input""" def __init__(self, input_channel_count, output_channel_count, kernel_size=5): """Init HighWay Instance. @param input_channel_count: int @param output_channel_count: int @param kernel_size: in...
the_stack_v2_python_sparse
stanford_nlp/a5/cnn.py
guocongyun/ml-projects
train
0
e341edb681b88c6efbd65316388ccf6a01b326f3
[ "type = kwargs['type']\nfile = kwargs['file']\nwith open(file, 'r') as data_file:\n for line in data_file:\n line = line[:-1]\n items_dict = ast.literal_eval(line)\n item = type.from_dict(items_dict)\n self.add_item(item, lambda i: i.uid)", "file = kwargs['file']\nwith open(file, 'w...
<|body_start_0|> type = kwargs['type'] file = kwargs['file'] with open(file, 'r') as data_file: for line in data_file: line = line[:-1] items_dict = ast.literal_eval(line) item = type.from_dict(items_dict) self.add_item(...
RepositoryText
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RepositoryText: def load_data(self, **kwargs): """Load repository from txt file. :param kwargs: file - file to load the data from type - the type of the objects :return:""" <|body_0|> def save_data(self, **kwargs): """Save repository to txt file. :param kwargs: file ...
stack_v2_sparse_classes_36k_train_001076
1,259
no_license
[ { "docstring": "Load repository from txt file. :param kwargs: file - file to load the data from type - the type of the objects :return:", "name": "load_data", "signature": "def load_data(self, **kwargs)" }, { "docstring": "Save repository to txt file. :param kwargs: file - file to load the data ...
2
stack_v2_sparse_classes_30k_train_002319
Implement the Python class `RepositoryText` described below. Class description: Implement the RepositoryText class. Method signatures and docstrings: - def load_data(self, **kwargs): Load repository from txt file. :param kwargs: file - file to load the data from type - the type of the objects :return: - def save_data...
Implement the Python class `RepositoryText` described below. Class description: Implement the RepositoryText class. Method signatures and docstrings: - def load_data(self, **kwargs): Load repository from txt file. :param kwargs: file - file to load the data from type - the type of the objects :return: - def save_data...
206b049700d8a3e03b52e57960cd44f85c415fe8
<|skeleton|> class RepositoryText: def load_data(self, **kwargs): """Load repository from txt file. :param kwargs: file - file to load the data from type - the type of the objects :return:""" <|body_0|> def save_data(self, **kwargs): """Save repository to txt file. :param kwargs: file ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RepositoryText: def load_data(self, **kwargs): """Load repository from txt file. :param kwargs: file - file to load the data from type - the type of the objects :return:""" type = kwargs['type'] file = kwargs['file'] with open(file, 'r') as data_file: for line in da...
the_stack_v2_python_sparse
semester_1/fp/assignment_09/src/repositories/repository_text.py
caprapaul/assignments
train
0
c9baccb09e5ac57daef9000707807c94034c59e4
[ "self.screen_width = 1200\nself.screen_height = 680\nself.bg_color = (0, 20, 50)\nself.hero_limit = 3\nself.bullets_allowed = 5\nself.covid_vertical_speed_factor = 1\nself.speedup_scale = 1.1\nself.initialize_dynamic_settings()", "self.hero_speed_factor = 1.5\nself.bullet_speed_factor = 1\nself.covid_horizontal_s...
<|body_start_0|> self.screen_width = 1200 self.screen_height = 680 self.bg_color = (0, 20, 50) self.hero_limit = 3 self.bullets_allowed = 5 self.covid_vertical_speed_factor = 1 self.speedup_scale = 1.1 self.initialize_dynamic_settings() <|end_body_0|> <|b...
A class that have all configurations of the game
Settings
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Settings: """A class that have all configurations of the game""" def __init__(self): """Initialize the game configs""" <|body_0|> def initialize_dynamic_settings(self): """Initializes the configurations that increase during the game""" <|body_1|> def...
stack_v2_sparse_classes_36k_train_001077
2,241
permissive
[ { "docstring": "Initialize the game configs", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Initializes the configurations that increase during the game", "name": "initialize_dynamic_settings", "signature": "def initialize_dynamic_settings(self)" }, { "...
3
stack_v2_sparse_classes_30k_train_005448
Implement the Python class `Settings` described below. Class description: A class that have all configurations of the game Method signatures and docstrings: - def __init__(self): Initialize the game configs - def initialize_dynamic_settings(self): Initializes the configurations that increase during the game - def inc...
Implement the Python class `Settings` described below. Class description: A class that have all configurations of the game Method signatures and docstrings: - def __init__(self): Initialize the game configs - def initialize_dynamic_settings(self): Initializes the configurations that increase during the game - def inc...
4b336ebf0bc29aa4c644f0996431d13f853ac6e7
<|skeleton|> class Settings: """A class that have all configurations of the game""" def __init__(self): """Initialize the game configs""" <|body_0|> def initialize_dynamic_settings(self): """Initializes the configurations that increase during the game""" <|body_1|> def...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Settings: """A class that have all configurations of the game""" def __init__(self): """Initialize the game configs""" self.screen_width = 1200 self.screen_height = 680 self.bg_color = (0, 20, 50) self.hero_limit = 3 self.bullets_allowed = 5 self.co...
the_stack_v2_python_sparse
pygame/hero_combat/hero_settings.py
carlinhoshk/python
train
0
d421d458d0d27392352a69a7b631b84bdc8f09bb
[ "ApiProvider.__init__(self)\nself.http_provider = http_provider\nself.counter = itertools.count()\nself.to_vapi = JsonRpcDictToVapi\nself.post_processors = [constructor() for constructor in dynamic_import_list(post_processors)]", "params = {'serviceId': service_id, 'operationId': operation_id, 'input': input_valu...
<|body_start_0|> ApiProvider.__init__(self) self.http_provider = http_provider self.counter = itertools.count() self.to_vapi = JsonRpcDictToVapi self.post_processors = [constructor() for constructor in dynamic_import_list(post_processors)] <|end_body_0|> <|body_start_1|> ...
Json rpc client provider
JsonClientProvider
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JsonClientProvider: """Json rpc client provider""" def __init__(self, http_provider, post_processors): """Json rpc client provider init :type http_provider: :class:`vmware.vapi.protocol.client.rpc.provider.HTTPProvider` :param http_provider: rpc provider object :type post_processors:...
stack_v2_sparse_classes_36k_train_001078
5,842
no_license
[ { "docstring": "Json rpc client provider init :type http_provider: :class:`vmware.vapi.protocol.client.rpc.provider.HTTPProvider` :param http_provider: rpc provider object :type post_processors: :class:`list` of :class:`str` :param post_processors: List of post processor class names", "name": "__init__", ...
3
null
Implement the Python class `JsonClientProvider` described below. Class description: Json rpc client provider Method signatures and docstrings: - def __init__(self, http_provider, post_processors): Json rpc client provider init :type http_provider: :class:`vmware.vapi.protocol.client.rpc.provider.HTTPProvider` :param ...
Implement the Python class `JsonClientProvider` described below. Class description: Json rpc client provider Method signatures and docstrings: - def __init__(self, http_provider, post_processors): Json rpc client provider init :type http_provider: :class:`vmware.vapi.protocol.client.rpc.provider.HTTPProvider` :param ...
5d395700ab3d0d1d45b497e48beab8c366fca9f5
<|skeleton|> class JsonClientProvider: """Json rpc client provider""" def __init__(self, http_provider, post_processors): """Json rpc client provider init :type http_provider: :class:`vmware.vapi.protocol.client.rpc.provider.HTTPProvider` :param http_provider: rpc provider object :type post_processors:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class JsonClientProvider: """Json rpc client provider""" def __init__(self, http_provider, post_processors): """Json rpc client provider init :type http_provider: :class:`vmware.vapi.protocol.client.rpc.provider.HTTPProvider` :param http_provider: rpc provider object :type post_processors: :class:`list...
the_stack_v2_python_sparse
alexa-program.bak/vmware/vapi/protocol/client/msg/json_connector.py
taromurata/TDP2018_VMCAPI
train
1
e3ecdad0d3c76e27e790a9edda1c5f417303d55d
[ "if std_w is None:\n std_w = 1 / np.sqrt(0.5 * n_input)\nself.lr = lr\nself.w = Tensor(n_output, n_input).normal_(0, std_w)\nself.dw = Tensor(self.w.shape).zero_()\nself.bias = bias\nif bias:\n if not std_b:\n self.b = Tensor(n_output, 1).fill_(0)\n else:\n self.b = Tensor(n_output, 1).normal...
<|body_start_0|> if std_w is None: std_w = 1 / np.sqrt(0.5 * n_input) self.lr = lr self.w = Tensor(n_output, n_input).normal_(0, std_w) self.dw = Tensor(self.w.shape).zero_() self.bias = bias if bias: if not std_b: self.b = Tensor(n...
Implements the fully connected layer module It requires the number of inputs and outputs. Weights are initialized assuming that a ReLU module will be used afterwards. If a Tanh module will be used instead, it is recommended to set std_w = 1 / np.sqrt(n_input) It is possible to set a default learning rate that will be u...
Linear
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Linear: """Implements the fully connected layer module It requires the number of inputs and outputs. Weights are initialized assuming that a ReLU module will be used afterwards. If a Tanh module will be used instead, it is recommended to set std_w = 1 / np.sqrt(n_input) It is possible to set a de...
stack_v2_sparse_classes_36k_train_001079
9,572
permissive
[ { "docstring": "INPUT: n_input: Size of input n_output: Number of hidden units lr: If adaptive learning rate is not used, learning rate used for update std_w: Normal distribution initialization of weights with std = std_w/ If None, std_w is chosen according to Xavier initialization. bias: If true, use bias std_...
5
stack_v2_sparse_classes_30k_train_017635
Implement the Python class `Linear` described below. Class description: Implements the fully connected layer module It requires the number of inputs and outputs. Weights are initialized assuming that a ReLU module will be used afterwards. If a Tanh module will be used instead, it is recommended to set std_w = 1 / np.s...
Implement the Python class `Linear` described below. Class description: Implements the fully connected layer module It requires the number of inputs and outputs. Weights are initialized assuming that a ReLU module will be used afterwards. If a Tanh module will be used instead, it is recommended to set std_w = 1 / np.s...
303fb507fc6a756b4bfbb3c9fbd57230c866b39b
<|skeleton|> class Linear: """Implements the fully connected layer module It requires the number of inputs and outputs. Weights are initialized assuming that a ReLU module will be used afterwards. If a Tanh module will be used instead, it is recommended to set std_w = 1 / np.sqrt(n_input) It is possible to set a de...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Linear: """Implements the fully connected layer module It requires the number of inputs and outputs. Weights are initialized assuming that a ReLU module will be used afterwards. If a Tanh module will be used instead, it is recommended to set std_w = 1 / np.sqrt(n_input) It is possible to set a default learnin...
the_stack_v2_python_sparse
Projects/Project2/framework/modules.py
lumosan/deeplearning2018
train
0
d4a04969cb0c0bf3cffc64ef162b3110e30b8d7b
[ "if is_horizontal:\n super(Composition3x1, self).__init__(3 * width, height)\nelse:\n super(Composition3x1, self).__init__(width, 3 * height)\nself.single_w = width\nself.single_h = height\nself.is_horizontal = is_horizontal\nself.empty = np.zeros((height, width, 3), dtype=np.uint8)\nself.left = left\nself.mi...
<|body_start_0|> if is_horizontal: super(Composition3x1, self).__init__(3 * width, height) else: super(Composition3x1, self).__init__(width, 3 * height) self.single_w = width self.single_h = height self.is_horizontal = is_horizontal self.empty = np...
Display two keras_tf next to each other.
Composition3x1
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Composition3x1: """Display two keras_tf next to each other.""" def __init__(self, width, height, left, middle, right, is_horizontal: bool=True): """Initialize the step with all relevant attributes. :param width: Width of the final composition. :param height: Height of the final compo...
stack_v2_sparse_classes_36k_train_001080
1,891
no_license
[ { "docstring": "Initialize the step with all relevant attributes. :param width: Width of the final composition. :param height: Height of the final composition. :param left: Reference to the function which gets the frame to be displayed on left. :param right: Reference to the function which gets the frame to be ...
2
stack_v2_sparse_classes_30k_train_000390
Implement the Python class `Composition3x1` described below. Class description: Display two keras_tf next to each other. Method signatures and docstrings: - def __init__(self, width, height, left, middle, right, is_horizontal: bool=True): Initialize the step with all relevant attributes. :param width: Width of the fi...
Implement the Python class `Composition3x1` described below. Class description: Display two keras_tf next to each other. Method signatures and docstrings: - def __init__(self, width, height, left, middle, right, is_horizontal: bool=True): Initialize the step with all relevant attributes. :param width: Width of the fi...
8316bcc43805ba3cdc196b68b14f921f81610337
<|skeleton|> class Composition3x1: """Display two keras_tf next to each other.""" def __init__(self, width, height, left, middle, right, is_horizontal: bool=True): """Initialize the step with all relevant attributes. :param width: Width of the final composition. :param height: Height of the final compo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Composition3x1: """Display two keras_tf next to each other.""" def __init__(self, width, height, left, middle, right, is_horizontal: bool=True): """Initialize the step with all relevant attributes. :param width: Width of the final composition. :param height: Height of the final composition. :para...
the_stack_v2_python_sparse
video/pipeline/compositions/composition_3x1.py
breitmuuufrosch/OpenCvPipeline
train
0
da6e8e90b303be724b177840345b1640e5b79a0c
[ "while n % 4 == 0:\n n = n // 4\nif n % 8 == 7:\n return 4\nx = 0\nwhile x * x <= n:\n y = int(math.sqrt(n - x * x))\n if x * x + y * y == n:\n if x == 0 or y == 0:\n return 1\n else:\n return 2\n x += 1\nreturn 3", "dp = [2147483647 for _ in range(n + 1)]\ndp[0]...
<|body_start_0|> while n % 4 == 0: n = n // 4 if n % 8 == 7: return 4 x = 0 while x * x <= n: y = int(math.sqrt(n - x * x)) if x * x + y * y == n: if x == 0 or y == 0: return 1 else: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def numSquares(self, n): """:type n: int :rtype: int""" <|body_0|> def numSquares_dp1(self, n): """:type n: int :rtype: int""" <|body_1|> def numSquares_dp2(self, n): """:type n: int :rtype: int""" <|body_2|> def numSquares...
stack_v2_sparse_classes_36k_train_001081
4,676
no_license
[ { "docstring": ":type n: int :rtype: int", "name": "numSquares", "signature": "def numSquares(self, n)" }, { "docstring": ":type n: int :rtype: int", "name": "numSquares_dp1", "signature": "def numSquares_dp1(self, n)" }, { "docstring": ":type n: int :rtype: int", "name": "nu...
6
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numSquares(self, n): :type n: int :rtype: int - def numSquares_dp1(self, n): :type n: int :rtype: int - def numSquares_dp2(self, n): :type n: int :rtype: int - def numSquares...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numSquares(self, n): :type n: int :rtype: int - def numSquares_dp1(self, n): :type n: int :rtype: int - def numSquares_dp2(self, n): :type n: int :rtype: int - def numSquares...
e60ba45fe2f2e5e3b3abfecec3db76f5ce1fde59
<|skeleton|> class Solution: def numSquares(self, n): """:type n: int :rtype: int""" <|body_0|> def numSquares_dp1(self, n): """:type n: int :rtype: int""" <|body_1|> def numSquares_dp2(self, n): """:type n: int :rtype: int""" <|body_2|> def numSquares...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def numSquares(self, n): """:type n: int :rtype: int""" while n % 4 == 0: n = n // 4 if n % 8 == 7: return 4 x = 0 while x * x <= n: y = int(math.sqrt(n - x * x)) if x * x + y * y == n: if x == 0 ...
the_stack_v2_python_sparse
src/lt_279.py
oxhead/CodingYourWay
train
0
dc77d866df98cac34dc54f350b08e3835b31220e
[ "status = _SpawnChild(exit_code=0)\nret = process_util.GetExitStatus(status)\nself.assertEqual(ret, 0)", "status = _SpawnChild(exit_code=10)\nret = process_util.GetExitStatus(status)\nself.assertEqual(ret, 10)", "status = _SpawnChild(exit_code=150)\nret = process_util.GetExitStatus(status)\nself.assertEqual(ret...
<|body_start_0|> status = _SpawnChild(exit_code=0) ret = process_util.GetExitStatus(status) self.assertEqual(ret, 0) <|end_body_0|> <|body_start_1|> status = _SpawnChild(exit_code=10) ret = process_util.GetExitStatus(status) self.assertEqual(ret, 10) <|end_body_1|> <|bo...
Tests for GetExitStatus()
GetExitStatusTests
[ "LGPL-2.0-or-later", "GPL-1.0-or-later", "MIT", "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GetExitStatusTests: """Tests for GetExitStatus()""" def testExitNormal(self): """Verify normal exits get decoded.""" <|body_0|> def testExitError(self): """Verify error exits (>0 && <128) get decoded.""" <|body_1|> def testExitWeird(self): ""...
stack_v2_sparse_classes_36k_train_001082
3,622
permissive
[ { "docstring": "Verify normal exits get decoded.", "name": "testExitNormal", "signature": "def testExitNormal(self)" }, { "docstring": "Verify error exits (>0 && <128) get decoded.", "name": "testExitError", "signature": "def testExitError(self)" }, { "docstring": "Verify weird e...
5
stack_v2_sparse_classes_30k_train_008225
Implement the Python class `GetExitStatusTests` described below. Class description: Tests for GetExitStatus() Method signatures and docstrings: - def testExitNormal(self): Verify normal exits get decoded. - def testExitError(self): Verify error exits (>0 && <128) get decoded. - def testExitWeird(self): Verify weird e...
Implement the Python class `GetExitStatusTests` described below. Class description: Tests for GetExitStatus() Method signatures and docstrings: - def testExitNormal(self): Verify normal exits get decoded. - def testExitError(self): Verify error exits (>0 && <128) get decoded. - def testExitWeird(self): Verify weird e...
72a05af97787001756bae2511b7985e61498c965
<|skeleton|> class GetExitStatusTests: """Tests for GetExitStatus()""" def testExitNormal(self): """Verify normal exits get decoded.""" <|body_0|> def testExitError(self): """Verify error exits (>0 && <128) get decoded.""" <|body_1|> def testExitWeird(self): ""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GetExitStatusTests: """Tests for GetExitStatus()""" def testExitNormal(self): """Verify normal exits get decoded.""" status = _SpawnChild(exit_code=0) ret = process_util.GetExitStatus(status) self.assertEqual(ret, 0) def testExitError(self): """Verify error ex...
the_stack_v2_python_sparse
third_party/chromite/lib/process_util_unittest.py
metux/chromium-suckless
train
5
241bd309a865f0a82daeec969f00b7fc366a5ee9
[ "if df is None:\n self._df = pd.DataFrame(columns=self.required_columns())\nelse:\n columns = set(df.columns)\n missing_columns = self.required_columns() - columns\n if missing_columns:\n raise ValueError(f'Dataframe must contain required columns {list(missing_columns)}.')\n extra_columns = co...
<|body_start_0|> if df is None: self._df = pd.DataFrame(columns=self.required_columns()) else: columns = set(df.columns) missing_columns = self.required_columns() - columns if missing_columns: raise ValueError(f'Dataframe must contain requi...
Class storing data for an experiment. The dataframe is retrieved via the `df` property. The data can be stored to an external store for future use by attaching it to an experiment using `experiment.attach_data()` (this requires a description to be set.) Attributes: df: DataFrame with underlying data, and required colum...
Data
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Data: """Class storing data for an experiment. The dataframe is retrieved via the `df` property. The data can be stored to an external store for future use by attaching it to an experiment using `experiment.attach_data()` (this requires a description to be set.) Attributes: df: DataFrame with und...
stack_v2_sparse_classes_36k_train_001083
10,526
permissive
[ { "docstring": "Init Data. Args: df: DataFrame with underlying data, and required columns. description: Human-readable description of data.", "name": "__init__", "signature": "def __init__(self, df: Optional[pd.DataFrame]=None, description: Optional[str]=None) -> None" }, { "docstring": "Combine...
4
stack_v2_sparse_classes_30k_train_005948
Implement the Python class `Data` described below. Class description: Class storing data for an experiment. The dataframe is retrieved via the `df` property. The data can be stored to an external store for future use by attaching it to an experiment using `experiment.attach_data()` (this requires a description to be s...
Implement the Python class `Data` described below. Class description: Class storing data for an experiment. The dataframe is retrieved via the `df` property. The data can be stored to an external store for future use by attaching it to an experiment using `experiment.attach_data()` (this requires a description to be s...
850b6975b7c7f9960ad5461e71d0304b2670232a
<|skeleton|> class Data: """Class storing data for an experiment. The dataframe is retrieved via the `df` property. The data can be stored to an external store for future use by attaching it to an experiment using `experiment.attach_data()` (this requires a description to be set.) Attributes: df: DataFrame with und...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Data: """Class storing data for an experiment. The dataframe is retrieved via the `df` property. The data can be stored to an external store for future use by attaching it to an experiment using `experiment.attach_data()` (this requires a description to be set.) Attributes: df: DataFrame with underlying data,...
the_stack_v2_python_sparse
ax/core/data.py
liusulin/Ax
train
1
b79266990d0c502ca390e30b53bdc5461a69c0cf
[ "self.config_entry = config_entry\nself.options = config_entry.options\nself.host = config_entry.data[CONF_HOST]\nself.key = config_entry.data[CONF_CLIENT_SECRET]", "errors = {}\nif user_input is not None:\n options_input = {CONF_SOURCES: user_input[CONF_SOURCES]}\n return self.async_create_entry(title='', ...
<|body_start_0|> self.config_entry = config_entry self.options = config_entry.options self.host = config_entry.data[CONF_HOST] self.key = config_entry.data[CONF_CLIENT_SECRET] <|end_body_0|> <|body_start_1|> errors = {} if user_input is not None: options_inpu...
Handle options.
OptionsFlowHandler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OptionsFlowHandler: """Handle options.""" def __init__(self, config_entry: ConfigEntry) -> None: """Initialize options flow.""" <|body_0|> async def async_step_init(self, user_input: dict[str, Any] | None=None) -> FlowResult: """Manage the options.""" <|b...
stack_v2_sparse_classes_36k_train_001084
7,262
permissive
[ { "docstring": "Initialize options flow.", "name": "__init__", "signature": "def __init__(self, config_entry: ConfigEntry) -> None" }, { "docstring": "Manage the options.", "name": "async_step_init", "signature": "async def async_step_init(self, user_input: dict[str, Any] | None=None) ->...
2
stack_v2_sparse_classes_30k_train_009928
Implement the Python class `OptionsFlowHandler` described below. Class description: Handle options. Method signatures and docstrings: - def __init__(self, config_entry: ConfigEntry) -> None: Initialize options flow. - async def async_step_init(self, user_input: dict[str, Any] | None=None) -> FlowResult: Manage the op...
Implement the Python class `OptionsFlowHandler` described below. Class description: Handle options. Method signatures and docstrings: - def __init__(self, config_entry: ConfigEntry) -> None: Initialize options flow. - async def async_step_init(self, user_input: dict[str, Any] | None=None) -> FlowResult: Manage the op...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class OptionsFlowHandler: """Handle options.""" def __init__(self, config_entry: ConfigEntry) -> None: """Initialize options flow.""" <|body_0|> async def async_step_init(self, user_input: dict[str, Any] | None=None) -> FlowResult: """Manage the options.""" <|b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OptionsFlowHandler: """Handle options.""" def __init__(self, config_entry: ConfigEntry) -> None: """Initialize options flow.""" self.config_entry = config_entry self.options = config_entry.options self.host = config_entry.data[CONF_HOST] self.key = config_entry.dat...
the_stack_v2_python_sparse
homeassistant/components/webostv/config_flow.py
home-assistant/core
train
35,501
3983fdd2c2f6ae410b60eb3d2db28d6f9ba2859a
[ "super(Exclusive, self).__init__()\nexclusivespec = cfnlint.helpers.load_resource(AdditionalSpecs, 'Exclusive.json')\nself.resource_types_specs = exclusivespec['ResourceTypes']\nself.property_types_specs = exclusivespec['PropertyTypes']\nfor resource_type_spec in self.resource_types_specs:\n self.resource_proper...
<|body_start_0|> super(Exclusive, self).__init__() exclusivespec = cfnlint.helpers.load_resource(AdditionalSpecs, 'Exclusive.json') self.resource_types_specs = exclusivespec['ResourceTypes'] self.property_types_specs = exclusivespec['PropertyTypes'] for resource_type_spec in self...
Check Properties Resource Configuration
Exclusive
[ "MIT-0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Exclusive: """Check Properties Resource Configuration""" def __init__(self): """Init""" <|body_0|> def check(self, properties, exclusions, path, cfn): """Check itself""" <|body_1|> def match_resource_sub_properties(self, properties, property_type, pa...
stack_v2_sparse_classes_36k_train_001085
3,288
permissive
[ { "docstring": "Init", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Check itself", "name": "check", "signature": "def check(self, properties, exclusions, path, cfn)" }, { "docstring": "Match for sub properties", "name": "match_resource_sub_properti...
4
stack_v2_sparse_classes_30k_train_014508
Implement the Python class `Exclusive` described below. Class description: Check Properties Resource Configuration Method signatures and docstrings: - def __init__(self): Init - def check(self, properties, exclusions, path, cfn): Check itself - def match_resource_sub_properties(self, properties, property_type, path, ...
Implement the Python class `Exclusive` described below. Class description: Check Properties Resource Configuration Method signatures and docstrings: - def __init__(self): Init - def check(self, properties, exclusions, path, cfn): Check itself - def match_resource_sub_properties(self, properties, property_type, path, ...
5176573c2f4cb7313998b4bc0bcb0716b58ea380
<|skeleton|> class Exclusive: """Check Properties Resource Configuration""" def __init__(self): """Init""" <|body_0|> def check(self, properties, exclusions, path, cfn): """Check itself""" <|body_1|> def match_resource_sub_properties(self, properties, property_type, pa...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Exclusive: """Check Properties Resource Configuration""" def __init__(self): """Init""" super(Exclusive, self).__init__() exclusivespec = cfnlint.helpers.load_resource(AdditionalSpecs, 'Exclusive.json') self.resource_types_specs = exclusivespec['ResourceTypes'] sel...
the_stack_v2_python_sparse
src/cfnlint/rules/resources/properties/Exclusive.py
rene84/cfn-python-lint
train
1
5bc4154f720b08151cfc6b91599c80d2148c1af7
[ "self.voltage_input = VoltageInput(analog_pin)\nself.voltage = 0.0\nself.ambient_light = self.light_extremely_dark\nself.measure_light()", "self.voltage = self.voltage_input.voltage\nif self.voltage < self.extremely_dark_max_voltage:\n self.ambient_light = self.light_extremely_dark\nelif self.voltage < self.ve...
<|body_start_0|> self.voltage_input = VoltageInput(analog_pin) self.voltage = 0.0 self.ambient_light = self.light_extremely_dark self.measure_light() <|end_body_0|> <|body_start_1|> self.voltage = self.voltage_input.voltage if self.voltage < self.extremely_dark_max_volta...
DarknessSensor
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DarknessSensor: def __init__(self, analog_pin): """Setting up the default values of the sensor reading""" <|body_0|> def measure_light(self): """Measuring the values of the light needed based on the voltage""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_001086
4,115
no_license
[ { "docstring": "Setting up the default values of the sensor reading", "name": "__init__", "signature": "def __init__(self, analog_pin)" }, { "docstring": "Measuring the values of the light needed based on the voltage", "name": "measure_light", "signature": "def measure_light(self)" } ]
2
stack_v2_sparse_classes_30k_train_008358
Implement the Python class `DarknessSensor` described below. Class description: Implement the DarknessSensor class. Method signatures and docstrings: - def __init__(self, analog_pin): Setting up the default values of the sensor reading - def measure_light(self): Measuring the values of the light needed based on the v...
Implement the Python class `DarknessSensor` described below. Class description: Implement the DarknessSensor class. Method signatures and docstrings: - def __init__(self, analog_pin): Setting up the default values of the sensor reading - def measure_light(self): Measuring the values of the light needed based on the v...
21bc5a9daaf33074c40f6c926effb78d6f67665f
<|skeleton|> class DarknessSensor: def __init__(self, analog_pin): """Setting up the default values of the sensor reading""" <|body_0|> def measure_light(self): """Measuring the values of the light needed based on the voltage""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DarknessSensor: def __init__(self, analog_pin): """Setting up the default values of the sensor reading""" self.voltage_input = VoltageInput(analog_pin) self.voltage = 0.0 self.ambient_light = self.light_extremely_dark self.measure_light() def measure_light(self): ...
the_stack_v2_python_sparse
Group Project/Code/Clients/LightSensor/light_sensor.py
omar-mohamed/Iot-Smart-Home
train
1
06e49ad763cea5c869d7afa3cc69f4865e387308
[ "s1 = sorted(s1)\nwindow_sz = len(s1)\nfor i in range(len(s2) - window_sz + 1):\n sub_s2 = sorted(s2[i:i + window_sz])\n if s1 == sub_s2:\n return True\nreturn False", "counter1 = Counter(s1)\nwindow_sz = len(s1)\nfor i in range(len(s2) - window_sz + 1):\n counter2 = Counter(s2[i:i + window_sz])\n...
<|body_start_0|> s1 = sorted(s1) window_sz = len(s1) for i in range(len(s2) - window_sz + 1): sub_s2 = sorted(s2[i:i + window_sz]) if s1 == sub_s2: return True return False <|end_body_0|> <|body_start_1|> counter1 = Counter(s1) win...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def checkInclusion(self, s1: str, s2: str) -> bool: """Approach2: Sort, Time: O(l1logl1 + (l2-l1)*(l1logl1+l1)), Space: O(1), TLE""" <|body_0|> def checkInclusion(self, s1: str, s2: str) -> bool: """Approach3: HashTable, Time: O(l1+(l2-l1)*l1), Space: O(1)"...
stack_v2_sparse_classes_36k_train_001087
2,508
no_license
[ { "docstring": "Approach2: Sort, Time: O(l1logl1 + (l2-l1)*(l1logl1+l1)), Space: O(1), TLE", "name": "checkInclusion", "signature": "def checkInclusion(self, s1: str, s2: str) -> bool" }, { "docstring": "Approach3: HashTable, Time: O(l1+(l2-l1)*l1), Space: O(1)", "name": "checkInclusion", ...
4
stack_v2_sparse_classes_30k_train_015091
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: Approach2: Sort, Time: O(l1logl1 + (l2-l1)*(l1logl1+l1)), Space: O(1), TLE - def checkInclusion(self, s1: str, s2: str) -> boo...
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: Approach2: Sort, Time: O(l1logl1 + (l2-l1)*(l1logl1+l1)), Space: O(1), TLE - def checkInclusion(self, s1: str, s2: str) -> boo...
72136e3487d239f5b37e2d6393e034262a6bf599
<|skeleton|> class Solution: def checkInclusion(self, s1: str, s2: str) -> bool: """Approach2: Sort, Time: O(l1logl1 + (l2-l1)*(l1logl1+l1)), Space: O(1), TLE""" <|body_0|> def checkInclusion(self, s1: str, s2: str) -> bool: """Approach3: HashTable, Time: O(l1+(l2-l1)*l1), Space: O(1)"...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def checkInclusion(self, s1: str, s2: str) -> bool: """Approach2: Sort, Time: O(l1logl1 + (l2-l1)*(l1logl1+l1)), Space: O(1), TLE""" s1 = sorted(s1) window_sz = len(s1) for i in range(len(s2) - window_sz + 1): sub_s2 = sorted(s2[i:i + window_sz]) ...
the_stack_v2_python_sparse
python/567-Permutation in String.py
cwza/leetcode
train
0
4c35d409c8c2b8fee7ae31262762868e030894be
[ "def construct_serialization(cur):\n if cur is None:\n return 'N'\n else:\n return str(cur.val) + ',' + construct_serialization(cur.left) + ',' + construct_serialization(cur.right)\nreturn construct_serialization(root)", "data = data.split(',')\nif len(data) == 0 or data[0] == 'N':\n return...
<|body_start_0|> def construct_serialization(cur): if cur is None: return 'N' else: return str(cur.val) + ',' + construct_serialization(cur.left) + ',' + construct_serialization(cur.right) return construct_serialization(root) <|end_body_0|> <|body...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_001088
1,557
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
3bfee704adb1d94efc8e531b732cf06c4f8aef0f
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" def construct_serialization(cur): if cur is None: return 'N' else: return str(cur.val) + ',' + construct_serialization(cur.left) +...
the_stack_v2_python_sparse
serializeanddeserialize.py
zopepy/leetcode
train
0
9c1d1f110049ce7c1b4336241e75e541e33dd5f3
[ "assert isinstance(nameRef, str), 'Invalid reference name %s' % nameRef\nassert isinstance(invoker, Invoker), 'Invalid invoker %s' % invoker\nassert isinstance(invoker.node, Node), 'Invalid invoker node %s' % invoker.node\nassert isinstance(invoker.doEncodePath, IDo), 'Invalid path encode %s' % invoker.doEncodePath...
<|body_start_0|> assert isinstance(nameRef, str), 'Invalid reference name %s' % nameRef assert isinstance(invoker, Invoker), 'Invalid invoker %s' % invoker assert isinstance(invoker.node, Node), 'Invalid invoker node %s' % invoker.node assert isinstance(invoker.doEncodePath, IDo), 'Inval...
Implementation for a @see: ISpecifier for attributes paths.
AttributesPath
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AttributesPath: """Implementation for a @see: ISpecifier for attributes paths.""" def __init__(self, nameRef, invoker): """Construct the paths attributes.""" <|body_0|> def populate(self, obj, specifications, support): """@see: ISpecifier.populate""" <|bo...
stack_v2_sparse_classes_36k_train_001089
5,781
no_license
[ { "docstring": "Construct the paths attributes.", "name": "__init__", "signature": "def __init__(self, nameRef, invoker)" }, { "docstring": "@see: ISpecifier.populate", "name": "populate", "signature": "def populate(self, obj, specifications, support)" } ]
2
null
Implement the Python class `AttributesPath` described below. Class description: Implementation for a @see: ISpecifier for attributes paths. Method signatures and docstrings: - def __init__(self, nameRef, invoker): Construct the paths attributes. - def populate(self, obj, specifications, support): @see: ISpecifier.pop...
Implement the Python class `AttributesPath` described below. Class description: Implementation for a @see: ISpecifier for attributes paths. Method signatures and docstrings: - def __init__(self, nameRef, invoker): Construct the paths attributes. - def populate(self, obj, specifications, support): @see: ISpecifier.pop...
e0b3466b34d31548996d57be4a9dac134d904380
<|skeleton|> class AttributesPath: """Implementation for a @see: ISpecifier for attributes paths.""" def __init__(self, nameRef, invoker): """Construct the paths attributes.""" <|body_0|> def populate(self, obj, specifications, support): """@see: ISpecifier.populate""" <|bo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AttributesPath: """Implementation for a @see: ISpecifier for attributes paths.""" def __init__(self, nameRef, invoker): """Construct the paths attributes.""" assert isinstance(nameRef, str), 'Invalid reference name %s' % nameRef assert isinstance(invoker, Invoker), 'Invalid invoke...
the_stack_v2_python_sparse
components/ally-core-http/ally/core/http/impl/processor/encoder/property_of_model_path.py
cristidomsa/Ally-Py
train
0
9e616c560c96d1e76ad95dac8fde75f25843780d
[ "BaseQuantityTemplate.__init__(self, token, 'gs')\nself.group = None\nself.groupProb = 0.0\nself.outcome = None\nself.sentence = token.sentence\nself.outcomeNumber = None", "if self.group == None:\n return -1\nif self.shouldBeAssociated(self.group):\n return 1\nreturn 0", "s = str(self.value) + ', GROUP =...
<|body_start_0|> BaseQuantityTemplate.__init__(self, token, 'gs') self.group = None self.groupProb = 0.0 self.outcome = None self.sentence = token.sentence self.outcomeNumber = None <|end_body_0|> <|body_start_1|> if self.group == None: return -1 ...
manage the information relevant to a Group size template
GroupSize
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GroupSize: """manage the information relevant to a Group size template""" def __init__(self, token): """Initialize a group size template given an integer token object""" <|body_0|> def correctAssociation(self, mType): """return True if quantity is correctly assoc...
stack_v2_sparse_classes_36k_train_001090
1,559
no_license
[ { "docstring": "Initialize a group size template given an integer token object", "name": "__init__", "signature": "def __init__(self, token)" }, { "docstring": "return True if quantity is correctly associated with mention of given type.", "name": "correctAssociation", "signature": "def c...
3
null
Implement the Python class `GroupSize` described below. Class description: manage the information relevant to a Group size template Method signatures and docstrings: - def __init__(self, token): Initialize a group size template given an integer token object - def correctAssociation(self, mType): return True if quanti...
Implement the Python class `GroupSize` described below. Class description: manage the information relevant to a Group size template Method signatures and docstrings: - def __init__(self, token): Initialize a group size template given an integer token object - def correctAssociation(self, mType): return True if quanti...
aecc4c4ac18ebc1c6cb39d54f9ed8cba5217c6f8
<|skeleton|> class GroupSize: """manage the information relevant to a Group size template""" def __init__(self, token): """Initialize a group size template given an integer token object""" <|body_0|> def correctAssociation(self, mType): """return True if quantity is correctly assoc...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GroupSize: """manage the information relevant to a Group size template""" def __init__(self, token): """Initialize a group size template given an integer token object""" BaseQuantityTemplate.__init__(self, token, 'gs') self.group = None self.groupProb = 0.0 self.ou...
the_stack_v2_python_sparse
groupsizetemplate.py
rlsummerscales/acres
train
0
2f6bd914559d02cd2193922fc6d756fe3d9ae3ad
[ "requests = []\nfor node in response.xpath('//div[@class=\"bus-listing\"]'):\n l = BusinessLoader(selector=node, response=response)\n l.add_xpath('category', './preceding-sibling::h2[1]/ text()')\n l.add_xpath('data_url', './/a[contains(@href, \"CoID=\")]/ @href')\n l.add_value('data_uid', re.match(patt...
<|body_start_0|> requests = [] for node in response.xpath('//div[@class="bus-listing"]'): l = BusinessLoader(selector=node, response=response) l.add_xpath('category', './preceding-sibling::h2[1]/ text()') l.add_xpath('data_url', './/a[contains(@href, "CoID=")]/ @href'...
Spider for Columbus, OH Chamber of Commerce business index
XeniaChamberSpider
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class XeniaChamberSpider: """Spider for Columbus, OH Chamber of Commerce business index""" def parse(self, response): """This will extract links to all categorized lists of businesses""" <|body_0|> def extract(self, response): """This extracts part of the information a...
stack_v2_sparse_classes_36k_train_001091
2,720
no_license
[ { "docstring": "This will extract links to all categorized lists of businesses", "name": "parse", "signature": "def parse(self, response)" }, { "docstring": "This extracts part of the information and then calls a child page to extract the rest of the business info", "name": "extract", "s...
2
stack_v2_sparse_classes_30k_train_005449
Implement the Python class `XeniaChamberSpider` described below. Class description: Spider for Columbus, OH Chamber of Commerce business index Method signatures and docstrings: - def parse(self, response): This will extract links to all categorized lists of businesses - def extract(self, response): This extracts part...
Implement the Python class `XeniaChamberSpider` described below. Class description: Spider for Columbus, OH Chamber of Commerce business index Method signatures and docstrings: - def parse(self, response): This will extract links to all categorized lists of businesses - def extract(self, response): This extracts part...
e36d842228a6ce4e3029b42d289eaa000e92efb5
<|skeleton|> class XeniaChamberSpider: """Spider for Columbus, OH Chamber of Commerce business index""" def parse(self, response): """This will extract links to all categorized lists of businesses""" <|body_0|> def extract(self, response): """This extracts part of the information a...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class XeniaChamberSpider: """Spider for Columbus, OH Chamber of Commerce business index""" def parse(self, response): """This will extract links to all categorized lists of businesses""" requests = [] for node in response.xpath('//div[@class="bus-listing"]'): l = BusinessLoa...
the_stack_v2_python_sparse
spiders/xenia_chamber_spider.py
dwcaraway/govly-scraper
train
1
454a9a1581b2e61a24c3a05f0513286b2bb7cf94
[ "app = App.get_running_app()\n\nasync def load():\n \"\"\"Load networks from settings and filter out not trusted.\"\"\"\n networks = set()\n for row in await app.ioc.facade.api.settings.networks():\n if row[1]:\n networks.add(uuid.UUID(row[0]))\n return networks\ntry:\n network_id =...
<|body_start_0|> app = App.get_running_app() async def load(): """Load networks from settings and filter out not trusted.""" networks = set() for row in await app.ioc.facade.api.settings.networks(): if row[1]: networks.add(uuid.UUI...
Networks
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Networks: def list_networks(self): """Load all blocked contacts.""" <|body_0|> def __load_rv(coro, content, tab=None, selectable=False, preselected=set()): """Update the ScrollView with new and changed data.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_001092
4,926
permissive
[ { "docstring": "Load all blocked contacts.", "name": "list_networks", "signature": "def list_networks(self)" }, { "docstring": "Update the ScrollView with new and changed data.", "name": "__load_rv", "signature": "def __load_rv(coro, content, tab=None, selectable=False, preselected=set()...
2
stack_v2_sparse_classes_30k_train_004137
Implement the Python class `Networks` described below. Class description: Implement the Networks class. Method signatures and docstrings: - def list_networks(self): Load all blocked contacts. - def __load_rv(coro, content, tab=None, selectable=False, preselected=set()): Update the ScrollView with new and changed data...
Implement the Python class `Networks` described below. Class description: Implement the Networks class. Method signatures and docstrings: - def list_networks(self): Load all blocked contacts. - def __load_rv(coro, content, tab=None, selectable=False, preselected=set()): Update the ScrollView with new and changed data...
7d8052cdf87d44159a56b1dbc2cbaa92283ec2ac
<|skeleton|> class Networks: def list_networks(self): """Load all blocked contacts.""" <|body_0|> def __load_rv(coro, content, tab=None, selectable=False, preselected=set()): """Update the ScrollView with new and changed data.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Networks: def list_networks(self): """Load all blocked contacts.""" app = App.get_running_app() async def load(): """Load networks from settings and filter out not trusted.""" networks = set() for row in await app.ioc.facade.api.settings.networks():...
the_stack_v2_python_sparse
lib/logo/baseclass/networks.py
kristoffer-paulsson/logo
train
0
b8af26faeb4444367f05b43d3ffe9fba193942e1
[ "if PDT_OT_ModalDrawOperator._handle is None:\n PDT_OT_ModalDrawOperator._handle = SpaceView3D.draw_handler_add(draw_callback_3d, (self, context), 'WINDOW', 'POST_VIEW')\n context.window_manager.pdt_run_opengl = True", "if PDT_OT_ModalDrawOperator._handle is not None:\n SpaceView3D.draw_handler_remove(PD...
<|body_start_0|> if PDT_OT_ModalDrawOperator._handle is None: PDT_OT_ModalDrawOperator._handle = SpaceView3D.draw_handler_add(draw_callback_3d, (self, context), 'WINDOW', 'POST_VIEW') context.window_manager.pdt_run_opengl = True <|end_body_0|> <|body_start_1|> if PDT_OT_ModalDra...
Show/Hide Pivot Point
PDT_OT_ModalDrawOperator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PDT_OT_ModalDrawOperator: """Show/Hide Pivot Point""" def handle_add(self, context): """Draw Pivot Point Graphic if not displayed. Note: Draws 7 element Pivot Point Graphic Args: context: Blender bpy.context instance. Returns: Nothing.""" <|body_0|> def handle_remove(sel...
stack_v2_sparse_classes_36k_train_001093
13,734
permissive
[ { "docstring": "Draw Pivot Point Graphic if not displayed. Note: Draws 7 element Pivot Point Graphic Args: context: Blender bpy.context instance. Returns: Nothing.", "name": "handle_add", "signature": "def handle_add(self, context)" }, { "docstring": "Remove Pivot Point Graphic if displayed. Not...
3
stack_v2_sparse_classes_30k_train_016710
Implement the Python class `PDT_OT_ModalDrawOperator` described below. Class description: Show/Hide Pivot Point Method signatures and docstrings: - def handle_add(self, context): Draw Pivot Point Graphic if not displayed. Note: Draws 7 element Pivot Point Graphic Args: context: Blender bpy.context instance. Returns: ...
Implement the Python class `PDT_OT_ModalDrawOperator` described below. Class description: Show/Hide Pivot Point Method signatures and docstrings: - def handle_add(self, context): Draw Pivot Point Graphic if not displayed. Note: Draws 7 element Pivot Point Graphic Args: context: Blender bpy.context instance. Returns: ...
4d5c304878c1e0018d97c1b07bcaa3981632265a
<|skeleton|> class PDT_OT_ModalDrawOperator: """Show/Hide Pivot Point""" def handle_add(self, context): """Draw Pivot Point Graphic if not displayed. Note: Draws 7 element Pivot Point Graphic Args: context: Blender bpy.context instance. Returns: Nothing.""" <|body_0|> def handle_remove(sel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PDT_OT_ModalDrawOperator: """Show/Hide Pivot Point""" def handle_add(self, context): """Draw Pivot Point Graphic if not displayed. Note: Draws 7 element Pivot Point Graphic Args: context: Blender bpy.context instance. Returns: Nothing.""" if PDT_OT_ModalDrawOperator._handle is None: ...
the_stack_v2_python_sparse
src/bpy/3.6/scripts/addons/precision_drawing_tools/pdt_pivot_point.py
RnoB/3DVisualSwarm
train
0
098ba368bab29cad3443e646c4ad16ff24325457
[ "limit = int(self.request.get('limit', 100))\naccepted_filters = ('executable', 'first_arg', 'platform', 'domain')\nreports = ProfileReport.all()\nmin_duration = self.request.get('min_duration')\nmax_duration = self.request.get('max_duration')\nincludes_not = False\nfor key in accepted_filters:\n value = self.re...
<|body_start_0|> limit = int(self.request.get('limit', 100)) accepted_filters = ('executable', 'first_arg', 'platform', 'domain') reports = ProfileReport.all() min_duration = self.request.get('min_duration') max_duration = self.request.get('max_duration') includes_not = F...
Profiling
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Profiling: def get(self): """Returns json formated data according to the provided filters.""" <|body_0|> def post(self): """Adds a new profile report. Anyone can add a report.""" <|body_1|> <|end_skeleton|> <|body_start_0|> limit = int(self.request....
stack_v2_sparse_classes_36k_train_001094
4,040
permissive
[ { "docstring": "Returns json formated data according to the provided filters.", "name": "get", "signature": "def get(self)" }, { "docstring": "Adds a new profile report. Anyone can add a report.", "name": "post", "signature": "def post(self)" } ]
2
null
Implement the Python class `Profiling` described below. Class description: Implement the Profiling class. Method signatures and docstrings: - def get(self): Returns json formated data according to the provided filters. - def post(self): Adds a new profile report. Anyone can add a report.
Implement the Python class `Profiling` described below. Class description: Implement the Profiling class. Method signatures and docstrings: - def get(self): Returns json formated data according to the provided filters. - def post(self): Adds a new profile report. Anyone can add a report. <|skeleton|> class Profiling...
b5d4783f99461438ca9e6a477535617fadab6ba3
<|skeleton|> class Profiling: def get(self): """Returns json formated data according to the provided filters.""" <|body_0|> def post(self): """Adds a new profile report. Anyone can add a report.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Profiling: def get(self): """Returns json formated data according to the provided filters.""" limit = int(self.request.get('limit', 100)) accepted_filters = ('executable', 'first_arg', 'platform', 'domain') reports = ProfileReport.all() min_duration = self.request.get('...
the_stack_v2_python_sparse
appengine/chromium_status/appengine_module/chromium_status/profiling.py
xinghun61/infra
train
2
e87e76f7ef72eca5f9d5cce01c4ad563a654479d
[ "posts = Post.objects.all()\nposts = post_filter(request, posts)\nif type(posts) == Response:\n return posts\nreturn Response(PostSerializer(posts, many=True).data)", "serializer = PostSerializerCreate(data=request.data, context={'request': request})\nif serializer.is_valid():\n serializer.save()\n retur...
<|body_start_0|> posts = Post.objects.all() posts = post_filter(request, posts) if type(posts) == Response: return posts return Response(PostSerializer(posts, many=True).data) <|end_body_0|> <|body_start_1|> serializer = PostSerializerCreate(data=request.data, contex...
PostView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PostView: def get(request): """List posts""" <|body_0|> def post(request): """Create post""" <|body_1|> <|end_skeleton|> <|body_start_0|> posts = Post.objects.all() posts = post_filter(request, posts) if type(posts) == Response: ...
stack_v2_sparse_classes_36k_train_001095
2,180
permissive
[ { "docstring": "List posts", "name": "get", "signature": "def get(request)" }, { "docstring": "Create post", "name": "post", "signature": "def post(request)" } ]
2
stack_v2_sparse_classes_30k_train_000441
Implement the Python class `PostView` described below. Class description: Implement the PostView class. Method signatures and docstrings: - def get(request): List posts - def post(request): Create post
Implement the Python class `PostView` described below. Class description: Implement the PostView class. Method signatures and docstrings: - def get(request): List posts - def post(request): Create post <|skeleton|> class PostView: def get(request): """List posts""" <|body_0|> def post(reque...
b93fa2fea8d45df9f19c3c58037e59dad4981921
<|skeleton|> class PostView: def get(request): """List posts""" <|body_0|> def post(request): """Create post""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PostView: def get(request): """List posts""" posts = Post.objects.all() posts = post_filter(request, posts) if type(posts) == Response: return posts return Response(PostSerializer(posts, many=True).data) def post(request): """Create post""" ...
the_stack_v2_python_sparse
v1/posts/views/post.py
lawiz22/PLOUC-Backend-master
train
0
4517e517e873ae242677697f5cda761a8c2be5fb
[ "self.sent_freq_dict = defaultdict(int)\nself.curr_sent = ''\nfor i in range(len(sentences)):\n self.sent_freq_dict[sentences[i]] = times[i]", "if c == '#':\n self.sent_freq_dict[self.curr_sent] += 1\n self.curr_sent = ''\nelse:\n self.curr_sent += c\n L = len(self.curr_sent)\n temp_lst = []\n ...
<|body_start_0|> self.sent_freq_dict = defaultdict(int) self.curr_sent = '' for i in range(len(sentences)): self.sent_freq_dict[sentences[i]] = times[i] <|end_body_0|> <|body_start_1|> if c == '#': self.sent_freq_dict[self.curr_sent] += 1 self.curr_se...
AutocompleteSystem
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AutocompleteSystem: def __init__(self, sentences, times): """:type sentences: List[str] :type times: List[int]""" <|body_0|> def input(self, c): """:type c: str :rtype: List[str]""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.sent_freq_dict = ...
stack_v2_sparse_classes_36k_train_001096
1,296
no_license
[ { "docstring": ":type sentences: List[str] :type times: List[int]", "name": "__init__", "signature": "def __init__(self, sentences, times)" }, { "docstring": ":type c: str :rtype: List[str]", "name": "input", "signature": "def input(self, c)" } ]
2
null
Implement the Python class `AutocompleteSystem` described below. Class description: Implement the AutocompleteSystem class. Method signatures and docstrings: - def __init__(self, sentences, times): :type sentences: List[str] :type times: List[int] - def input(self, c): :type c: str :rtype: List[str]
Implement the Python class `AutocompleteSystem` described below. Class description: Implement the AutocompleteSystem class. Method signatures and docstrings: - def __init__(self, sentences, times): :type sentences: List[str] :type times: List[int] - def input(self, c): :type c: str :rtype: List[str] <|skeleton|> cla...
a9b2de06306f3929a82ef4e6613c972e9a2c2200
<|skeleton|> class AutocompleteSystem: def __init__(self, sentences, times): """:type sentences: List[str] :type times: List[int]""" <|body_0|> def input(self, c): """:type c: str :rtype: List[str]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AutocompleteSystem: def __init__(self, sentences, times): """:type sentences: List[str] :type times: List[int]""" self.sent_freq_dict = defaultdict(int) self.curr_sent = '' for i in range(len(sentences)): self.sent_freq_dict[sentences[i]] = times[i] def input(s...
the_stack_v2_python_sparse
Practice_3/Design_Search_Autocomplete_System.py
anantvir/Leetcode-Problems
train
1
73db89ba05ccf582a567cb06a8a8fbee1183aad6
[ "response_message = ResponseMessage()\nresponse_message.callback_url = request_message.callback_url\nresponse_message.job_id = request_message.job_id\nresponse_message.username = request_message.username\nreturn response_message", "message = yaml.load(message_yaml)\nassert isinstance(message, ResponseMessage)\nre...
<|body_start_0|> response_message = ResponseMessage() response_message.callback_url = request_message.callback_url response_message.job_id = request_message.job_id response_message.username = request_message.username return response_message <|end_body_0|> <|body_start_1|> ...
Class for response messages.
ResponseMessage
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResponseMessage: """Class for response messages.""" def from_request_message(request_message): """Builds a response object from a request object.""" <|body_0|> def load(message_yaml): """Loads the response message from yaml asserting it deserialized properly.""" ...
stack_v2_sparse_classes_36k_train_001097
4,974
no_license
[ { "docstring": "Builds a response object from a request object.", "name": "from_request_message", "signature": "def from_request_message(request_message)" }, { "docstring": "Loads the response message from yaml asserting it deserialized properly.", "name": "load", "signature": "def load(...
2
stack_v2_sparse_classes_30k_train_018701
Implement the Python class `ResponseMessage` described below. Class description: Class for response messages. Method signatures and docstrings: - def from_request_message(request_message): Builds a response object from a request object. - def load(message_yaml): Loads the response message from yaml asserting it deser...
Implement the Python class `ResponseMessage` described below. Class description: Class for response messages. Method signatures and docstrings: - def from_request_message(request_message): Builds a response object from a request object. - def load(message_yaml): Loads the response message from yaml asserting it deser...
0051a4b09a0c5d5f0de8bd923b928d75516d3186
<|skeleton|> class ResponseMessage: """Class for response messages.""" def from_request_message(request_message): """Builds a response object from a request object.""" <|body_0|> def load(message_yaml): """Loads the response message from yaml asserting it deserialized properly.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResponseMessage: """Class for response messages.""" def from_request_message(request_message): """Builds a response object from a request object.""" response_message = ResponseMessage() response_message.callback_url = request_message.callback_url response_message.job_id = ...
the_stack_v2_python_sparse
daedalus/queueing/messages.py
Millz0r/daedalus
train
0
d68e3a533f938063ed96f3d578dd16a22cab9d04
[ "result = 0\nif len(s) == 1:\n return 1\nfor i in range(len(s)):\n print(s[i])\n hashset = []\n length = 0\n for j in range(i, len(s)):\n if s[j] not in hashset:\n length += 1\n hashset.append(s[j])\n print(hashset)\n else:\n break\n if...
<|body_start_0|> result = 0 if len(s) == 1: return 1 for i in range(len(s)): print(s[i]) hashset = [] length = 0 for j in range(i, len(s)): if s[j] not in hashset: length += 1 hash...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def lengthOfLongestSubstring_slow(self, s): """:type s: str :rtype: int""" <|body_0|> def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> result = 0 if len(s) == 1: ...
stack_v2_sparse_classes_36k_train_001098
2,188
no_license
[ { "docstring": ":type s: str :rtype: int", "name": "lengthOfLongestSubstring_slow", "signature": "def lengthOfLongestSubstring_slow(self, s)" }, { "docstring": ":type s: str :rtype: int", "name": "lengthOfLongestSubstring", "signature": "def lengthOfLongestSubstring(self, s)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLongestSubstring_slow(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLongestSubstring_slow(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int <|skeleton|> class Solution: def leng...
4d7e675c795c841f99ca95b8b60c4995bcb632fb
<|skeleton|> class Solution: def lengthOfLongestSubstring_slow(self, s): """:type s: str :rtype: int""" <|body_0|> def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def lengthOfLongestSubstring_slow(self, s): """:type s: str :rtype: int""" result = 0 if len(s) == 1: return 1 for i in range(len(s)): print(s[i]) hashset = [] length = 0 for j in range(i, len(s)): ...
the_stack_v2_python_sparse
lengthOfLongestSubstring.py
stephenchenxj/myLeetCode
train
0
9cb433bc086e2861ea778fdee2a14ea07c547f16
[ "payoff_fn = payoff_utils.make_basket_put_payoff([1.1, 1.2], dtype=dtype)\nsample_paths = tf.convert_to_tensor(_SAMPLES, dtype=dtype)\nsample_paths = tf.expand_dims(sample_paths, -1)\npayoff = payoff_fn(sample_paths, 3)\nexpected_payoff = [[0, 0], [0, 0], [0.07, 0.17], [0.18, 0.28], [0, 0], [0.2, 0.3], [0.09, 0.19]...
<|body_start_0|> payoff_fn = payoff_utils.make_basket_put_payoff([1.1, 1.2], dtype=dtype) sample_paths = tf.convert_to_tensor(_SAMPLES, dtype=dtype) sample_paths = tf.expand_dims(sample_paths, -1) payoff = payoff_fn(sample_paths, 3) expected_payoff = [[0, 0], [0, 0], [0.07, 0.17]...
PayoffTest
[ "Apache-2.0", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PayoffTest: def test_put_payoff_function(self, dtype): """Tests the put payoff function for a batch of strikes.""" <|body_0|> def test_put_payoff_function_batch(self, dtype): """Tests the put payoff function for a batch of samples.""" <|body_1|> <|end_skelet...
stack_v2_sparse_classes_36k_train_001099
3,627
permissive
[ { "docstring": "Tests the put payoff function for a batch of strikes.", "name": "test_put_payoff_function", "signature": "def test_put_payoff_function(self, dtype)" }, { "docstring": "Tests the put payoff function for a batch of samples.", "name": "test_put_payoff_function_batch", "signa...
2
null
Implement the Python class `PayoffTest` described below. Class description: Implement the PayoffTest class. Method signatures and docstrings: - def test_put_payoff_function(self, dtype): Tests the put payoff function for a batch of strikes. - def test_put_payoff_function_batch(self, dtype): Tests the put payoff funct...
Implement the Python class `PayoffTest` described below. Class description: Implement the PayoffTest class. Method signatures and docstrings: - def test_put_payoff_function(self, dtype): Tests the put payoff function for a batch of strikes. - def test_put_payoff_function_batch(self, dtype): Tests the put payoff funct...
0d3a2193c0f2d320b65e602cf01d7a617da484df
<|skeleton|> class PayoffTest: def test_put_payoff_function(self, dtype): """Tests the put payoff function for a batch of strikes.""" <|body_0|> def test_put_payoff_function_batch(self, dtype): """Tests the put payoff function for a batch of samples.""" <|body_1|> <|end_skelet...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PayoffTest: def test_put_payoff_function(self, dtype): """Tests the put payoff function for a batch of strikes.""" payoff_fn = payoff_utils.make_basket_put_payoff([1.1, 1.2], dtype=dtype) sample_paths = tf.convert_to_tensor(_SAMPLES, dtype=dtype) sample_paths = tf.expand_dims(s...
the_stack_v2_python_sparse
tf_quant_finance/experimental/lsm_algorithm/payoff_test.py
google/tf-quant-finance
train
4,165