blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
7.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
467
8.64k
id
stringlengths
40
40
length_bytes
int64
515
49.7k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
160
3.93k
prompted_full_text
stringlengths
681
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.09k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
331
8.3k
source
stringclasses
1 value
source_path
stringlengths
5
177
source_repo
stringlengths
6
88
split
stringclasses
1 value
star_events_count
int64
0
209k
e661330204e9fe0062cfb9fc6c7a668abb66c9b2
[ "self.barcode = barcode\nself.location = location\nself.online = online", "if dictionary is None:\n return None\nbarcode = dictionary.get('barcode')\nlocation = dictionary.get('location')\nonline = dictionary.get('online')\nreturn cls(barcode, location, online)" ]
<|body_start_0|> self.barcode = barcode self.location = location self.online = online <|end_body_0|> <|body_start_1|> if dictionary is None: return None barcode = dictionary.get('barcode') location = dictionary.get('location') online = dictionary.get(...
Implementation of the 'TapeMediaInformation' model. Provides information about a single tape media in a QStar Archive Vault. Attributes: barcode (string): Specifies a unique identifier for the media. location (string): Specifies the location of the offline media as recorded by the backup administrator using media manag...
TapeMediaInformation
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TapeMediaInformation: """Implementation of the 'TapeMediaInformation' model. Provides information about a single tape media in a QStar Archive Vault. Attributes: barcode (string): Specifies a unique identifier for the media. location (string): Specifies the location of the offline media as record...
stack_v2_sparse_classes_10k_train_000200
2,046
permissive
[ { "docstring": "Constructor for the TapeMediaInformation class", "name": "__init__", "signature": "def __init__(self, barcode=None, location=None, online=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of th...
2
null
Implement the Python class `TapeMediaInformation` described below. Class description: Implementation of the 'TapeMediaInformation' model. Provides information about a single tape media in a QStar Archive Vault. Attributes: barcode (string): Specifies a unique identifier for the media. location (string): Specifies the ...
Implement the Python class `TapeMediaInformation` described below. Class description: Implementation of the 'TapeMediaInformation' model. Provides information about a single tape media in a QStar Archive Vault. Attributes: barcode (string): Specifies a unique identifier for the media. location (string): Specifies the ...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class TapeMediaInformation: """Implementation of the 'TapeMediaInformation' model. Provides information about a single tape media in a QStar Archive Vault. Attributes: barcode (string): Specifies a unique identifier for the media. location (string): Specifies the location of the offline media as record...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TapeMediaInformation: """Implementation of the 'TapeMediaInformation' model. Provides information about a single tape media in a QStar Archive Vault. Attributes: barcode (string): Specifies a unique identifier for the media. location (string): Specifies the location of the offline media as recorded by the bac...
the_stack_v2_python_sparse
cohesity_management_sdk/models/tape_media_information.py
cohesity/management-sdk-python
train
24
0126f64812040aae7c9392b31cee9eae8dc1bc8e
[ "self.azdeg = azdeg\nself.altdeg = altdeg\nself.hsv_min_val = hsv_min_val\nself.hsv_max_val = hsv_max_val\nself.hsv_min_sat = hsv_min_sat\nself.hsv_max_sat = hsv_max_sat", "if minval == None:\n minval = data.min()\nnormdata = (data - minval) / (data.max() - minval)\nrgb0 = cmap(normdata)\nrgb1 = self.shade_rgb...
<|body_start_0|> self.azdeg = azdeg self.altdeg = altdeg self.hsv_min_val = hsv_min_val self.hsv_max_val = hsv_max_val self.hsv_min_sat = hsv_min_sat self.hsv_max_sat = hsv_max_sat <|end_body_0|> <|body_start_1|> if minval == None: minval = data.min()...
Create a light source coming from the specified azimuth and elevation. Angles are in degrees, with the azimuth measured clockwise from north and elevation up from the zero plane of the surface. The :meth:`shade` is used to produce rgb values for a shaded relief image given a data array. Original in matplotlib.colors, m...
LightSource
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LightSource: """Create a light source coming from the specified azimuth and elevation. Angles are in degrees, with the azimuth measured clockwise from north and elevation up from the zero plane of the surface. The :meth:`shade` is used to produce rgb values for a shaded relief image given a data ...
stack_v2_sparse_classes_10k_train_000201
5,066
no_license
[ { "docstring": "Specify the azimuth (measured clockwise from south) and altitude (measured up from the plane of the surface) of the light source in degrees. The color of the resulting image will be darkened by moving the (s,v) values (in hsv colorspace) toward (hsv_min_sat, hsv_min_val) in the shaded regions, o...
3
stack_v2_sparse_classes_30k_train_002657
Implement the Python class `LightSource` described below. Class description: Create a light source coming from the specified azimuth and elevation. Angles are in degrees, with the azimuth measured clockwise from north and elevation up from the zero plane of the surface. The :meth:`shade` is used to produce rgb values ...
Implement the Python class `LightSource` described below. Class description: Create a light source coming from the specified azimuth and elevation. Angles are in degrees, with the azimuth measured clockwise from north and elevation up from the zero plane of the surface. The :meth:`shade` is used to produce rgb values ...
6e39008842de8a0fb4a9879b53b8a67339b37aff
<|skeleton|> class LightSource: """Create a light source coming from the specified azimuth and elevation. Angles are in degrees, with the azimuth measured clockwise from north and elevation up from the zero plane of the surface. The :meth:`shade` is used to produce rgb values for a shaded relief image given a data ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LightSource: """Create a light source coming from the specified azimuth and elevation. Angles are in degrees, with the azimuth measured clockwise from north and elevation up from the zero plane of the surface. The :meth:`shade` is used to produce rgb values for a shaded relief image given a data array. Origin...
the_stack_v2_python_sparse
python/lib/myLightSource.py
gutmann/scripted_sufferin_succotash
train
2
dc83002818180a7301698d0cdf59d8b35b05bd48
[ "try:\n return super().emit(record)\nexcept FileNotFoundError:\n return self._emit_safely(record)\nexcept OSError as exception:\n if exception.errno == errno.ESTALE:\n return self._emit_safely(record)\n else:\n raise", "ATTEMPTS_MAX = 8\nSLEEP_INTERVAL = 0.1\nfor attempt_index in range(A...
<|body_start_0|> try: return super().emit(record) except FileNotFoundError: return self._emit_safely(record) except OSError as exception: if exception.errno == errno.ESTALE: return self._emit_safely(record) else: rai...
Process-safe rotating file handler. The standard :class:`RotatingFileHandler` class is thread- but *not* process-safe. Concurrent attempts to log to the same physical file from multiple processes can and typically will produce fatal race conditions producing raised exceptions from one or more of these processes. On log...
LogHandlerFileRotateSafe
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LogHandlerFileRotateSafe: """Process-safe rotating file handler. The standard :class:`RotatingFileHandler` class is thread- but *not* process-safe. Concurrent attempts to log to the same physical file from multiple processes can and typically will produce fatal race conditions producing raised ex...
stack_v2_sparse_classes_10k_train_000202
17,464
no_license
[ { "docstring": "Log the passed logging record in a thread- *and* process-safe manner. Parameters ---------- record : LogRecord Logging record to be logged. Raises ---------- BetseLogRaceException If this method detects but fails to automatically resolve a logging race condition between multiple processes concur...
2
null
Implement the Python class `LogHandlerFileRotateSafe` described below. Class description: Process-safe rotating file handler. The standard :class:`RotatingFileHandler` class is thread- but *not* process-safe. Concurrent attempts to log to the same physical file from multiple processes can and typically will produce fa...
Implement the Python class `LogHandlerFileRotateSafe` described below. Class description: Process-safe rotating file handler. The standard :class:`RotatingFileHandler` class is thread- but *not* process-safe. Concurrent attempts to log to the same physical file from multiple processes can and typically will produce fa...
dd03ff5e3df3ef48d887a6566a6286fcd168880b
<|skeleton|> class LogHandlerFileRotateSafe: """Process-safe rotating file handler. The standard :class:`RotatingFileHandler` class is thread- but *not* process-safe. Concurrent attempts to log to the same physical file from multiple processes can and typically will produce fatal race conditions producing raised ex...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LogHandlerFileRotateSafe: """Process-safe rotating file handler. The standard :class:`RotatingFileHandler` class is thread- but *not* process-safe. Concurrent attempts to log to the same physical file from multiple processes can and typically will produce fatal race conditions producing raised exceptions from...
the_stack_v2_python_sparse
betse/util/io/log/conf/logconfhandle.py
R-Stefano/betse-ml
train
0
2953b686abaa2b3c6de42c0caabe3de2bd560112
[ "n = len(stations)\nF = [0] * (n + 1)\nF[0] = startFuel\nfor i, (loc, cap) in enumerate(stations):\n for t in range(i, -1, -1):\n if F[t] >= loc:\n F[t + 1] = max(F[t + 1], F[t] + cap)\nfor i, d in enumerate(F):\n if d >= target:\n return i\nreturn -1", "i = res = 0\npq = []\ncur = ...
<|body_start_0|> n = len(stations) F = [0] * (n + 1) F[0] = startFuel for i, (loc, cap) in enumerate(stations): for t in range(i, -1, -1): if F[t] >= loc: F[t + 1] = max(F[t + 1], F[t] + cap) for i, d in enumerate(F): if...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def minRefuelStopsDP(self, target, startFuel, stations): """:type target: int :type startFuel: int :type stations: List[List[int]] :rtype: int""" <|body_0|> def minRefuelStops(self, target, startFuel, stations): """:type target: int :type startFuel: int :ty...
stack_v2_sparse_classes_10k_train_000203
3,918
no_license
[ { "docstring": ":type target: int :type startFuel: int :type stations: List[List[int]] :rtype: int", "name": "minRefuelStopsDP", "signature": "def minRefuelStopsDP(self, target, startFuel, stations)" }, { "docstring": ":type target: int :type startFuel: int :type stations: List[List[int]] :rtype...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minRefuelStopsDP(self, target, startFuel, stations): :type target: int :type startFuel: int :type stations: List[List[int]] :rtype: int - def minRefuelStops(self, target, sta...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minRefuelStopsDP(self, target, startFuel, stations): :type target: int :type startFuel: int :type stations: List[List[int]] :rtype: int - def minRefuelStops(self, target, sta...
810575368ecffa97677bdb51744d1f716140bbb1
<|skeleton|> class Solution: def minRefuelStopsDP(self, target, startFuel, stations): """:type target: int :type startFuel: int :type stations: List[List[int]] :rtype: int""" <|body_0|> def minRefuelStops(self, target, startFuel, stations): """:type target: int :type startFuel: int :ty...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def minRefuelStopsDP(self, target, startFuel, stations): """:type target: int :type startFuel: int :type stations: List[List[int]] :rtype: int""" n = len(stations) F = [0] * (n + 1) F[0] = startFuel for i, (loc, cap) in enumerate(stations): for t i...
the_stack_v2_python_sparse
M/MinimumNumberofRefuelingStops.py
bssrdf/pyleet
train
2
1fe89e0523c9160939709328d164a6fb22522b9e
[ "counter = 0\nwhile head:\n counter += 1\n head = head.next\nreturn counter", "for i in range(size - 1):\n if not head:\n break\n head = head.next\nif not head:\n return None\nnext_start, head.next = (head.next, None)\nreturn next_start", "curr = dummy_start\nwhile l1 and l2:\n if l1.va...
<|body_start_0|> counter = 0 while head: counter += 1 head = head.next return counter <|end_body_0|> <|body_start_1|> for i in range(size - 1): if not head: break head = head.next if not head: return Non...
Algorithm: Bottom Up Merge Sort 1) Start with splitting the list into sublists of size 1. Each adjacent pair of sublists of size 1 is merged in sorted order. After the first iteration, we get the sorted lists of size 2. A similar process is repeated for a sublist of size 2. In this way, we iteratively split the list in...
Solution2
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution2: """Algorithm: Bottom Up Merge Sort 1) Start with splitting the list into sublists of size 1. Each adjacent pair of sublists of size 1 is merged in sorted order. After the first iteration, we get the sorted lists of size 2. A similar process is repeated for a sublist of size 2. In this ...
stack_v2_sparse_classes_10k_train_000204
4,593
permissive
[ { "docstring": "Count the length of the linked list", "name": "get_size", "signature": "def get_size(self, head: ListNode) -> int" }, { "docstring": "Given the head & size, return the start node of the next chunk", "name": "split", "signature": "def split(self, head: ListNode, size: int)...
4
null
Implement the Python class `Solution2` described below. Class description: Algorithm: Bottom Up Merge Sort 1) Start with splitting the list into sublists of size 1. Each adjacent pair of sublists of size 1 is merged in sorted order. After the first iteration, we get the sorted lists of size 2. A similar process is rep...
Implement the Python class `Solution2` described below. Class description: Algorithm: Bottom Up Merge Sort 1) Start with splitting the list into sublists of size 1. Each adjacent pair of sublists of size 1 is merged in sorted order. After the first iteration, we get the sorted lists of size 2. A similar process is rep...
9f66d352c805fcdd9930aaa18c93d7546768287c
<|skeleton|> class Solution2: """Algorithm: Bottom Up Merge Sort 1) Start with splitting the list into sublists of size 1. Each adjacent pair of sublists of size 1 is merged in sorted order. After the first iteration, we get the sorted lists of size 2. A similar process is repeated for a sublist of size 2. In this ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution2: """Algorithm: Bottom Up Merge Sort 1) Start with splitting the list into sublists of size 1. Each adjacent pair of sublists of size 1 is merged in sorted order. After the first iteration, we get the sorted lists of size 2. A similar process is repeated for a sublist of size 2. In this way, we itera...
the_stack_v2_python_sparse
medium/148_sort_list.py
niki4/leetcode_py3
train
0
56bab1c0af90187458995f68217f93e7f210ec5c
[ "for k, v in classdict.iteritems():\n if isinstance(v, TraitType):\n v._attr_name = k\n elif inspect.isclass(v):\n if issubclass(v, TraitType):\n vinst = v()\n vinst._attr_name = k\n classdict[k] = vinst\nreturn super(MetaHasTraits, mcls).__new__(mcls, name, base...
<|body_start_0|> for k, v in classdict.iteritems(): if isinstance(v, TraitType): v._attr_name = k elif inspect.isclass(v): if issubclass(v, TraitType): vinst = v() vinst._attr_name = k classdict[k...
A metaclass for HasTraits. This metaclass makes sure that any TraitType class attributes are instantiated and sets their name attribute.
MetaHasTraits
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MetaHasTraits: """A metaclass for HasTraits. This metaclass makes sure that any TraitType class attributes are instantiated and sets their name attribute.""" def __new__(mcls, name, bases, classdict): """Create the HasTraits class. This instantiates all TraitTypes in the class dict a...
stack_v2_sparse_classes_10k_train_000205
34,850
no_license
[ { "docstring": "Create the HasTraits class. This instantiates all TraitTypes in the class dict and sets their :attr:`name` attribute.", "name": "__new__", "signature": "def __new__(mcls, name, bases, classdict)" }, { "docstring": "Finish initializing the HasTraits class. This sets the :attr:`thi...
2
null
Implement the Python class `MetaHasTraits` described below. Class description: A metaclass for HasTraits. This metaclass makes sure that any TraitType class attributes are instantiated and sets their name attribute. Method signatures and docstrings: - def __new__(mcls, name, bases, classdict): Create the HasTraits cl...
Implement the Python class `MetaHasTraits` described below. Class description: A metaclass for HasTraits. This metaclass makes sure that any TraitType class attributes are instantiated and sets their name attribute. Method signatures and docstrings: - def __new__(mcls, name, bases, classdict): Create the HasTraits cl...
5e7cc7de3495145501ca53deb9efee2233ab7e1c
<|skeleton|> class MetaHasTraits: """A metaclass for HasTraits. This metaclass makes sure that any TraitType class attributes are instantiated and sets their name attribute.""" def __new__(mcls, name, bases, classdict): """Create the HasTraits class. This instantiates all TraitTypes in the class dict a...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MetaHasTraits: """A metaclass for HasTraits. This metaclass makes sure that any TraitType class attributes are instantiated and sets their name attribute.""" def __new__(mcls, name, bases, classdict): """Create the HasTraits class. This instantiates all TraitTypes in the class dict and sets their...
the_stack_v2_python_sparse
Extensions/Deal Package/FPythonCode/traitlets.py
webclinic017/fa-absa-py3
train
0
48ea98bd23f30124ef17e5a15fb824db40c94602
[ "my_dim = symbol.shape[index]\nif isinstance(my_dim, ArrayType.ArrayBounds):\n lower_bound = my_dim.lower.copy()\n upper_bound = my_dim.upper.copy()\n step = Literal('1', INTEGER_TYPE)\n return (lower_bound, upper_bound, step)\nlower_bound = BinaryOperation.create(BinaryOperation.Operator.LBOUND, Refere...
<|body_start_0|> my_dim = symbol.shape[index] if isinstance(my_dim, ArrayType.ArrayBounds): lower_bound = my_dim.lower.copy() upper_bound = my_dim.upper.copy() step = Literal('1', INTEGER_TYPE) return (lower_bound, upper_bound, step) lower_bound = ...
Provides a transformation from PSyIR Array Notation (a reference to an Array) to a PSyIR Range. For example: >>> from psyclone.psyir.backend.fortran import FortranWriter >>> from psyclone.psyir.frontend.fortran import FortranReader >>> from psyclone.psyir.nodes import Reference >>> from psyclone.psyir.transformations i...
Reference2ArrayRangeTrans
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Reference2ArrayRangeTrans: """Provides a transformation from PSyIR Array Notation (a reference to an Array) to a PSyIR Range. For example: >>> from psyclone.psyir.backend.fortran import FortranWriter >>> from psyclone.psyir.frontend.fortran import FortranReader >>> from psyclone.psyir.nodes impor...
stack_v2_sparse_classes_10k_train_000206
8,629
permissive
[ { "docstring": "A utility function that returns the appropriate loop bounds (lower, upper and step) for an array dimension. If the array dimension is declared with known bounds (an integer or a symbol) then these bound values are used. If the size is unknown (a deferred or attribute type) then the LBOUND and UB...
3
null
Implement the Python class `Reference2ArrayRangeTrans` described below. Class description: Provides a transformation from PSyIR Array Notation (a reference to an Array) to a PSyIR Range. For example: >>> from psyclone.psyir.backend.fortran import FortranWriter >>> from psyclone.psyir.frontend.fortran import FortranRea...
Implement the Python class `Reference2ArrayRangeTrans` described below. Class description: Provides a transformation from PSyIR Array Notation (a reference to an Array) to a PSyIR Range. For example: >>> from psyclone.psyir.backend.fortran import FortranWriter >>> from psyclone.psyir.frontend.fortran import FortranRea...
0b149bc5a76ca85c1dd086c3aa813102d0d04b56
<|skeleton|> class Reference2ArrayRangeTrans: """Provides a transformation from PSyIR Array Notation (a reference to an Array) to a PSyIR Range. For example: >>> from psyclone.psyir.backend.fortran import FortranWriter >>> from psyclone.psyir.frontend.fortran import FortranReader >>> from psyclone.psyir.nodes impor...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Reference2ArrayRangeTrans: """Provides a transformation from PSyIR Array Notation (a reference to an Array) to a PSyIR Range. For example: >>> from psyclone.psyir.backend.fortran import FortranWriter >>> from psyclone.psyir.frontend.fortran import FortranReader >>> from psyclone.psyir.nodes import Reference >...
the_stack_v2_python_sparse
src/psyclone/psyir/transformations/reference2arrayrange_trans.py
stfc/PSyclone
train
100
e62b74496c87aac076888d250cd87196b15b6f45
[ "selected_severities = self._parameter('severities')\nseverities: dict[str, set[Severity]] = {}\nnr_vulnerabilities: dict[str, int] = {}\nexample_vulnerability = {}\nvulnerabilities = cast(JSONDict, json).get('vulnerabilities', [])\nfor vulnerability in vulnerabilities:\n if (severity := vulnerability['severity'...
<|body_start_0|> selected_severities = self._parameter('severities') severities: dict[str, set[Severity]] = {} nr_vulnerabilities: dict[str, int] = {} example_vulnerability = {} vulnerabilities = cast(JSONDict, json).get('vulnerabilities', []) for vulnerability in vulnera...
Snyk collector for security warnings.
SnykSecurityWarnings
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SnykSecurityWarnings: """Snyk collector for security warnings.""" def _parse_json(self, json: JSON, filename: str) -> Entities: """Parse the direct dependencies with vulnerabilities from the JSON.""" <|body_0|> def __highest_severity(severities: Collection[Severity]) -> ...
stack_v2_sparse_classes_10k_train_000207
2,290
permissive
[ { "docstring": "Parse the direct dependencies with vulnerabilities from the JSON.", "name": "_parse_json", "signature": "def _parse_json(self, json: JSON, filename: str) -> Entities" }, { "docstring": "Return the highest severity from a collection of severities.", "name": "__highest_severity...
2
null
Implement the Python class `SnykSecurityWarnings` described below. Class description: Snyk collector for security warnings. Method signatures and docstrings: - def _parse_json(self, json: JSON, filename: str) -> Entities: Parse the direct dependencies with vulnerabilities from the JSON. - def __highest_severity(sever...
Implement the Python class `SnykSecurityWarnings` described below. Class description: Snyk collector for security warnings. Method signatures and docstrings: - def _parse_json(self, json: JSON, filename: str) -> Entities: Parse the direct dependencies with vulnerabilities from the JSON. - def __highest_severity(sever...
5d9952bf0bd47895824fa78428d3e4f4d6b5d9b3
<|skeleton|> class SnykSecurityWarnings: """Snyk collector for security warnings.""" def _parse_json(self, json: JSON, filename: str) -> Entities: """Parse the direct dependencies with vulnerabilities from the JSON.""" <|body_0|> def __highest_severity(severities: Collection[Severity]) -> ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SnykSecurityWarnings: """Snyk collector for security warnings.""" def _parse_json(self, json: JSON, filename: str) -> Entities: """Parse the direct dependencies with vulnerabilities from the JSON.""" selected_severities = self._parameter('severities') severities: dict[str, set[Sev...
the_stack_v2_python_sparse
components/collector/src/source_collectors/snyk/security_warnings.py
ICTU/quality-time
train
43
753a81471fb52b8e60e24106398a3c5cc360dbff
[ "data_dict = {}\nfor key, value in request.POST.items():\n data_dict[key] = value\nsign = data_dict.pop('sign', None)\nalipay = AliPay(appid='', app_notify_url='http://127.0.0.1:8000/alipay_return/', app_private_key_path=private_key, alipay_public_key_path=ali_key, debug=True, return_url='http://127.0.0.1:8000/a...
<|body_start_0|> data_dict = {} for key, value in request.POST.items(): data_dict[key] = value sign = data_dict.pop('sign', None) alipay = AliPay(appid='', app_notify_url='http://127.0.0.1:8000/alipay_return/', app_private_key_path=private_key, alipay_public_key_path=ali_key,...
AliPayView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AliPayView: def post(self, request): """处理支付宝的notify_url""" <|body_0|> def get(self, request): """处理支付宝的return_url返回""" <|body_1|> <|end_skeleton|> <|body_start_0|> data_dict = {} for key, value in request.POST.items(): data_dict...
stack_v2_sparse_classes_10k_train_000208
10,394
no_license
[ { "docstring": "处理支付宝的notify_url", "name": "post", "signature": "def post(self, request)" }, { "docstring": "处理支付宝的return_url返回", "name": "get", "signature": "def get(self, request)" } ]
2
stack_v2_sparse_classes_30k_train_006000
Implement the Python class `AliPayView` described below. Class description: Implement the AliPayView class. Method signatures and docstrings: - def post(self, request): 处理支付宝的notify_url - def get(self, request): 处理支付宝的return_url返回
Implement the Python class `AliPayView` described below. Class description: Implement the AliPayView class. Method signatures and docstrings: - def post(self, request): 处理支付宝的notify_url - def get(self, request): 处理支付宝的return_url返回 <|skeleton|> class AliPayView: def post(self, request): """处理支付宝的notify_u...
5620f09cd6d2a99e7643d5ec0b6bc9e1203be6fe
<|skeleton|> class AliPayView: def post(self, request): """处理支付宝的notify_url""" <|body_0|> def get(self, request): """处理支付宝的return_url返回""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AliPayView: def post(self, request): """处理支付宝的notify_url""" data_dict = {} for key, value in request.POST.items(): data_dict[key] = value sign = data_dict.pop('sign', None) alipay = AliPay(appid='', app_notify_url='http://127.0.0.1:8000/alipay_return/', app_...
the_stack_v2_python_sparse
apps/trade/views.py
DzrJob/gulishop
train
0
d834640f05fce79682538d143639c783972b6f2b
[ "if set(s) & set(''.join(wordDict)) != set(s):\n return (False, {})\ndic_head, table, max_len = ({}, [0] * len(s) + [1], max(map(len, wordDict)))\nfor word in wordDict:\n if word[0] not in dic_head:\n dic_head[word[0]] = set([word])\n else:\n dic_head[word[0]].add(word)\nfor i in range(len(s)...
<|body_start_0|> if set(s) & set(''.join(wordDict)) != set(s): return (False, {}) dic_head, table, max_len = ({}, [0] * len(s) + [1], max(map(len, wordDict))) for word in wordDict: if word[0] not in dic_head: dic_head[word[0]] = set([word]) els...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def wordBreak1(self, s, wordDict): """:type s: str :type wordDict: List[str] :rtype: bool""" <|body_0|> def wordBreak(self, s, wordDict): """:type s: str :type wordDict: List[str] :rtype: List[str]""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_10k_train_000209
1,679
no_license
[ { "docstring": ":type s: str :type wordDict: List[str] :rtype: bool", "name": "wordBreak1", "signature": "def wordBreak1(self, s, wordDict)" }, { "docstring": ":type s: str :type wordDict: List[str] :rtype: List[str]", "name": "wordBreak", "signature": "def wordBreak(self, s, wordDict)" ...
2
stack_v2_sparse_classes_30k_test_000115
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wordBreak1(self, s, wordDict): :type s: str :type wordDict: List[str] :rtype: bool - def wordBreak(self, s, wordDict): :type s: str :type wordDict: List[str] :rtype: List[str...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wordBreak1(self, s, wordDict): :type s: str :type wordDict: List[str] :rtype: bool - def wordBreak(self, s, wordDict): :type s: str :type wordDict: List[str] :rtype: List[str...
c767e3794455c5105ca34714a3e15101f4962f4d
<|skeleton|> class Solution: def wordBreak1(self, s, wordDict): """:type s: str :type wordDict: List[str] :rtype: bool""" <|body_0|> def wordBreak(self, s, wordDict): """:type s: str :type wordDict: List[str] :rtype: List[str]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def wordBreak1(self, s, wordDict): """:type s: str :type wordDict: List[str] :rtype: bool""" if set(s) & set(''.join(wordDict)) != set(s): return (False, {}) dic_head, table, max_len = ({}, [0] * len(s) + [1], max(map(len, wordDict))) for word in wordDict:...
the_stack_v2_python_sparse
140/WordBreakII.py
basto11/leetcode
train
0
f899d4e2c3627bdd3816386c0e610bf62e9e3bb1
[ "self.capacity = capacity\nself.values = {}\nself.freq_time = {}\nself.least_used = []\nself.update = set()\nself.time = 0", "self.time += 1\nif key in self.values:\n self.update.add(key)\n self.freq_time[key] = (self.freq_time[key][0] + 1, self.time)\n return self.values[key]\nreturn -1", "if self.cap...
<|body_start_0|> self.capacity = capacity self.values = {} self.freq_time = {} self.least_used = [] self.update = set() self.time = 0 <|end_body_0|> <|body_start_1|> self.time += 1 if key in self.values: self.update.add(key) self.f...
LFUCache
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LFUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: None""" <|body_2|> <|end_s...
stack_v2_sparse_classes_10k_train_000210
4,992
no_license
[ { "docstring": ":type capacity: int", "name": "__init__", "signature": "def __init__(self, capacity)" }, { "docstring": ":type key: int :rtype: int", "name": "get", "signature": "def get(self, key)" }, { "docstring": ":type key: int :type value: int :rtype: None", "name": "pu...
3
null
Implement the Python class `LFUCache` described below. Class description: Implement the LFUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: None
Implement the Python class `LFUCache` described below. Class description: Implement the LFUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: None <|sk...
36d7f9e967a62db77622e0888f61999d7f37579a
<|skeleton|> class LFUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: None""" <|body_2|> <|end_s...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LFUCache: def __init__(self, capacity): """:type capacity: int""" self.capacity = capacity self.values = {} self.freq_time = {} self.least_used = [] self.update = set() self.time = 0 def get(self, key): """:type key: int :rtype: int""" ...
the_stack_v2_python_sparse
P0460.py
westgate458/LeetCode
train
0
3aafd25d5d4eb023f194ab6e87c861f0a9cf8591
[ "self.description = description\nself.icap_uri = icap_uri\nself.tag = tag\nself.tag_id = tag_id", "if dictionary is None:\n return None\ndescription = dictionary.get('description')\nicap_uri = dictionary.get('icapUri')\ntag = dictionary.get('tag')\ntag_id = dictionary.get('tagId')\nreturn cls(description, icap...
<|body_start_0|> self.description = description self.icap_uri = icap_uri self.tag = tag self.tag_id = tag_id <|end_body_0|> <|body_start_1|> if dictionary is None: return None description = dictionary.get('description') icap_uri = dictionary.get('icap...
Implementation of the 'AntivirusServiceConfig' model. Specifies configuration settings for antivirus service provider. Attributes: description (string): Specifies the description of the Antivirus service. This could be any additional information admin might associate with the Antivirus service. icap_uri (string, requir...
AntivirusServiceConfig
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AntivirusServiceConfig: """Implementation of the 'AntivirusServiceConfig' model. Specifies configuration settings for antivirus service provider. Attributes: description (string): Specifies the description of the Antivirus service. This could be any additional information admin might associate wi...
stack_v2_sparse_classes_10k_train_000211
2,737
permissive
[ { "docstring": "Constructor for the AntivirusServiceConfig class", "name": "__init__", "signature": "def __init__(self, description=None, icap_uri=None, tag=None, tag_id=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary repr...
2
stack_v2_sparse_classes_30k_test_000278
Implement the Python class `AntivirusServiceConfig` described below. Class description: Implementation of the 'AntivirusServiceConfig' model. Specifies configuration settings for antivirus service provider. Attributes: description (string): Specifies the description of the Antivirus service. This could be any addition...
Implement the Python class `AntivirusServiceConfig` described below. Class description: Implementation of the 'AntivirusServiceConfig' model. Specifies configuration settings for antivirus service provider. Attributes: description (string): Specifies the description of the Antivirus service. This could be any addition...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class AntivirusServiceConfig: """Implementation of the 'AntivirusServiceConfig' model. Specifies configuration settings for antivirus service provider. Attributes: description (string): Specifies the description of the Antivirus service. This could be any additional information admin might associate wi...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AntivirusServiceConfig: """Implementation of the 'AntivirusServiceConfig' model. Specifies configuration settings for antivirus service provider. Attributes: description (string): Specifies the description of the Antivirus service. This could be any additional information admin might associate with the Antivi...
the_stack_v2_python_sparse
cohesity_management_sdk/models/antivirus_service_config.py
cohesity/management-sdk-python
train
24
419e4b405dadef0750c4e33c5bba58c4480eb286
[ "import collections\nwordList = set(wordList)\nres = []\nlayer = {}\nlayer[beginWord] = [[beginWord]]\nwhile layer:\n newlayer = collections.defaultdict(list)\n for w in layer:\n if w == endWord:\n res.extend((k for k in layer[w]))\n else:\n for i in range(len(w)):\n ...
<|body_start_0|> import collections wordList = set(wordList) res = [] layer = {} layer[beginWord] = [[beginWord]] while layer: newlayer = collections.defaultdict(list) for w in layer: if w == endWord: res.extend(...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findLadders(self, beginWord, endWord, wordList): """:type beginWord: str :type endWord: str :type wordList: List[str] :rtype: List[List[str]]""" <|body_0|> def rewrite(self, beginWord, endWord, wordList): """:type beginWord: str :type endWord: str :type...
stack_v2_sparse_classes_10k_train_000212
3,718
no_license
[ { "docstring": ":type beginWord: str :type endWord: str :type wordList: List[str] :rtype: List[List[str]]", "name": "findLadders", "signature": "def findLadders(self, beginWord, endWord, wordList)" }, { "docstring": ":type beginWord: str :type endWord: str :type wordList: List[str] :rtype: List[...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findLadders(self, beginWord, endWord, wordList): :type beginWord: str :type endWord: str :type wordList: List[str] :rtype: List[List[str]] - def rewrite(self, beginWord, endW...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findLadders(self, beginWord, endWord, wordList): :type beginWord: str :type endWord: str :type wordList: List[str] :rtype: List[List[str]] - def rewrite(self, beginWord, endW...
6350568d16b0f8c49a020f055bb6d72e2705ea56
<|skeleton|> class Solution: def findLadders(self, beginWord, endWord, wordList): """:type beginWord: str :type endWord: str :type wordList: List[str] :rtype: List[List[str]]""" <|body_0|> def rewrite(self, beginWord, endWord, wordList): """:type beginWord: str :type endWord: str :type...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def findLadders(self, beginWord, endWord, wordList): """:type beginWord: str :type endWord: str :type wordList: List[str] :rtype: List[List[str]]""" import collections wordList = set(wordList) res = [] layer = {} layer[beginWord] = [[beginWord]] ...
the_stack_v2_python_sparse
co_uber/126_Word_Ladder_II.py
vsdrun/lc_public
train
6
7000d09ce1911516e95c6854d1d136d5296b782b
[ "TaskManager.__init__(self)\ntask.props[_KEY_MIN_RESPS] = min_responses\ntask.props[_KEY_WAIT_TIME_AFTER_MIN_RESPS] = wait_time_after_min_received\ntask.props[_KEY_MIN_RESPS_RCV_TIME] = None", "if len(task.client_tasks) == 0:\n return (False, TaskCompletionStatus.IGNORED)\nclients_responded = 0\nclients_not_re...
<|body_start_0|> TaskManager.__init__(self) task.props[_KEY_MIN_RESPS] = min_responses task.props[_KEY_WAIT_TIME_AFTER_MIN_RESPS] = wait_time_after_min_received task.props[_KEY_MIN_RESPS_RCV_TIME] = None <|end_body_0|> <|body_start_1|> if len(task.client_tasks) == 0: ...
BcastTaskManager
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BcastTaskManager: def __init__(self, task: Task, min_responses: int=0, wait_time_after_min_received: int=0): """Task manager for broadcast controller. Args: task (Task): an instance of Task min_responses (int, optional): the minimum number of responses so this task is considered finished...
stack_v2_sparse_classes_10k_train_000213
5,194
permissive
[ { "docstring": "Task manager for broadcast controller. Args: task (Task): an instance of Task min_responses (int, optional): the minimum number of responses so this task is considered finished. Defaults to 0. wait_time_after_min_received (int, optional): additional wait time for late clients to contribute their...
2
stack_v2_sparse_classes_30k_train_006742
Implement the Python class `BcastTaskManager` described below. Class description: Implement the BcastTaskManager class. Method signatures and docstrings: - def __init__(self, task: Task, min_responses: int=0, wait_time_after_min_received: int=0): Task manager for broadcast controller. Args: task (Task): an instance o...
Implement the Python class `BcastTaskManager` described below. Class description: Implement the BcastTaskManager class. Method signatures and docstrings: - def __init__(self, task: Task, min_responses: int=0, wait_time_after_min_received: int=0): Task manager for broadcast controller. Args: task (Task): an instance o...
1433290c203bd23f34c29e11795ce592bc067888
<|skeleton|> class BcastTaskManager: def __init__(self, task: Task, min_responses: int=0, wait_time_after_min_received: int=0): """Task manager for broadcast controller. Args: task (Task): an instance of Task min_responses (int, optional): the minimum number of responses so this task is considered finished...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class BcastTaskManager: def __init__(self, task: Task, min_responses: int=0, wait_time_after_min_received: int=0): """Task manager for broadcast controller. Args: task (Task): an instance of Task min_responses (int, optional): the minimum number of responses so this task is considered finished. Defaults to ...
the_stack_v2_python_sparse
nvflare/apis/impl/bcast_manager.py
NVIDIA/NVFlare
train
442
87d52fce0c5028d4b402759a700e64d54da1b79c
[ "self.gyx = 0\nself.gyy = 0\nself.gyz = 0\nself.acx = 0\nself.acy = 0\nself.acz = 0\nself.prs = 0\nself.temp = 0\nself.arduino = arduino", "dicioDeDados = self.arduino.dicioDeDados\nif 'acx' in dicioDeDados:\n self.acx = dicioDeDados['acx']\nif 'acy' in dicioDeDados:\n self.acy = dicioDeDados['acy']\nif 'ac...
<|body_start_0|> self.gyx = 0 self.gyy = 0 self.gyz = 0 self.acx = 0 self.acy = 0 self.acz = 0 self.prs = 0 self.temp = 0 self.arduino = arduino <|end_body_0|> <|body_start_1|> dicioDeDados = self.arduino.dicioDeDados if 'acx' in d...
Um objeto dessa classe deve ser criado quando quiser realizar a comunicação ou obter dados da MPU (Acelerômetro e Giroscópio). Para utilizar a classe, criamos o construtor colocando como parâmetros se queremos pegar os parâmetros. Depois, utilizamos a função atualiza() para fazer a aquisição pelo I2C. Por fim, acessa o...
IMU
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IMU: """Um objeto dessa classe deve ser criado quando quiser realizar a comunicação ou obter dados da MPU (Acelerômetro e Giroscópio). Para utilizar a classe, criamos o construtor colocando como parâmetros se queremos pegar os parâmetros. Depois, utilizamos a função atualiza() para fazer a aquisi...
stack_v2_sparse_classes_10k_train_000214
1,618
permissive
[ { "docstring": "Inicializa a classe com os parâmetros setados para adquirir e realiza configurações para aquisição do I2C.", "name": "__init__", "signature": "def __init__(self, arduino)" }, { "docstring": "Le valor analogico do ADC e transforma isso em pressão e velocidade. Todas as variaveis s...
2
stack_v2_sparse_classes_30k_train_006612
Implement the Python class `IMU` described below. Class description: Um objeto dessa classe deve ser criado quando quiser realizar a comunicação ou obter dados da MPU (Acelerômetro e Giroscópio). Para utilizar a classe, criamos o construtor colocando como parâmetros se queremos pegar os parâmetros. Depois, utilizamos ...
Implement the Python class `IMU` described below. Class description: Um objeto dessa classe deve ser criado quando quiser realizar a comunicação ou obter dados da MPU (Acelerômetro e Giroscópio). Para utilizar a classe, criamos o construtor colocando como parâmetros se queremos pegar os parâmetros. Depois, utilizamos ...
28162dab4b115232442a331dbdeacd13c0b1abc2
<|skeleton|> class IMU: """Um objeto dessa classe deve ser criado quando quiser realizar a comunicação ou obter dados da MPU (Acelerômetro e Giroscópio). Para utilizar a classe, criamos o construtor colocando como parâmetros se queremos pegar os parâmetros. Depois, utilizamos a função atualiza() para fazer a aquisi...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class IMU: """Um objeto dessa classe deve ser criado quando quiser realizar a comunicação ou obter dados da MPU (Acelerômetro e Giroscópio). Para utilizar a classe, criamos o construtor colocando como parâmetros se queremos pegar os parâmetros. Depois, utilizamos a função atualiza() para fazer a aquisição pelo I2C....
the_stack_v2_python_sparse
code/libs/sensors/imu.py
solkan1201/Vivace
train
0
b910462cc1ae7ea7a155099c74c30ed634092451
[ "self.mac = mac\nself.name = name\nself.device_policy = device_policy\nself.group_policy_id = group_policy_id", "if dictionary is None:\n return None\nmac = dictionary.get('mac')\ndevice_policy = dictionary.get('devicePolicy')\nname = dictionary.get('name')\ngroup_policy_id = dictionary.get('groupPolicyId')\nr...
<|body_start_0|> self.mac = mac self.name = name self.device_policy = device_policy self.group_policy_id = group_policy_id <|end_body_0|> <|body_start_1|> if dictionary is None: return None mac = dictionary.get('mac') device_policy = dictionary.get('d...
Implementation of the 'provisionNetworkClients' model. TODO: type model description here. Attributes: mac (string): The MAC address of the client. Required. name (string): The display name for the client. Optional. Limited to 255 bytes. device_policy (DevicePolicyEnum): The policy to apply to the specified client. Can ...
ProvisionNetworkClientsModel
[ "MIT", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProvisionNetworkClientsModel: """Implementation of the 'provisionNetworkClients' model. TODO: type model description here. Attributes: mac (string): The MAC address of the client. Required. name (string): The display name for the client. Optional. Limited to 255 bytes. device_policy (DevicePolicy...
stack_v2_sparse_classes_10k_train_000215
2,493
permissive
[ { "docstring": "Constructor for the ProvisionNetworkClientsModel class", "name": "__init__", "signature": "def __init__(self, mac=None, device_policy=None, name=None, group_policy_id=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A di...
2
null
Implement the Python class `ProvisionNetworkClientsModel` described below. Class description: Implementation of the 'provisionNetworkClients' model. TODO: type model description here. Attributes: mac (string): The MAC address of the client. Required. name (string): The display name for the client. Optional. Limited to...
Implement the Python class `ProvisionNetworkClientsModel` described below. Class description: Implementation of the 'provisionNetworkClients' model. TODO: type model description here. Attributes: mac (string): The MAC address of the client. Required. name (string): The display name for the client. Optional. Limited to...
9894089eb013318243ae48869cc5130eb37f80c0
<|skeleton|> class ProvisionNetworkClientsModel: """Implementation of the 'provisionNetworkClients' model. TODO: type model description here. Attributes: mac (string): The MAC address of the client. Required. name (string): The display name for the client. Optional. Limited to 255 bytes. device_policy (DevicePolicy...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ProvisionNetworkClientsModel: """Implementation of the 'provisionNetworkClients' model. TODO: type model description here. Attributes: mac (string): The MAC address of the client. Required. name (string): The display name for the client. Optional. Limited to 255 bytes. device_policy (DevicePolicyEnum): The po...
the_stack_v2_python_sparse
meraki_sdk/models/provision_network_clients_model.py
RaulCatalano/meraki-python-sdk
train
1
f96bd47755255aaf662c4fa06d39cfd77f07de2c
[ "self._topic = topic\nself._name = name\nself._action_type = action_type\nself.timeout = 1\nself.action_result = None\nself.prefered_callback = ' '\nSubscriber('mock/' + name, String, self.receive_commands)\nSubscriber('mock/gui_result', Bool, self.set_gui_result)\nself._server = ActionServer(self._topic, self._act...
<|body_start_0|> self._topic = topic self._name = name self._action_type = action_type self.timeout = 1 self.action_result = None self.prefered_callback = ' ' Subscriber('mock/' + name, String, self.receive_commands) Subscriber('mock/gui_result', Bool, sel...
MockActionServer base class
MockActionServer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MockActionServer: """MockActionServer base class""" def __init__(self, name, topic, action_type): """Creating a custom mock action server.""" <|body_0|> def receive_commands(self, msg): """Decides the result of the next call.""" <|body_1|> def decide...
stack_v2_sparse_classes_10k_train_000216
4,576
no_license
[ { "docstring": "Creating a custom mock action server.", "name": "__init__", "signature": "def __init__(self, name, topic, action_type)" }, { "docstring": "Decides the result of the next call.", "name": "receive_commands", "signature": "def receive_commands(self, msg)" }, { "docst...
4
stack_v2_sparse_classes_30k_train_002283
Implement the Python class `MockActionServer` described below. Class description: MockActionServer base class Method signatures and docstrings: - def __init__(self, name, topic, action_type): Creating a custom mock action server. - def receive_commands(self, msg): Decides the result of the next call. - def decide(sel...
Implement the Python class `MockActionServer` described below. Class description: MockActionServer base class Method signatures and docstrings: - def __init__(self, name, topic, action_type): Creating a custom mock action server. - def receive_commands(self, msg): Decides the result of the next call. - def decide(sel...
eecaf082b47e52582c5f009eefbf46dd692aba4f
<|skeleton|> class MockActionServer: """MockActionServer base class""" def __init__(self, name, topic, action_type): """Creating a custom mock action server.""" <|body_0|> def receive_commands(self, msg): """Decides the result of the next call.""" <|body_1|> def decide...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MockActionServer: """MockActionServer base class""" def __init__(self, name, topic, action_type): """Creating a custom mock action server.""" self._topic = topic self._name = name self._action_type = action_type self.timeout = 1 self.action_result = None ...
the_stack_v2_python_sparse
pandora_control/pandora_end_effector_controller/src/pandora_end_effector_controller/mocks/action_servers.py
skohlbr/pandora_ros_pkgs
train
0
2f7970d4837197811056d4adc87a2ee3ed1fe5af
[ "try:\n wiki = Wiki.objects.get(slug=slug)\nexcept Wiki.DoesNotExist:\n error_msg = 'Wiki not found.'\n return api_error(status.HTTP_404_NOT_FOUND, error_msg)\nif not wiki.has_read_perm(request.user):\n error_msg = 'Permission denied.'\n return api_error(status.HTTP_403_FORBIDDEN, error_msg)\npage_na...
<|body_start_0|> try: wiki = Wiki.objects.get(slug=slug) except Wiki.DoesNotExist: error_msg = 'Wiki not found.' return api_error(status.HTTP_404_NOT_FOUND, error_msg) if not wiki.has_read_perm(request.user): error_msg = 'Permission denied.' ...
WikiPageView
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WikiPageView: def get(self, request, slug, page_name='home'): """Get content of a wiki""" <|body_0|> def delete(self, request, slug, page_name): """Delete a page in a wiki""" <|body_1|> <|end_skeleton|> <|body_start_0|> try: wiki = Wiki....
stack_v2_sparse_classes_10k_train_000217
12,107
permissive
[ { "docstring": "Get content of a wiki", "name": "get", "signature": "def get(self, request, slug, page_name='home')" }, { "docstring": "Delete a page in a wiki", "name": "delete", "signature": "def delete(self, request, slug, page_name)" } ]
2
stack_v2_sparse_classes_30k_train_001007
Implement the Python class `WikiPageView` described below. Class description: Implement the WikiPageView class. Method signatures and docstrings: - def get(self, request, slug, page_name='home'): Get content of a wiki - def delete(self, request, slug, page_name): Delete a page in a wiki
Implement the Python class `WikiPageView` described below. Class description: Implement the WikiPageView class. Method signatures and docstrings: - def get(self, request, slug, page_name='home'): Get content of a wiki - def delete(self, request, slug, page_name): Delete a page in a wiki <|skeleton|> class WikiPageVi...
13b3ed26a04248211ef91ca70dccc617be27a3c3
<|skeleton|> class WikiPageView: def get(self, request, slug, page_name='home'): """Get content of a wiki""" <|body_0|> def delete(self, request, slug, page_name): """Delete a page in a wiki""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class WikiPageView: def get(self, request, slug, page_name='home'): """Get content of a wiki""" try: wiki = Wiki.objects.get(slug=slug) except Wiki.DoesNotExist: error_msg = 'Wiki not found.' return api_error(status.HTTP_404_NOT_FOUND, error_msg) i...
the_stack_v2_python_sparse
fhs/usr/share/python/syncwerk/restapi/restapi/api2/endpoints/wiki_pages.py
syncwerk/syncwerk-server-restapi
train
0
0ecedb70b85e10855269144c8e8612c278c6cb29
[ "rest_utils.validate_inputs({'username': username})\nif username != current_user.username:\n raise BadParametersError('Cannot get details of a different user')\nreturn user_datastore.get_user(current_user.username)", "request_dict = rest_utils.get_json_and_verify_params()\npassword = request_dict.get('password...
<|body_start_0|> rest_utils.validate_inputs({'username': username}) if username != current_user.username: raise BadParametersError('Cannot get details of a different user') return user_datastore.get_user(current_user.username) <|end_body_0|> <|body_start_1|> request_dict = r...
UsersIdCommunity
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UsersIdCommunity: def get(self, username): """Get details for a single user""" <|body_0|> def post(self, username): """Change user's password or getting started flag""" <|body_1|> <|end_skeleton|> <|body_start_0|> rest_utils.validate_inputs({'userna...
stack_v2_sparse_classes_10k_train_000218
8,537
permissive
[ { "docstring": "Get details for a single user", "name": "get", "signature": "def get(self, username)" }, { "docstring": "Change user's password or getting started flag", "name": "post", "signature": "def post(self, username)" } ]
2
null
Implement the Python class `UsersIdCommunity` described below. Class description: Implement the UsersIdCommunity class. Method signatures and docstrings: - def get(self, username): Get details for a single user - def post(self, username): Change user's password or getting started flag
Implement the Python class `UsersIdCommunity` described below. Class description: Implement the UsersIdCommunity class. Method signatures and docstrings: - def get(self, username): Get details for a single user - def post(self, username): Change user's password or getting started flag <|skeleton|> class UsersIdCommu...
c0de6442e1d7653fad824d75e571802a74eee605
<|skeleton|> class UsersIdCommunity: def get(self, username): """Get details for a single user""" <|body_0|> def post(self, username): """Change user's password or getting started flag""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class UsersIdCommunity: def get(self, username): """Get details for a single user""" rest_utils.validate_inputs({'username': username}) if username != current_user.username: raise BadParametersError('Cannot get details of a different user') return user_datastore.get_user(...
the_stack_v2_python_sparse
rest-service/manager_rest/rest/resources_v3/users.py
cloudify-cosmo/cloudify-manager
train
146
ded52555f12874d113bb9d60b0eb20395ef4820d
[ "self.minHeap = []\nself.k = k\nif not nums:\n return\nfor i in range(k):\n if self.minHeap and len(self.minHeap) >= k:\n heapq.heappop(self.minHeap)\n if len(nums) > i:\n heapq.heappush(self.minHeap, nums[i])\n else:\n return\nfor i in range(k, len(nums)):\n if nums[i] > self.mi...
<|body_start_0|> self.minHeap = [] self.k = k if not nums: return for i in range(k): if self.minHeap and len(self.minHeap) >= k: heapq.heappop(self.minHeap) if len(nums) > i: heapq.heappush(self.minHeap, nums[i]) ...
KthLargest
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KthLargest: def __init__(self, k, nums): """:type k: int :type nums: List[int]""" <|body_0|> def add(self, val): """:type val: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.minHeap = [] self.k = k if not nums: ...
stack_v2_sparse_classes_10k_train_000219
1,191
permissive
[ { "docstring": ":type k: int :type nums: List[int]", "name": "__init__", "signature": "def __init__(self, k, nums)" }, { "docstring": ":type val: int :rtype: int", "name": "add", "signature": "def add(self, val)" } ]
2
null
Implement the Python class `KthLargest` described below. Class description: Implement the KthLargest class. Method signatures and docstrings: - def __init__(self, k, nums): :type k: int :type nums: List[int] - def add(self, val): :type val: int :rtype: int
Implement the Python class `KthLargest` described below. Class description: Implement the KthLargest class. Method signatures and docstrings: - def __init__(self, k, nums): :type k: int :type nums: List[int] - def add(self, val): :type val: int :rtype: int <|skeleton|> class KthLargest: def __init__(self, k, nu...
20ae1a048eddbc9a32c819cf61258e2b57572f05
<|skeleton|> class KthLargest: def __init__(self, k, nums): """:type k: int :type nums: List[int]""" <|body_0|> def add(self, val): """:type val: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class KthLargest: def __init__(self, k, nums): """:type k: int :type nums: List[int]""" self.minHeap = [] self.k = k if not nums: return for i in range(k): if self.minHeap and len(self.minHeap) >= k: heapq.heappop(self.minHeap) ...
the_stack_v2_python_sparse
leetcode.com/python/703_Kth_Largest_Element_in_a_Stream.py
partho-maple/coding-interview-gym
train
862
057149a0d2d4bef7af9e7fb73c26d68f122b5bd1
[ "self.fin = fin\nself.stopd = stopdict\nself.result = []\nif userdict is not None:\n jieba.load_userdict(userdict)", "stopwords = {}\ntry:\n fstop = open(self.stopd)\nexcept IOError:\n print(self.stopd, '文件读取错误请检查!')\n exit(0)\nfor eachWord in fstop:\n stopwords[eachWord.strip()] = eachWord.strip()...
<|body_start_0|> self.fin = fin self.stopd = stopdict self.result = [] if userdict is not None: jieba.load_userdict(userdict) <|end_body_0|> <|body_start_1|> stopwords = {} try: fstop = open(self.stopd) except IOError: print(se...
切词类,把语料库的文本内容切词
Cutword
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Cutword: """切词类,把语料库的文本内容切词""" def __init__(self, fin, userdict=None, stopdict=stopd): """:param fin: 语料库文件 :param userdict: 自定义词典 :param stopdict: 停用词典""" <|body_0|> def cut(self, fout=None): """:param fout: :return:""" <|body_1|> def save(self, fou...
stack_v2_sparse_classes_10k_train_000220
3,192
no_license
[ { "docstring": ":param fin: 语料库文件 :param userdict: 自定义词典 :param stopdict: 停用词典", "name": "__init__", "signature": "def __init__(self, fin, userdict=None, stopdict=stopd)" }, { "docstring": ":param fout: :return:", "name": "cut", "signature": "def cut(self, fout=None)" }, { "docst...
3
stack_v2_sparse_classes_30k_train_003307
Implement the Python class `Cutword` described below. Class description: 切词类,把语料库的文本内容切词 Method signatures and docstrings: - def __init__(self, fin, userdict=None, stopdict=stopd): :param fin: 语料库文件 :param userdict: 自定义词典 :param stopdict: 停用词典 - def cut(self, fout=None): :param fout: :return: - def save(self, fout): ...
Implement the Python class `Cutword` described below. Class description: 切词类,把语料库的文本内容切词 Method signatures and docstrings: - def __init__(self, fin, userdict=None, stopdict=stopd): :param fin: 语料库文件 :param userdict: 自定义词典 :param stopdict: 停用词典 - def cut(self, fout=None): :param fout: :return: - def save(self, fout): ...
69e72541ca1d2afe03174f89350f7a4d886928dc
<|skeleton|> class Cutword: """切词类,把语料库的文本内容切词""" def __init__(self, fin, userdict=None, stopdict=stopd): """:param fin: 语料库文件 :param userdict: 自定义词典 :param stopdict: 停用词典""" <|body_0|> def cut(self, fout=None): """:param fout: :return:""" <|body_1|> def save(self, fou...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Cutword: """切词类,把语料库的文本内容切词""" def __init__(self, fin, userdict=None, stopdict=stopd): """:param fin: 语料库文件 :param userdict: 自定义词典 :param stopdict: 停用词典""" self.fin = fin self.stopd = stopdict self.result = [] if userdict is not None: jieba.load_userdic...
the_stack_v2_python_sparse
rec-engine/mining/nlp/cutword.py
worry1613/dongni-recommendation
train
1
c6e1b2e3f9b1b14f4881ee9baa0e1999835e5ac2
[ "width = 3.0\ntriangular_weights_instance = ChooseDefaultWeightsTriangular(width, units='hours')\nresult = str(triangular_weights_instance)\nexpected = '<ChooseDefaultTriangularWeights width=3.0, parameters_units=hours>'\nself.assertEqual(result, expected)", "width = 3.0\ntriangular_weights_instance = ChooseDefau...
<|body_start_0|> width = 3.0 triangular_weights_instance = ChooseDefaultWeightsTriangular(width, units='hours') result = str(triangular_weights_instance) expected = '<ChooseDefaultTriangularWeights width=3.0, parameters_units=hours>' self.assertEqual(result, expected) <|end_body_...
Tests for the __repr__function
Test___repr__
[ "BSD-3-Clause", "LicenseRef-scancode-proprietary-license" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test___repr__: """Tests for the __repr__function""" def test_basic(self): """Test the repr function formats the arguments correctly""" <|body_0|> def test_basic_no_units(self): """Test the repr function formats the arguments correctly""" <|body_1|> <|end...
stack_v2_sparse_classes_10k_train_000221
13,166
permissive
[ { "docstring": "Test the repr function formats the arguments correctly", "name": "test_basic", "signature": "def test_basic(self)" }, { "docstring": "Test the repr function formats the arguments correctly", "name": "test_basic_no_units", "signature": "def test_basic_no_units(self)" } ]
2
null
Implement the Python class `Test___repr__` described below. Class description: Tests for the __repr__function Method signatures and docstrings: - def test_basic(self): Test the repr function formats the arguments correctly - def test_basic_no_units(self): Test the repr function formats the arguments correctly
Implement the Python class `Test___repr__` described below. Class description: Tests for the __repr__function Method signatures and docstrings: - def test_basic(self): Test the repr function formats the arguments correctly - def test_basic_no_units(self): Test the repr function formats the arguments correctly <|skel...
cd2c9019944345df1e703bf8f625db537ad9f559
<|skeleton|> class Test___repr__: """Tests for the __repr__function""" def test_basic(self): """Test the repr function formats the arguments correctly""" <|body_0|> def test_basic_no_units(self): """Test the repr function formats the arguments correctly""" <|body_1|> <|end...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Test___repr__: """Tests for the __repr__function""" def test_basic(self): """Test the repr function formats the arguments correctly""" width = 3.0 triangular_weights_instance = ChooseDefaultWeightsTriangular(width, units='hours') result = str(triangular_weights_instance) ...
the_stack_v2_python_sparse
improver_tests/blending/weights/test_ChooseDefaultWeightsTriangular.py
metoppv/improver
train
101
a802a72fb8b79e9fb975773442f97a643071a8cc
[ "headers = {'User-Agent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)', 'Accept': 'application/json, text/plain, */*', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4,zh-TW;q=0.2,mt;q=0.2', 'Connection': 'keep-alive', 'X-Requested-With': 'XMLHttpRequest'...
<|body_start_0|> headers = {'User-Agent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)', 'Accept': 'application/json, text/plain, */*', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4,zh-TW;q=0.2,mt;q=0.2', 'Connection': 'keep-alive', 'X-Requested-Wit...
SportSpider
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SportSpider: def start_requests(self): """构造请求""" <|body_0|> def parse(self, response): """解析响应""" <|body_1|> <|end_skeleton|> <|body_start_0|> headers = {'User-Agent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)', 'Accept': 'applicat...
stack_v2_sparse_classes_10k_train_000222
1,487
no_license
[ { "docstring": "构造请求", "name": "start_requests", "signature": "def start_requests(self)" }, { "docstring": "解析响应", "name": "parse", "signature": "def parse(self, response)" } ]
2
stack_v2_sparse_classes_30k_train_000399
Implement the Python class `SportSpider` described below. Class description: Implement the SportSpider class. Method signatures and docstrings: - def start_requests(self): 构造请求 - def parse(self, response): 解析响应
Implement the Python class `SportSpider` described below. Class description: Implement the SportSpider class. Method signatures and docstrings: - def start_requests(self): 构造请求 - def parse(self, response): 解析响应 <|skeleton|> class SportSpider: def start_requests(self): """构造请求""" <|body_0|> ...
e812eb63fe5db402f79961f4c1d00d31c851a689
<|skeleton|> class SportSpider: def start_requests(self): """构造请求""" <|body_0|> def parse(self, response): """解析响应""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SportSpider: def start_requests(self): """构造请求""" headers = {'User-Agent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)', 'Accept': 'application/json, text/plain, */*', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4,zh-TW;q=0.2,mt;q...
the_stack_v2_python_sparse
scrapy项目/hupu/hupu/spiders/sport.py
Huigehao/python-spiders
train
1
92a26ea192637dcdf422b462a446a22806887140
[ "super().__init__()\nself.image_conv = nn.ConvTranspose2d(in_channels=in_channels, out_channels=out_channels // 2, **kwargs)\nself.kspace_conv = nn.ConvTranspose2d(in_channels=in_channels, out_channels=out_channels // 2, **kwargs)\nself.forward_operator = forward_operator\nself.backward_operator = backward_operator...
<|body_start_0|> super().__init__() self.image_conv = nn.ConvTranspose2d(in_channels=in_channels, out_channels=out_channels // 2, **kwargs) self.kspace_conv = nn.ConvTranspose2d(in_channels=in_channels, out_channels=out_channels // 2, **kwargs) self.forward_operator = forward_operator ...
MultiDomainConvTranspose2d
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MultiDomainConvTranspose2d: def __init__(self, forward_operator: Callable, backward_operator: Callable, in_channels: int, out_channels: int, **kwargs): """Inits :class:`MultiDomainConvTranspose2d`. Parameters ---------- forward_operator: Callable Forward Operator. backward_operator: Call...
stack_v2_sparse_classes_10k_train_000223
11,794
permissive
[ { "docstring": "Inits :class:`MultiDomainConvTranspose2d`. Parameters ---------- forward_operator: Callable Forward Operator. backward_operator: Callable Backward Operator. in_channels: int Number of input channels. out_channels: int Number of output channels.", "name": "__init__", "signature": "def __i...
2
stack_v2_sparse_classes_30k_train_003413
Implement the Python class `MultiDomainConvTranspose2d` described below. Class description: Implement the MultiDomainConvTranspose2d class. Method signatures and docstrings: - def __init__(self, forward_operator: Callable, backward_operator: Callable, in_channels: int, out_channels: int, **kwargs): Inits :class:`Mult...
Implement the Python class `MultiDomainConvTranspose2d` described below. Class description: Implement the MultiDomainConvTranspose2d class. Method signatures and docstrings: - def __init__(self, forward_operator: Callable, backward_operator: Callable, in_channels: int, out_channels: int, **kwargs): Inits :class:`Mult...
2a4c29342bc52a404aae097bc2654fb4323e1ac8
<|skeleton|> class MultiDomainConvTranspose2d: def __init__(self, forward_operator: Callable, backward_operator: Callable, in_channels: int, out_channels: int, **kwargs): """Inits :class:`MultiDomainConvTranspose2d`. Parameters ---------- forward_operator: Callable Forward Operator. backward_operator: Call...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MultiDomainConvTranspose2d: def __init__(self, forward_operator: Callable, backward_operator: Callable, in_channels: int, out_channels: int, **kwargs): """Inits :class:`MultiDomainConvTranspose2d`. Parameters ---------- forward_operator: Callable Forward Operator. backward_operator: Callable Backward ...
the_stack_v2_python_sparse
direct/nn/multidomainnet/multidomain.py
NKI-AI/direct
train
151
a6839b95fb0910b808a46135e0ba37d8e2997d52
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn FeatureRolloutPolicy()", "from .directory_object import DirectoryObject\nfrom .entity import Entity\nfrom .staged_feature_name import StagedFeatureName\nfrom .directory_object import DirectoryObject\nfrom .entity import Entity\nfrom .s...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return FeatureRolloutPolicy() <|end_body_0|> <|body_start_1|> from .directory_object import DirectoryObject from .entity import Entity from .staged_feature_name import StagedFeatureName...
FeatureRolloutPolicy
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FeatureRolloutPolicy: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FeatureRolloutPolicy: """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 ...
stack_v2_sparse_classes_10k_train_000224
3,749
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: FeatureRolloutPolicy", "name": "create_from_discriminator_value", "signature": "def create_from_discriminato...
3
stack_v2_sparse_classes_30k_train_003221
Implement the Python class `FeatureRolloutPolicy` described below. Class description: Implement the FeatureRolloutPolicy class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FeatureRolloutPolicy: Creates a new instance of the appropriate class based o...
Implement the Python class `FeatureRolloutPolicy` described below. Class description: Implement the FeatureRolloutPolicy class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FeatureRolloutPolicy: Creates a new instance of the appropriate class based o...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class FeatureRolloutPolicy: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FeatureRolloutPolicy: """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 ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class FeatureRolloutPolicy: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FeatureRolloutPolicy: """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...
the_stack_v2_python_sparse
msgraph/generated/models/feature_rollout_policy.py
microsoftgraph/msgraph-sdk-python
train
135
14dccef513cd0ad11ec43fdbc81e4be9fee48c21
[ "event_type = self._GetJSONValue(json_dict, 'type')\nif not event_type:\n parser_mediator.ProduceExtractionWarning('Missing event type.')\n return\nif event_type not in ('access', 'networkActivity'):\n parser_mediator.ProduceExtractionWarning('Unsupported event type: {0:s}.'.format(event_type))\n return...
<|body_start_0|> event_type = self._GetJSONValue(json_dict, 'type') if not event_type: parser_mediator.ProduceExtractionWarning('Missing event type.') return if event_type not in ('access', 'networkActivity'): parser_mediator.ProduceExtractionWarning('Unsuppor...
JSON-L parser plugin for iOS application privacy report files.
IOSAppPrivacPlugin
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IOSAppPrivacPlugin: """JSON-L parser plugin for iOS application privacy report files.""" def _ParseRecord(self, parser_mediator, json_dict): """Parses an iOS application privacy report record. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other com...
stack_v2_sparse_classes_10k_train_000225
5,927
permissive
[ { "docstring": "Parses an iOS application privacy report record. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfVFS. json_dict (dict): JSON dictionary of the log record.", "name": "_ParseRecord", "signature": "def _ParseRecord(se...
4
null
Implement the Python class `IOSAppPrivacPlugin` described below. Class description: JSON-L parser plugin for iOS application privacy report files. Method signatures and docstrings: - def _ParseRecord(self, parser_mediator, json_dict): Parses an iOS application privacy report record. Args: parser_mediator (ParserMedia...
Implement the Python class `IOSAppPrivacPlugin` described below. Class description: JSON-L parser plugin for iOS application privacy report files. Method signatures and docstrings: - def _ParseRecord(self, parser_mediator, json_dict): Parses an iOS application privacy report record. Args: parser_mediator (ParserMedia...
d6022f8cfebfddf2d08ab2d300a41b61f3349933
<|skeleton|> class IOSAppPrivacPlugin: """JSON-L parser plugin for iOS application privacy report files.""" def _ParseRecord(self, parser_mediator, json_dict): """Parses an iOS application privacy report record. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other com...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class IOSAppPrivacPlugin: """JSON-L parser plugin for iOS application privacy report files.""" def _ParseRecord(self, parser_mediator, json_dict): """Parses an iOS application privacy report record. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such...
the_stack_v2_python_sparse
plaso/parsers/jsonl_plugins/ios_app_privacy.py
log2timeline/plaso
train
1,506
3d0f4d69c6646b6c39e6b9c4300419777c35b64b
[ "super().__init__(convert_charrefs=True)\nself.url = urlparse(url)\nself.generator = None\nself.version = None\nself._parsed_url = None\nself.server = None\nself.scriptpath = None", "if self.version and value < self.version:\n return\nself.version = value", "url = url.split('.php', 1)[0]\ntry:\n value, sc...
<|body_start_0|> super().__init__(convert_charrefs=True) self.url = urlparse(url) self.generator = None self.version = None self._parsed_url = None self.server = None self.scriptpath = None <|end_body_0|> <|body_start_1|> if self.version and value < self....
Wiki HTML page parser.
WikiHTMLPageParser
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WikiHTMLPageParser: """Wiki HTML page parser.""" def __init__(self, url) -> None: """Initializer.""" <|body_0|> def set_version(self, value) -> None: """Set highest version.""" <|body_1|> def set_api_url(self, url) -> None: """Set api_url."""...
stack_v2_sparse_classes_10k_train_000226
10,845
permissive
[ { "docstring": "Initializer.", "name": "__init__", "signature": "def __init__(self, url) -> None" }, { "docstring": "Set highest version.", "name": "set_version", "signature": "def set_version(self, value) -> None" }, { "docstring": "Set api_url.", "name": "set_api_url", ...
4
stack_v2_sparse_classes_30k_train_005414
Implement the Python class `WikiHTMLPageParser` described below. Class description: Wiki HTML page parser. Method signatures and docstrings: - def __init__(self, url) -> None: Initializer. - def set_version(self, value) -> None: Set highest version. - def set_api_url(self, url) -> None: Set api_url. - def handle_star...
Implement the Python class `WikiHTMLPageParser` described below. Class description: Wiki HTML page parser. Method signatures and docstrings: - def __init__(self, url) -> None: Initializer. - def set_version(self, value) -> None: Set highest version. - def set_api_url(self, url) -> None: Set api_url. - def handle_star...
5c01e6bfcd328bc6eae643e661f1a0ae57612808
<|skeleton|> class WikiHTMLPageParser: """Wiki HTML page parser.""" def __init__(self, url) -> None: """Initializer.""" <|body_0|> def set_version(self, value) -> None: """Set highest version.""" <|body_1|> def set_api_url(self, url) -> None: """Set api_url."""...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class WikiHTMLPageParser: """Wiki HTML page parser.""" def __init__(self, url) -> None: """Initializer.""" super().__init__(convert_charrefs=True) self.url = urlparse(url) self.generator = None self.version = None self._parsed_url = None self.server = Non...
the_stack_v2_python_sparse
pywikibot/site_detect.py
wikimedia/pywikibot
train
432
a86e6bcd38eb23e8273abcc54dcee7dbc9b3e32a
[ "super().__init__(env)\nself.width = width\nself.height = height\nself.observation_space = gym.spaces.Box(low=0, high=255, shape=(self.height, self.width, 1), dtype=env.observation_space.dtype)", "frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)\nframe = cv2.resize(frame, (self.width, self.height), interpolation=c...
<|body_start_0|> super().__init__(env) self.width = width self.height = height self.observation_space = gym.spaces.Box(low=0, high=255, shape=(self.height, self.width, 1), dtype=env.observation_space.dtype) <|end_body_0|> <|body_start_1|> frame = cv2.cvtColor(frame, cv2.COLOR_RG...
WarpFrame
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WarpFrame: def __init__(self, env, width=84, height=84): """Warp frames to 84x84 as done in the Nature paper and later work. :param env: (Gym Environment) the environment""" <|body_0|> def observation(self, frame): """returns the current observation from a frame :par...
stack_v2_sparse_classes_10k_train_000227
8,786
permissive
[ { "docstring": "Warp frames to 84x84 as done in the Nature paper and later work. :param env: (Gym Environment) the environment", "name": "__init__", "signature": "def __init__(self, env, width=84, height=84)" }, { "docstring": "returns the current observation from a frame :param frame: ([int] or...
2
stack_v2_sparse_classes_30k_train_003464
Implement the Python class `WarpFrame` described below. Class description: Implement the WarpFrame class. Method signatures and docstrings: - def __init__(self, env, width=84, height=84): Warp frames to 84x84 as done in the Nature paper and later work. :param env: (Gym Environment) the environment - def observation(s...
Implement the Python class `WarpFrame` described below. Class description: Implement the WarpFrame class. Method signatures and docstrings: - def __init__(self, env, width=84, height=84): Warp frames to 84x84 as done in the Nature paper and later work. :param env: (Gym Environment) the environment - def observation(s...
1d304115406f6e29186cedb0160811d4139e2733
<|skeleton|> class WarpFrame: def __init__(self, env, width=84, height=84): """Warp frames to 84x84 as done in the Nature paper and later work. :param env: (Gym Environment) the environment""" <|body_0|> def observation(self, frame): """returns the current observation from a frame :par...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class WarpFrame: def __init__(self, env, width=84, height=84): """Warp frames to 84x84 as done in the Nature paper and later work. :param env: (Gym Environment) the environment""" super().__init__(env) self.width = width self.height = height self.observation_space = gym.space...
the_stack_v2_python_sparse
unstable_baselines/lib/envs/wrap/atari.py
Ending2015a/unstable_baselines
train
10
6971f209acaf0cbbb0f0e2790f8b0befdd9d4317
[ "if k == 0:\n return s\nif k == 1:\n return min((s[i:] + s[:i] for i in range(len(s))))\nelse:\n return ''.join(sorted(list(s)))", "if k > 2:\n return ''.join(sorted(s))\nret = s\nfor i in range(1, len(s)):\n ret = min(ret, s[i:] + s[:i])\nreturn ret" ]
<|body_start_0|> if k == 0: return s if k == 1: return min((s[i:] + s[:i] for i in range(len(s)))) else: return ''.join(sorted(list(s))) <|end_body_0|> <|body_start_1|> if k > 2: return ''.join(sorted(s)) ret = s for i in r...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def orderlyQueue(self, s: str, k: int) -> str: """09/22/2021 21:15""" <|body_0|> def orderlyQueue(self, s: str, k: int) -> str: """11/13/2022 18:09""" <|body_1|> <|end_skeleton|> <|body_start_0|> if k == 0: return s if ...
stack_v2_sparse_classes_10k_train_000228
1,850
no_license
[ { "docstring": "09/22/2021 21:15", "name": "orderlyQueue", "signature": "def orderlyQueue(self, s: str, k: int) -> str" }, { "docstring": "11/13/2022 18:09", "name": "orderlyQueue", "signature": "def orderlyQueue(self, s: str, k: int) -> str" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def orderlyQueue(self, s: str, k: int) -> str: 09/22/2021 21:15 - def orderlyQueue(self, s: str, k: int) -> str: 11/13/2022 18:09
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def orderlyQueue(self, s: str, k: int) -> str: 09/22/2021 21:15 - def orderlyQueue(self, s: str, k: int) -> str: 11/13/2022 18:09 <|skeleton|> class Solution: def orderlyQu...
1389a009a02e90e8700a7a00e0b7f797c129cdf4
<|skeleton|> class Solution: def orderlyQueue(self, s: str, k: int) -> str: """09/22/2021 21:15""" <|body_0|> def orderlyQueue(self, s: str, k: int) -> str: """11/13/2022 18:09""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def orderlyQueue(self, s: str, k: int) -> str: """09/22/2021 21:15""" if k == 0: return s if k == 1: return min((s[i:] + s[:i] for i in range(len(s)))) else: return ''.join(sorted(list(s))) def orderlyQueue(self, s: str, k: int...
the_stack_v2_python_sparse
leetcode/solved/935_Orderly_Queue/solution.py
sungminoh/algorithms
train
0
af1cc215c6662da42d088594c7d5f785b030200f
[ "if not matrix or not matrix[0]:\n return 0\nheights = [[0] * len(matrix[0]) for _ in range(len(matrix))]\nfor i in range(len(matrix)):\n count = 0\n left = 0\n right = 0\n while right < len(matrix[0]) or left < right:\n if right < len(matrix[0]) and matrix[i][right] == '1':\n count...
<|body_start_0|> if not matrix or not matrix[0]: return 0 heights = [[0] * len(matrix[0]) for _ in range(len(matrix))] for i in range(len(matrix)): count = 0 left = 0 right = 0 while right < len(matrix[0]) or left < right: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maximalRectangle(self, matrix): """:type matrix: List[List[str]] :rtype: int""" <|body_0|> def largestRectangleArea(self, heights): """:type heights: List[int] :rtype: int""" <|body_1|> def maximalRectangle2(self, matrix): """:type ...
stack_v2_sparse_classes_10k_train_000229
3,647
no_license
[ { "docstring": ":type matrix: List[List[str]] :rtype: int", "name": "maximalRectangle", "signature": "def maximalRectangle(self, matrix)" }, { "docstring": ":type heights: List[int] :rtype: int", "name": "largestRectangleArea", "signature": "def largestRectangleArea(self, heights)" }, ...
4
stack_v2_sparse_classes_30k_train_003010
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maximalRectangle(self, matrix): :type matrix: List[List[str]] :rtype: int - def largestRectangleArea(self, heights): :type heights: List[int] :rtype: int - def maximalRectang...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maximalRectangle(self, matrix): :type matrix: List[List[str]] :rtype: int - def largestRectangleArea(self, heights): :type heights: List[int] :rtype: int - def maximalRectang...
e2712dc25a73637db81ce8892e0c73a15d69766f
<|skeleton|> class Solution: def maximalRectangle(self, matrix): """:type matrix: List[List[str]] :rtype: int""" <|body_0|> def largestRectangleArea(self, heights): """:type heights: List[int] :rtype: int""" <|body_1|> def maximalRectangle2(self, matrix): """:type ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def maximalRectangle(self, matrix): """:type matrix: List[List[str]] :rtype: int""" if not matrix or not matrix[0]: return 0 heights = [[0] * len(matrix[0]) for _ in range(len(matrix))] for i in range(len(matrix)): count = 0 left = ...
the_stack_v2_python_sparse
code/Maximal Rectangle.py
zhix9767/Leetcode
train
0
50c3b31924573de7777f6e96b5155d4d6b34b160
[ "self._map['l1'][Sentinel2TOA.id] = Sentinel2TOA\nself._map['l2'][Sentinel2SR.id] = Sentinel2SR\nself._map['l3'][Sentinel2NBAR.id] = Sentinel2NBAR", "for drivers_by_level in self._map.values():\n for driver_name in drivers_by_level:\n if collection == driver_name:\n return drivers_by_level[dr...
<|body_start_0|> self._map['l1'][Sentinel2TOA.id] = Sentinel2TOA self._map['l2'][Sentinel2SR.id] = Sentinel2SR self._map['l3'][Sentinel2NBAR.id] = Sentinel2NBAR <|end_body_0|> <|body_start_1|> for drivers_by_level in self._map.values(): for driver_name in drivers_by_level: ...
Define a factory to identify a Sentinel product based on scene identifier.
SentinelFactory
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SentinelFactory: """Define a factory to identify a Sentinel product based on scene identifier.""" def register(self): """Initialize factory object.""" <|body_0|> def get_from_collection(self, collection: str): """Retrieve the respective Sentinel driver from given...
stack_v2_sparse_classes_10k_train_000230
11,082
permissive
[ { "docstring": "Initialize factory object.", "name": "register", "signature": "def register(self)" }, { "docstring": "Retrieve the respective Sentinel driver from given collection.", "name": "get_from_collection", "signature": "def get_from_collection(self, collection: str)" }, { ...
3
stack_v2_sparse_classes_30k_train_001831
Implement the Python class `SentinelFactory` described below. Class description: Define a factory to identify a Sentinel product based on scene identifier. Method signatures and docstrings: - def register(self): Initialize factory object. - def get_from_collection(self, collection: str): Retrieve the respective Senti...
Implement the Python class `SentinelFactory` described below. Class description: Define a factory to identify a Sentinel product based on scene identifier. Method signatures and docstrings: - def register(self): Initialize factory object. - def get_from_collection(self, collection: str): Retrieve the respective Senti...
62583f6c25bca79e7e1b5503bc6308298838c877
<|skeleton|> class SentinelFactory: """Define a factory to identify a Sentinel product based on scene identifier.""" def register(self): """Initialize factory object.""" <|body_0|> def get_from_collection(self, collection: str): """Retrieve the respective Sentinel driver from given...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SentinelFactory: """Define a factory to identify a Sentinel product based on scene identifier.""" def register(self): """Initialize factory object.""" self._map['l1'][Sentinel2TOA.id] = Sentinel2TOA self._map['l2'][Sentinel2SR.id] = Sentinel2SR self._map['l3'][Sentinel2NBA...
the_stack_v2_python_sparse
bdc_collection_builder/collections/sentinel/utils.py
rodolfolotte/bdc-collection-builder
train
0
b7430d53b55a61c1e7153ec971d49b72b8a0b563
[ "self.n_classes = number_class\nself.is_training = is_training\nself.is_simplified = is_simplified\nself.dropout = dropout", "if not self.is_simplified:\n net, _ = unet.unet(input_batch, self.n_classes, is_training=is_training, dropout=dropout, weight_decay=0.0005)\nelse:\n net, _ = simplified_unet.unet(inp...
<|body_start_0|> self.n_classes = number_class self.is_training = is_training self.is_simplified = is_simplified self.dropout = dropout <|end_body_0|> <|body_start_1|> if not self.is_simplified: net, _ = unet.unet(input_batch, self.n_classes, is_training=is_training,...
UnetModel
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UnetModel: def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): """Create the model""" <|body_0|> def _create_network(self, input_batch, dropout=False, is_training=True): """Args: input_batch: batch of pre-processed images. keep_pr...
stack_v2_sparse_classes_10k_train_000231
4,646
permissive
[ { "docstring": "Create the model", "name": "__init__", "signature": "def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True)" }, { "docstring": "Args: input_batch: batch of pre-processed images. keep_prob: probability of keeping neurons intact. Returns: A downsamp...
5
stack_v2_sparse_classes_30k_train_005519
Implement the Python class `UnetModel` described below. Class description: Implement the UnetModel class. Method signatures and docstrings: - def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): Create the model - def _create_network(self, input_batch, dropout=False, is_training=Tr...
Implement the Python class `UnetModel` described below. Class description: Implement the UnetModel class. Method signatures and docstrings: - def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): Create the model - def _create_network(self, input_batch, dropout=False, is_training=Tr...
57904544c6d6b43dcd5937afeb474c0a47456d98
<|skeleton|> class UnetModel: def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): """Create the model""" <|body_0|> def _create_network(self, input_batch, dropout=False, is_training=True): """Args: input_batch: batch of pre-processed images. keep_pr...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class UnetModel: def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): """Create the model""" self.n_classes = number_class self.is_training = is_training self.is_simplified = is_simplified self.dropout = dropout def _create_network(sel...
the_stack_v2_python_sparse
models/model_unet.py
cliang1453/IHC-based-labels-generation-and-semantic-segmentation-for-lung-cancer
train
0
0c8edfac9360108f11124e1f3a2617f5cd4d674b
[ "self.count = 0\n\ndef dfs(nums, target):\n if target == 0:\n self.count += 1\n return\n if target < 0:\n return\n for n in nums:\n dfs(nums, target - n)\ndfs(nums, target)\nreturn self.count", "def dfs(nums, temp_sum, target, d):\n if target == temp_sum:\n return 1\...
<|body_start_0|> self.count = 0 def dfs(nums, target): if target == 0: self.count += 1 return if target < 0: return for n in nums: dfs(nums, target - n) dfs(nums, target) return self.coun...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def combinationSum4(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def combinationSum41(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> def combinationSum42(se...
stack_v2_sparse_classes_10k_train_000232
2,690
no_license
[ { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "combinationSum4", "signature": "def combinationSum4(self, nums, target)" }, { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "combinationSum41", "signature": "def combinationSum41(...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def combinationSum4(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def combinationSum41(self, nums, target): :type nums: List[int] :type target: int :...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def combinationSum4(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def combinationSum41(self, nums, target): :type nums: List[int] :type target: int :...
857b8c7fccfe8216da59228c1cf3675444855673
<|skeleton|> class Solution: def combinationSum4(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def combinationSum41(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> def combinationSum42(se...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def combinationSum4(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" self.count = 0 def dfs(nums, target): if target == 0: self.count += 1 return if target < 0: return ...
the_stack_v2_python_sparse
algorithm/Combination-Sum-IV.py
atashi/LLL
train
0
600b474162e535fa590fe388601d73e476261085
[ "super().__init__()\nself.norm1 = nn.LayerNorm(embed_size)\nself.msa = _MSA(embed_size, num_heads)\nself.norm2 = nn.LayerNorm(embed_size)\nself.mlp = _MLP(in_feats=embed_size, out_feats=num_heads)", "y = self.norm1(x)\ny = self.msa(y)\nx = x + y\ny = self.norm2(x)\ny = self.mlp(y)\nx = x + y\nreturn x" ]
<|body_start_0|> super().__init__() self.norm1 = nn.LayerNorm(embed_size) self.msa = _MSA(embed_size, num_heads) self.norm2 = nn.LayerNorm(embed_size) self.mlp = _MLP(in_feats=embed_size, out_feats=num_heads) <|end_body_0|> <|body_start_1|> y = self.norm1(x) y = ...
_TransformerLayer
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _TransformerLayer: def __init__(self, embed_size, num_heads): """A module that implements a single transformer layer. Args: embed_size (int): The size of the embedding vector. num_heads (int): The number of heads to use in the multi-head self-attention module.""" <|body_0|> ...
stack_v2_sparse_classes_10k_train_000233
24,719
permissive
[ { "docstring": "A module that implements a single transformer layer. Args: embed_size (int): The size of the embedding vector. num_heads (int): The number of heads to use in the multi-head self-attention module.", "name": "__init__", "signature": "def __init__(self, embed_size, num_heads)" }, { ...
2
stack_v2_sparse_classes_30k_train_005885
Implement the Python class `_TransformerLayer` described below. Class description: Implement the _TransformerLayer class. Method signatures and docstrings: - def __init__(self, embed_size, num_heads): A module that implements a single transformer layer. Args: embed_size (int): The size of the embedding vector. num_he...
Implement the Python class `_TransformerLayer` described below. Class description: Implement the _TransformerLayer class. Method signatures and docstrings: - def __init__(self, embed_size, num_heads): A module that implements a single transformer layer. Args: embed_size (int): The size of the embedding vector. num_he...
72eb99f68205afd5f8d49a3bb6cfc08cfd467582
<|skeleton|> class _TransformerLayer: def __init__(self, embed_size, num_heads): """A module that implements a single transformer layer. Args: embed_size (int): The size of the embedding vector. num_heads (int): The number of heads to use in the multi-head self-attention module.""" <|body_0|> ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class _TransformerLayer: def __init__(self, embed_size, num_heads): """A module that implements a single transformer layer. Args: embed_size (int): The size of the embedding vector. num_heads (int): The number of heads to use in the multi-head self-attention module.""" super().__init__() sel...
the_stack_v2_python_sparse
GANDLF/models/unetr.py
mlcommons/GaNDLF
train
45
c7d3058adb3adc382a053cd838abdc54a7ba6bb6
[ "self.__password = password\nself.__class_code = class_code\nself.__msg = {'Class Code': '', 'Password': ''}", "if len(self.__class_code) == 0:\n self.__msg['Class Code'] += 'Class Code cannot be empty.\\n'\nif len(self.__password) == 0:\n self.__msg['Password'] += 'Password cannot be empty.\\n'\nif not all...
<|body_start_0|> self.__password = password self.__class_code = class_code self.__msg = {'Class Code': '', 'Password': ''} <|end_body_0|> <|body_start_1|> if len(self.__class_code) == 0: self.__msg['Class Code'] += 'Class Code cannot be empty.\n' if len(self.__passwo...
This class is responsible for the page login.
LoginController
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoginController: """This class is responsible for the page login.""" def __init__(self, password, class_code): """Init variables. :param password: the student password :param class_code: the student class code""" <|body_0|> def check_validation(self): """Check va...
stack_v2_sparse_classes_10k_train_000234
2,337
no_license
[ { "docstring": "Init variables. :param password: the student password :param class_code: the student class code", "name": "__init__", "signature": "def __init__(self, password, class_code)" }, { "docstring": "Check validation of student password & class_code.", "name": "check_validation", ...
4
stack_v2_sparse_classes_30k_train_001471
Implement the Python class `LoginController` described below. Class description: This class is responsible for the page login. Method signatures and docstrings: - def __init__(self, password, class_code): Init variables. :param password: the student password :param class_code: the student class code - def check_valid...
Implement the Python class `LoginController` described below. Class description: This class is responsible for the page login. Method signatures and docstrings: - def __init__(self, password, class_code): Init variables. :param password: the student password :param class_code: the student class code - def check_valid...
607e459d737ac689d6974bf05f452abf89cbdfe2
<|skeleton|> class LoginController: """This class is responsible for the page login.""" def __init__(self, password, class_code): """Init variables. :param password: the student password :param class_code: the student class code""" <|body_0|> def check_validation(self): """Check va...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LoginController: """This class is responsible for the page login.""" def __init__(self, password, class_code): """Init variables. :param password: the student password :param class_code: the student class code""" self.__password = password self.__class_code = class_code se...
the_stack_v2_python_sparse
UiController/logInPageController.py
alexshachor/TheBackEye
train
0
f391c2ce27d7a556b11595bf0cc0b3cb3543cf7b
[ "if isinstance(labelOrFluxInstance, fluxModule.Flux):\n if temperature is None:\n raise RuntimeError('The flux temperature is required as the second argument.')\n label = labelOrFluxInstance.label\n data = labelOrFluxInstance.data.copy()\nelif isinstance(labelOrFluxInstance, Flux):\n label = labe...
<|body_start_0|> if isinstance(labelOrFluxInstance, fluxModule.Flux): if temperature is None: raise RuntimeError('The flux temperature is required as the second argument.') label = labelOrFluxInstance.label data = labelOrFluxInstance.data.copy() elif i...
The multi-group flux.
Flux
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Flux: """The multi-group flux.""" def __init__(self, labelOrFluxInstance, temperature=None, data=None): """The constructor for the Flux class.""" <|body_0|> def process(self, groupBoundaries): """Multi-group the flux and return as a ProcessedFlux instance.""" ...
stack_v2_sparse_classes_10k_train_000235
18,060
permissive
[ { "docstring": "The constructor for the Flux class.", "name": "__init__", "signature": "def __init__(self, labelOrFluxInstance, temperature=None, data=None)" }, { "docstring": "Multi-group the flux and return as a ProcessedFlux instance.", "name": "process", "signature": "def process(sel...
2
null
Implement the Python class `Flux` described below. Class description: The multi-group flux. Method signatures and docstrings: - def __init__(self, labelOrFluxInstance, temperature=None, data=None): The constructor for the Flux class. - def process(self, groupBoundaries): Multi-group the flux and return as a Processed...
Implement the Python class `Flux` described below. Class description: The multi-group flux. Method signatures and docstrings: - def __init__(self, labelOrFluxInstance, temperature=None, data=None): The constructor for the Flux class. - def process(self, groupBoundaries): Multi-group the flux and return as a Processed...
6ba80855ae47cb32c37f635d065b228fadb03412
<|skeleton|> class Flux: """The multi-group flux.""" def __init__(self, labelOrFluxInstance, temperature=None, data=None): """The constructor for the Flux class.""" <|body_0|> def process(self, groupBoundaries): """Multi-group the flux and return as a ProcessedFlux instance.""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Flux: """The multi-group flux.""" def __init__(self, labelOrFluxInstance, temperature=None, data=None): """The constructor for the Flux class.""" if isinstance(labelOrFluxInstance, fluxModule.Flux): if temperature is None: raise RuntimeError('The flux temperatu...
the_stack_v2_python_sparse
fudge/processing/deterministic/particles.py
LLNL/fudge
train
21
75c3d1d79c7515d17cf7e5e359c1b00e460d0d58
[ "self.wifi_macs = wifi_macs\nself.ids = ids\nself.serials = serials\nself.scope = scope\nself.tags = tags\nself.update_action = update_action", "if dictionary is None:\n return None\ntags = dictionary.get('tags')\nupdate_action = dictionary.get('updateAction')\nwifi_macs = dictionary.get('wifiMacs')\nids = dic...
<|body_start_0|> self.wifi_macs = wifi_macs self.ids = ids self.serials = serials self.scope = scope self.tags = tags self.update_action = update_action <|end_body_0|> <|body_start_1|> if dictionary is None: return None tags = dictionary.get('...
Implementation of the 'updateNetworkSmDevicesTags' model. TODO: type model description here. Attributes: wifi_macs (string): The wifiMacs of the devices to be modified. ids (string): The ids of the devices to be modified. serials (string): The serials of the devices to be modified. scope (string): The scope (one of all...
UpdateNetworkSmDevicesTagsModel
[ "MIT", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UpdateNetworkSmDevicesTagsModel: """Implementation of the 'updateNetworkSmDevicesTags' model. TODO: type model description here. Attributes: wifi_macs (string): The wifiMacs of the devices to be modified. ids (string): The ids of the devices to be modified. serials (string): The serials of the de...
stack_v2_sparse_classes_10k_train_000236
2,806
permissive
[ { "docstring": "Constructor for the UpdateNetworkSmDevicesTagsModel class", "name": "__init__", "signature": "def __init__(self, tags=None, update_action=None, wifi_macs=None, ids=None, serials=None, scope=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictio...
2
stack_v2_sparse_classes_30k_train_004993
Implement the Python class `UpdateNetworkSmDevicesTagsModel` described below. Class description: Implementation of the 'updateNetworkSmDevicesTags' model. TODO: type model description here. Attributes: wifi_macs (string): The wifiMacs of the devices to be modified. ids (string): The ids of the devices to be modified. ...
Implement the Python class `UpdateNetworkSmDevicesTagsModel` described below. Class description: Implementation of the 'updateNetworkSmDevicesTags' model. TODO: type model description here. Attributes: wifi_macs (string): The wifiMacs of the devices to be modified. ids (string): The ids of the devices to be modified. ...
9894089eb013318243ae48869cc5130eb37f80c0
<|skeleton|> class UpdateNetworkSmDevicesTagsModel: """Implementation of the 'updateNetworkSmDevicesTags' model. TODO: type model description here. Attributes: wifi_macs (string): The wifiMacs of the devices to be modified. ids (string): The ids of the devices to be modified. serials (string): The serials of the de...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class UpdateNetworkSmDevicesTagsModel: """Implementation of the 'updateNetworkSmDevicesTags' model. TODO: type model description here. Attributes: wifi_macs (string): The wifiMacs of the devices to be modified. ids (string): The ids of the devices to be modified. serials (string): The serials of the devices to be m...
the_stack_v2_python_sparse
meraki_sdk/models/update_network_sm_devices_tags_model.py
RaulCatalano/meraki-python-sdk
train
1
219c36926b4e80b33f1da567b30c7c7a912c09e6
[ "self.data_description = data_description\nself.name = 'image_reshape'\nNI = self.data_description['NI']\nself.M = M\nself.N = N\nself.transf = transforms.Resize((self.M, self.N))", "N = X.shape[0]\nNC = X.shape[1]\nX_t = np.zeros((N, NC, self.M, self.N))\nfor k in tqdm(range(N)):\n for kc in range(NC):\n ...
<|body_start_0|> self.data_description = data_description self.name = 'image_reshape' NI = self.data_description['NI'] self.M = M self.N = N self.transf = transforms.Resize((self.M, self.N)) <|end_body_0|> <|body_start_1|> N = X.shape[0] NC = X.shape[1] ...
This class represents the main object for reshaping images.
image_reshape_model
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class image_reshape_model: """This class represents the main object for reshaping images.""" def __init__(self, data_description, M, N): """Create an image_reshape_model instance. Parameters ---------- data_description: dict Description of the input features M: integer Target number of row...
stack_v2_sparse_classes_10k_train_000237
1,851
permissive
[ { "docstring": "Create an image_reshape_model instance. Parameters ---------- data_description: dict Description of the input features M: integer Target number of rows N: integer Target number of columns", "name": "__init__", "signature": "def __init__(self, data_description, M, N)" }, { "docstr...
2
stack_v2_sparse_classes_30k_train_005784
Implement the Python class `image_reshape_model` described below. Class description: This class represents the main object for reshaping images. Method signatures and docstrings: - def __init__(self, data_description, M, N): Create an image_reshape_model instance. Parameters ---------- data_description: dict Descript...
Implement the Python class `image_reshape_model` described below. Class description: This class represents the main object for reshaping images. Method signatures and docstrings: - def __init__(self, data_description, M, N): Create an image_reshape_model instance. Parameters ---------- data_description: dict Descript...
ccc0a7674a04ae0d00bedc38893b33184c5f68c6
<|skeleton|> class image_reshape_model: """This class represents the main object for reshaping images.""" def __init__(self, data_description, M, N): """Create an image_reshape_model instance. Parameters ---------- data_description: dict Description of the input features M: integer Target number of row...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class image_reshape_model: """This class represents the main object for reshaping images.""" def __init__(self, data_description, M, N): """Create an image_reshape_model instance. Parameters ---------- data_description: dict Description of the input features M: integer Target number of rows N: integer ...
the_stack_v2_python_sparse
MMLL/preprocessors/image_reshape.py
Musketeer-H2020/MMLL-Robust
train
0
35ebd862f2db95944c1c51cd8d63e4d17570b69e
[ "assert query_batch_cnt.is_contiguous()\nassert key_batch_cnt.is_contiguous()\nassert index_pair_batch.is_contiguous()\nassert index_pair.is_contiguous()\nassert attn_weight.is_contiguous()\nassert value_features.is_contiguous()\nb = query_batch_cnt.shape[0]\ntotal_query_num, local_size = index_pair.size()\ntotal_k...
<|body_start_0|> assert query_batch_cnt.is_contiguous() assert key_batch_cnt.is_contiguous() assert index_pair_batch.is_contiguous() assert index_pair.is_contiguous() assert attn_weight.is_contiguous() assert value_features.is_contiguous() b = query_batch_cnt.shap...
Generate the attention result based on: * the generated attention pair index (total_query_num, local_size); * value features (total_key_num, nhead, hdim) * attn_weight (total_query_num, local_size, nhead) Generate the attention result. * (total_query_num, nhead, hdim)
AttentionValueComputation
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AttentionValueComputation: """Generate the attention result based on: * the generated attention pair index (total_query_num, local_size); * value features (total_key_num, nhead, hdim) * attn_weight (total_query_num, local_size, nhead) Generate the attention result. * (total_query_num, nhead, hdim...
stack_v2_sparse_classes_10k_train_000238
8,019
no_license
[ { "docstring": ":param ctx: :param query_batch_cnt: A integer tensor with shape [bs], indicating the query amount for each batch. :param key_batch_cnt: A integer tensor with shape [bs], indicating the key amount of each batch. :param index_pair_batch: A integer tensor with shape [total_query_num], indicating th...
2
stack_v2_sparse_classes_30k_train_006847
Implement the Python class `AttentionValueComputation` described below. Class description: Generate the attention result based on: * the generated attention pair index (total_query_num, local_size); * value features (total_key_num, nhead, hdim) * attn_weight (total_query_num, local_size, nhead) Generate the attention ...
Implement the Python class `AttentionValueComputation` described below. Class description: Generate the attention result based on: * the generated attention pair index (total_query_num, local_size); * value features (total_key_num, nhead, hdim) * attn_weight (total_query_num, local_size, nhead) Generate the attention ...
bbc78ca91e851f0f04459b1a8bbe96ab44bf41bc
<|skeleton|> class AttentionValueComputation: """Generate the attention result based on: * the generated attention pair index (total_query_num, local_size); * value features (total_key_num, nhead, hdim) * attn_weight (total_query_num, local_size, nhead) Generate the attention result. * (total_query_num, nhead, hdim...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AttentionValueComputation: """Generate the attention result based on: * the generated attention pair index (total_query_num, local_size); * value features (total_key_num, nhead, hdim) * attn_weight (total_query_num, local_size, nhead) Generate the attention result. * (total_query_num, nhead, hdim)""" def...
the_stack_v2_python_sparse
EQNet/eqnet/ops/attention/attention_utils_v2.py
dvlab-research/DeepVision3D
train
94
588117f0ae883e6ce352ac4174cd7916ff5f14b3
[ "widget = CompleterLineEdit(parent, self.delimiters, self.entries, self.entries_updater)\nwidget.setText(self.text)\nwidget.textEdited.connect(self.update_object)\nreturn widget", "if not self._no_update and self.activated:\n try:\n value = self.get_widget().text()\n except AttributeError:\n v...
<|body_start_0|> widget = CompleterLineEdit(parent, self.delimiters, self.entries, self.entries_updater) widget.setText(self.text) widget.textEdited.connect(self.update_object) return widget <|end_body_0|> <|body_start_1|> if not self._no_update and self.activated: t...
Simple style text editor, which displays a text field.
QtLineCompleter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class QtLineCompleter: """Simple style text editor, which displays a text field.""" def create_widget(self, parent): """Finishes initializing the editor by creating the underlying toolkit widget.""" <|body_0|> def update_object(self): """Handles the user entering input...
stack_v2_sparse_classes_10k_train_000239
4,964
no_license
[ { "docstring": "Finishes initializing the editor by creating the underlying toolkit widget.", "name": "create_widget", "signature": "def create_widget(self, parent)" }, { "docstring": "Handles the user entering input data in the edit control.", "name": "update_object", "signature": "def ...
3
stack_v2_sparse_classes_30k_train_001974
Implement the Python class `QtLineCompleter` described below. Class description: Simple style text editor, which displays a text field. Method signatures and docstrings: - def create_widget(self, parent): Finishes initializing the editor by creating the underlying toolkit widget. - def update_object(self): Handles th...
Implement the Python class `QtLineCompleter` described below. Class description: Simple style text editor, which displays a text field. Method signatures and docstrings: - def create_widget(self, parent): Finishes initializing the editor by creating the underlying toolkit widget. - def update_object(self): Handles th...
6d54091d2c1c436a4dc07727a66be5a536ea8414
<|skeleton|> class QtLineCompleter: """Simple style text editor, which displays a text field.""" def create_widget(self, parent): """Finishes initializing the editor by creating the underlying toolkit widget.""" <|body_0|> def update_object(self): """Handles the user entering input...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class QtLineCompleter: """Simple style text editor, which displays a text field.""" def create_widget(self, parent): """Finishes initializing the editor by creating the underlying toolkit widget.""" widget = CompleterLineEdit(parent, self.delimiters, self.entries, self.entries_updater) ...
the_stack_v2_python_sparse
hqc_meas/utils/widgets/qt_line_completer.py
MatthieuDartiailh/HQCMeas
train
11
46780f22b185fa8b881a63bb12a4c78e9e993e7b
[ "if not t1 and (not t2):\n return True\nif not t1 or not t2:\n return False\nif t1.val != t2.val:\n return False\nreturn self.is_same_tree_(t1.left, t2.left) and self.is_same_tree_(t1.right, t2.right)", "def check(tree_1: 'TreeNode', tree_2: 'TreeNode') -> bool:\n if not tree_1 and (not tree_2):\n ...
<|body_start_0|> if not t1 and (not t2): return True if not t1 or not t2: return False if t1.val != t2.val: return False return self.is_same_tree_(t1.left, t2.left) and self.is_same_tree_(t1.right, t2.right) <|end_body_0|> <|body_start_1|> def...
BinaryTree
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BinaryTree: def is_same_tree_(self, t1: 'TreeNode', t2: 'TreeNode') -> bool: """Approach: Recursion Time Complexity: O(N) Space Complexity: O(N) :param t1: :param t2: :return:""" <|body_0|> def is_same_tree_(self, t1: 'TreeNode', t2: 'TreeNode') -> bool: """Approach:...
stack_v2_sparse_classes_10k_train_000240
1,537
no_license
[ { "docstring": "Approach: Recursion Time Complexity: O(N) Space Complexity: O(N) :param t1: :param t2: :return:", "name": "is_same_tree_", "signature": "def is_same_tree_(self, t1: 'TreeNode', t2: 'TreeNode') -> bool" }, { "docstring": "Approach: Iteration Time Complexity: O(N) Space Complexity:...
2
null
Implement the Python class `BinaryTree` described below. Class description: Implement the BinaryTree class. Method signatures and docstrings: - def is_same_tree_(self, t1: 'TreeNode', t2: 'TreeNode') -> bool: Approach: Recursion Time Complexity: O(N) Space Complexity: O(N) :param t1: :param t2: :return: - def is_same...
Implement the Python class `BinaryTree` described below. Class description: Implement the BinaryTree class. Method signatures and docstrings: - def is_same_tree_(self, t1: 'TreeNode', t2: 'TreeNode') -> bool: Approach: Recursion Time Complexity: O(N) Space Complexity: O(N) :param t1: :param t2: :return: - def is_same...
65cc78b5afa0db064f9fe8f06597e3e120f7363d
<|skeleton|> class BinaryTree: def is_same_tree_(self, t1: 'TreeNode', t2: 'TreeNode') -> bool: """Approach: Recursion Time Complexity: O(N) Space Complexity: O(N) :param t1: :param t2: :return:""" <|body_0|> def is_same_tree_(self, t1: 'TreeNode', t2: 'TreeNode') -> bool: """Approach:...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class BinaryTree: def is_same_tree_(self, t1: 'TreeNode', t2: 'TreeNode') -> bool: """Approach: Recursion Time Complexity: O(N) Space Complexity: O(N) :param t1: :param t2: :return:""" if not t1 and (not t2): return True if not t1 or not t2: return False if t1...
the_stack_v2_python_sparse
revisited/trees/same_tree.py
Shiv2157k/leet_code
train
1
c2b8181ed89cf3ee92068761a055a9126019fa5e
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\ntry:\n mapping_value = parse_node.get_child_node('@odata.type').get_str_value()\nexcept AttributeError:\n mapping_value = None\nif mapping_value and mapping_value.casefold() == '#microsoft.graph.eventMessageRequest'.casefold():\n from ...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') try: mapping_value = parse_node.get_child_node('@odata.type').get_str_value() except AttributeError: mapping_value = None if mapping_value and mapping_value.casefold() ==...
EventMessage
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EventMessage: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventMessage: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: ...
stack_v2_sparse_classes_10k_train_000241
6,219
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: EventMessage", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value(...
3
null
Implement the Python class `EventMessage` described below. Class description: Implement the EventMessage class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventMessage: Creates a new instance of the appropriate class based on discriminator value Ar...
Implement the Python class `EventMessage` described below. Class description: Implement the EventMessage class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventMessage: Creates a new instance of the appropriate class based on discriminator value Ar...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class EventMessage: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventMessage: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class EventMessage: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EventMessage: """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: EventMessage""...
the_stack_v2_python_sparse
msgraph/generated/models/event_message.py
microsoftgraph/msgraph-sdk-python
train
135
a7f1074a294d42958601036409aa0328bb961ce4
[ "self._queue = Queue()\nself._sock_lock = threading.Lock()\nself._sock = sock\nself._req_buffer = bytearray(1000000)\nself._req_mv = memoryview(self._req_buffer)\nself._refs = {}\nself._ref_count = 1\nself._MAX_TO_PROCESS = 100", "packer = msgpack.Packer()\nunpacker = msgpack.Unpacker()\nwith self._sock_lock:\n ...
<|body_start_0|> self._queue = Queue() self._sock_lock = threading.Lock() self._sock = sock self._req_buffer = bytearray(1000000) self._req_mv = memoryview(self._req_buffer) self._refs = {} self._ref_count = 1 self._MAX_TO_PROCESS = 100 <|end_body_0|> <|b...
FIXME, fix all the docs Channels are connections to another participant. They maintain a message queue and push only one at a time. A couple implementation notes: - We maintain a single connection to the remote end and push all messages down this one socket. Calls to req place message tuples on a shared queue, and ther...
ClientChannel
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClientChannel: """FIXME, fix all the docs Channels are connections to another participant. They maintain a message queue and push only one at a time. A couple implementation notes: - We maintain a single connection to the remote end and push all messages down this one socket. Calls to req place m...
stack_v2_sparse_classes_10k_train_000242
3,343
permissive
[ { "docstring": "Sets up message tuple queue to remote.", "name": "__init__", "signature": "def __init__(self, sock)" }, { "docstring": "Sends data to the other side and waits for a response. If no response within timeout period (or connection failure) then raises an error.", "name": "req", ...
2
stack_v2_sparse_classes_30k_train_004804
Implement the Python class `ClientChannel` described below. Class description: FIXME, fix all the docs Channels are connections to another participant. They maintain a message queue and push only one at a time. A couple implementation notes: - We maintain a single connection to the remote end and push all messages dow...
Implement the Python class `ClientChannel` described below. Class description: FIXME, fix all the docs Channels are connections to another participant. They maintain a message queue and push only one at a time. A couple implementation notes: - We maintain a single connection to the remote end and push all messages dow...
91923ed10bee4b2f084b156b31d4e4700bf2326c
<|skeleton|> class ClientChannel: """FIXME, fix all the docs Channels are connections to another participant. They maintain a message queue and push only one at a time. A couple implementation notes: - We maintain a single connection to the remote end and push all messages down this one socket. Calls to req place m...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ClientChannel: """FIXME, fix all the docs Channels are connections to another participant. They maintain a message queue and push only one at a time. A couple implementation notes: - We maintain a single connection to the remote end and push all messages down this one socket. Calls to req place message tuples...
the_stack_v2_python_sparse
experiments/messaging/custom/mbus.py
bobquest33/wade
train
0
5ec46dec409619b85f0edb0e36b746f38b106f4b
[ "CtrlDev.__init__(self, parent)\nself._name = 'DVD/CD'\nself._category = 'Armazenamento'\nself._diag = DiagDVDCD(self)\nself._compat = CompatDVDCD(self)\nself._guiClass = GUIDVDCD", "self._callInfo()\nself._callCompat()\nself._callDiag()" ]
<|body_start_0|> CtrlDev.__init__(self, parent) self._name = 'DVD/CD' self._category = 'Armazenamento' self._diag = DiagDVDCD(self) self._compat = CompatDVDCD(self) self._guiClass = GUIDVDCD <|end_body_0|> <|body_start_1|> self._callInfo() self._callCompa...
Estende a classe 'CtrlDev'. Classe de controle que chama os testes de identificacao, compatibilidade, diagnostico e cria a tela de exibicao.
CtrlDvdcd
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CtrlDvdcd: """Estende a classe 'CtrlDev'. Classe de controle que chama os testes de identificacao, compatibilidade, diagnostico e cria a tela de exibicao.""" def __init__(self, parent): """Construtor que inicializa os atributos '_diag', '_compat' e '_guiClass' definidos na classe bas...
stack_v2_sparse_classes_10k_train_000243
1,186
no_license
[ { "docstring": "Construtor que inicializa os atributos '_diag', '_compat' e '_guiClass' definidos na classe base 'CtrlDev'.", "name": "__init__", "signature": "def __init__(self, parent)" }, { "docstring": "Executa o info, compat e diag (dependendo do resultado do compatibilidade) e cria as tela...
2
stack_v2_sparse_classes_30k_train_003337
Implement the Python class `CtrlDvdcd` described below. Class description: Estende a classe 'CtrlDev'. Classe de controle que chama os testes de identificacao, compatibilidade, diagnostico e cria a tela de exibicao. Method signatures and docstrings: - def __init__(self, parent): Construtor que inicializa os atributos...
Implement the Python class `CtrlDvdcd` described below. Class description: Estende a classe 'CtrlDev'. Classe de controle que chama os testes de identificacao, compatibilidade, diagnostico e cria a tela de exibicao. Method signatures and docstrings: - def __init__(self, parent): Construtor que inicializa os atributos...
bda0c2c8977dd1246339f1f0f4718d29e8795f21
<|skeleton|> class CtrlDvdcd: """Estende a classe 'CtrlDev'. Classe de controle que chama os testes de identificacao, compatibilidade, diagnostico e cria a tela de exibicao.""" def __init__(self, parent): """Construtor que inicializa os atributos '_diag', '_compat' e '_guiClass' definidos na classe bas...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class CtrlDvdcd: """Estende a classe 'CtrlDev'. Classe de controle que chama os testes de identificacao, compatibilidade, diagnostico e cria a tela de exibicao.""" def __init__(self, parent): """Construtor que inicializa os atributos '_diag', '_compat' e '_guiClass' definidos na classe base 'CtrlDev'."...
the_stack_v2_python_sparse
src/libs/dvdcd/ctrl_dvdcd.py
adrianomelo/ldc-desktop
train
1
3a7fba60888ce0bb0b58b355a8f7a27d4794115a
[ "mx = -float('inf')\nmn = float('inf')\nstack = []\nfor i, n in enumerate(nums):\n x = -float('inf')\n y = None\n while stack and stack[-1][0] > n:\n m, j = stack.pop()\n if m > x:\n x = m\n y = j\n mn = min(mn, j)\n mx = max(mx, i)\n stack.append((n, i)...
<|body_start_0|> mx = -float('inf') mn = float('inf') stack = [] for i, n in enumerate(nums): x = -float('inf') y = None while stack and stack[-1][0] > n: m, j = stack.pop() if m > x: x = m ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findUnsortedSubarray(self, nums: List[int]) -> int: """12/15/2020 16:17""" <|body_0|> def findUnsortedSubarray(self, nums: List[int]) -> int: """12/15/2020 16:52""" <|body_1|> def findUnsortedSubarray(self, nums: List[int]) -> int: ...
stack_v2_sparse_classes_10k_train_000244
3,322
no_license
[ { "docstring": "12/15/2020 16:17", "name": "findUnsortedSubarray", "signature": "def findUnsortedSubarray(self, nums: List[int]) -> int" }, { "docstring": "12/15/2020 16:52", "name": "findUnsortedSubarray", "signature": "def findUnsortedSubarray(self, nums: List[int]) -> int" }, { ...
3
stack_v2_sparse_classes_30k_train_004431
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findUnsortedSubarray(self, nums: List[int]) -> int: 12/15/2020 16:17 - def findUnsortedSubarray(self, nums: List[int]) -> int: 12/15/2020 16:52 - def findUnsortedSubarray(sel...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findUnsortedSubarray(self, nums: List[int]) -> int: 12/15/2020 16:17 - def findUnsortedSubarray(self, nums: List[int]) -> int: 12/15/2020 16:52 - def findUnsortedSubarray(sel...
1389a009a02e90e8700a7a00e0b7f797c129cdf4
<|skeleton|> class Solution: def findUnsortedSubarray(self, nums: List[int]) -> int: """12/15/2020 16:17""" <|body_0|> def findUnsortedSubarray(self, nums: List[int]) -> int: """12/15/2020 16:52""" <|body_1|> def findUnsortedSubarray(self, nums: List[int]) -> int: ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def findUnsortedSubarray(self, nums: List[int]) -> int: """12/15/2020 16:17""" mx = -float('inf') mn = float('inf') stack = [] for i, n in enumerate(nums): x = -float('inf') y = None while stack and stack[-1][0] > n: ...
the_stack_v2_python_sparse
leetcode/solved/581_Shortest_Unsorted_Continuous_Subarray/solution.py
sungminoh/algorithms
train
0
412234f3cc68d56bb498c294609ed195b1fdab85
[ "if self.is_db:\n return get_tables(self.db_url)\nreturn []", "if self.is_db:\n ds = get_table(self.db_url, self.table)\nelse:\n ds = pd.read_csv(self.dataset.file)\nreturn ds.columns.to_list()" ]
<|body_start_0|> if self.is_db: return get_tables(self.db_url) return [] <|end_body_0|> <|body_start_1|> if self.is_db: ds = get_table(self.db_url, self.table) else: ds = pd.read_csv(self.dataset.file) return ds.columns.to_list() <|end_body_1|...
Scenario
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Scenario: def tables(self): """Return table in DBMS""" <|body_0|> def columns(self): """Return columns in selected dataset""" <|body_1|> <|end_skeleton|> <|body_start_0|> if self.is_db: return get_tables(self.db_url) return [] <|...
stack_v2_sparse_classes_10k_train_000245
2,759
permissive
[ { "docstring": "Return table in DBMS", "name": "tables", "signature": "def tables(self)" }, { "docstring": "Return columns in selected dataset", "name": "columns", "signature": "def columns(self)" } ]
2
stack_v2_sparse_classes_30k_train_004733
Implement the Python class `Scenario` described below. Class description: Implement the Scenario class. Method signatures and docstrings: - def tables(self): Return table in DBMS - def columns(self): Return columns in selected dataset
Implement the Python class `Scenario` described below. Class description: Implement the Scenario class. Method signatures and docstrings: - def tables(self): Return table in DBMS - def columns(self): Return columns in selected dataset <|skeleton|> class Scenario: def tables(self): """Return table in DBM...
4299f09a338209fb6f03cc7c0806f8cc01447fe0
<|skeleton|> class Scenario: def tables(self): """Return table in DBMS""" <|body_0|> def columns(self): """Return columns in selected dataset""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Scenario: def tables(self): """Return table in DBMS""" if self.is_db: return get_tables(self.db_url) return [] def columns(self): """Return columns in selected dataset""" if self.is_db: ds = get_table(self.db_url, self.table) else: ...
the_stack_v2_python_sparse
msp/models.py
softlab-unimore/MASQ
train
1
c114fc40f51d2ab2100d5669e103904de43f946f
[ "request_data = request.GET\nticket_id = kwargs.get('ticket_id')\napp_name = request.META.get('HTTP_APPNAME')\napp_permission_check, msg = account_base_service_ins.app_ticket_permission_check(app_name, ticket_id)\nif not app_permission_check:\n return api_response(-1, msg, '')\nusername = request.META.get('HTTP_...
<|body_start_0|> request_data = request.GET ticket_id = kwargs.get('ticket_id') app_name = request.META.get('HTTP_APPNAME') app_permission_check, msg = account_base_service_ins.app_ticket_permission_check(app_name, ticket_id) if not app_permission_check: return api_re...
TicketView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TicketView: def get(self, request, *args, **kwargs): """获取工单详情,根据用户返回不同的内容(是否有工单表单的编辑权限) :param request: :param args: :param kwargs: :return:""" <|body_0|> def patch(self, request, *args, **kwargs): """处理工单 :param request: :param args: :param kwargs: :return:""" ...
stack_v2_sparse_classes_10k_train_000246
26,311
permissive
[ { "docstring": "获取工单详情,根据用户返回不同的内容(是否有工单表单的编辑权限) :param request: :param args: :param kwargs: :return:", "name": "get", "signature": "def get(self, request, *args, **kwargs)" }, { "docstring": "处理工单 :param request: :param args: :param kwargs: :return:", "name": "patch", "signature": "def ...
3
stack_v2_sparse_classes_30k_val_000013
Implement the Python class `TicketView` described below. Class description: Implement the TicketView class. Method signatures and docstrings: - def get(self, request, *args, **kwargs): 获取工单详情,根据用户返回不同的内容(是否有工单表单的编辑权限) :param request: :param args: :param kwargs: :return: - def patch(self, request, *args, **kwargs): 处理...
Implement the Python class `TicketView` described below. Class description: Implement the TicketView class. Method signatures and docstrings: - def get(self, request, *args, **kwargs): 获取工单详情,根据用户返回不同的内容(是否有工单表单的编辑权限) :param request: :param args: :param kwargs: :return: - def patch(self, request, *args, **kwargs): 处理...
b0e236b314286c5f6cc6959622c9c8505e776443
<|skeleton|> class TicketView: def get(self, request, *args, **kwargs): """获取工单详情,根据用户返回不同的内容(是否有工单表单的编辑权限) :param request: :param args: :param kwargs: :return:""" <|body_0|> def patch(self, request, *args, **kwargs): """处理工单 :param request: :param args: :param kwargs: :return:""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TicketView: def get(self, request, *args, **kwargs): """获取工单详情,根据用户返回不同的内容(是否有工单表单的编辑权限) :param request: :param args: :param kwargs: :return:""" request_data = request.GET ticket_id = kwargs.get('ticket_id') app_name = request.META.get('HTTP_APPNAME') app_permission_che...
the_stack_v2_python_sparse
apps/ticket/views.py
blackholll/loonflow
train
1,864
f3647ae0647d46e102b017bec622a593a5338613
[ "request = self.get_serializer_context()['request']\nif request.query_params.get('brief', False):\n return serializers.NestedDeviceSerializer\nelif 'config_context' in request.query_params.get('exclude', []):\n return serializers.DeviceSerializer\nreturn serializers.DeviceWithConfigContextSerializer", "devi...
<|body_start_0|> request = self.get_serializer_context()['request'] if request.query_params.get('brief', False): return serializers.NestedDeviceSerializer elif 'config_context' in request.query_params.get('exclude', []): return serializers.DeviceSerializer return ...
DeviceViewSet
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DeviceViewSet: def get_serializer_class(self): """Select the specific serializer based on the request context. If the `brief` query param equates to True, return the NestedDeviceSerializer If the `exclude` query param includes `config_context` as a value, return the DeviceSerializer Else...
stack_v2_sparse_classes_10k_train_000247
24,145
permissive
[ { "docstring": "Select the specific serializer based on the request context. If the `brief` query param equates to True, return the NestedDeviceSerializer If the `exclude` query param includes `config_context` as a value, return the DeviceSerializer Else, return the DeviceWithConfigContextSerializer", "name...
2
null
Implement the Python class `DeviceViewSet` described below. Class description: Implement the DeviceViewSet class. Method signatures and docstrings: - def get_serializer_class(self): Select the specific serializer based on the request context. If the `brief` query param equates to True, return the NestedDeviceSerializ...
Implement the Python class `DeviceViewSet` described below. Class description: Implement the DeviceViewSet class. Method signatures and docstrings: - def get_serializer_class(self): Select the specific serializer based on the request context. If the `brief` query param equates to True, return the NestedDeviceSerializ...
506884bc4dc70299db3e2a7ad577dd7fd808065e
<|skeleton|> class DeviceViewSet: def get_serializer_class(self): """Select the specific serializer based on the request context. If the `brief` query param equates to True, return the NestedDeviceSerializer If the `exclude` query param includes `config_context` as a value, return the DeviceSerializer Else...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class DeviceViewSet: def get_serializer_class(self): """Select the specific serializer based on the request context. If the `brief` query param equates to True, return the NestedDeviceSerializer If the `exclude` query param includes `config_context` as a value, return the DeviceSerializer Else, return the D...
the_stack_v2_python_sparse
netbox/dcim/api/views.py
netbox-community/netbox
train
8,122
902352904dfc1bc1db35dff9a1bd414387868c9a
[ "self.path = Path(path)\nself.validate()\nsuper(Processing, self).__init__(path, parent=parent, recursive=recursive, dataset_index=dataset_index, dataset_state=dataset_state)", "if not self.path.is_dir():\n raise NotProcessingFolder\nif not self.contains(self.path, ['visu_pars']):\n raise NotProcessingFolde...
<|body_start_0|> self.path = Path(path) self.validate() super(Processing, self).__init__(path, parent=parent, recursive=recursive, dataset_index=dataset_index, dataset_state=dataset_state) <|end_body_0|> <|body_start_1|> if not self.path.is_dir(): raise NotProcessingFolder ...
Processing
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Processing: def __init__(self, path, parent=None, recursive=True, dataset_index=['2dseq', '1r', '1i'], dataset_state: dict=DEFAULT_DATASET_STATE): """The constructor for Processing class. :param path: path to a folder :param parent: parent :class:`.Folder` object :param recursive: recurs...
stack_v2_sparse_classes_10k_train_000248
17,605
permissive
[ { "docstring": "The constructor for Processing class. :param path: path to a folder :param parent: parent :class:`.Folder` object :param recursive: recursively create sub-folders :return:", "name": "__init__", "signature": "def __init__(self, path, parent=None, recursive=True, dataset_index=['2dseq', '1...
2
stack_v2_sparse_classes_30k_train_004977
Implement the Python class `Processing` described below. Class description: Implement the Processing class. Method signatures and docstrings: - def __init__(self, path, parent=None, recursive=True, dataset_index=['2dseq', '1r', '1i'], dataset_state: dict=DEFAULT_DATASET_STATE): The constructor for Processing class. :...
Implement the Python class `Processing` described below. Class description: Implement the Processing class. Method signatures and docstrings: - def __init__(self, path, parent=None, recursive=True, dataset_index=['2dseq', '1r', '1i'], dataset_state: dict=DEFAULT_DATASET_STATE): The constructor for Processing class. :...
772d1b541fb998293a51c28f883e64fa74afa4c6
<|skeleton|> class Processing: def __init__(self, path, parent=None, recursive=True, dataset_index=['2dseq', '1r', '1i'], dataset_state: dict=DEFAULT_DATASET_STATE): """The constructor for Processing class. :param path: path to a folder :param parent: parent :class:`.Folder` object :param recursive: recurs...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Processing: def __init__(self, path, parent=None, recursive=True, dataset_index=['2dseq', '1r', '1i'], dataset_state: dict=DEFAULT_DATASET_STATE): """The constructor for Processing class. :param path: path to a folder :param parent: parent :class:`.Folder` object :param recursive: recursively create s...
the_stack_v2_python_sparse
brukerapi/folders.py
isi-nmr/brukerapi-python
train
18
803102ffa050b4cb5442abab01de57b10cb7c364
[ "super().__init__(coordinator=coordinator)\nself._sensor = sensor\nself.entity_id = f'{SENSOR_DOMAIN}.{sensor.key}'\nself._attr_device_class = sensor.device_class\nself._attr_entity_registry_enabled_default = sensor.entity_registry_enabled_default\nself._attr_name = sensor.name\nself._attr_state_class = sensor.stat...
<|body_start_0|> super().__init__(coordinator=coordinator) self._sensor = sensor self.entity_id = f'{SENSOR_DOMAIN}.{sensor.key}' self._attr_device_class = sensor.device_class self._attr_entity_registry_enabled_default = sensor.entity_registry_enabled_default self._attr_n...
Defines a Forcast.Solar sensor.
ForecastSolarSensorEntity
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ForecastSolarSensorEntity: """Defines a Forcast.Solar sensor.""" def __init__(self, *, entry_id: str, coordinator: DataUpdateCoordinator, sensor: ForecastSolarSensor) -> None: """Initialize Forcast.Solar sensor.""" <|body_0|> def state(self) -> StateType: """Retu...
stack_v2_sparse_classes_10k_train_000249
2,534
permissive
[ { "docstring": "Initialize Forcast.Solar sensor.", "name": "__init__", "signature": "def __init__(self, *, entry_id: str, coordinator: DataUpdateCoordinator, sensor: ForecastSolarSensor) -> None" }, { "docstring": "Return the state of the sensor.", "name": "state", "signature": "def stat...
2
stack_v2_sparse_classes_30k_train_006089
Implement the Python class `ForecastSolarSensorEntity` described below. Class description: Defines a Forcast.Solar sensor. Method signatures and docstrings: - def __init__(self, *, entry_id: str, coordinator: DataUpdateCoordinator, sensor: ForecastSolarSensor) -> None: Initialize Forcast.Solar sensor. - def state(sel...
Implement the Python class `ForecastSolarSensorEntity` described below. Class description: Defines a Forcast.Solar sensor. Method signatures and docstrings: - def __init__(self, *, entry_id: str, coordinator: DataUpdateCoordinator, sensor: ForecastSolarSensor) -> None: Initialize Forcast.Solar sensor. - def state(sel...
2fee32fce03bc49e86cf2e7b741a15621a97cce5
<|skeleton|> class ForecastSolarSensorEntity: """Defines a Forcast.Solar sensor.""" def __init__(self, *, entry_id: str, coordinator: DataUpdateCoordinator, sensor: ForecastSolarSensor) -> None: """Initialize Forcast.Solar sensor.""" <|body_0|> def state(self) -> StateType: """Retu...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ForecastSolarSensorEntity: """Defines a Forcast.Solar sensor.""" def __init__(self, *, entry_id: str, coordinator: DataUpdateCoordinator, sensor: ForecastSolarSensor) -> None: """Initialize Forcast.Solar sensor.""" super().__init__(coordinator=coordinator) self._sensor = sensor ...
the_stack_v2_python_sparse
homeassistant/components/forecast_solar/sensor.py
BenWoodford/home-assistant
train
11
fbc20ae178d157ca11d6759fb9beaee95357946a
[ "self.envirophat = envirophat\nself.use_leds = use_leds\nself.light = None\nself.light_red = None\nself.light_green = None\nself.light_blue = None\nself.accelerometer_x = None\nself.accelerometer_y = None\nself.accelerometer_z = None\nself.magnetometer_x = None\nself.magnetometer_y = None\nself.magnetometer_z = Non...
<|body_start_0|> self.envirophat = envirophat self.use_leds = use_leds self.light = None self.light_red = None self.light_green = None self.light_blue = None self.accelerometer_x = None self.accelerometer_y = None self.accelerometer_z = None ...
Get the latest data and update.
EnvirophatData
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EnvirophatData: """Get the latest data and update.""" def __init__(self, envirophat, use_leds): """Initialize the data object.""" <|body_0|> def update(self): """Get the latest data from Enviro pHAT.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_10k_train_000250
8,346
permissive
[ { "docstring": "Initialize the data object.", "name": "__init__", "signature": "def __init__(self, envirophat, use_leds)" }, { "docstring": "Get the latest data from Enviro pHAT.", "name": "update", "signature": "def update(self)" } ]
2
stack_v2_sparse_classes_30k_val_000230
Implement the Python class `EnvirophatData` described below. Class description: Get the latest data and update. Method signatures and docstrings: - def __init__(self, envirophat, use_leds): Initialize the data object. - def update(self): Get the latest data from Enviro pHAT.
Implement the Python class `EnvirophatData` described below. Class description: Get the latest data and update. Method signatures and docstrings: - def __init__(self, envirophat, use_leds): Initialize the data object. - def update(self): Get the latest data from Enviro pHAT. <|skeleton|> class EnvirophatData: ""...
8de7966104911bca6f855a1755a6d71a07afb9de
<|skeleton|> class EnvirophatData: """Get the latest data and update.""" def __init__(self, envirophat, use_leds): """Initialize the data object.""" <|body_0|> def update(self): """Get the latest data from Enviro pHAT.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class EnvirophatData: """Get the latest data and update.""" def __init__(self, envirophat, use_leds): """Initialize the data object.""" self.envirophat = envirophat self.use_leds = use_leds self.light = None self.light_red = None self.light_green = None s...
the_stack_v2_python_sparse
homeassistant/components/envirophat/sensor.py
AlexxIT/home-assistant
train
9
a60a9d1d7b4bed0bfd34ee413200b467037d3910
[ "self.backoff = backoff\nself.random_jitter_range = random_jitter_range\nsuper(LinearRetry, self).__init__(retry_total=retry_total, retry_to_secondary=retry_to_secondary, **kwargs)", "random_generator = random.Random()\nrandom_range_start = self.backoff - self.random_jitter_range if self.backoff > self.random_jit...
<|body_start_0|> self.backoff = backoff self.random_jitter_range = random_jitter_range super(LinearRetry, self).__init__(retry_total=retry_total, retry_to_secondary=retry_to_secondary, **kwargs) <|end_body_0|> <|body_start_1|> random_generator = random.Random() random_range_star...
Linear retry.
LinearRetry
[ "MIT", "LicenseRef-scancode-generic-cla", "LGPL-2.1-or-later" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LinearRetry: """Linear retry.""" def __init__(self, backoff=15, retry_total=3, retry_to_secondary=False, random_jitter_range=3, **kwargs): """Constructs a Linear retry object. :param int backoff: The backoff interval, in seconds, between retries. :param int max_attempts: The maximum ...
stack_v2_sparse_classes_10k_train_000251
26,717
permissive
[ { "docstring": "Constructs a Linear retry object. :param int backoff: The backoff interval, in seconds, between retries. :param int max_attempts: The maximum number of retry attempts. :param bool retry_to_secondary: Whether the request should be retried to secondary, if able. This should only be enabled of RA-G...
2
null
Implement the Python class `LinearRetry` described below. Class description: Linear retry. Method signatures and docstrings: - def __init__(self, backoff=15, retry_total=3, retry_to_secondary=False, random_jitter_range=3, **kwargs): Constructs a Linear retry object. :param int backoff: The backoff interval, in second...
Implement the Python class `LinearRetry` described below. Class description: Linear retry. Method signatures and docstrings: - def __init__(self, backoff=15, retry_total=3, retry_to_secondary=False, random_jitter_range=3, **kwargs): Constructs a Linear retry object. :param int backoff: The backoff interval, in second...
c2ca191e736bb06bfbbbc9493e8325763ba990bb
<|skeleton|> class LinearRetry: """Linear retry.""" def __init__(self, backoff=15, retry_total=3, retry_to_secondary=False, random_jitter_range=3, **kwargs): """Constructs a Linear retry object. :param int backoff: The backoff interval, in seconds, between retries. :param int max_attempts: The maximum ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LinearRetry: """Linear retry.""" def __init__(self, backoff=15, retry_total=3, retry_to_secondary=False, random_jitter_range=3, **kwargs): """Constructs a Linear retry object. :param int backoff: The backoff interval, in seconds, between retries. :param int max_attempts: The maximum number of ret...
the_stack_v2_python_sparse
sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/azure/eventhub/extensions/checkpointstoreblobaio/_vendor/storage/blob/_shared/policies.py
Azure/azure-sdk-for-python
train
4,046
f7d491e730c8392fb354a8858579bbc6398909a7
[ "if len(nums) <= 1:\n return len(nums)\nstar = 0\nfor i in range(1, len(nums)):\n if nums[i] != nums[star]:\n star += 1\n nums[star] = nums[i]\nreturn star + 1", "if not nums:\n return 0\nif len(nums) < 2:\n return 1\nlower = index = 0\nfast = 1\nwhile fast < len(nums):\n if nums[fast...
<|body_start_0|> if len(nums) <= 1: return len(nums) star = 0 for i in range(1, len(nums)): if nums[i] != nums[star]: star += 1 nums[star] = nums[i] return star + 1 <|end_body_0|> <|body_start_1|> if not nums: r...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def _removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def __removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def removeDuplicates(self, nums): """:type nums: List[int] :rty...
stack_v2_sparse_classes_10k_train_000252
3,447
permissive
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "_removeDuplicates", "signature": "def _removeDuplicates(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "__removeDuplicates", "signature": "def __removeDuplicates(self, nums)" }, { "docstring...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _removeDuplicates(self, nums): :type nums: List[int] :rtype: int - def __removeDuplicates(self, nums): :type nums: List[int] :rtype: int - def removeDuplicates(self, nums): :...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _removeDuplicates(self, nums): :type nums: List[int] :rtype: int - def __removeDuplicates(self, nums): :type nums: List[int] :rtype: int - def removeDuplicates(self, nums): :...
0dd67edca4e0b0323cb5a7239f02ea46383cd15a
<|skeleton|> class Solution: def _removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def __removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def removeDuplicates(self, nums): """:type nums: List[int] :rty...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def _removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" if len(nums) <= 1: return len(nums) star = 0 for i in range(1, len(nums)): if nums[i] != nums[star]: star += 1 nums[star] = nums[i] ...
the_stack_v2_python_sparse
26.remove-duplicates-from-sorted-array.py
windard/leeeeee
train
0
1f81dc3af2038bd7a0ebf317339e6b7275b40737
[ "self.logo = logo\nself.alternate_logo = alternate_logo\nself.icon = icon\nself.alternate_icon = alternate_icon\nself.primary_color = primary_color\nself.secondary_color = secondary_color\nself.gradient_color_top = gradient_color_top\nself.gradient_color_bottom = gradient_color_bottom\nself.tile = tile\nself.tile_s...
<|body_start_0|> self.logo = logo self.alternate_logo = alternate_logo self.icon = icon self.alternate_icon = alternate_icon self.primary_color = primary_color self.secondary_color = secondary_color self.gradient_color_top = gradient_color_top self.gradien...
Implementation of the 'InstitutionBranding' model. TODO: type model description here. Attributes: logo (string): TODO: type description here. alternate_logo (string): TODO: type description here. icon (string): TODO: type description here. alternate_icon (string): TODO: type description here. primary_color (string): TO...
InstitutionBranding
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class InstitutionBranding: """Implementation of the 'InstitutionBranding' model. TODO: type model description here. Attributes: logo (string): TODO: type description here. alternate_logo (string): TODO: type description here. icon (string): TODO: type description here. alternate_icon (string): TODO: ty...
stack_v2_sparse_classes_10k_train_000253
4,401
permissive
[ { "docstring": "Constructor for the InstitutionBranding class", "name": "__init__", "signature": "def __init__(self, logo=None, icon=None, alternate_icon=None, primary_color=None, gradient_color_top=None, gradient_color_bottom=None, tile=None, button_text_color=None, alternate_logo=None, secondary_color...
2
stack_v2_sparse_classes_30k_val_000221
Implement the Python class `InstitutionBranding` described below. Class description: Implementation of the 'InstitutionBranding' model. TODO: type model description here. Attributes: logo (string): TODO: type description here. alternate_logo (string): TODO: type description here. icon (string): TODO: type description ...
Implement the Python class `InstitutionBranding` described below. Class description: Implementation of the 'InstitutionBranding' model. TODO: type model description here. Attributes: logo (string): TODO: type description here. alternate_logo (string): TODO: type description here. icon (string): TODO: type description ...
b2ab1ded435db75c78d42261f5e4acd2a3061487
<|skeleton|> class InstitutionBranding: """Implementation of the 'InstitutionBranding' model. TODO: type model description here. Attributes: logo (string): TODO: type description here. alternate_logo (string): TODO: type description here. icon (string): TODO: type description here. alternate_icon (string): TODO: ty...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class InstitutionBranding: """Implementation of the 'InstitutionBranding' model. TODO: type model description here. Attributes: logo (string): TODO: type description here. alternate_logo (string): TODO: type description here. icon (string): TODO: type description here. alternate_icon (string): TODO: type descriptio...
the_stack_v2_python_sparse
finicityapi/models/institution_branding.py
monarchmoney/finicity-python
train
0
e0b32925aee455ca49a8ba47f6d45a72e7d74ee0
[ "super().__init__()\nself.self_attn_layer_norm = nn.LayerNorm(hid_dim)\nself.enc_attn_layer_norm = nn.LayerNorm(hid_dim)\nself.ff_layer_norm = nn.LayerNorm(hid_dim)\nself.self_attention = MultiHeadAttentionLayer(hid_dim, n_heads, dropout)\nself.encoder_attention = MultiHeadAttentionLayer(hid_dim, n_heads, dropout)\...
<|body_start_0|> super().__init__() self.self_attn_layer_norm = nn.LayerNorm(hid_dim) self.enc_attn_layer_norm = nn.LayerNorm(hid_dim) self.ff_layer_norm = nn.LayerNorm(hid_dim) self.self_attention = MultiHeadAttentionLayer(hid_dim, n_heads, dropout) self.encoder_attentio...
TransformerDecoderLayer is made up of self-attn, multi-head-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward network model dropout: the dropout value device: the device on which the model ...
TransformerDecoderLayer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TransformerDecoderLayer: """TransformerDecoderLayer is made up of self-attn, multi-head-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward network model dropout: the d...
stack_v2_sparse_classes_10k_train_000254
10,223
permissive
[ { "docstring": "Initialize model with params.", "name": "__init__", "signature": "def __init__(self, hid_dim, n_heads, pf_dim, dropout)" }, { "docstring": "Run a forward pass of model over the data.", "name": "forward", "signature": "def forward(self, trg, enc_src, trg_mask, src_mask)" ...
2
stack_v2_sparse_classes_30k_val_000306
Implement the Python class `TransformerDecoderLayer` described below. Class description: TransformerDecoderLayer is made up of self-attn, multi-head-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the f...
Implement the Python class `TransformerDecoderLayer` described below. Class description: TransformerDecoderLayer is made up of self-attn, multi-head-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the f...
9cdbf270487751a0ad6862b2fea2ccc0e23a0b67
<|skeleton|> class TransformerDecoderLayer: """TransformerDecoderLayer is made up of self-attn, multi-head-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward network model dropout: the d...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TransformerDecoderLayer: """TransformerDecoderLayer is made up of self-attn, multi-head-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward network model dropout: the dropout value ...
the_stack_v2_python_sparse
caspr/models/transformer.py
microsoft/CASPR
train
29
ad3e822a848fb09cb289c5f4a5df3359ac7a962e
[ "if self.request.method == 'GET':\n return (permissions.IsAuthenticated(), IsInActiveCommunity(), IsAbleToRetrieveInvitation())\nelif self.request.method == 'POST':\n return (permissions.IsAuthenticated(),)\nelif self.request.method in ('PUT', 'PATCH'):\n return (permissions.IsAuthenticated(), IsInActiveCo...
<|body_start_0|> if self.request.method == 'GET': return (permissions.IsAuthenticated(), IsInActiveCommunity(), IsAbleToRetrieveInvitation()) elif self.request.method == 'POST': return (permissions.IsAuthenticated(),) elif self.request.method in ('PUT', 'PATCH'): ...
Invitation view set
InvitationViewSet
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class InvitationViewSet: """Invitation view set""" def get_permissions(self): """Get permissions""" <|body_0|> def get_serializer_class(self): """Get serializer class""" <|body_1|> def list(self, request, *args, **kwargs): """List invitations""" ...
stack_v2_sparse_classes_10k_train_000255
27,778
permissive
[ { "docstring": "Get permissions", "name": "get_permissions", "signature": "def get_permissions(self)" }, { "docstring": "Get serializer class", "name": "get_serializer_class", "signature": "def get_serializer_class(self)" }, { "docstring": "List invitations", "name": "list", ...
5
stack_v2_sparse_classes_30k_train_005821
Implement the Python class `InvitationViewSet` described below. Class description: Invitation view set Method signatures and docstrings: - def get_permissions(self): Get permissions - def get_serializer_class(self): Get serializer class - def list(self, request, *args, **kwargs): List invitations - def create(self, r...
Implement the Python class `InvitationViewSet` described below. Class description: Invitation view set Method signatures and docstrings: - def get_permissions(self): Get permissions - def get_serializer_class(self): Get serializer class - def list(self, request, *args, **kwargs): List invitations - def create(self, r...
cf429f43251ad7e77c0d9bc9fe91bb030ca8bae8
<|skeleton|> class InvitationViewSet: """Invitation view set""" def get_permissions(self): """Get permissions""" <|body_0|> def get_serializer_class(self): """Get serializer class""" <|body_1|> def list(self, request, *args, **kwargs): """List invitations""" ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class InvitationViewSet: """Invitation view set""" def get_permissions(self): """Get permissions""" if self.request.method == 'GET': return (permissions.IsAuthenticated(), IsInActiveCommunity(), IsAbleToRetrieveInvitation()) elif self.request.method == 'POST': re...
the_stack_v2_python_sparse
membership/views.py
810Teams/clubs-and-events-backend
train
3
ce77e21c9e98a71c86d22d13e2fa1b1bc3fd870d
[ "self._attr_current_option = None\nself.entity_domain = ENTITY_DOMAIN\nsuper().__init__(config_entry=config_entry, coordinator=coordinator, description=description)", "self._attr_current_option = option\nawait self.async_update_ha_state()\nasync_dispatcher_send(self.hass, SIGNAL_HDHOMERUN_CHANNEL_SOURCE_CHANGE, s...
<|body_start_0|> self._attr_current_option = None self.entity_domain = ENTITY_DOMAIN super().__init__(config_entry=config_entry, coordinator=coordinator, description=description) <|end_body_0|> <|body_start_1|> self._attr_current_option = option await self.async_update_ha_state(...
Representation for a select entity.
HDHomeRunSelect
[ "Unlicense" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HDHomeRunSelect: """Representation for a select entity.""" def __init__(self, coordinator: DataUpdateCoordinator, config_entry: ConfigEntry, description: HDHomeRunSelectDescription) -> None: """Initialise.""" <|body_0|> async def async_select_option(self, option: str) ->...
stack_v2_sparse_classes_10k_train_000256
3,793
permissive
[ { "docstring": "Initialise.", "name": "__init__", "signature": "def __init__(self, coordinator: DataUpdateCoordinator, config_entry: ConfigEntry, description: HDHomeRunSelectDescription) -> None" }, { "docstring": "Select the option.", "name": "async_select_option", "signature": "async d...
3
null
Implement the Python class `HDHomeRunSelect` described below. Class description: Representation for a select entity. Method signatures and docstrings: - def __init__(self, coordinator: DataUpdateCoordinator, config_entry: ConfigEntry, description: HDHomeRunSelectDescription) -> None: Initialise. - async def async_sel...
Implement the Python class `HDHomeRunSelect` described below. Class description: Representation for a select entity. Method signatures and docstrings: - def __init__(self, coordinator: DataUpdateCoordinator, config_entry: ConfigEntry, description: HDHomeRunSelectDescription) -> None: Initialise. - async def async_sel...
8548d9999ddd54f13d6a307e013abcb8c897a74e
<|skeleton|> class HDHomeRunSelect: """Representation for a select entity.""" def __init__(self, coordinator: DataUpdateCoordinator, config_entry: ConfigEntry, description: HDHomeRunSelectDescription) -> None: """Initialise.""" <|body_0|> async def async_select_option(self, option: str) ->...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class HDHomeRunSelect: """Representation for a select entity.""" def __init__(self, coordinator: DataUpdateCoordinator, config_entry: ConfigEntry, description: HDHomeRunSelectDescription) -> None: """Initialise.""" self._attr_current_option = None self.entity_domain = ENTITY_DOMAIN ...
the_stack_v2_python_sparse
custom_components/hdhomerun/select.py
bacco007/HomeAssistantConfig
train
98
a8b901effd6b802e80959fc12ed71be79a91520a
[ "token = model.appspecifictoken.get_token_by_uuid(token_uuid, owner=get_authenticated_user())\nif token is None:\n raise NotFound()\nreturn {'token': token_view(token, include_code=True)}", "token = model.appspecifictoken.revoke_token_by_uuid(token_uuid, owner=get_authenticated_user())\nif token is None:\n ...
<|body_start_0|> token = model.appspecifictoken.get_token_by_uuid(token_uuid, owner=get_authenticated_user()) if token is None: raise NotFound() return {'token': token_view(token, include_code=True)} <|end_body_0|> <|body_start_1|> token = model.appspecifictoken.revoke_token...
Provides operations on an app specific token.
AppToken
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AppToken: """Provides operations on an app specific token.""" def get(self, token_uuid): """Returns a specific app token for the user.""" <|body_0|> def delete(self, token_uuid): """Revokes a specific app token for the user.""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_10k_train_000257
4,648
permissive
[ { "docstring": "Returns a specific app token for the user.", "name": "get", "signature": "def get(self, token_uuid)" }, { "docstring": "Revokes a specific app token for the user.", "name": "delete", "signature": "def delete(self, token_uuid)" } ]
2
null
Implement the Python class `AppToken` described below. Class description: Provides operations on an app specific token. Method signatures and docstrings: - def get(self, token_uuid): Returns a specific app token for the user. - def delete(self, token_uuid): Revokes a specific app token for the user.
Implement the Python class `AppToken` described below. Class description: Provides operations on an app specific token. Method signatures and docstrings: - def get(self, token_uuid): Returns a specific app token for the user. - def delete(self, token_uuid): Revokes a specific app token for the user. <|skeleton|> cla...
e400a0c22c5f89dd35d571654b13d262b1f6e3b3
<|skeleton|> class AppToken: """Provides operations on an app specific token.""" def get(self, token_uuid): """Returns a specific app token for the user.""" <|body_0|> def delete(self, token_uuid): """Revokes a specific app token for the user.""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class AppToken: """Provides operations on an app specific token.""" def get(self, token_uuid): """Returns a specific app token for the user.""" token = model.appspecifictoken.get_token_by_uuid(token_uuid, owner=get_authenticated_user()) if token is None: raise NotFound() ...
the_stack_v2_python_sparse
endpoints/api/appspecifictokens.py
quay/quay
train
2,363
dc0f09381a6c4fb413c2319abfc1603a3d187cbd
[ "try:\n raise RuntimeError('Hello World!')\nexcept Exception:\n self.exc_info = sys.exc_info()", "exc_class, exc, tb = self.exc_info\ncurrent_msg = str(exc) if exc else str(exc_class)\nnew_exc = exc_class('Re-raised exception: ' + current_msg)\nraise exc_class(new_exc).with_traceback(tb)" ]
<|body_start_0|> try: raise RuntimeError('Hello World!') except Exception: self.exc_info = sys.exc_info() <|end_body_0|> <|body_start_1|> exc_class, exc, tb = self.exc_info current_msg = str(exc) if exc else str(exc_class) new_exc = exc_class('Re-raised e...
Raise an exception, hold it and then re-raise it with original stack trace and a modified modify the message. Kudos: http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html http://blog.ianbicking.org/2007/09/12/re-raising-exceptions/
ExceptionHolder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ExceptionHolder: """Raise an exception, hold it and then re-raise it with original stack trace and a modified modify the message. Kudos: http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html http://blog.ianbicking.org/2007/09/12/re-raising-exceptions/""" def part_one(self...
stack_v2_sparse_classes_10k_train_000258
1,071
no_license
[ { "docstring": "Create exception but hold it.", "name": "part_one", "signature": "def part_one(self)" }, { "docstring": "Throw exeception generated in part_one with modified message. This exception will seem to come from part_one().", "name": "part_two", "signature": "def part_two(self)"...
2
stack_v2_sparse_classes_30k_train_002074
Implement the Python class `ExceptionHolder` described below. Class description: Raise an exception, hold it and then re-raise it with original stack trace and a modified modify the message. Kudos: http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html http://blog.ianbicking.org/2007/09/12/re-raisin...
Implement the Python class `ExceptionHolder` described below. Class description: Raise an exception, hold it and then re-raise it with original stack trace and a modified modify the message. Kudos: http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html http://blog.ianbicking.org/2007/09/12/re-raisin...
5e47e93c32bc85f986f39b1d4df8a384c7ff0019
<|skeleton|> class ExceptionHolder: """Raise an exception, hold it and then re-raise it with original stack trace and a modified modify the message. Kudos: http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html http://blog.ianbicking.org/2007/09/12/re-raising-exceptions/""" def part_one(self...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ExceptionHolder: """Raise an exception, hold it and then re-raise it with original stack trace and a modified modify the message. Kudos: http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html http://blog.ianbicking.org/2007/09/12/re-raising-exceptions/""" def part_one(self): ""...
the_stack_v2_python_sparse
python/exception-reraise.py
von/sandbox
train
4
bf37fb402b0884c911d6e576f1b6b0c1abfc35db
[ "found_item = plotter.plots.meshes.get(item_key_name, None)\nif found_item is None:\n plotter.plots.meshes[item_key_name] = render_item\n plotter.ui.plt += render_item\n found_item = render_item\n if not defer_render:\n plotter.ui.plt.render()\nreturn found_item", "found_item = plotter.plots.me...
<|body_start_0|> found_item = plotter.plots.meshes.get(item_key_name, None) if found_item is None: plotter.plots.meshes[item_key_name] = render_item plotter.ui.plt += render_item found_item = render_item if not defer_render: plotter.ui.plt....
docstring for VedoHelpers. Import with: from pyphoplacecellanalysis.GUI.Vedo.VedoMeshManipulatable import VedoPlotterHelpers
VedoPlotterHelpers
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VedoPlotterHelpers: """docstring for VedoHelpers. Import with: from pyphoplacecellanalysis.GUI.Vedo.VedoMeshManipulatable import VedoPlotterHelpers""" def vedo_create_if_needed(cls, plotter, item_key_name, render_item, defer_render=False): """Creates a new mesh if it exists in spike_...
stack_v2_sparse_classes_10k_train_000259
3,367
permissive
[ { "docstring": "Creates a new mesh if it exists in spike_raster_plt_3d_vedo plotter: Spike3DRaster_Vedo the main 3d plotter. item_key_name: str - like 'new_active_axes' render_item: a valid vedo object that can be added to the plotter, like a Mesh or Text3D defer_render: bool - whether to immediately render aft...
2
null
Implement the Python class `VedoPlotterHelpers` described below. Class description: docstring for VedoHelpers. Import with: from pyphoplacecellanalysis.GUI.Vedo.VedoMeshManipulatable import VedoPlotterHelpers Method signatures and docstrings: - def vedo_create_if_needed(cls, plotter, item_key_name, render_item, defer...
Implement the Python class `VedoPlotterHelpers` described below. Class description: docstring for VedoHelpers. Import with: from pyphoplacecellanalysis.GUI.Vedo.VedoMeshManipulatable import VedoPlotterHelpers Method signatures and docstrings: - def vedo_create_if_needed(cls, plotter, item_key_name, render_item, defer...
212399d826284b394fce8894ff1a93133aef783f
<|skeleton|> class VedoPlotterHelpers: """docstring for VedoHelpers. Import with: from pyphoplacecellanalysis.GUI.Vedo.VedoMeshManipulatable import VedoPlotterHelpers""" def vedo_create_if_needed(cls, plotter, item_key_name, render_item, defer_render=False): """Creates a new mesh if it exists in spike_...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class VedoPlotterHelpers: """docstring for VedoHelpers. Import with: from pyphoplacecellanalysis.GUI.Vedo.VedoMeshManipulatable import VedoPlotterHelpers""" def vedo_create_if_needed(cls, plotter, item_key_name, render_item, defer_render=False): """Creates a new mesh if it exists in spike_raster_plt_3d...
the_stack_v2_python_sparse
src/pyphoplacecellanalysis/GUI/Vedo/VedoMeshManipulatable.py
CommanderPho/pyPhoPlaceCellAnalysis
train
1
735dade4c3ea0b8a592f2eaddf064a5e2891c50c
[ "sample_size = len(samples)\nassert sample_size <= self.config.num_accumulated_batches\nmodel = state.model\nself.zero_grads(state)\nfor idx, (batch_id, (raw_batch, batch)) in enumerate(samples):\n with contextlib_ExitStack() as exit_stack:\n maybe_accumulate_gradients(exit_stack, model, idx, sample_size)...
<|body_start_0|> sample_size = len(samples) assert sample_size <= self.config.num_accumulated_batches model = state.model self.zero_grads(state) for idx, (batch_id, (raw_batch, batch)) in enumerate(samples): with contextlib_ExitStack() as exit_stack: m...
TaskTrainer
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TaskTrainer: def run_step(self, samples: List[Any], state: TrainingState, metric_reporter: MetricReporter, report_metric: bool): """Our run_step is a bit different, because we're wrapping the model forward call with model.train_batch, which arranges tensors and gets loss, etc. Whenever "...
stack_v2_sparse_classes_10k_train_000260
26,177
permissive
[ { "docstring": "Our run_step is a bit different, because we're wrapping the model forward call with model.train_batch, which arranges tensors and gets loss, etc. Whenever \"samples\" contains more than one mini-batch (sample_size > 1), we want to accumulate gradients locally and only call all-reduce in the last...
2
stack_v2_sparse_classes_30k_train_001754
Implement the Python class `TaskTrainer` described below. Class description: Implement the TaskTrainer class. Method signatures and docstrings: - def run_step(self, samples: List[Any], state: TrainingState, metric_reporter: MetricReporter, report_metric: bool): Our run_step is a bit different, because we're wrapping ...
Implement the Python class `TaskTrainer` described below. Class description: Implement the TaskTrainer class. Method signatures and docstrings: - def run_step(self, samples: List[Any], state: TrainingState, metric_reporter: MetricReporter, report_metric: bool): Our run_step is a bit different, because we're wrapping ...
f82830da00339392fd17c70572cf1920262d6d74
<|skeleton|> class TaskTrainer: def run_step(self, samples: List[Any], state: TrainingState, metric_reporter: MetricReporter, report_metric: bool): """Our run_step is a bit different, because we're wrapping the model forward call with model.train_batch, which arranges tensors and gets loss, etc. Whenever "...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TaskTrainer: def run_step(self, samples: List[Any], state: TrainingState, metric_reporter: MetricReporter, report_metric: bool): """Our run_step is a bit different, because we're wrapping the model forward call with model.train_batch, which arranges tensors and gets loss, etc. Whenever "samples" conta...
the_stack_v2_python_sparse
pytext/trainers/trainer.py
appatsekhar/pytext
train
3
32bdf0b625ad55cdc95fc66095d5c1f9c0740f16
[ "self.type = type\nself.position = position\nself.name = name\nself.status = status\nself.is_allowed_to_move = is_allowed_to_move\nself.icon = icon\nself.grabbedItems = items_list\nself.has_sering = Item('sering', 'resources//pictures//seringue.png')", "if level.grid[self.position[0]][self.position[1]] == 'i':\n ...
<|body_start_0|> self.type = type self.position = position self.name = name self.status = status self.is_allowed_to_move = is_allowed_to_move self.icon = icon self.grabbedItems = items_list self.has_sering = Item('sering', 'resources//pictures//seringue.pn...
class in order to create instance of game persona caracteristics : - position : position on the grid defined by a tuple (row, column) - name : name of persona. Type string - isGood : define if the persona is a good guy. Type boolean - isMoving : define if the persona is allowed to move. Type boolean - icon : path to th...
Persona
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Persona: """class in order to create instance of game persona caracteristics : - position : position on the grid defined by a tuple (row, column) - name : name of persona. Type string - isGood : define if the persona is a good guy. Type boolean - isMoving : define if the persona is allowed to mov...
stack_v2_sparse_classes_10k_train_000261
6,247
permissive
[ { "docstring": ":param type: Type of the persona. Type string :param position: current position of the persona. Type is tuple :param name: name of the persona. Type is string :param status: Status can the following value 'alive', bad guy', 'dead', 'winner'. Type is string :param is_allowed_to_move: persona is a...
6
stack_v2_sparse_classes_30k_val_000010
Implement the Python class `Persona` described below. Class description: class in order to create instance of game persona caracteristics : - position : position on the grid defined by a tuple (row, column) - name : name of persona. Type string - isGood : define if the persona is a good guy. Type boolean - isMoving : ...
Implement the Python class `Persona` described below. Class description: class in order to create instance of game persona caracteristics : - position : position on the grid defined by a tuple (row, column) - name : name of persona. Type string - isGood : define if the persona is a good guy. Type boolean - isMoving : ...
146ef0ec0f114b4deea9373d2fc2befe9a82ceb7
<|skeleton|> class Persona: """class in order to create instance of game persona caracteristics : - position : position on the grid defined by a tuple (row, column) - name : name of persona. Type string - isGood : define if the persona is a good guy. Type boolean - isMoving : define if the persona is allowed to mov...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Persona: """class in order to create instance of game persona caracteristics : - position : position on the grid defined by a tuple (row, column) - name : name of persona. Type string - isGood : define if the persona is a good guy. Type boolean - isMoving : define if the persona is allowed to move. Type boole...
the_stack_v2_python_sparse
models/Persona.py
cendrars59/OPC-DA-PY-P3
train
0
e8dd285ddcfe4bab3a15b54425c9626ef917bf90
[ "self.head = head\ntemp = head\ni = 0\nwhile temp is not None:\n i += 1\n temp = temp.next\nself.len = i", "steps = random.randint(0, self.len - 1)\ntemp = self.head\nfor i in range(steps):\n temp = temp.next\nreturn temp.val" ]
<|body_start_0|> self.head = head temp = head i = 0 while temp is not None: i += 1 temp = temp.next self.len = i <|end_body_0|> <|body_start_1|> steps = random.randint(0, self.len - 1) temp = self.head for i in range(steps): ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def __init__(self, head: ListNode): """@param head The linked list's head. Note that the head is guaranteed to be not null, so it contains at least one node.""" <|body_0|> def getRandom(self) -> int: """Returns a random node's value.""" <|body_1|> ...
stack_v2_sparse_classes_10k_train_000262
1,344
no_license
[ { "docstring": "@param head The linked list's head. Note that the head is guaranteed to be not null, so it contains at least one node.", "name": "__init__", "signature": "def __init__(self, head: ListNode)" }, { "docstring": "Returns a random node's value.", "name": "getRandom", "signatu...
2
stack_v2_sparse_classes_30k_train_002225
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, head: ListNode): @param head The linked list's head. Note that the head is guaranteed to be not null, so it contains at least one node. - def getRandom(self) -...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def __init__(self, head: ListNode): @param head The linked list's head. Note that the head is guaranteed to be not null, so it contains at least one node. - def getRandom(self) -...
fb5a930b5ad27e7ed405e5787346327d9b3bf957
<|skeleton|> class Solution: def __init__(self, head: ListNode): """@param head The linked list's head. Note that the head is guaranteed to be not null, so it contains at least one node.""" <|body_0|> def getRandom(self) -> int: """Returns a random node's value.""" <|body_1|> ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def __init__(self, head: ListNode): """@param head The linked list's head. Note that the head is guaranteed to be not null, so it contains at least one node.""" self.head = head temp = head i = 0 while temp is not None: i += 1 temp = te...
the_stack_v2_python_sparse
Jiuzhang_practice/Linkedlist_random_node.py
armstrong019/coding_n_project
train
0
df8801b358a40c0079308ce0a943089d2866a5c5
[ "self.ufp_required_field = split_tuple(self.ufp_required_field)\nself.ufp_value = split_tuple(self.ufp_value)\nself.ufp_enabled = split_tuple(self.ufp_enabled)", "if (ufp_value := self.ufp_value) is not None:\n if TYPE_CHECKING:\n assert isinstance(ufp_value, tuple)\n return get_nested_attr(obj, ufp_...
<|body_start_0|> self.ufp_required_field = split_tuple(self.ufp_required_field) self.ufp_value = split_tuple(self.ufp_value) self.ufp_enabled = split_tuple(self.ufp_enabled) <|end_body_0|> <|body_start_1|> if (ufp_value := self.ufp_value) is not None: if TYPE_CHECKING: ...
Mixin for required keys.
ProtectRequiredKeysMixin
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProtectRequiredKeysMixin: """Mixin for required keys.""" def __post_init__(self) -> None: """Pre-convert strings to tuples for faster get_nested_attr.""" <|body_0|> def get_ufp_value(self, obj: T) -> Any: """Return value from UniFi Protect device.""" <|bo...
stack_v2_sparse_classes_10k_train_000263
5,372
permissive
[ { "docstring": "Pre-convert strings to tuples for faster get_nested_attr.", "name": "__post_init__", "signature": "def __post_init__(self) -> None" }, { "docstring": "Return value from UniFi Protect device.", "name": "get_ufp_value", "signature": "def get_ufp_value(self, obj: T) -> Any" ...
4
stack_v2_sparse_classes_30k_train_004883
Implement the Python class `ProtectRequiredKeysMixin` described below. Class description: Mixin for required keys. Method signatures and docstrings: - def __post_init__(self) -> None: Pre-convert strings to tuples for faster get_nested_attr. - def get_ufp_value(self, obj: T) -> Any: Return value from UniFi Protect de...
Implement the Python class `ProtectRequiredKeysMixin` described below. Class description: Mixin for required keys. Method signatures and docstrings: - def __post_init__(self) -> None: Pre-convert strings to tuples for faster get_nested_attr. - def get_ufp_value(self, obj: T) -> Any: Return value from UniFi Protect de...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class ProtectRequiredKeysMixin: """Mixin for required keys.""" def __post_init__(self) -> None: """Pre-convert strings to tuples for faster get_nested_attr.""" <|body_0|> def get_ufp_value(self, obj: T) -> Any: """Return value from UniFi Protect device.""" <|bo...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class ProtectRequiredKeysMixin: """Mixin for required keys.""" def __post_init__(self) -> None: """Pre-convert strings to tuples for faster get_nested_attr.""" self.ufp_required_field = split_tuple(self.ufp_required_field) self.ufp_value = split_tuple(self.ufp_value) self.ufp_en...
the_stack_v2_python_sparse
homeassistant/components/unifiprotect/models.py
home-assistant/core
train
35,501
882905b66eb19f6db75b4fed87543117ef47e4d2
[ "map_file = open(Serializer.FILE_NAME, 'wb')\npickle.dump(game_map, map_file)\ncustom_log.logger.info('Map Saved!')\ncustom_log.logger.info('---------------------------------------------------')", "try:\n with open(Serializer.FILE_NAME, 'rb') as map_file:\n game_map = pickle.load(map_file)\n cust...
<|body_start_0|> map_file = open(Serializer.FILE_NAME, 'wb') pickle.dump(game_map, map_file) custom_log.logger.info('Map Saved!') custom_log.logger.info('---------------------------------------------------') <|end_body_0|> <|body_start_1|> try: with open(Serializer.F...
Serializer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Serializer: def save_map(game_map): """Save Game map. :param game_map: game map. :game_map type: str. :returns: None. :rtype: None.""" <|body_0|> def load_map(): """Load Game map. :returns: Game Map. :rtype: str.""" <|body_1|> <|end_skeleton|> <|body_start_...
stack_v2_sparse_classes_10k_train_000264
1,231
permissive
[ { "docstring": "Save Game map. :param game_map: game map. :game_map type: str. :returns: None. :rtype: None.", "name": "save_map", "signature": "def save_map(game_map)" }, { "docstring": "Load Game map. :returns: Game Map. :rtype: str.", "name": "load_map", "signature": "def load_map()" ...
2
null
Implement the Python class `Serializer` described below. Class description: Implement the Serializer class. Method signatures and docstrings: - def save_map(game_map): Save Game map. :param game_map: game map. :game_map type: str. :returns: None. :rtype: None. - def load_map(): Load Game map. :returns: Game Map. :rty...
Implement the Python class `Serializer` described below. Class description: Implement the Serializer class. Method signatures and docstrings: - def save_map(game_map): Save Game map. :param game_map: game map. :game_map type: str. :returns: None. :rtype: None. - def load_map(): Load Game map. :returns: Game Map. :rty...
291592e97b6d8fe9f9e6627dc0023875918d3463
<|skeleton|> class Serializer: def save_map(game_map): """Save Game map. :param game_map: game map. :game_map type: str. :returns: None. :rtype: None.""" <|body_0|> def load_map(): """Load Game map. :returns: Game Map. :rtype: str.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Serializer: def save_map(game_map): """Save Game map. :param game_map: game map. :game_map type: str. :returns: None. :rtype: None.""" map_file = open(Serializer.FILE_NAME, 'wb') pickle.dump(game_map, map_file) custom_log.logger.info('Map Saved!') custom_log.logger.info...
the_stack_v2_python_sparse
Yurii_Smazhnyi/10/dungeon_game/dungeon_game_smazhnyi/serializer.py
SmischenkoB/campus_2018_python
train
0
9db1feedb9a50452257eeb67949f75d50f15565c
[ "self.statevar = ['swq']\nself.obsvar = 'snow_cover'\nself.uncert = uncert", "data = {}\ndb = dbio.connect(models.dbname)\ncur = db.cursor()\nfor s in self.statevar:\n sql = \"select ensemble,st_x(geom),st_y(geom),val from (select ensemble,(ST_PixelAsCentroids(rast)).* from {0}.{1} where fdate=date '{2}-{3}-{4...
<|body_start_0|> self.statevar = ['swq'] self.obsvar = 'snow_cover' self.uncert = uncert <|end_body_0|> <|body_start_1|> data = {} db = dbio.connect(models.dbname) cur = db.cursor() for s in self.statevar: sql = "select ensemble,st_x(geom),st_y(geom),...
Snowcover
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Snowcover: def __init__(self, uncert=None): """Initialize MODSCAG snow cover fraction object.""" <|body_0|> def x(self, dt, models): """Retrieve state variable from database.""" <|body_1|> def get(self, dt, models): """Retrieve observations from ...
stack_v2_sparse_classes_10k_train_000265
2,788
permissive
[ { "docstring": "Initialize MODSCAG snow cover fraction object.", "name": "__init__", "signature": "def __init__(self, uncert=None)" }, { "docstring": "Retrieve state variable from database.", "name": "x", "signature": "def x(self, dt, models)" }, { "docstring": "Retrieve observat...
4
stack_v2_sparse_classes_30k_train_001437
Implement the Python class `Snowcover` described below. Class description: Implement the Snowcover class. Method signatures and docstrings: - def __init__(self, uncert=None): Initialize MODSCAG snow cover fraction object. - def x(self, dt, models): Retrieve state variable from database. - def get(self, dt, models): R...
Implement the Python class `Snowcover` described below. Class description: Implement the Snowcover class. Method signatures and docstrings: - def __init__(self, uncert=None): Initialize MODSCAG snow cover fraction object. - def x(self, dt, models): Retrieve state variable from database. - def get(self, dt, models): R...
27d0abcaeefd8760ce68e05e52905aea5f8f3a51
<|skeleton|> class Snowcover: def __init__(self, uncert=None): """Initialize MODSCAG snow cover fraction object.""" <|body_0|> def x(self, dt, models): """Retrieve state variable from database.""" <|body_1|> def get(self, dt, models): """Retrieve observations from ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Snowcover: def __init__(self, uncert=None): """Initialize MODSCAG snow cover fraction object.""" self.statevar = ['swq'] self.obsvar = 'snow_cover' self.uncert = uncert def x(self, dt, models): """Retrieve state variable from database.""" data = {} ...
the_stack_v2_python_sparse
src/datasets/snowcover.py
nasa/RHEAS
train
88
402bad30f81c9bf2a3c4faca5e710825b32eb91a
[ "self.criteria = kwargs.pop('criteria')\nsuper().__init__(*args, **kwargs)\nself.fields['levels_of_attainment'].initial = ', '.join(self.criteria[0].categories)", "form_data = super().clean()\nn_loas = len([loa for loa in form_data['levels_of_attainment'].split(',') if loa])\nif n_loas != len(self.criteria[0].cat...
<|body_start_0|> self.criteria = kwargs.pop('criteria') super().__init__(*args, **kwargs) self.fields['levels_of_attainment'].initial = ', '.join(self.criteria[0].categories) <|end_body_0|> <|body_start_1|> form_data = super().clean() n_loas = len([loa for loa in form_data['leve...
Edit the levels of attainment of a rubric.
RubricLOAForm
[ "LGPL-2.0-or-later", "BSD-3-Clause", "MIT", "Apache-2.0", "LGPL-2.1-only", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RubricLOAForm: """Edit the levels of attainment of a rubric.""" def __init__(self, *args, **kwargs): """Store the criteria.""" <|body_0|> def clean(self) -> Dict: """Check that the number of LOAs didn't change.""" <|body_1|> <|end_skeleton|> <|body_star...
stack_v2_sparse_classes_10k_train_000266
4,556
permissive
[ { "docstring": "Store the criteria.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Check that the number of LOAs didn't change.", "name": "clean", "signature": "def clean(self) -> Dict" } ]
2
null
Implement the Python class `RubricLOAForm` described below. Class description: Edit the levels of attainment of a rubric. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Store the criteria. - def clean(self) -> Dict: Check that the number of LOAs didn't change.
Implement the Python class `RubricLOAForm` described below. Class description: Edit the levels of attainment of a rubric. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Store the criteria. - def clean(self) -> Dict: Check that the number of LOAs didn't change. <|skeleton|> class RubricLOAFo...
c432745dfff932cbe7397100422d49df78f0a882
<|skeleton|> class RubricLOAForm: """Edit the levels of attainment of a rubric.""" def __init__(self, *args, **kwargs): """Store the criteria.""" <|body_0|> def clean(self) -> Dict: """Check that the number of LOAs didn't change.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class RubricLOAForm: """Edit the levels of attainment of a rubric.""" def __init__(self, *args, **kwargs): """Store the criteria.""" self.criteria = kwargs.pop('criteria') super().__init__(*args, **kwargs) self.fields['levels_of_attainment'].initial = ', '.join(self.criteria[0]....
the_stack_v2_python_sparse
ontask/action/forms/crud.py
abelardopardo/ontask_b
train
43
1cc5847563b3606fc337946683b75fb15e332235
[ "self.id = id\nself.created_date = created_date\nself.additional_properties = additional_properties", "if dictionary is None:\n return None\nid = dictionary.get('id')\ncreated_date = dictionary.get('createdDate')\nfor key in cls._names.values():\n if key in dictionary:\n del dictionary[key]\nreturn c...
<|body_start_0|> self.id = id self.created_date = created_date self.additional_properties = additional_properties <|end_body_0|> <|body_start_1|> if dictionary is None: return None id = dictionary.get('id') created_date = dictionary.get('createdDate') ...
Implementation of the 'Create TxPush Test Transaction Response' model. Response for TxPush test transaction Attributes: id (long|int): The ID of the new transaction record created_date (long|int): A timestamp of when the transaction was added (see Handling Dates and Times)
CreateTxpushTestTransactionResponse
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CreateTxpushTestTransactionResponse: """Implementation of the 'Create TxPush Test Transaction Response' model. Response for TxPush test transaction Attributes: id (long|int): The ID of the new transaction record created_date (long|int): A timestamp of when the transaction was added (see Handling ...
stack_v2_sparse_classes_10k_train_000267
2,019
permissive
[ { "docstring": "Constructor for the CreateTxpushTestTransactionResponse class", "name": "__init__", "signature": "def __init__(self, id=None, created_date=None, additional_properties={})" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dict...
2
stack_v2_sparse_classes_30k_train_001861
Implement the Python class `CreateTxpushTestTransactionResponse` described below. Class description: Implementation of the 'Create TxPush Test Transaction Response' model. Response for TxPush test transaction Attributes: id (long|int): The ID of the new transaction record created_date (long|int): A timestamp of when t...
Implement the Python class `CreateTxpushTestTransactionResponse` described below. Class description: Implementation of the 'Create TxPush Test Transaction Response' model. Response for TxPush test transaction Attributes: id (long|int): The ID of the new transaction record created_date (long|int): A timestamp of when t...
b2ab1ded435db75c78d42261f5e4acd2a3061487
<|skeleton|> class CreateTxpushTestTransactionResponse: """Implementation of the 'Create TxPush Test Transaction Response' model. Response for TxPush test transaction Attributes: id (long|int): The ID of the new transaction record created_date (long|int): A timestamp of when the transaction was added (see Handling ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class CreateTxpushTestTransactionResponse: """Implementation of the 'Create TxPush Test Transaction Response' model. Response for TxPush test transaction Attributes: id (long|int): The ID of the new transaction record created_date (long|int): A timestamp of when the transaction was added (see Handling Dates and Tim...
the_stack_v2_python_sparse
finicityapi/models/create_txpush_test_transaction_response.py
monarchmoney/finicity-python
train
0
8469a8aebcaad6f103eec9c98f31ead992183c71
[ "with tf.variable_scope('interatomic_dists'):\n dists = tf.sqrt(tf.reduce_sum(tf.square(R[:, None, :, :] - R[:, :, None, :]), axis=-1))\nreturn dists", "with tf.variable_scope('gauss_grid'):\n num = int(np.ceil((mu_max - mu_min) / delta_mu))\n remainder = num * delta_mu - (mu_max - mu_min)\n mu = self...
<|body_start_0|> with tf.variable_scope('interatomic_dists'): dists = tf.sqrt(tf.reduce_sum(tf.square(R[:, None, :, :] - R[:, :, None, :]), axis=-1)) return dists <|end_body_0|> <|body_start_1|> with tf.variable_scope('gauss_grid'): num = int(np.ceil((mu_max - mu_min) / ...
MolecularPreprocessingMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MolecularPreprocessingMixin: def _interatomic_dists(self, R): """transforms absolute coordinates in data matrix R to pairwise distance matrices params: R - matrix of shape (n_points, n_atoms, 3) returns - pairwise distance matrix of shape (n_points, n_atoms, n_atoms)""" <|body_0|...
stack_v2_sparse_classes_10k_train_000268
18,572
no_license
[ { "docstring": "transforms absolute coordinates in data matrix R to pairwise distance matrices params: R - matrix of shape (n_points, n_atoms, 3) returns - pairwise distance matrix of shape (n_points, n_atoms, n_atoms)", "name": "_interatomic_dists", "signature": "def _interatomic_dists(self, R)" }, ...
2
stack_v2_sparse_classes_30k_test_000037
Implement the Python class `MolecularPreprocessingMixin` described below. Class description: Implement the MolecularPreprocessingMixin class. Method signatures and docstrings: - def _interatomic_dists(self, R): transforms absolute coordinates in data matrix R to pairwise distance matrices params: R - matrix of shape ...
Implement the Python class `MolecularPreprocessingMixin` described below. Class description: Implement the MolecularPreprocessingMixin class. Method signatures and docstrings: - def _interatomic_dists(self, R): transforms absolute coordinates in data matrix R to pairwise distance matrices params: R - matrix of shape ...
b54a80ce4be5b89a1b2c5bf3ebc0308d12e4c9b6
<|skeleton|> class MolecularPreprocessingMixin: def _interatomic_dists(self, R): """transforms absolute coordinates in data matrix R to pairwise distance matrices params: R - matrix of shape (n_points, n_atoms, 3) returns - pairwise distance matrix of shape (n_points, n_atoms, n_atoms)""" <|body_0|...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MolecularPreprocessingMixin: def _interatomic_dists(self, R): """transforms absolute coordinates in data matrix R to pairwise distance matrices params: R - matrix of shape (n_points, n_atoms, 3) returns - pairwise distance matrix of shape (n_points, n_atoms, n_atoms)""" with tf.variable_scope(...
the_stack_v2_python_sparse
networks/neuralnet.py
qk/unn
train
1
b6453361031f0b9ce581abe770960536889d98bf
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\ntry:\n mapping_value = parse_node.get_child_node('@odata.type').get_str_value()\nexcept AttributeError:\n mapping_value = None\nif mapping_value and mapping_value.casefold() == '#microsoft.graph.notebook'.casefold():\n from .notebook i...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') try: mapping_value = parse_node.get_child_node('@odata.type').get_str_value() except AttributeError: mapping_value = None if mapping_value and mapping_value.casefold() ==...
OnenoteEntityHierarchyModel
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OnenoteEntityHierarchyModel: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> OnenoteEntityHierarchyModel: """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 a...
stack_v2_sparse_classes_10k_train_000269
4,684
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: OnenoteEntityHierarchyModel", "name": "create_from_discriminator_value", "signature": "def create_from_discr...
3
stack_v2_sparse_classes_30k_train_001516
Implement the Python class `OnenoteEntityHierarchyModel` described below. Class description: Implement the OnenoteEntityHierarchyModel class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> OnenoteEntityHierarchyModel: Creates a new instance of the appr...
Implement the Python class `OnenoteEntityHierarchyModel` described below. Class description: Implement the OnenoteEntityHierarchyModel class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> OnenoteEntityHierarchyModel: Creates a new instance of the appr...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class OnenoteEntityHierarchyModel: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> OnenoteEntityHierarchyModel: """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 a...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class OnenoteEntityHierarchyModel: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> OnenoteEntityHierarchyModel: """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 ...
the_stack_v2_python_sparse
msgraph/generated/models/onenote_entity_hierarchy_model.py
microsoftgraph/msgraph-sdk-python
train
135
5dc4e213daef57cb10919bb09b98075aeb004d7a
[ "if not lists:\n return None\nleft, right = (0, len(lists) - 1)\nwhile right > 0:\n if left >= right:\n left = 0\n else:\n lists[left] = self.merge_two(lists[left], lists[right])\n left += 1\n right -= 1\nreturn lists[0]", "curr = dummy = ListNode('X')\nwhile l1 and l2:\n i...
<|body_start_0|> if not lists: return None left, right = (0, len(lists) - 1) while right > 0: if left >= right: left = 0 else: lists[left] = self.merge_two(lists[left], lists[right]) left += 1 rig...
Solution_STD
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution_STD: def mergeKLists(self, lists: List[ListNode]) -> ListNode: """Improved from C1 这个方法采用首尾合并, 这样能显著减少重复流经的节点 首尾相遇后, 重置首为0, 尾不变(因为已经都被合并到前面去了)""" <|body_0|> def merge_two(self, l1: ListNode, l2: ListNode) -> ListNode: """Helper for Solution C1 and C2 (now se...
stack_v2_sparse_classes_10k_train_000270
4,145
permissive
[ { "docstring": "Improved from C1 这个方法采用首尾合并, 这样能显著减少重复流经的节点 首尾相遇后, 重置首为0, 尾不变(因为已经都被合并到前面去了)", "name": "mergeKLists", "signature": "def mergeKLists(self, lists: List[ListNode]) -> ListNode" }, { "docstring": "Helper for Solution C1 and C2 (now set out side of the Solution) merge two sorted linke...
2
null
Implement the Python class `Solution_STD` described below. Class description: Implement the Solution_STD class. Method signatures and docstrings: - def mergeKLists(self, lists: List[ListNode]) -> ListNode: Improved from C1 这个方法采用首尾合并, 这样能显著减少重复流经的节点 首尾相遇后, 重置首为0, 尾不变(因为已经都被合并到前面去了) - def merge_two(self, l1: ListNode,...
Implement the Python class `Solution_STD` described below. Class description: Implement the Solution_STD class. Method signatures and docstrings: - def mergeKLists(self, lists: List[ListNode]) -> ListNode: Improved from C1 这个方法采用首尾合并, 这样能显著减少重复流经的节点 首尾相遇后, 重置首为0, 尾不变(因为已经都被合并到前面去了) - def merge_two(self, l1: ListNode,...
143422321cbc3715ca08f6c3af8f960a55887ced
<|skeleton|> class Solution_STD: def mergeKLists(self, lists: List[ListNode]) -> ListNode: """Improved from C1 这个方法采用首尾合并, 这样能显著减少重复流经的节点 首尾相遇后, 重置首为0, 尾不变(因为已经都被合并到前面去了)""" <|body_0|> def merge_two(self, l1: ListNode, l2: ListNode) -> ListNode: """Helper for Solution C1 and C2 (now se...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution_STD: def mergeKLists(self, lists: List[ListNode]) -> ListNode: """Improved from C1 这个方法采用首尾合并, 这样能显著减少重复流经的节点 首尾相遇后, 重置首为0, 尾不变(因为已经都被合并到前面去了)""" if not lists: return None left, right = (0, len(lists) - 1) while right > 0: if left >= right: ...
the_stack_v2_python_sparse
LeetCode/LC023_merge_k_sorted_list.py
jxie0755/Learning_Python
train
0
ef883a8c3b5db22bf83c58765c7bf09f88657fc7
[ "print('build SetRank')\nself.hparams = ultra.utils.hparams.HParams(d_model=256, num_heads=8, num_layers=2, diff=64, rate=0.0, initializer=None, output_size=1)\nself.hparams.parse(hparams_str)\nself.initializer = None\nif self.hparams.initializer == 'constant':\n self.initializer = tf.constant_initializer(0.001)...
<|body_start_0|> print('build SetRank') self.hparams = ultra.utils.hparams.HParams(d_model=256, num_heads=8, num_layers=2, diff=64, rate=0.0, initializer=None, output_size=1) self.hparams.parse(hparams_str) self.initializer = None if self.hparams.initializer == 'constant': ...
The SetRank model for learning to rank. This class implements the SetRank model for ranking. See the following paper for more information. * Liang Pang, Jun Xu, Qingyao Ai, Yanyan Lan, Xueqi Cheng, Jirong Wen. 2020. SetRank: Learning a Permutation-Invariant Ranking Model for Information Retrieval. In Proceedings of SIG...
SetRank
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SetRank: """The SetRank model for learning to rank. This class implements the SetRank model for ranking. See the following paper for more information. * Liang Pang, Jun Xu, Qingyao Ai, Yanyan Lan, Xueqi Cheng, Jirong Wen. 2020. SetRank: Learning a Permutation-Invariant Ranking Model for Informati...
stack_v2_sparse_classes_10k_train_000271
10,418
permissive
[ { "docstring": "Create the network. Args: hparams_str: (String) The hyper-parameters used to build the network.", "name": "__init__", "signature": "def __init__(self, hparams_str)" }, { "docstring": "Create the SetRank model (no supports for noisy parameters) Args: input_list: (list<tf.tensor>) ...
2
stack_v2_sparse_classes_30k_train_002721
Implement the Python class `SetRank` described below. Class description: The SetRank model for learning to rank. This class implements the SetRank model for ranking. See the following paper for more information. * Liang Pang, Jun Xu, Qingyao Ai, Yanyan Lan, Xueqi Cheng, Jirong Wen. 2020. SetRank: Learning a Permutatio...
Implement the Python class `SetRank` described below. Class description: The SetRank model for learning to rank. This class implements the SetRank model for ranking. See the following paper for more information. * Liang Pang, Jun Xu, Qingyao Ai, Yanyan Lan, Xueqi Cheng, Jirong Wen. 2020. SetRank: Learning a Permutatio...
89ffcaeb1049627d90518c2045dad7a996dfe2aa
<|skeleton|> class SetRank: """The SetRank model for learning to rank. This class implements the SetRank model for ranking. See the following paper for more information. * Liang Pang, Jun Xu, Qingyao Ai, Yanyan Lan, Xueqi Cheng, Jirong Wen. 2020. SetRank: Learning a Permutation-Invariant Ranking Model for Informati...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SetRank: """The SetRank model for learning to rank. This class implements the SetRank model for ranking. See the following paper for more information. * Liang Pang, Jun Xu, Qingyao Ai, Yanyan Lan, Xueqi Cheng, Jirong Wen. 2020. SetRank: Learning a Permutation-Invariant Ranking Model for Information Retrieval....
the_stack_v2_python_sparse
ultra/ranking_model/SetRank.py
ULTR-Community/ULTRA
train
281
b911e40a3f5d80d4cfcbace42b8d3795e1f7bdcf
[ "params['n_clusters'] = n_clusters\nself.km = Kmeans(**params)\nself.metric = self.km.metric", "self.covmeans_ = []\nself.classes_ = numpy.unique(y)\nfor c in self.classes_:\n self.km.fit(X[y == c])\n self.covmeans_.extend(self.km.centroids())\nreturn self", "mdm = MDM(metric=self.metric)\nmdm.covmeans_ =...
<|body_start_0|> params['n_clusters'] = n_clusters self.km = Kmeans(**params) self.metric = self.km.metric <|end_body_0|> <|body_start_1|> self.covmeans_ = [] self.classes_ = numpy.unique(y) for c in self.classes_: self.km.fit(X[y == c]) self.covm...
Run kmeans for each class.
KmeansPerClassTransform
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KmeansPerClassTransform: """Run kmeans for each class.""" def __init__(self, n_clusters=2, **params): """Init.""" <|body_0|> def fit(self, X, y): """fit.""" <|body_1|> def transform(self, X): """transform.""" <|body_2|> <|end_skeleto...
stack_v2_sparse_classes_10k_train_000272
12,224
permissive
[ { "docstring": "Init.", "name": "__init__", "signature": "def __init__(self, n_clusters=2, **params)" }, { "docstring": "fit.", "name": "fit", "signature": "def fit(self, X, y)" }, { "docstring": "transform.", "name": "transform", "signature": "def transform(self, X)" }...
3
stack_v2_sparse_classes_30k_train_003955
Implement the Python class `KmeansPerClassTransform` described below. Class description: Run kmeans for each class. Method signatures and docstrings: - def __init__(self, n_clusters=2, **params): Init. - def fit(self, X, y): fit. - def transform(self, X): transform.
Implement the Python class `KmeansPerClassTransform` described below. Class description: Run kmeans for each class. Method signatures and docstrings: - def __init__(self, n_clusters=2, **params): Init. - def fit(self, X, y): fit. - def transform(self, X): transform. <|skeleton|> class KmeansPerClassTransform: ""...
26c2ebf5200b5a5cd268fa73ac3928d7257d08d3
<|skeleton|> class KmeansPerClassTransform: """Run kmeans for each class.""" def __init__(self, n_clusters=2, **params): """Init.""" <|body_0|> def fit(self, X, y): """fit.""" <|body_1|> def transform(self, X): """transform.""" <|body_2|> <|end_skeleto...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class KmeansPerClassTransform: """Run kmeans for each class.""" def __init__(self, n_clusters=2, **params): """Init.""" params['n_clusters'] = n_clusters self.km = Kmeans(**params) self.metric = self.km.metric def fit(self, X, y): """fit.""" self.covmeans_ =...
the_stack_v2_python_sparse
externals/pyriemann/clustering.py
kingjr/decoding_challenge_cortana_2016_3rd
train
10
48b6bfdf3841c55d1521e60891df82f07dde1335
[ "n = len(nums)\n\ndef dfs(a, cur):\n nonlocal res\n if a == (1 << n) - 1:\n res.append(cur)\n for i in range(n):\n if a & 1 << i:\n continue\n dfs(a | 1 << i, cur + [nums[i]])\nres = []\ndfs(0, [])\nreturn res", "n = len(nums)\n\ndef dfs(start):\n nonlocal res\n if s...
<|body_start_0|> n = len(nums) def dfs(a, cur): nonlocal res if a == (1 << n) - 1: res.append(cur) for i in range(n): if a & 1 << i: continue dfs(a | 1 << i, cur + [nums[i]]) res = [] ...
[46. 全排列](https://leetcode-cn.com/problems/permutations/)
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """[46. 全排列](https://leetcode-cn.com/problems/permutations/)""" def permute(self, nums: List[int]) -> List[List[int]]: """思路:回溯算法,由于没有重复的数字,每次传一个值,用二进制代表哪个位置被选过""" <|body_0|> def permute2(self, nums: List[int]) -> List[List[int]]: """思路:回溯算法,大佬的交换法,可以随递...
stack_v2_sparse_classes_10k_train_000273
1,469
no_license
[ { "docstring": "思路:回溯算法,由于没有重复的数字,每次传一个值,用二进制代表哪个位置被选过", "name": "permute", "signature": "def permute(self, nums: List[int]) -> List[List[int]]" }, { "docstring": "思路:回溯算法,大佬的交换法,可以随递归深度缩小遍历次数", "name": "permute2", "signature": "def permute2(self, nums: List[int]) -> List[List[int]]" }...
2
null
Implement the Python class `Solution` described below. Class description: [46. 全排列](https://leetcode-cn.com/problems/permutations/) Method signatures and docstrings: - def permute(self, nums: List[int]) -> List[List[int]]: 思路:回溯算法,由于没有重复的数字,每次传一个值,用二进制代表哪个位置被选过 - def permute2(self, nums: List[int]) -> List[List[int]]...
Implement the Python class `Solution` described below. Class description: [46. 全排列](https://leetcode-cn.com/problems/permutations/) Method signatures and docstrings: - def permute(self, nums: List[int]) -> List[List[int]]: 思路:回溯算法,由于没有重复的数字,每次传一个值,用二进制代表哪个位置被选过 - def permute2(self, nums: List[int]) -> List[List[int]]...
dbe8eb449e5b112a71bc1cd4eabfd138304de4a3
<|skeleton|> class Solution: """[46. 全排列](https://leetcode-cn.com/problems/permutations/)""" def permute(self, nums: List[int]) -> List[List[int]]: """思路:回溯算法,由于没有重复的数字,每次传一个值,用二进制代表哪个位置被选过""" <|body_0|> def permute2(self, nums: List[int]) -> List[List[int]]: """思路:回溯算法,大佬的交换法,可以随递...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: """[46. 全排列](https://leetcode-cn.com/problems/permutations/)""" def permute(self, nums: List[int]) -> List[List[int]]: """思路:回溯算法,由于没有重复的数字,每次传一个值,用二进制代表哪个位置被选过""" n = len(nums) def dfs(a, cur): nonlocal res if a == (1 << n) - 1: ...
the_stack_v2_python_sparse
leetcode/1-300/46.py
Rivarrl/leetcode_python
train
3
fd9170e9e6144146496359d46112e3f5b2ae8252
[ "LOG.info('doLogin called {}.'.format(PrettyFormatAny.form(p_json, 'Login From Browser')))\nl_obj = json_tools.decode_json_unicode(p_json)\nl_login_obj = self.validate_user(l_obj)\nl_json = json_tools.encode_json(l_login_obj)\nreturn l_json", "l_obj = dict(Devices=VALID_DEVICE_TYPES, Families=VALID_FAMILIES, Floo...
<|body_start_0|> LOG.info('doLogin called {}.'.format(PrettyFormatAny.form(p_json, 'Login From Browser'))) l_obj = json_tools.decode_json_unicode(p_json) l_login_obj = self.validate_user(l_obj) l_json = json_tools.encode_json(l_login_obj) return l_json <|end_body_0|> <|body_star...
LoginHelper
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoginHelper: def doLogin(self, p_json): """This will receive json of username, password when the user clicks on the login button in the browser. First, we validate the user If valid, display the user and then the root menu. If not - allow the user to retry the login. also allow user to c...
stack_v2_sparse_classes_10k_train_000274
10,628
no_license
[ { "docstring": "This will receive json of username, password when the user clicks on the login button in the browser. First, we validate the user If valid, display the user and then the root menu. If not - allow the user to retry the login. also allow user to check the change button and apply the change after l...
3
stack_v2_sparse_classes_30k_train_001144
Implement the Python class `LoginHelper` described below. Class description: Implement the LoginHelper class. Method signatures and docstrings: - def doLogin(self, p_json): This will receive json of username, password when the user clicks on the login button in the browser. First, we validate the user If valid, displ...
Implement the Python class `LoginHelper` described below. Class description: Implement the LoginHelper class. Method signatures and docstrings: - def doLogin(self, p_json): This will receive json of username, password when the user clicks on the login button in the browser. First, we validate the user If valid, displ...
8ccbbd1494b7b33ff5099d321cda634fbb254ceb
<|skeleton|> class LoginHelper: def doLogin(self, p_json): """This will receive json of username, password when the user clicks on the login button in the browser. First, we validate the user If valid, display the user and then the root menu. If not - allow the user to retry the login. also allow user to c...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LoginHelper: def doLogin(self, p_json): """This will receive json of username, password when the user clicks on the login button in the browser. First, we validate the user If valid, display the user and then the root menu. If not - allow the user to retry the login. also allow user to check the chang...
the_stack_v2_python_sparse
Project/src/Modules/Computer/Web/web_login.py
bopopescu/PyHouse
train
0
f9e60960a5cf11441200ec474a266ed766c36a45
[ "self.data_train = tfds.load('ted_hrlr_translate/pt_to_en', split='train', as_supervised=True)\nself.data_valid = tfds.load('ted_hrlr_translate/pt_to_en', split='validation', as_supervised=True)\ntokenizer_pt, tokenizer_en = self.tokenize_dataset(self.data_train)\nself.tokenizer_pt = tokenizer_pt\nself.tokenizer_en...
<|body_start_0|> self.data_train = tfds.load('ted_hrlr_translate/pt_to_en', split='train', as_supervised=True) self.data_valid = tfds.load('ted_hrlr_translate/pt_to_en', split='validation', as_supervised=True) tokenizer_pt, tokenizer_en = self.tokenize_dataset(self.data_train) self.token...
class dataset
Dataset
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Dataset: """class dataset""" def __init__(self): """constructor instance attributes: data_train: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset train split, loaded as_supervided data_valid: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset validate split, loaded as_s...
stack_v2_sparse_classes_10k_train_000275
1,987
no_license
[ { "docstring": "constructor instance attributes: data_train: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset train split, loaded as_supervided data_valid: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset validate split, loaded as_supervided tokenizer_pt: is the Portuguese tokenizer created from...
2
stack_v2_sparse_classes_30k_train_006736
Implement the Python class `Dataset` described below. Class description: class dataset Method signatures and docstrings: - def __init__(self): constructor instance attributes: data_train: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset train split, loaded as_supervided data_valid: contains the ted_hrlr_trans...
Implement the Python class `Dataset` described below. Class description: class dataset Method signatures and docstrings: - def __init__(self): constructor instance attributes: data_train: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset train split, loaded as_supervided data_valid: contains the ted_hrlr_trans...
ff1af62484620b599cc3813068770db03b37036d
<|skeleton|> class Dataset: """class dataset""" def __init__(self): """constructor instance attributes: data_train: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset train split, loaded as_supervided data_valid: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset validate split, loaded as_s...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Dataset: """class dataset""" def __init__(self): """constructor instance attributes: data_train: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset train split, loaded as_supervided data_valid: contains the ted_hrlr_translate/pt_to_en tf.data.Dataset validate split, loaded as_supervided tok...
the_stack_v2_python_sparse
supervised_learning/0x12-transformer_apps/0-dataset.py
paurbano/holbertonschool-machine_learning
train
0
10d23eb14c95df3f69d5caaa95ddfa7cb8e0635a
[ "self.scrreningconditionInt = scrreningconditionInt\nself.samlingConditionInt = samplingConditionInt\nself.screeningconditionFloat = screeningconditionFloat\nself.samlingConditionFloat = samlingConditionFloat\nself.screeningConditionStr = screeningConditionStr\nself.samlingConditionStr = samlingConditionStr\nself.s...
<|body_start_0|> self.scrreningconditionInt = scrreningconditionInt self.samlingConditionInt = samplingConditionInt self.screeningconditionFloat = screeningconditionFloat self.samlingConditionFloat = samlingConditionFloat self.screeningConditionStr = screeningConditionStr ...
SamplingAndScreeningFactory
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SamplingAndScreeningFactory: def __init__(self, intNum, samplingConditionInt, scrreningconditionInt, floatNum, samlingConditionFloat, screeningconditionFloat, strNum, samlingConditionStr, screeningConditionStr, strlen=6): """:param intNum:产生整数随机数的个数 :param samplingConditionInt: 整数随机数生成范围...
stack_v2_sparse_classes_10k_train_000276
2,892
no_license
[ { "docstring": ":param intNum:产生整数随机数的个数 :param samplingConditionInt: 整数随机数生成范围 :param scrreningconditionInt: 整数随机数筛选范围 :param floatNum: 产生浮点数的个数 :param samlingConditionFloat:浮点数的生成范围 :param screeningconditionFloat:浮点数的筛选范围 :param strNum:产生字符串的个数 :param samlingConditionStr:字符串的生成范围 :param screeningConditionStr:...
2
null
Implement the Python class `SamplingAndScreeningFactory` described below. Class description: Implement the SamplingAndScreeningFactory class. Method signatures and docstrings: - def __init__(self, intNum, samplingConditionInt, scrreningconditionInt, floatNum, samlingConditionFloat, screeningconditionFloat, strNum, sa...
Implement the Python class `SamplingAndScreeningFactory` described below. Class description: Implement the SamplingAndScreeningFactory class. Method signatures and docstrings: - def __init__(self, intNum, samplingConditionInt, scrreningconditionInt, floatNum, samlingConditionFloat, screeningconditionFloat, strNum, sa...
661dba7ea846859056fd6ee7a310d352ca178e98
<|skeleton|> class SamplingAndScreeningFactory: def __init__(self, intNum, samplingConditionInt, scrreningconditionInt, floatNum, samlingConditionFloat, screeningconditionFloat, strNum, samlingConditionStr, screeningConditionStr, strlen=6): """:param intNum:产生整数随机数的个数 :param samplingConditionInt: 整数随机数生成范围...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class SamplingAndScreeningFactory: def __init__(self, intNum, samplingConditionInt, scrreningconditionInt, floatNum, samlingConditionFloat, screeningconditionFloat, strNum, samlingConditionStr, screeningConditionStr, strlen=6): """:param intNum:产生整数随机数的个数 :param samplingConditionInt: 整数随机数生成范围 :param scrren...
the_stack_v2_python_sparse
林一夫2017012923/平时作业3/SamplingAndScreeningFactory.py
wanghan79/2020_Python
train
4
e6d8ae0eb196988cfedc077a0f0b1392b50acf7d
[ "is_negative = x < 0\nreversed_num = self.reverse_num(abs(x))\nif -reversed_num < -2 ** 31 or reversed_num > 2 ** 31 - 1:\n return 0\nreturn -reversed_num if is_negative else reversed_num", "reversed = 0\nwhile x > 0:\n reversed += x % 10\n x //= 10\n reversed *= 10\nreturn reversed // 10" ]
<|body_start_0|> is_negative = x < 0 reversed_num = self.reverse_num(abs(x)) if -reversed_num < -2 ** 31 or reversed_num > 2 ** 31 - 1: return 0 return -reversed_num if is_negative else reversed_num <|end_body_0|> <|body_start_1|> reversed = 0 while x > 0: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def reverse(self, x): """(Solution, int) -> int Reverse the digits of a given integer. If the given integer is negative, then the reversed integer should be negative as well. If the given integer has zeros at the end, then the reversed integer should not have the leading zeroes...
stack_v2_sparse_classes_10k_train_000277
2,101
no_license
[ { "docstring": "(Solution, int) -> int Reverse the digits of a given integer. If the given integer is negative, then the reversed integer should be negative as well. If the given integer has zeros at the end, then the reversed integer should not have the leading zeroes. If the reversed integer is outside the 32...
2
stack_v2_sparse_classes_30k_train_000654
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverse(self, x): (Solution, int) -> int Reverse the digits of a given integer. If the given integer is negative, then the reversed integer should be negative as well. If the...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverse(self, x): (Solution, int) -> int Reverse the digits of a given integer. If the given integer is negative, then the reversed integer should be negative as well. If the...
6812253b90bdd5a35c6bfba8eac54da9be26d56c
<|skeleton|> class Solution: def reverse(self, x): """(Solution, int) -> int Reverse the digits of a given integer. If the given integer is negative, then the reversed integer should be negative as well. If the given integer has zeros at the end, then the reversed integer should not have the leading zeroes...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def reverse(self, x): """(Solution, int) -> int Reverse the digits of a given integer. If the given integer is negative, then the reversed integer should be negative as well. If the given integer has zeros at the end, then the reversed integer should not have the leading zeroes. If the rever...
the_stack_v2_python_sparse
python2/reverseInt.py
yichuanma95/leetcode-solns
train
2
c1156d2c7b020d8cdd232c935b449d22ab617acd
[ "domain = self._client.create(domain_name)\nif check:\n self.check_domain_presence(domain)\nreturn domain", "self._client.update(domain, enabled=False)\nself._client.delete(domain.id)\nif check:\n self.check_domain_presence(domain, present=False)", "def predicate():\n try:\n self._client.get(dom...
<|body_start_0|> domain = self._client.create(domain_name) if check: self.check_domain_presence(domain) return domain <|end_body_0|> <|body_start_1|> self._client.update(domain, enabled=False) self._client.delete(domain.id) if check: self.check_do...
Domain steps.
DomainSteps
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DomainSteps: """Domain steps.""" def create_domain(self, domain_name, check=True): """Step to create domain.""" <|body_0|> def delete_domain(self, domain, check=True): """Step to delete domain.""" <|body_1|> def check_domain_presence(self, domain, pr...
stack_v2_sparse_classes_10k_train_000278
1,679
no_license
[ { "docstring": "Step to create domain.", "name": "create_domain", "signature": "def create_domain(self, domain_name, check=True)" }, { "docstring": "Step to delete domain.", "name": "delete_domain", "signature": "def delete_domain(self, domain, check=True)" }, { "docstring": "Ver...
3
stack_v2_sparse_classes_30k_test_000190
Implement the Python class `DomainSteps` described below. Class description: Domain steps. Method signatures and docstrings: - def create_domain(self, domain_name, check=True): Step to create domain. - def delete_domain(self, domain, check=True): Step to delete domain. - def check_domain_presence(self, domain, presen...
Implement the Python class `DomainSteps` described below. Class description: Domain steps. Method signatures and docstrings: - def create_domain(self, domain_name, check=True): Step to create domain. - def delete_domain(self, domain, check=True): Step to delete domain. - def check_domain_presence(self, domain, presen...
380849c3f24d3322caa49f895d0d89cc6c998fa8
<|skeleton|> class DomainSteps: """Domain steps.""" def create_domain(self, domain_name, check=True): """Step to create domain.""" <|body_0|> def delete_domain(self, domain, check=True): """Step to delete domain.""" <|body_1|> def check_domain_presence(self, domain, pr...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class DomainSteps: """Domain steps.""" def create_domain(self, domain_name, check=True): """Step to create domain.""" domain = self._client.create(domain_name) if check: self.check_domain_presence(domain) return domain def delete_domain(self, domain, check=True)...
the_stack_v2_python_sparse
stepler/keystone/steps/domains.py
gdyuldin/stepler
train
0
290e8cd268006000cee9af28736b19d9a4ad31e6
[ "super(LightSource, self).at_object_creation()\nself.db.tutorial_info = 'This object can be turned on off and has a timed script controlling it.'\nself.db.is_active = False\nself.db.burntime = 60 * 3\nself.db.desc = 'A splinter of wood with remnants of resin on it, enough for burning.'\nself.cmdset.add_default(CmdS...
<|body_start_0|> super(LightSource, self).at_object_creation() self.db.tutorial_info = 'This object can be turned on off and has a timed script controlling it.' self.db.is_active = False self.db.burntime = 60 * 3 self.db.desc = 'A splinter of wood with remnants of resin on it, en...
This implements a light source object. When burned out, lightsource will be moved to its home - which by default is the location it was first created at.
LightSource
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LightSource: """This implements a light source object. When burned out, lightsource will be moved to its home - which by default is the location it was first created at.""" def at_object_creation(self): """Called when object is first created.""" <|body_0|> def reset(self...
stack_v2_sparse_classes_10k_train_000279
36,948
permissive
[ { "docstring": "Called when object is first created.", "name": "at_object_creation", "signature": "def at_object_creation(self)" }, { "docstring": "Can be called by tutorial world runner, or by the script when the lightsource has burned out.", "name": "reset", "signature": "def reset(sel...
2
stack_v2_sparse_classes_30k_train_000664
Implement the Python class `LightSource` described below. Class description: This implements a light source object. When burned out, lightsource will be moved to its home - which by default is the location it was first created at. Method signatures and docstrings: - def at_object_creation(self): Called when object is...
Implement the Python class `LightSource` described below. Class description: This implements a light source object. When burned out, lightsource will be moved to its home - which by default is the location it was first created at. Method signatures and docstrings: - def at_object_creation(self): Called when object is...
4515b6b569f919b18223ff2b241ea70f3e787e1e
<|skeleton|> class LightSource: """This implements a light source object. When burned out, lightsource will be moved to its home - which by default is the location it was first created at.""" def at_object_creation(self): """Called when object is first created.""" <|body_0|> def reset(self...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class LightSource: """This implements a light source object. When burned out, lightsource will be moved to its home - which by default is the location it was first created at.""" def at_object_creation(self): """Called when object is first created.""" super(LightSource, self).at_object_creation...
the_stack_v2_python_sparse
contrib/tutorial_world/objects.py
mergederg/deuterium
train
1
5d92f08a57780bc3b787d5535c42a6ec287cd9e9
[ "favorite_existence = Favorite.query(Favorite.model_key == fav.model_key, Favorite.model_type == fav.model_type, ancestor=fav.key.parent()).count()\nif favorite_existence == 0:\n fav.put()\n TBANSHelper.update_favorites(fav.user_id, device_key)\n return True\nelse:\n return False", "to_delete = Favori...
<|body_start_0|> favorite_existence = Favorite.query(Favorite.model_key == fav.model_key, Favorite.model_type == fav.model_type, ancestor=fav.key.parent()).count() if favorite_existence == 0: fav.put() TBANSHelper.update_favorites(fav.user_id, device_key) return True ...
MyTBAHelper
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyTBAHelper: def add_favorite(fav: Favorite, device_key: Optional[str]=None) -> bool: """returns true if the favorite was successfully added, or false if it already existed""" <|body_0|> def remove_favorite(account_key: ndb.Key, model_key: str, model_type: ModelType, device_...
stack_v2_sparse_classes_10k_train_000280
4,103
permissive
[ { "docstring": "returns true if the favorite was successfully added, or false if it already existed", "name": "add_favorite", "signature": "def add_favorite(fav: Favorite, device_key: Optional[str]=None) -> bool" }, { "docstring": "returns true if the favorite was deleted, or false if it didn't ...
4
stack_v2_sparse_classes_30k_train_001590
Implement the Python class `MyTBAHelper` described below. Class description: Implement the MyTBAHelper class. Method signatures and docstrings: - def add_favorite(fav: Favorite, device_key: Optional[str]=None) -> bool: returns true if the favorite was successfully added, or false if it already existed - def remove_fa...
Implement the Python class `MyTBAHelper` described below. Class description: Implement the MyTBAHelper class. Method signatures and docstrings: - def add_favorite(fav: Favorite, device_key: Optional[str]=None) -> bool: returns true if the favorite was successfully added, or false if it already existed - def remove_fa...
6d42f3cdb2f785d192f2871419e58aaae3445029
<|skeleton|> class MyTBAHelper: def add_favorite(fav: Favorite, device_key: Optional[str]=None) -> bool: """returns true if the favorite was successfully added, or false if it already existed""" <|body_0|> def remove_favorite(account_key: ndb.Key, model_key: str, model_type: ModelType, device_...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class MyTBAHelper: def add_favorite(fav: Favorite, device_key: Optional[str]=None) -> bool: """returns true if the favorite was successfully added, or false if it already existed""" favorite_existence = Favorite.query(Favorite.model_key == fav.model_key, Favorite.model_type == fav.model_type, ancest...
the_stack_v2_python_sparse
src/backend/common/helpers/mytba_helper.py
the-blue-alliance/the-blue-alliance
train
344
c2c9ce14160360a314affb15f2cb2182929fdbc9
[ "form = EngineerAddForm(request.POST or None)\nif form.is_valid():\n instance = form.save(commit=False)\n instance.added_by = self.request.user\n instance.save()\n messages.add_message(request, messages.INFO, 'Success - Engineer added successfully')\n return redirect('engineers:engineer_view')\nmessa...
<|body_start_0|> form = EngineerAddForm(request.POST or None) if form.is_valid(): instance = form.save(commit=False) instance.added_by = self.request.user instance.save() messages.add_message(request, messages.INFO, 'Success - Engineer added successfully')...
EngineerView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EngineerView: def post(self, request): """Adds new engineer from engineer_list_view page modal""" <|body_0|> def get(self, request): """Returns list of all engineers""" <|body_1|> <|end_skeleton|> <|body_start_0|> form = EngineerAddForm(request.POST...
stack_v2_sparse_classes_10k_train_000281
3,806
no_license
[ { "docstring": "Adds new engineer from engineer_list_view page modal", "name": "post", "signature": "def post(self, request)" }, { "docstring": "Returns list of all engineers", "name": "get", "signature": "def get(self, request)" } ]
2
stack_v2_sparse_classes_30k_train_001804
Implement the Python class `EngineerView` described below. Class description: Implement the EngineerView class. Method signatures and docstrings: - def post(self, request): Adds new engineer from engineer_list_view page modal - def get(self, request): Returns list of all engineers
Implement the Python class `EngineerView` described below. Class description: Implement the EngineerView class. Method signatures and docstrings: - def post(self, request): Adds new engineer from engineer_list_view page modal - def get(self, request): Returns list of all engineers <|skeleton|> class EngineerView: ...
bdd7c5ca9f00ce33be31609e5be9c2ccfcd8743a
<|skeleton|> class EngineerView: def post(self, request): """Adds new engineer from engineer_list_view page modal""" <|body_0|> def get(self, request): """Returns list of all engineers""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class EngineerView: def post(self, request): """Adds new engineer from engineer_list_view page modal""" form = EngineerAddForm(request.POST or None) if form.is_valid(): instance = form.save(commit=False) instance.added_by = self.request.user instance.save(...
the_stack_v2_python_sparse
engineers/views.py
mrmaheshrajput/htscrm
train
0
3a8fbc3e8585dfbd4fdaedaf81cbb0933eb9c13a
[ "count = 0\nfor i in range(1, m + 1):\n count += min(int(num / i), n)\nreturn count", "if k == 1:\n return 1\nelif k == m * n:\n return m * n\nelse:\n left = 1\n right = m * n\n while left < right:\n mid = int(left + right >> 1)\n count_smaller_than_mid = self.count_smaller_than_nu...
<|body_start_0|> count = 0 for i in range(1, m + 1): count += min(int(num / i), n) return count <|end_body_0|> <|body_start_1|> if k == 1: return 1 elif k == m * n: return m * n else: left = 1 right = m * n ...
Solution
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def count_smaller_than_num(self, m, n, num): """:type m: int :type n: int :type num: int :return: count int""" <|body_0|> def findKthNumber_wrong(self, m, n, k): """:type m: int :type n: int :type k: int :rtype: int""" <|body_1|> def findKthNum...
stack_v2_sparse_classes_10k_train_000282
2,372
permissive
[ { "docstring": ":type m: int :type n: int :type num: int :return: count int", "name": "count_smaller_than_num", "signature": "def count_smaller_than_num(self, m, n, num)" }, { "docstring": ":type m: int :type n: int :type k: int :rtype: int", "name": "findKthNumber_wrong", "signature": "...
3
stack_v2_sparse_classes_30k_train_000677
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def count_smaller_than_num(self, m, n, num): :type m: int :type n: int :type num: int :return: count int - def findKthNumber_wrong(self, m, n, k): :type m: int :type n: int :type...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def count_smaller_than_num(self, m, n, num): :type m: int :type n: int :type num: int :return: count int - def findKthNumber_wrong(self, m, n, k): :type m: int :type n: int :type...
4a6d46c179d7f52054c417b2aa21708331ac84c5
<|skeleton|> class Solution: def count_smaller_than_num(self, m, n, num): """:type m: int :type n: int :type num: int :return: count int""" <|body_0|> def findKthNumber_wrong(self, m, n, k): """:type m: int :type n: int :type k: int :rtype: int""" <|body_1|> def findKthNum...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def count_smaller_than_num(self, m, n, num): """:type m: int :type n: int :type num: int :return: count int""" count = 0 for i in range(1, m + 1): count += min(int(num / i), n) return count def findKthNumber_wrong(self, m, n, k): """:type m: i...
the_stack_v2_python_sparse
problems/二分/668. 乘法表中第k小的数/kth-smallest-number-in-multiplication-table.py
HannibalXZX/LeetCode
train
1
1d7d8ba23a35df2fbd9c6d4bcdc9132f7ae659ec
[ "assert num_bases == len(init_weights)\nself._num_bases = int(num_bases)\nself._converge_epsilon = float(converge_epsilon)\nself._init_weights = Mat([[float(i)] for i in init_weights])\nself._data = []\nself._input = []\nself._label = []\nwith open(file_path, 'r') as file_:\n for line in file_.readlines():\n ...
<|body_start_0|> assert num_bases == len(init_weights) self._num_bases = int(num_bases) self._converge_epsilon = float(converge_epsilon) self._init_weights = Mat([[float(i)] for i in init_weights]) self._data = [] self._input = [] self._label = [] with ope...
Newton's Method Optimization
NewtonMethod
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NewtonMethod: """Newton's Method Optimization""" def __init__(self, file_path, num_bases, converge_epsilon, init_weights): """Get polynomail regression result by Newton's Method Optimization Args ---- file_path : str, path to dataset num_bases : int, degree of polynomial converge_eps...
stack_v2_sparse_classes_10k_train_000283
3,193
no_license
[ { "docstring": "Get polynomail regression result by Newton's Method Optimization Args ---- file_path : str, path to dataset num_bases : int, degree of polynomial converge_epsilon : float, the condition of convergence init_weights : list, shape=[num_bases,] the parameters of polynomial", "name": "__init__", ...
4
stack_v2_sparse_classes_30k_train_002555
Implement the Python class `NewtonMethod` described below. Class description: Newton's Method Optimization Method signatures and docstrings: - def __init__(self, file_path, num_bases, converge_epsilon, init_weights): Get polynomail regression result by Newton's Method Optimization Args ---- file_path : str, path to d...
Implement the Python class `NewtonMethod` described below. Class description: Newton's Method Optimization Method signatures and docstrings: - def __init__(self, file_path, num_bases, converge_epsilon, init_weights): Get polynomail regression result by Newton's Method Optimization Args ---- file_path : str, path to d...
b87c26e215b4ae0358d5cb79e685711691f4ced2
<|skeleton|> class NewtonMethod: """Newton's Method Optimization""" def __init__(self, file_path, num_bases, converge_epsilon, init_weights): """Get polynomail regression result by Newton's Method Optimization Args ---- file_path : str, path to dataset num_bases : int, degree of polynomial converge_eps...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class NewtonMethod: """Newton's Method Optimization""" def __init__(self, file_path, num_bases, converge_epsilon, init_weights): """Get polynomail regression result by Newton's Method Optimization Args ---- file_path : str, path to dataset num_bases : int, degree of polynomial converge_epsilon : float,...
the_stack_v2_python_sparse
HW1/Newton.py
chychen/NCTU_ML_2018
train
2
2a50d35ad5af8f9be6d5438a05bc04fa903d3869
[ "n, m = (len(s), len(p))\np = sorted(p)\nres = []\nfor i in range(n):\n if s[i] in p:\n if sorted(s[i:i + m]) == p:\n res.append(i)\nreturn res", "from collections import defaultdict\nneed = defaultdict(int)\nfor i in p:\n need[i] += 1\nwindow = {}\nn, m = (len(s), len(p))\nleft, right = (...
<|body_start_0|> n, m = (len(s), len(p)) p = sorted(p) res = [] for i in range(n): if s[i] in p: if sorted(s[i:i + m]) == p: res.append(i) return res <|end_body_0|> <|body_start_1|> from collections import defaultdict ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findAnagrams0(self, s, p): """:type s: str :type p: str :rtype: List[int] 暴力解法,超时""" <|body_0|> def findAnagrams(self, s, p): """:type s: str :type p: str :rtype: List[int] 滑动窗口""" <|body_1|> <|end_skeleton|> <|body_start_0|> n, m = (l...
stack_v2_sparse_classes_10k_train_000284
1,695
no_license
[ { "docstring": ":type s: str :type p: str :rtype: List[int] 暴力解法,超时", "name": "findAnagrams0", "signature": "def findAnagrams0(self, s, p)" }, { "docstring": ":type s: str :type p: str :rtype: List[int] 滑动窗口", "name": "findAnagrams", "signature": "def findAnagrams(self, s, p)" } ]
2
stack_v2_sparse_classes_30k_train_005462
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findAnagrams0(self, s, p): :type s: str :type p: str :rtype: List[int] 暴力解法,超时 - def findAnagrams(self, s, p): :type s: str :type p: str :rtype: List[int] 滑动窗口
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findAnagrams0(self, s, p): :type s: str :type p: str :rtype: List[int] 暴力解法,超时 - def findAnagrams(self, s, p): :type s: str :type p: str :rtype: List[int] 滑动窗口 <|skeleton|> ...
6e18c5d257840489cc3fb1079ae3804c743982a4
<|skeleton|> class Solution: def findAnagrams0(self, s, p): """:type s: str :type p: str :rtype: List[int] 暴力解法,超时""" <|body_0|> def findAnagrams(self, s, p): """:type s: str :type p: str :rtype: List[int] 滑动窗口""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def findAnagrams0(self, s, p): """:type s: str :type p: str :rtype: List[int] 暴力解法,超时""" n, m = (len(s), len(p)) p = sorted(p) res = [] for i in range(n): if s[i] in p: if sorted(s[i:i + m]) == p: res.append(i) ...
the_stack_v2_python_sparse
438.找到字符串中所有字母异位词.py
yangyuxiang1996/leetcode
train
0
0b16ba59eec2d77e012fb8d975f94cca7a921172
[ "startTime = datetime.datetime.now()\nclient = dml.pymongo.MongoClient()\nrepo = client.repo\nrepo.authenticate('aquan_erj826', 'aquan_erj826')\ncollection = repo.aquan_erj826.firearms\nrepo.dropCollection('gunsRecovered')\nrepo.createCollection('gunsRecovered')\nfor point in collection.find():\n total = int(poi...
<|body_start_0|> startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('aquan_erj826', 'aquan_erj826') collection = repo.aquan_erj826.firearms repo.dropCollection('gunsRecovered') repo.createCollection('gunsRec...
gunsRecovered
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class gunsRecovered: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everything...
stack_v2_sparse_classes_10k_train_000285
4,457
no_license
[ { "docstring": "Retrieve some data sets (not using the API here for the sake of simplicity).", "name": "execute", "signature": "def execute(trial=False)" }, { "docstring": "Create the provenance document describing everything happening in this script. Each run of the script will generate a new d...
2
stack_v2_sparse_classes_30k_train_007077
Implement the Python class `gunsRecovered` described below. Class description: Implement the gunsRecovered class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=None, e...
Implement the Python class `gunsRecovered` described below. Class description: Implement the gunsRecovered class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=None, e...
97e72731ffadbeae57d7a332decd58706e7c08de
<|skeleton|> class gunsRecovered: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everything...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class gunsRecovered: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('aquan_erj826', 'aquan_erj826') ...
the_stack_v2_python_sparse
aquan_erj826/gunsRecovered.py
ROODAY/course-2017-fal-proj
train
3
662627630756f53d82ef36047548231f793618e1
[ "model_name = model._meta.label_lower\npos = model_name.find('.')\ntable_name = model_name[pos + 1:]\nif table_name in self.route_encuestas:\n return 'encuestas'\nelif table_name in self.route_uxxienc_resul:\n return 'uxxienc_resul'\nreturn None", "if model._meta.label_lower in self.route_encuestas:\n re...
<|body_start_0|> model_name = model._meta.label_lower pos = model_name.find('.') table_name = model_name[pos + 1:] if table_name in self.route_encuestas: return 'encuestas' elif table_name in self.route_uxxienc_resul: return 'uxxienc_resul' return ...
A router to control all database operations on models in the Encuestas applications.
EncuestasRouter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EncuestasRouter: """A router to control all database operations on models in the Encuestas applications.""" def db_for_read(self, model, **hints): """Attempts to read TipoCampania models go to Encuestas db.""" <|body_0|> def db_for_write(self, model, **hints): ""...
stack_v2_sparse_classes_10k_train_000286
1,730
no_license
[ { "docstring": "Attempts to read TipoCampania models go to Encuestas db.", "name": "db_for_read", "signature": "def db_for_read(self, model, **hints)" }, { "docstring": "Attempts to write TipoCampania models go to Encuestas db.", "name": "db_for_write", "signature": "def db_for_write(sel...
4
stack_v2_sparse_classes_30k_train_006039
Implement the Python class `EncuestasRouter` described below. Class description: A router to control all database operations on models in the Encuestas applications. Method signatures and docstrings: - def db_for_read(self, model, **hints): Attempts to read TipoCampania models go to Encuestas db. - def db_for_write(s...
Implement the Python class `EncuestasRouter` described below. Class description: A router to control all database operations on models in the Encuestas applications. Method signatures and docstrings: - def db_for_read(self, model, **hints): Attempts to read TipoCampania models go to Encuestas db. - def db_for_write(s...
ea41397bbee7c204f590d39569a9060f1410a819
<|skeleton|> class EncuestasRouter: """A router to control all database operations on models in the Encuestas applications.""" def db_for_read(self, model, **hints): """Attempts to read TipoCampania models go to Encuestas db.""" <|body_0|> def db_for_write(self, model, **hints): ""...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class EncuestasRouter: """A router to control all database operations on models in the Encuestas applications.""" def db_for_read(self, model, **hints): """Attempts to read TipoCampania models go to Encuestas db.""" model_name = model._meta.label_lower pos = model_name.find('.') ...
the_stack_v2_python_sparse
django/tfmsurveysapp/router_copy.py
dsm9/TreballFiMaster
train
0
24ee2d99cff2e108f138bd61bd128ca9d8e0c17d
[ "required = [{'short_name': 'thetao'}, {'short_name': 'volcello', 'mip': 'fx'}]\nif project == 'CMIP6':\n required = [{'short_name': 'thetao'}, {'short_name': 'volcello', 'mip': 'Ofx'}]\nreturn required", "cube = cubes.extract_cube(Constraint(cube_func=lambda c: c.var_name == 'thetao'))\nvolume = cubes.extract...
<|body_start_0|> required = [{'short_name': 'thetao'}, {'short_name': 'volcello', 'mip': 'fx'}] if project == 'CMIP6': required = [{'short_name': 'thetao'}, {'short_name': 'volcello', 'mip': 'Ofx'}] return required <|end_body_0|> <|body_start_1|> cube = cubes.extract_cube(Co...
Derivation of variable `ohc`.
DerivedVariable
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DerivedVariable: """Derivation of variable `ohc`.""" def required(project): """Declare the variables needed for derivation.""" <|body_0|> def calculate(cubes): """Compute ocean heat content. Use c_p*rho_0= 4.09169e+6 J m-3 K-1 (Kuhlbrodt et al., 2015, Clim. Dyn.)...
stack_v2_sparse_classes_10k_train_000287
2,789
permissive
[ { "docstring": "Declare the variables needed for derivation.", "name": "required", "signature": "def required(project)" }, { "docstring": "Compute ocean heat content. Use c_p*rho_0= 4.09169e+6 J m-3 K-1 (Kuhlbrodt et al., 2015, Clim. Dyn.) Arguments --------- cube: iris.cube.Cube input cube. Ret...
2
stack_v2_sparse_classes_30k_train_006289
Implement the Python class `DerivedVariable` described below. Class description: Derivation of variable `ohc`. Method signatures and docstrings: - def required(project): Declare the variables needed for derivation. - def calculate(cubes): Compute ocean heat content. Use c_p*rho_0= 4.09169e+6 J m-3 K-1 (Kuhlbrodt et a...
Implement the Python class `DerivedVariable` described below. Class description: Derivation of variable `ohc`. Method signatures and docstrings: - def required(project): Declare the variables needed for derivation. - def calculate(cubes): Compute ocean heat content. Use c_p*rho_0= 4.09169e+6 J m-3 K-1 (Kuhlbrodt et a...
d5187438fea2928644cb53ecb26c6adb1e4cc947
<|skeleton|> class DerivedVariable: """Derivation of variable `ohc`.""" def required(project): """Declare the variables needed for derivation.""" <|body_0|> def calculate(cubes): """Compute ocean heat content. Use c_p*rho_0= 4.09169e+6 J m-3 K-1 (Kuhlbrodt et al., 2015, Clim. Dyn.)...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class DerivedVariable: """Derivation of variable `ohc`.""" def required(project): """Declare the variables needed for derivation.""" required = [{'short_name': 'thetao'}, {'short_name': 'volcello', 'mip': 'fx'}] if project == 'CMIP6': required = [{'short_name': 'thetao'}, {'...
the_stack_v2_python_sparse
esmvalcore/preprocessor/_derive/ohc.py
ESMValGroup/ESMValCore
train
41
83ed12139ab57f61824f81ee8c14c3edb4b06bdb
[ "stack, rslt = (root and [root], [])\nwhile stack:\n currNode = stack.pop()\n rslt.append(currNode.val)\n stack.extend(reversed(currNode.children or []))\nreturn rslt", "rslt = []\nif root:\n rslt.append(root.val)\n for child in root.children:\n rslt.extend(self.preorder2(child))\nreturn rsl...
<|body_start_0|> stack, rslt = (root and [root], []) while stack: currNode = stack.pop() rslt.append(currNode.val) stack.extend(reversed(currNode.children or [])) return rslt <|end_body_0|> <|body_start_1|> rslt = [] if root: rslt....
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def preorder(self, root: NaryTreeNode) -> List[int]: """Use iteration.""" <|body_0|> def preorder2(self, root: NaryTreeNode) -> List[int]: """Use recursion.""" <|body_1|> <|end_skeleton|> <|body_start_0|> stack, rslt = (root and [root], []...
stack_v2_sparse_classes_10k_train_000288
760
no_license
[ { "docstring": "Use iteration.", "name": "preorder", "signature": "def preorder(self, root: NaryTreeNode) -> List[int]" }, { "docstring": "Use recursion.", "name": "preorder2", "signature": "def preorder2(self, root: NaryTreeNode) -> List[int]" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def preorder(self, root: NaryTreeNode) -> List[int]: Use iteration. - def preorder2(self, root: NaryTreeNode) -> List[int]: Use recursion.
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def preorder(self, root: NaryTreeNode) -> List[int]: Use iteration. - def preorder2(self, root: NaryTreeNode) -> List[int]: Use recursion. <|skeleton|> class Solution: def ...
edb870f83f0c4568cce0cacec04ee70cf6b545bf
<|skeleton|> class Solution: def preorder(self, root: NaryTreeNode) -> List[int]: """Use iteration.""" <|body_0|> def preorder2(self, root: NaryTreeNode) -> List[int]: """Use recursion.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def preorder(self, root: NaryTreeNode) -> List[int]: """Use iteration.""" stack, rslt = (root and [root], []) while stack: currNode = stack.pop() rslt.append(currNode.val) stack.extend(reversed(currNode.children or [])) return rslt ...
the_stack_v2_python_sparse
2020/n_ary_tree_preorder_traversal.py
eronekogin/leetcode
train
0
7db9398fc31ab0e3a8f14db31f3ce0c6f105b9b3
[ "test_utils.set_competition_round()\ngroup = Group.objects.create(name='Test Group')\ngroup.save()\nself.team = Team.objects.create(group=group, name='A')\nself.user = User.objects.create_user('user', 'user@test.com')\nprofile = self.user.get_profile()\nprofile.team = self.team\nprofile.save()", "profile = self.u...
<|body_start_0|> test_utils.set_competition_round() group = Group.objects.create(name='Test Group') group.save() self.team = Team.objects.create(group=group, name='A') self.user = User.objects.create_user('user', 'user@test.com') profile = self.user.get_profile() ...
Team Energy Goal Test
TeamEnergyGoalTest
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TeamEnergyGoalTest: """Team Energy Goal Test""" def setUp(self): """setup""" <|body_0|> def testTeamEnergyGoal(self): """Test energy goal""" <|body_1|> <|end_skeleton|> <|body_start_0|> test_utils.set_competition_round() group = Group.ob...
stack_v2_sparse_classes_10k_train_000289
3,231
permissive
[ { "docstring": "setup", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Test energy goal", "name": "testTeamEnergyGoal", "signature": "def testTeamEnergyGoal(self)" } ]
2
stack_v2_sparse_classes_30k_train_005858
Implement the Python class `TeamEnergyGoalTest` described below. Class description: Team Energy Goal Test Method signatures and docstrings: - def setUp(self): setup - def testTeamEnergyGoal(self): Test energy goal
Implement the Python class `TeamEnergyGoalTest` described below. Class description: Team Energy Goal Test Method signatures and docstrings: - def setUp(self): setup - def testTeamEnergyGoal(self): Test energy goal <|skeleton|> class TeamEnergyGoalTest: """Team Energy Goal Test""" def setUp(self): ""...
4b7dd685012ec64758affe0ecee3103596d16aa7
<|skeleton|> class TeamEnergyGoalTest: """Team Energy Goal Test""" def setUp(self): """setup""" <|body_0|> def testTeamEnergyGoal(self): """Test energy goal""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class TeamEnergyGoalTest: """Team Energy Goal Test""" def setUp(self): """setup""" test_utils.set_competition_round() group = Group.objects.create(name='Test Group') group.save() self.team = Team.objects.create(group=group, name='A') self.user = User.objects.crea...
the_stack_v2_python_sparse
makahiki/apps/widgets/resource_goal/tests.py
justinslee/Wai-Not-Makahiki
train
1
9d8d308307823a5e580f7dccb5e5167e55fdf3d5
[ "super(Overlay, self).__init__(parent=parent)\nself.setObjectName('overlay')\nself.setFrameStyle(QtWidgets.QFrame.StyledPanel | QtWidgets.QFrame.Plain)\napplication = QtCore.QCoreApplication.instance()\napplication.installEventFilter(self)", "if visible:\n parent = self.parent()\n if parent.hasFocus():\n ...
<|body_start_0|> super(Overlay, self).__init__(parent=parent) self.setObjectName('overlay') self.setFrameStyle(QtWidgets.QFrame.StyledPanel | QtWidgets.QFrame.Plain) application = QtCore.QCoreApplication.instance() application.installEventFilter(self) <|end_body_0|> <|body_start...
Display a transparent overlay over another widget. Customise the background colour using stylesheets. The widget has an object name of "overlay". While the overlay is active, the target widget and its children will not receive interaction events from the user (e.g. focus).
Overlay
[ "Apache-2.0", "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Overlay: """Display a transparent overlay over another widget. Customise the background colour using stylesheets. The widget has an object name of "overlay". While the overlay is active, the target widget and its children will not receive interaction events from the user (e.g. focus).""" def...
stack_v2_sparse_classes_10k_train_000290
8,378
permissive
[ { "docstring": "Initialise overlay for target *parent*.", "name": "__init__", "signature": "def __init__(self, parent)" }, { "docstring": "Set whether *visible* or not.", "name": "setVisible", "signature": "def setVisible(self, visible)" }, { "docstring": "Filter *event* sent to ...
3
stack_v2_sparse_classes_30k_train_003091
Implement the Python class `Overlay` described below. Class description: Display a transparent overlay over another widget. Customise the background colour using stylesheets. The widget has an object name of "overlay". While the overlay is active, the target widget and its children will not receive interaction events ...
Implement the Python class `Overlay` described below. Class description: Display a transparent overlay over another widget. Customise the background colour using stylesheets. The widget has an object name of "overlay". While the overlay is active, the target widget and its children will not receive interaction events ...
f55f52787484fcf931c4653e7e241791f052c04f
<|skeleton|> class Overlay: """Display a transparent overlay over another widget. Customise the background colour using stylesheets. The widget has an object name of "overlay". While the overlay is active, the target widget and its children will not receive interaction events from the user (e.g. focus).""" def...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Overlay: """Display a transparent overlay over another widget. Customise the background colour using stylesheets. The widget has an object name of "overlay". While the overlay is active, the target widget and its children will not receive interaction events from the user (e.g. focus).""" def __init__(sel...
the_stack_v2_python_sparse
source/ftrack_connect/ui/widget/overlay.py
IngenuityEngine/ftrack-connect
train
0
7f05141f5cd167c71d209658dda2fbc516e983b1
[ "from aha.widget.form import Form\nfrom aha.widget.field import TextField, RichText\nfrom formencode import validators as v\n\nclass AddForm(Form):\n multipart = True\n form_title = u'Add New Category'\n button_title = u'Add'\n submit = u'Save'\n name = TextField(title=u'ID', args={'size': 40}, valid...
<|body_start_0|> from aha.widget.form import Form from aha.widget.field import TextField, RichText from formencode import validators as v class AddForm(Form): multipart = True form_title = u'Add New Category' button_title = u'Add' submit =...
The controller for blog category
BlogcategoryController
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BlogcategoryController: """The controller for blog category""" def get_form(self, kind, ins=None): """A method to return form object based on given kind. kind must be one of 'add' or 'edit'""" <|body_0|> def add_new_object(cls, v, ins): """A method to obtain new ...
stack_v2_sparse_classes_10k_train_000291
2,210
permissive
[ { "docstring": "A method to return form object based on given kind. kind must be one of 'add' or 'edit'", "name": "get_form", "signature": "def get_form(self, kind, ins=None)" }, { "docstring": "A method to obtain new object", "name": "add_new_object", "signature": "def add_new_object(cl...
2
stack_v2_sparse_classes_30k_train_006639
Implement the Python class `BlogcategoryController` described below. Class description: The controller for blog category Method signatures and docstrings: - def get_form(self, kind, ins=None): A method to return form object based on given kind. kind must be one of 'add' or 'edit' - def add_new_object(cls, v, ins): A ...
Implement the Python class `BlogcategoryController` described below. Class description: The controller for blog category Method signatures and docstrings: - def get_form(self, kind, ins=None): A method to return form object based on given kind. kind must be one of 'add' or 'edit' - def add_new_object(cls, v, ins): A ...
e1209f7d44d1c59ff9d373b7d89d414f31a9c28b
<|skeleton|> class BlogcategoryController: """The controller for blog category""" def get_form(self, kind, ins=None): """A method to return form object based on given kind. kind must be one of 'add' or 'edit'""" <|body_0|> def add_new_object(cls, v, ins): """A method to obtain new ...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class BlogcategoryController: """The controller for blog category""" def get_form(self, kind, ins=None): """A method to return form object based on given kind. kind must be one of 'add' or 'edit'""" from aha.widget.form import Form from aha.widget.field import TextField, RichText ...
the_stack_v2_python_sparse
applications/aha.application.coreblog3/application/controller/blogcategory.py
Letractively/aha-gae
train
0
afcb29e6feeb042531c2b3b75b0c46045aefea67
[ "self.bot: BunkBot = bot\nself.message: Message = None\nself.channels: ChannelService = channels\nself.yt_result: YoutubeResult = YoutubeResult()\nself.yt_link: str = ''", "try:\n params: List[str] = get_cmd_params(ctx)\n if len(params) == 0:\n await ctx.send('No youtube query given')\n return...
<|body_start_0|> self.bot: BunkBot = bot self.message: Message = None self.channels: ChannelService = channels self.yt_result: YoutubeResult = YoutubeResult() self.yt_link: str = '' <|end_body_0|> <|body_start_1|> try: params: List[str] = get_cmd_params(ctx) ...
Youtube
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Youtube: def __init__(self, bot: BunkBot, channels: ChannelService): """Description ------------ A cog that enables the ability to search and embed youtube videos Parameters ----------- bot: Bunkbot Super class instance of the bot database: DatabaseService Super class instance of the dat...
stack_v2_sparse_classes_10k_train_000292
4,093
permissive
[ { "docstring": "Description ------------ A cog that enables the ability to search and embed youtube videos Parameters ----------- bot: Bunkbot Super class instance of the bot database: DatabaseService Super class instance of the database service channels: ChannelService Access to the server channels and other c...
4
stack_v2_sparse_classes_30k_train_000105
Implement the Python class `Youtube` described below. Class description: Implement the Youtube class. Method signatures and docstrings: - def __init__(self, bot: BunkBot, channels: ChannelService): Description ------------ A cog that enables the ability to search and embed youtube videos Parameters ----------- bot: B...
Implement the Python class `Youtube` described below. Class description: Implement the Youtube class. Method signatures and docstrings: - def __init__(self, bot: BunkBot, channels: ChannelService): Description ------------ A cog that enables the ability to search and embed youtube videos Parameters ----------- bot: B...
f438c6a7d1f2c1797755eb8287bc1499c0cf2a88
<|skeleton|> class Youtube: def __init__(self, bot: BunkBot, channels: ChannelService): """Description ------------ A cog that enables the ability to search and embed youtube videos Parameters ----------- bot: Bunkbot Super class instance of the bot database: DatabaseService Super class instance of the dat...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Youtube: def __init__(self, bot: BunkBot, channels: ChannelService): """Description ------------ A cog that enables the ability to search and embed youtube videos Parameters ----------- bot: Bunkbot Super class instance of the bot database: DatabaseService Super class instance of the database service ...
the_stack_v2_python_sparse
src/youtube/youtube_cog.py
fugwenna/bunkbot
train
2
95e3177b9171172f8e40d2f6ed2f224b9e553734
[ "if not vals.get('name', False):\n emp_job = self.pool.get('hr.job').read(cr, uid, vals['job_id'], ['name'], context=context)\n emp_level = self.pool.get('hr.employee.level').read(cr, uid, vals['level_id'], ['name'], context=context)\n vals['name'] = emp_job['name'] + ' ' + emp_level['name']\nreturn super(...
<|body_start_0|> if not vals.get('name', False): emp_job = self.pool.get('hr.job').read(cr, uid, vals['job_id'], ['name'], context=context) emp_level = self.pool.get('hr.employee.level').read(cr, uid, vals['level_id'], ['name'], context=context) vals['name'] = emp_job['name']...
hr_employee_grade
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class hr_employee_grade: def create(self, cr, uid, vals, context=None): """Override fnct: Get grade name""" <|body_0|> def write(self, cr, uid, ids, vals, context=None): """Override fnct: Get grade name""" <|body_1|> <|end_skeleton|> <|body_start_0|> if n...
stack_v2_sparse_classes_10k_train_000293
1,858
no_license
[ { "docstring": "Override fnct: Get grade name", "name": "create", "signature": "def create(self, cr, uid, vals, context=None)" }, { "docstring": "Override fnct: Get grade name", "name": "write", "signature": "def write(self, cr, uid, ids, vals, context=None)" } ]
2
null
Implement the Python class `hr_employee_grade` described below. Class description: Implement the hr_employee_grade class. Method signatures and docstrings: - def create(self, cr, uid, vals, context=None): Override fnct: Get grade name - def write(self, cr, uid, ids, vals, context=None): Override fnct: Get grade name
Implement the Python class `hr_employee_grade` described below. Class description: Implement the hr_employee_grade class. Method signatures and docstrings: - def create(self, cr, uid, vals, context=None): Override fnct: Get grade name - def write(self, cr, uid, ids, vals, context=None): Override fnct: Get grade name ...
673dd0f2a7c0b69a984342b20f55164a97a00529
<|skeleton|> class hr_employee_grade: def create(self, cr, uid, vals, context=None): """Override fnct: Get grade name""" <|body_0|> def write(self, cr, uid, ids, vals, context=None): """Override fnct: Get grade name""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class hr_employee_grade: def create(self, cr, uid, vals, context=None): """Override fnct: Get grade name""" if not vals.get('name', False): emp_job = self.pool.get('hr.job').read(cr, uid, vals['job_id'], ['name'], context=context) emp_level = self.pool.get('hr.employee.level'...
the_stack_v2_python_sparse
addons/app-trobz-hr/__unported__/trobz_hr_payslip_parameter/model/hr_employee_grade.py
TinPlusIT05/tms
train
0
91591795c31dc82345f24568d9d0dc053db5f715
[ "try:\n self.email = email\n self.password = password\nexcept Exception as e:\n config.logger.log('ERROR', str(e))", "try:\n if self.email is not None and self.password is not None:\n self.email = self.email.lower()\n config.logger.log('INFO', 'Searching for email in database...')\n ...
<|body_start_0|> try: self.email = email self.password = password except Exception as e: config.logger.log('ERROR', str(e)) <|end_body_0|> <|body_start_1|> try: if self.email is not None and self.password is not None: self.email = ...
Validation
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Validation: def __init__(self, email, password): """:param email: email of the user :param password: password of the user""" <|body_0|> def check(self): """:return: whether valid or not along with a new jwt.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_10k_train_000294
1,885
no_license
[ { "docstring": ":param email: email of the user :param password: password of the user", "name": "__init__", "signature": "def __init__(self, email, password)" }, { "docstring": ":return: whether valid or not along with a new jwt.", "name": "check", "signature": "def check(self)" } ]
2
stack_v2_sparse_classes_30k_val_000092
Implement the Python class `Validation` described below. Class description: Implement the Validation class. Method signatures and docstrings: - def __init__(self, email, password): :param email: email of the user :param password: password of the user - def check(self): :return: whether valid or not along with a new j...
Implement the Python class `Validation` described below. Class description: Implement the Validation class. Method signatures and docstrings: - def __init__(self, email, password): :param email: email of the user :param password: password of the user - def check(self): :return: whether valid or not along with a new j...
b7444684784d8320c833bf9f7a5ee15d983e474b
<|skeleton|> class Validation: def __init__(self, email, password): """:param email: email of the user :param password: password of the user""" <|body_0|> def check(self): """:return: whether valid or not along with a new jwt.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Validation: def __init__(self, email, password): """:param email: email of the user :param password: password of the user""" try: self.email = email self.password = password except Exception as e: config.logger.log('ERROR', str(e)) def check(sel...
the_stack_v2_python_sparse
py_backend/login/login_user.py
shubhamgantayat/MedHub
train
2
dd699df475f8d724d7d0273e8623484a8f5feafb
[ "if not table:\n return {}\nrecord_values = {}\nfor record in table.records:\n if parser_mediator.abort:\n break\n if record.get_number_of_values() != 2:\n continue\n identification = self._GetRecordValue(record, 0)\n filename = self._GetRecordValue(record, 1)\n if not identification...
<|body_start_0|> if not table: return {} record_values = {} for record in table.records: if parser_mediator.abort: break if record.get_number_of_values() != 2: continue identification = self._GetRecordValue(record, 0...
Parses a Library Table of File History ESE database file.
FileHistoryLibraryTableParser
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileHistoryLibraryTableParser: """Parses a Library Table of File History ESE database file.""" def _GetDictFromStringsTable(self, parser_mediator, table): """Build a dictionary of the value in the strings table. Args: parser_mediator (ParserMediator): mediates interactions between pa...
stack_v2_sparse_classes_10k_train_000295
3,468
permissive
[ { "docstring": "Build a dictionary of the value in the strings table. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. table (pyesedb.table): strings table. Returns:", "name": "_GetDictFromStringsTable", "signature": "def _Get...
2
stack_v2_sparse_classes_30k_val_000335
Implement the Python class `FileHistoryLibraryTableParser` described below. Class description: Parses a Library Table of File History ESE database file. Method signatures and docstrings: - def _GetDictFromStringsTable(self, parser_mediator, table): Build a dictionary of the value in the strings table. Args: parser_me...
Implement the Python class `FileHistoryLibraryTableParser` described below. Class description: Parses a Library Table of File History ESE database file. Method signatures and docstrings: - def _GetDictFromStringsTable(self, parser_mediator, table): Build a dictionary of the value in the strings table. Args: parser_me...
2c74c3586f94d3ddf9ff523fbdc8cb42d950a109
<|skeleton|> class FileHistoryLibraryTableParser: """Parses a Library Table of File History ESE database file.""" def _GetDictFromStringsTable(self, parser_mediator, table): """Build a dictionary of the value in the strings table. Args: parser_mediator (ParserMediator): mediates interactions between pa...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class FileHistoryLibraryTableParser: """Parses a Library Table of File History ESE database file.""" def _GetDictFromStringsTable(self, parser_mediator, table): """Build a dictionary of the value in the strings table. Args: parser_mediator (ParserMediator): mediates interactions between parsers and oth...
the_stack_v2_python_sparse
plaso/parsers/esedb_plugins/filehistory_library.py
jieonk/plaso
train
0
1f3eba17243a90d30720a9954fb985d5094c8ff6
[ "username = self.cleaned_data['username']\nif User.objects.filter(username=username) or RegisterUser.objects.filter(username=username):\n raise forms.ValidationError('El usuario ya existe en usuarios o registro temporal.')\nreturn username", "email = self.cleaned_data['email']\nif User.objects.filter(email=ema...
<|body_start_0|> username = self.cleaned_data['username'] if User.objects.filter(username=username) or RegisterUser.objects.filter(username=username): raise forms.ValidationError('El usuario ya existe en usuarios o registro temporal.') return username <|end_body_0|> <|body_start_1|>...
Form crear usuario en admin.
UserCreationForm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserCreationForm: """Form crear usuario en admin.""" def clean_username(self): """Comprueba que username no este registrado. También lo prueba en la tabla RegisterUser.""" <|body_0|> def clean_email(self): """Email no puede ser repetido. También lo prueba en la t...
stack_v2_sparse_classes_10k_train_000296
3,955
no_license
[ { "docstring": "Comprueba que username no este registrado. También lo prueba en la tabla RegisterUser.", "name": "clean_username", "signature": "def clean_username(self)" }, { "docstring": "Email no puede ser repetido. También lo prueba en la tabla RegisterUser", "name": "clean_email", "...
2
stack_v2_sparse_classes_30k_train_006313
Implement the Python class `UserCreationForm` described below. Class description: Form crear usuario en admin. Method signatures and docstrings: - def clean_username(self): Comprueba que username no este registrado. También lo prueba en la tabla RegisterUser. - def clean_email(self): Email no puede ser repetido. Tamb...
Implement the Python class `UserCreationForm` described below. Class description: Form crear usuario en admin. Method signatures and docstrings: - def clean_username(self): Comprueba que username no este registrado. También lo prueba en la tabla RegisterUser. - def clean_email(self): Email no puede ser repetido. Tamb...
44b8d2934105ccbf02ff6c20896aa8c2b1746eaa
<|skeleton|> class UserCreationForm: """Form crear usuario en admin.""" def clean_username(self): """Comprueba que username no este registrado. También lo prueba en la tabla RegisterUser.""" <|body_0|> def clean_email(self): """Email no puede ser repetido. También lo prueba en la t...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class UserCreationForm: """Form crear usuario en admin.""" def clean_username(self): """Comprueba que username no este registrado. También lo prueba en la tabla RegisterUser.""" username = self.cleaned_data['username'] if User.objects.filter(username=username) or RegisterUser.objects.fi...
the_stack_v2_python_sparse
src/apps/accounts/forms.py
snicoper/ofervivienda
train
1
ff92132657b857349b01daa1f5bf7aeb1bb7fb1d
[ "i = 0\nres = []\nwhile i < len(nums):\n if nums[i] != i + 1 and nums[i] != nums[nums[i] - 1]:\n tmp = nums[i]\n nums[i] = nums[tmp - 1]\n nums[tmp - 1] = tmp\n else:\n i += 1\nfor i in range(len(nums)):\n if nums[i] != i + 1:\n res.append(i + 1)\nreturn res", "myset = ...
<|body_start_0|> i = 0 res = [] while i < len(nums): if nums[i] != i + 1 and nums[i] != nums[nums[i] - 1]: tmp = nums[i] nums[i] = nums[tmp - 1] nums[tmp - 1] = tmp else: i += 1 for i in range(len(num...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findDisappearedNumbers(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_0|> def findDisappearedNumbers2(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> i = 0 ...
stack_v2_sparse_classes_10k_train_000297
1,144
no_license
[ { "docstring": ":type nums: List[int] :rtype: List[int]", "name": "findDisappearedNumbers", "signature": "def findDisappearedNumbers(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: List[int]", "name": "findDisappearedNumbers2", "signature": "def findDisappearedNumbers2(self...
2
stack_v2_sparse_classes_30k_train_007011
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findDisappearedNumbers(self, nums): :type nums: List[int] :rtype: List[int] - def findDisappearedNumbers2(self, nums): :type nums: List[int] :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findDisappearedNumbers(self, nums): :type nums: List[int] :rtype: List[int] - def findDisappearedNumbers2(self, nums): :type nums: List[int] :rtype: List[int] <|skeleton|> c...
ab49373ff3fc306a03a90de02e1801b8cbe520d7
<|skeleton|> class Solution: def findDisappearedNumbers(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_0|> def findDisappearedNumbers2(self, nums): """:type nums: List[int] :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Solution: def findDisappearedNumbers(self, nums): """:type nums: List[int] :rtype: List[int]""" i = 0 res = [] while i < len(nums): if nums[i] != i + 1 and nums[i] != nums[nums[i] - 1]: tmp = nums[i] nums[i] = nums[tmp - 1] ...
the_stack_v2_python_sparse
explore/array/448.py
yiguid/LeetCodePractise
train
0
de31272b0541e67565800a46e2d4dc62e1ad32d8
[ "if id:\n activity = session.restclient.lookup_activity(str(id))\n if '_attributes' not in activity.keys():\n raise NotFoundError(f'Activity not found: {id}')\nself.request_href = activity['_links']['request']['href']\nself.href = activity['_links']['self']['href']\nself.workitem_href = activity['_link...
<|body_start_0|> if id: activity = session.restclient.lookup_activity(str(id)) if '_attributes' not in activity.keys(): raise NotFoundError(f'Activity not found: {id}') self.request_href = activity['_links']['request']['href'] self.href = activity['_links'...
Activity
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Activity: def __init__(self, session: 'Session', activity=None, id: str=None): """Represents an ISIM Activity. Can do lookup using the id attribute. Args: session (Session): Active ISIM Session activity (zeep.WSActivity, optional): Activity object returned from ISIM REST API. Defaults to...
stack_v2_sparse_classes_10k_train_000298
2,619
permissive
[ { "docstring": "Represents an ISIM Activity. Can do lookup using the id attribute. Args: session (Session): Active ISIM Session activity (zeep.WSActivity, optional): Activity object returned from ISIM REST API. Defaults to None. id (str, optional): Activity ID for lookup. Defaults to None.", "name": "__init...
2
stack_v2_sparse_classes_30k_train_003392
Implement the Python class `Activity` described below. Class description: Implement the Activity class. Method signatures and docstrings: - def __init__(self, session: 'Session', activity=None, id: str=None): Represents an ISIM Activity. Can do lookup using the id attribute. Args: session (Session): Active ISIM Sessi...
Implement the Python class `Activity` described below. Class description: Implement the Activity class. Method signatures and docstrings: - def __init__(self, session: 'Session', activity=None, id: str=None): Represents an ISIM Activity. Can do lookup using the id attribute. Args: session (Session): Active ISIM Sessi...
c86e87ab1ca7e39169a1a8e565de2afc7ff49d52
<|skeleton|> class Activity: def __init__(self, session: 'Session', activity=None, id: str=None): """Represents an ISIM Activity. Can do lookup using the id attribute. Args: session (Session): Active ISIM Session activity (zeep.WSActivity, optional): Activity object returned from ISIM REST API. Defaults to...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class Activity: def __init__(self, session: 'Session', activity=None, id: str=None): """Represents an ISIM Activity. Can do lookup using the id attribute. Args: session (Session): Active ISIM Session activity (zeep.WSActivity, optional): Activity object returned from ISIM REST API. Defaults to None. id (str...
the_stack_v2_python_sparse
pyisim/entities/activity.py
cazdlt/pyisim
train
1
fbf9c8c9a7b9afcb48c765b2de0e8d03698f2ac2
[ "self.context = context\nself.builder = builder\nself.struct_type = struct_type", "context = self.context\nbuilder = self.builder\nstruct_type = self.struct_type\nst = cgutils.create_struct_proxy(struct_type)(context, builder)\nst.meminfo = mi\nreturn st", "context = self.context\nbuilder = self.builder\nstruct...
<|body_start_0|> self.context = context self.builder = builder self.struct_type = struct_type <|end_body_0|> <|body_start_1|> context = self.context builder = self.builder struct_type = self.struct_type st = cgutils.create_struct_proxy(struct_type)(context, build...
Internal builder-code utils for structref definitions.
_Utils
[ "LicenseRef-scancode-secret-labs-2011", "BSD-3-Clause", "LicenseRef-scancode-python-cwi", "LicenseRef-scancode-free-unknown", "GPL-1.0-or-later", "LicenseRef-scancode-other-copyleft", "MIT", "LicenseRef-scancode-unknown-license-reference", "Python-2.0", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _Utils: """Internal builder-code utils for structref definitions.""" def __init__(self, context, builder, struct_type): """Parameters ---------- context : a numba target context builder : a llvmlite IRBuilder struct_type : numba.core.types.StructRef""" <|body_0|> def new...
stack_v2_sparse_classes_10k_train_000299
11,491
permissive
[ { "docstring": "Parameters ---------- context : a numba target context builder : a llvmlite IRBuilder struct_type : numba.core.types.StructRef", "name": "__init__", "signature": "def __init__(self, context, builder, struct_type)" }, { "docstring": "Encapsulate the MemInfo from a `StructRefPayloa...
5
null
Implement the Python class `_Utils` described below. Class description: Internal builder-code utils for structref definitions. Method signatures and docstrings: - def __init__(self, context, builder, struct_type): Parameters ---------- context : a numba target context builder : a llvmlite IRBuilder struct_type : numb...
Implement the Python class `_Utils` described below. Class description: Internal builder-code utils for structref definitions. Method signatures and docstrings: - def __init__(self, context, builder, struct_type): Parameters ---------- context : a numba target context builder : a llvmlite IRBuilder struct_type : numb...
46059957ad416e68476d1e5f32ccd59f7d5df2bb
<|skeleton|> class _Utils: """Internal builder-code utils for structref definitions.""" def __init__(self, context, builder, struct_type): """Parameters ---------- context : a numba target context builder : a llvmlite IRBuilder struct_type : numba.core.types.StructRef""" <|body_0|> def new...
stack_v2_sparse_classes_10k
data/stack_v2_sparse_classes_30k
class _Utils: """Internal builder-code utils for structref definitions.""" def __init__(self, context, builder, struct_type): """Parameters ---------- context : a numba target context builder : a llvmlite IRBuilder struct_type : numba.core.types.StructRef""" self.context = context self....
the_stack_v2_python_sparse
numba/experimental/structref.py
numba/numba
train
8,247