blob_id stringlengths 40 40 | bodies listlengths 2 6 | bodies_text stringlengths 196 6.73k | class_docstring stringlengths 0 700 | class_name stringlengths 1 86 | detected_licenses listlengths 0 45 | format_version stringclasses 1
value | full_text stringlengths 438 7.52k | id stringlengths 40 40 | length_bytes int64 506 50k | license_type stringclasses 2
values | methods listlengths 2 6 | n_methods int64 2 6 | original_id stringlengths 38 40 ⌀ | prompt stringlengths 153 4.25k | prompted_full_text stringlengths 645 10.7k | revision_id stringlengths 40 40 | skeleton stringlengths 162 4.34k | snapshot_name stringclasses 1
value | snapshot_source_dir stringclasses 1
value | solution stringlengths 302 7.33k | source stringclasses 1
value | source_path stringlengths 4 177 | source_repo stringlengths 6 110 | split stringclasses 1
value | star_events_count int64 0 209k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f5d2cfcef99b05c77dc9caf48df26ac563977817 | [
"super(MyInventory, self).__init__(loader=loader, variable_manager=variable_manager, host_list=host_list)\nself.resource = resource\nself.gen_inventory()",
"my_group = Group(name=groupname)\nif groupvars:\n for key, value in groupvars.items():\n my_group.set_variable(key, value)\nfor host in hosts:\n ... | <|body_start_0|>
super(MyInventory, self).__init__(loader=loader, variable_manager=variable_manager, host_list=host_list)
self.resource = resource
self.gen_inventory()
<|end_body_0|>
<|body_start_1|>
my_group = Group(name=groupname)
if groupvars:
for key, value in gr... | MyInventory | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class MyInventory:
def __init__(self, resource, loader, variable_manager, host_list=[]):
"""resource的数据格式是一个列表字典,比如 { "group1": { "hosts": [{"hostname": "10.10.10.10", "port": "22", "username": "test", "password": "mypass"}, ...], "vars": {"var1": value1, "var2": value2, ...} } } 如果你只传入1个列表,这默... | stack_v2_sparse_classes_36k_train_024900 | 9,326 | permissive | [
{
"docstring": "resource的数据格式是一个列表字典,比如 { \"group1\": { \"hosts\": [{\"hostname\": \"10.10.10.10\", \"port\": \"22\", \"username\": \"test\", \"password\": \"mypass\"}, ...], \"vars\": {\"var1\": value1, \"var2\": value2, ...} } } 如果你只传入1个列表,这默认该列表内的所有主机属于my_group组,比如 [{\"hostname\": \"10.10.10.10\", \"port\": ... | 3 | null | Implement the Python class `MyInventory` described below.
Class description:
Implement the MyInventory class.
Method signatures and docstrings:
- def __init__(self, resource, loader, variable_manager, host_list=[]): resource的数据格式是一个列表字典,比如 { "group1": { "hosts": [{"hostname": "10.10.10.10", "port": "22", "username": ... | Implement the Python class `MyInventory` described below.
Class description:
Implement the MyInventory class.
Method signatures and docstrings:
- def __init__(self, resource, loader, variable_manager, host_list=[]): resource的数据格式是一个列表字典,比如 { "group1": { "hosts": [{"hostname": "10.10.10.10", "port": "22", "username": ... | 408f3fa3d36542d8fc1236ba1cac804de6f14b0c | <|skeleton|>
class MyInventory:
def __init__(self, resource, loader, variable_manager, host_list=[]):
"""resource的数据格式是一个列表字典,比如 { "group1": { "hosts": [{"hostname": "10.10.10.10", "port": "22", "username": "test", "password": "mypass"}, ...], "vars": {"var1": value1, "var2": value2, ...} } } 如果你只传入1个列表,这默... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class MyInventory:
def __init__(self, resource, loader, variable_manager, host_list=[]):
"""resource的数据格式是一个列表字典,比如 { "group1": { "hosts": [{"hostname": "10.10.10.10", "port": "22", "username": "test", "password": "mypass"}, ...], "vars": {"var1": value1, "var2": value2, ...} } } 如果你只传入1个列表,这默认该列表内的所有主机属于my... | the_stack_v2_python_sparse | hard-gists/3211f1660291f871739379082f204c83/snippet.py | dockerizeme/dockerizeme | train | 24 | |
6cf1f5fa3fe7944642cd85cfa1aa2a5ff1ffcaa5 | [
"self.log_file = os.path.join(self.job_folder, name_prefix + '.log')\nself.logger = logging.getLogger(f'{name_prefix}_{self.job_id}')\nself.logger.setLevel(logging.DEBUG)\nif len(self.logger.handlers) <= 1:\n file_handler = logging.FileHandler(self.log_file, encoding='utf-8')\n file_handler.setLevel(logging.D... | <|body_start_0|>
self.log_file = os.path.join(self.job_folder, name_prefix + '.log')
self.logger = logging.getLogger(f'{name_prefix}_{self.job_id}')
self.logger.setLevel(logging.DEBUG)
if len(self.logger.handlers) <= 1:
file_handler = logging.FileHandler(self.log_file, encodi... | Used to set up and tear down logging for a parallel process. | LoggingMixin | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class LoggingMixin:
"""Used to set up and tear down logging for a parallel process."""
def setup_logger(self, name_prefix):
"""Set up the logger used for logging messages for this process. Logs are written to a text file. Args: logger_obj: The logger instance."""
<|body_0|>
de... | stack_v2_sparse_classes_36k_train_024901 | 42,314 | permissive | [
{
"docstring": "Set up the logger used for logging messages for this process. Logs are written to a text file. Args: logger_obj: The logger instance.",
"name": "setup_logger",
"signature": "def setup_logger(self, name_prefix)"
},
{
"docstring": "Clean up and close the logger.",
"name": "tear... | 2 | stack_v2_sparse_classes_30k_train_012628 | Implement the Python class `LoggingMixin` described below.
Class description:
Used to set up and tear down logging for a parallel process.
Method signatures and docstrings:
- def setup_logger(self, name_prefix): Set up the logger used for logging messages for this process. Logs are written to a text file. Args: logge... | Implement the Python class `LoggingMixin` described below.
Class description:
Used to set up and tear down logging for a parallel process.
Method signatures and docstrings:
- def setup_logger(self, name_prefix): Set up the logger used for logging messages for this process. Logs are written to a text file. Args: logge... | 47cbc3de67a7b1bf9255e07e88cba7b051db0505 | <|skeleton|>
class LoggingMixin:
"""Used to set up and tear down logging for a parallel process."""
def setup_logger(self, name_prefix):
"""Set up the logger used for logging messages for this process. Logs are written to a text file. Args: logger_obj: The logger instance."""
<|body_0|>
de... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class LoggingMixin:
"""Used to set up and tear down logging for a parallel process."""
def setup_logger(self, name_prefix):
"""Set up the logger used for logging messages for this process. Logs are written to a text file. Args: logger_obj: The logger instance."""
self.log_file = os.path.join(se... | the_stack_v2_python_sparse | transit-network-analysis-tools/AnalysisHelpers.py | Esri/public-transit-tools | train | 155 |
3747a413ed68998375225d8cd7d7f6b2ee0db64b | [
"user = request.user\ndata = request.data\nresult = password_update_action.UpdatePassword.call(user=user, data=data)\nif result.failed:\n return Response(errors=dict(errors=result.error.value), status=status.HTTP_400_BAD_REQUEST)\nreturn Response(data=result.value, status=status.HTTP_201_CREATED)",
"data = req... | <|body_start_0|>
user = request.user
data = request.data
result = password_update_action.UpdatePassword.call(user=user, data=data)
if result.failed:
return Response(errors=dict(errors=result.error.value), status=status.HTTP_400_BAD_REQUEST)
return Response(data=result... | PasswordsViewSet | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class PasswordsViewSet:
def change(self, request):
"""This method updates the user's password and returns an appropriate response."""
<|body_0|>
def reset(self, request):
"""This reset password view collects the data from the user and calls the ResetPassword Action to perf... | stack_v2_sparse_classes_36k_train_024902 | 1,856 | permissive | [
{
"docstring": "This method updates the user's password and returns an appropriate response.",
"name": "change",
"signature": "def change(self, request)"
},
{
"docstring": "This reset password view collects the data from the user and calls the ResetPassword Action to perform the necessary valida... | 2 | stack_v2_sparse_classes_30k_train_013996 | Implement the Python class `PasswordsViewSet` described below.
Class description:
Implement the PasswordsViewSet class.
Method signatures and docstrings:
- def change(self, request): This method updates the user's password and returns an appropriate response.
- def reset(self, request): This reset password view colle... | Implement the Python class `PasswordsViewSet` described below.
Class description:
Implement the PasswordsViewSet class.
Method signatures and docstrings:
- def change(self, request): This method updates the user's password and returns an appropriate response.
- def reset(self, request): This reset password view colle... | ba93610cdb5ad04fd93effbb0249139b351bc226 | <|skeleton|>
class PasswordsViewSet:
def change(self, request):
"""This method updates the user's password and returns an appropriate response."""
<|body_0|>
def reset(self, request):
"""This reset password view collects the data from the user and calls the ResetPassword Action to perf... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class PasswordsViewSet:
def change(self, request):
"""This method updates the user's password and returns an appropriate response."""
user = request.user
data = request.data
result = password_update_action.UpdatePassword.call(user=user, data=data)
if result.failed:
... | the_stack_v2_python_sparse | project/api/views/passwords.py | AdejokeOgunyinka/cinch-API | train | 0 | |
651af74dd2f8d3ab2c0c84cdb0ff910ee80fc01c | [
"if sort == 'new':\n order_by = ('-create_time',)\nelif sort == 'hot':\n order_by = ('-sales',)\nelif sort == 'price':\n order_by = ('price',)\nelse:\n order_by = ('-pk',)\nbooks_li = self.filter(type_id=type_id).order_by(*order_by)\nif limit:\n books_li = books_li[:limit]\nreturn books_li",
"try:\... | <|body_start_0|>
if sort == 'new':
order_by = ('-create_time',)
elif sort == 'hot':
order_by = ('-sales',)
elif sort == 'price':
order_by = ('price',)
else:
order_by = ('-pk',)
books_li = self.filter(type_id=type_id).order_by(*order... | BooksManager | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class BooksManager:
def get_books_by_type(self, type_id, limit=None, sort='default'):
"""根据商品类型id查询商品信息"""
<|body_0|>
def get_books_by_id(self, books_id):
"""根据商品的id获取商品信息"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
if sort == 'new':
order... | stack_v2_sparse_classes_36k_train_024903 | 1,904 | no_license | [
{
"docstring": "根据商品类型id查询商品信息",
"name": "get_books_by_type",
"signature": "def get_books_by_type(self, type_id, limit=None, sort='default')"
},
{
"docstring": "根据商品的id获取商品信息",
"name": "get_books_by_id",
"signature": "def get_books_by_id(self, books_id)"
}
] | 2 | null | Implement the Python class `BooksManager` described below.
Class description:
Implement the BooksManager class.
Method signatures and docstrings:
- def get_books_by_type(self, type_id, limit=None, sort='default'): 根据商品类型id查询商品信息
- def get_books_by_id(self, books_id): 根据商品的id获取商品信息 | Implement the Python class `BooksManager` described below.
Class description:
Implement the BooksManager class.
Method signatures and docstrings:
- def get_books_by_type(self, type_id, limit=None, sort='default'): 根据商品类型id查询商品信息
- def get_books_by_id(self, books_id): 根据商品的id获取商品信息
<|skeleton|>
class BooksManager:
... | 874a448bab30bf35c221ec2d6779119bc840fd1b | <|skeleton|>
class BooksManager:
def get_books_by_type(self, type_id, limit=None, sort='default'):
"""根据商品类型id查询商品信息"""
<|body_0|>
def get_books_by_id(self, books_id):
"""根据商品的id获取商品信息"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class BooksManager:
def get_books_by_type(self, type_id, limit=None, sort='default'):
"""根据商品类型id查询商品信息"""
if sort == 'new':
order_by = ('-create_time',)
elif sort == 'hot':
order_by = ('-sales',)
elif sort == 'price':
order_by = ('price',)
... | the_stack_v2_python_sparse | changyachen/booksea/books/models.py | zhchzh10000/Crowd | train | 3 | |
513541bd4a357de13f21b0334df7a09f3c7302de | [
"m = Utils.md5()\nup = m.update\nup(self.__class__.__name__.encode())\nfor x in self.inputs:\n up(x.abspath().encode())\nreturn m.digest()",
"for x in self.run_after:\n if not x.hasrun:\n return Task.ASK_LATER\nsig = self.signature()\nfor x in self.generator.bld.raw_deps.get(sig, []):\n self.outpu... | <|body_start_0|>
m = Utils.md5()
up = m.update
up(self.__class__.__name__.encode())
for x in self.inputs:
up(x.abspath().encode())
return m.digest()
<|end_body_0|>
<|body_start_1|>
for x in self.run_after:
if not x.hasrun:
return T... | prog1 | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class prog1:
def uid(self):
"""the unique id of this task should only depend on the file inputs"""
<|body_0|>
def runnable_status(self):
"""since it is called after the build has started, any task added must be passed through 'more_tasks'"""
<|body_1|>
def cre... | stack_v2_sparse_classes_36k_train_024904 | 4,216 | permissive | [
{
"docstring": "the unique id of this task should only depend on the file inputs",
"name": "uid",
"signature": "def uid(self)"
},
{
"docstring": "since it is called after the build has started, any task added must be passed through 'more_tasks'",
"name": "runnable_status",
"signature": "... | 5 | stack_v2_sparse_classes_30k_train_000786 | Implement the Python class `prog1` described below.
Class description:
Implement the prog1 class.
Method signatures and docstrings:
- def uid(self): the unique id of this task should only depend on the file inputs
- def runnable_status(self): since it is called after the build has started, any task added must be pass... | Implement the Python class `prog1` described below.
Class description:
Implement the prog1 class.
Method signatures and docstrings:
- def uid(self): the unique id of this task should only depend on the file inputs
- def runnable_status(self): since it is called after the build has started, any task added must be pass... | e6792143576f13f0a3a49edfd54dbb2ef851d95a | <|skeleton|>
class prog1:
def uid(self):
"""the unique id of this task should only depend on the file inputs"""
<|body_0|>
def runnable_status(self):
"""since it is called after the build has started, any task added must be passed through 'more_tasks'"""
<|body_1|>
def cre... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class prog1:
def uid(self):
"""the unique id of this task should only depend on the file inputs"""
m = Utils.md5()
up = m.update
up(self.__class__.__name__.encode())
for x in self.inputs:
up(x.abspath().encode())
return m.digest()
def runnable_status(... | the_stack_v2_python_sparse | waf/playground/cpp_gen/wscript | yankee14/reflow-oven-atmega328p | train | 0 | |
2e8c056606d174ae6bc5ae64048d32f1af6a3a71 | [
"self.CONFIG = config\nself.CHECKING_TIME = int(Misc.hasKey(self.CONFIG, 'CHECKING_TIME', 10))\nself.URL_POOL = self.CONFIG['URL_BASE']\nself.Analyzers = {}",
"cp = CommPool(self.CONFIG, preferred_url=CommPool.URL_EVENTS)\ncp.logFromCore(Messages.system_analyzers_connect.format(cp.URL_BASE), LogTypes.INFO, self._... | <|body_start_0|>
self.CONFIG = config
self.CHECKING_TIME = int(Misc.hasKey(self.CONFIG, 'CHECKING_TIME', 10))
self.URL_POOL = self.CONFIG['URL_BASE']
self.Analyzers = {}
<|end_body_0|>
<|body_start_1|>
cp = CommPool(self.CONFIG, preferred_url=CommPool.URL_EVENTS)
cp.logF... | Class to control all Analyzer components to load in system. | LoaderOfAnalyzer | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class LoaderOfAnalyzer:
"""Class to control all Analyzer components to load in system."""
def __init__(self, config):
"""Initialize all variables"""
<|body_0|>
def start(self):
"""Start load of all device analyzers"""
<|body_1|>
<|end_skeleton|>
<|body_start_... | stack_v2_sparse_classes_36k_train_024905 | 1,910 | permissive | [
{
"docstring": "Initialize all variables",
"name": "__init__",
"signature": "def __init__(self, config)"
},
{
"docstring": "Start load of all device analyzers",
"name": "start",
"signature": "def start(self)"
}
] | 2 | stack_v2_sparse_classes_30k_train_007350 | Implement the Python class `LoaderOfAnalyzer` described below.
Class description:
Class to control all Analyzer components to load in system.
Method signatures and docstrings:
- def __init__(self, config): Initialize all variables
- def start(self): Start load of all device analyzers | Implement the Python class `LoaderOfAnalyzer` described below.
Class description:
Class to control all Analyzer components to load in system.
Method signatures and docstrings:
- def __init__(self, config): Initialize all variables
- def start(self): Start load of all device analyzers
<|skeleton|>
class LoaderOfAnaly... | 0ae0149e455a5d62beaab3eb778f1257bf881483 | <|skeleton|>
class LoaderOfAnalyzer:
"""Class to control all Analyzer components to load in system."""
def __init__(self, config):
"""Initialize all variables"""
<|body_0|>
def start(self):
"""Start load of all device analyzers"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class LoaderOfAnalyzer:
"""Class to control all Analyzer components to load in system."""
def __init__(self, config):
"""Initialize all variables"""
self.CONFIG = config
self.CHECKING_TIME = int(Misc.hasKey(self.CONFIG, 'CHECKING_TIME', 10))
self.URL_POOL = self.CONFIG['URL_BASE... | the_stack_v2_python_sparse | Core/LoaderOfAnalyzer.py | Turing-IA-IHC/Home-Monitor | train | 1 |
33f01f6a41f63f4a22c9c3457d71ed2d44853e5e | [
"super(InTriggerDistanceToVehicle, self).__init__(name)\nself.logger.debug('%s.__init__()' % self.__class__.__name__)\nself._other_actor = other_actor\nself._actor = actor\nself._distance = distance",
"new_status = py_trees.common.Status.RUNNING\nego_location = CarlaDataProvider.get_location(self._actor)\nother_l... | <|body_start_0|>
super(InTriggerDistanceToVehicle, self).__init__(name)
self.logger.debug('%s.__init__()' % self.__class__.__name__)
self._other_actor = other_actor
self._actor = actor
self._distance = distance
<|end_body_0|>
<|body_start_1|>
new_status = py_trees.common... | This class contains the trigger distance (condition) between to actors of a scenario | InTriggerDistanceToVehicle | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class InTriggerDistanceToVehicle:
"""This class contains the trigger distance (condition) between to actors of a scenario"""
def __init__(self, other_actor, actor, distance, name='TriggerDistanceToVehicle'):
"""Setup trigger distance"""
<|body_0|>
def update(self):
"""... | stack_v2_sparse_classes_36k_train_024906 | 25,380 | permissive | [
{
"docstring": "Setup trigger distance",
"name": "__init__",
"signature": "def __init__(self, other_actor, actor, distance, name='TriggerDistanceToVehicle')"
},
{
"docstring": "Check if the ego vehicle is within trigger distance to other actor",
"name": "update",
"signature": "def update... | 2 | stack_v2_sparse_classes_30k_train_000039 | Implement the Python class `InTriggerDistanceToVehicle` described below.
Class description:
This class contains the trigger distance (condition) between to actors of a scenario
Method signatures and docstrings:
- def __init__(self, other_actor, actor, distance, name='TriggerDistanceToVehicle'): Setup trigger distance... | Implement the Python class `InTriggerDistanceToVehicle` described below.
Class description:
This class contains the trigger distance (condition) between to actors of a scenario
Method signatures and docstrings:
- def __init__(self, other_actor, actor, distance, name='TriggerDistanceToVehicle'): Setup trigger distance... | 1d3e8339f8e60f7bdcaefeff49ec238b1746b047 | <|skeleton|>
class InTriggerDistanceToVehicle:
"""This class contains the trigger distance (condition) between to actors of a scenario"""
def __init__(self, other_actor, actor, distance, name='TriggerDistanceToVehicle'):
"""Setup trigger distance"""
<|body_0|>
def update(self):
"""... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class InTriggerDistanceToVehicle:
"""This class contains the trigger distance (condition) between to actors of a scenario"""
def __init__(self, other_actor, actor, distance, name='TriggerDistanceToVehicle'):
"""Setup trigger distance"""
super(InTriggerDistanceToVehicle, self).__init__(name)
... | the_stack_v2_python_sparse | srunner/scenariomanager/atomic_scenario_behavior.py | chauvinSimon/scenario_runner | train | 2 |
c56ac94690fbec2ea84a0b954e0c54627a0dcb52 | [
"super().__init__(*args, **kwargs)\nself._gs_mix = float(gs_mix)\nassert 0.0 < self._gs_mix < 1.0, 'Mixing factor must be 0 < fac < 1'",
"assert self.imgpair is not None, 'Must have an image pair'\ndhs_step = self.imgpair.get_dhs_step_by_side(side, self._step_size)\ngs_step = self.imgpair.get_last_step_by_side(si... | <|body_start_0|>
super().__init__(*args, **kwargs)
self._gs_mix = float(gs_mix)
assert 0.0 < self._gs_mix < 1.0, 'Mixing factor must be 0 < fac < 1'
<|end_body_0|>
<|body_start_1|>
assert self.imgpair is not None, 'Must have an image pair'
dhs_step = self.imgpair.get_dhs_step_by... | Dewar-Healy-Stewart method, augmented with Growing String (GS) method. The DHS step (stepping along the linear interpolated path between the two images) is mixed with a GS step (linear interpolation along last and current position of one image) in a fixed ratio. Proposed by J. Kilmes, D. R. Bowler, A. Michaelides, J. P... | DHSGS | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class DHSGS:
"""Dewar-Healy-Stewart method, augmented with Growing String (GS) method. The DHS step (stepping along the linear interpolated path between the two images) is mixed with a GS step (linear interpolation along last and current position of one image) in a fixed ratio. Proposed by J. Kilmes, D... | stack_v2_sparse_classes_36k_train_024907 | 26,310 | permissive | [
{
"docstring": "Arguments and other keyword arguments follow DHS, please see :py:meth:`DHS <autode.bracket.dhs.DHS.__init__>` Keyword Args: gs_mix (float): Represents the percentage of mixing of the Growing String step with the DHS step. 0.3 means 0.3 * GS_step + (1-0.3) * DHS_step It is not recommended to set ... | 2 | stack_v2_sparse_classes_30k_train_004647 | Implement the Python class `DHSGS` described below.
Class description:
Dewar-Healy-Stewart method, augmented with Growing String (GS) method. The DHS step (stepping along the linear interpolated path between the two images) is mixed with a GS step (linear interpolation along last and current position of one image) in ... | Implement the Python class `DHSGS` described below.
Class description:
Dewar-Healy-Stewart method, augmented with Growing String (GS) method. The DHS step (stepping along the linear interpolated path between the two images) is mixed with a GS step (linear interpolation along last and current position of one image) in ... | 4d6667592f083dfcf38de6b75c4222c0a0e7b60b | <|skeleton|>
class DHSGS:
"""Dewar-Healy-Stewart method, augmented with Growing String (GS) method. The DHS step (stepping along the linear interpolated path between the two images) is mixed with a GS step (linear interpolation along last and current position of one image) in a fixed ratio. Proposed by J. Kilmes, D... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class DHSGS:
"""Dewar-Healy-Stewart method, augmented with Growing String (GS) method. The DHS step (stepping along the linear interpolated path between the two images) is mixed with a GS step (linear interpolation along last and current position of one image) in a fixed ratio. Proposed by J. Kilmes, D. R. Bowler, ... | the_stack_v2_python_sparse | autode/bracket/dhs.py | duartegroup/autodE | train | 132 |
e3cc05e3c7f0953a6eb132179b3af8215fc42f65 | [
"class ExceptionType1(Exception):\n pass\n\nclass ExceptionType2(Exception):\n pass\n\n@decorators.Memoize\ndef raiseExceptions():\n if raiseExceptions.count == 0:\n raiseExceptions.count += 1\n raise ExceptionType1()\n if raiseExceptions.count == 1:\n raise ExceptionType2()\nraiseE... | <|body_start_0|>
class ExceptionType1(Exception):
pass
class ExceptionType2(Exception):
pass
@decorators.Memoize
def raiseExceptions():
if raiseExceptions.count == 0:
raiseExceptions.count += 1
raise ExceptionType1()
... | MemoizeDecoratorTest | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class MemoizeDecoratorTest:
def testFunctionExceptionNotMemoized(self):
"""Tests that |Memoize| decorator does not cache exception results."""
<|body_0|>
def testFunctionResultMemoized(self):
"""Tests that |Memoize| decorator caches results."""
<|body_1|>
def ... | stack_v2_sparse_classes_36k_train_024908 | 1,997 | permissive | [
{
"docstring": "Tests that |Memoize| decorator does not cache exception results.",
"name": "testFunctionExceptionNotMemoized",
"signature": "def testFunctionExceptionNotMemoized(self)"
},
{
"docstring": "Tests that |Memoize| decorator caches results.",
"name": "testFunctionResultMemoized",
... | 3 | stack_v2_sparse_classes_30k_train_013608 | Implement the Python class `MemoizeDecoratorTest` described below.
Class description:
Implement the MemoizeDecoratorTest class.
Method signatures and docstrings:
- def testFunctionExceptionNotMemoized(self): Tests that |Memoize| decorator does not cache exception results.
- def testFunctionResultMemoized(self): Tests... | Implement the Python class `MemoizeDecoratorTest` described below.
Class description:
Implement the MemoizeDecoratorTest class.
Method signatures and docstrings:
- def testFunctionExceptionNotMemoized(self): Tests that |Memoize| decorator does not cache exception results.
- def testFunctionResultMemoized(self): Tests... | 53102de187a48ac2cfc241fef54dcbc29c453a8e | <|skeleton|>
class MemoizeDecoratorTest:
def testFunctionExceptionNotMemoized(self):
"""Tests that |Memoize| decorator does not cache exception results."""
<|body_0|>
def testFunctionResultMemoized(self):
"""Tests that |Memoize| decorator caches results."""
<|body_1|>
def ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class MemoizeDecoratorTest:
def testFunctionExceptionNotMemoized(self):
"""Tests that |Memoize| decorator does not cache exception results."""
class ExceptionType1(Exception):
pass
class ExceptionType2(Exception):
pass
@decorators.Memoize
def raiseEx... | the_stack_v2_python_sparse | devil/devil/utils/decorators_test.py | catapult-project/catapult | train | 2,032 | |
c0d8ebf0c703f194b5321d5c83849cc764d1e9ec | [
"if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn EducationRubricOutcome()",
"from .education_outcome import EducationOutcome\nfrom .rubric_quality_feedback_model import RubricQualityFeedbackModel\nfrom .rubric_quality_selected_column_model import RubricQualitySelectedColumnModel\nfro... | <|body_start_0|>
if not parse_node:
raise TypeError('parse_node cannot be null.')
return EducationRubricOutcome()
<|end_body_0|>
<|body_start_1|>
from .education_outcome import EducationOutcome
from .rubric_quality_feedback_model import RubricQualityFeedbackModel
fro... | EducationRubricOutcome | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class EducationRubricOutcome:
def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EducationRubricOutcome:
"""Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create ... | stack_v2_sparse_classes_36k_train_024909 | 4,320 | 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: EducationRubricOutcome",
"name": "create_from_discriminator_value",
"signature": "def create_from_discrimina... | 3 | null | Implement the Python class `EducationRubricOutcome` described below.
Class description:
Implement the EducationRubricOutcome class.
Method signatures and docstrings:
- def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EducationRubricOutcome: Creates a new instance of the appropriate class b... | Implement the Python class `EducationRubricOutcome` described below.
Class description:
Implement the EducationRubricOutcome class.
Method signatures and docstrings:
- def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EducationRubricOutcome: Creates a new instance of the appropriate class b... | 27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949 | <|skeleton|>
class EducationRubricOutcome:
def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EducationRubricOutcome:
"""Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class EducationRubricOutcome:
def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EducationRubricOutcome:
"""Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Ret... | the_stack_v2_python_sparse | msgraph/generated/models/education_rubric_outcome.py | microsoftgraph/msgraph-sdk-python | train | 135 | |
e8e05023d5d3a4d7d689422fe3aae4b55299e097 | [
"data = {'Address': ['1.1.1.1', '1.2.3.4'], 'Range': ['1.4.3.1-1.4.3.5', '1.4.3.6-1.4.3.9']}\nlimit = 3\ndata = limit_ip_results(data, limit)\nassert len(data['Address']) == 2\nassert len(data['Range']) == 1",
"data = {'Address': ['1.1.1.1', '1.2.3.4'], 'Range': ['1.4.3.1-1.4.3.5', '1.4.3.6-1.4.3.9']}\nlimit = 1\... | <|body_start_0|>
data = {'Address': ['1.1.1.1', '1.2.3.4'], 'Range': ['1.4.3.1-1.4.3.5', '1.4.3.6-1.4.3.9']}
limit = 3
data = limit_ip_results(data, limit)
assert len(data['Address']) == 2
assert len(data['Range']) == 1
<|end_body_0|>
<|body_start_1|>
data = {'Address': ... | TestLimitIPResults | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TestLimitIPResults:
def test_limit_ip_results_high_limit(self):
"""Given - IPs data that contains both single IP's and ranges - Limit value When - the limit value is high enough so data will be taken from both lists Then - Change the lists so all addresses will show and part of the Range... | stack_v2_sparse_classes_36k_train_024910 | 44,285 | permissive | [
{
"docstring": "Given - IPs data that contains both single IP's and ranges - Limit value When - the limit value is high enough so data will be taken from both lists Then - Change the lists so all addresses will show and part of the Ranges",
"name": "test_limit_ip_results_high_limit",
"signature": "def t... | 4 | stack_v2_sparse_classes_30k_train_003360 | Implement the Python class `TestLimitIPResults` described below.
Class description:
Implement the TestLimitIPResults class.
Method signatures and docstrings:
- def test_limit_ip_results_high_limit(self): Given - IPs data that contains both single IP's and ranges - Limit value When - the limit value is high enough so ... | Implement the Python class `TestLimitIPResults` described below.
Class description:
Implement the TestLimitIPResults class.
Method signatures and docstrings:
- def test_limit_ip_results_high_limit(self): Given - IPs data that contains both single IP's and ranges - Limit value When - the limit value is high enough so ... | 890def5a0e0ae8d6eaa538148249ddbc851dbb6b | <|skeleton|>
class TestLimitIPResults:
def test_limit_ip_results_high_limit(self):
"""Given - IPs data that contains both single IP's and ranges - Limit value When - the limit value is high enough so data will be taken from both lists Then - Change the lists so all addresses will show and part of the Range... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TestLimitIPResults:
def test_limit_ip_results_high_limit(self):
"""Given - IPs data that contains both single IP's and ranges - Limit value When - the limit value is high enough so data will be taken from both lists Then - Change the lists so all addresses will show and part of the Ranges"""
d... | the_stack_v2_python_sparse | Packs/qualys/Integrations/Qualysv2/Qualysv2_test.py | demisto/content | train | 1,023 | |
688ac9db3a4be1bbba503d60a115aa6f8997ff8a | [
"import numpy as np\nself.income_data = merge_by_year(income, countries, year)\nself.year = year",
"fig = pl.figure(figsize=(15, 10))\nfor i, region in enumerate(self.income_data['Region'].unique()):\n ax = fig.add_subplot(2, 3, i + 1)\n self.income_data[self.income_data.Region == region].plot(kind='box', a... | <|body_start_0|>
import numpy as np
self.income_data = merge_by_year(income, countries, year)
self.year = year
<|end_body_0|>
<|body_start_1|>
fig = pl.figure(figsize=(15, 10))
for i, region in enumerate(self.income_data['Region'].unique()):
ax = fig.add_subplot(2, 3... | Class represents the income per capita for countries in the world in a given year | world_Income_per_capita | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class world_Income_per_capita:
"""Class represents the income per capita for countries in the world in a given year"""
def __init__(self, income, countries, year):
"""Constructor for world_Income_per_capita class inputs: num_trials: An integer between 1800 and 2012 representing the year of... | stack_v2_sparse_classes_36k_train_024911 | 2,801 | no_license | [
{
"docstring": "Constructor for world_Income_per_capita class inputs: num_trials: An integer between 1800 and 2012 representing the year of interest",
"name": "__init__",
"signature": "def __init__(self, income, countries, year)"
},
{
"docstring": "Plots a boxplot of the income distribution acro... | 3 | stack_v2_sparse_classes_30k_train_009723 | Implement the Python class `world_Income_per_capita` described below.
Class description:
Class represents the income per capita for countries in the world in a given year
Method signatures and docstrings:
- def __init__(self, income, countries, year): Constructor for world_Income_per_capita class inputs: num_trials: ... | Implement the Python class `world_Income_per_capita` described below.
Class description:
Class represents the income per capita for countries in the world in a given year
Method signatures and docstrings:
- def __init__(self, income, countries, year): Constructor for world_Income_per_capita class inputs: num_trials: ... | f5bb1e51de4f84ab3dd62d3073aee4f56534afa1 | <|skeleton|>
class world_Income_per_capita:
"""Class represents the income per capita for countries in the world in a given year"""
def __init__(self, income, countries, year):
"""Constructor for world_Income_per_capita class inputs: num_trials: An integer between 1800 and 2012 representing the year of... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class world_Income_per_capita:
"""Class represents the income per capita for countries in the world in a given year"""
def __init__(self, income, countries, year):
"""Constructor for world_Income_per_capita class inputs: num_trials: An integer between 1800 and 2012 representing the year of interest"""
... | the_stack_v2_python_sparse | jt2276/world_Income_per_capita.py | ds-ga-1007/assignment9 | train | 2 |
6a0a0783428edc8dca7a1a5f1b7346a6c8d1cfe9 | [
"self.max_proportion = sum(w)\nself.Lists = []\nstart = 0.1\nfor x in w:\n start += x\n self.Lists.append(start)",
"import bisect\nimport random\na = random.randint(1, self.max_proportion)\nb = bisect.bisect(self.Lists, a)\nreturn b"
] | <|body_start_0|>
self.max_proportion = sum(w)
self.Lists = []
start = 0.1
for x in w:
start += x
self.Lists.append(start)
<|end_body_0|>
<|body_start_1|>
import bisect
import random
a = random.randint(1, self.max_proportion)
b = bi... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def __init__(self, w):
""":type w: List[int] 276 ms"""
<|body_0|>
def pickIndex(self):
""":rtype: int"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
self.max_proportion = sum(w)
self.Lists = []
start = 0.1
for x in... | stack_v2_sparse_classes_36k_train_024912 | 1,901 | no_license | [
{
"docstring": ":type w: List[int] 276 ms",
"name": "__init__",
"signature": "def __init__(self, w)"
},
{
"docstring": ":rtype: int",
"name": "pickIndex",
"signature": "def pickIndex(self)"
}
] | 2 | stack_v2_sparse_classes_30k_train_017846 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def __init__(self, w): :type w: List[int] 276 ms
- def pickIndex(self): :rtype: int | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def __init__(self, w): :type w: List[int] 276 ms
- def pickIndex(self): :rtype: int
<|skeleton|>
class Solution:
def __init__(self, w):
""":type w: List[int] 276 ms... | 679a2b246b8b6bb7fc55ed1c8096d3047d6d4461 | <|skeleton|>
class Solution:
def __init__(self, w):
""":type w: List[int] 276 ms"""
<|body_0|>
def pickIndex(self):
""":rtype: int"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def __init__(self, w):
""":type w: List[int] 276 ms"""
self.max_proportion = sum(w)
self.Lists = []
start = 0.1
for x in w:
start += x
self.Lists.append(start)
def pickIndex(self):
""":rtype: int"""
import bisect
... | the_stack_v2_python_sparse | RandomPickWithWeight_MID_880.py | 953250587/leetcode-python | train | 2 | |
73bb953dbd54108ddd2616a4f9d8bbe940097fe9 | [
"super().__init__()\nself.length = length\nself.k0 = k0\nself.use_pi = use_pi\nself.use_input = use_input",
"batch_shape = inputs.shape[:-1]\nnum_inputs = inputs.shape[-1]\ninputs = inputs.view(-1, 1, num_inputs)\nfactors = (2.0 ** torch.arange(self.k0, self.k0 + self.length).float().cuda()).view(1, -1, 1)\nif se... | <|body_start_0|>
super().__init__()
self.length = length
self.k0 = k0
self.use_pi = use_pi
self.use_input = use_input
<|end_body_0|>
<|body_start_1|>
batch_shape = inputs.shape[:-1]
num_inputs = inputs.shape[-1]
inputs = inputs.view(-1, 1, num_inputs)
... | Fourier positional embedding. Emb(x) = [sin(2^k Pi x), cos(2^k Pi x), sin(2^(k+1) Pi x), cos(2^(k+1) Pi x), ..., sin(2^(k+L-1) Pi x), cos(2^(k+L-1) Pi x)], where x is the input tensor. | FourierEmbedding | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class FourierEmbedding:
"""Fourier positional embedding. Emb(x) = [sin(2^k Pi x), cos(2^k Pi x), sin(2^(k+1) Pi x), cos(2^(k+1) Pi x), ..., sin(2^(k+L-1) Pi x), cos(2^(k+L-1) Pi x)], where x is the input tensor."""
def __init__(self, length: int, k0: float=0.0, use_pi: bool=True, use_input: bool=F... | stack_v2_sparse_classes_36k_train_024913 | 4,949 | permissive | [
{
"docstring": "Initialize a Fourier embedding function. Args: length (float): the length of the embedding. k0 (float): the starting exponential of the embedding. Default: 0. use_pi (bool): if True, use pi in the embedding. Default: True. use_input (bool): if True, return the input vector in the embedding. Defa... | 2 | stack_v2_sparse_classes_30k_train_003369 | Implement the Python class `FourierEmbedding` described below.
Class description:
Fourier positional embedding. Emb(x) = [sin(2^k Pi x), cos(2^k Pi x), sin(2^(k+1) Pi x), cos(2^(k+1) Pi x), ..., sin(2^(k+L-1) Pi x), cos(2^(k+L-1) Pi x)], where x is the input tensor.
Method signatures and docstrings:
- def __init__(se... | Implement the Python class `FourierEmbedding` described below.
Class description:
Fourier positional embedding. Emb(x) = [sin(2^k Pi x), cos(2^k Pi x), sin(2^(k+1) Pi x), cos(2^(k+1) Pi x), ..., sin(2^(k+L-1) Pi x), cos(2^(k+L-1) Pi x)], where x is the input tensor.
Method signatures and docstrings:
- def __init__(se... | 29c1c02134c20a14337458d18826e4a6f80e844e | <|skeleton|>
class FourierEmbedding:
"""Fourier positional embedding. Emb(x) = [sin(2^k Pi x), cos(2^k Pi x), sin(2^(k+1) Pi x), cos(2^(k+1) Pi x), ..., sin(2^(k+L-1) Pi x), cos(2^(k+L-1) Pi x)], where x is the input tensor."""
def __init__(self, length: int, k0: float=0.0, use_pi: bool=True, use_input: bool=F... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class FourierEmbedding:
"""Fourier positional embedding. Emb(x) = [sin(2^k Pi x), cos(2^k Pi x), sin(2^(k+1) Pi x), cos(2^(k+1) Pi x), ..., sin(2^(k+L-1) Pi x), cos(2^(k+L-1) Pi x)], where x is the input tensor."""
def __init__(self, length: int, k0: float=0.0, use_pi: bool=True, use_input: bool=False) -> None... | the_stack_v2_python_sparse | vision3d/layers/embedding.py | qinzheng93/vision3d | train | 20 |
19b9893a324a8f723380c068fb7a85bbf7ef22f7 | [
"username = claims.get(os.environ.get('CLAIMS_ENDPOINT') + 'username')\nif not username:\n return HttpResponse('No username provided, contact support.')\ntry:\n user = User.objects.filter(username=username)\n return user\nexcept User.DoesNotExist:\n return self.UserModel.objects.none()",
"user = super... | <|body_start_0|>
username = claims.get(os.environ.get('CLAIMS_ENDPOINT') + 'username')
if not username:
return HttpResponse('No username provided, contact support.')
try:
user = User.objects.filter(username=username)
return user
except User.DoesNotExis... | MyOIDCAB | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class MyOIDCAB:
def filter_users_by_claims(self, claims):
"""Checks to see if user exists and create user if not Linux foundation does not allow users to change their username, so chose to match users based on their username. If this changes we will need to match users based on some other crit... | stack_v2_sparse_classes_36k_train_024914 | 8,249 | permissive | [
{
"docstring": "Checks to see if user exists and create user if not Linux foundation does not allow users to change their username, so chose to match users based on their username. If this changes we will need to match users based on some other criterea.",
"name": "filter_users_by_claims",
"signature": ... | 3 | stack_v2_sparse_classes_30k_train_001459 | Implement the Python class `MyOIDCAB` described below.
Class description:
Implement the MyOIDCAB class.
Method signatures and docstrings:
- def filter_users_by_claims(self, claims): Checks to see if user exists and create user if not Linux foundation does not allow users to change their username, so chose to match us... | Implement the Python class `MyOIDCAB` described below.
Class description:
Implement the MyOIDCAB class.
Method signatures and docstrings:
- def filter_users_by_claims(self, claims): Checks to see if user exists and create user if not Linux foundation does not allow users to change their username, so chose to match us... | 886a644432ff53f97babccbae4eee555338caec1 | <|skeleton|>
class MyOIDCAB:
def filter_users_by_claims(self, claims):
"""Checks to see if user exists and create user if not Linux foundation does not allow users to change their username, so chose to match users based on their username. If this changes we will need to match users based on some other crit... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class MyOIDCAB:
def filter_users_by_claims(self, claims):
"""Checks to see if user exists and create user if not Linux foundation does not allow users to change their username, so chose to match users based on their username. If this changes we will need to match users based on some other criterea."""
... | the_stack_v2_python_sparse | src/account/views.py | opnfv/laas | train | 3 | |
427af9a6ee6daf83ec84493580c331cce368b4e5 | [
"AbstractEstimatorDecorator.__init__(self, component)\nself.foldername = foldername\nself.appendix = appendix",
"import matplotlib.pyplot as plt\nest = self.component.estimate(measdata, options)\ntry:\n for i in range(len(est['Diflist'][0])):\n part_diflist = [f[i] for f in est['Diflist']]\n part... | <|body_start_0|>
AbstractEstimatorDecorator.__init__(self, component)
self.foldername = foldername
self.appendix = appendix
<|end_body_0|>
<|body_start_1|>
import matplotlib.pyplot as plt
est = self.component.estimate(measdata, options)
try:
for i in range(le... | Декоратор, который либо сохраняет рисунки, либо выдаёт последовательно на экран рисунки такие: два графика (риальни, моделированни) диаграмма остатков график падения объектной функции | GraphPackEstimatorDecorator | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class GraphPackEstimatorDecorator:
"""Декоратор, который либо сохраняет рисунки, либо выдаёт последовательно на экран рисунки такие: два графика (риальни, моделированни) диаграмма остатков график падения объектной функции"""
def __init__(self, component, foldername, appendix):
""":param co... | stack_v2_sparse_classes_36k_train_024915 | 35,094 | no_license | [
{
"docstring": ":param component: :param foldername: папка, куда сохранять, если None, то показывать :param appendix: добавлять к именам файлов :return:",
"name": "__init__",
"signature": "def __init__(self, component, foldername, appendix)"
},
{
"docstring": "Описание выходной структуры данных ... | 2 | null | Implement the Python class `GraphPackEstimatorDecorator` described below.
Class description:
Декоратор, который либо сохраняет рисунки, либо выдаёт последовательно на экран рисунки такие: два графика (риальни, моделированни) диаграмма остатков график падения объектной функции
Method signatures and docstrings:
- def _... | Implement the Python class `GraphPackEstimatorDecorator` described below.
Class description:
Декоратор, который либо сохраняет рисунки, либо выдаёт последовательно на экран рисунки такие: два графика (риальни, моделированни) диаграмма остатков график падения объектной функции
Method signatures and docstrings:
- def _... | b071d3084cdf2d9f18b3981c9884ec7310840e79 | <|skeleton|>
class GraphPackEstimatorDecorator:
"""Декоратор, который либо сохраняет рисунки, либо выдаёт последовательно на экран рисунки такие: два графика (риальни, моделированни) диаграмма остатков график падения объектной функции"""
def __init__(self, component, foldername, appendix):
""":param co... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class GraphPackEstimatorDecorator:
"""Декоратор, который либо сохраняет рисунки, либо выдаёт последовательно на экран рисунки такие: два графика (риальни, моделированни) диаграмма остатков график падения объектной функции"""
def __init__(self, component, foldername, appendix):
""":param component: :par... | the_stack_v2_python_sparse | Fianora/Fianora_Estimators.py | reinerwaldmann/PHDLinearization | train | 0 |
d6780c86c579863d31ca82f7752780366f4af574 | [
"params = params or {}\nif db is None:\n logger.warning('Be careful, you are instanciating a matching without db')\nself.db = db\nself.fingerprinting = fingerprinting",
"current_segment_indexes = np.arange(int(t1 * self.fingerprinting.sr / 50), int(np.ceil(t2 * self.fingerprinting.sr / 50)))\ntracks_scored_uns... | <|body_start_0|>
params = params or {}
if db is None:
logger.warning('Be careful, you are instanciating a matching without db')
self.db = db
self.fingerprinting = fingerprinting
<|end_body_0|>
<|body_start_1|>
current_segment_indexes = np.arange(int(t1 * self.fingerp... | Simplest matching: check if two fingerprints are strictly equal. You have access to self.db, a database instance, and self.fingerprinting | SampleMatching | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SampleMatching:
"""Simplest matching: check if two fingerprints are strictly equal. You have access to self.db, a database instance, and self.fingerprinting"""
def __init__(self, db, params=None, fingerprinting=None):
"""Initializes the Fingerprinting class. Args: db: an instance of ... | stack_v2_sparse_classes_36k_train_024916 | 6,595 | no_license | [
{
"docstring": "Initializes the Fingerprinting class. Args: db: an instance of a child of DbApi params: a dictionary of parameters. Corresponds to params['fingerprint'] fingerprinting: an instance of a child of Fingerprinting.",
"name": "__init__",
"signature": "def __init__(self, db, params=None, finge... | 2 | stack_v2_sparse_classes_30k_train_004032 | Implement the Python class `SampleMatching` described below.
Class description:
Simplest matching: check if two fingerprints are strictly equal. You have access to self.db, a database instance, and self.fingerprinting
Method signatures and docstrings:
- def __init__(self, db, params=None, fingerprinting=None): Initia... | Implement the Python class `SampleMatching` described below.
Class description:
Simplest matching: check if two fingerprints are strictly equal. You have access to self.db, a database instance, and self.fingerprinting
Method signatures and docstrings:
- def __init__(self, db, params=None, fingerprinting=None): Initia... | bb874d019f70f671637b1269ad5c0681fb97715a | <|skeleton|>
class SampleMatching:
"""Simplest matching: check if two fingerprints are strictly equal. You have access to self.db, a database instance, and self.fingerprinting"""
def __init__(self, db, params=None, fingerprinting=None):
"""Initializes the Fingerprinting class. Args: db: an instance of ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SampleMatching:
"""Simplest matching: check if two fingerprints are strictly equal. You have access to self.db, a database instance, and self.fingerprinting"""
def __init__(self, db, params=None, fingerprinting=None):
"""Initializes the Fingerprinting class. Args: db: an instance of a child of Db... | the_stack_v2_python_sparse | traxit_manage/sample_algorithm.py | Trax-air/traxit-manage | train | 0 |
3caf53d519e9570d6989efd8bf23fe4a3d0e878b | [
"super().__init__()\nself.aliases.update({'artist': 'artistname', 'album': 'groupname', 'leech_type': 'freetorrent', 'release_type': 'releasetype', 'tags': 'taglist', 'tag_type': 'tags_type', 'log': 'haslog'})\nself.params.update({'taglist': None, 'artistname': None, 'groupname': None, 'year': None, 'tags_type': {'... | <|body_start_0|>
super().__init__()
self.aliases.update({'artist': 'artistname', 'album': 'groupname', 'leech_type': 'freetorrent', 'release_type': 'releasetype', 'tags': 'taglist', 'tag_type': 'tags_type', 'log': 'haslog'})
self.params.update({'taglist': None, 'artistname': None, 'groupname': N... | A plugin that searches a Gazelle-based music website Based on https://github.com/WhatCD/Gazelle since it's the starting point of all Gazelle-based music sites. | InputGazelleMusic | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class InputGazelleMusic:
"""A plugin that searches a Gazelle-based music website Based on https://github.com/WhatCD/Gazelle since it's the starting point of all Gazelle-based music sites."""
def __init__(self):
"""Set up the majority of parameters that these sites support"""
<|body... | stack_v2_sparse_classes_36k_train_024917 | 18,418 | permissive | [
{
"docstring": "Set up the majority of parameters that these sites support",
"name": "__init__",
"signature": "def __init__(self)"
},
{
"docstring": "The schema of the plugin Extends the super's schema",
"name": "schema",
"signature": "def schema(self)"
},
{
"docstring": "Generat... | 3 | null | Implement the Python class `InputGazelleMusic` described below.
Class description:
A plugin that searches a Gazelle-based music website Based on https://github.com/WhatCD/Gazelle since it's the starting point of all Gazelle-based music sites.
Method signatures and docstrings:
- def __init__(self): Set up the majority... | Implement the Python class `InputGazelleMusic` described below.
Class description:
A plugin that searches a Gazelle-based music website Based on https://github.com/WhatCD/Gazelle since it's the starting point of all Gazelle-based music sites.
Method signatures and docstrings:
- def __init__(self): Set up the majority... | ea95ff60041beaea9aacbc2d93549e3a6b981dc5 | <|skeleton|>
class InputGazelleMusic:
"""A plugin that searches a Gazelle-based music website Based on https://github.com/WhatCD/Gazelle since it's the starting point of all Gazelle-based music sites."""
def __init__(self):
"""Set up the majority of parameters that these sites support"""
<|body... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class InputGazelleMusic:
"""A plugin that searches a Gazelle-based music website Based on https://github.com/WhatCD/Gazelle since it's the starting point of all Gazelle-based music sites."""
def __init__(self):
"""Set up the majority of parameters that these sites support"""
super().__init__()
... | the_stack_v2_python_sparse | flexget/plugins/input/gazelle.py | BrutuZ/Flexget | train | 1 |
daa40f592ecc9818acb7844861c0b8aff3cb9c13 | [
"self.safe_views = []\nif hasattr(demo_settings, 'DEMO_SAFE_VIEWS'):\n for view_path in demo_settings.DEMO_SAFE_VIEWS:\n view = self._get_view(view_path)\n self.safe_views.append(view)",
"right_most_dot = view_path.rfind('.')\nmodule_path, view_name = (view_path[:right_most_dot], view_path[right_... | <|body_start_0|>
self.safe_views = []
if hasattr(demo_settings, 'DEMO_SAFE_VIEWS'):
for view_path in demo_settings.DEMO_SAFE_VIEWS:
view = self._get_view(view_path)
self.safe_views.append(view)
<|end_body_0|>
<|body_start_1|>
right_most_dot = view_pat... | Disable all views except those that are explicitly allowed. Safe views are listed in conf/demo_settings.py. | DisabledInDemoModeMiddleware | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class DisabledInDemoModeMiddleware:
"""Disable all views except those that are explicitly allowed. Safe views are listed in conf/demo_settings.py."""
def __init__(self):
"""Constructor."""
<|body_0|>
def _get_view(self, view_path):
"""Get the View from the path to help... | stack_v2_sparse_classes_36k_train_024918 | 1,588 | permissive | [
{
"docstring": "Constructor.",
"name": "__init__",
"signature": "def __init__(self)"
},
{
"docstring": "Get the View from the path to help build the list of safe views.",
"name": "_get_view",
"signature": "def _get_view(self, view_path)"
},
{
"docstring": "Override to implement M... | 3 | stack_v2_sparse_classes_30k_train_020561 | Implement the Python class `DisabledInDemoModeMiddleware` described below.
Class description:
Disable all views except those that are explicitly allowed. Safe views are listed in conf/demo_settings.py.
Method signatures and docstrings:
- def __init__(self): Constructor.
- def _get_view(self, view_path): Get the View ... | Implement the Python class `DisabledInDemoModeMiddleware` described below.
Class description:
Disable all views except those that are explicitly allowed. Safe views are listed in conf/demo_settings.py.
Method signatures and docstrings:
- def __init__(self): Constructor.
- def _get_view(self, view_path): Get the View ... | 898936072a716a799462c113286056690a7723d1 | <|skeleton|>
class DisabledInDemoModeMiddleware:
"""Disable all views except those that are explicitly allowed. Safe views are listed in conf/demo_settings.py."""
def __init__(self):
"""Constructor."""
<|body_0|>
def _get_view(self, view_path):
"""Get the View from the path to help... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class DisabledInDemoModeMiddleware:
"""Disable all views except those that are explicitly allowed. Safe views are listed in conf/demo_settings.py."""
def __init__(self):
"""Constructor."""
self.safe_views = []
if hasattr(demo_settings, 'DEMO_SAFE_VIEWS'):
for view_path in de... | the_stack_v2_python_sparse | genome_designer/main/middleware.py | RubensZimbres/millstone | train | 1 |
25ab57895d26b0717979c9de67b87714e2d8ee46 | [
"self.alignment = alignment_dict\nself.gap = gap_symbol\nself.missing = missing_symbol\nself.gap_threshold = gap_threshold\nself.missing_threshold = missing_threshold\nself.filter_terminals()\nself.filter_columns()",
"for taxa, seq in self.alignment.items():\n trim_seq = list(seq)\n counter, reverse_counter... | <|body_start_0|>
self.alignment = alignment_dict
self.gap = gap_symbol
self.missing = missing_symbol
self.gap_threshold = gap_threshold
self.missing_threshold = missing_threshold
self.filter_terminals()
self.filter_columns()
<|end_body_0|>
<|body_start_1|>
... | Contains several methods used to trim and filter missing data from alignments. It's mainly used for inheritance | MissingFilter | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class MissingFilter:
"""Contains several methods used to trim and filter missing data from alignments. It's mainly used for inheritance"""
def __init__(self, alignment_dict, gap_threshold=50, missing_threshold=75, gap_symbol='-', missing_symbol='n'):
"""the gap_threshold variable is a cut-... | stack_v2_sparse_classes_36k_train_024919 | 3,521 | no_license | [
{
"docstring": "the gap_threshold variable is a cut-off to total_missing_proportion and missing_threshold in a cut-off to missing_proportion",
"name": "__init__",
"signature": "def __init__(self, alignment_dict, gap_threshold=50, missing_threshold=75, gap_symbol='-', missing_symbol='n')"
},
{
"d... | 3 | stack_v2_sparse_classes_30k_train_008764 | Implement the Python class `MissingFilter` described below.
Class description:
Contains several methods used to trim and filter missing data from alignments. It's mainly used for inheritance
Method signatures and docstrings:
- def __init__(self, alignment_dict, gap_threshold=50, missing_threshold=75, gap_symbol='-', ... | Implement the Python class `MissingFilter` described below.
Class description:
Contains several methods used to trim and filter missing data from alignments. It's mainly used for inheritance
Method signatures and docstrings:
- def __init__(self, alignment_dict, gap_threshold=50, missing_threshold=75, gap_symbol='-', ... | 5895a8d3279020d9c02be474fb355c849f4170ca | <|skeleton|>
class MissingFilter:
"""Contains several methods used to trim and filter missing data from alignments. It's mainly used for inheritance"""
def __init__(self, alignment_dict, gap_threshold=50, missing_threshold=75, gap_symbol='-', missing_symbol='n'):
"""the gap_threshold variable is a cut-... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class MissingFilter:
"""Contains several methods used to trim and filter missing data from alignments. It's mainly used for inheritance"""
def __init__(self, alignment_dict, gap_threshold=50, missing_threshold=75, gap_symbol='-', missing_symbol='n'):
"""the gap_threshold variable is a cut-off to total_... | the_stack_v2_python_sparse | wingman/MissingFilter.py | ODiogoSilva/ElConcatenero3 | train | 0 |
e50bda2276a98a7004bee321a0de73d3b2579a8f | [
"super(_VNCRepeaterServer, self).__init__()\nself.peers = dict()\nself.adapter = adapter\nself.lpar_uuid = lpar_uuid\nself.local_port = local_port\nself.alive = True\nself.vnc_killer = None\nif client_socket is not None and local_socket is not None:\n self.add_socket_connection_pair(client_socket, local_socket)"... | <|body_start_0|>
super(_VNCRepeaterServer, self).__init__()
self.peers = dict()
self.adapter = adapter
self.lpar_uuid = lpar_uuid
self.local_port = local_port
self.alive = True
self.vnc_killer = None
if client_socket is not None and local_socket is not Non... | Repeats a VNC connection from localhost to a given client. This class is separated out from the Socket Listener so that there can be one thread doing the actual repeating/forwarded of the data for the VNC sessions for a single LPAR. Otherwise if there are sessions to a lot of LPAR's with sessions, one overall thread mi... | _VNCRepeaterServer | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class _VNCRepeaterServer:
"""Repeats a VNC connection from localhost to a given client. This class is separated out from the Socket Listener so that there can be one thread doing the actual repeating/forwarded of the data for the VNC sessions for a single LPAR. Otherwise if there are sessions to a lot ... | stack_v2_sparse_classes_36k_train_024920 | 34,456 | permissive | [
{
"docstring": "Creates the repeater. :param adapter: The pypowervm adapter :param lpar_uuid: Partition UUID. :param local_port: The local port bound to by the VNC session. :param client_socket: (Optional, Default: None) The socket descriptor of the incoming client connection. :param local_socket: (Optional, De... | 5 | null | Implement the Python class `_VNCRepeaterServer` described below.
Class description:
Repeats a VNC connection from localhost to a given client. This class is separated out from the Socket Listener so that there can be one thread doing the actual repeating/forwarded of the data for the VNC sessions for a single LPAR. Ot... | Implement the Python class `_VNCRepeaterServer` described below.
Class description:
Repeats a VNC connection from localhost to a given client. This class is separated out from the Socket Listener so that there can be one thread doing the actual repeating/forwarded of the data for the VNC sessions for a single LPAR. Ot... | 68f2b586b4f17489f379534ab52fc56a524b6da5 | <|skeleton|>
class _VNCRepeaterServer:
"""Repeats a VNC connection from localhost to a given client. This class is separated out from the Socket Listener so that there can be one thread doing the actual repeating/forwarded of the data for the VNC sessions for a single LPAR. Otherwise if there are sessions to a lot ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class _VNCRepeaterServer:
"""Repeats a VNC connection from localhost to a given client. This class is separated out from the Socket Listener so that there can be one thread doing the actual repeating/forwarded of the data for the VNC sessions for a single LPAR. Otherwise if there are sessions to a lot of LPAR's wit... | the_stack_v2_python_sparse | pypowervm/tasks/vterm.py | powervm/pypowervm | train | 25 |
62f96a6d2ff09586914263ebfbdb2827d8ad5e38 | [
"view = cls.as_view('budgets')\napp.add_url_rule('/api/ledgers/<int:ledger_id>/budgets', defaults={'budget_id': None}, view_func=view, methods=['GET'])\napp.add_url_rule('/api/ledgers/<int:ledger_id>/budgets', view_func=view, methods=['POST'])\napp.add_url_rule('/api/budgets/<int:budget_id>', defaults={'ledger_id':... | <|body_start_0|>
view = cls.as_view('budgets')
app.add_url_rule('/api/ledgers/<int:ledger_id>/budgets', defaults={'budget_id': None}, view_func=view, methods=['GET'])
app.add_url_rule('/api/ledgers/<int:ledger_id>/budgets', view_func=view, methods=['POST'])
app.add_url_rule('/api/budgets... | Budget REST resource view | BudgetsView | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class BudgetsView:
"""Budget REST resource view"""
def register(cls, app: Flask):
"""Registers routes for this view"""
<|body_0|>
def get(ledger_id: Optional[int], budget_id: Optional[int]):
"""Gets a specific budget or all budgets in the specified ledger"""
<|... | stack_v2_sparse_classes_36k_train_024921 | 17,779 | permissive | [
{
"docstring": "Registers routes for this view",
"name": "register",
"signature": "def register(cls, app: Flask)"
},
{
"docstring": "Gets a specific budget or all budgets in the specified ledger",
"name": "get",
"signature": "def get(ledger_id: Optional[int], budget_id: Optional[int])"
... | 5 | stack_v2_sparse_classes_30k_train_017810 | Implement the Python class `BudgetsView` described below.
Class description:
Budget REST resource view
Method signatures and docstrings:
- def register(cls, app: Flask): Registers routes for this view
- def get(ledger_id: Optional[int], budget_id: Optional[int]): Gets a specific budget or all budgets in the specified... | Implement the Python class `BudgetsView` described below.
Class description:
Budget REST resource view
Method signatures and docstrings:
- def register(cls, app: Flask): Registers routes for this view
- def get(ledger_id: Optional[int], budget_id: Optional[int]): Gets a specific budget or all budgets in the specified... | 20d992356952542fd79aab69849a04129fa22de2 | <|skeleton|>
class BudgetsView:
"""Budget REST resource view"""
def register(cls, app: Flask):
"""Registers routes for this view"""
<|body_0|>
def get(ledger_id: Optional[int], budget_id: Optional[int]):
"""Gets a specific budget or all budgets in the specified ledger"""
<|... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class BudgetsView:
"""Budget REST resource view"""
def register(cls, app: Flask):
"""Registers routes for this view"""
view = cls.as_view('budgets')
app.add_url_rule('/api/ledgers/<int:ledger_id>/budgets', defaults={'budget_id': None}, view_func=view, methods=['GET'])
app.add_ur... | the_stack_v2_python_sparse | backend/underbudget/views/budgets.py | vimofthevine/underbudget4 | train | 0 |
2256c3809d3279306e2c4e56d5dc511abdd05162 | [
"super(NormLayer, self).__init__()\nself.n_channels = n_channels\nself.scale = scale\nself.epsilon = epsilon\nself.weights = nn.Parameter(torch.Tensor(self.n_channels))\nself.weights.data *= 0.0\nself.weights.data += self.scale",
"norm = x.pow(2).sum(dim=1, keepdim=True).sqrt() + self.epsilon\nx = x / norm * self... | <|body_start_0|>
super(NormLayer, self).__init__()
self.n_channels = n_channels
self.scale = scale
self.epsilon = epsilon
self.weights = nn.Parameter(torch.Tensor(self.n_channels))
self.weights.data *= 0.0
self.weights.data += self.scale
<|end_body_0|>
<|body_sta... | Implementation of the L2 Norm Layer used in the S3FD paper. | NormLayer | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class NormLayer:
"""Implementation of the L2 Norm Layer used in the S3FD paper."""
def __init__(self, n_channels, scale=1.0, epsilon=1e-10):
"""Instantiates a L2 Norm layer. Parameters ---------- n_channels : int The number of channels in the input. scale : float, optional The scaling used... | stack_v2_sparse_classes_36k_train_024922 | 6,948 | no_license | [
{
"docstring": "Instantiates a L2 Norm layer. Parameters ---------- n_channels : int The number of channels in the input. scale : float, optional The scaling used for the weighted L2-norm, by default 1.0. epsilon : float, optional Parameter that prevents division by zero, by default 1e-10. Returns ------- None"... | 2 | stack_v2_sparse_classes_30k_train_001830 | Implement the Python class `NormLayer` described below.
Class description:
Implementation of the L2 Norm Layer used in the S3FD paper.
Method signatures and docstrings:
- def __init__(self, n_channels, scale=1.0, epsilon=1e-10): Instantiates a L2 Norm layer. Parameters ---------- n_channels : int The number of channe... | Implement the Python class `NormLayer` described below.
Class description:
Implementation of the L2 Norm Layer used in the S3FD paper.
Method signatures and docstrings:
- def __init__(self, n_channels, scale=1.0, epsilon=1e-10): Instantiates a L2 Norm layer. Parameters ---------- n_channels : int The number of channe... | a7c30481822ecb945e3ff6ad184d104361a40ed1 | <|skeleton|>
class NormLayer:
"""Implementation of the L2 Norm Layer used in the S3FD paper."""
def __init__(self, n_channels, scale=1.0, epsilon=1e-10):
"""Instantiates a L2 Norm layer. Parameters ---------- n_channels : int The number of channels in the input. scale : float, optional The scaling used... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class NormLayer:
"""Implementation of the L2 Norm Layer used in the S3FD paper."""
def __init__(self, n_channels, scale=1.0, epsilon=1e-10):
"""Instantiates a L2 Norm layer. Parameters ---------- n_channels : int The number of channels in the input. scale : float, optional The scaling used for the weig... | the_stack_v2_python_sparse | cheapfake/FAN/detectors/SF3DNet.py | hu-simon/cheapfake | train | 0 |
3e676a0487467960ba477b169e3e028a22a28896 | [
"line = line.rstrip('\\n')\ntry:\n super(DataSamplerTaskHadoop, self).__init__(line)\nexcept ValueError as e:\n raise DataSamplerTaskInitError('%s' % e)\ntry:\n self._ratio = self.get_attribute('ratio', self._json, 'ratio')\n self._encode = self.get_attribute('encode', self._json, 'code')\n self._dec... | <|body_start_0|>
line = line.rstrip('\n')
try:
super(DataSamplerTaskHadoop, self).__init__(line)
except ValueError as e:
raise DataSamplerTaskInitError('%s' % e)
try:
self._ratio = self.get_attribute('ratio', self._json, 'ratio')
self._enco... | hadoop data sampler task | DataSamplerTaskHadoop | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class DataSamplerTaskHadoop:
"""hadoop data sampler task"""
def __init__(self, line):
"""Change line to taskconf object Args: line: str Exception: DataSamplerTaskInitError"""
<|body_0|>
def excute(self):
"""begin to sample Args: None Return: 0"""
<|body_1|>
<|... | stack_v2_sparse_classes_36k_train_024923 | 6,255 | no_license | [
{
"docstring": "Change line to taskconf object Args: line: str Exception: DataSamplerTaskInitError",
"name": "__init__",
"signature": "def __init__(self, line)"
},
{
"docstring": "begin to sample Args: None Return: 0",
"name": "excute",
"signature": "def excute(self)"
}
] | 2 | stack_v2_sparse_classes_30k_train_007989 | Implement the Python class `DataSamplerTaskHadoop` described below.
Class description:
hadoop data sampler task
Method signatures and docstrings:
- def __init__(self, line): Change line to taskconf object Args: line: str Exception: DataSamplerTaskInitError
- def excute(self): begin to sample Args: None Return: 0 | Implement the Python class `DataSamplerTaskHadoop` described below.
Class description:
hadoop data sampler task
Method signatures and docstrings:
- def __init__(self, line): Change line to taskconf object Args: line: str Exception: DataSamplerTaskInitError
- def excute(self): begin to sample Args: None Return: 0
<|s... | 913fb4af29f4395f4a300d35c00236065075960e | <|skeleton|>
class DataSamplerTaskHadoop:
"""hadoop data sampler task"""
def __init__(self, line):
"""Change line to taskconf object Args: line: str Exception: DataSamplerTaskInitError"""
<|body_0|>
def excute(self):
"""begin to sample Args: None Return: 0"""
<|body_1|>
<|... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class DataSamplerTaskHadoop:
"""hadoop data sampler task"""
def __init__(self, line):
"""Change line to taskconf object Args: line: str Exception: DataSamplerTaskInitError"""
line = line.rstrip('\n')
try:
super(DataSamplerTaskHadoop, self).__init__(line)
except Value... | the_stack_v2_python_sparse | script/data_sampler_task.py | jhuangpku/data_checker | train | 0 |
de250f911303a04e513d36855fb60a2bf0e3338c | [
"n = len(graph)\ng = [[float('inf')] * n for _ in range(n)]\nfor i, js in enumerate(graph):\n for j in js:\n g[i][j] = 1\nfor k in range(n):\n for i in range(n):\n for j in range(n):\n if i == j:\n g[i][j] = 0\n else:\n g[i][j] = min(g[i][j], g... | <|body_start_0|>
n = len(graph)
g = [[float('inf')] * n for _ in range(n)]
for i, js in enumerate(graph):
for j in js:
g[i][j] = 1
for k in range(n):
for i in range(n):
for j in range(n):
if i == j:
... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def shortestPathLength(self, graph: List[List[int]]) -> int:
"""1. Convert the graph to a bidirectional weighted graph whose all pairs are connected 2. Return the minium traverse distance Time complexity: O(n^3) (max of FW and n times of DFS) Floyd-Warshall: O(n^3) DFS: O(V+E) ... | stack_v2_sparse_classes_36k_train_024924 | 3,565 | no_license | [
{
"docstring": "1. Convert the graph to a bidirectional weighted graph whose all pairs are connected 2. Return the minium traverse distance Time complexity: O(n^3) (max of FW and n times of DFS) Floyd-Warshall: O(n^3) DFS: O(V+E) = O(n + n^2) Space complexity: O(n*2^n)",
"name": "shortestPathLength",
"s... | 2 | stack_v2_sparse_classes_30k_train_005063 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def shortestPathLength(self, graph: List[List[int]]) -> int: 1. Convert the graph to a bidirectional weighted graph whose all pairs are connected 2. Return the minium traverse di... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def shortestPathLength(self, graph: List[List[int]]) -> int: 1. Convert the graph to a bidirectional weighted graph whose all pairs are connected 2. Return the minium traverse di... | 1389a009a02e90e8700a7a00e0b7f797c129cdf4 | <|skeleton|>
class Solution:
def shortestPathLength(self, graph: List[List[int]]) -> int:
"""1. Convert the graph to a bidirectional weighted graph whose all pairs are connected 2. Return the minium traverse distance Time complexity: O(n^3) (max of FW and n times of DFS) Floyd-Warshall: O(n^3) DFS: O(V+E) ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def shortestPathLength(self, graph: List[List[int]]) -> int:
"""1. Convert the graph to a bidirectional weighted graph whose all pairs are connected 2. Return the minium traverse distance Time complexity: O(n^3) (max of FW and n times of DFS) Floyd-Warshall: O(n^3) DFS: O(V+E) = O(n + n^2) S... | the_stack_v2_python_sparse | leetcode/solved/877_Shortest_Path_Visiting_All_Nodes/solution.py | sungminoh/algorithms | train | 0 | |
11a72443dfdce4db6dd71ccd35e37422d9a7c62d | [
"if value is self.field.missing_value:\n return []\nkey_converter = self._get_converter(self.field.key_type)\nconverter = self._get_converter(self.field.value_type)\nreturn [(key_converter.to_widget_value(k), converter.to_widget_value(v)) for k, v in value.items()]",
"if len(value) == 0:\n return self.field... | <|body_start_0|>
if value is self.field.missing_value:
return []
key_converter = self._get_converter(self.field.key_type)
converter = self._get_converter(self.field.value_type)
return [(key_converter.to_widget_value(k), converter.to_widget_value(v)) for k, v in value.items()]... | Data converter for IMultiWidget. | DictMultiConverter | [
"ZPL-2.1"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class DictMultiConverter:
"""Data converter for IMultiWidget."""
def to_widget_value(self, value):
"""Just dispatch it."""
<|body_0|>
def to_field_value(self, value):
"""Just dispatch it."""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
if value is sel... | stack_v2_sparse_classes_36k_train_024925 | 16,755 | permissive | [
{
"docstring": "Just dispatch it.",
"name": "to_widget_value",
"signature": "def to_widget_value(self, value)"
},
{
"docstring": "Just dispatch it.",
"name": "to_field_value",
"signature": "def to_field_value(self, value)"
}
] | 2 | null | Implement the Python class `DictMultiConverter` described below.
Class description:
Data converter for IMultiWidget.
Method signatures and docstrings:
- def to_widget_value(self, value): Just dispatch it.
- def to_field_value(self, value): Just dispatch it. | Implement the Python class `DictMultiConverter` described below.
Class description:
Data converter for IMultiWidget.
Method signatures and docstrings:
- def to_widget_value(self, value): Just dispatch it.
- def to_field_value(self, value): Just dispatch it.
<|skeleton|>
class DictMultiConverter:
"""Data converte... | e83e2ce314355f98eaf66e90ad6feccbda7934f9 | <|skeleton|>
class DictMultiConverter:
"""Data converter for IMultiWidget."""
def to_widget_value(self, value):
"""Just dispatch it."""
<|body_0|>
def to_field_value(self, value):
"""Just dispatch it."""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class DictMultiConverter:
"""Data converter for IMultiWidget."""
def to_widget_value(self, value):
"""Just dispatch it."""
if value is self.field.missing_value:
return []
key_converter = self._get_converter(self.field.key_type)
converter = self._get_converter(self.fi... | the_stack_v2_python_sparse | src/pyams_form/converter.py | Py-AMS/pyams-form | train | 0 |
6b02611823dc4b58ec5be35b8ff112a7ccbb668c | [
"RPM.__init__(self, mat, **kwargs)\nself.base = mat\nif is_sparse is True:\n self.mat = self.sparsify(mat)\nelse:\n self.mat = mat",
"mat = np.copy(old_mat)\nsize = mat.shape[0]\nGS = cls.to_graph(mat)\nfor dim in [0, 1]:\n G = GS[dim]\n for i in range(size):\n for j in range(i + 1, size):\n ... | <|body_start_0|>
RPM.__init__(self, mat, **kwargs)
self.base = mat
if is_sparse is True:
self.mat = self.sparsify(mat)
else:
self.mat = mat
<|end_body_0|>
<|body_start_1|>
mat = np.copy(old_mat)
size = mat.shape[0]
GS = cls.to_graph(mat)
... | SRPM | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SRPM:
def __init__(self, mat, is_sparse=False, **kwargs):
"""Sparse Relative Position Matrix before calling self.as_constraint(), removes redundant entries"""
<|body_0|>
def sparsify(cls, old_mat):
"""if A is left of B and B is to left of C -> A is left of C => i,j =... | stack_v2_sparse_classes_36k_train_024926 | 28,849 | no_license | [
{
"docstring": "Sparse Relative Position Matrix before calling self.as_constraint(), removes redundant entries",
"name": "__init__",
"signature": "def __init__(self, mat, is_sparse=False, **kwargs)"
},
{
"docstring": "if A is left of B and B is to left of C -> A is left of C => i,j = left j,k = ... | 2 | stack_v2_sparse_classes_30k_train_010870 | Implement the Python class `SRPM` described below.
Class description:
Implement the SRPM class.
Method signatures and docstrings:
- def __init__(self, mat, is_sparse=False, **kwargs): Sparse Relative Position Matrix before calling self.as_constraint(), removes redundant entries
- def sparsify(cls, old_mat): if A is l... | Implement the Python class `SRPM` described below.
Class description:
Implement the SRPM class.
Method signatures and docstrings:
- def __init__(self, mat, is_sparse=False, **kwargs): Sparse Relative Position Matrix before calling self.as_constraint(), removes redundant entries
- def sparsify(cls, old_mat): if A is l... | 5928c1ef1eb0d60bfa0726227e690c0a66570f45 | <|skeleton|>
class SRPM:
def __init__(self, mat, is_sparse=False, **kwargs):
"""Sparse Relative Position Matrix before calling self.as_constraint(), removes redundant entries"""
<|body_0|>
def sparsify(cls, old_mat):
"""if A is left of B and B is to left of C -> A is left of C => i,j =... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SRPM:
def __init__(self, mat, is_sparse=False, **kwargs):
"""Sparse Relative Position Matrix before calling self.as_constraint(), removes redundant entries"""
RPM.__init__(self, mat, **kwargs)
self.base = mat
if is_sparse is True:
self.mat = self.sparsify(mat)
... | the_stack_v2_python_sparse | src/cvopt/formulate/positioning.py | psavine42/juststuff | train | 0 | |
d44f55e449332180c0a5ec051cb0813a453deca6 | [
"batch_size = self.tensors.batch_size\nmask = self._get_mask()\nspatial_temporal_log_loss = self._get_spatial_temporal_loss(n_location_categories, layer_2_output_socres) * mask\ncategorical_log_loss = self._get_categorical_loss(layer_1_output_socres) * mask\nreturn [tf.reduce_sum(categorical_log_loss) / batch_size,... | <|body_start_0|>
batch_size = self.tensors.batch_size
mask = self._get_mask()
spatial_temporal_log_loss = self._get_spatial_temporal_loss(n_location_categories, layer_2_output_socres) * mask
categorical_log_loss = self._get_categorical_loss(layer_1_output_socres) * mask
return [t... | TwoLayerCategoricalLocationLossFunction | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TwoLayerCategoricalLocationLossFunction:
def get_loss(self, n_location_categories, layer_1_output_socres, layer_2_output_socres):
"""Get total loss from layer 1 and layer 2 output."""
<|body_0|>
def _get_spatial_temporal_loss(self, n_location_categories, output_socres):
... | stack_v2_sparse_classes_36k_train_024927 | 3,718 | permissive | [
{
"docstring": "Get total loss from layer 1 and layer 2 output.",
"name": "get_loss",
"signature": "def get_loss(self, n_location_categories, layer_1_output_socres, layer_2_output_socres)"
},
{
"docstring": "Compute the spatial-temporal log loss",
"name": "_get_spatial_temporal_loss",
"s... | 2 | stack_v2_sparse_classes_30k_train_010072 | Implement the Python class `TwoLayerCategoricalLocationLossFunction` described below.
Class description:
Implement the TwoLayerCategoricalLocationLossFunction class.
Method signatures and docstrings:
- def get_loss(self, n_location_categories, layer_1_output_socres, layer_2_output_socres): Get total loss from layer 1... | Implement the Python class `TwoLayerCategoricalLocationLossFunction` described below.
Class description:
Implement the TwoLayerCategoricalLocationLossFunction class.
Method signatures and docstrings:
- def get_loss(self, n_location_categories, layer_1_output_socres, layer_2_output_socres): Get total loss from layer 1... | 36f21b46a5c9382f90ece561a3efb1885be3c74f | <|skeleton|>
class TwoLayerCategoricalLocationLossFunction:
def get_loss(self, n_location_categories, layer_1_output_socres, layer_2_output_socres):
"""Get total loss from layer 1 and layer 2 output."""
<|body_0|>
def _get_spatial_temporal_loss(self, n_location_categories, output_socres):
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TwoLayerCategoricalLocationLossFunction:
def get_loss(self, n_location_categories, layer_1_output_socres, layer_2_output_socres):
"""Get total loss from layer 1 and layer 2 output."""
batch_size = self.tensors.batch_size
mask = self._get_mask()
spatial_temporal_log_loss = self.... | the_stack_v2_python_sparse | lstm_mobility_model/two_layer_categorical_location/loss_function.py | zihenglin/LSTM-Mobility-Model | train | 20 | |
bd487e09af6d18f93bf1d59df677765294db5a40 | [
"valid_places = (lite.Place(lite.TargetType.kFPGA, lite.PrecisionType.kFP16, lite.DataLayoutType.kNHWC), lite.Place(lite.TargetType.kHost, lite.PrecisionType.kFloat), lite.Place(lite.TargetType.kARM, lite.PrecisionType.kFloat))\nconfig = lite.CxxConfig()\nif model_dir:\n config.set_model_dir(model_dir)\nelse:\n ... | <|body_start_0|>
valid_places = (lite.Place(lite.TargetType.kFPGA, lite.PrecisionType.kFP16, lite.DataLayoutType.kNHWC), lite.Place(lite.TargetType.kHost, lite.PrecisionType.kFloat), lite.Place(lite.TargetType.kARM, lite.PrecisionType.kFloat))
config = lite.CxxConfig()
if model_dir:
... | cxx_model | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class cxx_model:
def load_model(self, model_flie, param_file, thread_num, model_dir):
"""加载CxxCongig模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器"""
<|body_0|>
def data_feed(self, data_shape):
"""初始化CxxCongig模型输入数据张量 参数:数据形状, 预测器 返回:数据张量"""
<|body_1|>
def predict(self, ... | stack_v2_sparse_classes_36k_train_024928 | 3,563 | permissive | [
{
"docstring": "加载CxxCongig模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器",
"name": "load_model",
"signature": "def load_model(self, model_flie, param_file, thread_num, model_dir)"
},
{
"docstring": "初始化CxxCongig模型输入数据张量 参数:数据形状, 预测器 返回:数据张量",
"name": "data_feed",
"signature": "def data_feed(self, ... | 3 | stack_v2_sparse_classes_30k_train_005345 | Implement the Python class `cxx_model` described below.
Class description:
Implement the cxx_model class.
Method signatures and docstrings:
- def load_model(self, model_flie, param_file, thread_num, model_dir): 加载CxxCongig模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器
- def data_feed(self, data_shape): 初始化CxxCongig模型输入数据张量 参数:数... | Implement the Python class `cxx_model` described below.
Class description:
Implement the cxx_model class.
Method signatures and docstrings:
- def load_model(self, model_flie, param_file, thread_num, model_dir): 加载CxxCongig模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器
- def data_feed(self, data_shape): 初始化CxxCongig模型输入数据张量 参数:数... | afbd0e081763c53833617a4892d03043e644d641 | <|skeleton|>
class cxx_model:
def load_model(self, model_flie, param_file, thread_num, model_dir):
"""加载CxxCongig模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器"""
<|body_0|>
def data_feed(self, data_shape):
"""初始化CxxCongig模型输入数据张量 参数:数据形状, 预测器 返回:数据张量"""
<|body_1|>
def predict(self, ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class cxx_model:
def load_model(self, model_flie, param_file, thread_num, model_dir):
"""加载CxxCongig模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器"""
valid_places = (lite.Place(lite.TargetType.kFPGA, lite.PrecisionType.kFP16, lite.DataLayoutType.kNHWC), lite.Place(lite.TargetType.kHost, lite.PrecisionType.kFlo... | the_stack_v2_python_sparse | mastercar/eblite_smart_car-master/model.py | wpy-111/python | train | 1 | |
944d74f40e1c9c48f54f80207679d087cb705708 | [
"if state is None and zonename is not None:\n self.zonename = zonename\n self.refresh()\nelse:\n self.zoneid = zoneid\n self.zonename = zonename\n self.state = state\n self.zonepath = zonepath\n self.uuid = uuid\n self.brand = brand\n self.ip_type = ip_type",
"cmd = [ZONEADM, '-z', self... | <|body_start_0|>
if state is None and zonename is not None:
self.zonename = zonename
self.refresh()
else:
self.zoneid = zoneid
self.zonename = zonename
self.state = state
self.zonepath = zonepath
self.uuid = uuid
... | Zone | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Zone:
def __init__(self, zoneid=None, zonename=None, state=None, zonepath=None, uuid=None, brand=None, ip_type=None):
"""define Zone object attribute from zoneadm output line zoneid:zonename:state:zonepath:uuid:brand:ip-type"""
<|body_0|>
def refresh(self):
"""refres... | stack_v2_sparse_classes_36k_train_024929 | 3,215 | no_license | [
{
"docstring": "define Zone object attribute from zoneadm output line zoneid:zonename:state:zonepath:uuid:brand:ip-type",
"name": "__init__",
"signature": "def __init__(self, zoneid=None, zonename=None, state=None, zonepath=None, uuid=None, brand=None, ip_type=None)"
},
{
"docstring": "refresh z... | 2 | null | Implement the Python class `Zone` described below.
Class description:
Implement the Zone class.
Method signatures and docstrings:
- def __init__(self, zoneid=None, zonename=None, state=None, zonepath=None, uuid=None, brand=None, ip_type=None): define Zone object attribute from zoneadm output line zoneid:zonename:stat... | Implement the Python class `Zone` described below.
Class description:
Implement the Zone class.
Method signatures and docstrings:
- def __init__(self, zoneid=None, zonename=None, state=None, zonepath=None, uuid=None, brand=None, ip_type=None): define Zone object attribute from zoneadm output line zoneid:zonename:stat... | 75baeb19e0d26d5e150e770aef4d615c2327f32e | <|skeleton|>
class Zone:
def __init__(self, zoneid=None, zonename=None, state=None, zonepath=None, uuid=None, brand=None, ip_type=None):
"""define Zone object attribute from zoneadm output line zoneid:zonename:state:zonepath:uuid:brand:ip-type"""
<|body_0|>
def refresh(self):
"""refres... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Zone:
def __init__(self, zoneid=None, zonename=None, state=None, zonepath=None, uuid=None, brand=None, ip_type=None):
"""define Zone object attribute from zoneadm output line zoneid:zonename:state:zonepath:uuid:brand:ip-type"""
if state is None and zonename is not None:
self.zonena... | the_stack_v2_python_sparse | lib/rcZone.py | SLB-DeN/opensvc | train | 1 | |
195599cce372357af9b02a668e7d0ebbb02f06fe | [
"self_keys = {'value': self.value}\nnatural_keys = super(IncomeTransaction, self).natural_key(self_keys)\nreturn natural_keys",
"exclude_fields = tuple(set(exclude_fields) | {'user'})\nserialized = super(IncomeTransaction, self).serialize(format, include_fields, exclude_fields, use_natural_foreign_keys, use_natur... | <|body_start_0|>
self_keys = {'value': self.value}
natural_keys = super(IncomeTransaction, self).natural_key(self_keys)
return natural_keys
<|end_body_0|>
<|body_start_1|>
exclude_fields = tuple(set(exclude_fields) | {'user'})
serialized = super(IncomeTransaction, self).serializ... | Represents Income transaction table | IncomeTransaction | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class IncomeTransaction:
"""Represents Income transaction table"""
def natural_key(self):
"""Overrides base class method :return:"""
<|body_0|>
def serialize(self, format='json', include_fields=(), exclude_fields=(), use_natural_foreign_keys=True, use_natural_primary_keys=True... | stack_v2_sparse_classes_36k_train_024930 | 2,062 | no_license | [
{
"docstring": "Overrides base class method :return:",
"name": "natural_key",
"signature": "def natural_key(self)"
},
{
"docstring": "Overrides base class method :param format: :param include_fields: :param exclude_fields: :param use_natural_foreign_keys: :param use_natural_primary_keys: :return... | 3 | stack_v2_sparse_classes_30k_train_018443 | Implement the Python class `IncomeTransaction` described below.
Class description:
Represents Income transaction table
Method signatures and docstrings:
- def natural_key(self): Overrides base class method :return:
- def serialize(self, format='json', include_fields=(), exclude_fields=(), use_natural_foreign_keys=Tru... | Implement the Python class `IncomeTransaction` described below.
Class description:
Represents Income transaction table
Method signatures and docstrings:
- def natural_key(self): Overrides base class method :return:
- def serialize(self, format='json', include_fields=(), exclude_fields=(), use_natural_foreign_keys=Tru... | a93e0eee39e1f45fa73de84514ca254e235a17bd | <|skeleton|>
class IncomeTransaction:
"""Represents Income transaction table"""
def natural_key(self):
"""Overrides base class method :return:"""
<|body_0|>
def serialize(self, format='json', include_fields=(), exclude_fields=(), use_natural_foreign_keys=True, use_natural_primary_keys=True... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class IncomeTransaction:
"""Represents Income transaction table"""
def natural_key(self):
"""Overrides base class method :return:"""
self_keys = {'value': self.value}
natural_keys = super(IncomeTransaction, self).natural_key(self_keys)
return natural_keys
def serialize(self... | the_stack_v2_python_sparse | cashapp_models/models/IncomeTransactionModel.py | dmitryshepelev/cashapp | train | 0 |
0cb4cd4f9ff045a296381afa0c8eb652dfcdae31 | [
"supported_detection_types = ['bbox', 'segmentation']\nif detection_type not in supported_detection_types:\n raise ValueError('Unsupported detection type: {}. Supported values are: {}'.format(detection_type, supported_detection_types))\nself._detection_type = detection_type\ncoco.COCO.__init__(self)\nself.datase... | <|body_start_0|>
supported_detection_types = ['bbox', 'segmentation']
if detection_type not in supported_detection_types:
raise ValueError('Unsupported detection type: {}. Supported values are: {}'.format(detection_type, supported_detection_types))
self._detection_type = detection_ty... | Wrapper for the pycocotools COCO class. | COCOWrapper | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class COCOWrapper:
"""Wrapper for the pycocotools COCO class."""
def __init__(self, dataset, detection_type='bbox'):
"""COCOWrapper constructor. See http://mscoco.org/dataset/#format for a description of the format. By default, the coco.COCO class constructor reads from a JSON file. This f... | stack_v2_sparse_classes_36k_train_024931 | 37,770 | permissive | [
{
"docstring": "COCOWrapper constructor. See http://mscoco.org/dataset/#format for a description of the format. By default, the coco.COCO class constructor reads from a JSON file. This function duplicates the same behavior but loads from a dictionary, allowing us to perform evaluation without writing to externa... | 2 | null | Implement the Python class `COCOWrapper` described below.
Class description:
Wrapper for the pycocotools COCO class.
Method signatures and docstrings:
- def __init__(self, dataset, detection_type='bbox'): COCOWrapper constructor. See http://mscoco.org/dataset/#format for a description of the format. By default, the c... | Implement the Python class `COCOWrapper` described below.
Class description:
Wrapper for the pycocotools COCO class.
Method signatures and docstrings:
- def __init__(self, dataset, detection_type='bbox'): COCOWrapper constructor. See http://mscoco.org/dataset/#format for a description of the format. By default, the c... | a5388a45f71a949639b35cc5b990bd130d2d8164 | <|skeleton|>
class COCOWrapper:
"""Wrapper for the pycocotools COCO class."""
def __init__(self, dataset, detection_type='bbox'):
"""COCOWrapper constructor. See http://mscoco.org/dataset/#format for a description of the format. By default, the coco.COCO class constructor reads from a JSON file. This f... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class COCOWrapper:
"""Wrapper for the pycocotools COCO class."""
def __init__(self, dataset, detection_type='bbox'):
"""COCOWrapper constructor. See http://mscoco.org/dataset/#format for a description of the format. By default, the coco.COCO class constructor reads from a JSON file. This function dupli... | the_stack_v2_python_sparse | TensorFlow/Detection/SSD/models/research/object_detection/metrics/coco_tools.py | NVIDIA/DeepLearningExamples | train | 11,838 |
6504bca43fec8cddc98cc55dce3aeaddf1bdd15f | [
"def get_number(l: ListNode) -> int:\n rslt, curr = (0, l)\n while curr:\n rslt = rslt * 10 + curr.val\n curr = curr.next\n return rslt\nn = str(get_number(l1) + get_number(l2))\ndummyHead = currNode = ListNode(None)\nfor c in n:\n currNode.next = ListNode(int(c))\n currNode = currNode.... | <|body_start_0|>
def get_number(l: ListNode) -> int:
rslt, curr = (0, l)
while curr:
rslt = rslt * 10 + curr.val
curr = curr.next
return rslt
n = str(get_number(l1) + get_number(l2))
dummyHead = currNode = ListNode(None)
... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
"""Cheat answer: python does not have a limit on integer."""
<|body_0|>
def addTwoNumbers2(self, l1: ListNode, l2: ListNode) -> ListNode:
"""Regular solution using a stack."""
<|body_1... | stack_v2_sparse_classes_36k_train_024932 | 1,482 | no_license | [
{
"docstring": "Cheat answer: python does not have a limit on integer.",
"name": "addTwoNumbers",
"signature": "def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode"
},
{
"docstring": "Regular solution using a stack.",
"name": "addTwoNumbers2",
"signature": "def addTwoNumbers2... | 2 | stack_v2_sparse_classes_30k_train_015742 | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: Cheat answer: python does not have a limit on integer.
- def addTwoNumbers2(self, l1: ListNode, l2: ListNode) -> ... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: Cheat answer: python does not have a limit on integer.
- def addTwoNumbers2(self, l1: ListNode, l2: ListNode) -> ... | edb870f83f0c4568cce0cacec04ee70cf6b545bf | <|skeleton|>
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
"""Cheat answer: python does not have a limit on integer."""
<|body_0|>
def addTwoNumbers2(self, l1: ListNode, l2: ListNode) -> ListNode:
"""Regular solution using a stack."""
<|body_1... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
"""Cheat answer: python does not have a limit on integer."""
def get_number(l: ListNode) -> int:
rslt, curr = (0, l)
while curr:
rslt = rslt * 10 + curr.val
curr =... | the_stack_v2_python_sparse | 2020/add_two_numbers_ii.py | eronekogin/leetcode | train | 0 | |
50ec17c31cc9d79049bb914aa03aa6c82686af80 | [
"super(Tacotron2Loss, self).__init__()\nassert use_masking != use_weighted_masking or not use_masking\nself.use_masking = use_masking\nself.use_weighted_masking = use_weighted_masking\nreduction = 'none' if self.use_weighted_masking else 'mean'\nself.l1_criterion = torch.nn.L1Loss(reduction=reduction)\nself.mse_cri... | <|body_start_0|>
super(Tacotron2Loss, self).__init__()
assert use_masking != use_weighted_masking or not use_masking
self.use_masking = use_masking
self.use_weighted_masking = use_weighted_masking
reduction = 'none' if self.use_weighted_masking else 'mean'
self.l1_criteri... | Loss function module for Tacotron2. | Tacotron2Loss | [
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Tacotron2Loss:
"""Loss function module for Tacotron2."""
def __init__(self, use_masking=True, use_weighted_masking=False, bce_pos_weight=20.0):
"""Initialize Tactoron2 loss module. Args: use_masking (bool): Whether to apply masking for padded part in loss calculation. use_weighted_ma... | stack_v2_sparse_classes_36k_train_024933 | 18,153 | permissive | [
{
"docstring": "Initialize Tactoron2 loss module. Args: use_masking (bool): Whether to apply masking for padded part in loss calculation. use_weighted_masking (bool): Whether to apply weighted masking in loss calculation. bce_pos_weight (float): Weight of positive sample of stop token.",
"name": "__init__",... | 3 | stack_v2_sparse_classes_30k_train_004562 | Implement the Python class `Tacotron2Loss` described below.
Class description:
Loss function module for Tacotron2.
Method signatures and docstrings:
- def __init__(self, use_masking=True, use_weighted_masking=False, bce_pos_weight=20.0): Initialize Tactoron2 loss module. Args: use_masking (bool): Whether to apply mas... | Implement the Python class `Tacotron2Loss` described below.
Class description:
Loss function module for Tacotron2.
Method signatures and docstrings:
- def __init__(self, use_masking=True, use_weighted_masking=False, bce_pos_weight=20.0): Initialize Tactoron2 loss module. Args: use_masking (bool): Whether to apply mas... | b60c741f746877293bb85eed6806736fc8fa0ffd | <|skeleton|>
class Tacotron2Loss:
"""Loss function module for Tacotron2."""
def __init__(self, use_masking=True, use_weighted_masking=False, bce_pos_weight=20.0):
"""Initialize Tactoron2 loss module. Args: use_masking (bool): Whether to apply masking for padded part in loss calculation. use_weighted_ma... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Tacotron2Loss:
"""Loss function module for Tacotron2."""
def __init__(self, use_masking=True, use_weighted_masking=False, bce_pos_weight=20.0):
"""Initialize Tactoron2 loss module. Args: use_masking (bool): Whether to apply masking for padded part in loss calculation. use_weighted_masking (bool):... | the_stack_v2_python_sparse | speecht5/speecht5/criterions/text_to_speech_loss.py | microsoft/unilm | train | 15,313 |
08e67d9eecf2d713de08fc743d78acf82e33dc21 | [
"slow, fast = (nums[0], nums[nums[0]])\nwhile slow != fast:\n slow = nums[slow]\n fast = nums[nums[fast]]\nslow = 0\nwhile slow != fast:\n slow = nums[slow]\n fast = nums[fast]\nreturn slow",
"n = len(nums) - 1\nans = 0\nleft, right = (1, n)\nwhile left <= right:\n mid = (left + right) / 2\n cnt... | <|body_start_0|>
slow, fast = (nums[0], nums[nums[0]])
while slow != fast:
slow = nums[slow]
fast = nums[nums[fast]]
slow = 0
while slow != fast:
slow = nums[slow]
fast = nums[fast]
return slow
<|end_body_0|>
<|body_start_1|>
... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def findDuplicate(self, nums):
""":type nums: List[int] :rtype: int"""
<|body_0|>
def findDuplicate_binary_search(self, nums):
""":type nums: List[int] :rtype: int"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
slow, fast = (nums[0], nums... | stack_v2_sparse_classes_36k_train_024934 | 1,668 | no_license | [
{
"docstring": ":type nums: List[int] :rtype: int",
"name": "findDuplicate",
"signature": "def findDuplicate(self, nums)"
},
{
"docstring": ":type nums: List[int] :rtype: int",
"name": "findDuplicate_binary_search",
"signature": "def findDuplicate_binary_search(self, nums)"
}
] | 2 | null | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def findDuplicate(self, nums): :type nums: List[int] :rtype: int
- def findDuplicate_binary_search(self, nums): :type nums: List[int] :rtype: int | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def findDuplicate(self, nums): :type nums: List[int] :rtype: int
- def findDuplicate_binary_search(self, nums): :type nums: List[int] :rtype: int
<|skeleton|>
class Solution:
... | 0a7aa09a2b95e4caca5b5123fb735ceb5c01e992 | <|skeleton|>
class Solution:
def findDuplicate(self, nums):
""":type nums: List[int] :rtype: int"""
<|body_0|>
def findDuplicate_binary_search(self, nums):
""":type nums: List[int] :rtype: int"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def findDuplicate(self, nums):
""":type nums: List[int] :rtype: int"""
slow, fast = (nums[0], nums[nums[0]])
while slow != fast:
slow = nums[slow]
fast = nums[nums[fast]]
slow = 0
while slow != fast:
slow = nums[slow]
... | the_stack_v2_python_sparse | find-the-duplicate-number.py | onestarshang/leetcode | train | 0 | |
32aa3e77edd63b76826e226d0ff1d79cb09caa39 | [
"super().__init__()\nif out_planes is None:\n self.linear1 = tf.keras.models.Sequential((layers.InputLayer(input_shape=(2 * in_planes,)), layers.Dense(in_planes), layers.BatchNormalization(momentum=0.9, epsilon=1e-05), layers.ReLU()))\n self.linear2 = tf.keras.models.Sequential((layers.InputLayer(input_shape=... | <|body_start_0|>
super().__init__()
if out_planes is None:
self.linear1 = tf.keras.models.Sequential((layers.InputLayer(input_shape=(2 * in_planes,)), layers.Dense(in_planes), layers.BatchNormalization(momentum=0.9, epsilon=1e-05), layers.ReLU()))
self.linear2 = tf.keras.models.S... | Decoder layer for PointTransformer. Interpolate points based on corresponding encoder layer. | TransitionUp | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TransitionUp:
"""Decoder layer for PointTransformer. Interpolate points based on corresponding encoder layer."""
def __init__(self, in_planes, out_planes=None):
"""Constructor for TransitionUp Layer. Args: in_planes (int): Number of input planes. out_planes (int): Number of output pl... | stack_v2_sparse_classes_36k_train_024935 | 29,888 | permissive | [
{
"docstring": "Constructor for TransitionUp Layer. Args: in_planes (int): Number of input planes. out_planes (int): Number of output planes.",
"name": "__init__",
"signature": "def __init__(self, in_planes, out_planes=None)"
},
{
"docstring": "Forward call for TransitionUp Args: pxo1: [point, f... | 2 | stack_v2_sparse_classes_30k_train_002784 | Implement the Python class `TransitionUp` described below.
Class description:
Decoder layer for PointTransformer. Interpolate points based on corresponding encoder layer.
Method signatures and docstrings:
- def __init__(self, in_planes, out_planes=None): Constructor for TransitionUp Layer. Args: in_planes (int): Numb... | Implement the Python class `TransitionUp` described below.
Class description:
Decoder layer for PointTransformer. Interpolate points based on corresponding encoder layer.
Method signatures and docstrings:
- def __init__(self, in_planes, out_planes=None): Constructor for TransitionUp Layer. Args: in_planes (int): Numb... | 51482281dc180786e7563c73c12ac5df89289748 | <|skeleton|>
class TransitionUp:
"""Decoder layer for PointTransformer. Interpolate points based on corresponding encoder layer."""
def __init__(self, in_planes, out_planes=None):
"""Constructor for TransitionUp Layer. Args: in_planes (int): Number of input planes. out_planes (int): Number of output pl... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TransitionUp:
"""Decoder layer for PointTransformer. Interpolate points based on corresponding encoder layer."""
def __init__(self, in_planes, out_planes=None):
"""Constructor for TransitionUp Layer. Args: in_planes (int): Number of input planes. out_planes (int): Number of output planes."""
... | the_stack_v2_python_sparse | ml3d/tf/models/point_transformer.py | CosmosHua/Open3D-ML | train | 0 |
1fb09479d283ae56c1cb1d847e6c3cdb77cec7b6 | [
"\"\"\"For Frequency Prescalar-0\"\"\"\nbus.write_byte_data(PCA9530_1C_DEFAULT_ADDRESS, PCA9530_1C_REG_PSC0, PCA9530_1C_PSC0_USERDEFINED)\n'For Frequency Prescalar-1'\nbus.write_byte_data(PCA9530_1C_DEFAULT_ADDRESS, PCA9530_1C_REG_PSC1, PCA9530_1C_PSC1_USERDEFINED)",
"\"\"\"For PWM Register-0\"\"\"\nbus.write_byt... | <|body_start_0|>
"""For Frequency Prescalar-0"""
bus.write_byte_data(PCA9530_1C_DEFAULT_ADDRESS, PCA9530_1C_REG_PSC0, PCA9530_1C_PSC0_USERDEFINED)
'For Frequency Prescalar-1'
bus.write_byte_data(PCA9530_1C_DEFAULT_ADDRESS, PCA9530_1C_REG_PSC1, PCA9530_1C_PSC1_USERDEFINED)
<|end_body_0|>
... | PCA9530_1C | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class PCA9530_1C:
def set_frequency(self):
"""Select the Frequency Prescalar Configuration from the given provided value"""
<|body_0|>
def set_pulse_width(self):
"""Select the PWM Register Configuration from the given provided value"""
<|body_1|>
def set_led_s... | stack_v2_sparse_classes_36k_train_024936 | 2,770 | no_license | [
{
"docstring": "Select the Frequency Prescalar Configuration from the given provided value",
"name": "set_frequency",
"signature": "def set_frequency(self)"
},
{
"docstring": "Select the PWM Register Configuration from the given provided value",
"name": "set_pulse_width",
"signature": "d... | 3 | stack_v2_sparse_classes_30k_test_000287 | Implement the Python class `PCA9530_1C` described below.
Class description:
Implement the PCA9530_1C class.
Method signatures and docstrings:
- def set_frequency(self): Select the Frequency Prescalar Configuration from the given provided value
- def set_pulse_width(self): Select the PWM Register Configuration from th... | Implement the Python class `PCA9530_1C` described below.
Class description:
Implement the PCA9530_1C class.
Method signatures and docstrings:
- def set_frequency(self): Select the Frequency Prescalar Configuration from the given provided value
- def set_pulse_width(self): Select the PWM Register Configuration from th... | 769c9ecc9171d65512e4cdca4c167872217a904a | <|skeleton|>
class PCA9530_1C:
def set_frequency(self):
"""Select the Frequency Prescalar Configuration from the given provided value"""
<|body_0|>
def set_pulse_width(self):
"""Select the PWM Register Configuration from the given provided value"""
<|body_1|>
def set_led_s... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class PCA9530_1C:
def set_frequency(self):
"""Select the Frequency Prescalar Configuration from the given provided value"""
"""For Frequency Prescalar-0"""
bus.write_byte_data(PCA9530_1C_DEFAULT_ADDRESS, PCA9530_1C_REG_PSC0, PCA9530_1C_PSC0_USERDEFINED)
'For Frequency Prescalar-1'
... | the_stack_v2_python_sparse | PCA9530_1C.py | ncdcommunity/PYTHON_LIBRARY | train | 0 | |
0640ba32b61874efa1387cc9cbac19b17a4a37a5 | [
"context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')",
"context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')",
"conte... | <|body_start_0|>
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
<|end_body_0|>
<|body_start_1|>
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not im... | submit transfer job | TransferSubmitServiceServicer | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TransferSubmitServiceServicer:
"""submit transfer job"""
def send(self, request, context):
"""send data"""
<|body_0|>
def recv(self, request, context):
"""receive data, i.e. wait for data to arrive"""
<|body_1|>
def checkStatusNow(self, request, cont... | stack_v2_sparse_classes_36k_train_024937 | 4,429 | permissive | [
{
"docstring": "send data",
"name": "send",
"signature": "def send(self, request, context)"
},
{
"docstring": "receive data, i.e. wait for data to arrive",
"name": "recv",
"signature": "def recv(self, request, context)"
},
{
"docstring": "check the transfer status, return immedia... | 4 | null | Implement the Python class `TransferSubmitServiceServicer` described below.
Class description:
submit transfer job
Method signatures and docstrings:
- def send(self, request, context): send data
- def recv(self, request, context): receive data, i.e. wait for data to arrive
- def checkStatusNow(self, request, context)... | Implement the Python class `TransferSubmitServiceServicer` described below.
Class description:
submit transfer job
Method signatures and docstrings:
- def send(self, request, context): send data
- def recv(self, request, context): receive data, i.e. wait for data to arrive
- def checkStatusNow(self, request, context)... | 67708d5d327e736d80e2f6726968cf02a926310e | <|skeleton|>
class TransferSubmitServiceServicer:
"""submit transfer job"""
def send(self, request, context):
"""send data"""
<|body_0|>
def recv(self, request, context):
"""receive data, i.e. wait for data to arrive"""
<|body_1|>
def checkStatusNow(self, request, cont... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TransferSubmitServiceServicer:
"""submit transfer job"""
def send(self, request, context):
"""send data"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def recv(self... | the_stack_v2_python_sparse | arch/api/proto/federation_pb2_grpc.py | liuheng2cqupt/FATE | train | 1 |
e1f2c067e1b18b0688adaa425b177c218225e8e7 | [
"super(Layer, self).__init__()\nself.unit_class = unit_class\nself.block_class = block_class\nself.blocks = blocks\nself.output_stride = output_stride\nself.in_channel = in_channel\nself.blocks_cell = []\nself.last_out_channel = self.in_channel\nself.intermediate_block = 3\nself.intermediate_unit = 12\nfor i, block... | <|body_start_0|>
super(Layer, self).__init__()
self.unit_class = unit_class
self.block_class = block_class
self.blocks = blocks
self.output_stride = output_stride
self.in_channel = in_channel
self.blocks_cell = []
self.last_out_channel = self.in_channel
... | Resnet Layer consisted of Block. | Layer | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-proprietary-license"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Layer:
"""Resnet Layer consisted of Block."""
def __init__(self, in_channel, blocks, output_stride=None, unit_class=Bottleneck, block_class=Block):
"""Args: in_channel: in channel blocks: blocks config. should be generated by _make_block output_stride: If None, then the output will b... | stack_v2_sparse_classes_36k_train_024938 | 11,719 | permissive | [
{
"docstring": "Args: in_channel: in channel blocks: blocks config. should be generated by _make_block output_stride: If None, then the output will be computed at the nominal network stride. If output_stride is not None, it specifies the requested ratio of input to output spatial resolution. unit_class: class o... | 2 | null | Implement the Python class `Layer` described below.
Class description:
Resnet Layer consisted of Block.
Method signatures and docstrings:
- def __init__(self, in_channel, blocks, output_stride=None, unit_class=Bottleneck, block_class=Block): Args: in_channel: in channel blocks: blocks config. should be generated by _... | Implement the Python class `Layer` described below.
Class description:
Resnet Layer consisted of Block.
Method signatures and docstrings:
- def __init__(self, in_channel, blocks, output_stride=None, unit_class=Bottleneck, block_class=Block): Args: in_channel: in channel blocks: blocks config. should be generated by _... | eab643f51336dbf7d711f02d27e6516e5affee59 | <|skeleton|>
class Layer:
"""Resnet Layer consisted of Block."""
def __init__(self, in_channel, blocks, output_stride=None, unit_class=Bottleneck, block_class=Block):
"""Args: in_channel: in channel blocks: blocks config. should be generated by _make_block output_stride: If None, then the output will b... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Layer:
"""Resnet Layer consisted of Block."""
def __init__(self, in_channel, blocks, output_stride=None, unit_class=Bottleneck, block_class=Block):
"""Args: in_channel: in channel blocks: blocks config. should be generated by _make_block output_stride: If None, then the output will be computed at... | the_stack_v2_python_sparse | research/cv/ArtTrack/src/model/resnet/resnet.py | mindspore-ai/models | train | 301 |
ed74a996403e2a6a226e3213476e354864dcfb4b | [
"xdata = np.array(x_vect)\nxdata = xdata - x_vect[0]\nydata = np.array(y_vect)\npopt, pcov = curve_fit(sigmoidscaled, xdata, ydata)\nx = np.linspace(-0.5, len(xdata), CURVE_STEP)\ny = sigmoidscaled(x, *popt)\nfit_y = sigmoidscaled(xdata, *popt)\nreturn (popt, pcov, x + x_vect[0], y, fit_y)",
"xdata = np.array(x_v... | <|body_start_0|>
xdata = np.array(x_vect)
xdata = xdata - x_vect[0]
ydata = np.array(y_vect)
popt, pcov = curve_fit(sigmoidscaled, xdata, ydata)
x = np.linspace(-0.5, len(xdata), CURVE_STEP)
y = sigmoidscaled(x, *popt)
fit_y = sigmoidscaled(xdata, *popt)
r... | CurveFit | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class CurveFit:
def sigm_fit(x_vect, y_vect):
"""Function: sigmond fit @arguments: (in) [x_vect, y_vect]: data for curve_fit (out) popt: Optimal values for the parameters so that the sum of the squared error of f(xdata, *popt) pcov: The estimated covariance of popt. perr = np.sqrt(np.diag(pcov... | stack_v2_sparse_classes_36k_train_024939 | 3,323 | no_license | [
{
"docstring": "Function: sigmond fit @arguments: (in) [x_vect, y_vect]: data for curve_fit (out) popt: Optimal values for the parameters so that the sum of the squared error of f(xdata, *popt) pcov: The estimated covariance of popt. perr = np.sqrt(np.diag(pcov)). [x, y, fit_y]: x, y used for plot curve, and fi... | 3 | stack_v2_sparse_classes_30k_train_017772 | Implement the Python class `CurveFit` described below.
Class description:
Implement the CurveFit class.
Method signatures and docstrings:
- def sigm_fit(x_vect, y_vect): Function: sigmond fit @arguments: (in) [x_vect, y_vect]: data for curve_fit (out) popt: Optimal values for the parameters so that the sum of the squ... | Implement the Python class `CurveFit` described below.
Class description:
Implement the CurveFit class.
Method signatures and docstrings:
- def sigm_fit(x_vect, y_vect): Function: sigmond fit @arguments: (in) [x_vect, y_vect]: data for curve_fit (out) popt: Optimal values for the parameters so that the sum of the squ... | 03ff57e6fe0114ffd2dd953e79a73a893a6bc0ad | <|skeleton|>
class CurveFit:
def sigm_fit(x_vect, y_vect):
"""Function: sigmond fit @arguments: (in) [x_vect, y_vect]: data for curve_fit (out) popt: Optimal values for the parameters so that the sum of the squared error of f(xdata, *popt) pcov: The estimated covariance of popt. perr = np.sqrt(np.diag(pcov... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class CurveFit:
def sigm_fit(x_vect, y_vect):
"""Function: sigmond fit @arguments: (in) [x_vect, y_vect]: data for curve_fit (out) popt: Optimal values for the parameters so that the sum of the squared error of f(xdata, *popt) pcov: The estimated covariance of popt. perr = np.sqrt(np.diag(pcov)). [x, y, fit... | the_stack_v2_python_sparse | GIS_DataAnalysis/proj_py/src/curve_fit.py | samuelxu999/Research | train | 1 | |
1cddffceea8ffd47f4e54535f5127b72d5be3442 | [
"shutil.copy('build/MakePAR', 'source/Makefile')\nos.chdir('source')\nself.cfg.update('makeopts', 'LD=\"$MPIF90 -o\" FC=\"$MPIF90 -c\" par')",
"self.log.debug('copying %s/execute to %s, (from %s)', self.cfg['start_dir'], self.installdir, os.getcwd())\nbin_path = os.path.join(self.installdir, 'bin')\ninstall_path ... | <|body_start_0|>
shutil.copy('build/MakePAR', 'source/Makefile')
os.chdir('source')
self.cfg.update('makeopts', 'LD="$MPIF90 -o" FC="$MPIF90 -c" par')
<|end_body_0|>
<|body_start_1|>
self.log.debug('copying %s/execute to %s, (from %s)', self.cfg['start_dir'], self.installdir, os.getcwd(... | Support for building and installing DL_POLY Classic. | EB_DL_underscore_POLY_underscore_Classic | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class EB_DL_underscore_POLY_underscore_Classic:
"""Support for building and installing DL_POLY Classic."""
def configure_step(self):
"""Copy the makefile to the source directory and use MPIF90 to do a parrallel build"""
<|body_0|>
def install_step(self):
"""Copy the ex... | stack_v2_sparse_classes_36k_train_024940 | 2,190 | no_license | [
{
"docstring": "Copy the makefile to the source directory and use MPIF90 to do a parrallel build",
"name": "configure_step",
"signature": "def configure_step(self)"
},
{
"docstring": "Copy the executables to the installation directory",
"name": "install_step",
"signature": "def install_s... | 2 | null | Implement the Python class `EB_DL_underscore_POLY_underscore_Classic` described below.
Class description:
Support for building and installing DL_POLY Classic.
Method signatures and docstrings:
- def configure_step(self): Copy the makefile to the source directory and use MPIF90 to do a parrallel build
- def install_st... | Implement the Python class `EB_DL_underscore_POLY_underscore_Classic` described below.
Class description:
Support for building and installing DL_POLY Classic.
Method signatures and docstrings:
- def configure_step(self): Copy the makefile to the source directory and use MPIF90 to do a parrallel build
- def install_st... | 3c5434f9a4193fbe4cf8107327faadda83d798ae | <|skeleton|>
class EB_DL_underscore_POLY_underscore_Classic:
"""Support for building and installing DL_POLY Classic."""
def configure_step(self):
"""Copy the makefile to the source directory and use MPIF90 to do a parrallel build"""
<|body_0|>
def install_step(self):
"""Copy the ex... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class EB_DL_underscore_POLY_underscore_Classic:
"""Support for building and installing DL_POLY Classic."""
def configure_step(self):
"""Copy the makefile to the source directory and use MPIF90 to do a parrallel build"""
shutil.copy('build/MakePAR', 'source/Makefile')
os.chdir('source')
... | the_stack_v2_python_sparse | 1.11.1/easyblock/easyblocks/d/dl_poly_classic.py | lsuhpchelp/easybuild_smic | train | 0 |
e8cdd5a31a81ba6252d02232dcdcd7d0d602c153 | [
"if campo is None:\n return ''\nif campo in request.POST:\n return request.POST[campo].strip().encode('utf8')\nreturn ''",
"if campo is None:\n return ''\nif campo in request.FILES:\n return request.FILES[campo]\nreturn ''"
] | <|body_start_0|>
if campo is None:
return ''
if campo in request.POST:
return request.POST[campo].strip().encode('utf8')
return ''
<|end_body_0|>
<|body_start_1|>
if campo is None:
return ''
if campo in request.FILES:
return reques... | UtilsForAll | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class UtilsForAll:
def getfromPost(self, request, campo=None):
"""Given a field return its value if exists. Return an empty string otherwise."""
<|body_0|>
def getfilefromPost(self, request, campo=None):
"""Given a field return its value if exists. Return an empty string o... | stack_v2_sparse_classes_36k_train_024941 | 914 | no_license | [
{
"docstring": "Given a field return its value if exists. Return an empty string otherwise.",
"name": "getfromPost",
"signature": "def getfromPost(self, request, campo=None)"
},
{
"docstring": "Given a field return its value if exists. Return an empty string otherwise.",
"name": "getfilefrom... | 2 | stack_v2_sparse_classes_30k_train_000307 | Implement the Python class `UtilsForAll` described below.
Class description:
Implement the UtilsForAll class.
Method signatures and docstrings:
- def getfromPost(self, request, campo=None): Given a field return its value if exists. Return an empty string otherwise.
- def getfilefromPost(self, request, campo=None): Gi... | Implement the Python class `UtilsForAll` described below.
Class description:
Implement the UtilsForAll class.
Method signatures and docstrings:
- def getfromPost(self, request, campo=None): Given a field return its value if exists. Return an empty string otherwise.
- def getfilefromPost(self, request, campo=None): Gi... | 7a390f98fec62825360c462f65944018ace7c265 | <|skeleton|>
class UtilsForAll:
def getfromPost(self, request, campo=None):
"""Given a field return its value if exists. Return an empty string otherwise."""
<|body_0|>
def getfilefromPost(self, request, campo=None):
"""Given a field return its value if exists. Return an empty string o... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class UtilsForAll:
def getfromPost(self, request, campo=None):
"""Given a field return its value if exists. Return an empty string otherwise."""
if campo is None:
return ''
if campo in request.POST:
return request.POST[campo].strip().encode('utf8')
return ''
... | the_stack_v2_python_sparse | Welpe/site_utils.py | itziar/Welpe | train | 1 | |
6a809bd3315be49bdedc90ede2e165d0b3d87ed8 | [
"Action.__init__(self, p_game_state)\nassert isinstance(p_player_id, int)\nassert PLAYER_PER_TEAM >= p_player_id >= 0\nassert isinstance(p_force, (int, float))\nassert KICK_MAX_SPD >= p_force >= 0\nself.player_id = p_player_id\nself.force = p_force\nself.target = target\nself.speed_pose = Pose()",
"target = self.... | <|body_start_0|>
Action.__init__(self, p_game_state)
assert isinstance(p_player_id, int)
assert PLAYER_PER_TEAM >= p_player_id >= 0
assert isinstance(p_force, (int, float))
assert KICK_MAX_SPD >= p_force >= 0
self.player_id = p_player_id
self.force = p_force
... | Action Kick: Actionne le kick du robot Méthodes : exec(self): Retourne la position actuelle et une force de kick Attributs (en plus de ceux de Action): player_id : L'identifiant du joueur qui doit frapper la balle | Kick | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Kick:
"""Action Kick: Actionne le kick du robot Méthodes : exec(self): Retourne la position actuelle et une force de kick Attributs (en plus de ceux de Action): player_id : L'identifiant du joueur qui doit frapper la balle"""
def __init__(self, p_game_state, p_player_id, p_force, target=Pose... | stack_v2_sparse_classes_36k_train_024942 | 2,199 | permissive | [
{
"docstring": ":param p_game_state: L'état courant du jeu. :param p_player_id: Identifiant du joueur qui frappe la balle :param p_force: force du kicker (float entre 0 et 1)",
"name": "__init__",
"signature": "def __init__(self, p_game_state, p_player_id, p_force, target=Pose())"
},
{
"docstrin... | 2 | stack_v2_sparse_classes_30k_train_000442 | Implement the Python class `Kick` described below.
Class description:
Action Kick: Actionne le kick du robot Méthodes : exec(self): Retourne la position actuelle et une force de kick Attributs (en plus de ceux de Action): player_id : L'identifiant du joueur qui doit frapper la balle
Method signatures and docstrings:
... | Implement the Python class `Kick` described below.
Class description:
Action Kick: Actionne le kick du robot Méthodes : exec(self): Retourne la position actuelle et une force de kick Attributs (en plus de ceux de Action): player_id : L'identifiant du joueur qui doit frapper la balle
Method signatures and docstrings:
... | 7e20de8b2213d9b9b46be16d6b4800d767da1b00 | <|skeleton|>
class Kick:
"""Action Kick: Actionne le kick du robot Méthodes : exec(self): Retourne la position actuelle et une force de kick Attributs (en plus de ceux de Action): player_id : L'identifiant du joueur qui doit frapper la balle"""
def __init__(self, p_game_state, p_player_id, p_force, target=Pose... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Kick:
"""Action Kick: Actionne le kick du robot Méthodes : exec(self): Retourne la position actuelle et une force de kick Attributs (en plus de ceux de Action): player_id : L'identifiant du joueur qui doit frapper la balle"""
def __init__(self, p_game_state, p_player_id, p_force, target=Pose()):
... | the_stack_v2_python_sparse | ai/STA/Action/Kick.py | etibuteau/StrategyIA | train | 0 |
95f84fd12c584fdd90fb54d9f5b193c0c61bb680 | [
"try:\n return Question.objects.get(pk=pk)\nexcept Question.DoesNotExist:\n raise NotFound(detail='Invalid Question ID specified')",
"question = self.get_object(pk)\nserializer = CreateQuestionSerializer(question)\nreturn Response(serializer.data)",
"question = self.get_object(pk)\nserializer = EditQuesti... | <|body_start_0|>
try:
return Question.objects.get(pk=pk)
except Question.DoesNotExist:
raise NotFound(detail='Invalid Question ID specified')
<|end_body_0|>
<|body_start_1|>
question = self.get_object(pk)
serializer = CreateQuestionSerializer(question)
re... | API to get specific user created question Requests handled: GET, PUT, DELETE | CustomQuestionListView | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class CustomQuestionListView:
"""API to get specific user created question Requests handled: GET, PUT, DELETE"""
def get_object(self, pk):
"""Check if question with specific ID exists :param pk: id of question to retrieve :return: Question object if id exists :raises: NotFound if id does n... | stack_v2_sparse_classes_36k_train_024943 | 30,034 | no_license | [
{
"docstring": "Check if question with specific ID exists :param pk: id of question to retrieve :return: Question object if id exists :raises: NotFound if id does not exist",
"name": "get_object",
"signature": "def get_object(self, pk)"
},
{
"docstring": "GET request handler. :param pk: id of qu... | 4 | stack_v2_sparse_classes_30k_train_019648 | Implement the Python class `CustomQuestionListView` described below.
Class description:
API to get specific user created question Requests handled: GET, PUT, DELETE
Method signatures and docstrings:
- def get_object(self, pk): Check if question with specific ID exists :param pk: id of question to retrieve :return: Qu... | Implement the Python class `CustomQuestionListView` described below.
Class description:
API to get specific user created question Requests handled: GET, PUT, DELETE
Method signatures and docstrings:
- def get_object(self, pk): Check if question with specific ID exists :param pk: id of question to retrieve :return: Qu... | ea0e59de38505beba3b490a3b107f884b35986fd | <|skeleton|>
class CustomQuestionListView:
"""API to get specific user created question Requests handled: GET, PUT, DELETE"""
def get_object(self, pk):
"""Check if question with specific ID exists :param pk: id of question to retrieve :return: Question object if id exists :raises: NotFound if id does n... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class CustomQuestionListView:
"""API to get specific user created question Requests handled: GET, PUT, DELETE"""
def get_object(self, pk):
"""Check if question with specific ID exists :param pk: id of question to retrieve :return: Question object if id exists :raises: NotFound if id does not exist"""
... | the_stack_v2_python_sparse | main/views.py | weixingp/slay-the-software-backend | train | 0 |
152527549d4db4d470986793121a90077e9ec0e8 | [
"if not self:\n raise KeyError(self.__class__.__name__ + ' is empty')\nkey = next((reversed if last else iter)(self))\nval = self._pop(key)\nreturn (key, val)",
"node = self.fwdm[key]\n_, prv, nxt = node\nprv[_NXT] = nxt\nnxt[_PRV] = prv\nsntl = self.sntl\nif last:\n last = sntl[_PRV]\n node[_PRV] = last... | <|body_start_0|>
if not self:
raise KeyError(self.__class__.__name__ + ' is empty')
key = next((reversed if last else iter)(self))
val = self._pop(key)
return (key, val)
<|end_body_0|>
<|body_start_1|>
node = self.fwdm[key]
_, prv, nxt = node
prv[_NXT... | Mutable bidict type that maintains items in insertion order. | OrderedBidict | [
"BSD-2-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class OrderedBidict:
"""Mutable bidict type that maintains items in insertion order."""
def popitem(self, last=True):
"""Like :meth:`collections.OrderedDict.popitem`."""
<|body_0|>
def move_to_end(self, key, last=True):
"""Like :meth:`collections.OrderedDict.move_to_en... | stack_v2_sparse_classes_36k_train_024944 | 9,654 | permissive | [
{
"docstring": "Like :meth:`collections.OrderedDict.popitem`.",
"name": "popitem",
"signature": "def popitem(self, last=True)"
},
{
"docstring": "Like :meth:`collections.OrderedDict.move_to_end`.",
"name": "move_to_end",
"signature": "def move_to_end(self, key, last=True)"
}
] | 2 | null | Implement the Python class `OrderedBidict` described below.
Class description:
Mutable bidict type that maintains items in insertion order.
Method signatures and docstrings:
- def popitem(self, last=True): Like :meth:`collections.OrderedDict.popitem`.
- def move_to_end(self, key, last=True): Like :meth:`collections.O... | Implement the Python class `OrderedBidict` described below.
Class description:
Mutable bidict type that maintains items in insertion order.
Method signatures and docstrings:
- def popitem(self, last=True): Like :meth:`collections.OrderedDict.popitem`.
- def move_to_end(self, key, last=True): Like :meth:`collections.O... | 43fb2f19aeed57a8a9d9af032ee80f1c9f58516d | <|skeleton|>
class OrderedBidict:
"""Mutable bidict type that maintains items in insertion order."""
def popitem(self, last=True):
"""Like :meth:`collections.OrderedDict.popitem`."""
<|body_0|>
def move_to_end(self, key, last=True):
"""Like :meth:`collections.OrderedDict.move_to_en... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class OrderedBidict:
"""Mutable bidict type that maintains items in insertion order."""
def popitem(self, last=True):
"""Like :meth:`collections.OrderedDict.popitem`."""
if not self:
raise KeyError(self.__class__.__name__ + ' is empty')
key = next((reversed if last else iter... | the_stack_v2_python_sparse | build/lib/tnetwork/utils/bidict/_ordered.py | Yquetzal/tnetwork | train | 13 |
79018f99c43d9acb3717d20a86edbd2675c4c362 | [
"super(SubGraph, self).__init__()\nself.layers_number = layersNumber\nself.layers = nn.ModuleList([SubGraphLayer(feature_length * 2 ** i) for i in range(self.layers_number)])",
"for layer in self.layers:\n x = layer(x)\nx = x.permute(0, 2, 1)\nx = F.max_pool1d(x, kernel_size=x.shape[2])\nx = x.permute(0, 2, 1)... | <|body_start_0|>
super(SubGraph, self).__init__()
self.layers_number = layersNumber
self.layers = nn.ModuleList([SubGraphLayer(feature_length * 2 ** i) for i in range(self.layers_number)])
<|end_body_0|>
<|body_start_1|>
for layer in self.layers:
x = layer(x)
x = x.p... | Subgraph of VectorNet. This network accept a number of initiated vectors belong to the same polyline, flow three layers of network, then output this polyline's feature vector. | SubGraph | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SubGraph:
"""Subgraph of VectorNet. This network accept a number of initiated vectors belong to the same polyline, flow three layers of network, then output this polyline's feature vector."""
def __init__(self, feature_length, layersNumber):
"""Given all vectors of this polyline, we ... | stack_v2_sparse_classes_36k_train_024945 | 3,612 | no_license | [
{
"docstring": "Given all vectors of this polyline, we should build a 3-layers subgraph network, get the output which is the polyline's feature vector. :param feature_length: the length of vector. :param layersNumber: the number of subgraph network.",
"name": "__init__",
"signature": "def __init__(self,... | 2 | stack_v2_sparse_classes_30k_train_004673 | Implement the Python class `SubGraph` described below.
Class description:
Subgraph of VectorNet. This network accept a number of initiated vectors belong to the same polyline, flow three layers of network, then output this polyline's feature vector.
Method signatures and docstrings:
- def __init__(self, feature_lengt... | Implement the Python class `SubGraph` described below.
Class description:
Subgraph of VectorNet. This network accept a number of initiated vectors belong to the same polyline, flow three layers of network, then output this polyline's feature vector.
Method signatures and docstrings:
- def __init__(self, feature_lengt... | 0a314f7bdfc6db0247c92bc2c5c3806fdd18b885 | <|skeleton|>
class SubGraph:
"""Subgraph of VectorNet. This network accept a number of initiated vectors belong to the same polyline, flow three layers of network, then output this polyline's feature vector."""
def __init__(self, feature_length, layersNumber):
"""Given all vectors of this polyline, we ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SubGraph:
"""Subgraph of VectorNet. This network accept a number of initiated vectors belong to the same polyline, flow three layers of network, then output this polyline's feature vector."""
def __init__(self, feature_length, layersNumber):
"""Given all vectors of this polyline, we should build ... | the_stack_v2_python_sparse | sub_graph.py | JieFeng-cse/dynamic_driving | train | 1 |
20dbeed40bbf3a52d73b62441485b43c7ba64eb3 | [
"self.encoding = encoding\nself.object_hook = object_hook\nself.object_pairs_hook = object_pairs_hook\nself.parse_float = parse_float or float\nself.parse_int = parse_int or int\nself.parse_constant = parse_constant or _CONSTANTS.__getitem__\nself.strict = strict\nself.parse_object = JSONObject\nself.parse_array = ... | <|body_start_0|>
self.encoding = encoding
self.object_hook = object_hook
self.object_pairs_hook = object_pairs_hook
self.parse_float = parse_float or float
self.parse_int = parse_int or int
self.parse_constant = parse_constant or _CONSTANTS.__getitem__
self.strict... | Simple JSON <http://json.org> decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | unicod... | JSONDecoder | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class JSONDecoder:
"""Simple JSON <http://json.org> decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------... | stack_v2_sparse_classes_36k_train_024946 | 47,385 | no_license | [
{
"docstring": "``encoding`` determines the encoding used to interpret any ``str`` objects decoded by this instance (utf-8 by default). It has no effect when decoding ``unicode`` objects. Note that currently only encodings that are a superset of ASCII work, strings of other encodings should be passed in as ``un... | 3 | stack_v2_sparse_classes_30k_train_008770 | Implement the Python class `JSONDecoder` described below.
Class description:
Simple JSON <http://json.org> decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+---------------... | Implement the Python class `JSONDecoder` described below.
Class description:
Simple JSON <http://json.org> decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+---------------... | 1f5295cd6114f3f18958be0e0618ff6b35aa16d7 | <|skeleton|>
class JSONDecoder:
"""Simple JSON <http://json.org> decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class JSONDecoder:
"""Simple JSON <http://json.org> decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+------------... | the_stack_v2_python_sparse | packages/python_compat_json.py | grid-control/grid-control | train | 32 |
74b26613aa5e69863760bfda100f0ba2940b51c4 | [
"super().__init__(**kwargs)\nself.attention = TFFastSpeechAttention(config, name='attention')\nself.intermediate = TFFastSpeechIntermediate(config, name='intermediate')\nself.bert_output = TFFastSpeechOutput(config, name='output')",
"hidden_states, key, attention_mask, mel_mask = inputs\nattention_outputs = self.... | <|body_start_0|>
super().__init__(**kwargs)
self.attention = TFFastSpeechAttention(config, name='attention')
self.intermediate = TFFastSpeechIntermediate(config, name='intermediate')
self.bert_output = TFFastSpeechOutput(config, name='output')
<|end_body_0|>
<|body_start_1|>
hid... | Fastspeech module (FFT module on the paper). | TFFastSpeechLayer | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TFFastSpeechLayer:
"""Fastspeech module (FFT module on the paper)."""
def __init__(self, config, **kwargs):
"""Init variables."""
<|body_0|>
def call(self, inputs, training=False):
"""Call logic."""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
s... | stack_v2_sparse_classes_36k_train_024947 | 17,606 | permissive | [
{
"docstring": "Init variables.",
"name": "__init__",
"signature": "def __init__(self, config, **kwargs)"
},
{
"docstring": "Call logic.",
"name": "call",
"signature": "def call(self, inputs, training=False)"
}
] | 2 | null | Implement the Python class `TFFastSpeechLayer` described below.
Class description:
Fastspeech module (FFT module on the paper).
Method signatures and docstrings:
- def __init__(self, config, **kwargs): Init variables.
- def call(self, inputs, training=False): Call logic. | Implement the Python class `TFFastSpeechLayer` described below.
Class description:
Fastspeech module (FFT module on the paper).
Method signatures and docstrings:
- def __init__(self, config, **kwargs): Init variables.
- def call(self, inputs, training=False): Call logic.
<|skeleton|>
class TFFastSpeechLayer:
"""... | 4343c409340c608a426cc6f0926fbe2c1661783e | <|skeleton|>
class TFFastSpeechLayer:
"""Fastspeech module (FFT module on the paper)."""
def __init__(self, config, **kwargs):
"""Init variables."""
<|body_0|>
def call(self, inputs, training=False):
"""Call logic."""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TFFastSpeechLayer:
"""Fastspeech module (FFT module on the paper)."""
def __init__(self, config, **kwargs):
"""Init variables."""
super().__init__(**kwargs)
self.attention = TFFastSpeechAttention(config, name='attention')
self.intermediate = TFFastSpeechIntermediate(config... | the_stack_v2_python_sparse | malaya_speech/train/model/fastspeech/model_aligner.py | Ariffleng/malaya-speech | train | 0 |
e50314a6f6694749ed830953b02e0d676daa830d | [
"if location is None:\n self.location = [0, 0]\nelse:\n self.location = double_gis_util.validate_location(location)\nself.popup = popup.replace(\"'\", '^') if isinstance(popup, str) else popup\nself.tooltip = tooltip.replace(\"'\", '^') if isinstance(tooltip, str) else tooltip\nself.icon = marker_icon.getMark... | <|body_start_0|>
if location is None:
self.location = [0, 0]
else:
self.location = double_gis_util.validate_location(location)
self.popup = popup.replace("'", '^') if isinstance(popup, str) else popup
self.tooltip = tooltip.replace("'", '^') if isinstance(tooltip,... | Pin marker. | iq2GISMarker | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class iq2GISMarker:
"""Pin marker."""
def __init__(self, location, popup=None, tooltip=None, icon=None, **kwargs):
"""Constructor. :param location: Marker geolocation. :param popup: Marker pop-up text. A tooltip appears by clicking on the marker. :param tooltip: Marker pop-up text. A toolt... | stack_v2_sparse_classes_36k_train_024948 | 3,242 | no_license | [
{
"docstring": "Constructor. :param location: Marker geolocation. :param popup: Marker pop-up text. A tooltip appears by clicking on the marker. :param tooltip: Marker pop-up text. A tooltip appears when you hover the mouse over the marker. :param icon: Icon.",
"name": "__init__",
"signature": "def __in... | 3 | null | Implement the Python class `iq2GISMarker` described below.
Class description:
Pin marker.
Method signatures and docstrings:
- def __init__(self, location, popup=None, tooltip=None, icon=None, **kwargs): Constructor. :param location: Marker geolocation. :param popup: Marker pop-up text. A tooltip appears by clicking o... | Implement the Python class `iq2GISMarker` described below.
Class description:
Pin marker.
Method signatures and docstrings:
- def __init__(self, location, popup=None, tooltip=None, icon=None, **kwargs): Constructor. :param location: Marker geolocation. :param popup: Marker pop-up text. A tooltip appears by clicking o... | 7550e242746cb2fb1219474463f8db21f8e3e114 | <|skeleton|>
class iq2GISMarker:
"""Pin marker."""
def __init__(self, location, popup=None, tooltip=None, icon=None, **kwargs):
"""Constructor. :param location: Marker geolocation. :param popup: Marker pop-up text. A tooltip appears by clicking on the marker. :param tooltip: Marker pop-up text. A toolt... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class iq2GISMarker:
"""Pin marker."""
def __init__(self, location, popup=None, tooltip=None, icon=None, **kwargs):
"""Constructor. :param location: Marker geolocation. :param popup: Marker pop-up text. A tooltip appears by clicking on the marker. :param tooltip: Marker pop-up text. A tooltip appears wh... | the_stack_v2_python_sparse | iq/components/doublegis_indicator_manager/pin_marker.py | XHermitOne/iq_framework | train | 1 |
633cf26eb6abb94ff51f7787063018b535f06d38 | [
"self.language = language\nself.text = text\nself.sender = sender\nself.additional_properties = additional_properties",
"if dictionary is None:\n return None\nlanguage = dictionary.get('language')\ntext = dictionary.get('text')\nsender = dictionary.get('sender')\nfor key in cls._names.values():\n if key in ... | <|body_start_0|>
self.language = language
self.text = text
self.sender = sender
self.additional_properties = additional_properties
<|end_body_0|>
<|body_start_1|>
if dictionary is None:
return None
language = dictionary.get('language')
text = dictiona... | Implementation of the 'SMS' model. TODO: type model description here. Attributes: language (Language185): Sms language text (string): Sms text sender (string): Sender name | SMS | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SMS:
"""Implementation of the 'SMS' model. TODO: type model description here. Attributes: language (Language185): Sms language text (string): Sms text sender (string): Sender name"""
def __init__(self, language=None, text=None, sender=None, additional_properties={}):
"""Constructor f... | stack_v2_sparse_classes_36k_train_024949 | 2,135 | permissive | [
{
"docstring": "Constructor for the SMS class",
"name": "__init__",
"signature": "def __init__(self, language=None, text=None, sender=None, additional_properties={})"
},
{
"docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation... | 2 | null | Implement the Python class `SMS` described below.
Class description:
Implementation of the 'SMS' model. TODO: type model description here. Attributes: language (Language185): Sms language text (string): Sms text sender (string): Sender name
Method signatures and docstrings:
- def __init__(self, language=None, text=No... | Implement the Python class `SMS` described below.
Class description:
Implementation of the 'SMS' model. TODO: type model description here. Attributes: language (Language185): Sms language text (string): Sms text sender (string): Sender name
Method signatures and docstrings:
- def __init__(self, language=None, text=No... | fa3918a6c54ea0eedb9146578645b7eb1755b642 | <|skeleton|>
class SMS:
"""Implementation of the 'SMS' model. TODO: type model description here. Attributes: language (Language185): Sms language text (string): Sms text sender (string): Sender name"""
def __init__(self, language=None, text=None, sender=None, additional_properties={}):
"""Constructor f... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SMS:
"""Implementation of the 'SMS' model. TODO: type model description here. Attributes: language (Language185): Sms language text (string): Sms text sender (string): Sender name"""
def __init__(self, language=None, text=None, sender=None, additional_properties={}):
"""Constructor for the SMS cl... | the_stack_v2_python_sparse | idfy_rest_client/models/sms.py | dealflowteam/Idfy | train | 0 |
0e141e4c27d08eb480edb9cf953af024358d7921 | [
"selector = 'view.pay-bottom>view.pay-content>view.pay-price.text'\nel_texts = self.page.get_elements(selector)\nreturn el_texts[1]",
"selector = 'view.pay-bottom>view.pay-content>view.pay-btn.text'\ninner_text = '提交订单'\nreturn self.page.get_element(selector, inner_text=inner_text)"
] | <|body_start_0|>
selector = 'view.pay-bottom>view.pay-content>view.pay-price.text'
el_texts = self.page.get_elements(selector)
return el_texts[1]
<|end_body_0|>
<|body_start_1|>
selector = 'view.pay-bottom>view.pay-content>view.pay-btn.text'
inner_text = '提交订单'
return se... | Elements | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Elements:
def total_amount(self):
"""合计金额"""
<|body_0|>
def submit(self):
"""提交订单按钮"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
selector = 'view.pay-bottom>view.pay-content>view.pay-price.text'
el_texts = self.page.get_elements(selector)... | stack_v2_sparse_classes_36k_train_024950 | 1,295 | no_license | [
{
"docstring": "合计金额",
"name": "total_amount",
"signature": "def total_amount(self)"
},
{
"docstring": "提交订单按钮",
"name": "submit",
"signature": "def submit(self)"
}
] | 2 | stack_v2_sparse_classes_30k_train_001433 | Implement the Python class `Elements` described below.
Class description:
Implement the Elements class.
Method signatures and docstrings:
- def total_amount(self): 合计金额
- def submit(self): 提交订单按钮 | Implement the Python class `Elements` described below.
Class description:
Implement the Elements class.
Method signatures and docstrings:
- def total_amount(self): 合计金额
- def submit(self): 提交订单按钮
<|skeleton|>
class Elements:
def total_amount(self):
"""合计金额"""
<|body_0|>
def submit(self):
... | 3011071556a3fa097d951a1823a4870cc4cc81e1 | <|skeleton|>
class Elements:
def total_amount(self):
"""合计金额"""
<|body_0|>
def submit(self):
"""提交订单按钮"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Elements:
def total_amount(self):
"""合计金额"""
selector = 'view.pay-bottom>view.pay-content>view.pay-price.text'
el_texts = self.page.get_elements(selector)
return el_texts[1]
def submit(self):
"""提交订单按钮"""
selector = 'view.pay-bottom>view.pay-content>view.pa... | the_stack_v2_python_sparse | sevenautotest/testobjects/pages/apppages/yy/confirm_order_page.py | hotswwkyo/SevenPytest | train | 3 | |
51fec0c1da2e974523fe0fa284ad1a8515876935 | [
"host = f'{account_name}.obsrvbl.com'\nsuper().__init__(host=host)\nself.base_url = f'https://{self.host}/api/v3'\nself.headers['Authorization'] = f'ApiKey {email}:{api_key}'",
"account_name = os.environ.get('SWC_ACCOUNT')\nif not account_name:\n raise ValueError('Env var SWC_ACCOUNT not specified')\nemail = o... | <|body_start_0|>
host = f'{account_name}.obsrvbl.com'
super().__init__(host=host)
self.base_url = f'https://{self.host}/api/v3'
self.headers['Authorization'] = f'ApiKey {email}:{api_key}'
<|end_body_0|>
<|body_start_1|>
account_name = os.environ.get('SWC_ACCOUNT')
if not... | Declaration of Cisco Stealthwatch Cloud (SWC) SDK class. | CiscoSWCloud | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class CiscoSWCloud:
"""Declaration of Cisco Stealthwatch Cloud (SWC) SDK class."""
def __init__(self, account_name, email, api_key):
"""Constructor to create a new object. SWC uses a custom Authorization header (similar to HTTP basic auth) with the user's email address and API key"""
... | stack_v2_sparse_classes_36k_train_024951 | 2,015 | no_license | [
{
"docstring": "Constructor to create a new object. SWC uses a custom Authorization header (similar to HTTP basic auth) with the user's email address and API key",
"name": "__init__",
"signature": "def __init__(self, account_name, email, api_key)"
},
{
"docstring": "Static class-level helper met... | 2 | null | Implement the Python class `CiscoSWCloud` described below.
Class description:
Declaration of Cisco Stealthwatch Cloud (SWC) SDK class.
Method signatures and docstrings:
- def __init__(self, account_name, email, api_key): Constructor to create a new object. SWC uses a custom Authorization header (similar to HTTP basic... | Implement the Python class `CiscoSWCloud` described below.
Class description:
Declaration of Cisco Stealthwatch Cloud (SWC) SDK class.
Method signatures and docstrings:
- def __init__(self, account_name, email, api_key): Constructor to create a new object. SWC uses a custom Authorization header (similar to HTTP basic... | 37aeff8e5cb5de99506195fce3d9bb119041cc2b | <|skeleton|>
class CiscoSWCloud:
"""Declaration of Cisco Stealthwatch Cloud (SWC) SDK class."""
def __init__(self, account_name, email, api_key):
"""Constructor to create a new object. SWC uses a custom Authorization header (similar to HTTP basic auth) with the user's email address and API key"""
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class CiscoSWCloud:
"""Declaration of Cisco Stealthwatch Cloud (SWC) SDK class."""
def __init__(self, account_name, email, api_key):
"""Constructor to create a new object. SWC uses a custom Authorization header (similar to HTTP basic auth) with the user's email address and API key"""
host = f'{... | the_stack_v2_python_sparse | sauto3/m3/cisco_sw_cloud.py | ncnetworkcloud/pluralsight | train | 0 |
5c6395936796ea51dc5732efb296c5de2ccee48d | [
"gtk.ComboBoxEntry.__init__(self)\nself.props.width_request = width\nself.props.height_request = height\n_list = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING)\nself.set_model(_list)\nself.set_text_column(0)\nself.set_tooltip_markup(tooltip)\nself.show()",
"_return = False\n_model = ... | <|body_start_0|>
gtk.ComboBoxEntry.__init__(self)
self.props.width_request = width
self.props.height_request = height
_list = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING)
self.set_model(_list)
self.set_text_column(0)
self.set_toolti... | This is the RAMSTK ComboBox with Entry class. | RAMSTKComboBoxEntry | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class RAMSTKComboBoxEntry:
"""This is the RAMSTK ComboBox with Entry class."""
def __init__(self, width=200, height=30, tooltip='RAMSTK WARNING: Missing tooltip. Please register an Enhancement type bug.'):
"""Create RAMSTK Combo widgets. :keyword int width: width of the gtk.ComboBox() wid... | stack_v2_sparse_classes_36k_train_024952 | 6,449 | permissive | [
{
"docstring": "Create RAMSTK Combo widgets. :keyword int width: width of the gtk.ComboBox() widget. Default is 200. :keyword int height: height of the gtk.ComboBox() widget. Default is 30. :keyword bool simple: indicates whether the gtk.ComboBox() contains only the display information or if there is additional... | 2 | stack_v2_sparse_classes_30k_train_000444 | Implement the Python class `RAMSTKComboBoxEntry` described below.
Class description:
This is the RAMSTK ComboBox with Entry class.
Method signatures and docstrings:
- def __init__(self, width=200, height=30, tooltip='RAMSTK WARNING: Missing tooltip. Please register an Enhancement type bug.'): Create RAMSTK Combo wid... | Implement the Python class `RAMSTKComboBoxEntry` described below.
Class description:
This is the RAMSTK ComboBox with Entry class.
Method signatures and docstrings:
- def __init__(self, width=200, height=30, tooltip='RAMSTK WARNING: Missing tooltip. Please register an Enhancement type bug.'): Create RAMSTK Combo wid... | 488ffed8b842399ddcae93007de6c6f1dda23d05 | <|skeleton|>
class RAMSTKComboBoxEntry:
"""This is the RAMSTK ComboBox with Entry class."""
def __init__(self, width=200, height=30, tooltip='RAMSTK WARNING: Missing tooltip. Please register an Enhancement type bug.'):
"""Create RAMSTK Combo widgets. :keyword int width: width of the gtk.ComboBox() wid... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class RAMSTKComboBoxEntry:
"""This is the RAMSTK ComboBox with Entry class."""
def __init__(self, width=200, height=30, tooltip='RAMSTK WARNING: Missing tooltip. Please register an Enhancement type bug.'):
"""Create RAMSTK Combo widgets. :keyword int width: width of the gtk.ComboBox() widget. Default ... | the_stack_v2_python_sparse | src/ramstk/gui/gtk/ramstk/Combo.py | JmiXIII/ramstk | train | 0 |
d319eeb40b5b8933c36a41403b7e45d9ebebff22 | [
"super().__init__(main_window)\nself.hide()\nself.setGraphicsEffect(utils.get_shadow())\nmain_window.communication.resized.connect(self._move)\nmain_window.communication.action_button_toggle.connect(self.toggle_state)",
"w = int(width * 0.08)\nself.setStyleSheet(self.QSS.format(x=int(w / 3), y=int(w / 2), z=w))\n... | <|body_start_0|>
super().__init__(main_window)
self.hide()
self.setGraphicsEffect(utils.get_shadow())
main_window.communication.resized.connect(self._move)
main_window.communication.action_button_toggle.connect(self.toggle_state)
<|end_body_0|>
<|body_start_1|>
w = int(w... | Main button for application. Changes callback and icon, depending on current state. | ActionButton | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ActionButton:
"""Main button for application. Changes callback and icon, depending on current state."""
def __init__(self, main_window):
"""Connect signals. Hide the button, it will be shown only when required signals are emited"""
<|body_0|>
def _move(self, width, water... | stack_v2_sparse_classes_36k_train_024953 | 2,194 | no_license | [
{
"docstring": "Connect signals. Hide the button, it will be shown only when required signals are emited",
"name": "__init__",
"signature": "def __init__(self, main_window)"
},
{
"docstring": "Move the button when application is resized.",
"name": "_move",
"signature": "def _move(self, w... | 3 | stack_v2_sparse_classes_30k_train_003605 | Implement the Python class `ActionButton` described below.
Class description:
Main button for application. Changes callback and icon, depending on current state.
Method signatures and docstrings:
- def __init__(self, main_window): Connect signals. Hide the button, it will be shown only when required signals are emite... | Implement the Python class `ActionButton` described below.
Class description:
Main button for application. Changes callback and icon, depending on current state.
Method signatures and docstrings:
- def __init__(self, main_window): Connect signals. Hide the button, it will be shown only when required signals are emite... | 606e188e88ee3a2b2e1daee60c71948c678228e1 | <|skeleton|>
class ActionButton:
"""Main button for application. Changes callback and icon, depending on current state."""
def __init__(self, main_window):
"""Connect signals. Hide the button, it will be shown only when required signals are emited"""
<|body_0|>
def _move(self, width, water... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ActionButton:
"""Main button for application. Changes callback and icon, depending on current state."""
def __init__(self, main_window):
"""Connect signals. Hide the button, it will be shown only when required signals are emited"""
super().__init__(main_window)
self.hide()
... | the_stack_v2_python_sparse | Hospital-Helper-2-master/app/gui/action_button.py | JoaoBueno/estudos-python | train | 2 |
243b523df28d68587a4a64554c095afaf6048d86 | [
"bibfile = bibfile or pkg_resources.resource_filename('ExoCTK', 'data/core/bibtex.bib')\nself.bibfile = bibfile\nself.refs = []\nbf = open(bibfile)\nself.database = bt.load(bf)\nbf.close()\nself.bibcodes = [i['ID'] for i in self.database.entries]",
"if bibcode in self.bibcodes:\n self.refs += [bibcode]\n pr... | <|body_start_0|>
bibfile = bibfile or pkg_resources.resource_filename('ExoCTK', 'data/core/bibtex.bib')
self.bibfile = bibfile
self.refs = []
bf = open(bibfile)
self.database = bt.load(bf)
bf.close()
self.bibcodes = [i['ID'] for i in self.database.entries]
<|end_b... | Creates and manages a References object to track references within an ExoCTK user session Attributes ---------- bibfile: str The path to the bibtex file from which the references will be read refs: list The list of bibcodes saved during the user session database: bibtexparser.bibdatabase.BibDatabase object The database... | References | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class References:
"""Creates and manages a References object to track references within an ExoCTK user session Attributes ---------- bibfile: str The path to the bibtex file from which the references will be read refs: list The list of bibcodes saved during the user session database: bibtexparser.bibda... | stack_v2_sparse_classes_36k_train_024954 | 36,966 | no_license | [
{
"docstring": "Initializes an empty References object which points to a .bib file Parameters ---------- bibfile: str The path to the bibtex file from which the references will be read",
"name": "__init__",
"signature": "def __init__(self, bibfile='')"
},
{
"docstring": "Adds a bibcode to the Re... | 4 | stack_v2_sparse_classes_30k_train_000678 | Implement the Python class `References` described below.
Class description:
Creates and manages a References object to track references within an ExoCTK user session Attributes ---------- bibfile: str The path to the bibtex file from which the references will be read refs: list The list of bibcodes saved during the us... | Implement the Python class `References` described below.
Class description:
Creates and manages a References object to track references within an ExoCTK user session Attributes ---------- bibfile: str The path to the bibtex file from which the references will be read refs: list The list of bibcodes saved during the us... | 7b996f77fd7b87eac381ca396877bda4121f18a8 | <|skeleton|>
class References:
"""Creates and manages a References object to track references within an ExoCTK user session Attributes ---------- bibfile: str The path to the bibtex file from which the references will be read refs: list The list of bibcodes saved during the user session database: bibtexparser.bibda... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class References:
"""Creates and manages a References object to track references within an ExoCTK user session Attributes ---------- bibfile: str The path to the bibtex file from which the references will be read refs: list The list of bibcodes saved during the user session database: bibtexparser.bibdatabase.BibDat... | the_stack_v2_python_sparse | ExoCTK/core.py | natashabatalha/ExoCTK | train | 2 |
2f193cb1eaf7b5e99d20025716a248144af90b92 | [
"OdfFit.__init__(self, model, data)\nself._gfa = None\nself.npeaks = 5\nself._peak_values = None\nself._peak_indices = None\nself._qa = None",
"self.gqi_vector = self.model.cache_get('gqi_vector', key=sphere)\nif self.gqi_vector is None:\n if self.model.method == 'gqi2':\n H = squared_radial_component\n... | <|body_start_0|>
OdfFit.__init__(self, model, data)
self._gfa = None
self.npeaks = 5
self._peak_values = None
self._peak_indices = None
self._qa = None
<|end_body_0|>
<|body_start_1|>
self.gqi_vector = self.model.cache_get('gqi_vector', key=sphere)
if sel... | GeneralizedQSamplingFit | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class GeneralizedQSamplingFit:
def __init__(self, model, data):
"""Calculates PDF and ODF for a single voxel Parameters ---------- model : object, DiffusionSpectrumModel data : 1d ndarray, signal values"""
<|body_0|>
def odf(self, sphere):
"""Calculates the discrete ODF fo... | stack_v2_sparse_classes_36k_train_024955 | 9,071 | permissive | [
{
"docstring": "Calculates PDF and ODF for a single voxel Parameters ---------- model : object, DiffusionSpectrumModel data : 1d ndarray, signal values",
"name": "__init__",
"signature": "def __init__(self, model, data)"
},
{
"docstring": "Calculates the discrete ODF for a given discrete sphere.... | 2 | stack_v2_sparse_classes_30k_train_012582 | Implement the Python class `GeneralizedQSamplingFit` described below.
Class description:
Implement the GeneralizedQSamplingFit class.
Method signatures and docstrings:
- def __init__(self, model, data): Calculates PDF and ODF for a single voxel Parameters ---------- model : object, DiffusionSpectrumModel data : 1d nd... | Implement the Python class `GeneralizedQSamplingFit` described below.
Class description:
Implement the GeneralizedQSamplingFit class.
Method signatures and docstrings:
- def __init__(self, model, data): Calculates PDF and ODF for a single voxel Parameters ---------- model : object, DiffusionSpectrumModel data : 1d nd... | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | <|skeleton|>
class GeneralizedQSamplingFit:
def __init__(self, model, data):
"""Calculates PDF and ODF for a single voxel Parameters ---------- model : object, DiffusionSpectrumModel data : 1d ndarray, signal values"""
<|body_0|>
def odf(self, sphere):
"""Calculates the discrete ODF fo... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class GeneralizedQSamplingFit:
def __init__(self, model, data):
"""Calculates PDF and ODF for a single voxel Parameters ---------- model : object, DiffusionSpectrumModel data : 1d ndarray, signal values"""
OdfFit.__init__(self, model, data)
self._gfa = None
self.npeaks = 5
se... | the_stack_v2_python_sparse | env/lib/python3.6/site-packages/dipy/reconst/gqi.py | Raniac/NEURO-LEARN | train | 9 | |
1d8338ec46b2d0a4343c696ab7416899db0f6d88 | [
"if model_name is None:\n if model is None:\n self.model = Defaults.model\n else:\n self.model = model\nelse:\n self.model = Defaults.models[model_name]\nself.scores = []\nfor its in range(len(self.end_sites)):\n if Defaults.model_select:\n self.model = Defaults.model_select(self, i... | <|body_start_0|>
if model_name is None:
if model is None:
self.model = Defaults.model
else:
self.model = model
else:
self.model = Defaults.models[model_name]
self.scores = []
for its in range(len(self.end_sites)):
... | mmModel | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class mmModel:
def eval_score(self, model_name=None, model=None):
"""Computes the *miRmap* score(s). :param model_name: Model name. :type model_name: str :param model: Model with coefficients and intercept as keys. :type model: dict"""
<|body_0|>
def score(self):
"""*miRma... | stack_v2_sparse_classes_36k_train_024956 | 23,750 | permissive | [
{
"docstring": "Computes the *miRmap* score(s). :param model_name: Model name. :type model_name: str :param model: Model with coefficients and intercept as keys. :type model: dict",
"name": "eval_score",
"signature": "def eval_score(self, model_name=None, model=None)"
},
{
"docstring": "*miRmap*... | 2 | stack_v2_sparse_classes_30k_train_012382 | Implement the Python class `mmModel` described below.
Class description:
Implement the mmModel class.
Method signatures and docstrings:
- def eval_score(self, model_name=None, model=None): Computes the *miRmap* score(s). :param model_name: Model name. :type model_name: str :param model: Model with coefficients and in... | Implement the Python class `mmModel` described below.
Class description:
Implement the mmModel class.
Method signatures and docstrings:
- def eval_score(self, model_name=None, model=None): Computes the *miRmap* score(s). :param model_name: Model name. :type model_name: str :param model: Model with coefficients and in... | f608578defb122a1782cff39c5a9a60be0a900df | <|skeleton|>
class mmModel:
def eval_score(self, model_name=None, model=None):
"""Computes the *miRmap* score(s). :param model_name: Model name. :type model_name: str :param model: Model with coefficients and intercept as keys. :type model: dict"""
<|body_0|>
def score(self):
"""*miRma... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class mmModel:
def eval_score(self, model_name=None, model=None):
"""Computes the *miRmap* score(s). :param model_name: Model name. :type model_name: str :param model: Model with coefficients and intercept as keys. :type model: dict"""
if model_name is None:
if model is None:
... | the_stack_v2_python_sparse | node/mirmap/model.py | RNAEDITINGPLUS/main | train | 4 | |
abb8087a2302cda6da0a3aed8d76d654eb5ea2e1 | [
"d2l.use_svg_display()\nself.fig, self.axes = d2l.plt.subplots(nrows, ncols, figsize=figsize)\nif nrows * ncols == 1:\n self.axes = [self.axes]\nself.config_axes = lambda: d2l.set_axes(self.axes[0], xlabel, ylabel, xlim, ylim, xscale, yscale, legend)\nself.X, self.Y, self.fmts = (None, None, fmts)",
"if not ha... | <|body_start_0|>
d2l.use_svg_display()
self.fig, self.axes = d2l.plt.subplots(nrows, ncols, figsize=figsize)
if nrows * ncols == 1:
self.axes = [self.axes]
self.config_axes = lambda: d2l.set_axes(self.axes[0], xlabel, ylabel, xlim, ylim, xscale, yscale, legend)
self.X... | Animator | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Animator:
def __init__(self, xlabel=None, ylabel=None, legend=[], xlim=None, ylim=None, xscale='linear', yscale='linear', fmts=None, nrows=1, ncols=1, figsize=(3.5, 2.5)):
"""Incrementally plot multiple lines."""
<|body_0|>
def add(self, x, y):
"""Add multiple data p... | stack_v2_sparse_classes_36k_train_024957 | 4,298 | no_license | [
{
"docstring": "Incrementally plot multiple lines.",
"name": "__init__",
"signature": "def __init__(self, xlabel=None, ylabel=None, legend=[], xlim=None, ylim=None, xscale='linear', yscale='linear', fmts=None, nrows=1, ncols=1, figsize=(3.5, 2.5))"
},
{
"docstring": "Add multiple data points int... | 2 | stack_v2_sparse_classes_30k_train_003267 | Implement the Python class `Animator` described below.
Class description:
Implement the Animator class.
Method signatures and docstrings:
- def __init__(self, xlabel=None, ylabel=None, legend=[], xlim=None, ylim=None, xscale='linear', yscale='linear', fmts=None, nrows=1, ncols=1, figsize=(3.5, 2.5)): Incrementally pl... | Implement the Python class `Animator` described below.
Class description:
Implement the Animator class.
Method signatures and docstrings:
- def __init__(self, xlabel=None, ylabel=None, legend=[], xlim=None, ylim=None, xscale='linear', yscale='linear', fmts=None, nrows=1, ncols=1, figsize=(3.5, 2.5)): Incrementally pl... | 4acdd0d4966e31a616910554bc075b641aa152df | <|skeleton|>
class Animator:
def __init__(self, xlabel=None, ylabel=None, legend=[], xlim=None, ylim=None, xscale='linear', yscale='linear', fmts=None, nrows=1, ncols=1, figsize=(3.5, 2.5)):
"""Incrementally plot multiple lines."""
<|body_0|>
def add(self, x, y):
"""Add multiple data p... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Animator:
def __init__(self, xlabel=None, ylabel=None, legend=[], xlim=None, ylim=None, xscale='linear', yscale='linear', fmts=None, nrows=1, ncols=1, figsize=(3.5, 2.5)):
"""Incrementally plot multiple lines."""
d2l.use_svg_display()
self.fig, self.axes = d2l.plt.subplots(nrows, ncols... | the_stack_v2_python_sparse | AILearning/Others/Test.py | GuyRobot/AIPythonExamples | train | 0 | |
d3179ad8a0a881b7af7ce4df4a1d7132fc414a37 | [
"type_indicator = volume_system_type.TYPE_INDICATOR\nif type_indicator not in cls._volume_system_types:\n raise KeyError(f'Volume system type: {type_indicator:s} not set.')\ndel cls._volume_system_types[type_indicator]",
"if type_indicator not in cls._volume_system_types:\n raise KeyError(f'Volume system ty... | <|body_start_0|>
type_indicator = volume_system_type.TYPE_INDICATOR
if type_indicator not in cls._volume_system_types:
raise KeyError(f'Volume system type: {type_indicator:s} not set.')
del cls._volume_system_types[type_indicator]
<|end_body_0|>
<|body_start_1|>
if type_indi... | Volume system factory. | Factory | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Factory:
"""Volume system factory."""
def DeregisterVolumeSystem(cls, volume_system_type):
"""Deregisters a path specification type. Args: volume_system_type (type): path specification type. Raises: KeyError: if path specification type is not registered."""
<|body_0|>
de... | stack_v2_sparse_classes_36k_train_024958 | 1,710 | permissive | [
{
"docstring": "Deregisters a path specification type. Args: volume_system_type (type): path specification type. Raises: KeyError: if path specification type is not registered.",
"name": "DeregisterVolumeSystem",
"signature": "def DeregisterVolumeSystem(cls, volume_system_type)"
},
{
"docstring"... | 3 | null | Implement the Python class `Factory` described below.
Class description:
Volume system factory.
Method signatures and docstrings:
- def DeregisterVolumeSystem(cls, volume_system_type): Deregisters a path specification type. Args: volume_system_type (type): path specification type. Raises: KeyError: if path specificat... | Implement the Python class `Factory` described below.
Class description:
Volume system factory.
Method signatures and docstrings:
- def DeregisterVolumeSystem(cls, volume_system_type): Deregisters a path specification type. Args: volume_system_type (type): path specification type. Raises: KeyError: if path specificat... | 28756d910e951a22c5f0b2bcf5184f055a19d544 | <|skeleton|>
class Factory:
"""Volume system factory."""
def DeregisterVolumeSystem(cls, volume_system_type):
"""Deregisters a path specification type. Args: volume_system_type (type): path specification type. Raises: KeyError: if path specification type is not registered."""
<|body_0|>
de... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Factory:
"""Volume system factory."""
def DeregisterVolumeSystem(cls, volume_system_type):
"""Deregisters a path specification type. Args: volume_system_type (type): path specification type. Raises: KeyError: if path specification type is not registered."""
type_indicator = volume_system_... | the_stack_v2_python_sparse | dfvfs/volume/factory.py | log2timeline/dfvfs | train | 197 |
079f1b5bf6a5cb126952b0d009beee615eb15e87 | [
"for item in config:\n config[item] = Items._filrt_callble(modules, config[item])\nresult = {}\nfor item in config:\n if callable(config[item]):\n result[item] = config[item]\nreturn result",
"if isinstance(call_name, str):\n if hasattr(modules, call_name):\n obj = getattr(modules, call_nam... | <|body_start_0|>
for item in config:
config[item] = Items._filrt_callble(modules, config[item])
result = {}
for item in config:
if callable(config[item]):
result[item] = config[item]
return result
<|end_body_0|>
<|body_start_1|>
if isinsta... | Items | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Items:
def filrt_call_conf(config, modules):
"""加工配置字典, 将配置字典中键所对应的字符串值, 加工成一个可调用对象值. :param config: 配置字典, 键是数据库所需的字段, 值是 解析这个字段的类或者方法的名字. :param modules: 一个python模块对象. :return: 返回加工后的配置字典, 只包含可调用对象的键值对. 如果某个键值对的可调用对象不存在, 则会被过滤掉."""
<|body_0|>
def _filrt_callble(modules, cal... | stack_v2_sparse_classes_36k_train_024959 | 1,628 | no_license | [
{
"docstring": "加工配置字典, 将配置字典中键所对应的字符串值, 加工成一个可调用对象值. :param config: 配置字典, 键是数据库所需的字段, 值是 解析这个字段的类或者方法的名字. :param modules: 一个python模块对象. :return: 返回加工后的配置字典, 只包含可调用对象的键值对. 如果某个键值对的可调用对象不存在, 则会被过滤掉.",
"name": "filrt_call_conf",
"signature": "def filrt_call_conf(config, modules)"
},
{
"docstring":... | 2 | null | Implement the Python class `Items` described below.
Class description:
Implement the Items class.
Method signatures and docstrings:
- def filrt_call_conf(config, modules): 加工配置字典, 将配置字典中键所对应的字符串值, 加工成一个可调用对象值. :param config: 配置字典, 键是数据库所需的字段, 值是 解析这个字段的类或者方法的名字. :param modules: 一个python模块对象. :return: 返回加工后的配置字典, 只包含可... | Implement the Python class `Items` described below.
Class description:
Implement the Items class.
Method signatures and docstrings:
- def filrt_call_conf(config, modules): 加工配置字典, 将配置字典中键所对应的字符串值, 加工成一个可调用对象值. :param config: 配置字典, 键是数据库所需的字段, 值是 解析这个字段的类或者方法的名字. :param modules: 一个python模块对象. :return: 返回加工后的配置字典, 只包含可... | cc2b84da69f3f7904e2420f85a5061b37ebfa948 | <|skeleton|>
class Items:
def filrt_call_conf(config, modules):
"""加工配置字典, 将配置字典中键所对应的字符串值, 加工成一个可调用对象值. :param config: 配置字典, 键是数据库所需的字段, 值是 解析这个字段的类或者方法的名字. :param modules: 一个python模块对象. :return: 返回加工后的配置字典, 只包含可调用对象的键值对. 如果某个键值对的可调用对象不存在, 则会被过滤掉."""
<|body_0|>
def _filrt_callble(modules, cal... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Items:
def filrt_call_conf(config, modules):
"""加工配置字典, 将配置字典中键所对应的字符串值, 加工成一个可调用对象值. :param config: 配置字典, 键是数据库所需的字段, 值是 解析这个字段的类或者方法的名字. :param modules: 一个python模块对象. :return: 返回加工后的配置字典, 只包含可调用对象的键值对. 如果某个键值对的可调用对象不存在, 则会被过滤掉."""
for item in config:
config[item] = Items._filrt_c... | the_stack_v2_python_sparse | spiderFrame/Spider/Base/BaseItem.py | hiphp7/hs_code | train | 0 | |
b47df17b813f5c3c11ab7d705caa10682ef5d739 | [
"self.errors = errors\nself.file_names = file_names\nself.pagination_cookie = pagination_cookie",
"if dictionary is None:\n return None\nerrors = None\nif dictionary.get('errors') != None:\n errors = list()\n for structure in dictionary.get('errors'):\n errors.append(cohesity_management_sdk.models... | <|body_start_0|>
self.errors = errors
self.file_names = file_names
self.pagination_cookie = pagination_cookie
<|end_body_0|>
<|body_start_1|>
if dictionary is None:
return None
errors = None
if dictionary.get('errors') != None:
errors = list()
... | Implementation of the 'ProtectionRunErrors' model. TODO: type description here. Attributes: errors (list of RequestError): Specifies the list of errors encountered by a task during a protection run. file_names (list of string): Specifies the list of filenames with errors encountered by a task during a protection run. p... | ProtectionRunErrors | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ProtectionRunErrors:
"""Implementation of the 'ProtectionRunErrors' model. TODO: type description here. Attributes: errors (list of RequestError): Specifies the list of errors encountered by a task during a protection run. file_names (list of string): Specifies the list of filenames with errors e... | stack_v2_sparse_classes_36k_train_024960 | 2,287 | permissive | [
{
"docstring": "Constructor for the ProtectionRunErrors class",
"name": "__init__",
"signature": "def __init__(self, errors=None, file_names=None, pagination_cookie=None)"
},
{
"docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary represent... | 2 | null | Implement the Python class `ProtectionRunErrors` described below.
Class description:
Implementation of the 'ProtectionRunErrors' model. TODO: type description here. Attributes: errors (list of RequestError): Specifies the list of errors encountered by a task during a protection run. file_names (list of string): Specif... | Implement the Python class `ProtectionRunErrors` described below.
Class description:
Implementation of the 'ProtectionRunErrors' model. TODO: type description here. Attributes: errors (list of RequestError): Specifies the list of errors encountered by a task during a protection run. file_names (list of string): Specif... | e4973dfeb836266904d0369ea845513c7acf261e | <|skeleton|>
class ProtectionRunErrors:
"""Implementation of the 'ProtectionRunErrors' model. TODO: type description here. Attributes: errors (list of RequestError): Specifies the list of errors encountered by a task during a protection run. file_names (list of string): Specifies the list of filenames with errors e... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ProtectionRunErrors:
"""Implementation of the 'ProtectionRunErrors' model. TODO: type description here. Attributes: errors (list of RequestError): Specifies the list of errors encountered by a task during a protection run. file_names (list of string): Specifies the list of filenames with errors encountered by... | the_stack_v2_python_sparse | cohesity_management_sdk/models/protection_run_errors.py | cohesity/management-sdk-python | train | 24 |
9575c09184ee2f111d688de7e502e9cbcff30a87 | [
"try:\n authenticator = TokenAuthenticator(token=config['secret_key'])\n stream = Customers(authenticator=authenticator, start_date=config['start_date'])\n records = stream.read_records(sync_mode=SyncMode.full_refresh)\n next(records)\n return (True, None)\nexcept StopIteration:\n return (True, No... | <|body_start_0|>
try:
authenticator = TokenAuthenticator(token=config['secret_key'])
stream = Customers(authenticator=authenticator, start_date=config['start_date'])
records = stream.read_records(sync_mode=SyncMode.full_refresh)
next(records)
return (T... | SourcePaystack | [
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"Elastic-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SourcePaystack:
def check_connection(self, logger, config) -> Tuple[bool, any]:
"""Check connection by fetching customers :param config: the user-input config object conforming to the connector's spec.json :param logger: logger object :return Tuple[bool, any]: (True, None) if the input c... | stack_v2_sparse_classes_36k_train_024961 | 2,274 | permissive | [
{
"docstring": "Check connection by fetching customers :param config: the user-input config object conforming to the connector's spec.json :param logger: logger object :return Tuple[bool, any]: (True, None) if the input config can be used to connect to the API successfully, (False, error) otherwise.",
"name... | 2 | null | Implement the Python class `SourcePaystack` described below.
Class description:
Implement the SourcePaystack class.
Method signatures and docstrings:
- def check_connection(self, logger, config) -> Tuple[bool, any]: Check connection by fetching customers :param config: the user-input config object conforming to the c... | Implement the Python class `SourcePaystack` described below.
Class description:
Implement the SourcePaystack class.
Method signatures and docstrings:
- def check_connection(self, logger, config) -> Tuple[bool, any]: Check connection by fetching customers :param config: the user-input config object conforming to the c... | 8d5f9a2d49ab8f9e85ccf058cb02c2fda287afc6 | <|skeleton|>
class SourcePaystack:
def check_connection(self, logger, config) -> Tuple[bool, any]:
"""Check connection by fetching customers :param config: the user-input config object conforming to the connector's spec.json :param logger: logger object :return Tuple[bool, any]: (True, None) if the input c... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SourcePaystack:
def check_connection(self, logger, config) -> Tuple[bool, any]:
"""Check connection by fetching customers :param config: the user-input config object conforming to the connector's spec.json :param logger: logger object :return Tuple[bool, any]: (True, None) if the input config can be u... | the_stack_v2_python_sparse | dts/airbyte/airbyte-integrations/connectors/source-paystack/source_paystack/source.py | alldatacenter/alldata | train | 774 | |
3c3d9defc1454116d79fab1dda78c6a1bed68156 | [
"super().__init__()\nself.snr_dB = snr\nself.powers = powers",
"data, label, pos, file_name = sample\nsnr = 10.0 ** (self.snr_dB / 10.0)\nif self.powers is None:\n signal_power = data.flatten().var()\nelse:\n signal_power = self.powers[file_name]\nnoise_power = signal_power / snr\nnoise = np.random.randn(*d... | <|body_start_0|>
super().__init__()
self.snr_dB = snr
self.powers = powers
<|end_body_0|>
<|body_start_1|>
data, label, pos, file_name = sample
snr = 10.0 ** (self.snr_dB / 10.0)
if self.powers is None:
signal_power = data.flatten().var()
else:
... | Adds noise corresponding to a certain SNR ratio. | SNRTransform | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SNRTransform:
"""Adds noise corresponding to a certain SNR ratio."""
def __init__(self, snr, powers: dict=None):
"""snr: desired SNR in dB"""
<|body_0|>
def __call__(self, sample):
"""x: np.ndarray: Signal to add noise to. Can be of any shape."""
<|body_1... | stack_v2_sparse_classes_36k_train_024962 | 4,182 | no_license | [
{
"docstring": "snr: desired SNR in dB",
"name": "__init__",
"signature": "def __init__(self, snr, powers: dict=None)"
},
{
"docstring": "x: np.ndarray: Signal to add noise to. Can be of any shape.",
"name": "__call__",
"signature": "def __call__(self, sample)"
}
] | 2 | stack_v2_sparse_classes_30k_train_004498 | Implement the Python class `SNRTransform` described below.
Class description:
Adds noise corresponding to a certain SNR ratio.
Method signatures and docstrings:
- def __init__(self, snr, powers: dict=None): snr: desired SNR in dB
- def __call__(self, sample): x: np.ndarray: Signal to add noise to. Can be of any shape... | Implement the Python class `SNRTransform` described below.
Class description:
Adds noise corresponding to a certain SNR ratio.
Method signatures and docstrings:
- def __init__(self, snr, powers: dict=None): snr: desired SNR in dB
- def __call__(self, sample): x: np.ndarray: Signal to add noise to. Can be of any shape... | 10fbe43b95c7dc474102c20fe74910ade51a5ae3 | <|skeleton|>
class SNRTransform:
"""Adds noise corresponding to a certain SNR ratio."""
def __init__(self, snr, powers: dict=None):
"""snr: desired SNR in dB"""
<|body_0|>
def __call__(self, sample):
"""x: np.ndarray: Signal to add noise to. Can be of any shape."""
<|body_1... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SNRTransform:
"""Adds noise corresponding to a certain SNR ratio."""
def __init__(self, snr, powers: dict=None):
"""snr: desired SNR in dB"""
super().__init__()
self.snr_dB = snr
self.powers = powers
def __call__(self, sample):
"""x: np.ndarray: Signal to add ... | the_stack_v2_python_sparse | transforms.py | zacholade/MRF-Project | train | 3 |
cf9ec76dac9fbe5f467fb8b66415d108fe7eb25e | [
"f = {'ip': ip}\ncol = cls.get_collection()\nr = col.find_one(filter=f)\nif r is None:\n return True\nelse:\n return False",
"pipeline = []\np1 = {'$project': {'_id': 0, 'ip_item': {'$objectToArray': '$children'}}}\nw1 = {'$unwind': '$ip_item'}\npipeline.append(p1)\npipeline.append(w1)\ncol = cls.get_collec... | <|body_start_0|>
f = {'ip': ip}
col = cls.get_collection()
r = col.find_one(filter=f)
if r is None:
return True
else:
return False
<|end_body_0|>
<|body_start_1|>
pipeline = []
p1 = {'$project': {'_id': 0, 'ip_item': {'$objectToArray': '$c... | 嵌入式设备 | Embedded | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Embedded:
"""嵌入式设备"""
def allow_control_ip(cls, ip: str) -> bool:
"""检查主控板是否ip冲突?不冲突返回True :param ip: :return:"""
<|body_0|>
def allow_execute_ip(cls, ip: str) -> bool:
"""检查执行板是否ip冲突?不冲突返回True :param ip: :return:"""
<|body_1|>
<|end_skeleton|>
<|body_s... | stack_v2_sparse_classes_36k_train_024963 | 27,644 | no_license | [
{
"docstring": "检查主控板是否ip冲突?不冲突返回True :param ip: :return:",
"name": "allow_control_ip",
"signature": "def allow_control_ip(cls, ip: str) -> bool"
},
{
"docstring": "检查执行板是否ip冲突?不冲突返回True :param ip: :return:",
"name": "allow_execute_ip",
"signature": "def allow_execute_ip(cls, ip: str) ->... | 2 | null | Implement the Python class `Embedded` described below.
Class description:
嵌入式设备
Method signatures and docstrings:
- def allow_control_ip(cls, ip: str) -> bool: 检查主控板是否ip冲突?不冲突返回True :param ip: :return:
- def allow_execute_ip(cls, ip: str) -> bool: 检查执行板是否ip冲突?不冲突返回True :param ip: :return: | Implement the Python class `Embedded` described below.
Class description:
嵌入式设备
Method signatures and docstrings:
- def allow_control_ip(cls, ip: str) -> bool: 检查主控板是否ip冲突?不冲突返回True :param ip: :return:
- def allow_execute_ip(cls, ip: str) -> bool: 检查执行板是否ip冲突?不冲突返回True :param ip: :return:
<|skeleton|>
class Embedded... | 3a2bdfd1598bfcdfe56386ec0c46fcede772cbfe | <|skeleton|>
class Embedded:
"""嵌入式设备"""
def allow_control_ip(cls, ip: str) -> bool:
"""检查主控板是否ip冲突?不冲突返回True :param ip: :return:"""
<|body_0|>
def allow_execute_ip(cls, ip: str) -> bool:
"""检查执行板是否ip冲突?不冲突返回True :param ip: :return:"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Embedded:
"""嵌入式设备"""
def allow_control_ip(cls, ip: str) -> bool:
"""检查主控板是否ip冲突?不冲突返回True :param ip: :return:"""
f = {'ip': ip}
col = cls.get_collection()
r = col.find_one(filter=f)
if r is None:
return True
else:
return False
... | the_stack_v2_python_sparse | query_server/module/system_module.py | SYYDSN/py_projects | train | 0 |
c463f1cb1e9f86b53dad34946ca94053084a2454 | [
"log.debug('getparam_city_names() | <START>')\ncity = ''\ndb_cur_one.execute(\"select count(distinct CITY_NAME) from ZMT_PARAMETERS where ACTIVE_FLAG = 'Y'\")\nfor count in db_cur_one:\n if count[0] is 0:\n log.info('getparam_city_names() | Parameter: CITY_NAME missing. Please define.')\n else:\n ... | <|body_start_0|>
log.debug('getparam_city_names() | <START>')
city = ''
db_cur_one.execute("select count(distinct CITY_NAME) from ZMT_PARAMETERS where ACTIVE_FLAG = 'Y'")
for count in db_cur_one:
if count[0] is 0:
log.info('getparam_city_names() | Parameter: C... | ZomatoParameters | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ZomatoParameters:
def getparam_city_names(self):
"""Retrieve Parameter | City Names"""
<|body_0|>
def getparam_localities(self):
"""Retrieve Parameter | Localities"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
log.debug('getparam_city_names() | <S... | stack_v2_sparse_classes_36k_train_024964 | 41,261 | no_license | [
{
"docstring": "Retrieve Parameter | City Names",
"name": "getparam_city_names",
"signature": "def getparam_city_names(self)"
},
{
"docstring": "Retrieve Parameter | Localities",
"name": "getparam_localities",
"signature": "def getparam_localities(self)"
}
] | 2 | stack_v2_sparse_classes_30k_test_000840 | Implement the Python class `ZomatoParameters` described below.
Class description:
Implement the ZomatoParameters class.
Method signatures and docstrings:
- def getparam_city_names(self): Retrieve Parameter | City Names
- def getparam_localities(self): Retrieve Parameter | Localities | Implement the Python class `ZomatoParameters` described below.
Class description:
Implement the ZomatoParameters class.
Method signatures and docstrings:
- def getparam_city_names(self): Retrieve Parameter | City Names
- def getparam_localities(self): Retrieve Parameter | Localities
<|skeleton|>
class ZomatoParamete... | 2e6c48d1a39f6f44e1db827f60dbdc7907b74b63 | <|skeleton|>
class ZomatoParameters:
def getparam_city_names(self):
"""Retrieve Parameter | City Names"""
<|body_0|>
def getparam_localities(self):
"""Retrieve Parameter | Localities"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ZomatoParameters:
def getparam_city_names(self):
"""Retrieve Parameter | City Names"""
log.debug('getparam_city_names() | <START>')
city = ''
db_cur_one.execute("select count(distinct CITY_NAME) from ZMT_PARAMETERS where ACTIVE_FLAG = 'Y'")
for count in db_cur_one:
... | the_stack_v2_python_sparse | mylibrary/zmt_20180331.py | nitinx/zomato-mart | train | 0 | |
074f25ac8b0fc9bb33cfd536ce98c5347e47bb29 | [
"self.action = action\nself.datastore_entity = datastore_entity\nself.power_state_config = power_state_config\nself.rename_restored_object_param = rename_restored_object_param\nself.resource_pool_entity = resource_pool_entity\nself.restore_parent_source = restore_parent_source\nself.restored_objects_network_config ... | <|body_start_0|>
self.action = action
self.datastore_entity = datastore_entity
self.power_state_config = power_state_config
self.rename_restored_object_param = rename_restored_object_param
self.resource_pool_entity = resource_pool_entity
self.restore_parent_source = resto... | Implementation of the 'RestoreObjectParams' model. TODO: type description here. Attributes: action (int): The action to perform. datastore_entity (EntityProto): A datastore entity where the object's files should be restored to. This field is optional if object is being restored to its original parent source. If not spe... | RestoreObjectParams | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class RestoreObjectParams:
"""Implementation of the 'RestoreObjectParams' model. TODO: type description here. Attributes: action (int): The action to perform. datastore_entity (EntityProto): A datastore entity where the object's files should be restored to. This field is optional if object is being res... | stack_v2_sparse_classes_36k_train_024965 | 7,111 | permissive | [
{
"docstring": "Constructor for the RestoreObjectParams class",
"name": "__init__",
"signature": "def __init__(self, action=None, datastore_entity=None, power_state_config=None, rename_restored_object_param=None, resource_pool_entity=None, restore_parent_source=None, restored_objects_network_config=None... | 2 | stack_v2_sparse_classes_30k_train_003284 | Implement the Python class `RestoreObjectParams` described below.
Class description:
Implementation of the 'RestoreObjectParams' model. TODO: type description here. Attributes: action (int): The action to perform. datastore_entity (EntityProto): A datastore entity where the object's files should be restored to. This f... | Implement the Python class `RestoreObjectParams` described below.
Class description:
Implementation of the 'RestoreObjectParams' model. TODO: type description here. Attributes: action (int): The action to perform. datastore_entity (EntityProto): A datastore entity where the object's files should be restored to. This f... | e4973dfeb836266904d0369ea845513c7acf261e | <|skeleton|>
class RestoreObjectParams:
"""Implementation of the 'RestoreObjectParams' model. TODO: type description here. Attributes: action (int): The action to perform. datastore_entity (EntityProto): A datastore entity where the object's files should be restored to. This field is optional if object is being res... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class RestoreObjectParams:
"""Implementation of the 'RestoreObjectParams' model. TODO: type description here. Attributes: action (int): The action to perform. datastore_entity (EntityProto): A datastore entity where the object's files should be restored to. This field is optional if object is being restored to its ... | the_stack_v2_python_sparse | cohesity_management_sdk/models/restore_object_params.py | cohesity/management-sdk-python | train | 24 |
b18c34502918b94175ea56a6a68f003f5132f416 | [
"bond_attributes = {}\nbond_plugin_attributes_query = db().query(cls.model.id, models.Plugin.name, models.Plugin.title, cls.model.attributes).join(models.ClusterPlugin, models.Plugin).filter(cls.model.bond_id == bond.id).filter(models.ClusterPlugin.enabled.is_(True))\nfor bond_plugin_id, name, title, attributes in ... | <|body_start_0|>
bond_attributes = {}
bond_plugin_attributes_query = db().query(cls.model.id, models.Plugin.name, models.Plugin.title, cls.model.attributes).join(models.ClusterPlugin, models.Plugin).filter(cls.model.bond_id == bond.id).filter(models.ClusterPlugin.enabled.is_(True))
for bond_plug... | NodeBondInterfaceClusterPlugin | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class NodeBondInterfaceClusterPlugin:
def get_all_enabled_attributes_by_bond(cls, bond):
"""Returns plugin enabled attributes for specific Bond. :param interface: Bond instance :type interface: models.node.NodeBondInterface :returns: dict -- Dict object with plugin Bond attributes"""
<... | stack_v2_sparse_classes_36k_train_024966 | 24,356 | permissive | [
{
"docstring": "Returns plugin enabled attributes for specific Bond. :param interface: Bond instance :type interface: models.node.NodeBondInterface :returns: dict -- Dict object with plugin Bond attributes",
"name": "get_all_enabled_attributes_by_bond",
"signature": "def get_all_enabled_attributes_by_bo... | 3 | stack_v2_sparse_classes_30k_train_013189 | Implement the Python class `NodeBondInterfaceClusterPlugin` described below.
Class description:
Implement the NodeBondInterfaceClusterPlugin class.
Method signatures and docstrings:
- def get_all_enabled_attributes_by_bond(cls, bond): Returns plugin enabled attributes for specific Bond. :param interface: Bond instanc... | Implement the Python class `NodeBondInterfaceClusterPlugin` described below.
Class description:
Implement the NodeBondInterfaceClusterPlugin class.
Method signatures and docstrings:
- def get_all_enabled_attributes_by_bond(cls, bond): Returns plugin enabled attributes for specific Bond. :param interface: Bond instanc... | 768ac74a420f822261c4eb8da72f1d8af3c6bbff | <|skeleton|>
class NodeBondInterfaceClusterPlugin:
def get_all_enabled_attributes_by_bond(cls, bond):
"""Returns plugin enabled attributes for specific Bond. :param interface: Bond instance :type interface: models.node.NodeBondInterface :returns: dict -- Dict object with plugin Bond attributes"""
<... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class NodeBondInterfaceClusterPlugin:
def get_all_enabled_attributes_by_bond(cls, bond):
"""Returns plugin enabled attributes for specific Bond. :param interface: Bond instance :type interface: models.node.NodeBondInterface :returns: dict -- Dict object with plugin Bond attributes"""
bond_attributes... | the_stack_v2_python_sparse | nailgun/nailgun/objects/plugin.py | dis-xcom/fuel-web | train | 0 | |
3468f9f5462e745b72e0851d620c546908122a71 | [
"self.entity_name = entity_name\nself.read_model_from_s3 = read_model_from_s3\nself.read_embeddings_from_remote_url = read_embeddings_from_remote_url\nself.live_crf_model_path = live_crf_model_path\ncrf_model = CrfModel(entity_name=self.entity_name)\nif self.read_model_from_s3:\n self.tagger = crf_model.load_mod... | <|body_start_0|>
self.entity_name = entity_name
self.read_model_from_s3 = read_model_from_s3
self.read_embeddings_from_remote_url = read_embeddings_from_remote_url
self.live_crf_model_path = live_crf_model_path
crf_model = CrfModel(entity_name=self.entity_name)
if self.re... | This method is used to detect a text entity using the Crf model. | CrfDetection | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class CrfDetection:
"""This method is used to detect a text entity using the Crf model."""
def __init__(self, entity_name, read_model_from_s3=False, read_embeddings_from_remote_url=False, live_crf_model_path=''):
"""This method is used to detect text entities using the Crf model Args: enti... | stack_v2_sparse_classes_36k_train_024967 | 2,897 | no_license | [
{
"docstring": "This method is used to detect text entities using the Crf model Args: entity_name (str): Name of the entity for which the entity has to be detected read_model_from_s3 (bool): To indicate if cloud storage settings is required. live_crf_model_path (str): Path for the model to be loaded. read_embed... | 2 | stack_v2_sparse_classes_30k_train_021139 | Implement the Python class `CrfDetection` described below.
Class description:
This method is used to detect a text entity using the Crf model.
Method signatures and docstrings:
- def __init__(self, entity_name, read_model_from_s3=False, read_embeddings_from_remote_url=False, live_crf_model_path=''): This method is us... | Implement the Python class `CrfDetection` described below.
Class description:
This method is used to detect a text entity using the Crf model.
Method signatures and docstrings:
- def __init__(self, entity_name, read_model_from_s3=False, read_embeddings_from_remote_url=False, live_crf_model_path=''): This method is us... | b2ffe0413fd3622530779bedd103cca97ccbb1d6 | <|skeleton|>
class CrfDetection:
"""This method is used to detect a text entity using the Crf model."""
def __init__(self, entity_name, read_model_from_s3=False, read_embeddings_from_remote_url=False, live_crf_model_path=''):
"""This method is used to detect text entities using the Crf model Args: enti... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class CrfDetection:
"""This method is used to detect a text entity using the Crf model."""
def __init__(self, entity_name, read_model_from_s3=False, read_embeddings_from_remote_url=False, live_crf_model_path=''):
"""This method is used to detect text entities using the Crf model Args: entity_name (str)... | the_stack_v2_python_sparse | models/crf_v2/crf_detect_entity.py | saishashank85/chatbot_challengers | train | 0 |
3335e602714908a6f43a1d7cd55b1905d9e2af4e | [
"self.cache = []\nself.hash_map = {}\nself.capacity = capacity",
"if key in self.hash_map:\n index = self.cache.index(key)\n del self.cache[index]\n self.cache.append(key)\n return self.hash_map[key]\nelse:\n return -1",
"\"\"\"\n Add element\n \"\"\"\nif key not in self.hash_map:\n... | <|body_start_0|>
self.cache = []
self.hash_map = {}
self.capacity = capacity
<|end_body_0|>
<|body_start_1|>
if key in self.hash_map:
index = self.cache.index(key)
del self.cache[index]
self.cache.append(key)
return self.hash_map[key]
... | LRUCache | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class LRUCache:
def __init__(self, capacity):
""":type capacity: int"""
<|body_0|>
def get(self, key):
""":rtype: int"""
<|body_1|>
def set(self, key, value):
""":type key: int :type value: int :rtype: nothing"""
<|body_2|>
<|end_skeleton|>
<... | stack_v2_sparse_classes_36k_train_024968 | 1,548 | no_license | [
{
"docstring": ":type capacity: int",
"name": "__init__",
"signature": "def __init__(self, capacity)"
},
{
"docstring": ":rtype: int",
"name": "get",
"signature": "def get(self, key)"
},
{
"docstring": ":type key: int :type value: int :rtype: nothing",
"name": "set",
"sig... | 3 | null | Implement the Python class `LRUCache` described below.
Class description:
Implement the LRUCache class.
Method signatures and docstrings:
- def __init__(self, capacity): :type capacity: int
- def get(self, key): :rtype: int
- def set(self, key, value): :type key: int :type value: int :rtype: nothing | Implement the Python class `LRUCache` described below.
Class description:
Implement the LRUCache class.
Method signatures and docstrings:
- def __init__(self, capacity): :type capacity: int
- def get(self, key): :rtype: int
- def set(self, key, value): :type key: int :type value: int :rtype: nothing
<|skeleton|>
cla... | 6dfdffc075488af717b4e8d486bc3a9222f2721c | <|skeleton|>
class LRUCache:
def __init__(self, capacity):
""":type capacity: int"""
<|body_0|>
def get(self, key):
""":rtype: int"""
<|body_1|>
def set(self, key, value):
""":type key: int :type value: int :rtype: nothing"""
<|body_2|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class LRUCache:
def __init__(self, capacity):
""":type capacity: int"""
self.cache = []
self.hash_map = {}
self.capacity = capacity
def get(self, key):
""":rtype: int"""
if key in self.hash_map:
index = self.cache.index(key)
del self.cache... | the_stack_v2_python_sparse | LRUcache.py | kns94/algorithms_practice | train | 0 | |
420be07774e250b1b3349a22a54715b27b101592 | [
"this_click_time = time.time()\ntime_to_last_click = None\nif cls.last_click_time:\n time_to_last_click = this_click_time - cls.last_click_time\ncls.last_click_time = this_click_time\nreturn time_to_last_click and time_to_last_click < 0.7",
"is_parent = cloud_plot.is_parent_artist(artist, ind)\ngen = cloud_plo... | <|body_start_0|>
this_click_time = time.time()
time_to_last_click = None
if cls.last_click_time:
time_to_last_click = this_click_time - cls.last_click_time
cls.last_click_time = this_click_time
return time_to_last_click and time_to_last_click < 0.7
<|end_body_0|>
<|b... | mouse pick event on cloud plot | PointClick | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class PointClick:
"""mouse pick event on cloud plot"""
def rate_limiting(cls):
"""limit the rate of clicking"""
<|body_0|>
def button_1(cls, cloud_plot, artist, ind):
"""click with button 1, i.e., left button"""
<|body_1|>
def button_3(cls, cloud_plot, art... | stack_v2_sparse_classes_36k_train_024969 | 4,481 | permissive | [
{
"docstring": "limit the rate of clicking",
"name": "rate_limiting",
"signature": "def rate_limiting(cls)"
},
{
"docstring": "click with button 1, i.e., left button",
"name": "button_1",
"signature": "def button_1(cls, cloud_plot, artist, ind)"
},
{
"docstring": "click with butt... | 4 | stack_v2_sparse_classes_30k_train_008036 | Implement the Python class `PointClick` described below.
Class description:
mouse pick event on cloud plot
Method signatures and docstrings:
- def rate_limiting(cls): limit the rate of clicking
- def button_1(cls, cloud_plot, artist, ind): click with button 1, i.e., left button
- def button_3(cls, cloud_plot, artist,... | Implement the Python class `PointClick` described below.
Class description:
mouse pick event on cloud plot
Method signatures and docstrings:
- def rate_limiting(cls): limit the rate of clicking
- def button_1(cls, cloud_plot, artist, ind): click with button 1, i.e., left button
- def button_3(cls, cloud_plot, artist,... | d0132c8a64516fbb45eb1e645c6312bbe56a7bc5 | <|skeleton|>
class PointClick:
"""mouse pick event on cloud plot"""
def rate_limiting(cls):
"""limit the rate of clicking"""
<|body_0|>
def button_1(cls, cloud_plot, artist, ind):
"""click with button 1, i.e., left button"""
<|body_1|>
def button_3(cls, cloud_plot, art... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class PointClick:
"""mouse pick event on cloud plot"""
def rate_limiting(cls):
"""limit the rate of clicking"""
this_click_time = time.time()
time_to_last_click = None
if cls.last_click_time:
time_to_last_click = this_click_time - cls.last_click_time
cls.last... | the_stack_v2_python_sparse | visual_inspector/figure_base/mouse_event.py | justin-nguyen-1996/deep-neuroevolution | train | 1 |
9820628612a6ee1acf247a6d1c483b78e0ac111a | [
"self.dq = collections.deque()\nfor i in range(1, n + 1):\n self.dq.append(i)\nself.t = collections.deque()",
"if k == len(self.dq):\n return self.dq[-1]\nwhile k != 0:\n k -= 1\n self.t.append(self.dq.popleft())\nr = self.t[-1]\nself.dq.append(self.t.pop())\nwhile self.t:\n self.dq.appendleft(self... | <|body_start_0|>
self.dq = collections.deque()
for i in range(1, n + 1):
self.dq.append(i)
self.t = collections.deque()
<|end_body_0|>
<|body_start_1|>
if k == len(self.dq):
return self.dq[-1]
while k != 0:
k -= 1
self.t.append(sel... | MRUQueue | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class MRUQueue:
def __init__(self, n):
""":type n: int"""
<|body_0|>
def fetch(self, k):
""":type k: int :rtype: int"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
self.dq = collections.deque()
for i in range(1, n + 1):
self.dq.append... | stack_v2_sparse_classes_36k_train_024970 | 754 | no_license | [
{
"docstring": ":type n: int",
"name": "__init__",
"signature": "def __init__(self, n)"
},
{
"docstring": ":type k: int :rtype: int",
"name": "fetch",
"signature": "def fetch(self, k)"
}
] | 2 | stack_v2_sparse_classes_30k_train_013972 | Implement the Python class `MRUQueue` described below.
Class description:
Implement the MRUQueue class.
Method signatures and docstrings:
- def __init__(self, n): :type n: int
- def fetch(self, k): :type k: int :rtype: int | Implement the Python class `MRUQueue` described below.
Class description:
Implement the MRUQueue class.
Method signatures and docstrings:
- def __init__(self, n): :type n: int
- def fetch(self, k): :type k: int :rtype: int
<|skeleton|>
class MRUQueue:
def __init__(self, n):
""":type n: int"""
<|... | 20623defecf65cbc35b194d8b60d8b211816ee4f | <|skeleton|>
class MRUQueue:
def __init__(self, n):
""":type n: int"""
<|body_0|>
def fetch(self, k):
""":type k: int :rtype: int"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class MRUQueue:
def __init__(self, n):
""":type n: int"""
self.dq = collections.deque()
for i in range(1, n + 1):
self.dq.append(i)
self.t = collections.deque()
def fetch(self, k):
""":type k: int :rtype: int"""
if k == len(self.dq):
retur... | the_stack_v2_python_sparse | in_Python/1756 Design Most Recently Used Queue.py | YangLiyli131/Leetcode2020 | train | 0 | |
784853d4e7f89f3f808949c56bb430cdb7f79c39 | [
"if request.version == 'v6':\n return self.post_v6(request)\nelse:\n Http404()",
"title = rest_util.parse_string(request, 'title', required=False)\ndescription = rest_util.parse_string(request, 'description', required=False)\ndefinition_dict = rest_util.parse_dict(request, 'definition', required=True)\nvali... | <|body_start_0|>
if request.version == 'v6':
return self.post_v6(request)
else:
Http404()
<|end_body_0|>
<|body_start_1|>
title = rest_util.parse_string(request, 'title', required=False)
description = rest_util.parse_string(request, 'description', required=False)... | This view is the endpoint for validating a new dataset before attempting to create it | DataSetValidationView | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class DataSetValidationView:
"""This view is the endpoint for validating a new dataset before attempting to create it"""
def post(self, request):
"""Validates a new dataset and returns any errors/warnings discovered :param request: the HTTP POST request :type request: :class:`rest_framewor... | stack_v2_sparse_classes_36k_train_024971 | 24,544 | permissive | [
{
"docstring": "Validates a new dataset and returns any errors/warnings discovered :param request: the HTTP POST request :type request: :class:`rest_framework.request.Request` :rtype: :class:`rest_framework.response.Response` :returns: the HTTP response to send back to the user",
"name": "post",
"signat... | 2 | null | Implement the Python class `DataSetValidationView` described below.
Class description:
This view is the endpoint for validating a new dataset before attempting to create it
Method signatures and docstrings:
- def post(self, request): Validates a new dataset and returns any errors/warnings discovered :param request: t... | Implement the Python class `DataSetValidationView` described below.
Class description:
This view is the endpoint for validating a new dataset before attempting to create it
Method signatures and docstrings:
- def post(self, request): Validates a new dataset and returns any errors/warnings discovered :param request: t... | 28618aee07ceed9e4a6eb7b8d0e6f05b31d8fd6b | <|skeleton|>
class DataSetValidationView:
"""This view is the endpoint for validating a new dataset before attempting to create it"""
def post(self, request):
"""Validates a new dataset and returns any errors/warnings discovered :param request: the HTTP POST request :type request: :class:`rest_framewor... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class DataSetValidationView:
"""This view is the endpoint for validating a new dataset before attempting to create it"""
def post(self, request):
"""Validates a new dataset and returns any errors/warnings discovered :param request: the HTTP POST request :type request: :class:`rest_framework.request.Req... | the_stack_v2_python_sparse | scale/data/views.py | kfconsultant/scale | train | 0 |
a04b470e7d25d5e3c84ed20fcccf8888c8eb304f | [
"self.max_frames = max_frames\nself.count = 0\nself.payload = b''",
"self.count += 1\nself.payload += data\nif self.count == self.max_frames:\n self.process(cli)",
"get_processor(cli).process(self.count, self.payload, cli)\nself.count = 0\nself.payload = b''"
] | <|body_start_0|>
self.max_frames = max_frames
self.count = 0
self.payload = b''
<|end_body_0|>
<|body_start_1|>
self.count += 1
self.payload += data
if self.count == self.max_frames:
self.process(cli)
<|end_body_1|>
<|body_start_2|>
get_processor(cli... | BufferedPipe | [
"MIT",
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class BufferedPipe:
def __init__(self, max_frames):
"""Create a buffer which will call the provided processor (sink) when full. It will call the processor with the number of frames and the accumulated bytes when it reaches `max_buffer_size` frames."""
<|body_0|>
def append(self, d... | stack_v2_sparse_classes_36k_train_024972 | 13,915 | permissive | [
{
"docstring": "Create a buffer which will call the provided processor (sink) when full. It will call the processor with the number of frames and the accumulated bytes when it reaches `max_buffer_size` frames.",
"name": "__init__",
"signature": "def __init__(self, max_frames)"
},
{
"docstring": ... | 3 | stack_v2_sparse_classes_30k_train_004702 | Implement the Python class `BufferedPipe` described below.
Class description:
Implement the BufferedPipe class.
Method signatures and docstrings:
- def __init__(self, max_frames): Create a buffer which will call the provided processor (sink) when full. It will call the processor with the number of frames and the accu... | Implement the Python class `BufferedPipe` described below.
Class description:
Implement the BufferedPipe class.
Method signatures and docstrings:
- def __init__(self, max_frames): Create a buffer which will call the provided processor (sink) when full. It will call the processor with the number of frames and the accu... | 11991dc8d2220fef19e9a5ed10acbb3e6311bca8 | <|skeleton|>
class BufferedPipe:
def __init__(self, max_frames):
"""Create a buffer which will call the provided processor (sink) when full. It will call the processor with the number of frames and the accumulated bytes when it reaches `max_buffer_size` frames."""
<|body_0|>
def append(self, d... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class BufferedPipe:
def __init__(self, max_frames):
"""Create a buffer which will call the provided processor (sink) when full. It will call the processor with the number of frames and the accumulated bytes when it reaches `max_buffer_size` frames."""
self.max_frames = max_frames
self.count ... | the_stack_v2_python_sparse | legacy-server/sepia_stt_server.py | SEPIA-Framework/sepia-stt-server | train | 98 | |
571ef9f7b97e19a9791c2e48ad1dcbda8d004624 | [
"appearences = {}\nstart_idx = 0\nmax_len = 0\nfor current_idx, ch in enumerate(s):\n if ch in appearences and start_idx <= appearences[ch]:\n start_idx = appearences[ch] + 1\n else:\n max_len = max(max_len, current_idx - start_idx + 1)\n appearences[ch] = current_idx\nreturn max_len",
"lon... | <|body_start_0|>
appearences = {}
start_idx = 0
max_len = 0
for current_idx, ch in enumerate(s):
if ch in appearences and start_idx <= appearences[ch]:
start_idx = appearences[ch] + 1
else:
max_len = max(max_len, current_idx - start... | Solution | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def lengthOfLongestSubstring22(self, s):
""":type s: str :rtype: int"""
<|body_0|>
def lengthOfLongestSubstring(self, s):
""":type s: str :rtype: int"""
<|body_1|>
def lengthOfLongestSubstring2(self, s):
""":type s: str :rtype: int"""
... | stack_v2_sparse_classes_36k_train_024973 | 3,084 | no_license | [
{
"docstring": ":type s: str :rtype: int",
"name": "lengthOfLongestSubstring22",
"signature": "def lengthOfLongestSubstring22(self, s)"
},
{
"docstring": ":type s: str :rtype: int",
"name": "lengthOfLongestSubstring",
"signature": "def lengthOfLongestSubstring(self, s)"
},
{
"doc... | 3 | null | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def lengthOfLongestSubstring22(self, s): :type s: str :rtype: int
- def lengthOfLongestSubstring(self, s): :type s: str :rtype: int
- def lengthOfLongestSubstring2(self, s): :typ... | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def lengthOfLongestSubstring22(self, s): :type s: str :rtype: int
- def lengthOfLongestSubstring(self, s): :type s: str :rtype: int
- def lengthOfLongestSubstring2(self, s): :typ... | 507d4982eb4fc1d3afa5dfdc0e7b6830ff8594ad | <|skeleton|>
class Solution:
def lengthOfLongestSubstring22(self, s):
""":type s: str :rtype: int"""
<|body_0|>
def lengthOfLongestSubstring(self, s):
""":type s: str :rtype: int"""
<|body_1|>
def lengthOfLongestSubstring2(self, s):
""":type s: str :rtype: int"""
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def lengthOfLongestSubstring22(self, s):
""":type s: str :rtype: int"""
appearences = {}
start_idx = 0
max_len = 0
for current_idx, ch in enumerate(s):
if ch in appearences and start_idx <= appearences[ch]:
start_idx = appearences[c... | the_stack_v2_python_sparse | longest-substring-without-repeating-characters_.py | igor-nov/algorithms | train | 0 | |
0261107220b884863048d4bb18b15a618ff4ea17 | [
"super().__init__(observation_spec, action_spec, reward_spec=reward_spec, env=env, config=config, debug_summaries=debug_summaries, name=name)\nself._distance_to_decelerate = distance_to_decelerate\nself._distance_to_stop = distance_to_stop",
"waypoints = alf.nest.get_field(observation, 'observation.navigation')\n... | <|body_start_0|>
super().__init__(observation_spec, action_spec, reward_spec=reward_spec, env=env, config=config, debug_summaries=debug_summaries, name=name)
self._distance_to_decelerate = distance_to_decelerate
self._distance_to_stop = distance_to_stop
<|end_body_0|>
<|body_start_1|>
w... | A simple controller for Carla environment. | SimpleCarlaAlgorithm | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class SimpleCarlaAlgorithm:
"""A simple controller for Carla environment."""
def __init__(self, observation_spec, action_spec: BoundedTensorSpec, reward_spec=TensorSpec(()), distance_to_decelerate=50.0, distance_to_stop=1.0, env=None, config: TrainerConfig=None, debug_summaries=False, name='Simple... | stack_v2_sparse_classes_36k_train_024974 | 8,254 | permissive | [
{
"docstring": "Args: observation_spec (nested TensorSpec): representing the observations. action_spec (nested BoundedTensorSpec): representing the actions. reward_spec (TensorSpec): a rank-1 or rank-0 tensor spec representing the reward(s). distance_to_decelerate (float|int): the distance in meter to goal from... | 2 | null | Implement the Python class `SimpleCarlaAlgorithm` described below.
Class description:
A simple controller for Carla environment.
Method signatures and docstrings:
- def __init__(self, observation_spec, action_spec: BoundedTensorSpec, reward_spec=TensorSpec(()), distance_to_decelerate=50.0, distance_to_stop=1.0, env=N... | Implement the Python class `SimpleCarlaAlgorithm` described below.
Class description:
A simple controller for Carla environment.
Method signatures and docstrings:
- def __init__(self, observation_spec, action_spec: BoundedTensorSpec, reward_spec=TensorSpec(()), distance_to_decelerate=50.0, distance_to_stop=1.0, env=N... | b00ff2fa5e660de31020338ba340263183fbeaa4 | <|skeleton|>
class SimpleCarlaAlgorithm:
"""A simple controller for Carla environment."""
def __init__(self, observation_spec, action_spec: BoundedTensorSpec, reward_spec=TensorSpec(()), distance_to_decelerate=50.0, distance_to_stop=1.0, env=None, config: TrainerConfig=None, debug_summaries=False, name='Simple... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class SimpleCarlaAlgorithm:
"""A simple controller for Carla environment."""
def __init__(self, observation_spec, action_spec: BoundedTensorSpec, reward_spec=TensorSpec(()), distance_to_decelerate=50.0, distance_to_stop=1.0, env=None, config: TrainerConfig=None, debug_summaries=False, name='SimpleCarlaAlgorith... | the_stack_v2_python_sparse | alf/algorithms/handcrafted_algorithm.py | HorizonRobotics/alf | train | 288 |
4c8a321d05ea10be2837e0358786c29c5a538a36 | [
"try:\n response, status = (DistributionCodeService.find_fee_schedules_by_distribution_id(distribution_code_id), HTTPStatus.OK)\nexcept BusinessException as exception:\n return exception.response()\nreturn (jsonify(response), status)",
"request_json = request.get_json()\ntry:\n DistributionCodeService.cr... | <|body_start_0|>
try:
response, status = (DistributionCodeService.find_fee_schedules_by_distribution_id(distribution_code_id), HTTPStatus.OK)
except BusinessException as exception:
return exception.response()
return (jsonify(response), status)
<|end_body_0|>
<|body_start... | Endpoint resource to handle Distribution Schedules. | DistributionSchedules | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class DistributionSchedules:
"""Endpoint resource to handle Distribution Schedules."""
def get(distribution_code_id: int):
"""Return all fee schedules linked to the distribution."""
<|body_0|>
def post(distribution_code_id: int):
"""Create link between distribution and... | stack_v2_sparse_classes_36k_train_024975 | 5,455 | permissive | [
{
"docstring": "Return all fee schedules linked to the distribution.",
"name": "get",
"signature": "def get(distribution_code_id: int)"
},
{
"docstring": "Create link between distribution and fee schedule.",
"name": "post",
"signature": "def post(distribution_code_id: int)"
}
] | 2 | null | Implement the Python class `DistributionSchedules` described below.
Class description:
Endpoint resource to handle Distribution Schedules.
Method signatures and docstrings:
- def get(distribution_code_id: int): Return all fee schedules linked to the distribution.
- def post(distribution_code_id: int): Create link bet... | Implement the Python class `DistributionSchedules` described below.
Class description:
Endpoint resource to handle Distribution Schedules.
Method signatures and docstrings:
- def get(distribution_code_id: int): Return all fee schedules linked to the distribution.
- def post(distribution_code_id: int): Create link bet... | 0d71d37b0e08d11f6b6d9f59a4b202dfabc98fc1 | <|skeleton|>
class DistributionSchedules:
"""Endpoint resource to handle Distribution Schedules."""
def get(distribution_code_id: int):
"""Return all fee schedules linked to the distribution."""
<|body_0|>
def post(distribution_code_id: int):
"""Create link between distribution and... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class DistributionSchedules:
"""Endpoint resource to handle Distribution Schedules."""
def get(distribution_code_id: int):
"""Return all fee schedules linked to the distribution."""
try:
response, status = (DistributionCodeService.find_fee_schedules_by_distribution_id(distribution_c... | the_stack_v2_python_sparse | pay-api/src/pay_api/resources/distributions.py | bcgov/sbc-pay | train | 6 |
bfe785508a0aeb210e7ede7c1fa0e3bdcd999bf7 | [
"board_id = await self.__board_id(urls[0])\napi_url = URL(f'{urls[0]}/rest/greenhopper/1.0/rapid/charts/velocity.json?rapidViewId={board_id}')\nreturn await super()._get_source_responses(api_url)",
"api_url = await self._api_url()\nboard_id = parse_qs(urlparse(str(responses.api_url)).query)['rapidViewId'][0]\nent... | <|body_start_0|>
board_id = await self.__board_id(urls[0])
api_url = URL(f'{urls[0]}/rest/greenhopper/1.0/rapid/charts/velocity.json?rapidViewId={board_id}')
return await super()._get_source_responses(api_url)
<|end_body_0|>
<|body_start_1|>
api_url = await self._api_url()
board... | Collector to get sprint velocity from Jira. | JiraVelocity | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class JiraVelocity:
"""Collector to get sprint velocity from Jira."""
async def _get_source_responses(self, *urls: URL) -> SourceResponses:
"""Extend to pass the Greenhopper velocity chart API."""
<|body_0|>
async def _parse_source_responses(self, responses: SourceResponses) -... | stack_v2_sparse_classes_36k_train_024976 | 4,976 | permissive | [
{
"docstring": "Extend to pass the Greenhopper velocity chart API.",
"name": "_get_source_responses",
"signature": "async def _get_source_responses(self, *urls: URL) -> SourceResponses"
},
{
"docstring": "Override to parse the sprint values from the responses.",
"name": "_parse_source_respon... | 6 | null | Implement the Python class `JiraVelocity` described below.
Class description:
Collector to get sprint velocity from Jira.
Method signatures and docstrings:
- async def _get_source_responses(self, *urls: URL) -> SourceResponses: Extend to pass the Greenhopper velocity chart API.
- async def _parse_source_responses(sel... | Implement the Python class `JiraVelocity` described below.
Class description:
Collector to get sprint velocity from Jira.
Method signatures and docstrings:
- async def _get_source_responses(self, *urls: URL) -> SourceResponses: Extend to pass the Greenhopper velocity chart API.
- async def _parse_source_responses(sel... | 5d9952bf0bd47895824fa78428d3e4f4d6b5d9b3 | <|skeleton|>
class JiraVelocity:
"""Collector to get sprint velocity from Jira."""
async def _get_source_responses(self, *urls: URL) -> SourceResponses:
"""Extend to pass the Greenhopper velocity chart API."""
<|body_0|>
async def _parse_source_responses(self, responses: SourceResponses) -... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class JiraVelocity:
"""Collector to get sprint velocity from Jira."""
async def _get_source_responses(self, *urls: URL) -> SourceResponses:
"""Extend to pass the Greenhopper velocity chart API."""
board_id = await self.__board_id(urls[0])
api_url = URL(f'{urls[0]}/rest/greenhopper/1.0/r... | the_stack_v2_python_sparse | components/collector/src/source_collectors/jira/velocity.py | ICTU/quality-time | train | 43 |
07c372fb5d11e70a822c1a8af603fe36562d9e52 | [
"super().__init__(reporters, max_iterations, evaluator, individual_generator, target_fitness)\nself.selector = selector\nself.crossover = crossover\nself.mutation = mutation\nself.population_size = population_size\nself.population = individual_generator.batch_generate(population_size)",
"self.evaluator.batch_eval... | <|body_start_0|>
super().__init__(reporters, max_iterations, evaluator, individual_generator, target_fitness)
self.selector = selector
self.crossover = crossover
self.mutation = mutation
self.population_size = population_size
self.population = individual_generator.batch_g... | Genetic algorithm class | GeneticAlgorithm | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class GeneticAlgorithm:
"""Genetic algorithm class"""
def __init__(self, reporters, evaluator, selector, crossover, mutation, population_size, individual_generator, max_iterations, target_fitness=None):
"""Initialize genetic algorithm hyperparameters. :param evaluator: Evaluator instance :... | stack_v2_sparse_classes_36k_train_024977 | 2,221 | no_license | [
{
"docstring": "Initialize genetic algorithm hyperparameters. :param evaluator: Evaluator instance :param reporters: List of Reporter instances :param selector: Selector to be used :param crossover: Crossover to be used :param mutation: Mutation to be used :param population_size: population size :param individu... | 2 | stack_v2_sparse_classes_30k_train_012917 | Implement the Python class `GeneticAlgorithm` described below.
Class description:
Genetic algorithm class
Method signatures and docstrings:
- def __init__(self, reporters, evaluator, selector, crossover, mutation, population_size, individual_generator, max_iterations, target_fitness=None): Initialize genetic algorith... | Implement the Python class `GeneticAlgorithm` described below.
Class description:
Genetic algorithm class
Method signatures and docstrings:
- def __init__(self, reporters, evaluator, selector, crossover, mutation, population_size, individual_generator, max_iterations, target_fitness=None): Initialize genetic algorith... | 30d87754ed22aa5aab7103d912c414f5a6150a34 | <|skeleton|>
class GeneticAlgorithm:
"""Genetic algorithm class"""
def __init__(self, reporters, evaluator, selector, crossover, mutation, population_size, individual_generator, max_iterations, target_fitness=None):
"""Initialize genetic algorithm hyperparameters. :param evaluator: Evaluator instance :... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class GeneticAlgorithm:
"""Genetic algorithm class"""
def __init__(self, reporters, evaluator, selector, crossover, mutation, population_size, individual_generator, max_iterations, target_fitness=None):
"""Initialize genetic algorithm hyperparameters. :param evaluator: Evaluator instance :param reporte... | the_stack_v2_python_sparse | algorithms/genetic_algorithm.py | Yabk/SF-Evolution | train | 0 |
3f0b8d03bb81763f0e1b0ba5c89e9cf5fa6efe42 | [
"self._skeleton = server.TrunkSkeleton()\nself._stub = server.TrunkStub()\nLOG.debug('RPC backend initialized for trunk plugin')\nfor event_type in (events.AFTER_CREATE, events.AFTER_DELETE):\n registry.subscribe(self.process_event, resources.TRUNK, event_type)\n registry.subscribe(self.process_event, resourc... | <|body_start_0|>
self._skeleton = server.TrunkSkeleton()
self._stub = server.TrunkStub()
LOG.debug('RPC backend initialized for trunk plugin')
for event_type in (events.AFTER_CREATE, events.AFTER_DELETE):
registry.subscribe(self.process_event, resources.TRUNK, event_type)
... | The Neutron Server RPC backend. | ServerSideRpcBackend | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ServerSideRpcBackend:
"""The Neutron Server RPC backend."""
def __init__(self):
"""Initialize an RPC backend for the Neutron Server."""
<|body_0|>
def process_event(self, resource, event, trunk_plugin, payload):
"""Emit RPC notifications to registered subscribers... | stack_v2_sparse_classes_36k_train_024978 | 2,676 | permissive | [
{
"docstring": "Initialize an RPC backend for the Neutron Server.",
"name": "__init__",
"signature": "def __init__(self)"
},
{
"docstring": "Emit RPC notifications to registered subscribers.",
"name": "process_event",
"signature": "def process_event(self, resource, event, trunk_plugin, p... | 2 | stack_v2_sparse_classes_30k_train_005823 | Implement the Python class `ServerSideRpcBackend` described below.
Class description:
The Neutron Server RPC backend.
Method signatures and docstrings:
- def __init__(self): Initialize an RPC backend for the Neutron Server.
- def process_event(self, resource, event, trunk_plugin, payload): Emit RPC notifications to r... | Implement the Python class `ServerSideRpcBackend` described below.
Class description:
The Neutron Server RPC backend.
Method signatures and docstrings:
- def __init__(self): Initialize an RPC backend for the Neutron Server.
- def process_event(self, resource, event, trunk_plugin, payload): Emit RPC notifications to r... | dde31aae392b80341f6440eb38db1583563d7d1f | <|skeleton|>
class ServerSideRpcBackend:
"""The Neutron Server RPC backend."""
def __init__(self):
"""Initialize an RPC backend for the Neutron Server."""
<|body_0|>
def process_event(self, resource, event, trunk_plugin, payload):
"""Emit RPC notifications to registered subscribers... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ServerSideRpcBackend:
"""The Neutron Server RPC backend."""
def __init__(self):
"""Initialize an RPC backend for the Neutron Server."""
self._skeleton = server.TrunkSkeleton()
self._stub = server.TrunkStub()
LOG.debug('RPC backend initialized for trunk plugin')
for... | the_stack_v2_python_sparse | neutron/services/trunk/rpc/backend.py | openstack/neutron | train | 1,174 |
446f93db141f6f425732417fb84e211bbd69465d | [
"super().__init__()\nself.encoder = Encoder(N, dm, h, hidden, input_vocab, max_seq_input, drop_rate)\nself.decoder = Decoder(N, dm, h, hidden, target_vocab, max_seq_target, drop_rate)\nself.linear = tf.keras.layers.Dense(target_vocab)",
"enc_output = self.encoder(inputs, training, encoder_mask)\ndec_output, atten... | <|body_start_0|>
super().__init__()
self.encoder = Encoder(N, dm, h, hidden, input_vocab, max_seq_input, drop_rate)
self.decoder = Decoder(N, dm, h, hidden, target_vocab, max_seq_target, drop_rate)
self.linear = tf.keras.layers.Dense(target_vocab)
<|end_body_0|>
<|body_start_1|>
... | class Transform | Transformer | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Transformer:
"""class Transform"""
def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1):
"""* N - the number of blocks in the encoder and decoder * dm - the dimensionality of the model * h - the number of heads * hidden - the n... | stack_v2_sparse_classes_36k_train_024979 | 18,002 | no_license | [
{
"docstring": "* N - the number of blocks in the encoder and decoder * dm - the dimensionality of the model * h - the number of heads * hidden - the number of hidden units in the fully connected layers * input_vocab - the size of the input vocabulary * target_vocab - the size of the target vocabulary * max_seq... | 2 | stack_v2_sparse_classes_30k_train_005338 | Implement the Python class `Transformer` described below.
Class description:
class Transform
Method signatures and docstrings:
- def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1): * N - the number of blocks in the encoder and decoder * dm - the dimensionalit... | Implement the Python class `Transformer` described below.
Class description:
class Transform
Method signatures and docstrings:
- def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1): * N - the number of blocks in the encoder and decoder * dm - the dimensionalit... | 8ad4c2594ff78b345dbd92e9d54d2a143ac4071a | <|skeleton|>
class Transformer:
"""class Transform"""
def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1):
"""* N - the number of blocks in the encoder and decoder * dm - the dimensionality of the model * h - the number of heads * hidden - the n... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Transformer:
"""class Transform"""
def __init__(self, N, dm, h, hidden, input_vocab, target_vocab, max_seq_input, max_seq_target, drop_rate=0.1):
"""* N - the number of blocks in the encoder and decoder * dm - the dimensionality of the model * h - the number of heads * hidden - the number of hidd... | the_stack_v2_python_sparse | supervised_learning/0x12-transformer_apps/5-transformer.py | jorgezafra94/holbertonschool-machine_learning | train | 1 |
1ff0fd9d0f442f04e185a512151b68c7a988cc0f | [
"if data is None:\n if n < 1:\n raise ValueError('n must be a positive value')\n else:\n self.n = int(n)\n if p >= 1 or p <= 0:\n raise ValueError('p must be greater than 0 and less than 1')\n else:\n self.p = float(p)\nelse:\n if type(data) is not list:\n raise Typ... | <|body_start_0|>
if data is None:
if n < 1:
raise ValueError('n must be a positive value')
else:
self.n = int(n)
if p >= 1 or p <= 0:
raise ValueError('p must be greater than 0 and less than 1')
else:
... | Class binomial distribution | Binomial | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Binomial:
"""Class binomial distribution"""
def __init__(self, data=None, n=1, p=0.5):
"""Class contructor"""
<|body_0|>
def pmf(self, k):
"""Probability Mass Function for binomial"""
<|body_1|>
def cdf(self, k):
"""Cumulative Distribution Fu... | stack_v2_sparse_classes_36k_train_024980 | 1,943 | no_license | [
{
"docstring": "Class contructor",
"name": "__init__",
"signature": "def __init__(self, data=None, n=1, p=0.5)"
},
{
"docstring": "Probability Mass Function for binomial",
"name": "pmf",
"signature": "def pmf(self, k)"
},
{
"docstring": "Cumulative Distribution Function for binom... | 3 | stack_v2_sparse_classes_30k_train_010163 | Implement the Python class `Binomial` described below.
Class description:
Class binomial distribution
Method signatures and docstrings:
- def __init__(self, data=None, n=1, p=0.5): Class contructor
- def pmf(self, k): Probability Mass Function for binomial
- def cdf(self, k): Cumulative Distribution Function for bino... | Implement the Python class `Binomial` described below.
Class description:
Class binomial distribution
Method signatures and docstrings:
- def __init__(self, data=None, n=1, p=0.5): Class contructor
- def pmf(self, k): Probability Mass Function for binomial
- def cdf(self, k): Cumulative Distribution Function for bino... | 6778dd5a728d07030a9e635266c30f089cdf4ff0 | <|skeleton|>
class Binomial:
"""Class binomial distribution"""
def __init__(self, data=None, n=1, p=0.5):
"""Class contructor"""
<|body_0|>
def pmf(self, k):
"""Probability Mass Function for binomial"""
<|body_1|>
def cdf(self, k):
"""Cumulative Distribution Fu... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Binomial:
"""Class binomial distribution"""
def __init__(self, data=None, n=1, p=0.5):
"""Class contructor"""
if data is None:
if n < 1:
raise ValueError('n must be a positive value')
else:
self.n = int(n)
if p >= 1 or p ... | the_stack_v2_python_sparse | math/0x03-probability/binomial.py | ranakh23/holbertonschool-machine_learning | train | 0 |
1a97c51cb6c8ec32847aa86cae3f67543fe1e36d | [
"def _doLogin(soapStub):\n si = vim.ServiceInstance('ServiceInstance', soapStub)\n sm = si.content.sessionManager\n if not sm.currentSession:\n si.content.sessionManager.Login(username, password, locale)\nreturn _doLogin",
"def _doLogin(soapStub):\n si = vim.ServiceInstance('ServiceInstance', s... | <|body_start_0|>
def _doLogin(soapStub):
si = vim.ServiceInstance('ServiceInstance', soapStub)
sm = si.content.sessionManager
if not sm.currentSession:
si.content.sessionManager.Login(username, password, locale)
return _doLogin
<|end_body_0|>
<|body_s... | A vim-specific SessionOrientedStub. See the SessionOrientedStub class in pyVmomi/SoapAdapter.py for more information. | VimSessionOrientedStub | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class VimSessionOrientedStub:
"""A vim-specific SessionOrientedStub. See the SessionOrientedStub class in pyVmomi/SoapAdapter.py for more information."""
def makeUserLoginMethod(username, password, locale=None):
"""Return a function that will call the vim.SessionManager.Login() method with... | stack_v2_sparse_classes_36k_train_024981 | 38,725 | permissive | [
{
"docstring": "Return a function that will call the vim.SessionManager.Login() method with the given parameters. The result of this function can be passed as the \"loginMethod\" to a SessionOrientedStub constructor.",
"name": "makeUserLoginMethod",
"signature": "def makeUserLoginMethod(username, passwo... | 4 | stack_v2_sparse_classes_30k_train_000689 | Implement the Python class `VimSessionOrientedStub` described below.
Class description:
A vim-specific SessionOrientedStub. See the SessionOrientedStub class in pyVmomi/SoapAdapter.py for more information.
Method signatures and docstrings:
- def makeUserLoginMethod(username, password, locale=None): Return a function ... | Implement the Python class `VimSessionOrientedStub` described below.
Class description:
A vim-specific SessionOrientedStub. See the SessionOrientedStub class in pyVmomi/SoapAdapter.py for more information.
Method signatures and docstrings:
- def makeUserLoginMethod(username, password, locale=None): Return a function ... | f0fe4e279cebdfdbca5bfce699063d15b1d3bd1d | <|skeleton|>
class VimSessionOrientedStub:
"""A vim-specific SessionOrientedStub. See the SessionOrientedStub class in pyVmomi/SoapAdapter.py for more information."""
def makeUserLoginMethod(username, password, locale=None):
"""Return a function that will call the vim.SessionManager.Login() method with... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class VimSessionOrientedStub:
"""A vim-specific SessionOrientedStub. See the SessionOrientedStub class in pyVmomi/SoapAdapter.py for more information."""
def makeUserLoginMethod(username, password, locale=None):
"""Return a function that will call the vim.SessionManager.Login() method with the given pa... | the_stack_v2_python_sparse | pyVim/connect.py | vmware/pyvmomi | train | 2,122 |
d9500e4a2f66a625ee319d0733ef3f3b0fac8f1d | [
"super().__init__()\nself.encoder = make_linear_chain(input_dim, architecture[:-1])\nself.mu = make_linear(architecture[-1], target_dim)\nself.var = make_linear(architecture[-1], target_dim)\nself.decoder = make_linear_chain(target_dim, list(reversed(architecture))[1:])",
"enc = run_linear_chain(self.encoder, inp... | <|body_start_0|>
super().__init__()
self.encoder = make_linear_chain(input_dim, architecture[:-1])
self.mu = make_linear(architecture[-1], target_dim)
self.var = make_linear(architecture[-1], target_dim)
self.decoder = make_linear_chain(target_dim, list(reversed(architecture))[1:... | Variational autoencoder Autoencoder instance that regularizes the compressed, latent space to ensure a degree of regularity and uniformity in it. Via this, sampling from the latent space and decoding can be assumed to be a data generation process. Assumes a normal distribution on the latent space vectors. | VAE | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class VAE:
"""Variational autoencoder Autoencoder instance that regularizes the compressed, latent space to ensure a degree of regularity and uniformity in it. Via this, sampling from the latent space and decoding can be assumed to be a data generation process. Assumes a normal distribution on the late... | stack_v2_sparse_classes_36k_train_024982 | 3,377 | no_license | [
{
"docstring": "Constructor for a VAE Arguments input_dim {int} -- The input features dimension target_dim {int} -- The reduced features dimension architecture {list} -- List of layer dimensions to insert between the input and reduced dimension",
"name": "__init__",
"signature": "def __init__(self, inpu... | 2 | stack_v2_sparse_classes_30k_train_009242 | Implement the Python class `VAE` described below.
Class description:
Variational autoencoder Autoencoder instance that regularizes the compressed, latent space to ensure a degree of regularity and uniformity in it. Via this, sampling from the latent space and decoding can be assumed to be a data generation process. As... | Implement the Python class `VAE` described below.
Class description:
Variational autoencoder Autoencoder instance that regularizes the compressed, latent space to ensure a degree of regularity and uniformity in it. Via this, sampling from the latent space and decoding can be assumed to be a data generation process. As... | 1375e4483aec18831df7c8af32ee02cecb26f82d | <|skeleton|>
class VAE:
"""Variational autoencoder Autoencoder instance that regularizes the compressed, latent space to ensure a degree of regularity and uniformity in it. Via this, sampling from the latent space and decoding can be assumed to be a data generation process. Assumes a normal distribution on the late... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class VAE:
"""Variational autoencoder Autoencoder instance that regularizes the compressed, latent space to ensure a degree of regularity and uniformity in it. Via this, sampling from the latent space and decoding can be assumed to be a data generation process. Assumes a normal distribution on the latent space vect... | the_stack_v2_python_sparse | transform/autoencoder.py | npit/nlp-semantic-augmentation | train | 3 |
cdbb4260cc79270824a70bd38f7d88d202bea3ea | [
"super(conv_block, self).__init__()\nconv_fn = getattr(nn, 'Conv{0}d'.format(dim))\nif stride == 1:\n ksize = 3\nelif stride == 2:\n ksize = 4\nelse:\n raise Exception('stride must be 1 or 2')\nself.main = conv_fn(in_channels, out_channels, ksize, stride, 1)\nself.activation = nn.LeakyReLU(0.2)",
"out = ... | <|body_start_0|>
super(conv_block, self).__init__()
conv_fn = getattr(nn, 'Conv{0}d'.format(dim))
if stride == 1:
ksize = 3
elif stride == 2:
ksize = 4
else:
raise Exception('stride must be 1 or 2')
self.main = conv_fn(in_channels, out_... | [conv_block] represents a single convolution block in the Unet which is a convolution based on the size of the input channel and output channels and then preforms a Leaky Relu with parameter 0.2. | conv_block | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class conv_block:
"""[conv_block] represents a single convolution block in the Unet which is a convolution based on the size of the input channel and output channels and then preforms a Leaky Relu with parameter 0.2."""
def __init__(self, dim, in_channels, out_channels, stride=1):
"""Insti... | stack_v2_sparse_classes_36k_train_024983 | 11,379 | permissive | [
{
"docstring": "Instiatiate the conv block :param dim: number of dimensions of the input :param in_channels: number of input channels :param out_channels: number of output channels :param stride: stride of the convolution",
"name": "__init__",
"signature": "def __init__(self, dim, in_channels, out_chann... | 2 | stack_v2_sparse_classes_30k_train_021219 | Implement the Python class `conv_block` described below.
Class description:
[conv_block] represents a single convolution block in the Unet which is a convolution based on the size of the input channel and output channels and then preforms a Leaky Relu with parameter 0.2.
Method signatures and docstrings:
- def __init... | Implement the Python class `conv_block` described below.
Class description:
[conv_block] represents a single convolution block in the Unet which is a convolution based on the size of the input channel and output channels and then preforms a Leaky Relu with parameter 0.2.
Method signatures and docstrings:
- def __init... | ae368ea39b4049afb4b54cb3447d26107c3a8ab1 | <|skeleton|>
class conv_block:
"""[conv_block] represents a single convolution block in the Unet which is a convolution based on the size of the input channel and output channels and then preforms a Leaky Relu with parameter 0.2."""
def __init__(self, dim, in_channels, out_channels, stride=1):
"""Insti... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class conv_block:
"""[conv_block] represents a single convolution block in the Unet which is a convolution based on the size of the input channel and output channels and then preforms a Leaky Relu with parameter 0.2."""
def __init__(self, dim, in_channels, out_channels, stride=1):
"""Instiatiate the co... | the_stack_v2_python_sparse | UMF-CMGR/models/layers.py | Linfeng-Tang/VIF-Benchmark | train | 29 |
115e070509a3f9c3e7c618263faedf6b4e97bff3 | [
"self.c = capacity\nself.used = []\nself.f = {}\nself.m = {}",
"if key not in self.m:\n return -1\nself.f[key] += 1\nself.used.remove(key)\nself.used.append(key)\nreturn self.m[key]",
"if self.c == 0:\n return\nif key in self.f:\n self.f[key] += 1\n self.used.remove(key)\n self.used.append(key)\n... | <|body_start_0|>
self.c = capacity
self.used = []
self.f = {}
self.m = {}
<|end_body_0|>
<|body_start_1|>
if key not in self.m:
return -1
self.f[key] += 1
self.used.remove(key)
self.used.append(key)
return self.m[key]
<|end_body_1|>
<... | 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 set(self, key, value):
""":type key: int :type value: int :rtype: void"""
<|body_2|>
<|end_s... | stack_v2_sparse_classes_36k_train_024984 | 1,544 | no_license | [
{
"docstring": ":type capacity: int",
"name": "__init__",
"signature": "def __init__(self, capacity)"
},
{
"docstring": ":type key: int :rtype: int",
"name": "get",
"signature": "def get(self, key)"
},
{
"docstring": ":type key: int :type value: int :rtype: void",
"name": "se... | 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 set(self, key, value): :type key: int :type value: int :rtype: void | 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 set(self, key, value): :type key: int :type value: int :rtype: void
<|sk... | fa1a63cb192666fc6aa5c7c72130993818ea58d0 | <|skeleton|>
class LFUCache:
def __init__(self, capacity):
""":type capacity: int"""
<|body_0|>
def get(self, key):
""":type key: int :rtype: int"""
<|body_1|>
def set(self, key, value):
""":type key: int :type value: int :rtype: void"""
<|body_2|>
<|end_s... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class LFUCache:
def __init__(self, capacity):
""":type capacity: int"""
self.c = capacity
self.used = []
self.f = {}
self.m = {}
def get(self, key):
""":type key: int :rtype: int"""
if key not in self.m:
return -1
self.f[key] += 1
... | the_stack_v2_python_sparse | q460.py | gitttttt/lc | train | 0 | |
85dfd7318ed8eb3f68e1aad19c6fdd6f37e1e4f7 | [
"gm_track = gmusic.GMusicTrack(title='Zhao Hua', artist='HVAD & Pan Daijing')\nexpected = ['HVAD', 'Pan Daijing']\nactual = gmspotify.get_gm_track_artists(gm_track)\nself.assertEqual(actual, expected)",
"gm_track = gmusic.GMusicTrack(title='Stretch Deep (feat. Eve Essex)', artist='James K')\nexpected = ['Eve Esse... | <|body_start_0|>
gm_track = gmusic.GMusicTrack(title='Zhao Hua', artist='HVAD & Pan Daijing')
expected = ['HVAD', 'Pan Daijing']
actual = gmspotify.get_gm_track_artists(gm_track)
self.assertEqual(actual, expected)
<|end_body_0|>
<|body_start_1|>
gm_track = gmusic.GMusicTrack(tit... | TestGetGMTrackArtists | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TestGetGMTrackArtists:
def test_get_gm_track_artists_ampersand(self):
"""Given a GM Track with an artist string containing multiple artists Should return a list of those artists"""
<|body_0|>
def test_get_gm_track_artists_ft_1(self):
"""Given a GM Track with a title ... | stack_v2_sparse_classes_36k_train_024985 | 9,283 | no_license | [
{
"docstring": "Given a GM Track with an artist string containing multiple artists Should return a list of those artists",
"name": "test_get_gm_track_artists_ampersand",
"signature": "def test_get_gm_track_artists_ampersand(self)"
},
{
"docstring": "Given a GM Track with a title featuring an art... | 3 | stack_v2_sparse_classes_30k_test_001009 | Implement the Python class `TestGetGMTrackArtists` described below.
Class description:
Implement the TestGetGMTrackArtists class.
Method signatures and docstrings:
- def test_get_gm_track_artists_ampersand(self): Given a GM Track with an artist string containing multiple artists Should return a list of those artists
... | Implement the Python class `TestGetGMTrackArtists` described below.
Class description:
Implement the TestGetGMTrackArtists class.
Method signatures and docstrings:
- def test_get_gm_track_artists_ampersand(self): Given a GM Track with an artist string containing multiple artists Should return a list of those artists
... | a29a9771ee1f03650b367b22d5a2bcbabc4d3990 | <|skeleton|>
class TestGetGMTrackArtists:
def test_get_gm_track_artists_ampersand(self):
"""Given a GM Track with an artist string containing multiple artists Should return a list of those artists"""
<|body_0|>
def test_get_gm_track_artists_ft_1(self):
"""Given a GM Track with a title ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TestGetGMTrackArtists:
def test_get_gm_track_artists_ampersand(self):
"""Given a GM Track with an artist string containing multiple artists Should return a list of those artists"""
gm_track = gmusic.GMusicTrack(title='Zhao Hua', artist='HVAD & Pan Daijing')
expected = ['HVAD', 'Pan Dai... | the_stack_v2_python_sparse | test_gmspotify.py | jdheyburn/gmspotify | train | 0 | |
1b347eeca875b9f23267b7e75ac82238e49b9c2c | [
"super(Inception3c, self).__init__()\nbranch1_list = [{'type': ConvBNLayer, 'num_channels': num_channels, 'num_filters': ch3x3reduced, 'filter_size': 1, 'stride': 1, 'padding': 0, 'act': 'relu'}, {'type': ConvBNLayer, 'num_channels': ch3x3reduced, 'num_filters': ch3x3, 'filter_size': 3, 'stride': 2, 'padding': 1, '... | <|body_start_0|>
super(Inception3c, self).__init__()
branch1_list = [{'type': ConvBNLayer, 'num_channels': num_channels, 'num_filters': ch3x3reduced, 'filter_size': 1, 'stride': 1, 'padding': 0, 'act': 'relu'}, {'type': ConvBNLayer, 'num_channels': ch3x3reduced, 'num_filters': ch3x3, 'filter_size': 3, '... | Inception3c | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Inception3c:
def __init__(self, num_channels, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2):
"""@Brief `Inception3c` @Parameters num_channels : channel numbers of input tensor ch3x3reduced : channel numbers of 1x1 conv before 3x3 conv ch3x3 : output channel numbe... | stack_v2_sparse_classes_36k_train_024986 | 22,436 | permissive | [
{
"docstring": "@Brief `Inception3c` @Parameters num_channels : channel numbers of input tensor ch3x3reduced : channel numbers of 1x1 conv before 3x3 conv ch3x3 : output channel numbers of 3x3 conv doublech3x3reduced : channel numbers of 1x1 conv before the double 3x3 convs doublech3x3_1 : output channel number... | 2 | stack_v2_sparse_classes_30k_train_016073 | Implement the Python class `Inception3c` described below.
Class description:
Implement the Inception3c class.
Method signatures and docstrings:
- def __init__(self, num_channels, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2): @Brief `Inception3c` @Parameters num_channels : channel numbers of ... | Implement the Python class `Inception3c` described below.
Class description:
Implement the Inception3c class.
Method signatures and docstrings:
- def __init__(self, num_channels, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2): @Brief `Inception3c` @Parameters num_channels : channel numbers of ... | 78ff3c3ab3906012a0f4a612251347632aa493a7 | <|skeleton|>
class Inception3c:
def __init__(self, num_channels, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2):
"""@Brief `Inception3c` @Parameters num_channels : channel numbers of input tensor ch3x3reduced : channel numbers of 1x1 conv before 3x3 conv ch3x3 : output channel numbe... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Inception3c:
def __init__(self, num_channels, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2):
"""@Brief `Inception3c` @Parameters num_channels : channel numbers of input tensor ch3x3reduced : channel numbers of 1x1 conv before 3x3 conv ch3x3 : output channel numbers of 3x3 conv... | the_stack_v2_python_sparse | ECO/paddle1.8/model/ECO.py | thinkall/Contrib | train | 1 | |
d009f1456d50d20ab77715744276f21133d6fd0b | [
"examples, _ = tfds.load('ted_hrlr_translate/pt_to_en', with_info=True, as_supervised=True)\nself.data_train = examples['train']\nself.data_valid = examples['validation']\nself.tokenizer_pt, self.tokenizer_en = self.tokenize_dataset(self.data_train)",
"tokenizer_pt = tfds.features.text.SubwordTextEncoder.build_fr... | <|body_start_0|>
examples, _ = tfds.load('ted_hrlr_translate/pt_to_en', with_info=True, as_supervised=True)
self.data_train = examples['train']
self.data_valid = examples['validation']
self.tokenizer_pt, self.tokenizer_en = self.tokenize_dataset(self.data_train)
<|end_body_0|>
<|body_st... | Data set | Dataset | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Dataset:
"""Data set"""
def __init__(self):
"""Data set"""
<|body_0|>
def tokenize_dataset(self, data):
"""Data set"""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
examples, _ = tfds.load('ted_hrlr_translate/pt_to_en', with_info=True, as_supervi... | stack_v2_sparse_classes_36k_train_024987 | 1,133 | no_license | [
{
"docstring": "Data set",
"name": "__init__",
"signature": "def __init__(self)"
},
{
"docstring": "Data set",
"name": "tokenize_dataset",
"signature": "def tokenize_dataset(self, data)"
}
] | 2 | stack_v2_sparse_classes_30k_train_018666 | Implement the Python class `Dataset` described below.
Class description:
Data set
Method signatures and docstrings:
- def __init__(self): Data set
- def tokenize_dataset(self, data): Data set | Implement the Python class `Dataset` described below.
Class description:
Data set
Method signatures and docstrings:
- def __init__(self): Data set
- def tokenize_dataset(self, data): Data set
<|skeleton|>
class Dataset:
"""Data set"""
def __init__(self):
"""Data set"""
<|body_0|>
def to... | 8761eb876046ad3c0c3f85d98dbdca4007d93cd1 | <|skeleton|>
class Dataset:
"""Data set"""
def __init__(self):
"""Data set"""
<|body_0|>
def tokenize_dataset(self, data):
"""Data set"""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Dataset:
"""Data set"""
def __init__(self):
"""Data set"""
examples, _ = tfds.load('ted_hrlr_translate/pt_to_en', with_info=True, as_supervised=True)
self.data_train = examples['train']
self.data_valid = examples['validation']
self.tokenizer_pt, self.tokenizer_en =... | the_stack_v2_python_sparse | supervised_learning/0x12-transformer_apps/0-dataset.py | oran2527/holbertonschool-machine_learning | train | 0 |
5966fc65dc15b01fd857b743e91d49e4559a6bc3 | [
"self.responses = []\nself.path_basename = path_basename\nself.path_basename_len = len(path_basename)\nself.method = method\nself.success_response = success_response",
"assert path.startswith(self.path_basename), '%s does not start with %s' % (path, self.path_basename)\nif type(what) is int:\n code = what\n ... | <|body_start_0|>
self.responses = []
self.path_basename = path_basename
self.path_basename_len = len(path_basename)
self.method = method
self.success_response = success_response
<|end_body_0|>
<|body_start_1|>
assert path.startswith(self.path_basename), '%s does not star... | Stores a list of (typically error) responses for use in a L{MultiStatusResponse}. | ResponseQueue | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ResponseQueue:
"""Stores a list of (typically error) responses for use in a L{MultiStatusResponse}."""
def __init__(self, path_basename, method, success_response):
"""@param path_basename: the base path for all responses to be added to the queue. All paths for responses added to the ... | stack_v2_sparse_classes_36k_train_024988 | 13,040 | permissive | [
{
"docstring": "@param path_basename: the base path for all responses to be added to the queue. All paths for responses added to the queue must start with C{path_basename}, which will be stripped from the beginning of each path to determine the response's URI. @param method: the name of the method generating th... | 3 | stack_v2_sparse_classes_30k_train_006188 | Implement the Python class `ResponseQueue` described below.
Class description:
Stores a list of (typically error) responses for use in a L{MultiStatusResponse}.
Method signatures and docstrings:
- def __init__(self, path_basename, method, success_response): @param path_basename: the base path for all responses to be ... | Implement the Python class `ResponseQueue` described below.
Class description:
Stores a list of (typically error) responses for use in a L{MultiStatusResponse}.
Method signatures and docstrings:
- def __init__(self, path_basename, method, success_response): @param path_basename: the base path for all responses to be ... | cb2962f1f1927f1e52ea405094fa3e7e180f23cb | <|skeleton|>
class ResponseQueue:
"""Stores a list of (typically error) responses for use in a L{MultiStatusResponse}."""
def __init__(self, path_basename, method, success_response):
"""@param path_basename: the base path for all responses to be added to the queue. All paths for responses added to the ... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ResponseQueue:
"""Stores a list of (typically error) responses for use in a L{MultiStatusResponse}."""
def __init__(self, path_basename, method, success_response):
"""@param path_basename: the base path for all responses to be added to the queue. All paths for responses added to the queue must st... | the_stack_v2_python_sparse | txweb2/dav/http.py | ass-a2s/ccs-calendarserver | train | 2 |
08bdd714a00dcdf3a5409aad75e88f5c96977ca6 | [
"Equipment.__init__(self)\npygame.sprite.Sprite.__init__(self)\nself.sprites = {}\nself.channelList = {}\nself.currentVolume = 0",
"self.screen = screen\nself.channelList = {'1': ChannelTV('1'), '2': ChannelTV('2'), '3': ChannelTV('3')}\nself.currentChannelPlay = self.channelList.get('1')\nself.sprites['tv_off'] ... | <|body_start_0|>
Equipment.__init__(self)
pygame.sprite.Sprite.__init__(self)
self.sprites = {}
self.channelList = {}
self.currentVolume = 0
<|end_body_0|>
<|body_start_1|>
self.screen = screen
self.channelList = {'1': ChannelTV('1'), '2': ChannelTV('2'), '3': Ch... | A classe TV é uma classe que vai representar um aparelho de TV do mundo real :version: 224 :author: Felipe Miranda | TV | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TV:
"""A classe TV é uma classe que vai representar um aparelho de TV do mundo real :version: 224 :author: Felipe Miranda"""
def __init__(self):
"""Construtor da classe"""
<|body_0|>
def load(self, screen):
"""Método que faz o carregamento das imagens do aparelho... | stack_v2_sparse_classes_36k_train_024989 | 2,814 | permissive | [
{
"docstring": "Construtor da classe",
"name": "__init__",
"signature": "def __init__(self)"
},
{
"docstring": "Método que faz o carregamento das imagens do aparelho TV :Param screen: Tela :Type screen: Screen Pygame",
"name": "load",
"signature": "def load(self, screen)"
},
{
"d... | 4 | stack_v2_sparse_classes_30k_train_005770 | Implement the Python class `TV` described below.
Class description:
A classe TV é uma classe que vai representar um aparelho de TV do mundo real :version: 224 :author: Felipe Miranda
Method signatures and docstrings:
- def __init__(self): Construtor da classe
- def load(self, screen): Método que faz o carregamento da... | Implement the Python class `TV` described below.
Class description:
A classe TV é uma classe que vai representar um aparelho de TV do mundo real :version: 224 :author: Felipe Miranda
Method signatures and docstrings:
- def __init__(self): Construtor da classe
- def load(self, screen): Método que faz o carregamento da... | 491487411bc63db497943fac78b810ac7e37ef44 | <|skeleton|>
class TV:
"""A classe TV é uma classe que vai representar um aparelho de TV do mundo real :version: 224 :author: Felipe Miranda"""
def __init__(self):
"""Construtor da classe"""
<|body_0|>
def load(self, screen):
"""Método que faz o carregamento das imagens do aparelho... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TV:
"""A classe TV é uma classe que vai representar um aparelho de TV do mundo real :version: 224 :author: Felipe Miranda"""
def __init__(self):
"""Construtor da classe"""
Equipment.__init__(self)
pygame.sprite.Sprite.__init__(self)
self.sprites = {}
self.channelLi... | the_stack_v2_python_sparse | Python_Controle_Multimidia_Universal/trunk/Comodo/TV.py | felipelindemberg/ControleMultimidiaUniversal | train | 1 |
dbfbaf42d03c49bdbf25070bb21e038b7542c5a6 | [
"self._bridge = CvBridge()\nself._properties_srv = rospy.Service('get_face_properties', GetFaceProperties, self._get_face_properties_srv)\nself._estimator = AgeGenderEstimator(weights_file_path, img_size, depth, width, use_gpu)\nif save_images_folder:\n self._save_images_folder = os.path.expanduser(save_images_f... | <|body_start_0|>
self._bridge = CvBridge()
self._properties_srv = rospy.Service('get_face_properties', GetFaceProperties, self._get_face_properties_srv)
self._estimator = AgeGenderEstimator(weights_file_path, img_size, depth, width, use_gpu)
if save_images_folder:
self._save_... | FacePropertiesNode | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class FacePropertiesNode:
def __init__(self, weights_file_path, img_size, depth, width, save_images_folder, use_gpu):
"""ROS node that wraps the PyTorch age gender estimator"""
<|body_0|>
def _get_face_properties_srv(self, req):
"""Callback when the GetFaceProperties servi... | stack_v2_sparse_classes_36k_train_024990 | 4,296 | permissive | [
{
"docstring": "ROS node that wraps the PyTorch age gender estimator",
"name": "__init__",
"signature": "def __init__(self, weights_file_path, img_size, depth, width, save_images_folder, use_gpu)"
},
{
"docstring": "Callback when the GetFaceProperties service is called :param req: Input images :... | 2 | stack_v2_sparse_classes_30k_train_006062 | Implement the Python class `FacePropertiesNode` described below.
Class description:
Implement the FacePropertiesNode class.
Method signatures and docstrings:
- def __init__(self, weights_file_path, img_size, depth, width, save_images_folder, use_gpu): ROS node that wraps the PyTorch age gender estimator
- def _get_fa... | Implement the Python class `FacePropertiesNode` described below.
Class description:
Implement the FacePropertiesNode class.
Method signatures and docstrings:
- def __init__(self, weights_file_path, img_size, depth, width, save_images_folder, use_gpu): ROS node that wraps the PyTorch age gender estimator
- def _get_fa... | 0b468bec744cc09a2c3f8d62e1d9f6e96e20ec35 | <|skeleton|>
class FacePropertiesNode:
def __init__(self, weights_file_path, img_size, depth, width, save_images_folder, use_gpu):
"""ROS node that wraps the PyTorch age gender estimator"""
<|body_0|>
def _get_face_properties_srv(self, req):
"""Callback when the GetFaceProperties servi... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class FacePropertiesNode:
def __init__(self, weights_file_path, img_size, depth, width, save_images_folder, use_gpu):
"""ROS node that wraps the PyTorch age gender estimator"""
self._bridge = CvBridge()
self._properties_srv = rospy.Service('get_face_properties', GetFaceProperties, self._get_... | the_stack_v2_python_sparse | image_recognition_age_gender/scripts/face_properties_node | tue-robotics/image_recognition | train | 74 | |
104f1d5acd28bf5b80277b069535f64f70b390f6 | [
"parser = reqparse.RequestParser()\nparser.add_argument('page', type=int, location='args')\nparser.add_argument('per_page', type=int, location='args')\nargs = parser.parse_args()\npage = args['page']\nper_page = args['per_page']\ncurrent_user = get_jwt_identity()\nreturn db_client.get_user_liked_quotes(page, per_pa... | <|body_start_0|>
parser = reqparse.RequestParser()
parser.add_argument('page', type=int, location='args')
parser.add_argument('per_page', type=int, location='args')
args = parser.parse_args()
page = args['page']
per_page = args['per_page']
current_user = get_jwt_i... | Resource for likes. | Likes | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Likes:
"""Resource for likes."""
def get(cls):
"""Returns the liked quotes of the current user."""
<|body_0|>
def post(cls):
"""Creates a like for the current user."""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
parser = reqparse.RequestParser(... | stack_v2_sparse_classes_36k_train_024991 | 2,152 | no_license | [
{
"docstring": "Returns the liked quotes of the current user.",
"name": "get",
"signature": "def get(cls)"
},
{
"docstring": "Creates a like for the current user.",
"name": "post",
"signature": "def post(cls)"
}
] | 2 | stack_v2_sparse_classes_30k_train_015053 | Implement the Python class `Likes` described below.
Class description:
Resource for likes.
Method signatures and docstrings:
- def get(cls): Returns the liked quotes of the current user.
- def post(cls): Creates a like for the current user. | Implement the Python class `Likes` described below.
Class description:
Resource for likes.
Method signatures and docstrings:
- def get(cls): Returns the liked quotes of the current user.
- def post(cls): Creates a like for the current user.
<|skeleton|>
class Likes:
"""Resource for likes."""
def get(cls):
... | 6718d90111a49a902deae461858b29a48167ee0e | <|skeleton|>
class Likes:
"""Resource for likes."""
def get(cls):
"""Returns the liked quotes of the current user."""
<|body_0|>
def post(cls):
"""Creates a like for the current user."""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Likes:
"""Resource for likes."""
def get(cls):
"""Returns the liked quotes of the current user."""
parser = reqparse.RequestParser()
parser.add_argument('page', type=int, location='args')
parser.add_argument('per_page', type=int, location='args')
args = parser.pars... | the_stack_v2_python_sparse | devquotes/routes/like.py | bertdida/devquotes-flask | train | 1 |
d1f6321444eebb293c4c5b7e242eeb6170c23217 | [
"future_question = create_question(question_text='Future question.', days=5)\nchoice_one = create_choice(future_question, 'Choice one', votes=2)\nchoice_two = create_choice(future_question, 'Choice two', votes=4)\nurl = reverse('polls:results', args=(future_question.id,))\nresponse = self.client.get(url)\nself.asse... | <|body_start_0|>
future_question = create_question(question_text='Future question.', days=5)
choice_one = create_choice(future_question, 'Choice one', votes=2)
choice_two = create_choice(future_question, 'Choice two', votes=4)
url = reverse('polls:results', args=(future_question.id,))
... | QuestionResultsViewTests | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class QuestionResultsViewTests:
def test_results_view_with_a_future_question(self):
"""The results view of a question with a pub_date in the future should return a 404 not found."""
<|body_0|>
def test_results_view_with_a_past_question(self):
"""The results view of a quest... | stack_v2_sparse_classes_36k_train_024992 | 7,438 | no_license | [
{
"docstring": "The results view of a question with a pub_date in the future should return a 404 not found.",
"name": "test_results_view_with_a_future_question",
"signature": "def test_results_view_with_a_future_question(self)"
},
{
"docstring": "The results view of a question with a pub_date in... | 2 | stack_v2_sparse_classes_30k_train_005947 | Implement the Python class `QuestionResultsViewTests` described below.
Class description:
Implement the QuestionResultsViewTests class.
Method signatures and docstrings:
- def test_results_view_with_a_future_question(self): The results view of a question with a pub_date in the future should return a 404 not found.
- ... | Implement the Python class `QuestionResultsViewTests` described below.
Class description:
Implement the QuestionResultsViewTests class.
Method signatures and docstrings:
- def test_results_view_with_a_future_question(self): The results view of a question with a pub_date in the future should return a 404 not found.
- ... | a7e7fc72abe357172f5aa49b03c5b9298d92d6e8 | <|skeleton|>
class QuestionResultsViewTests:
def test_results_view_with_a_future_question(self):
"""The results view of a question with a pub_date in the future should return a 404 not found."""
<|body_0|>
def test_results_view_with_a_past_question(self):
"""The results view of a quest... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class QuestionResultsViewTests:
def test_results_view_with_a_future_question(self):
"""The results view of a question with a pub_date in the future should return a 404 not found."""
future_question = create_question(question_text='Future question.', days=5)
choice_one = create_choice(future_... | the_stack_v2_python_sparse | firstdjango/polls/tests.py | thewritingstew/lpthw | train | 0 | |
9a72491a8455e493a6c7b36324a7b9ea678f6277 | [
"if not root:\n return\nq = deque()\nq.append(root)\nwhile q:\n level_len = len(q) - 1\n node = q.popleft()\n for _ in range(level_len):\n node.next = q.popleft()\n if node.left:\n q.append(node.left)\n if node.right:\n q.append(node.right)\n node = node... | <|body_start_0|>
if not root:
return
q = deque()
q.append(root)
while q:
level_len = len(q) - 1
node = q.popleft()
for _ in range(level_len):
node.next = q.popleft()
if node.left:
q.append... | Solution | [
"BSD-3-Clause"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Solution:
def connect(self, root: 'Node') -> 'Node':
"""A solution using O(n) extra space."""
<|body_0|>
def connect(self, root: 'Node') -> 'Node':
"""Solve it recursively."""
<|body_1|>
<|end_skeleton|>
<|body_start_0|>
if not root:
ret... | stack_v2_sparse_classes_36k_train_024993 | 2,467 | permissive | [
{
"docstring": "A solution using O(n) extra space.",
"name": "connect",
"signature": "def connect(self, root: 'Node') -> 'Node'"
},
{
"docstring": "Solve it recursively.",
"name": "connect",
"signature": "def connect(self, root: 'Node') -> 'Node'"
}
] | 2 | null | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def connect(self, root: 'Node') -> 'Node': A solution using O(n) extra space.
- def connect(self, root: 'Node') -> 'Node': Solve it recursively. | Implement the Python class `Solution` described below.
Class description:
Implement the Solution class.
Method signatures and docstrings:
- def connect(self, root: 'Node') -> 'Node': A solution using O(n) extra space.
- def connect(self, root: 'Node') -> 'Node': Solve it recursively.
<|skeleton|>
class Solution:
... | 226cecde136531341ce23cdf88529345be1912fc | <|skeleton|>
class Solution:
def connect(self, root: 'Node') -> 'Node':
"""A solution using O(n) extra space."""
<|body_0|>
def connect(self, root: 'Node') -> 'Node':
"""Solve it recursively."""
<|body_1|>
<|end_skeleton|> | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Solution:
def connect(self, root: 'Node') -> 'Node':
"""A solution using O(n) extra space."""
if not root:
return
q = deque()
q.append(root)
while q:
level_len = len(q) - 1
node = q.popleft()
for _ in range(level_len):
... | the_stack_v2_python_sparse | Leetcode/Intermediate/Tree and graph/116_Populating_Next_Right_Pointers_in_Each_Node.py | ZR-Huang/AlgorithmsPractices | train | 1 | |
e5ab5511bfc15c6f36690c752b5cbeb03171476d | [
"context = super(ExhibitionListView, self).get_context_data(**kwargs)\ncontext['now'] = 'active'\ncontext['title'] = 'Расписание выставок.'\nreturn context",
"qs = super(ExhibitionListView, self).get_queryset()\nqs = qs.filter(date__gte=timezone.now())\nreturn qs"
] | <|body_start_0|>
context = super(ExhibitionListView, self).get_context_data(**kwargs)
context['now'] = 'active'
context['title'] = 'Расписание выставок.'
return context
<|end_body_0|>
<|body_start_1|>
qs = super(ExhibitionListView, self).get_queryset()
qs = qs.filter(dat... | List of exhibition which will | ExhibitionListView | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class ExhibitionListView:
"""List of exhibition which will"""
def get_context_data(self, **kwargs):
"""Extends context data :param kwargs: :return: context"""
<|body_0|>
def get_queryset(self):
"""Filter exhibition :return: exhibition which will"""
<|body_1|>
... | stack_v2_sparse_classes_36k_train_024994 | 5,515 | no_license | [
{
"docstring": "Extends context data :param kwargs: :return: context",
"name": "get_context_data",
"signature": "def get_context_data(self, **kwargs)"
},
{
"docstring": "Filter exhibition :return: exhibition which will",
"name": "get_queryset",
"signature": "def get_queryset(self)"
}
] | 2 | stack_v2_sparse_classes_30k_train_003070 | Implement the Python class `ExhibitionListView` described below.
Class description:
List of exhibition which will
Method signatures and docstrings:
- def get_context_data(self, **kwargs): Extends context data :param kwargs: :return: context
- def get_queryset(self): Filter exhibition :return: exhibition which will | Implement the Python class `ExhibitionListView` described below.
Class description:
List of exhibition which will
Method signatures and docstrings:
- def get_context_data(self, **kwargs): Extends context data :param kwargs: :return: context
- def get_queryset(self): Filter exhibition :return: exhibition which will
<... | 8eb18b831e034302f90585a179110336bb18af45 | <|skeleton|>
class ExhibitionListView:
"""List of exhibition which will"""
def get_context_data(self, **kwargs):
"""Extends context data :param kwargs: :return: context"""
<|body_0|>
def get_queryset(self):
"""Filter exhibition :return: exhibition which will"""
<|body_1|>
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class ExhibitionListView:
"""List of exhibition which will"""
def get_context_data(self, **kwargs):
"""Extends context data :param kwargs: :return: context"""
context = super(ExhibitionListView, self).get_context_data(**kwargs)
context['now'] = 'active'
context['title'] = 'Распи... | the_stack_v2_python_sparse | exhibition/views.py | YevheniiaSmyrnova/butterflies | train | 0 |
9f2e7ca86aa7d2d9b27d9909e3c33eb5bcacffa9 | [
"self.launcher = ROSLaunch()\nself.launcher.start()\nself.namespace = namespace\nself.pedestrian_id = int(pedestrian_id)\nself.crosswalk_id = int(crosswalk_id)\nself.class_name = self.__class__.__name__\nself.simulation_rate = simulation_rate\nself.simulate = False\nself.x = x\nself.y = y\nself.yaw = yaw\nself.np_t... | <|body_start_0|>
self.launcher = ROSLaunch()
self.launcher.start()
self.namespace = namespace
self.pedestrian_id = int(pedestrian_id)
self.crosswalk_id = int(crosswalk_id)
self.class_name = self.__class__.__name__
self.simulation_rate = simulation_rate
sel... | Base class for pedestrians. | Pedestrian | [] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class Pedestrian:
"""Base class for pedestrians."""
def __init__(self, namespace, pedestrian_id, simulation_rate, crosswalk_id, x=0.0, y=0.0, yaw=0.0):
"""Initialize class Pedestrian. @param namespace: I{(string)} Namespace in which the pedestrian node is started. @param pedestrian_id: I{(... | stack_v2_sparse_classes_36k_train_024995 | 6,610 | no_license | [
{
"docstring": "Initialize class Pedestrian. @param namespace: I{(string)} Namespace in which the pedestrian node is started. @param pedestrian_id: I{(int)} ID of the pedestrian that is created. @param simulation_rate: I{(int)} Rate at which the pedestrian is simulated (hz). @param crosswalk_id: I{(int)} ID of ... | 5 | stack_v2_sparse_classes_30k_train_015696 | Implement the Python class `Pedestrian` described below.
Class description:
Base class for pedestrians.
Method signatures and docstrings:
- def __init__(self, namespace, pedestrian_id, simulation_rate, crosswalk_id, x=0.0, y=0.0, yaw=0.0): Initialize class Pedestrian. @param namespace: I{(string)} Namespace in which ... | Implement the Python class `Pedestrian` described below.
Class description:
Base class for pedestrians.
Method signatures and docstrings:
- def __init__(self, namespace, pedestrian_id, simulation_rate, crosswalk_id, x=0.0, y=0.0, yaw=0.0): Initialize class Pedestrian. @param namespace: I{(string)} Namespace in which ... | d34f47d55df7b728c78d870e2f6f2b2d842bdee9 | <|skeleton|>
class Pedestrian:
"""Base class for pedestrians."""
def __init__(self, namespace, pedestrian_id, simulation_rate, crosswalk_id, x=0.0, y=0.0, yaw=0.0):
"""Initialize class Pedestrian. @param namespace: I{(string)} Namespace in which the pedestrian node is started. @param pedestrian_id: I{(... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class Pedestrian:
"""Base class for pedestrians."""
def __init__(self, namespace, pedestrian_id, simulation_rate, crosswalk_id, x=0.0, y=0.0, yaw=0.0):
"""Initialize class Pedestrian. @param namespace: I{(string)} Namespace in which the pedestrian node is started. @param pedestrian_id: I{(int)} ID of t... | the_stack_v2_python_sparse | sml_world/scripts/sml_modules/pedestrian_model.py | xiao3913/UGV_demo_new | train | 0 |
8f540844ba35df23b5dd0188d3d9d7fd9f0228b4 | [
"self.ha = abstract.sdk.libs.abstracted_libs.ha.HA(device=uut)\nfor mapping_keys in self.mapping.keys:\n if 'lc' not in mapping_keys:\n raise Exception('LC is not found in {}'.format(mapping_keys))\n else:\n lc_value = mapping_keys['lc']\n for key, value in mapping_keys.items():\n if l... | <|body_start_0|>
self.ha = abstract.sdk.libs.abstracted_libs.ha.HA(device=uut)
for mapping_keys in self.mapping.keys:
if 'lc' not in mapping_keys:
raise Exception('LC is not found in {}'.format(mapping_keys))
else:
lc_value = mapping_keys['lc']
... | Trigger class for Reload LCs action | TriggerReloadLc | [
"Apache-2.0"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class TriggerReloadLc:
"""Trigger class for Reload LCs action"""
def reload(self, uut, abstract, steps, lcRole=None):
"""Reload LC and reconnect to device if needed Args: uut (`obj`): Device object. abstract (`obj`): Abstract object. steps (`step obj`): aetest step object Returns: None Rai... | stack_v2_sparse_classes_36k_train_024996 | 20,969 | permissive | [
{
"docstring": "Reload LC and reconnect to device if needed Args: uut (`obj`): Device object. abstract (`obj`): Abstract object. steps (`step obj`): aetest step object Returns: None Raises: pyATS Results",
"name": "reload",
"signature": "def reload(self, uut, abstract, steps, lcRole=None)"
},
{
... | 2 | null | Implement the Python class `TriggerReloadLc` described below.
Class description:
Trigger class for Reload LCs action
Method signatures and docstrings:
- def reload(self, uut, abstract, steps, lcRole=None): Reload LC and reconnect to device if needed Args: uut (`obj`): Device object. abstract (`obj`): Abstract object.... | Implement the Python class `TriggerReloadLc` described below.
Class description:
Trigger class for Reload LCs action
Method signatures and docstrings:
- def reload(self, uut, abstract, steps, lcRole=None): Reload LC and reconnect to device if needed Args: uut (`obj`): Device object. abstract (`obj`): Abstract object.... | e42e51475cddcb10f5c7814d0fe892ac865742ba | <|skeleton|>
class TriggerReloadLc:
"""Trigger class for Reload LCs action"""
def reload(self, uut, abstract, steps, lcRole=None):
"""Reload LC and reconnect to device if needed Args: uut (`obj`): Device object. abstract (`obj`): Abstract object. steps (`step obj`): aetest step object Returns: None Rai... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class TriggerReloadLc:
"""Trigger class for Reload LCs action"""
def reload(self, uut, abstract, steps, lcRole=None):
"""Reload LC and reconnect to device if needed Args: uut (`obj`): Device object. abstract (`obj`): Abstract object. steps (`step obj`): aetest step object Returns: None Raises: pyATS Re... | the_stack_v2_python_sparse | pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/ha.py | CiscoTestAutomation/genielibs | train | 109 |
7fc5bf3743cffa3011e25ee88bd32aee2cbc66f5 | [
"if rest_filter is None:\n rest_filter = dict()\nrest_filter['name', 'version'] = [(gp.name, gp.version) for gp in user.group.genepanels]\nrest_filter['official'] = True\nreturn self.list_query(session, gene.Genepanel, schema=schemas.GenepanelSchema(), rest_filter=rest_filter, order_by=['name', 'version'])",
"... | <|body_start_0|>
if rest_filter is None:
rest_filter = dict()
rest_filter['name', 'version'] = [(gp.name, gp.version) for gp in user.group.genepanels]
rest_filter['official'] = True
return self.list_query(session, gene.Genepanel, schema=schemas.GenepanelSchema(), rest_filter=... | GenepanelListResource | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class GenepanelListResource:
def get(self, session, rest_filter=None, page=None, per_page=None, user=None):
"""Returns a list of genepanels. * Supports `q=` filtering. * Supports pagination. --- summary: List genepanels tags: - Genepanel parameters: - name: q in: query type: string description... | stack_v2_sparse_classes_36k_train_024997 | 13,080 | permissive | [
{
"docstring": "Returns a list of genepanels. * Supports `q=` filtering. * Supports pagination. --- summary: List genepanels tags: - Genepanel parameters: - name: q in: query type: string description: JSON filter query responses: 200: schema: type: array items: $ref: '#/definitions/Genepanel' description: List ... | 2 | null | Implement the Python class `GenepanelListResource` described below.
Class description:
Implement the GenepanelListResource class.
Method signatures and docstrings:
- def get(self, session, rest_filter=None, page=None, per_page=None, user=None): Returns a list of genepanels. * Supports `q=` filtering. * Supports pagin... | Implement the Python class `GenepanelListResource` described below.
Class description:
Implement the GenepanelListResource class.
Method signatures and docstrings:
- def get(self, session, rest_filter=None, page=None, per_page=None, user=None): Returns a list of genepanels. * Supports `q=` filtering. * Supports pagin... | e38631d302611a143c9baaa684bcbd014d9734e4 | <|skeleton|>
class GenepanelListResource:
def get(self, session, rest_filter=None, page=None, per_page=None, user=None):
"""Returns a list of genepanels. * Supports `q=` filtering. * Supports pagination. --- summary: List genepanels tags: - Genepanel parameters: - name: q in: query type: string description... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class GenepanelListResource:
def get(self, session, rest_filter=None, page=None, per_page=None, user=None):
"""Returns a list of genepanels. * Supports `q=` filtering. * Supports pagination. --- summary: List genepanels tags: - Genepanel parameters: - name: q in: query type: string description: JSON filter ... | the_stack_v2_python_sparse | src/api/v1/resources/genepanel.py | dabble-of-devops-consulting/ella | train | 0 | |
3fa71d29288e1ab220c10ddb2fde4586d300d10f | [
"client = bundle.get('client')\nmessage = bundle.get('message')\nif message.content.startswith(self.command_char + 'echo'):\n await self.echo(message)\nelif message.content.startswith(self.command_char + 'sleep'):\n await self.sleep(message)\nelif message.content.startswith(self.command_char + 'shutdown'):\n ... | <|body_start_0|>
client = bundle.get('client')
message = bundle.get('message')
if message.content.startswith(self.command_char + 'echo'):
await self.echo(message)
elif message.content.startswith(self.command_char + 'sleep'):
await self.sleep(message)
elif ... | Class for basic commands module. | BasicCommands | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class BasicCommands:
"""Class for basic commands module."""
async def parse_command(self, bundle):
"""Decides which command should be executed and calls it. :param bundle Dictionary passed in from caller. :return: no return value."""
<|body_0|>
async def echo(self, message):
... | stack_v2_sparse_classes_36k_train_024998 | 2,338 | permissive | [
{
"docstring": "Decides which command should be executed and calls it. :param bundle Dictionary passed in from caller. :return: no return value.",
"name": "parse_command",
"signature": "async def parse_command(self, bundle)"
},
{
"docstring": "Echoes given message(excluding command term). :param... | 4 | stack_v2_sparse_classes_30k_train_014218 | Implement the Python class `BasicCommands` described below.
Class description:
Class for basic commands module.
Method signatures and docstrings:
- async def parse_command(self, bundle): Decides which command should be executed and calls it. :param bundle Dictionary passed in from caller. :return: no return value.
- ... | Implement the Python class `BasicCommands` described below.
Class description:
Class for basic commands module.
Method signatures and docstrings:
- async def parse_command(self, bundle): Decides which command should be executed and calls it. :param bundle Dictionary passed in from caller. :return: no return value.
- ... | 9f254f6b3b681743dc6850fd8ed64f3252e8e318 | <|skeleton|>
class BasicCommands:
"""Class for basic commands module."""
async def parse_command(self, bundle):
"""Decides which command should be executed and calls it. :param bundle Dictionary passed in from caller. :return: no return value."""
<|body_0|>
async def echo(self, message):
... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class BasicCommands:
"""Class for basic commands module."""
async def parse_command(self, bundle):
"""Decides which command should be executed and calls it. :param bundle Dictionary passed in from caller. :return: no return value."""
client = bundle.get('client')
message = bundle.get('m... | the_stack_v2_python_sparse | modular_bot/modules/basic_commands_module.py | wonwooseo/modular_discord_bot | train | 0 |
320fdc1518fb6449ed3f8f9856ea07816755a960 | [
"if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn EdiscoveryExportOperation()",
"from .case_operation import CaseOperation\nfrom .ediscovery_review_set import EdiscoveryReviewSet\nfrom .ediscovery_review_set_query import EdiscoveryReviewSetQuery\nfrom .export_file_metadata import Expo... | <|body_start_0|>
if not parse_node:
raise TypeError('parse_node cannot be null.')
return EdiscoveryExportOperation()
<|end_body_0|>
<|body_start_1|>
from .case_operation import CaseOperation
from .ediscovery_review_set import EdiscoveryReviewSet
from .ediscovery_revi... | EdiscoveryExportOperation | [
"MIT"
] | stack_v2_sparse_python_classes_v1 | <|skeleton|>
class EdiscoveryExportOperation:
def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EdiscoveryExportOperation:
"""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 c... | stack_v2_sparse_classes_36k_train_024999 | 4,962 | 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: EdiscoveryExportOperation",
"name": "create_from_discriminator_value",
"signature": "def create_from_discrim... | 3 | stack_v2_sparse_classes_30k_test_000904 | Implement the Python class `EdiscoveryExportOperation` described below.
Class description:
Implement the EdiscoveryExportOperation class.
Method signatures and docstrings:
- def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EdiscoveryExportOperation: Creates a new instance of the appropriat... | Implement the Python class `EdiscoveryExportOperation` described below.
Class description:
Implement the EdiscoveryExportOperation class.
Method signatures and docstrings:
- def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EdiscoveryExportOperation: Creates a new instance of the appropriat... | 27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949 | <|skeleton|>
class EdiscoveryExportOperation:
def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EdiscoveryExportOperation:
"""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 c... | stack_v2_sparse_classes_36k | data/stack_v2_sparse_classes_30k | class EdiscoveryExportOperation:
def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> EdiscoveryExportOperation:
"""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 obje... | the_stack_v2_python_sparse | msgraph/generated/models/security/ediscovery_export_operation.py | microsoftgraph/msgraph-sdk-python | train | 135 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.