blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
7.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
378
8.64k
id
stringlengths
44
44
length_bytes
int64
505
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.88k
prompted_full_text
stringlengths
565
12.5k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
5.05k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
snapshot_total_rows
int64
75.8k
75.8k
solution
stringlengths
242
8.3k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
ad1c389082b8c46fcc421eb4da67ec4cf18b358f
[ "tk.Toplevel.__init__(self)\nself.tid = scrolledtext.ScrolledText(self)\nself.tid.pack(fill=tk.BOTH, expand=1)\nself.Styles()\nself.Show()", "for c in ['red', 'blue', 'magenta', 'yellow', 'green', 'red4', 'green4', 'blue4']:\n self.tid.tag_configure(c, foreground=c)\nself.tid.tag_config('underline', underline=...
<|body_start_0|> tk.Toplevel.__init__(self) self.tid = scrolledtext.ScrolledText(self) self.tid.pack(fill=tk.BOTH, expand=1) self.Styles() self.Show() <|end_body_0|> <|body_start_1|> for c in ['red', 'blue', 'magenta', 'yellow', 'green', 'red4', 'green4', 'blue4']: ...
Help window.
xbbtools_help
[ "BSD-3-Clause", "LicenseRef-scancode-biopython" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class xbbtools_help: """Help window.""" def __init__(self, *args): """Make toplevel help window.""" <|body_0|> def Styles(self): """Define text styles.""" <|body_1|> def Show(self): """Display help text.""" <|body_2|> <|end_skeleton|> <|b...
stack_v2_sparse_classes_75kplus_train_006700
3,209
permissive
[ { "docstring": "Make toplevel help window.", "name": "__init__", "signature": "def __init__(self, *args)" }, { "docstring": "Define text styles.", "name": "Styles", "signature": "def Styles(self)" }, { "docstring": "Display help text.", "name": "Show", "signature": "def S...
3
stack_v2_sparse_classes_30k_train_024402
Implement the Python class `xbbtools_help` described below. Class description: Help window. Method signatures and docstrings: - def __init__(self, *args): Make toplevel help window. - def Styles(self): Define text styles. - def Show(self): Display help text.
Implement the Python class `xbbtools_help` described below. Class description: Help window. Method signatures and docstrings: - def __init__(self, *args): Make toplevel help window. - def Styles(self): Define text styles. - def Show(self): Display help text. <|skeleton|> class xbbtools_help: """Help window.""" ...
d416809344f1e345fbabbdaca4dd6dcf441e53bd
<|skeleton|> class xbbtools_help: """Help window.""" def __init__(self, *args): """Make toplevel help window.""" <|body_0|> def Styles(self): """Define text styles.""" <|body_1|> def Show(self): """Display help text.""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class xbbtools_help: """Help window.""" def __init__(self, *args): """Make toplevel help window.""" tk.Toplevel.__init__(self) self.tid = scrolledtext.ScrolledText(self) self.tid.pack(fill=tk.BOTH, expand=1) self.Styles() self.Show() def Styles(self): ...
the_stack_v2_python_sparse
Scripts/xbbtools/xbb_help.py
biopython/biopython
train
3,669
2e1d5832b459d39accc30ac90405cf3e6d5384fe
[ "self.config = configparser.ConfigParser()\nself.config.read(rootPath + '\\\\testdata\\\\config.txt', encoding='UTF-8')\nself.conf = {}", "self.conf['login_email'] = self.config.get('Email', 'login_email')\nself.conf['login_password'] = self.config.get('Email', 'login_password')\nself.conf['port'] = self.config.g...
<|body_start_0|> self.config = configparser.ConfigParser() self.config.read(rootPath + '\\testdata\\config.txt', encoding='UTF-8') self.conf = {} <|end_body_0|> <|body_start_1|> self.conf['login_email'] = self.config.get('Email', 'login_email') self.conf['login_password'] = self...
Config
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Config: def __init__(self): """初始化config,读取config文件""" <|body_0|> def get_email(self): """获取email的各种参数配置值""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.config = configparser.ConfigParser() self.config.read(rootPath + '\\testdata\\conf...
stack_v2_sparse_classes_75kplus_train_006701
1,687
no_license
[ { "docstring": "初始化config,读取config文件", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "获取email的各种参数配置值", "name": "get_email", "signature": "def get_email(self)" } ]
2
stack_v2_sparse_classes_30k_train_036157
Implement the Python class `Config` described below. Class description: Implement the Config class. Method signatures and docstrings: - def __init__(self): 初始化config,读取config文件 - def get_email(self): 获取email的各种参数配置值
Implement the Python class `Config` described below. Class description: Implement the Config class. Method signatures and docstrings: - def __init__(self): 初始化config,读取config文件 - def get_email(self): 获取email的各种参数配置值 <|skeleton|> class Config: def __init__(self): """初始化config,读取config文件""" <|body...
4f94968978057d6bf52a5796a68a262097c3e31e
<|skeleton|> class Config: def __init__(self): """初始化config,读取config文件""" <|body_0|> def get_email(self): """获取email的各种参数配置值""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Config: def __init__(self): """初始化config,读取config文件""" self.config = configparser.ConfigParser() self.config.read(rootPath + '\\testdata\\config.txt', encoding='UTF-8') self.conf = {} def get_email(self): """获取email的各种参数配置值""" self.conf['login_email'] = sel...
the_stack_v2_python_sparse
common/get_config.py
hecong520/kuaishang_auto
train
1
938463964996f43823c9e45ebaac81157703444d
[ "self.log = log\nself.run_times = 0\nself.success_num = 0\nself.failed_num = 0\nself.failed_reasons = dict()\nself.retry_times = dict()", "self.run_times += 1\nif report.access_type == SeedAccessType.ERROR:\n self.failed_num += 1\n if report.access_type not in self.failed_reasons:\n self.failed_reaso...
<|body_start_0|> self.log = log self.run_times = 0 self.success_num = 0 self.failed_num = 0 self.failed_reasons = dict() self.retry_times = dict() <|end_body_0|> <|body_start_1|> self.run_times += 1 if report.access_type == SeedAccessType.ERROR: ...
CrawlerStatic is used to statistic the crawler @version:1.0 @author:david ding @modify:
CrawlerStatic
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CrawlerStatic: """CrawlerStatic is used to statistic the crawler @version:1.0 @author:david ding @modify:""" def __init__(self, log): """Initiate the parameters.""" <|body_0|> def statistic(self, report, retry_times): """Statistic one report :param report: :param...
stack_v2_sparse_classes_75kplus_train_006702
1,872
no_license
[ { "docstring": "Initiate the parameters.", "name": "__init__", "signature": "def __init__(self, log)" }, { "docstring": "Statistic one report :param report: :param retry_times: :return:", "name": "statistic", "signature": "def statistic(self, report, retry_times)" }, { "docstring...
3
null
Implement the Python class `CrawlerStatic` described below. Class description: CrawlerStatic is used to statistic the crawler @version:1.0 @author:david ding @modify: Method signatures and docstrings: - def __init__(self, log): Initiate the parameters. - def statistic(self, report, retry_times): Statistic one report ...
Implement the Python class `CrawlerStatic` described below. Class description: CrawlerStatic is used to statistic the crawler @version:1.0 @author:david ding @modify: Method signatures and docstrings: - def __init__(self, log): Initiate the parameters. - def statistic(self, report, retry_times): Statistic one report ...
f04300e329768eb38e97b992f9fe065fa300e13d
<|skeleton|> class CrawlerStatic: """CrawlerStatic is used to statistic the crawler @version:1.0 @author:david ding @modify:""" def __init__(self, log): """Initiate the parameters.""" <|body_0|> def statistic(self, report, retry_times): """Statistic one report :param report: :param...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CrawlerStatic: """CrawlerStatic is used to statistic the crawler @version:1.0 @author:david ding @modify:""" def __init__(self, log): """Initiate the parameters.""" self.log = log self.run_times = 0 self.success_num = 0 self.failed_num = 0 self.failed_reaso...
the_stack_v2_python_sparse
qyxx_all/CrawlerStatistic.py
chybot/crawler
train
1
670d56f84a4535cf9256c0b05751fa048c304f51
[ "mes = {'message': 'success'}\nrole_name = kwargs.get('role_name', '')\ndb = orm_module.get_client()\nconn = orm_module.get_conn(table_name=cls.get_table_name(), db_client=db)\nwrite_concern = WriteConcern(w=1, j=True)\nwith db.start_session(causal_consistency=True) as ses:\n with ses.start_transaction(write_con...
<|body_start_0|> mes = {'message': 'success'} role_name = kwargs.get('role_name', '') db = orm_module.get_client() conn = orm_module.get_conn(table_name=cls.get_table_name(), db_client=db) write_concern = WriteConcern(w=1, j=True) with db.start_session(causal_consistency=...
管理员的角色/权限组
AdminRole
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdminRole: """管理员的角色/权限组""" def add(cls, **kwargs) -> dict: """添加角色 :param kwargs: :return:""" <|body_0|> def all_rules(cls) -> list: """查询所有的rule,不包括root :return:""" <|body_1|> def paging_info(cls, filter_dict: dict, page_index: int=1, page_size: in...
stack_v2_sparse_classes_75kplus_train_006703
13,255
no_license
[ { "docstring": "添加角色 :param kwargs: :return:", "name": "add", "signature": "def add(cls, **kwargs) -> dict" }, { "docstring": "查询所有的rule,不包括root :return:", "name": "all_rules", "signature": "def all_rules(cls) -> list" }, { "docstring": "分页查看角色信息 :param filter_dict: 过滤器,由用户的权限生成 ...
3
stack_v2_sparse_classes_30k_train_047027
Implement the Python class `AdminRole` described below. Class description: 管理员的角色/权限组 Method signatures and docstrings: - def add(cls, **kwargs) -> dict: 添加角色 :param kwargs: :return: - def all_rules(cls) -> list: 查询所有的rule,不包括root :return: - def paging_info(cls, filter_dict: dict, page_index: int=1, page_size: int=10...
Implement the Python class `AdminRole` described below. Class description: 管理员的角色/权限组 Method signatures and docstrings: - def add(cls, **kwargs) -> dict: 添加角色 :param kwargs: :return: - def all_rules(cls) -> list: 查询所有的rule,不包括root :return: - def paging_info(cls, filter_dict: dict, page_index: int=1, page_size: int=10...
3a2bdfd1598bfcdfe56386ec0c46fcede772cbfe
<|skeleton|> class AdminRole: """管理员的角色/权限组""" def add(cls, **kwargs) -> dict: """添加角色 :param kwargs: :return:""" <|body_0|> def all_rules(cls) -> list: """查询所有的rule,不包括root :return:""" <|body_1|> def paging_info(cls, filter_dict: dict, page_index: int=1, page_size: in...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AdminRole: """管理员的角色/权限组""" def add(cls, **kwargs) -> dict: """添加角色 :param kwargs: :return:""" mes = {'message': 'success'} role_name = kwargs.get('role_name', '') db = orm_module.get_client() conn = orm_module.get_conn(table_name=cls.get_table_name(), db_client=db...
the_stack_v2_python_sparse
Webchat_Server/module/admin_module.py
SYYDSN/py_projects
train
0
823965ea79cc569e373f54f537779c46c54be49b
[ "super(TweetProcess, self).__init__()\nself.logger = getLogger(__name__)\nself.queue = que\nself.daemon = True\nself.get_auth = GetAuth()\nself.tweetable = False", "while True:\n try:\n data = self.queue.get()\n if data is None:\n break\n self.logger.debug('[TWEET] ' + data)\n ...
<|body_start_0|> super(TweetProcess, self).__init__() self.logger = getLogger(__name__) self.queue = que self.daemon = True self.get_auth = GetAuth() self.tweetable = False <|end_body_0|> <|body_start_1|> while True: try: data = self.q...
This class' instance has Queue when created. Queue has tweet information. So tweet it until Queue become empty.
TweetProcess
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TweetProcess: """This class' instance has Queue when created. Queue has tweet information. So tweet it until Queue become empty.""" def __init__(self, que: Queue): """Args: que: queue.Queue object""" <|body_0|> def run(self) -> None: """Get data from Queue, and t...
stack_v2_sparse_classes_75kplus_train_006704
2,136
permissive
[ { "docstring": "Args: que: queue.Queue object", "name": "__init__", "signature": "def __init__(self, que: Queue)" }, { "docstring": "Get data from Queue, and tweet until Queue become empty", "name": "run", "signature": "def run(self) -> None" } ]
2
stack_v2_sparse_classes_30k_train_050815
Implement the Python class `TweetProcess` described below. Class description: This class' instance has Queue when created. Queue has tweet information. So tweet it until Queue become empty. Method signatures and docstrings: - def __init__(self, que: Queue): Args: que: queue.Queue object - def run(self) -> None: Get d...
Implement the Python class `TweetProcess` described below. Class description: This class' instance has Queue when created. Queue has tweet information. So tweet it until Queue become empty. Method signatures and docstrings: - def __init__(self, que: Queue): Args: que: queue.Queue object - def run(self) -> None: Get d...
4f696ce5198196ea79dc0d25a30cb22230342ca9
<|skeleton|> class TweetProcess: """This class' instance has Queue when created. Queue has tweet information. So tweet it until Queue become empty.""" def __init__(self, que: Queue): """Args: que: queue.Queue object""" <|body_0|> def run(self) -> None: """Get data from Queue, and t...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TweetProcess: """This class' instance has Queue when created. Queue has tweet information. So tweet it until Queue become empty.""" def __init__(self, que: Queue): """Args: que: queue.Queue object""" super(TweetProcess, self).__init__() self.logger = getLogger(__name__) se...
the_stack_v2_python_sparse
qkoubot/network/tweeter.py
pddg/qkouserver
train
0
19f8650ed05cdb829a7e59b7b7beb34d1b94e2bb
[ "space = HyperoptSearchSpace(hp_space)\nsuper().__init__(space, hp_space.keys())\nself.last_hparams = None\nself.algo = partial(tpe.suggest, n_startup_jobs=n_rand_point) if algo == 'tpe' else rand.suggest", "if sample_x is not None and len(sample_x) > 0:\n\n def obj(hparams):\n assert len(sample_x[0].ke...
<|body_start_0|> space = HyperoptSearchSpace(hp_space) super().__init__(space, hp_space.keys()) self.last_hparams = None self.algo = partial(tpe.suggest, n_startup_jobs=n_rand_point) if algo == 'tpe' else rand.suggest <|end_body_0|> <|body_start_1|> if sample_x is not None and l...
The HyperOpt optimizer class.
HyperoptOptimizer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HyperoptOptimizer: """The HyperOpt optimizer class.""" def __init__(self, hp_space, n_rand_point, algo='tpe'): """The construction of the GPyOpt optimizer. :param hp_space: A dictionary that contain object of type continuous domain and discrete domain. :param n_rand_point: Number of ...
stack_v2_sparse_classes_75kplus_train_006705
9,140
no_license
[ { "docstring": "The construction of the GPyOpt optimizer. :param hp_space: A dictionary that contain object of type continuous domain and discrete domain. :param n_rand_point: Number of points that will sample randomly before starting the optimization. :param algo: The algorithm that will to define the next poi...
4
stack_v2_sparse_classes_30k_train_043668
Implement the Python class `HyperoptOptimizer` described below. Class description: The HyperOpt optimizer class. Method signatures and docstrings: - def __init__(self, hp_space, n_rand_point, algo='tpe'): The construction of the GPyOpt optimizer. :param hp_space: A dictionary that contain object of type continuous do...
Implement the Python class `HyperoptOptimizer` described below. Class description: The HyperOpt optimizer class. Method signatures and docstrings: - def __init__(self, hp_space, n_rand_point, algo='tpe'): The construction of the GPyOpt optimizer. :param hp_space: A dictionary that contain object of type continuous do...
45057f45b1397db429a0ed7f7ee5b3edbf1c1728
<|skeleton|> class HyperoptOptimizer: """The HyperOpt optimizer class.""" def __init__(self, hp_space, n_rand_point, algo='tpe'): """The construction of the GPyOpt optimizer. :param hp_space: A dictionary that contain object of type continuous domain and discrete domain. :param n_rand_point: Number of ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class HyperoptOptimizer: """The HyperOpt optimizer class.""" def __init__(self, hp_space, n_rand_point, algo='tpe'): """The construction of the GPyOpt optimizer. :param hp_space: A dictionary that contain object of type continuous domain and discrete domain. :param n_rand_point: Number of points that w...
the_stack_v2_python_sparse
Optimizer/Optimizer.py
AleAyotte/HyperPara
train
6
81727263ba483b685b72195500a54d1b5eb0a739
[ "super(MapsComponent, self).__init__(config)\nself.maps_solar_path = None\nself.maps_intermediate_path = None\nself.maps_cutoff_path = None", "super(MapsComponent, self).setup()\nself.maps_solar_path = fs.create_directory_in(self.maps_path, 'solar')\nself.maps_intermediate_path = fs.create_directory_in(self.maps_...
<|body_start_0|> super(MapsComponent, self).__init__(config) self.maps_solar_path = None self.maps_intermediate_path = None self.maps_cutoff_path = None <|end_body_0|> <|body_start_1|> super(MapsComponent, self).setup() self.maps_solar_path = fs.create_directory_in(self....
This class...
MapsComponent
[ "GPL-1.0-or-later", "AGPL-3.0-only", "AGPL-3.0-or-later", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-philippe-de-muyter", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MapsComponent: """This class...""" def __init__(self, config=None): """The constructor ... :param config: :return:""" <|body_0|> def setup(self): """This function ... :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> super(MapsComponent, ...
stack_v2_sparse_classes_75kplus_train_006706
2,119
permissive
[ { "docstring": "The constructor ... :param config: :return:", "name": "__init__", "signature": "def __init__(self, config=None)" }, { "docstring": "This function ... :return:", "name": "setup", "signature": "def setup(self)" } ]
2
stack_v2_sparse_classes_30k_train_038898
Implement the Python class `MapsComponent` described below. Class description: This class... Method signatures and docstrings: - def __init__(self, config=None): The constructor ... :param config: :return: - def setup(self): This function ... :return:
Implement the Python class `MapsComponent` described below. Class description: This class... Method signatures and docstrings: - def __init__(self, config=None): The constructor ... :param config: :return: - def setup(self): This function ... :return: <|skeleton|> class MapsComponent: """This class...""" de...
62b2339beb2eb956565e1605d44d92f934361ad7
<|skeleton|> class MapsComponent: """This class...""" def __init__(self, config=None): """The constructor ... :param config: :return:""" <|body_0|> def setup(self): """This function ... :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MapsComponent: """This class...""" def __init__(self, config=None): """The constructor ... :param config: :return:""" super(MapsComponent, self).__init__(config) self.maps_solar_path = None self.maps_intermediate_path = None self.maps_cutoff_path = None def se...
the_stack_v2_python_sparse
CAAPR/CAAPR_AstroMagic/PTS/pts/modeling/maps/component.py
Stargrazer82301/CAAPR
train
8
4f2d71c4097ff2a0b9d9fed3bb43d80e6dd33c6f
[ "self.included = self._get_plugins_by_type('included')\nself.custom = self._get_plugins_by_type('custom')\nfor plugin in list(self.custom):\n if plugin in self.included:\n del self.custom[plugin]\n warn('Custom plugin \"{plugin_name}\" is invalid, as there is already an included plugin of the same ...
<|body_start_0|> self.included = self._get_plugins_by_type('included') self.custom = self._get_plugins_by_type('custom') for plugin in list(self.custom): if plugin in self.included: del self.custom[plugin] warn('Custom plugin "{plugin_name}" is invalid...
Class used to store valid included and custom plugins.
_ValidPlugins
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _ValidPlugins: """Class used to store valid included and custom plugins.""" def __init__(self): """Store all plugins by their type.""" <|body_0|> def get_plugin_type(self, plugin_name): """Return the type (included or custom) for the given plugin.""" <|bo...
stack_v2_sparse_classes_75kplus_train_006707
5,248
no_license
[ { "docstring": "Store all plugins by their type.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Return the type (included or custom) for the given plugin.", "name": "get_plugin_type", "signature": "def get_plugin_type(self, plugin_name)" }, { "docstrin...
3
stack_v2_sparse_classes_30k_train_048656
Implement the Python class `_ValidPlugins` described below. Class description: Class used to store valid included and custom plugins. Method signatures and docstrings: - def __init__(self): Store all plugins by their type. - def get_plugin_type(self, plugin_name): Return the type (included or custom) for the given pl...
Implement the Python class `_ValidPlugins` described below. Class description: Class used to store valid included and custom plugins. Method signatures and docstrings: - def __init__(self): Store all plugins by their type. - def get_plugin_type(self, plugin_name): Return the type (included or custom) for the given pl...
cead3639bab2acce9da55a4e7f196c750160b27f
<|skeleton|> class _ValidPlugins: """Class used to store valid included and custom plugins.""" def __init__(self): """Store all plugins by their type.""" <|body_0|> def get_plugin_type(self, plugin_name): """Return the type (included or custom) for the given plugin.""" <|bo...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class _ValidPlugins: """Class used to store valid included and custom plugins.""" def __init__(self): """Store all plugins by their type.""" self.included = self._get_plugins_by_type('included') self.custom = self._get_plugins_by_type('custom') for plugin in list(self.custom): ...
the_stack_v2_python_sparse
srcds/addons/source-python/plugins/admin/core/plugins/valid.py
Source-Python-Dev-Team/Source.Python.Admin
train
8
0cf275b381fbe8da803bce9da473ed329be123d5
[ "self.mesh = mesh\nself.render_modes = render_modes\nself.frame = frame\nself.config = config\nself.stable_pose = stable_pose\nself.scene_objs = scene_objs\nself.num_prealloc_samples = num_prealloc_samples\nself.ws_rv = UniformPlanarWorksurfaceRandomVariable(self.frame, self.config, num_prealloc_samples=self.num_pr...
<|body_start_0|> self.mesh = mesh self.render_modes = render_modes self.frame = frame self.config = config self.stable_pose = stable_pose self.scene_objs = scene_objs self.num_prealloc_samples = num_prealloc_samples self.ws_rv = UniformPlanarWorksurfaceRan...
Random variable for sampling images from a camera
UniformPlanarWorksurfaceImageRandomVariable
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UniformPlanarWorksurfaceImageRandomVariable: """Random variable for sampling images from a camera""" def __init__(self, mesh, render_modes, frame, config, stable_pose=None, scene_objs=None, num_prealloc_samples=0): """Initialize a ViewsphereDiscretizer. Parameters ---------- mesh : :...
stack_v2_sparse_classes_75kplus_train_006708
19,794
permissive
[ { "docstring": "Initialize a ViewsphereDiscretizer. Parameters ---------- mesh : :obj:`Mesh3D` mesh of the object to render render_modes : :obj:`list` of :obj:`perception.RenderMode` render modes to use frame: :obj:`str` string name of the camera frame config : :obj:`autolab_core.YamlConfig` configuration conta...
2
stack_v2_sparse_classes_30k_train_032180
Implement the Python class `UniformPlanarWorksurfaceImageRandomVariable` described below. Class description: Random variable for sampling images from a camera Method signatures and docstrings: - def __init__(self, mesh, render_modes, frame, config, stable_pose=None, scene_objs=None, num_prealloc_samples=0): Initializ...
Implement the Python class `UniformPlanarWorksurfaceImageRandomVariable` described below. Class description: Random variable for sampling images from a camera Method signatures and docstrings: - def __init__(self, mesh, render_modes, frame, config, stable_pose=None, scene_objs=None, num_prealloc_samples=0): Initializ...
336eb9e9cbb534dea36b3e92e0d1b7adef13d7f3
<|skeleton|> class UniformPlanarWorksurfaceImageRandomVariable: """Random variable for sampling images from a camera""" def __init__(self, mesh, render_modes, frame, config, stable_pose=None, scene_objs=None, num_prealloc_samples=0): """Initialize a ViewsphereDiscretizer. Parameters ---------- mesh : :...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class UniformPlanarWorksurfaceImageRandomVariable: """Random variable for sampling images from a camera""" def __init__(self, mesh, render_modes, frame, config, stable_pose=None, scene_objs=None, num_prealloc_samples=0): """Initialize a ViewsphereDiscretizer. Parameters ---------- mesh : :obj:`Mesh3D` ...
the_stack_v2_python_sparse
meshpy/meshpy/random_variables.py
lianghongzhuo/PointNetGPD
train
285
3f212b9cf18461f4f8b7521317851cebffca86e4
[ "while low <= high:\n if s[low] == s[high]:\n low += 1\n high -= 1\n else:\n return False\nreturn True", "for size in range(len(s), -1, -1):\n print(len(s), size)\n for low in range(len(s)):\n high = low + (size - 1)\n if high < len(s):\n if self.shrinkChe...
<|body_start_0|> while low <= high: if s[low] == s[high]: low += 1 high -= 1 else: return False return True <|end_body_0|> <|body_start_1|> for size in range(len(s), -1, -1): print(len(s), size) for ...
Brute-force暴力求解法
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """Brute-force暴力求解法""" def shrinkCheckPalindrome(self, s, low, high): """判断传递的序列是否为回文序列,s[low:high+1]""" <|body_0|> def longestPalindrome(self, s): """暴力法解回文子串,实际上是滑动窗口,O(n^3),由于是滑动,因此找的就是最长子串""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_75kplus_train_006709
5,121
no_license
[ { "docstring": "判断传递的序列是否为回文序列,s[low:high+1]", "name": "shrinkCheckPalindrome", "signature": "def shrinkCheckPalindrome(self, s, low, high)" }, { "docstring": "暴力法解回文子串,实际上是滑动窗口,O(n^3),由于是滑动,因此找的就是最长子串", "name": "longestPalindrome", "signature": "def longestPalindrome(self, s)" } ]
2
stack_v2_sparse_classes_30k_train_031291
Implement the Python class `Solution` described below. Class description: Brute-force暴力求解法 Method signatures and docstrings: - def shrinkCheckPalindrome(self, s, low, high): 判断传递的序列是否为回文序列,s[low:high+1] - def longestPalindrome(self, s): 暴力法解回文子串,实际上是滑动窗口,O(n^3),由于是滑动,因此找的就是最长子串
Implement the Python class `Solution` described below. Class description: Brute-force暴力求解法 Method signatures and docstrings: - def shrinkCheckPalindrome(self, s, low, high): 判断传递的序列是否为回文序列,s[low:high+1] - def longestPalindrome(self, s): 暴力法解回文子串,实际上是滑动窗口,O(n^3),由于是滑动,因此找的就是最长子串 <|skeleton|> class Solution: """Br...
4e4f739402b95691f6c91411da26d7d3bfe042b6
<|skeleton|> class Solution: """Brute-force暴力求解法""" def shrinkCheckPalindrome(self, s, low, high): """判断传递的序列是否为回文序列,s[low:high+1]""" <|body_0|> def longestPalindrome(self, s): """暴力法解回文子串,实际上是滑动窗口,O(n^3),由于是滑动,因此找的就是最长子串""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: """Brute-force暴力求解法""" def shrinkCheckPalindrome(self, s, low, high): """判断传递的序列是否为回文序列,s[low:high+1]""" while low <= high: if s[low] == s[high]: low += 1 high -= 1 else: return False return True ...
the_stack_v2_python_sparse
other_code_programe/13、最长回文子串.py
hugechuanqi/Algorithms-and-Data-Structures
train
3
5a2fedbdf5218fb0ad37fc52dbacd227b7b38891
[ "params = base.get_params(None, locals())\nurl = '{0}/{1}'.format(self.get_url(), 'public')\nreturn (http.Request('GET', url, params), parsers.parse_json)", "params = base.get_params(None, locals())\nurl = '{0}/{1}'.format(self.get_url(), 'private')\nreturn (http.Request('GET', url, params), parsers.parse_json)" ...
<|body_start_0|> params = base.get_params(None, locals()) url = '{0}/{1}'.format(self.get_url(), 'public') return (http.Request('GET', url, params), parsers.parse_json) <|end_body_0|> <|body_start_1|> params = base.get_params(None, locals()) url = '{0}/{1}'.format(self.get_url()...
Stream
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Stream: def public(self, date=None, filter=None, since=None): """Fetch all public events. :var date: Fetch only events from that day (EST). See upstream documentation for details. :vartype date: str :var filter: Specify which event types you want. See upstream documentation for allowed v...
stack_v2_sparse_classes_75kplus_train_006710
1,675
permissive
[ { "docstring": "Fetch all public events. :var date: Fetch only events from that day (EST). See upstream documentation for details. :vartype date: str :var filter: Specify which event types you want. See upstream documentation for allowed values. :var filter: str :var since: Fetch events from that moment onward....
2
null
Implement the Python class `Stream` described below. Class description: Implement the Stream class. Method signatures and docstrings: - def public(self, date=None, filter=None, since=None): Fetch all public events. :var date: Fetch only events from that day (EST). See upstream documentation for details. :vartype date...
Implement the Python class `Stream` described below. Class description: Implement the Stream class. Method signatures and docstrings: - def public(self, date=None, filter=None, since=None): Fetch all public events. :var date: Fetch only events from that day (EST). See upstream documentation for details. :vartype date...
25caa745a104c8dc209584fa359294c65dbf88bb
<|skeleton|> class Stream: def public(self, date=None, filter=None, since=None): """Fetch all public events. :var date: Fetch only events from that day (EST). See upstream documentation for details. :vartype date: str :var filter: Specify which event types you want. See upstream documentation for allowed v...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Stream: def public(self, date=None, filter=None, since=None): """Fetch all public events. :var date: Fetch only events from that day (EST). See upstream documentation for details. :vartype date: str :var filter: Specify which event types you want. See upstream documentation for allowed values. :var fi...
the_stack_v2_python_sparse
libsaas/services/uservoice/streams.py
piplcom/libsaas
train
1
ce43b92f5b3b349459131776dc4053f9c0fb9126
[ "fs = self._parse_fs(fs)\nif rotate_u:\n tmpdat = self.reshape(veldat[0] + 1j * veldat[1])\n tmpdat *= np.exp(-1j * np.angle(tmpdat.mean(-1)))\n if noise[0] != noise[1]:\n print('Warning: noise levels different for u,v. This means noise-correction cannot be done here when rotatin...
<|body_start_0|> fs = self._parse_fs(fs) if rotate_u: tmpdat = self.reshape(veldat[0] + 1j * veldat[1]) tmpdat *= np.exp(-1j * np.angle(tmpdat.mean(-1))) if noise[0] != noise[1]: print('Warning: noise levels different for u,v. This means ...
VelBinnerSpec
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VelBinnerSpec: def calc_vel_psd(self, veldat, fs=None, rotate_u=False, noise=[0, 0, 0], n_pad=None, window='hann'): """Calculate the psd of velocity. Parameters ---------- veldat : np.ndarray The raw velocity data. fs : float (optional) The sample rate (default: from the binner). rotate_...
stack_v2_sparse_classes_75kplus_train_006711
15,509
permissive
[ { "docstring": "Calculate the psd of velocity. Parameters ---------- veldat : np.ndarray The raw velocity data. fs : float (optional) The sample rate (default: from the binner). rotate_u : bool (optional) If True, each 'bin' of horizontal velocity is rotated into its principal axis prior to calculating the psd....
2
stack_v2_sparse_classes_30k_train_010572
Implement the Python class `VelBinnerSpec` described below. Class description: Implement the VelBinnerSpec class. Method signatures and docstrings: - def calc_vel_psd(self, veldat, fs=None, rotate_u=False, noise=[0, 0, 0], n_pad=None, window='hann'): Calculate the psd of velocity. Parameters ---------- veldat : np.nd...
Implement the Python class `VelBinnerSpec` described below. Class description: Implement the VelBinnerSpec class. Method signatures and docstrings: - def calc_vel_psd(self, veldat, fs=None, rotate_u=False, noise=[0, 0, 0], n_pad=None, window='hann'): Calculate the psd of velocity. Parameters ---------- veldat : np.nd...
d807d0188f9e5f11845bc3f9efc7d154f729850a
<|skeleton|> class VelBinnerSpec: def calc_vel_psd(self, veldat, fs=None, rotate_u=False, noise=[0, 0, 0], n_pad=None, window='hann'): """Calculate the psd of velocity. Parameters ---------- veldat : np.ndarray The raw velocity data. fs : float (optional) The sample rate (default: from the binner). rotate_...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class VelBinnerSpec: def calc_vel_psd(self, veldat, fs=None, rotate_u=False, noise=[0, 0, 0], n_pad=None, window='hann'): """Calculate the psd of velocity. Parameters ---------- veldat : np.ndarray The raw velocity data. fs : float (optional) The sample rate (default: from the binner). rotate_u : bool (opti...
the_stack_v2_python_sparse
dolfyn/data/velocity_legacy.py
MRE-Code-Hub/dolfyn
train
0
170cc2bc2a643e992c30ac37639148f874e6a2e3
[ "obj = model_admin.model.objects.all().order_by('-log_day').first()\nif not obj:\n return []\nlast_log_day = obj.log_day\ndays = [last_log_day - timedelta(days=d) for d in range(0, 7)]\nresult = [(d.strftime('%Y-%m-%d'), d.strftime('%Y-%m-%d')) for d in days]\nresult.append(('7d', 'Last 7 days'))\nresult.append(...
<|body_start_0|> obj = model_admin.model.objects.all().order_by('-log_day').first() if not obj: return [] last_log_day = obj.log_day days = [last_log_day - timedelta(days=d) for d in range(0, 7)] result = [(d.strftime('%Y-%m-%d'), d.strftime('%Y-%m-%d')) for d in days...
DailyLogDayFilter
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DailyLogDayFilter: def lookups(self, request, model_admin): """Returns a list of tuples. The first element in each tuple is the coded value for the option that will appear in the URL query. The second element is the human-readable name for the option that will appear in the right sidebar...
stack_v2_sparse_classes_75kplus_train_006712
30,166
permissive
[ { "docstring": "Returns a list of tuples. The first element in each tuple is the coded value for the option that will appear in the URL query. The second element is the human-readable name for the option that will appear in the right sidebar.", "name": "lookups", "signature": "def lookups(self, request,...
2
stack_v2_sparse_classes_30k_train_054546
Implement the Python class `DailyLogDayFilter` described below. Class description: Implement the DailyLogDayFilter class. Method signatures and docstrings: - def lookups(self, request, model_admin): Returns a list of tuples. The first element in each tuple is the coded value for the option that will appear in the URL...
Implement the Python class `DailyLogDayFilter` described below. Class description: Implement the DailyLogDayFilter class. Method signatures and docstrings: - def lookups(self, request, model_admin): Returns a list of tuples. The first element in each tuple is the coded value for the option that will appear in the URL...
46dfea6e8687201e7f406ca8d46a3a716e7b3d28
<|skeleton|> class DailyLogDayFilter: def lookups(self, request, model_admin): """Returns a list of tuples. The first element in each tuple is the coded value for the option that will appear in the URL query. The second element is the human-readable name for the option that will appear in the right sidebar...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DailyLogDayFilter: def lookups(self, request, model_admin): """Returns a list of tuples. The first element in each tuple is the coded value for the option that will appear in the URL query. The second element is the human-readable name for the option that will appear in the right sidebar.""" o...
the_stack_v2_python_sparse
nginx/admin.py
dbca-wa/it-assets
train
9
3aa50cd82b1ac77df7f38e50c8ac6d3dd0fe65b5
[ "Continuum.__init__(self, *args, **kwargs)\nself.kappa_low = kappa_low\nself.kappa_high = kappa_high\nself.maxiter = maxiter", "if valid is None:\n valid = np.ones(x.shape, dtype=np.bool)\nxx = x[valid].copy()\nyy = y[valid].copy()\npoly = self._fit_poly(xx, yy)\ni = 0\nwhile i < self.maxiter:\n residuals =...
<|body_start_0|> Continuum.__init__(self, *args, **kwargs) self.kappa_low = kappa_low self.kappa_high = kappa_high self.maxiter = maxiter <|end_body_0|> <|body_start_1|> if valid is None: valid = np.ones(x.shape, dtype=np.bool) xx = x[valid].copy() yy...
Derives continuum from kappa-sigma clipping with polynomial.
SigmaClipping
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SigmaClipping: """Derives continuum from kappa-sigma clipping with polynomial.""" def __init__(self, kappa_low: float=3, kappa_high: float=3, maxiter: int=20, *args, **kwargs): """Initialize a new SigmaClipping continuum Args: kappa_low: Lower kappa. kappa_high: Upper kappa. maxiter:...
stack_v2_sparse_classes_75kplus_train_006713
15,610
permissive
[ { "docstring": "Initialize a new SigmaClipping continuum Args: kappa_low: Lower kappa. kappa_high: Upper kappa. maxiter: Maximum number of iterations.", "name": "__init__", "signature": "def __init__(self, kappa_low: float=3, kappa_high: float=3, maxiter: int=20, *args, **kwargs)" }, { "docstrin...
2
null
Implement the Python class `SigmaClipping` described below. Class description: Derives continuum from kappa-sigma clipping with polynomial. Method signatures and docstrings: - def __init__(self, kappa_low: float=3, kappa_high: float=3, maxiter: int=20, *args, **kwargs): Initialize a new SigmaClipping continuum Args: ...
Implement the Python class `SigmaClipping` described below. Class description: Derives continuum from kappa-sigma clipping with polynomial. Method signatures and docstrings: - def __init__(self, kappa_low: float=3, kappa_high: float=3, maxiter: int=20, *args, **kwargs): Initialize a new SigmaClipping continuum Args: ...
648eb1758e3744d9e3d6669edc4a0c4753559f17
<|skeleton|> class SigmaClipping: """Derives continuum from kappa-sigma clipping with polynomial.""" def __init__(self, kappa_low: float=3, kappa_high: float=3, maxiter: int=20, *args, **kwargs): """Initialize a new SigmaClipping continuum Args: kappa_low: Lower kappa. kappa_high: Upper kappa. maxiter:...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SigmaClipping: """Derives continuum from kappa-sigma clipping with polynomial.""" def __init__(self, kappa_low: float=3, kappa_high: float=3, maxiter: int=20, *args, **kwargs): """Initialize a new SigmaClipping continuum Args: kappa_low: Lower kappa. kappa_high: Upper kappa. maxiter: Maximum numb...
the_stack_v2_python_sparse
spexxy/utils/continuum.py
thusser/spexxy
train
4
214971cb33ee27829fcb480c2f6daff7c7848f83
[ "session_controller = SessionController()\nresponse = session_controller.login(user.username, user.password, user.rememberme, server.host, st_code)\nreturn response", "url = server + '/Services/Authentication/Login.do'\nrequest_params = dict()\nrequest_params['loginName'] = name\nrequest_params['password'] = pass...
<|body_start_0|> session_controller = SessionController() response = session_controller.login(user.username, user.password, user.rememberme, server.host, st_code) return response <|end_body_0|> <|body_start_1|> url = server + '/Services/Authentication/Login.do' request_params = ...
AuthService
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AuthService: def login(self, user, server, st_code=200): """login with user object and server object""" <|body_0|> def get_auth_token(self, name, password, server): """Получение токена авторизации""" <|body_1|> <|end_skeleton|> <|body_start_0|> sess...
stack_v2_sparse_classes_75kplus_train_006714
1,346
no_license
[ { "docstring": "login with user object and server object", "name": "login", "signature": "def login(self, user, server, st_code=200)" }, { "docstring": "Получение токена авторизации", "name": "get_auth_token", "signature": "def get_auth_token(self, name, password, server)" } ]
2
stack_v2_sparse_classes_30k_train_000587
Implement the Python class `AuthService` described below. Class description: Implement the AuthService class. Method signatures and docstrings: - def login(self, user, server, st_code=200): login with user object and server object - def get_auth_token(self, name, password, server): Получение токена авторизации
Implement the Python class `AuthService` described below. Class description: Implement the AuthService class. Method signatures and docstrings: - def login(self, user, server, st_code=200): login with user object and server object - def get_auth_token(self, name, password, server): Получение токена авторизации <|ske...
81e9aeb5d0a61d48fa90c9e2e97987a7c9975504
<|skeleton|> class AuthService: def login(self, user, server, st_code=200): """login with user object and server object""" <|body_0|> def get_auth_token(self, name, password, server): """Получение токена авторизации""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AuthService: def login(self, user, server, st_code=200): """login with user object and server object""" session_controller = SessionController() response = session_controller.login(user.username, user.password, user.rememberme, server.host, st_code) return response def get...
the_stack_v2_python_sparse
sdk/services/auth_service.py
dmoz/lementpro_python_sdk
train
0
49f1de400275ef196b5c3ba57d1c4223e5de3094
[ "super(up, self).__init__()\nself.conv1 = nn.Conv2d(inChannels, outChannels, 3, stride=1, padding=1)\nself.conv2 = nn.Conv2d(2 * outChannels, outChannels, 3, stride=1, padding=1)", "x = F.interpolate(x, size=[skpCn.size(2), skpCn.size(3)], mode='bilinear')\nx = F.leaky_relu(self.conv1(x), negative_slope=0.1)\nx =...
<|body_start_0|> super(up, self).__init__() self.conv1 = nn.Conv2d(inChannels, outChannels, 3, stride=1, padding=1) self.conv2 = nn.Conv2d(2 * outChannels, outChannels, 3, stride=1, padding=1) <|end_body_0|> <|body_start_1|> x = F.interpolate(x, size=[skpCn.size(2), skpCn.size(3)], mode...
A class for creating neural network blocks containing layers: Bilinear interpolation --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class to create a UNet like NN architecture. ... Methods ------- forward(x, skpCn) Returns output tensor after passing input `x` to the neural network bl...
up
[ "GPL-1.0-or-later", "Apache-2.0", "MIT", "BSD-2-Clause", "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class up: """A class for creating neural network blocks containing layers: Bilinear interpolation --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class to create a UNet like NN architecture. ... Methods ------- forward(x, skpCn) Returns output tensor after passing inpu...
stack_v2_sparse_classes_75kplus_train_006715
6,643
permissive
[ { "docstring": "Parameters ---------- inChannels : int number of input channels for the first convolutional layer. outChannels : int number of output channels for the first convolutional layer. This is also used for setting input and output channels for the second convolutional layer.", "name": "__init__", ...
2
stack_v2_sparse_classes_30k_train_024554
Implement the Python class `up` described below. Class description: A class for creating neural network blocks containing layers: Bilinear interpolation --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class to create a UNet like NN architecture. ... Methods ------- forward(x, skpCn) R...
Implement the Python class `up` described below. Class description: A class for creating neural network blocks containing layers: Bilinear interpolation --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class to create a UNet like NN architecture. ... Methods ------- forward(x, skpCn) R...
92acc188d3a0f634de58463b6676e70df83ef808
<|skeleton|> class up: """A class for creating neural network blocks containing layers: Bilinear interpolation --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class to create a UNet like NN architecture. ... Methods ------- forward(x, skpCn) Returns output tensor after passing inpu...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class up: """A class for creating neural network blocks containing layers: Bilinear interpolation --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class to create a UNet like NN architecture. ... Methods ------- forward(x, skpCn) Returns output tensor after passing input `x` to the ...
the_stack_v2_python_sparse
PyTorch/contrib/cv/video/QVI_ID2930_for_PyTorch/models/UNet2.py
Ascend/ModelZoo-PyTorch
train
23
cdc1c3592b7823c2caa81cd7950547c992552e49
[ "try:\n sh.zfs('list', '-t', 'filesystem', self.name)\nexcept sh.ErrorReturnCode_1:\n return False\nreturn True", "try:\n sh.zfs('create', self.name)\nexcept sh.ErrorReturnCode_1:\n raise\nreturn True", "if confirm is not True:\n raise ZfsError('Destroy of storage filesystem requires confirm=True...
<|body_start_0|> try: sh.zfs('list', '-t', 'filesystem', self.name) except sh.ErrorReturnCode_1: return False return True <|end_body_0|> <|body_start_1|> try: sh.zfs('create', self.name) except sh.ErrorReturnCode_1: raise r...
Filesystem
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Filesystem: def exists(self): """Checks if filesystem exists. filesystem = Filesystem('dpool/tmp/test0') filesystem.exists()""" <|body_0|> def create(self): """Creates storage filesystem. filesystem = Filesystem('dpool/tmp/test0') filesystem.create()""" <|bod...
stack_v2_sparse_classes_75kplus_train_006716
3,103
no_license
[ { "docstring": "Checks if filesystem exists. filesystem = Filesystem('dpool/tmp/test0') filesystem.exists()", "name": "exists", "signature": "def exists(self)" }, { "docstring": "Creates storage filesystem. filesystem = Filesystem('dpool/tmp/test0') filesystem.create()", "name": "create", ...
4
stack_v2_sparse_classes_30k_test_002334
Implement the Python class `Filesystem` described below. Class description: Implement the Filesystem class. Method signatures and docstrings: - def exists(self): Checks if filesystem exists. filesystem = Filesystem('dpool/tmp/test0') filesystem.exists() - def create(self): Creates storage filesystem. filesystem = Fil...
Implement the Python class `Filesystem` described below. Class description: Implement the Filesystem class. Method signatures and docstrings: - def exists(self): Checks if filesystem exists. filesystem = Filesystem('dpool/tmp/test0') filesystem.exists() - def create(self): Creates storage filesystem. filesystem = Fil...
8ed19bc7d481e398bce318b7d513f4583f1e623f
<|skeleton|> class Filesystem: def exists(self): """Checks if filesystem exists. filesystem = Filesystem('dpool/tmp/test0') filesystem.exists()""" <|body_0|> def create(self): """Creates storage filesystem. filesystem = Filesystem('dpool/tmp/test0') filesystem.create()""" <|bod...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Filesystem: def exists(self): """Checks if filesystem exists. filesystem = Filesystem('dpool/tmp/test0') filesystem.exists()""" try: sh.zfs('list', '-t', 'filesystem', self.name) except sh.ErrorReturnCode_1: return False return True def create(self)...
the_stack_v2_python_sparse
solarsan/storage/filesystem.py
akatrevorjay/solarsan
train
1
c7426051809a28e3b48e89ce585981890d907960
[ "min_diff = 999999\ns_times = sorted(times)\nfor index in range(len(s_times) - 1):\n next_a, next_b = s_times[index + 1].split(':')\n curr_a, curr_b = s_times[index].split(':')\n diff = int(next_a) * 60 + int(next_b) - (int(curr_a) * 60 + int(curr_b))\n if diff < min_diff:\n min_diff = diff\ncurr...
<|body_start_0|> min_diff = 999999 s_times = sorted(times) for index in range(len(s_times) - 1): next_a, next_b = s_times[index + 1].split(':') curr_a, curr_b = s_times[index].split(':') diff = int(next_a) * 60 + int(next_b) - (int(curr_a) * 60 + int(curr_b)) ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def timeDifference_1(self, times): """:type times: list of str :rtype: int :O(NLogN) solution""" <|body_0|> def timeDifference(self, times): """:type times: list of str :rtype: int :O(N) solution""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_75kplus_train_006717
1,998
no_license
[ { "docstring": ":type times: list of str :rtype: int :O(NLogN) solution", "name": "timeDifference_1", "signature": "def timeDifference_1(self, times)" }, { "docstring": ":type times: list of str :rtype: int :O(N) solution", "name": "timeDifference", "signature": "def timeDifference(self,...
2
stack_v2_sparse_classes_30k_test_002255
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def timeDifference_1(self, times): :type times: list of str :rtype: int :O(NLogN) solution - def timeDifference(self, times): :type times: list of str :rtype: int :O(N) solution
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def timeDifference_1(self, times): :type times: list of str :rtype: int :O(NLogN) solution - def timeDifference(self, times): :type times: list of str :rtype: int :O(N) solution ...
ec48cbde4356208afac226d41752daffe674be2c
<|skeleton|> class Solution: def timeDifference_1(self, times): """:type times: list of str :rtype: int :O(NLogN) solution""" <|body_0|> def timeDifference(self, times): """:type times: list of str :rtype: int :O(N) solution""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def timeDifference_1(self, times): """:type times: list of str :rtype: int :O(NLogN) solution""" min_diff = 999999 s_times = sorted(times) for index in range(len(s_times) - 1): next_a, next_b = s_times[index + 1].split(':') curr_a, curr_b = s_t...
the_stack_v2_python_sparse
B2BSWE/Primitives/min_time_diff.py
librar127/PythonDS
train
0
5ccf0109d23d13be75f63257341ebf131da9b4c4
[ "len_nums = len(nums)\nfor i in range(len_nums - 1, 0, -1):\n if nums[i] > nums[i - 1]:\n if i == 1 and nums[i - 1] == max(nums):\n nums.reverse()\n else:\n j = len_nums - 1\n while j > i and nums[i] < nums[j]:\n j -= 1\n temp = nums[i - 1]...
<|body_start_0|> len_nums = len(nums) for i in range(len_nums - 1, 0, -1): if nums[i] > nums[i - 1]: if i == 1 and nums[i - 1] == max(nums): nums.reverse() else: j = len_nums - 1 while j > i and nums[...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def nextPermutationmy(self, nums): """Do not return anything, modify nums in-place instead.""" <|body_0|> def nextPermutation(self, nums): """Do not return anything, modify nums in-place instead. 答题思路:从后往前寻找第一个升序对(i,j)即nums[i]<nums[j] 再从后往前找第一个大于nums[i]的数即为...
stack_v2_sparse_classes_75kplus_train_006718
5,932
no_license
[ { "docstring": "Do not return anything, modify nums in-place instead.", "name": "nextPermutationmy", "signature": "def nextPermutationmy(self, nums)" }, { "docstring": "Do not return anything, modify nums in-place instead. 答题思路:从后往前寻找第一个升序对(i,j)即nums[i]<nums[j] 再从后往前找第一个大于nums[i]的数即为大数,交换着两个元素即将...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def nextPermutationmy(self, nums): Do not return anything, modify nums in-place instead. - def nextPermutation(self, nums): Do not return anything, modify nums in-place instead. ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def nextPermutationmy(self, nums): Do not return anything, modify nums in-place instead. - def nextPermutation(self, nums): Do not return anything, modify nums in-place instead. ...
d86f7dd4a6d9fbb0aaa8005f5b3ab3f609f1588d
<|skeleton|> class Solution: def nextPermutationmy(self, nums): """Do not return anything, modify nums in-place instead.""" <|body_0|> def nextPermutation(self, nums): """Do not return anything, modify nums in-place instead. 答题思路:从后往前寻找第一个升序对(i,j)即nums[i]<nums[j] 再从后往前找第一个大于nums[i]的数即为...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def nextPermutationmy(self, nums): """Do not return anything, modify nums in-place instead.""" len_nums = len(nums) for i in range(len_nums - 1, 0, -1): if nums[i] > nums[i - 1]: if i == 1 and nums[i - 1] == max(nums): nums.reve...
the_stack_v2_python_sparse
hot/a30_next_permutation.py
yongzhuo/leetcode-in-out
train
2
d019f1a9c449ace6483ff68b08adb203bf7f6095
[ "self.settings = settings\nself.ships_left = self.settings.ships_limit\nself.current_score = 0\nself.level = 1\nself.reset_stats()\nself.game_active = False\nself.record_score = 0\nself.read_high_score()", "try:\n with open(self.settings.file_score, encoding='utf-8') as file_obj:\n self.record_score = i...
<|body_start_0|> self.settings = settings self.ships_left = self.settings.ships_limit self.current_score = 0 self.level = 1 self.reset_stats() self.game_active = False self.record_score = 0 self.read_high_score() <|end_body_0|> <|body_start_1|> tr...
Класс для отслеживания статистики в игре
GameStats
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GameStats: """Класс для отслеживания статистики в игре""" def __init__(self, settings): """Инициализируем статистику""" <|body_0|> def read_high_score(self): """Считываем рекорд из файла""" <|body_1|> def write_high_score(self): """Записываем...
stack_v2_sparse_classes_75kplus_train_006719
1,617
no_license
[ { "docstring": "Инициализируем статистику", "name": "__init__", "signature": "def __init__(self, settings)" }, { "docstring": "Считываем рекорд из файла", "name": "read_high_score", "signature": "def read_high_score(self)" }, { "docstring": "Записываем рекорд в файл", "name":...
4
stack_v2_sparse_classes_30k_val_001794
Implement the Python class `GameStats` described below. Class description: Класс для отслеживания статистики в игре Method signatures and docstrings: - def __init__(self, settings): Инициализируем статистику - def read_high_score(self): Считываем рекорд из файла - def write_high_score(self): Записываем рекорд в файл ...
Implement the Python class `GameStats` described below. Class description: Класс для отслеживания статистики в игре Method signatures and docstrings: - def __init__(self, settings): Инициализируем статистику - def read_high_score(self): Считываем рекорд из файла - def write_high_score(self): Записываем рекорд в файл ...
ea34bd0fc2db6576d21de5ddd6c060e7ea151213
<|skeleton|> class GameStats: """Класс для отслеживания статистики в игре""" def __init__(self, settings): """Инициализируем статистику""" <|body_0|> def read_high_score(self): """Считываем рекорд из файла""" <|body_1|> def write_high_score(self): """Записываем...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GameStats: """Класс для отслеживания статистики в игре""" def __init__(self, settings): """Инициализируем статистику""" self.settings = settings self.ships_left = self.settings.ships_limit self.current_score = 0 self.level = 1 self.reset_stats() sel...
the_stack_v2_python_sparse
alien_invasion/game_stats.py
Toptimum/games
train
0
a691369c1cb1bf714c508b7daafb7694cee28f18
[ "if not root:\n return []\nqueue = collections.deque([root])\nres = []\nwhile queue:\n size = len(queue)\n for i in range(size):\n node = queue.pop()\n if node:\n res.append(node.val)\n queue.appendleft(node.left)\n queue.appendleft(node.right)\n else:\...
<|body_start_0|> if not root: return [] queue = collections.deque([root]) res = [] while queue: size = len(queue) for i in range(size): node = queue.pop() if node: res.append(node.val) ...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_75kplus_train_006720
1,777
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
stack_v2_sparse_classes_30k_train_049713
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
1d8821da01c9c200732a6b7037b8631689e2f7e7
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" if not root: return [] queue = collections.deque([root]) res = [] while queue: size = len(queue) for i in range(size): ...
the_stack_v2_python_sparse
Leetcode0297_Queue.py
xiaojinghu/Leetcode
train
0
2e6ea76e4d15d7f4a4229c8b4353ffe42881e77c
[ "query = u'\\n INSERT INTO res\\n (thread_id, name, message, create_time)\\n VALUES\\n (:thread_id, :name, :message, NOW())\\n '\nparam = {u'thread_id': args.get(u'thread_id'), u'name': args.get(u'username'), u'message': args.get...
<|body_start_0|> query = u'\n INSERT INTO res\n (thread_id, name, message, create_time)\n VALUES\n (:thread_id, :name, :message, NOW())\n ' param = {u'thread_id': args.get(u'thread_id'), u'name': args.get(u'username')...
レスがらみのDB処理用 res
resDb
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class resDb: """レスがらみのDB処理用 res""" def newCreateRes(self, args): """res にレコード追加""" <|body_0|> def catchResAllRecord(self, thread_id): """res テーブルの全てのレコードを返す""" <|body_1|> def catchResRecord(self, thread_id, limit, count): """res テーブルの一部のレコードを返す""" ...
stack_v2_sparse_classes_75kplus_train_006721
1,751
no_license
[ { "docstring": "res にレコード追加", "name": "newCreateRes", "signature": "def newCreateRes(self, args)" }, { "docstring": "res テーブルの全てのレコードを返す", "name": "catchResAllRecord", "signature": "def catchResAllRecord(self, thread_id)" }, { "docstring": "res テーブルの一部のレコードを返す", "name": "catc...
3
null
Implement the Python class `resDb` described below. Class description: レスがらみのDB処理用 res Method signatures and docstrings: - def newCreateRes(self, args): res にレコード追加 - def catchResAllRecord(self, thread_id): res テーブルの全てのレコードを返す - def catchResRecord(self, thread_id, limit, count): res テーブルの一部のレコードを返す
Implement the Python class `resDb` described below. Class description: レスがらみのDB処理用 res Method signatures and docstrings: - def newCreateRes(self, args): res にレコード追加 - def catchResAllRecord(self, thread_id): res テーブルの全てのレコードを返す - def catchResRecord(self, thread_id, limit, count): res テーブルの一部のレコードを返す <|skeleton|> clas...
ed9288e54a2d76d730c785e2dcd523a745e5d12e
<|skeleton|> class resDb: """レスがらみのDB処理用 res""" def newCreateRes(self, args): """res にレコード追加""" <|body_0|> def catchResAllRecord(self, thread_id): """res テーブルの全てのレコードを返す""" <|body_1|> def catchResRecord(self, thread_id, limit, count): """res テーブルの一部のレコードを返す""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class resDb: """レスがらみのDB処理用 res""" def newCreateRes(self, args): """res にレコード追加""" query = u'\n INSERT INTO res\n (thread_id, name, message, create_time)\n VALUES\n (:thread_id, :name, :message, NOW())\n ' ...
the_stack_v2_python_sparse
test03/model/resdb.py
GunioRobot/learning-web.py
train
0
f89cb10316966b7d6811529105bec64e00a4f4b3
[ "logger.info('Visiting %s', self.home_url)\nself.get_response(self.home_url)\nlogger.info('Logging in...')\nresponse = self.submit_form(login_url, data=dict(myusername=username, mypassword=password, remember=0))\ndata = response.json()\nlogger.debug(data)\nif 'response' in data and data['response'] == 'true':\n ...
<|body_start_0|> logger.info('Visiting %s', self.home_url) self.get_response(self.home_url) logger.info('Logging in...') response = self.submit_form(login_url, data=dict(myusername=username, mypassword=password, remember=0)) data = response.json() logger.debug(data) ...
MtledNovelsCrawler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MtledNovelsCrawler: def login(self, username, password): """login to LNMTL""" <|body_0|> def logout(self): """logout as a good citizen""" <|body_1|> def read_novel_info(self): """Get novel title, autor, cover etc""" <|body_2|> def do...
stack_v2_sparse_classes_75kplus_train_006722
4,801
permissive
[ { "docstring": "login to LNMTL", "name": "login", "signature": "def login(self, username, password)" }, { "docstring": "logout as a good citizen", "name": "logout", "signature": "def logout(self)" }, { "docstring": "Get novel title, autor, cover etc", "name": "read_novel_info...
4
null
Implement the Python class `MtledNovelsCrawler` described below. Class description: Implement the MtledNovelsCrawler class. Method signatures and docstrings: - def login(self, username, password): login to LNMTL - def logout(self): logout as a good citizen - def read_novel_info(self): Get novel title, autor, cover et...
Implement the Python class `MtledNovelsCrawler` described below. Class description: Implement the MtledNovelsCrawler class. Method signatures and docstrings: - def login(self, username, password): login to LNMTL - def logout(self): logout as a good citizen - def read_novel_info(self): Get novel title, autor, cover et...
451e816ab03c8466be90f6f0b3eaa52d799140ce
<|skeleton|> class MtledNovelsCrawler: def login(self, username, password): """login to LNMTL""" <|body_0|> def logout(self): """logout as a good citizen""" <|body_1|> def read_novel_info(self): """Get novel title, autor, cover etc""" <|body_2|> def do...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MtledNovelsCrawler: def login(self, username, password): """login to LNMTL""" logger.info('Visiting %s', self.home_url) self.get_response(self.home_url) logger.info('Logging in...') response = self.submit_form(login_url, data=dict(myusername=username, mypassword=passwor...
the_stack_v2_python_sparse
lncrawl/sources/mtlednovels.py
NNTin/lightnovel-crawler
train
2
4366c0d0c2775f79d5af9175f7ac63992c4cdcf4
[ "command = ['gcloud', 'auth', 'login', '-q']\nsubprocess.check_call(command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)\nreturn AuthClient.get_default_credentials()", "credentials_path = AuthClient._get_active_account_adc_path()\ntry:\n creds = credentials.Credentials.from_authorized_user_file(crede...
<|body_start_0|> command = ['gcloud', 'auth', 'login', '-q'] subprocess.check_call(command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) return AuthClient.get_default_credentials() <|end_body_0|> <|body_start_1|> credentials_path = AuthClient._get_active_account_adc_path() ...
A class for GCP authentication.
AuthClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AuthClient: """A class for GCP authentication.""" def create_default_credentials() -> credentials.Credentials: """Retrieves google application default credentials for authentication. Uses subprocess to call gcloud auth application-default login. User must have gcloud installed. Retur...
stack_v2_sparse_classes_75kplus_train_006723
3,838
permissive
[ { "docstring": "Retrieves google application default credentials for authentication. Uses subprocess to call gcloud auth application-default login. User must have gcloud installed. Returns: Credentials Object", "name": "create_default_credentials", "signature": "def create_default_credentials() -> crede...
4
null
Implement the Python class `AuthClient` described below. Class description: A class for GCP authentication. Method signatures and docstrings: - def create_default_credentials() -> credentials.Credentials: Retrieves google application default credentials for authentication. Uses subprocess to call gcloud auth applicat...
Implement the Python class `AuthClient` described below. Class description: A class for GCP authentication. Method signatures and docstrings: - def create_default_credentials() -> credentials.Credentials: Retrieves google application default credentials for authentication. Uses subprocess to call gcloud auth applicat...
d316b1e45357761e2b124143e6e12ce34ef6f975
<|skeleton|> class AuthClient: """A class for GCP authentication.""" def create_default_credentials() -> credentials.Credentials: """Retrieves google application default credentials for authentication. Uses subprocess to call gcloud auth application-default login. User must have gcloud installed. Retur...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AuthClient: """A class for GCP authentication.""" def create_default_credentials() -> credentials.Credentials: """Retrieves google application default credentials for authentication. Uses subprocess to call gcloud auth application-default login. User must have gcloud installed. Returns: Credentia...
the_stack_v2_python_sparse
django_cloud_deploy/cloudlib/auth.py
GoogleCloudPlatform/django-cloud-deploy
train
64
d59b432a2565ff97ccfcf5bb2632e88398dfab3b
[ "url = reverse('collection-urls')\ndata = json.dumps(VALID_COLLECTION_SAMPLE_DATA)\nresponse = client.post(url, data=data, content_type='application/json', HTTP_AUTHORIZATION='Token {}'.format(self.token))\ncollection_uuid = response.data['collection_uuid']\ncollection = Collection.objects.get(uuid=collection_uuid)...
<|body_start_0|> url = reverse('collection-urls') data = json.dumps(VALID_COLLECTION_SAMPLE_DATA) response = client.post(url, data=data, content_type='application/json', HTTP_AUTHORIZATION='Token {}'.format(self.token)) collection_uuid = response.data['collection_uuid'] collectio...
Tests for Collection data generation APIs
CollectionCreationTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CollectionCreationTests: """Tests for Collection data generation APIs""" def test_valid_collection_creation(self): """testing behaviour of Create Collection API when a valid data is passed""" <|body_0|> def test_invalid_title_collection_creation(self): """testing...
stack_v2_sparse_classes_75kplus_train_006724
18,065
no_license
[ { "docstring": "testing behaviour of Create Collection API when a valid data is passed", "name": "test_valid_collection_creation", "signature": "def test_valid_collection_creation(self)" }, { "docstring": "testing behaviour of Create Collection API when a data with invalid title is passed", ...
3
stack_v2_sparse_classes_30k_train_040350
Implement the Python class `CollectionCreationTests` described below. Class description: Tests for Collection data generation APIs Method signatures and docstrings: - def test_valid_collection_creation(self): testing behaviour of Create Collection API when a valid data is passed - def test_invalid_title_collection_cr...
Implement the Python class `CollectionCreationTests` described below. Class description: Tests for Collection data generation APIs Method signatures and docstrings: - def test_valid_collection_creation(self): testing behaviour of Create Collection API when a valid data is passed - def test_invalid_title_collection_cr...
e27a4c813c2b14095ca42b0c5f116744f31556fb
<|skeleton|> class CollectionCreationTests: """Tests for Collection data generation APIs""" def test_valid_collection_creation(self): """testing behaviour of Create Collection API when a valid data is passed""" <|body_0|> def test_invalid_title_collection_creation(self): """testing...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CollectionCreationTests: """Tests for Collection data generation APIs""" def test_valid_collection_creation(self): """testing behaviour of Create Collection API when a valid data is passed""" url = reverse('collection-urls') data = json.dumps(VALID_COLLECTION_SAMPLE_DATA) ...
the_stack_v2_python_sparse
movies/tests.py
dprestsde/movies-collections-drf
train
0
13afe98a7ca5ee20397a0e57917b7f2f40368fdb
[ "process_move_id = context and context.get('active_id', False) or False\ntotal_qty = context and context.get('total_qty', 0.0) or 0.0\nproduct_id = context and context.get('product_id', False) or False\nprocess_qty = context and context.get('process_qty', 0.0) or 0.0\nres = super(qty_to_consume, self).default_get(c...
<|body_start_0|> process_move_id = context and context.get('active_id', False) or False total_qty = context and context.get('total_qty', 0.0) or 0.0 product_id = context and context.get('product_id', False) or False process_qty = context and context.get('process_qty', 0.0) or 0.0 ...
qty_to_consume
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class qty_to_consume: def default_get(self, cr, uid, fields, context): """-Process -Set default values of -Active_id -Product -Total Qty""" <|body_0|> def _check_validation_consume_qty(self, cr, uid, total_qty, consume_qty): """- Process - Warning raise, if consume_qty > t...
stack_v2_sparse_classes_75kplus_train_006725
6,631
no_license
[ { "docstring": "-Process -Set default values of -Active_id -Product -Total Qty", "name": "default_get", "signature": "def default_get(self, cr, uid, fields, context)" }, { "docstring": "- Process - Warning raise, if consume_qty > total qty or consume_qty < 0", "name": "_check_validation_cons...
4
null
Implement the Python class `qty_to_consume` described below. Class description: Implement the qty_to_consume class. Method signatures and docstrings: - def default_get(self, cr, uid, fields, context): -Process -Set default values of -Active_id -Product -Total Qty - def _check_validation_consume_qty(self, cr, uid, tot...
Implement the Python class `qty_to_consume` described below. Class description: Implement the qty_to_consume class. Method signatures and docstrings: - def default_get(self, cr, uid, fields, context): -Process -Set default values of -Active_id -Product -Total Qty - def _check_validation_consume_qty(self, cr, uid, tot...
d3daac105636ac4e146816232c616298dc5bb742
<|skeleton|> class qty_to_consume: def default_get(self, cr, uid, fields, context): """-Process -Set default values of -Active_id -Product -Total Qty""" <|body_0|> def _check_validation_consume_qty(self, cr, uid, total_qty, consume_qty): """- Process - Warning raise, if consume_qty > t...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class qty_to_consume: def default_get(self, cr, uid, fields, context): """-Process -Set default values of -Active_id -Product -Total Qty""" process_move_id = context and context.get('active_id', False) or False total_qty = context and context.get('total_qty', 0.0) or 0.0 product_id =...
the_stack_v2_python_sparse
l10n_in_mrp_subcontract/wizard/qty_to_consume.py
Odoo-India/odoo-india
train
10
8c779168b2e4a6ab89322b818f4123e98686e3b9
[ "super().__init__()\nif not point_ids and (not cell_ids):\n raise ValueError('IDs must be set for points or cells or both.')\nself.point_ids = point_ids\nself.cell_ids = cell_ids", "try:\n inp = wrap(self.GetInputData(inInfo, 0, 0))\n out = self.GetOutputData(outInfo, 0)\n output = inp.copy()\n if ...
<|body_start_0|> super().__init__() if not point_ids and (not cell_ids): raise ValueError('IDs must be set for points or cells or both.') self.point_ids = point_ids self.cell_ids = cell_ids <|end_body_0|> <|body_start_1|> try: inp = wrap(self.GetInputData...
Algorithm to add point or cell IDs. Output of this filter is a shallow copy of the input with point and/or cell ID arrays added.
AddIDsAlgorithm
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AddIDsAlgorithm: """Algorithm to add point or cell IDs. Output of this filter is a shallow copy of the input with point and/or cell ID arrays added.""" def __init__(self, point_ids=True, cell_ids=True): """Initialize algorithm.""" <|body_0|> def RequestData(self, request...
stack_v2_sparse_classes_75kplus_train_006726
11,491
permissive
[ { "docstring": "Initialize algorithm.", "name": "__init__", "signature": "def __init__(self, point_ids=True, cell_ids=True)" }, { "docstring": "Perform algorithm execution.", "name": "RequestData", "signature": "def RequestData(self, request, inInfo, outInfo)" } ]
2
stack_v2_sparse_classes_30k_train_054295
Implement the Python class `AddIDsAlgorithm` described below. Class description: Algorithm to add point or cell IDs. Output of this filter is a shallow copy of the input with point and/or cell ID arrays added. Method signatures and docstrings: - def __init__(self, point_ids=True, cell_ids=True): Initialize algorithm....
Implement the Python class `AddIDsAlgorithm` described below. Class description: Algorithm to add point or cell IDs. Output of this filter is a shallow copy of the input with point and/or cell ID arrays added. Method signatures and docstrings: - def __init__(self, point_ids=True, cell_ids=True): Initialize algorithm....
1b450b23340f367315fc914075d551e0a4df8cc3
<|skeleton|> class AddIDsAlgorithm: """Algorithm to add point or cell IDs. Output of this filter is a shallow copy of the input with point and/or cell ID arrays added.""" def __init__(self, point_ids=True, cell_ids=True): """Initialize algorithm.""" <|body_0|> def RequestData(self, request...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AddIDsAlgorithm: """Algorithm to add point or cell IDs. Output of this filter is a shallow copy of the input with point and/or cell ID arrays added.""" def __init__(self, point_ids=True, cell_ids=True): """Initialize algorithm.""" super().__init__() if not point_ids and (not cell_...
the_stack_v2_python_sparse
pyvista/plotting/utilities/algorithms.py
pyvista/pyvista
train
1,885
b5347db8c6fbb733e3376f15d1b7895820e7dd20
[ "self.in_shape = None\nself.in_filters = None\nself.out_filters = out_filters\nself.out_shape = None\nself.strides = strides\nself.use_bias = use_bias\nself.filter_shape = filter_shape\nself.full_strides = [1] + list(self.strides) + [1]\nself._rank = len(list(self.strides))\nassert 1 < self._rank < 4, 'Transposed c...
<|body_start_0|> self.in_shape = None self.in_filters = None self.out_filters = out_filters self.out_shape = None self.strides = strides self.use_bias = use_bias self.filter_shape = filter_shape self.full_strides = [1] + list(self.strides) + [1] se...
Tranposed convolution module This build a 2D or 3D transposed convolution based on the dimensionality of the input
TransposedConvolution
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TransposedConvolution: """Tranposed convolution module This build a 2D or 3D transposed convolution based on the dimensionality of the input""" def __init__(self, out_filters, strides=(1, 1, 1), filter_shape=None, use_bias=False, name='conv_transposed'): """Constructs a transposed co...
stack_v2_sparse_classes_75kplus_train_006727
3,805
permissive
[ { "docstring": "Constructs a transposed convolution The kernel shape is defined as 2 * stride for stride > 1 Parameters ---------- out_filters : int number of output filters strides : tuple or list, optional strides used for the transposed convolution use_bias : bool flag to toggle whether a bias is added to th...
3
null
Implement the Python class `TransposedConvolution` described below. Class description: Tranposed convolution module This build a 2D or 3D transposed convolution based on the dimensionality of the input Method signatures and docstrings: - def __init__(self, out_filters, strides=(1, 1, 1), filter_shape=None, use_bias=F...
Implement the Python class `TransposedConvolution` described below. Class description: Tranposed convolution module This build a 2D or 3D transposed convolution based on the dimensionality of the input Method signatures and docstrings: - def __init__(self, out_filters, strides=(1, 1, 1), filter_shape=None, use_bias=F...
80d1a04dc163590aa44b62688b06aece78fb7fd6
<|skeleton|> class TransposedConvolution: """Tranposed convolution module This build a 2D or 3D transposed convolution based on the dimensionality of the input""" def __init__(self, out_filters, strides=(1, 1, 1), filter_shape=None, use_bias=False, name='conv_transposed'): """Constructs a transposed co...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TransposedConvolution: """Tranposed convolution module This build a 2D or 3D transposed convolution based on the dimensionality of the input""" def __init__(self, out_filters, strides=(1, 1, 1), filter_shape=None, use_bias=False, name='conv_transposed'): """Constructs a transposed convolution The...
the_stack_v2_python_sparse
dltk/core/modules/tranposed_convolution.py
pawni/DLTK-1
train
1
191693511078b02f3e73f38657f9bbe33d6c36be
[ "test_bookmark = self._create_test_bookmark()\nself.session.flush()\nself.session.commit()\nself.assertIsNotNone(self._select_bookmark(test_bookmark.bookmark_id))\nBookmark.delete_bookmark(test_bookmark.bookmark_id)\nself.session.flush()\nself.session.commit()\nself.assertIsNone(self._select_bookmark(test_bookmark....
<|body_start_0|> test_bookmark = self._create_test_bookmark() self.session.flush() self.session.commit() self.assertIsNotNone(self._select_bookmark(test_bookmark.bookmark_id)) Bookmark.delete_bookmark(test_bookmark.bookmark_id) self.session.flush() self.session.co...
Verify Bookmark.delete_bookmark.
BookmarkDeleteTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BookmarkDeleteTests: """Verify Bookmark.delete_bookmark.""" def test_delete(self): """Verify that bookmark is deleted.""" <|body_0|> def test_delete__no_such_bookmark(self): """Verify that delete_bookmark does no harm if bookmark does not exist.""" <|body...
stack_v2_sparse_classes_75kplus_train_006728
42,223
no_license
[ { "docstring": "Verify that bookmark is deleted.", "name": "test_delete", "signature": "def test_delete(self)" }, { "docstring": "Verify that delete_bookmark does no harm if bookmark does not exist.", "name": "test_delete__no_such_bookmark", "signature": "def test_delete__no_such_bookmar...
2
stack_v2_sparse_classes_30k_val_001784
Implement the Python class `BookmarkDeleteTests` described below. Class description: Verify Bookmark.delete_bookmark. Method signatures and docstrings: - def test_delete(self): Verify that bookmark is deleted. - def test_delete__no_such_bookmark(self): Verify that delete_bookmark does no harm if bookmark does not exi...
Implement the Python class `BookmarkDeleteTests` described below. Class description: Verify Bookmark.delete_bookmark. Method signatures and docstrings: - def test_delete(self): Verify that bookmark is deleted. - def test_delete__no_such_bookmark(self): Verify that delete_bookmark does no harm if bookmark does not exi...
ef6c69da37db19a0d41961afafe52e5ecb21449f
<|skeleton|> class BookmarkDeleteTests: """Verify Bookmark.delete_bookmark.""" def test_delete(self): """Verify that bookmark is deleted.""" <|body_0|> def test_delete__no_such_bookmark(self): """Verify that delete_bookmark does no harm if bookmark does not exist.""" <|body...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BookmarkDeleteTests: """Verify Bookmark.delete_bookmark.""" def test_delete(self): """Verify that bookmark is deleted.""" test_bookmark = self._create_test_bookmark() self.session.flush() self.session.commit() self.assertIsNotNone(self._select_bookmark(test_bookmar...
the_stack_v2_python_sparse
server/bookmarks/dao/test_bookmark_dao.py
Presterity/bookmarks
train
0
b2a4e54fdb2fe863bc3d1027b940d1e0ab6a6675
[ "super().__init__(**kwargs)\nself.duration = duration\nself.external_dag_id = external_dag_id\nself.check_exists = check_exists\nself.grace_period = grace_period", "success_state = True\nretry_state = False\nif self.check_exists:\n self.check_dag_exists(session)\nexecution_date = context['execution_date']\ndat...
<|body_start_0|> super().__init__(**kwargs) self.duration = duration self.external_dag_id = external_dag_id self.check_exists = check_exists self.grace_period = grace_period <|end_body_0|> <|body_start_1|> success_state = True retry_state = False if self....
A sensor for monitoring dag runs from other DAGs. Behaviour: * If the DAG ID does not exist, throw an exception. * Monitors the time period [execution_date - duration, execution_date] for the DAG's dag runs. - If there are no runs, then return a success state. - If there are runs, look at the latest run in the time per...
DagRunSensor
[ "MIT", "BSD-2-Clause", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DagRunSensor: """A sensor for monitoring dag runs from other DAGs. Behaviour: * If the DAG ID does not exist, throw an exception. * Monitors the time period [execution_date - duration, execution_date] for the DAG's dag runs. - If there are no runs, then return a success state. - If there are runs...
stack_v2_sparse_classes_75kplus_train_006729
5,825
permissive
[ { "docstring": ":param external_dag_id: The DAG ID to monitor. :param duration: Size of the window to look back from the current execution date. :param check_exists: Whether to perform check for dag existence. :param grace_period: If no dag run can be found, sleep for this short grace period and try again. :par...
5
stack_v2_sparse_classes_30k_train_003333
Implement the Python class `DagRunSensor` described below. Class description: A sensor for monitoring dag runs from other DAGs. Behaviour: * If the DAG ID does not exist, throw an exception. * Monitors the time period [execution_date - duration, execution_date] for the DAG's dag runs. - If there are no runs, then retu...
Implement the Python class `DagRunSensor` described below. Class description: A sensor for monitoring dag runs from other DAGs. Behaviour: * If the DAG ID does not exist, throw an exception. * Monitors the time period [execution_date - duration, execution_date] for the DAG's dag runs. - If there are no runs, then retu...
8aa033887d0c66e741dce18ba14dc7af907fcdac
<|skeleton|> class DagRunSensor: """A sensor for monitoring dag runs from other DAGs. Behaviour: * If the DAG ID does not exist, throw an exception. * Monitors the time period [execution_date - duration, execution_date] for the DAG's dag runs. - If there are no runs, then return a success state. - If there are runs...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DagRunSensor: """A sensor for monitoring dag runs from other DAGs. Behaviour: * If the DAG ID does not exist, throw an exception. * Monitors the time period [execution_date - duration, execution_date] for the DAG's dag runs. - If there are no runs, then return a success state. - If there are runs, look at the...
the_stack_v2_python_sparse
observatory-platform/observatory/platform/utils/dag_run_sensor.py
The-Academic-Observatory/observatory-platform
train
11
994d651b934bc9d380c58d006a3b7386b042edee
[ "opts = {} if opts is None else opts\nfor key in ('filter_params', 'filter_query', 'output_params'):\n DictUtils.ensure_exists(opts, key)\nDictUtils.ensure_exists(opts, 'failed_benchmarks', 'discard')\nDictUtils.ensure_exists(opts, '_extended_params', {})\nDictUtils.ensure_exists(opts, 'ignore_errors', False)\ns...
<|body_start_0|> opts = {} if opts is None else opts for key in ('filter_params', 'filter_query', 'output_params'): DictUtils.ensure_exists(opts, key) DictUtils.ensure_exists(opts, 'failed_benchmarks', 'discard') DictUtils.ensure_exists(opts, '_extended_params', {}) D...
Parser for log files produced by Deep Learning Benchmarking Suite.
LogParser
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LogParser: """Parser for log files produced by Deep Learning Benchmarking Suite.""" def parse_log_files(filenames, opts=None): """Parses files and returns their parameters. :param list filenames: List of file names to parse. :param dict opts: Dictionary of options. :rtype: tuple<list...
stack_v2_sparse_classes_75kplus_train_006730
16,433
permissive
[ { "docstring": "Parses files and returns their parameters. :param list filenames: List of file names to parse. :param dict opts: Dictionary of options. :rtype: tuple<list, list> :return: A tuple of two lists - succeeded and failed benchmarks", "name": "parse_log_files", "signature": "def parse_log_files...
2
null
Implement the Python class `LogParser` described below. Class description: Parser for log files produced by Deep Learning Benchmarking Suite. Method signatures and docstrings: - def parse_log_files(filenames, opts=None): Parses files and returns their parameters. :param list filenames: List of file names to parse. :p...
Implement the Python class `LogParser` described below. Class description: Parser for log files produced by Deep Learning Benchmarking Suite. Method signatures and docstrings: - def parse_log_files(filenames, opts=None): Parses files and returns their parameters. :param list filenames: List of file names to parse. :p...
834350c81154e48af132b7d27874e30a7b80a78c
<|skeleton|> class LogParser: """Parser for log files produced by Deep Learning Benchmarking Suite.""" def parse_log_files(filenames, opts=None): """Parses files and returns their parameters. :param list filenames: List of file names to parse. :param dict opts: Dictionary of options. :rtype: tuple<list...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LogParser: """Parser for log files produced by Deep Learning Benchmarking Suite.""" def parse_log_files(filenames, opts=None): """Parses files and returns their parameters. :param list filenames: List of file names to parse. :param dict opts: Dictionary of options. :rtype: tuple<list, list> :retu...
the_stack_v2_python_sparse
python/dlbs/logparser.py
HewlettPackard/dlcookbook-dlbs
train
132
db5a91678bff08ce5718330bebbfa8f45e036466
[ "if change:\n if 'parent_menu' in form.changed_data:\n obj.slug = mainpage_models.Menu.extra_objects.generate_menu_slug(obj)\n obj.update_child_menu_slug()\n if 'link_app' in form.changed_data or 'link_app_view' in form.changed_data:\n obj.link_address = obj.generate_link_address()\nelse:...
<|body_start_0|> if change: if 'parent_menu' in form.changed_data: obj.slug = mainpage_models.Menu.extra_objects.generate_menu_slug(obj) obj.update_child_menu_slug() if 'link_app' in form.changed_data or 'link_app_view' in form.changed_data: ...
MenuAdmin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MenuAdmin: def save_model(self, request, obj, form, change): """重构默认的保存函数 :param request: :param obj: :param form: :param change: :return:""" <|body_0|> def up_menu(self, request, queryset): """上移菜单 :param request: :param queryset: :return:""" <|body_1|> ...
stack_v2_sparse_classes_75kplus_train_006731
3,388
no_license
[ { "docstring": "重构默认的保存函数 :param request: :param obj: :param form: :param change: :return:", "name": "save_model", "signature": "def save_model(self, request, obj, form, change)" }, { "docstring": "上移菜单 :param request: :param queryset: :return:", "name": "up_menu", "signature": "def up_m...
3
stack_v2_sparse_classes_30k_train_044843
Implement the Python class `MenuAdmin` described below. Class description: Implement the MenuAdmin class. Method signatures and docstrings: - def save_model(self, request, obj, form, change): 重构默认的保存函数 :param request: :param obj: :param form: :param change: :return: - def up_menu(self, request, queryset): 上移菜单 :param...
Implement the Python class `MenuAdmin` described below. Class description: Implement the MenuAdmin class. Method signatures and docstrings: - def save_model(self, request, obj, form, change): 重构默认的保存函数 :param request: :param obj: :param form: :param change: :return: - def up_menu(self, request, queryset): 上移菜单 :param...
aa300577f506beb17ce9aeb99fdb4127d4c097dc
<|skeleton|> class MenuAdmin: def save_model(self, request, obj, form, change): """重构默认的保存函数 :param request: :param obj: :param form: :param change: :return:""" <|body_0|> def up_menu(self, request, queryset): """上移菜单 :param request: :param queryset: :return:""" <|body_1|> ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MenuAdmin: def save_model(self, request, obj, form, change): """重构默认的保存函数 :param request: :param obj: :param form: :param change: :return:""" if change: if 'parent_menu' in form.changed_data: obj.slug = mainpage_models.Menu.extra_objects.generate_menu_slug(obj) ...
the_stack_v2_python_sparse
mainpage/admin.py
Dexutian/home
train
0
eaace314947e524535a09d6d673ec14405390e5e
[ "self._decorator = decorator\nself._methods = methods_to_decorate\nself._positional_args_lambdas = pos_arg_map\nself._keyword_args_lambdas = kw_arg_map", "decorator = self._decorator\nmethods = self._methods\npositional_args_lambdas = self._positional_args_lambdas\nkeyword_args_lambdas = self._keyword_args_lambda...
<|body_start_0|> self._decorator = decorator self._methods = methods_to_decorate self._positional_args_lambdas = pos_arg_map self._keyword_args_lambdas = kw_arg_map <|end_body_0|> <|body_start_1|> decorator = self._decorator methods = self._methods positional_arg...
Decorator that will inject a decorator during class construction. This decorator will intercept the __init__(self, *args **kwargs) call, and decorate specified methods by instantiating the supplied decorators, with arguments extracted and mapped from the constructor call. For example: def decorator(pos_arg_1, keyword_a...
DynamicDecorator
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DynamicDecorator: """Decorator that will inject a decorator during class construction. This decorator will intercept the __init__(self, *args **kwargs) call, and decorate specified methods by instantiating the supplied decorators, with arguments extracted and mapped from the constructor call. For...
stack_v2_sparse_classes_75kplus_train_006732
3,456
permissive
[ { "docstring": "Construct a decorator with it's mappings. :param decorator: Original decorator to apply to specified methods. :type decorator: callable :param methods_to_decorate: List of methods (strings) where the decorator should be applied :type methods_to_decorate: list(string) :param pos_arg_map: lambdas ...
2
null
Implement the Python class `DynamicDecorator` described below. Class description: Decorator that will inject a decorator during class construction. This decorator will intercept the __init__(self, *args **kwargs) call, and decorate specified methods by instantiating the supplied decorators, with arguments extracted an...
Implement the Python class `DynamicDecorator` described below. Class description: Decorator that will inject a decorator during class construction. This decorator will intercept the __init__(self, *args **kwargs) call, and decorate specified methods by instantiating the supplied decorators, with arguments extracted an...
523d2395d39d189772b1db1c944db0cf4ca5769a
<|skeleton|> class DynamicDecorator: """Decorator that will inject a decorator during class construction. This decorator will intercept the __init__(self, *args **kwargs) call, and decorate specified methods by instantiating the supplied decorators, with arguments extracted and mapped from the constructor call. For...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DynamicDecorator: """Decorator that will inject a decorator during class construction. This decorator will intercept the __init__(self, *args **kwargs) call, and decorate specified methods by instantiating the supplied decorators, with arguments extracted and mapped from the constructor call. For example: def...
the_stack_v2_python_sparse
splitio/storage/adapters/util.py
splitio/python-client
train
17
85cc34aff525f44c4af76ad30364220cadc2d89a
[ "self._frame_length = frame_length\nself._fixed_smooth = fixed_smooth\nself._prob_smooth = prob_smooth\nself._prior = prior\nself._snr_opt_lin = 10.0 ** (snr_opt_db / 10.0)\nself._num_frames_init = num_frames_init\nself._v_old_psd = np.zeros(frame_length // 2 + 1)\nself._v_smooth_prob = np.zeros(frame_length // 2 +...
<|body_start_0|> self._frame_length = frame_length self._fixed_smooth = fixed_smooth self._prob_smooth = prob_smooth self._prior = prior self._snr_opt_lin = 10.0 ** (snr_opt_db / 10.0) self._num_frames_init = num_frames_init self._v_old_psd = np.zeros(frame_length...
Implements the speech presence probability (SPP) based noise PSD estimator proposed in [1], [2]. NOTE: This algorithm is designed for 32 ms with 16 ms shift. If you want to use other parameters for your STFT, you need to adjust the parameters accordingly. Even after adjusting these parameters, a lower performance can b...
SPPNoiseEstimator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SPPNoiseEstimator: """Implements the speech presence probability (SPP) based noise PSD estimator proposed in [1], [2]. NOTE: This algorithm is designed for 32 ms with 16 ms shift. If you want to use other parameters for your STFT, you need to adjust the parameters accordingly. Even after adjustin...
stack_v2_sparse_classes_75kplus_train_006733
8,567
no_license
[ { "docstring": "Generates a SPP noise PSD estimator object. For all optional parameters, the default values in [1] are used. :frame_length: frame length (number of samples) :fixed_smooth: (optional) fixed smoothing constant (see line 6 of Algorithm 1 in [1]). Default value is 0.8. :prob_smooth: (optional) fixed...
4
stack_v2_sparse_classes_30k_train_003319
Implement the Python class `SPPNoiseEstimator` described below. Class description: Implements the speech presence probability (SPP) based noise PSD estimator proposed in [1], [2]. NOTE: This algorithm is designed for 32 ms with 16 ms shift. If you want to use other parameters for your STFT, you need to adjust the para...
Implement the Python class `SPPNoiseEstimator` described below. Class description: Implements the speech presence probability (SPP) based noise PSD estimator proposed in [1], [2]. NOTE: This algorithm is designed for 32 ms with 16 ms shift. If you want to use other parameters for your STFT, you need to adjust the para...
d4d44d04ee519ff3443aa24a30891f0d18940707
<|skeleton|> class SPPNoiseEstimator: """Implements the speech presence probability (SPP) based noise PSD estimator proposed in [1], [2]. NOTE: This algorithm is designed for 32 ms with 16 ms shift. If you want to use other parameters for your STFT, you need to adjust the parameters accordingly. Even after adjustin...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SPPNoiseEstimator: """Implements the speech presence probability (SPP) based noise PSD estimator proposed in [1], [2]. NOTE: This algorithm is designed for 32 ms with 16 ms shift. If you want to use other parameters for your STFT, you need to adjust the parameters accordingly. Even after adjusting these param...
the_stack_v2_python_sparse
python/models/spp_estimation.py
sp-uhh/guided-vae-nmf
train
5
e3040cef11a8a41dc73c20b319768b85ac1f5024
[ "for v in variables:\n if v.systematics_funcs == 'suffix':\n v.fillSystematicsSuffix(systematics)\nself.variables_dict = OrderedDict([(v.name, v) for v in variables])", "ret = OrderedDict()\nfor vname, v in self.variables_dict.items():\n if schema in v.schema:\n ret[vname] = v.getValue(event, ...
<|body_start_0|> for v in variables: if v.systematics_funcs == 'suffix': v.fillSystematicsSuffix(systematics) self.variables_dict = OrderedDict([(v.name, v) for v in variables]) <|end_body_0|> <|body_start_1|> ret = OrderedDict() for vname, v in self.variable...
Event description with varying systematics Attributes: variables_dict (dict of string->Var): Variables in the event
Desc
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Desc: """Event description with varying systematics Attributes: variables_dict (dict of string->Var): Variables in the event""" def __init__(self, systematics, variables=[]): """Creates the event description based on a list of variables Args: systematics (list of string): systematics...
stack_v2_sparse_classes_75kplus_train_006734
34,880
no_license
[ { "docstring": "Creates the event description based on a list of variables Args: systematics (list of string): systematics to use for variable lookup variables (list, optional): Variables to use", "name": "__init__", "signature": "def __init__(self, systematics, variables=[])" }, { "docstring": ...
2
stack_v2_sparse_classes_30k_train_029800
Implement the Python class `Desc` described below. Class description: Event description with varying systematics Attributes: variables_dict (dict of string->Var): Variables in the event Method signatures and docstrings: - def __init__(self, systematics, variables=[]): Creates the event description based on a list of ...
Implement the Python class `Desc` described below. Class description: Event description with varying systematics Attributes: variables_dict (dict of string->Var): Variables in the event Method signatures and docstrings: - def __init__(self, systematics, variables=[]): Creates the event description based on a list of ...
d33786f405792cafee22658b40d04f59e37f799b
<|skeleton|> class Desc: """Event description with varying systematics Attributes: variables_dict (dict of string->Var): Variables in the event""" def __init__(self, systematics, variables=[]): """Creates the event description based on a list of variables Args: systematics (list of string): systematics...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Desc: """Event description with varying systematics Attributes: variables_dict (dict of string->Var): Variables in the event""" def __init__(self, systematics, variables=[]): """Creates the event description based on a list of variables Args: systematics (list of string): systematics to use for v...
the_stack_v2_python_sparse
Plotting/python/joosep/sparsinator.py
jpata/tthbb13
train
2
3ab8fc3acac27e6c003f922041b5d329e33e1ff9
[ "self.filename = filename\nself.columns = columns\nself.compressed = compressed\nself.offset = offset\nself.limit = limit\nself.is_open = False\nself.fh = None\nself.read_index = None\nself.rows = None", "if self.is_open:\n self.fh.close()\nself.fh = None\nself.rows = None\nself.read_index = None\nself.is_open...
<|body_start_0|> self.filename = filename self.columns = columns self.compressed = compressed self.offset = offset self.limit = limit self.is_open = False self.fh = None self.read_index = None self.rows = None <|end_body_0|> <|body_start_1|> ...
Dataset reader for datasets stored in defaut Json format. The default Json serialization has the following structure: { 'rows': [ {'id': int, 'values': [...]} ] }
DefaultJsonDatasetReader
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DefaultJsonDatasetReader: """Dataset reader for datasets stored in defaut Json format. The default Json serialization has the following structure: { 'rows': [ {'id': int, 'values': [...]} ] }""" def __init__(self, filename: str, columns: List[DatasetColumn]=None, compressed: bool=False, offs...
stack_v2_sparse_classes_75kplus_train_006735
12,341
permissive
[ { "docstring": "Initialize information about the Json file. Parameters ---------- filename: string Path to the file on disk columns: list(vizier.datastore.base.DatasetColumn), optional List of columns. It is expected that each column has a unique identifier. compressed: bool, optional Flag indicating if the fil...
5
stack_v2_sparse_classes_30k_train_001181
Implement the Python class `DefaultJsonDatasetReader` described below. Class description: Dataset reader for datasets stored in defaut Json format. The default Json serialization has the following structure: { 'rows': [ {'id': int, 'values': [...]} ] } Method signatures and docstrings: - def __init__(self, filename: ...
Implement the Python class `DefaultJsonDatasetReader` described below. Class description: Dataset reader for datasets stored in defaut Json format. The default Json serialization has the following structure: { 'rows': [ {'id': int, 'values': [...]} ] } Method signatures and docstrings: - def __init__(self, filename: ...
e99f43df3df80ad5647f57d805c339257336ac73
<|skeleton|> class DefaultJsonDatasetReader: """Dataset reader for datasets stored in defaut Json format. The default Json serialization has the following structure: { 'rows': [ {'id': int, 'values': [...]} ] }""" def __init__(self, filename: str, columns: List[DatasetColumn]=None, compressed: bool=False, offs...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DefaultJsonDatasetReader: """Dataset reader for datasets stored in defaut Json format. The default Json serialization has the following structure: { 'rows': [ {'id': int, 'values': [...]} ] }""" def __init__(self, filename: str, columns: List[DatasetColumn]=None, compressed: bool=False, offset: int=0, li...
the_stack_v2_python_sparse
vizier/datastore/reader.py
VizierDB/web-api-async
train
2
d758b088535de37243e5ba04780a5411c950794f
[ "result = []\nformat_kwargs = {'model_name': self.model._meta.model_name}\nurl_entries = (getattr(self, attr) for attr in dir(self) if attr.endswith('_view') if isinstance(getattr(self, attr), (list, tuple)))\nfor url_entry in url_entries:\n regexp, view, name = url_entry\n if hasattr(self, 'login_require') a...
<|body_start_0|> result = [] format_kwargs = {'model_name': self.model._meta.model_name} url_entries = (getattr(self, attr) for attr in dir(self) if attr.endswith('_view') if isinstance(getattr(self, attr), (list, tuple))) for url_entry in url_entries: regexp, view, name = ur...
DFModelViewSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DFModelViewSet: def urls(self): """Collect url specs from the instance attributes. Assumes that each attribute with name ending with `_view` contains triple (regexp, view, url_name)""" <|body_0|> def get_list_view_kwargs(self, **kwargs): """Configuration arguments fo...
stack_v2_sparse_classes_75kplus_train_006736
11,811
no_license
[ { "docstring": "Collect url specs from the instance attributes. Assumes that each attribute with name ending with `_view` contains triple (regexp, view, url_name)", "name": "urls", "signature": "def urls(self)" }, { "docstring": "Configuration arguments for list view. May not be called if `get_l...
2
null
Implement the Python class `DFModelViewSet` described below. Class description: Implement the DFModelViewSet class. Method signatures and docstrings: - def urls(self): Collect url specs from the instance attributes. Assumes that each attribute with name ending with `_view` contains triple (regexp, view, url_name) - d...
Implement the Python class `DFModelViewSet` described below. Class description: Implement the DFModelViewSet class. Method signatures and docstrings: - def urls(self): Collect url specs from the instance attributes. Assumes that each attribute with name ending with `_view` contains triple (regexp, view, url_name) - d...
8b8c06c6e3f8dc592d6973fcae560ed24ca8ccc3
<|skeleton|> class DFModelViewSet: def urls(self): """Collect url specs from the instance attributes. Assumes that each attribute with name ending with `_view` contains triple (regexp, view, url_name)""" <|body_0|> def get_list_view_kwargs(self, **kwargs): """Configuration arguments fo...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DFModelViewSet: def urls(self): """Collect url specs from the instance attributes. Assumes that each attribute with name ending with `_view` contains triple (regexp, view, url_name)""" result = [] format_kwargs = {'model_name': self.model._meta.model_name} url_entries = (getatt...
the_stack_v2_python_sparse
lib/viewsets.py
x2x4com/site_base_django
train
0
7aaee75a4f1b6a275c1cef8d344f4f92051525bb
[ "super(PermissionForm, self).__init__(*args, **kwargs)\nself.current_user = current_user\nself.user_id.choices = [(-1, _('--- Select User ---'))] + [(user.id, user.email) for user in User.query.order_by('email').filter_by(is_deleted=False)]\nself.collection_id.choices = [(-1, _('--- Select Collection ---'))]\nif cu...
<|body_start_0|> super(PermissionForm, self).__init__(*args, **kwargs) self.current_user = current_user self.user_id.choices = [(-1, _('--- Select User ---'))] + [(user.id, user.email) for user in User.query.order_by('email').filter_by(is_deleted=False)] self.collection_id.choices = [(-1...
Permission form.
PermissionForm
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PermissionForm: """Permission form.""" def __init__(self, current_user, *args, **kwargs): """Create instance.""" <|body_0|> def validate_user_id(self, field): """Validate user ID is selected and exists in 'users' table.""" <|body_1|> <|end_skeleton|> <|...
stack_v2_sparse_classes_75kplus_train_006737
10,553
permissive
[ { "docstring": "Create instance.", "name": "__init__", "signature": "def __init__(self, current_user, *args, **kwargs)" }, { "docstring": "Validate user ID is selected and exists in 'users' table.", "name": "validate_user_id", "signature": "def validate_user_id(self, field)" } ]
2
stack_v2_sparse_classes_30k_train_010182
Implement the Python class `PermissionForm` described below. Class description: Permission form. Method signatures and docstrings: - def __init__(self, current_user, *args, **kwargs): Create instance. - def validate_user_id(self, field): Validate user ID is selected and exists in 'users' table.
Implement the Python class `PermissionForm` described below. Class description: Permission form. Method signatures and docstrings: - def __init__(self, current_user, *args, **kwargs): Create instance. - def validate_user_id(self, field): Validate user ID is selected and exists in 'users' table. <|skeleton|> class Pe...
d2b66717d87ee2452edf0f6c04f6fdf4533091ba
<|skeleton|> class PermissionForm: """Permission form.""" def __init__(self, current_user, *args, **kwargs): """Create instance.""" <|body_0|> def validate_user_id(self, field): """Validate user ID is selected and exists in 'users' table.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PermissionForm: """Permission form.""" def __init__(self, current_user, *args, **kwargs): """Create instance.""" super(PermissionForm, self).__init__(*args, **kwargs) self.current_user = current_user self.user_id.choices = [(-1, _('--- Select User ---'))] + [(user.id, user...
the_stack_v2_python_sparse
xl_auth/permission/forms.py
libris/xl_auth
train
8
65cb7f6e496a78ef5be528d76147bab0c0ecddf1
[ "resp = ''\nif var.has_key('kinds'):\n items = var['kinds']\n for item in items:\n resp += 'Category :' + cnv_JSON_category(item, 'kind') + '\\n'\nif var.has_key('mixins'):\n items = var['mixins']\n for item in items:\n resp += 'Category :' + cnv_JSON_category(item, 'mixin') + '\\n'\nif va...
<|body_start_0|> resp = '' if var.has_key('kinds'): items = var['kinds'] for item in items: resp += 'Category :' + cnv_JSON_category(item, 'kind') + '\n' if var.has_key('mixins'): items = var['mixins'] for item in items: ...
Converts Response data from application/occi+json object to HTTP text/plain descriptions
To_HTTP_Text_Plain
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class To_HTTP_Text_Plain: """Converts Response data from application/occi+json object to HTTP text/plain descriptions""" def format_to_text_plain_categories(self, var): """Format JSON categories into HTTP text/plain categories Args: @param var: JSON categories""" <|body_0|> de...
stack_v2_sparse_classes_75kplus_train_006738
9,246
permissive
[ { "docstring": "Format JSON categories into HTTP text/plain categories Args: @param var: JSON categories", "name": "format_to_text_plain_categories", "signature": "def format_to_text_plain_categories(self, var)" }, { "docstring": "Convert a JSON resource description into a text/plain resource de...
4
null
Implement the Python class `To_HTTP_Text_Plain` described below. Class description: Converts Response data from application/occi+json object to HTTP text/plain descriptions Method signatures and docstrings: - def format_to_text_plain_categories(self, var): Format JSON categories into HTTP text/plain categories Args: ...
Implement the Python class `To_HTTP_Text_Plain` described below. Class description: Converts Response data from application/occi+json object to HTTP text/plain descriptions Method signatures and docstrings: - def format_to_text_plain_categories(self, var): Format JSON categories into HTTP text/plain categories Args: ...
9535b721e7b832d72fd7bba6d2a29e76a0d4bdb7
<|skeleton|> class To_HTTP_Text_Plain: """Converts Response data from application/occi+json object to HTTP text/plain descriptions""" def format_to_text_plain_categories(self, var): """Format JSON categories into HTTP text/plain categories Args: @param var: JSON categories""" <|body_0|> de...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class To_HTTP_Text_Plain: """Converts Response data from application/occi+json object to HTTP text/plain descriptions""" def format_to_text_plain_categories(self, var): """Format JSON categories into HTTP text/plain categories Args: @param var: JSON categories""" resp = '' if var.has_ke...
the_stack_v2_python_sparse
pyocni/adapters/httpResponse_Formater.py
MarouenMechtri/CNG-Manager
train
1
de67bcd220c0af23080f6c13144b8e65842f434d
[ "super().__init__(mesh_entities, interface_dim)\nif self.mesh_entities.entity_type not in ('nodes', 'edges', 'faces'):\n raise ValueError('Entities must be nodes, edges or faces')", "all_interface_neighbors = self.mesh_entities.bridge_adjacencies(elements, self.interface_dim, self.target_dim)\nnum_neighbors = ...
<|body_start_0|> super().__init__(mesh_entities, interface_dim) if self.mesh_entities.entity_type not in ('nodes', 'edges', 'faces'): raise ValueError('Entities must be nodes, edges or faces') <|end_body_0|> <|body_start_1|> all_interface_neighbors = self.mesh_entities.bridge_adjace...
Implementation of the 2D MPFA-D entity ordering.
MPFAD2DOrdering
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MPFAD2DOrdering: """Implementation of the 2D MPFA-D entity ordering.""" def __init__(self, mesh_entities, interface_dim): """Constructor""" <|body_0|> def sort_elements(self, elements, center): """Sort elements according to the MPFA-D ordering. Parameters -------...
stack_v2_sparse_classes_75kplus_train_006739
2,518
permissive
[ { "docstring": "Constructor", "name": "__init__", "signature": "def __init__(self, mesh_entities, interface_dim)" }, { "docstring": "Sort elements according to the MPFA-D ordering. Parameters ---------- elements: Numpy array Array containing the indices of the elements to be ordered. from_elemen...
2
stack_v2_sparse_classes_30k_train_004382
Implement the Python class `MPFAD2DOrdering` described below. Class description: Implementation of the 2D MPFA-D entity ordering. Method signatures and docstrings: - def __init__(self, mesh_entities, interface_dim): Constructor - def sort_elements(self, elements, center): Sort elements according to the MPFA-D orderin...
Implement the Python class `MPFAD2DOrdering` described below. Class description: Implementation of the 2D MPFA-D entity ordering. Method signatures and docstrings: - def __init__(self, mesh_entities, interface_dim): Constructor - def sort_elements(self, elements, center): Sort elements according to the MPFA-D orderin...
1d4103ff70e32b593cd204e85e0ae65ccba318a4
<|skeleton|> class MPFAD2DOrdering: """Implementation of the 2D MPFA-D entity ordering.""" def __init__(self, mesh_entities, interface_dim): """Constructor""" <|body_0|> def sort_elements(self, elements, center): """Sort elements according to the MPFA-D ordering. Parameters -------...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MPFAD2DOrdering: """Implementation of the 2D MPFA-D entity ordering.""" def __init__(self, mesh_entities, interface_dim): """Constructor""" super().__init__(mesh_entities, interface_dim) if self.mesh_entities.entity_type not in ('nodes', 'edges', 'faces'): raise ValueE...
the_stack_v2_python_sparse
preprocessor/element_order/MPFAD2DOrdering.py
padmec-reservoir/impress
train
6
70248383b0dbfc0c7bbe423547952e24d499e4b1
[ "course = Courses.objects.get(id=course_id)\nfields = {'id', 'name', 'objective', 'learningOutcomes', 'published'}\nreturn jsonify(convert_doc(course, include=fields))", "data = request.get_json()\ntry:\n res = Courses.objects.get(id=course_id).update(**data)\nexcept ValidationError as e:\n return bad_reque...
<|body_start_0|> course = Courses.objects.get(id=course_id) fields = {'id', 'name', 'objective', 'learningOutcomes', 'published'} return jsonify(convert_doc(course, include=fields)) <|end_body_0|> <|body_start_1|> data = request.get_json() try: res = Courses.objects....
Flask-resftul resource for returning db.course collection.
CourseApi
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CourseApi: """Flask-resftul resource for returning db.course collection.""" def get(self, course_id: str) -> Response: """GET response method for single documents in course collection. :return: JSON object""" <|body_0|> def put(self, course_id: str) -> Response: ...
stack_v2_sparse_classes_75kplus_train_006740
11,053
no_license
[ { "docstring": "GET response method for single documents in course collection. :return: JSON object", "name": "get", "signature": "def get(self, course_id: str) -> Response" }, { "docstring": "PUT response method for updating a course. JSON Web Token is required. Authorization is required: Acces...
3
stack_v2_sparse_classes_30k_train_050239
Implement the Python class `CourseApi` described below. Class description: Flask-resftul resource for returning db.course collection. Method signatures and docstrings: - def get(self, course_id: str) -> Response: GET response method for single documents in course collection. :return: JSON object - def put(self, cours...
Implement the Python class `CourseApi` described below. Class description: Flask-resftul resource for returning db.course collection. Method signatures and docstrings: - def get(self, course_id: str) -> Response: GET response method for single documents in course collection. :return: JSON object - def put(self, cours...
7f44c736c95866aaf820627ea54d3f00b3ada779
<|skeleton|> class CourseApi: """Flask-resftul resource for returning db.course collection.""" def get(self, course_id: str) -> Response: """GET response method for single documents in course collection. :return: JSON object""" <|body_0|> def put(self, course_id: str) -> Response: ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CourseApi: """Flask-resftul resource for returning db.course collection.""" def get(self, course_id: str) -> Response: """GET response method for single documents in course collection. :return: JSON object""" course = Courses.objects.get(id=course_id) fields = {'id', 'name', 'obje...
the_stack_v2_python_sparse
backend/uimpactify/controller/course.py
ObaidaSaleh/E-learning-app
train
1
5b1afd51322c1c977c91d518d4f24b8a310419da
[ "id = None\ndescription = None\nLITDB = None\nauthors = None\ntitle = None\ncitations = None\ncomments = None\ncorrelating = {}\ndata = [None] * 20\nid = self._get_field('H', lines)\ndescription = self._get_field('D', lines)\nLITDB = self._get_field('R', lines)\nauthors = self._get_field('A', lines)\ntitle = self._...
<|body_start_0|> id = None description = None LITDB = None authors = None title = None citations = None comments = None correlating = {} data = [None] * 20 id = self._get_field('H', lines) description = self._get_field('D', lines) ...
Parse AAIndex1 file & return it as dict of AAIndex1 objects
AAIndex1Parser
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AAIndex1Parser: """Parse AAIndex1 file & return it as dict of AAIndex1 objects""" def _parse_record(self, lines): """Parse a single record and return it as a AAIndex1Record Object""" <|body_0|> def _parse_correlating(self, raw): """Parse Correlating entries from ...
stack_v2_sparse_classes_75kplus_train_006741
16,089
permissive
[ { "docstring": "Parse a single record and return it as a AAIndex1Record Object", "name": "_parse_record", "signature": "def _parse_record(self, lines)" }, { "docstring": "Parse Correlating entries from the current record", "name": "_parse_correlating", "signature": "def _parse_correlatin...
3
stack_v2_sparse_classes_30k_train_035907
Implement the Python class `AAIndex1Parser` described below. Class description: Parse AAIndex1 file & return it as dict of AAIndex1 objects Method signatures and docstrings: - def _parse_record(self, lines): Parse a single record and return it as a AAIndex1Record Object - def _parse_correlating(self, raw): Parse Corr...
Implement the Python class `AAIndex1Parser` described below. Class description: Parse AAIndex1 file & return it as dict of AAIndex1 objects Method signatures and docstrings: - def _parse_record(self, lines): Parse a single record and return it as a AAIndex1Record Object - def _parse_correlating(self, raw): Parse Corr...
fe6f8c8dfed86d39c80f2804a753c05bb2e485b4
<|skeleton|> class AAIndex1Parser: """Parse AAIndex1 file & return it as dict of AAIndex1 objects""" def _parse_record(self, lines): """Parse a single record and return it as a AAIndex1Record Object""" <|body_0|> def _parse_correlating(self, raw): """Parse Correlating entries from ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AAIndex1Parser: """Parse AAIndex1 file & return it as dict of AAIndex1 objects""" def _parse_record(self, lines): """Parse a single record and return it as a AAIndex1Record Object""" id = None description = None LITDB = None authors = None title = None ...
the_stack_v2_python_sparse
scripts/venv/lib/python2.7/site-packages/cogent/parse/aaindex.py
sauloal/cnidaria
train
3
316f88510958c5181c8659b386d2c9a2ec5e1cd3
[ "max_position = 0\nfor i, n in enumerate(nums[:-1]):\n if max_position < i:\n break\n max_position = max(max_position, i + n)\nreturn max_position >= len(nums) - 1", "max_position = len(nums) - 1\nfor i in range(len(nums) - 2, -1, -1):\n if i + nums[i] >= max_position:\n max_position = i\nr...
<|body_start_0|> max_position = 0 for i, n in enumerate(nums[:-1]): if max_position < i: break max_position = max(max_position, i + n) return max_position >= len(nums) - 1 <|end_body_0|> <|body_start_1|> max_position = len(nums) - 1 for i ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def canJump(self, nums): """:type nums: List[int] :rtype: bool""" <|body_0|> def canJump_reverse(self, nums): """:type nums: List[int] :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> max_position = 0 for i, n in enumer...
stack_v2_sparse_classes_75kplus_train_006742
1,393
no_license
[ { "docstring": ":type nums: List[int] :rtype: bool", "name": "canJump", "signature": "def canJump(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: bool", "name": "canJump_reverse", "signature": "def canJump_reverse(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_052214
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canJump(self, nums): :type nums: List[int] :rtype: bool - def canJump_reverse(self, nums): :type nums: List[int] :rtype: bool
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canJump(self, nums): :type nums: List[int] :rtype: bool - def canJump_reverse(self, nums): :type nums: List[int] :rtype: bool <|skeleton|> class Solution: def canJump(s...
e60ba45fe2f2e5e3b3abfecec3db76f5ce1fde59
<|skeleton|> class Solution: def canJump(self, nums): """:type nums: List[int] :rtype: bool""" <|body_0|> def canJump_reverse(self, nums): """:type nums: List[int] :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def canJump(self, nums): """:type nums: List[int] :rtype: bool""" max_position = 0 for i, n in enumerate(nums[:-1]): if max_position < i: break max_position = max(max_position, i + n) return max_position >= len(nums) - 1 de...
the_stack_v2_python_sparse
src/lt_55.py
oxhead/CodingYourWay
train
0
a07fa0f0a221deae592b822da08bdcc0eef08c55
[ "assert isinstance(predictions, list)\nassert predictions[0].dim() == 1 or (predictions[0].dim() == 2 and predictions[0].shape[1] == 1)\noutput = concat_list(predictions, 0)\nreturn output.reshape((-1, n_permutations))", "assert isinstance(representations, list)\nassert representations[0].dim() == 2\noutput = con...
<|body_start_0|> assert isinstance(predictions, list) assert predictions[0].dim() == 1 or (predictions[0].dim() == 2 and predictions[0].shape[1] == 1) output = concat_list(predictions, 0) return output.reshape((-1, n_permutations)) <|end_body_0|> <|body_start_1|> assert isinstan...
JpUtil
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JpUtil: def _reshape_for_inference(predictions, n_permutations): """Input: list describing a vector of shape (num_seq * num_perm, 1) Output: matrix of shape (num_seq, num_perm)""" <|body_0|> def _reshape_for_reprs(representations, n_permutations): """Input: list of m...
stack_v2_sparse_classes_75kplus_train_006743
6,890
no_license
[ { "docstring": "Input: list describing a vector of shape (num_seq * num_perm, 1) Output: matrix of shape (num_seq, num_perm)", "name": "_reshape_for_inference", "signature": "def _reshape_for_inference(predictions, n_permutations)" }, { "docstring": "Input: list of matrices of shapes (num_seq * ...
5
stack_v2_sparse_classes_30k_train_024214
Implement the Python class `JpUtil` described below. Class description: Implement the JpUtil class. Method signatures and docstrings: - def _reshape_for_inference(predictions, n_permutations): Input: list describing a vector of shape (num_seq * num_perm, 1) Output: matrix of shape (num_seq, num_perm) - def _reshape_f...
Implement the Python class `JpUtil` described below. Class description: Implement the JpUtil class. Method signatures and docstrings: - def _reshape_for_inference(predictions, n_permutations): Input: list describing a vector of shape (num_seq * num_perm, 1) Output: matrix of shape (num_seq, num_perm) - def _reshape_f...
95c0426724681455d84d73398e4aa2b188d93991
<|skeleton|> class JpUtil: def _reshape_for_inference(predictions, n_permutations): """Input: list describing a vector of shape (num_seq * num_perm, 1) Output: matrix of shape (num_seq, num_perm)""" <|body_0|> def _reshape_for_reprs(representations, n_permutations): """Input: list of m...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class JpUtil: def _reshape_for_inference(predictions, n_permutations): """Input: list describing a vector of shape (num_seq * num_perm, 1) Output: matrix of shape (num_seq, num_perm)""" assert isinstance(predictions, list) assert predictions[0].dim() == 1 or (predictions[0].dim() == 2 and pr...
the_stack_v2_python_sparse
TEXT_CLASSIFICATION/Transformer/util/jp_util.py
wushishang/complex-order
train
0
17575935a37527e446e15f10a40c3948d6d84b75
[ "n = len(nums)\nl = 0\nr = 1\ndd = dict()\nwhile r < n:\n if nums[l] not in dd:\n if nums[r] not in dd:\n dd[nums[r]] = 1\n else:\n dd[nums[r]] += 1\n r += 1\n else:\n return True\n if r - l > k + 1:\n dd[nums[l + 1]] -= 1\n if dd[nums[l + 1]]...
<|body_start_0|> n = len(nums) l = 0 r = 1 dd = dict() while r < n: if nums[l] not in dd: if nums[r] not in dd: dd[nums[r]] = 1 else: dd[nums[r]] += 1 r += 1 else: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def containsNearbyDuplicate(self, nums, k: int) -> bool: """:param nums: List[int] :param k: :return:""" <|body_0|> def containsNearbyDuplicate1(self, nums, k: int) -> bool: """:param nums: List[int] :param k: :return:""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_75kplus_train_006744
1,625
no_license
[ { "docstring": ":param nums: List[int] :param k: :return:", "name": "containsNearbyDuplicate", "signature": "def containsNearbyDuplicate(self, nums, k: int) -> bool" }, { "docstring": ":param nums: List[int] :param k: :return:", "name": "containsNearbyDuplicate1", "signature": "def conta...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsNearbyDuplicate(self, nums, k: int) -> bool: :param nums: List[int] :param k: :return: - def containsNearbyDuplicate1(self, nums, k: int) -> bool: :param nums: List[i...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsNearbyDuplicate(self, nums, k: int) -> bool: :param nums: List[int] :param k: :return: - def containsNearbyDuplicate1(self, nums, k: int) -> bool: :param nums: List[i...
c55b0cfd2967a2221c27ed738e8de15034775945
<|skeleton|> class Solution: def containsNearbyDuplicate(self, nums, k: int) -> bool: """:param nums: List[int] :param k: :return:""" <|body_0|> def containsNearbyDuplicate1(self, nums, k: int) -> bool: """:param nums: List[int] :param k: :return:""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def containsNearbyDuplicate(self, nums, k: int) -> bool: """:param nums: List[int] :param k: :return:""" n = len(nums) l = 0 r = 1 dd = dict() while r < n: if nums[l] not in dd: if nums[r] not in dd: dd[n...
the_stack_v2_python_sparse
PycharmProjects/leetcode/Find/219存在重复元素2.py
crystal30/DataStructure
train
0
f6f6188ed678527bcce3db2ab12c4e2b15caf1d4
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn TimeOff()", "from .change_tracked_entity import ChangeTrackedEntity\nfrom .time_off_item import TimeOffItem\nfrom .change_tracked_entity import ChangeTrackedEntity\nfrom .time_off_item import TimeOffItem\nfields: Dict[str, Callable[[An...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return TimeOff() <|end_body_0|> <|body_start_1|> from .change_tracked_entity import ChangeTrackedEntity from .time_off_item import TimeOffItem from .change_tracked_entity import ChangeT...
TimeOff
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TimeOff: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TimeOff: """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: TimeOff"""...
stack_v2_sparse_classes_75kplus_train_006745
2,855
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: TimeOff", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value(parse...
3
stack_v2_sparse_classes_30k_train_025015
Implement the Python class `TimeOff` described below. Class description: Implement the TimeOff class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TimeOff: Creates a new instance of the appropriate class based on discriminator value Args: parse_node:...
Implement the Python class `TimeOff` described below. Class description: Implement the TimeOff class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TimeOff: Creates a new instance of the appropriate class based on discriminator value Args: parse_node:...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class TimeOff: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TimeOff: """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: TimeOff"""...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TimeOff: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TimeOff: """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: TimeOff""" if no...
the_stack_v2_python_sparse
msgraph/generated/models/time_off.py
microsoftgraph/msgraph-sdk-python
train
135
fae61a9443a2b013bfcaf57539c0c6bbbdfacb38
[ "self.users = {}\nself.tweetTime = {}\nself.recentMax = 0\nself.time = 0", "if userId not in self.users.keys():\n self.users[userId] = user()\nself.users[userId].tweets.append(tweetId)\nself.tweetTime[tweetId] = self.time\nself.time += 1", "if userId not in self.users.keys():\n return []\nmine = self.user...
<|body_start_0|> self.users = {} self.tweetTime = {} self.recentMax = 0 self.time = 0 <|end_body_0|> <|body_start_1|> if userId not in self.users.keys(): self.users[userId] = user() self.users[userId].tweets.append(tweetId) self.tweetTime[tweetId] = s...
Twitter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Twitter: def __init__(self): """Initialize your data structure here.""" <|body_0|> def postTweet(self, userId: int, tweetId: int) -> None: """Compose a new tweet.""" <|body_1|> def getNewsFeed(self, userId: int) -> List[int]: """Retrieve the 10 m...
stack_v2_sparse_classes_75kplus_train_006746
3,131
no_license
[ { "docstring": "Initialize your data structure here.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Compose a new tweet.", "name": "postTweet", "signature": "def postTweet(self, userId: int, tweetId: int) -> None" }, { "docstring": "Retrieve the 10 mos...
5
stack_v2_sparse_classes_30k_train_052497
Implement the Python class `Twitter` described below. Class description: Implement the Twitter class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def postTweet(self, userId: int, tweetId: int) -> None: Compose a new tweet. - def getNewsFeed(self, userId: int) -> List...
Implement the Python class `Twitter` described below. Class description: Implement the Twitter class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def postTweet(self, userId: int, tweetId: int) -> None: Compose a new tweet. - def getNewsFeed(self, userId: int) -> List...
6b24a99e5ce87bca5ec487a996fea80991380293
<|skeleton|> class Twitter: def __init__(self): """Initialize your data structure here.""" <|body_0|> def postTweet(self, userId: int, tweetId: int) -> None: """Compose a new tweet.""" <|body_1|> def getNewsFeed(self, userId: int) -> List[int]: """Retrieve the 10 m...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Twitter: def __init__(self): """Initialize your data structure here.""" self.users = {} self.tweetTime = {} self.recentMax = 0 self.time = 0 def postTweet(self, userId: int, tweetId: int) -> None: """Compose a new tweet.""" if userId not in self.use...
the_stack_v2_python_sparse
355设计推特.py
Frodoooo/MyLeetCode
train
0
a494402d72c8c73c06be7ecaef7cd76acf3268c1
[ "if not root:\n return 0\nleft_subtree_depth = self.minDepth(root.left)\nright_subtree_depth = self.minDepth(root.right)\nreturn (min(left_subtree_depth, right_subtree_depth) or max(left_subtree_depth, right_subtree_depth)) + 1", "if not root:\n return 0\nqueue = [root]\nmin_depth = 0\nrow_node_num = 1\nwhi...
<|body_start_0|> if not root: return 0 left_subtree_depth = self.minDepth(root.left) right_subtree_depth = self.minDepth(root.right) return (min(left_subtree_depth, right_subtree_depth) or max(left_subtree_depth, right_subtree_depth)) + 1 <|end_body_0|> <|body_start_1|> ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def minDepth(self, root): """:type root: TreeNode :rtype: int""" <|body_0|> def minDepthIterate(self, root): """迭代方式,层序遍历,遇到的第一个叶子节点就是最小深度的节点""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not root: return 0 left_su...
stack_v2_sparse_classes_75kplus_train_006747
1,745
no_license
[ { "docstring": ":type root: TreeNode :rtype: int", "name": "minDepth", "signature": "def minDepth(self, root)" }, { "docstring": "迭代方式,层序遍历,遇到的第一个叶子节点就是最小深度的节点", "name": "minDepthIterate", "signature": "def minDepthIterate(self, root)" } ]
2
stack_v2_sparse_classes_30k_train_007855
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minDepth(self, root): :type root: TreeNode :rtype: int - def minDepthIterate(self, root): 迭代方式,层序遍历,遇到的第一个叶子节点就是最小深度的节点
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minDepth(self, root): :type root: TreeNode :rtype: int - def minDepthIterate(self, root): 迭代方式,层序遍历,遇到的第一个叶子节点就是最小深度的节点 <|skeleton|> class Solution: def minDepth(self, ...
8853f85214ac88db024d26e228f1848dd5acd933
<|skeleton|> class Solution: def minDepth(self, root): """:type root: TreeNode :rtype: int""" <|body_0|> def minDepthIterate(self, root): """迭代方式,层序遍历,遇到的第一个叶子节点就是最小深度的节点""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def minDepth(self, root): """:type root: TreeNode :rtype: int""" if not root: return 0 left_subtree_depth = self.minDepth(root.left) right_subtree_depth = self.minDepth(root.right) return (min(left_subtree_depth, right_subtree_depth) or max(left_su...
the_stack_v2_python_sparse
111-MinimumDepthofBinaryTree/MinimumDepthofBinaryTree.py
cqxmzhc/my_leetcode_solutions
train
2
c5b5b78c8ab45565985a2c5dd665d68b28055567
[ "try:\n user = User.objects.get(username=request.user)\n if user.tfa_secret_code is None:\n key = pyotp.random_base32()\n user.tfa_secret_code = key\n user.save()\n data = {'secret_code': user.tfa_secret_code}\n return Utils.dispatch_success(request, data)\nexcept Exception as e:\n ...
<|body_start_0|> try: user = User.objects.get(username=request.user) if user.tfa_secret_code is None: key = pyotp.random_base32() user.tfa_secret_code = key user.save() data = {'secret_code': user.tfa_secret_code} re...
TwoFactorAuthenticationDetails
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TwoFactorAuthenticationDetails: def get(self, request): """Gets TOTP Secret Key for a user""" <|body_0|> def post(self, request): """Check weather the totp is valid or not""" <|body_1|> def put(self, request): """Updates Two factor flag""" ...
stack_v2_sparse_classes_75kplus_train_006748
28,880
no_license
[ { "docstring": "Gets TOTP Secret Key for a user", "name": "get", "signature": "def get(self, request)" }, { "docstring": "Check weather the totp is valid or not", "name": "post", "signature": "def post(self, request)" }, { "docstring": "Updates Two factor flag", "name": "put"...
3
stack_v2_sparse_classes_30k_train_037800
Implement the Python class `TwoFactorAuthenticationDetails` described below. Class description: Implement the TwoFactorAuthenticationDetails class. Method signatures and docstrings: - def get(self, request): Gets TOTP Secret Key for a user - def post(self, request): Check weather the totp is valid or not - def put(se...
Implement the Python class `TwoFactorAuthenticationDetails` described below. Class description: Implement the TwoFactorAuthenticationDetails class. Method signatures and docstrings: - def get(self, request): Gets TOTP Secret Key for a user - def post(self, request): Check weather the totp is valid or not - def put(se...
11b80dbd665e3592ed862403dd8c8d65b6791b30
<|skeleton|> class TwoFactorAuthenticationDetails: def get(self, request): """Gets TOTP Secret Key for a user""" <|body_0|> def post(self, request): """Check weather the totp is valid or not""" <|body_1|> def put(self, request): """Updates Two factor flag""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TwoFactorAuthenticationDetails: def get(self, request): """Gets TOTP Secret Key for a user""" try: user = User.objects.get(username=request.user) if user.tfa_secret_code is None: key = pyotp.random_base32() user.tfa_secret_code = key ...
the_stack_v2_python_sparse
portalbackend/lendapi/v1/accounts/views.py
mthangaraj/ix-ec-backend
train
0
0b355753b9c1249da04daa4deacbb56bfc75b177
[ "super(SSHClient, self).__init__(host=host)\nself.username = username\nself.password = password\nself.host = host\nself.tcp_timeout = tcp_timeout\nself.auth_strategy = auth_strategy\nself.look_for_keys = look_for_keys\nself.key = key\nself.key_filename = key_filename\nself.allow_agent = allow_agent\nself.port = por...
<|body_start_0|> super(SSHClient, self).__init__(host=host) self.username = username self.password = password self.host = host self.tcp_timeout = tcp_timeout self.auth_strategy = auth_strategy self.look_for_keys = look_for_keys self.key = key self....
SSHClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SSHClient: def __init__(self, username=None, password=None, host=None, tcp_timeout=None, auth_strategy=None, port=22, look_for_keys=None, key=None, key_filename=None, allow_agent=True, accept_missing_host_key=True): """Initialization @param username: Username to be used for SSH connectio...
stack_v2_sparse_classes_75kplus_train_006749
19,247
permissive
[ { "docstring": "Initialization @param username: Username to be used for SSH connection @type username: string @param password: Password to be used for SSH connection @type password: string @param host: IP address or host name to connect to @type host: string @param auth_strategy: Authentication strategy to use ...
5
stack_v2_sparse_classes_30k_train_038660
Implement the Python class `SSHClient` described below. Class description: Implement the SSHClient class. Method signatures and docstrings: - def __init__(self, username=None, password=None, host=None, tcp_timeout=None, auth_strategy=None, port=22, look_for_keys=None, key=None, key_filename=None, allow_agent=True, ac...
Implement the Python class `SSHClient` described below. Class description: Implement the SSHClient class. Method signatures and docstrings: - def __init__(self, username=None, password=None, host=None, tcp_timeout=None, auth_strategy=None, port=22, look_for_keys=None, key=None, key_filename=None, allow_agent=True, ac...
67efb1615fc2d7c4f287878d3fe04b9faa598f10
<|skeleton|> class SSHClient: def __init__(self, username=None, password=None, host=None, tcp_timeout=None, auth_strategy=None, port=22, look_for_keys=None, key=None, key_filename=None, allow_agent=True, accept_missing_host_key=True): """Initialization @param username: Username to be used for SSH connectio...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SSHClient: def __init__(self, username=None, password=None, host=None, tcp_timeout=None, auth_strategy=None, port=22, look_for_keys=None, key=None, key_filename=None, allow_agent=True, accept_missing_host_key=True): """Initialization @param username: Username to be used for SSH connection @type userna...
the_stack_v2_python_sparse
cafe/plugins/ssh/cafe/engine/ssh/client.py
CafeHub/opencafe
train
0
1ce725633d5f96c8d2a21d835b9dc625d17c6b73
[ "try:\n self.segmentsize = int(args[0])\nexcept ValueError:\n raise ValueError(\"Parameter 1 unrecognized. Got '{}'\".format(args[0]))\nif self.segmentsize < 0:\n raise ValueError(\"'segmentsize' shoudl be positive. Got '{}'\".format(self.segmentsize))", "new_pl = PacketList()\nfor pkt in pkt_list:\n ...
<|body_start_0|> try: self.segmentsize = int(args[0]) except ValueError: raise ValueError("Parameter 1 unrecognized. Got '{}'".format(args[0])) if self.segmentsize < 0: raise ValueError("'segmentsize' shoudl be positive. Got '{}'".format(self.segmentsize)) <|e...
Segments the TCP packets at the L4-layer. The segmentation size must be specified. It represents the size of the TCP data in each of the fragments. Args: *args: The arguments of the mods. Attributes: segmentsize: The segmentation size (bytes of TCP data to use). Raises: ValueError: Unrecognized or incorrect number of p...
TcpSegment
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TcpSegment: """Segments the TCP packets at the L4-layer. The segmentation size must be specified. It represents the size of the TCP data in each of the fragments. Args: *args: The arguments of the mods. Attributes: segmentsize: The segmentation size (bytes of TCP data to use). Raises: ValueError:...
stack_v2_sparse_classes_75kplus_train_006750
1,835
permissive
[ { "docstring": "See base class.", "name": "parse_args", "signature": "def parse_args(self, *args)" }, { "docstring": "Segments each TCP packet. See `Mod.apply` for more details.", "name": "apply", "signature": "def apply(self, pkt_list)" } ]
2
stack_v2_sparse_classes_30k_val_002323
Implement the Python class `TcpSegment` described below. Class description: Segments the TCP packets at the L4-layer. The segmentation size must be specified. It represents the size of the TCP data in each of the fragments. Args: *args: The arguments of the mods. Attributes: segmentsize: The segmentation size (bytes o...
Implement the Python class `TcpSegment` described below. Class description: Segments the TCP packets at the L4-layer. The segmentation size must be specified. It represents the size of the TCP data in each of the fragments. Args: *args: The arguments of the mods. Attributes: segmentsize: The segmentation size (bytes o...
3ee7f5c73fc6c7eb64858e197c0b8d2b313734e0
<|skeleton|> class TcpSegment: """Segments the TCP packets at the L4-layer. The segmentation size must be specified. It represents the size of the TCP data in each of the fragments. Args: *args: The arguments of the mods. Attributes: segmentsize: The segmentation size (bytes of TCP data to use). Raises: ValueError:...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TcpSegment: """Segments the TCP packets at the L4-layer. The segmentation size must be specified. It represents the size of the TCP data in each of the fragments. Args: *args: The arguments of the mods. Attributes: segmentsize: The segmentation size (bytes of TCP data to use). Raises: ValueError: Unrecognized...
the_stack_v2_python_sparse
fragscapy/modifications/tcp_segment.py
daeon/Fragscapy
train
0
3a0de611d02203c254f85799fd1d0baad8bbfbcd
[ "kwargs = {'pk': obj.pk, 'username': obj.user.username}\nrequest = self.context.get('request')\nreturn reverse('download_xform', kwargs=kwargs, request=request)", "kwargs = {'pk': obj.pk, 'username': obj.user.username}\nrequest = self.context.get('request')\nobject_list = MetaData.objects.filter(data_type='media'...
<|body_start_0|> kwargs = {'pk': obj.pk, 'username': obj.user.username} request = self.context.get('request') return reverse('download_xform', kwargs=kwargs, request=request) <|end_body_0|> <|body_start_1|> kwargs = {'pk': obj.pk, 'username': obj.user.username} request = self.co...
XForm serializer for OpenRosa form list API.
XFormListSerializer
[ "BSD-2-Clause", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class XFormListSerializer: """XForm serializer for OpenRosa form list API.""" def get_url(self, obj): """Returns XForm download URL.""" <|body_0|> def get_manifest_url(self, obj): """Return manifest URL.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_75kplus_train_006751
23,801
permissive
[ { "docstring": "Returns XForm download URL.", "name": "get_url", "signature": "def get_url(self, obj)" }, { "docstring": "Return manifest URL.", "name": "get_manifest_url", "signature": "def get_manifest_url(self, obj)" } ]
2
stack_v2_sparse_classes_30k_train_044702
Implement the Python class `XFormListSerializer` described below. Class description: XForm serializer for OpenRosa form list API. Method signatures and docstrings: - def get_url(self, obj): Returns XForm download URL. - def get_manifest_url(self, obj): Return manifest URL.
Implement the Python class `XFormListSerializer` described below. Class description: XForm serializer for OpenRosa form list API. Method signatures and docstrings: - def get_url(self, obj): Returns XForm download URL. - def get_manifest_url(self, obj): Return manifest URL. <|skeleton|> class XFormListSerializer: ...
e5bdec91cb47179172b515bbcb91701262ff3377
<|skeleton|> class XFormListSerializer: """XForm serializer for OpenRosa form list API.""" def get_url(self, obj): """Returns XForm download URL.""" <|body_0|> def get_manifest_url(self, obj): """Return manifest URL.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class XFormListSerializer: """XForm serializer for OpenRosa form list API.""" def get_url(self, obj): """Returns XForm download URL.""" kwargs = {'pk': obj.pk, 'username': obj.user.username} request = self.context.get('request') return reverse('download_xform', kwargs=kwargs, re...
the_stack_v2_python_sparse
onadata/libs/serializers/xform_serializer.py
onaio/onadata
train
177
ade4a68b9bd09236fa372a3bc320e05726bdd260
[ "super().__init__()\nself.p_1: List[int] = [0, 3, 2, 1]\nself.p_2: List[int] = [0, 2, 1, 3]\nself.dnn: Module = DepthWiseSeparableDNN(cnn_channels=cnn_channels, cnn_dropout=cnn_dropout, inner_kernel_size=inner_kernel_size, inner_padding=inner_padding)\nself.dilated_cnn: Module = DilatedConvBLock(in_channels=1, out_...
<|body_start_0|> super().__init__() self.p_1: List[int] = [0, 3, 2, 1] self.p_2: List[int] = [0, 2, 1, 3] self.dnn: Module = DepthWiseSeparableDNN(cnn_channels=cnn_channels, cnn_dropout=cnn_dropout, inner_kernel_size=inner_kernel_size, inner_padding=inner_padding) self.dilated_cn...
DESSEDDilatedTag
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DESSEDDilatedTag: def __init__(self, cnn_channels: int, cnn_dropout: float, dilated_output_channels: int, dilated_kernel_size: Union[int, Tuple[int, int], List[int]], dilated_stride: Union[int, Tuple[int, int], List[int]], dilated_padding: Union[int, Tuple[int, int], List[int]], dilation_shape: ...
stack_v2_sparse_classes_75kplus_train_006752
14,491
no_license
[ { "docstring": "The DESSEDDilated model. :param cnn_channels: Amount of CNN channels. :type cnn_channels: int :param cnn_dropout: Dropout to be applied to the CNNs. :type cnn_dropout: float :param dilated_output_channels: Amount of channels for the dilated CNN. :type dilated_output_channels: int :param dilated_...
2
null
Implement the Python class `DESSEDDilatedTag` described below. Class description: Implement the DESSEDDilatedTag class. Method signatures and docstrings: - def __init__(self, cnn_channels: int, cnn_dropout: float, dilated_output_channels: int, dilated_kernel_size: Union[int, Tuple[int, int], List[int]], dilated_strid...
Implement the Python class `DESSEDDilatedTag` described below. Class description: Implement the DESSEDDilatedTag class. Method signatures and docstrings: - def __init__(self, cnn_channels: int, cnn_dropout: float, dilated_output_channels: int, dilated_kernel_size: Union[int, Tuple[int, int], List[int]], dilated_strid...
e8775f0242cc955e990da33d4e6824dfb0b0546d
<|skeleton|> class DESSEDDilatedTag: def __init__(self, cnn_channels: int, cnn_dropout: float, dilated_output_channels: int, dilated_kernel_size: Union[int, Tuple[int, int], List[int]], dilated_stride: Union[int, Tuple[int, int], List[int]], dilated_padding: Union[int, Tuple[int, int], List[int]], dilation_shape: ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DESSEDDilatedTag: def __init__(self, cnn_channels: int, cnn_dropout: float, dilated_output_channels: int, dilated_kernel_size: Union[int, Tuple[int, int], List[int]], dilated_stride: Union[int, Tuple[int, int], List[int]], dilated_padding: Union[int, Tuple[int, int], List[int]], dilation_shape: Union[int, Tup...
the_stack_v2_python_sparse
models/depthwise_separable_conv_block.py
ankitshah009/urban-sound-classification-and-comparison
train
0
8f67d59da3bc32ceb80cb28e394e6aca85cb7f3c
[ "args = [Arping.ARPING_COMMAND_NAME, Arping.INTERFACE_OPTION, device, Arping.COUNT_OPTION, str(count), Arping.TIMEOUT_OPTION, str(timeout)]\nif quiet is True:\n args.append(Arping.QUIET_OPTION)\nif firstReply is True:\n args.append(Arping.FIRST_REPLY_OPTION)\nargs.append(destination)\nrc = Command.execute(log...
<|body_start_0|> args = [Arping.ARPING_COMMAND_NAME, Arping.INTERFACE_OPTION, device, Arping.COUNT_OPTION, str(count), Arping.TIMEOUT_OPTION, str(timeout)] if quiet is True: args.append(Arping.QUIET_OPTION) if firstReply is True: args.append(Arping.FIRST_REPLY_OPTION) ...
Arping
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Arping: def sendArpRequest(logger, device, destination, count=3, timeout=1, quiet=False, firstReply=False, blocking=True): """This function sends ARP REQUEST to a neighbour host Args: logger device - Name of network device where to send ARP REQUEST packets destination - destination IP to...
stack_v2_sparse_classes_75kplus_train_006753
10,343
no_license
[ { "docstring": "This function sends ARP REQUEST to a neighbour host Args: logger device - Name of network device where to send ARP REQUEST packets destination - destination IP to ping count - stop after sending X ARP REQUEST packets timeout - specify a timeout, in seconds, before arping exits quiet - quiet outp...
2
stack_v2_sparse_classes_30k_train_007791
Implement the Python class `Arping` described below. Class description: Implement the Arping class. Method signatures and docstrings: - def sendArpRequest(logger, device, destination, count=3, timeout=1, quiet=False, firstReply=False, blocking=True): This function sends ARP REQUEST to a neighbour host Args: logger de...
Implement the Python class `Arping` described below. Class description: Implement the Arping class. Method signatures and docstrings: - def sendArpRequest(logger, device, destination, count=3, timeout=1, quiet=False, firstReply=False, blocking=True): This function sends ARP REQUEST to a neighbour host Args: logger de...
81bcc74fe7c0ca036ec483f634d7be0bab19a6d0
<|skeleton|> class Arping: def sendArpRequest(logger, device, destination, count=3, timeout=1, quiet=False, firstReply=False, blocking=True): """This function sends ARP REQUEST to a neighbour host Args: logger device - Name of network device where to send ARP REQUEST packets destination - destination IP to...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Arping: def sendArpRequest(logger, device, destination, count=3, timeout=1, quiet=False, firstReply=False, blocking=True): """This function sends ARP REQUEST to a neighbour host Args: logger device - Name of network device where to send ARP REQUEST packets destination - destination IP to ping count - ...
the_stack_v2_python_sparse
oscar/a/sys/net/lnx/neighbour.py
afeset/miner2-tools
train
0
e231b5e86acffc23ea9f76f27416facedbaa43cd
[ "super().__init__()\nself.variable_name = variable_name\nself.variable_type = variable_type", "lam = self.variable_type.execute(session, context)\nif lam is None:\n msg = 'Type {} for variable {} has not been declared yet'.format(self.variable_type.name, self.variable_name)\n raise NormError(msg)\nfrom norm...
<|body_start_0|> super().__init__() self.variable_name = variable_name self.variable_type = variable_type <|end_body_0|> <|body_start_1|> lam = self.variable_type.execute(session, context) if lam is None: msg = 'Type {} for variable {} has not been declared yet'.form...
ArgumentDeclaration
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ArgumentDeclaration: def __init__(self, variable_name, variable_type): """The argument declaration :param variable_name: the name of the variable :type variable_name: VariableName :param variable_type: the type of the variable :type variable_type: TypeName""" <|body_0|> def ...
stack_v2_sparse_classes_75kplus_train_006754
3,531
permissive
[ { "docstring": "The argument declaration :param variable_name: the name of the variable :type variable_name: VariableName :param variable_type: the type of the variable :type variable_type: TypeName", "name": "__init__", "signature": "def __init__(self, variable_name, variable_type)" }, { "docst...
2
stack_v2_sparse_classes_30k_train_005469
Implement the Python class `ArgumentDeclaration` described below. Class description: Implement the ArgumentDeclaration class. Method signatures and docstrings: - def __init__(self, variable_name, variable_type): The argument declaration :param variable_name: the name of the variable :type variable_name: VariableName ...
Implement the Python class `ArgumentDeclaration` described below. Class description: Implement the ArgumentDeclaration class. Method signatures and docstrings: - def __init__(self, variable_name, variable_type): The argument declaration :param variable_name: the name of the variable :type variable_name: VariableName ...
ff76e030d7cebdca51c72d5d7e789d90f0e1e565
<|skeleton|> class ArgumentDeclaration: def __init__(self, variable_name, variable_type): """The argument declaration :param variable_name: the name of the variable :type variable_name: VariableName :param variable_type: the type of the variable :type variable_type: TypeName""" <|body_0|> def ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ArgumentDeclaration: def __init__(self, variable_name, variable_type): """The argument declaration :param variable_name: the name of the variable :type variable_name: VariableName :param variable_type: the type of the variable :type variable_type: TypeName""" super().__init__() self.va...
the_stack_v2_python_sparse
norm/executable/declaration.py
xumiao/supernorm
train
0
2e3bfc7bece2963e33d59182db5092a5739023ee
[ "if defines is None:\n defines = {}\nif autotune_configs is None:\n autotune_configs = []\nif autotune_key is None:\n autotune_key = []\nif src == '':\n raise ValueError('Kernel source code is empty')\nself.src = src\nassert device.type in ['cuda', 'cpu']\nif device.type == 'cuda':\n self.device_id =...
<|body_start_0|> if defines is None: defines = {} if autotune_configs is None: autotune_configs = [] if autotune_key is None: autotune_key = [] if src == '': raise ValueError('Kernel source code is empty') self.src = src ass...
A class used to represent a Triton kernel.
kernel
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class kernel: """A class used to represent a Triton kernel.""" def __init__(self, src: str, device: torch.device, defines: Optional[Dict]=None, num_warps: int=4, autotune_configs: Optional[List]=None, autotune_key: Optional[List]=None): """:param src: The source code of the kernel. :param ...
stack_v2_sparse_classes_75kplus_train_006755
4,369
permissive
[ { "docstring": ":param src: The source code of the kernel. :param device: The device to compile the kernel for. :param defines: A dictionary of preprocessor #define for the compiler. :param num_warps: Optimization flag for the compiler's internal auto-parallelization engine. :param autotune_configs: A list of t...
2
stack_v2_sparse_classes_30k_train_007920
Implement the Python class `kernel` described below. Class description: A class used to represent a Triton kernel. Method signatures and docstrings: - def __init__(self, src: str, device: torch.device, defines: Optional[Dict]=None, num_warps: int=4, autotune_configs: Optional[List]=None, autotune_key: Optional[List]=...
Implement the Python class `kernel` described below. Class description: A class used to represent a Triton kernel. Method signatures and docstrings: - def __init__(self, src: str, device: torch.device, defines: Optional[Dict]=None, num_warps: int=4, autotune_configs: Optional[List]=None, autotune_key: Optional[List]=...
a598fba0f5ad2db54bf0bbcbe9f23b85c408fc25
<|skeleton|> class kernel: """A class used to represent a Triton kernel.""" def __init__(self, src: str, device: torch.device, defines: Optional[Dict]=None, num_warps: int=4, autotune_configs: Optional[List]=None, autotune_key: Optional[List]=None): """:param src: The source code of the kernel. :param ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class kernel: """A class used to represent a Triton kernel.""" def __init__(self, src: str, device: torch.device, defines: Optional[Dict]=None, num_warps: int=4, autotune_configs: Optional[List]=None, autotune_key: Optional[List]=None): """:param src: The source code of the kernel. :param device: The d...
the_stack_v2_python_sparse
python/triton/kernel.py
beyondliyang/triton
train
1
bd089873cc73683cf6f71ba4680b94a86abf154d
[ "rospy.init_node('paparazzienvironment')\nrospy.wait_for_service('/get_wind')\nself.ivy_msg = None\nself.nps_udp_socket = None\nself.time_scale = time_scale\nif nps_addr is not None:\n self.use_udp = True\n self.nps_addr = nps_addr\n self.start_time = rospy.get_time()\n self.wind_udp_packer = struct.Str...
<|body_start_0|> rospy.init_node('paparazzienvironment') rospy.wait_for_service('/get_wind') self.ivy_msg = None self.nps_udp_socket = None self.time_scale = time_scale if nps_addr is not None: self.use_udp = True self.nps_addr = nps_addr ...
PaparazziEnvironment holds environment data (eg. wind) and sends them to paparazzi.
PaparazziEnvironment
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PaparazziEnvironment: """PaparazziEnvironment holds environment data (eg. wind) and sends them to paparazzi.""" def __init__(self, nps_addr=None, time_scale=1): """Initialize PaparazziEnvironment. Arguments: nps_addr: (optional) key-value pairs of ac_id and corresponding (host, port)...
stack_v2_sparse_classes_75kplus_train_006756
6,772
no_license
[ { "docstring": "Initialize PaparazziEnvironment. Arguments: nps_addr: (optional) key-value pairs of ac_id and corresponding (host, port). If None, use Ivy bus instead of UDP datagrams. time_scale: simulation speed multiplier (default 1)", "name": "__init__", "signature": "def __init__(self, nps_addr=Non...
4
stack_v2_sparse_classes_30k_train_039413
Implement the Python class `PaparazziEnvironment` described below. Class description: PaparazziEnvironment holds environment data (eg. wind) and sends them to paparazzi. Method signatures and docstrings: - def __init__(self, nps_addr=None, time_scale=1): Initialize PaparazziEnvironment. Arguments: nps_addr: (optional...
Implement the Python class `PaparazziEnvironment` described below. Class description: PaparazziEnvironment holds environment data (eg. wind) and sends them to paparazzi. Method signatures and docstrings: - def __init__(self, nps_addr=None, time_scale=1): Initialize PaparazziEnvironment. Arguments: nps_addr: (optional...
7dd55f9ace342c34f988082b197e79bc6faba584
<|skeleton|> class PaparazziEnvironment: """PaparazziEnvironment holds environment data (eg. wind) and sends them to paparazzi.""" def __init__(self, nps_addr=None, time_scale=1): """Initialize PaparazziEnvironment. Arguments: nps_addr: (optional) key-value pairs of ac_id and corresponding (host, port)...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PaparazziEnvironment: """PaparazziEnvironment holds environment data (eg. wind) and sends them to paparazzi.""" def __init__(self, nps_addr=None, time_scale=1): """Initialize PaparazziEnvironment. Arguments: nps_addr: (optional) key-value pairs of ac_id and corresponding (host, port). If None, us...
the_stack_v2_python_sparse
src/paparazzienvironment.py
rafael1193/skyscannner_integration
train
2
08a8d852fa8879dd900fabc2b1046c391d078784
[ "capture_output = []\nif interface is None:\n raise Exception('Please provide the interface used.')\nelse:\n capture = pyshark.LiveCapture(interface=interface, bpf_filter=bpf_filter, tshark_path=tshark_path, output_file=output_file)\n capture.sniff(timeout=timeout)\n length = len(capture)\n return (c...
<|body_start_0|> capture_output = [] if interface is None: raise Exception('Please provide the interface used.') else: capture = pyshark.LiveCapture(interface=interface, bpf_filter=bpf_filter, tshark_path=tshark_path, output_file=output_file) capture.sniff(tim...
Provides utility for the monitoring of network traffic, measuring the packets sent through specific filters as passed by user.
NetworkMonitor
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NetworkMonitor: """Provides utility for the monitoring of network traffic, measuring the packets sent through specific filters as passed by user.""" def get_packets(timeout=50, interface=None, bpf_filter=None, display_filter='tcp.port == 80', tshark_path=None, output_file=None): """R...
stack_v2_sparse_classes_75kplus_train_006757
3,625
permissive
[ { "docstring": "Returns the captured packets of the transmitted data using Wireshark. Args: timeout: An integer. Set for sniffing with tshark. Default to 50 seconds in this setup. interface: A string. Name of the interface to sniff on. bpf_filter: A string. The capture filter in bpf syntax 'tcp port 80'. Needs ...
2
stack_v2_sparse_classes_30k_train_019791
Implement the Python class `NetworkMonitor` described below. Class description: Provides utility for the monitoring of network traffic, measuring the packets sent through specific filters as passed by user. Method signatures and docstrings: - def get_packets(timeout=50, interface=None, bpf_filter=None, display_filter...
Implement the Python class `NetworkMonitor` described below. Class description: Provides utility for the monitoring of network traffic, measuring the packets sent through specific filters as passed by user. Method signatures and docstrings: - def get_packets(timeout=50, interface=None, bpf_filter=None, display_filter...
cc4765bed880ad38a02505834f63df39e0815328
<|skeleton|> class NetworkMonitor: """Provides utility for the monitoring of network traffic, measuring the packets sent through specific filters as passed by user.""" def get_packets(timeout=50, interface=None, bpf_filter=None, display_filter='tcp.port == 80', tshark_path=None, output_file=None): """R...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class NetworkMonitor: """Provides utility for the monitoring of network traffic, measuring the packets sent through specific filters as passed by user.""" def get_packets(timeout=50, interface=None, bpf_filter=None, display_filter='tcp.port == 80', tshark_path=None, output_file=None): """Returns the ca...
the_stack_v2_python_sparse
syft/generic/metrics.py
tudorcebere/PySyft
train
2
f71210d9aeca09d326dc09b3691a0ab350d78beb
[ "super(PAE_train, self).__init__(dim, **kwargs)\nself.init_train(num_epochs, batch_size, learning_rate, db)\nself.build(input_shape=(4, self.image_size))\nself.b_epochs = b_epochs\nself.b_batch = b_batch\nself.b_learning = b_learning\nself.b_split = b_split\nself.optimizer = tf.keras.optimizers.Adam(self.learning_r...
<|body_start_0|> super(PAE_train, self).__init__(dim, **kwargs) self.init_train(num_epochs, batch_size, learning_rate, db) self.build(input_shape=(4, self.image_size)) self.b_epochs = b_epochs self.b_batch = b_batch self.b_learning = b_learning self.b_split = b_sp...
PAE_train
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PAE_train: def __init__(self, dim, num_epochs, batch_size, learning_rate, db, b_epochs=5, b_batch=256, b_learning=0.0001, b_split=0.2, **kwargs): """Wrapper for the train of Probabilistic Autoencoder (PAE) :param dim: hyperparameters of the model [h_dim, z_dim, real_dim] :param num_epoch...
stack_v2_sparse_classes_75kplus_train_006758
4,101
permissive
[ { "docstring": "Wrapper for the train of Probabilistic Autoencoder (PAE) :param dim: hyperparameters of the model [h_dim, z_dim, real_dim] :param num_epochs: number of epochs in training :param batch_size: Bacth size in traiing :param learning_rate: Learning rate :param db: Db where to save data training :param...
4
stack_v2_sparse_classes_30k_train_017827
Implement the Python class `PAE_train` described below. Class description: Implement the PAE_train class. Method signatures and docstrings: - def __init__(self, dim, num_epochs, batch_size, learning_rate, db, b_epochs=5, b_batch=256, b_learning=0.0001, b_split=0.2, **kwargs): Wrapper for the train of Probabilistic Au...
Implement the Python class `PAE_train` described below. Class description: Implement the PAE_train class. Method signatures and docstrings: - def __init__(self, dim, num_epochs, batch_size, learning_rate, db, b_epochs=5, b_batch=256, b_learning=0.0001, b_split=0.2, **kwargs): Wrapper for the train of Probabilistic Au...
91dbb0eebba64f1fa2c18562e2c9f35f532ef7c0
<|skeleton|> class PAE_train: def __init__(self, dim, num_epochs, batch_size, learning_rate, db, b_epochs=5, b_batch=256, b_learning=0.0001, b_split=0.2, **kwargs): """Wrapper for the train of Probabilistic Autoencoder (PAE) :param dim: hyperparameters of the model [h_dim, z_dim, real_dim] :param num_epoch...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PAE_train: def __init__(self, dim, num_epochs, batch_size, learning_rate, db, b_epochs=5, b_batch=256, b_learning=0.0001, b_split=0.2, **kwargs): """Wrapper for the train of Probabilistic Autoencoder (PAE) :param dim: hyperparameters of the model [h_dim, z_dim, real_dim] :param num_epochs: number of e...
the_stack_v2_python_sparse
src/python_code/Models/model_PAE_train.py
ipmach/Thesis2021
train
0
2e34bb6ca90e92b267ad0946f69640262d974f71
[ "super().__init__(*args, **kwargs)\nif ext_args == {}:\n self._freq = 1\nelse:\n self._freq = ext_args.freq", "if engine.rank == 0 and engine.last_iter.val % self._freq == 0:\n dirname = os.path.join(engine.save_path, 'ckpt')\n if not os.path.exists(dirname):\n try:\n os.mkdir(dirnam...
<|body_start_0|> super().__init__(*args, **kwargs) if ext_args == {}: self._freq = 1 else: self._freq = ext_args.freq <|end_body_0|> <|body_start_1|> if engine.rank == 0 and engine.last_iter.val % self._freq == 0: dirname = os.path.join(engine.save_pa...
Overview: Hook to save checkpoint Interfaces: __init__, __call__ Property: name, priority, position
SaveCkptHook
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SaveCkptHook: """Overview: Hook to save checkpoint Interfaces: __init__, __call__ Property: name, priority, position""" def __init__(self, *args, ext_args: EasyDict=EasyDict(), **kwargs) -> None: """Overview: init SaveCkptHook Arguments: - ext_args (:obj:`EasyDict`): extended_args, u...
stack_v2_sparse_classes_75kplus_train_006759
13,409
permissive
[ { "docstring": "Overview: init SaveCkptHook Arguments: - ext_args (:obj:`EasyDict`): extended_args, use ext_args.freq to set save_ckpt_freq", "name": "__init__", "signature": "def __init__(self, *args, ext_args: EasyDict=EasyDict(), **kwargs) -> None" }, { "docstring": "Overview: Save check poin...
2
null
Implement the Python class `SaveCkptHook` described below. Class description: Overview: Hook to save checkpoint Interfaces: __init__, __call__ Property: name, priority, position Method signatures and docstrings: - def __init__(self, *args, ext_args: EasyDict=EasyDict(), **kwargs) -> None: Overview: init SaveCkptHook ...
Implement the Python class `SaveCkptHook` described below. Class description: Overview: Hook to save checkpoint Interfaces: __init__, __call__ Property: name, priority, position Method signatures and docstrings: - def __init__(self, *args, ext_args: EasyDict=EasyDict(), **kwargs) -> None: Overview: init SaveCkptHook ...
09d507c412235a2f0cf9c0b3485ec9ed15fb6421
<|skeleton|> class SaveCkptHook: """Overview: Hook to save checkpoint Interfaces: __init__, __call__ Property: name, priority, position""" def __init__(self, *args, ext_args: EasyDict=EasyDict(), **kwargs) -> None: """Overview: init SaveCkptHook Arguments: - ext_args (:obj:`EasyDict`): extended_args, u...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SaveCkptHook: """Overview: Hook to save checkpoint Interfaces: __init__, __call__ Property: name, priority, position""" def __init__(self, *args, ext_args: EasyDict=EasyDict(), **kwargs) -> None: """Overview: init SaveCkptHook Arguments: - ext_args (:obj:`EasyDict`): extended_args, use ext_args.f...
the_stack_v2_python_sparse
ctools/worker/learner/learner_hook.py
LFhase/DI-star
train
1
9dc59f096aeda010c3cdeb71625dc8ed48bdca51
[ "for config in self.config.get('org.permissions.org_integrity.orgs'):\n host, org = config['url'].rsplit('/', 1)\n url_hash = collabs.get_sha256_hash([config['url']], 10)\n path = ['permissions', f'gh_forks_{url_hash}.json']\n description = f'Forks of repos in the {org} GH org'\n self.config.add_evid...
<|body_start_0|> for config in self.config.get('org.permissions.org_integrity.orgs'): host, org = config['url'].rsplit('/', 1) url_hash = collabs.get_sha256_hash([config['url']], 10) path = ['permissions', f'gh_forks_{url_hash}.json'] description = f'Forks of repo...
Fetch Github permissions evidence.
GithubOrgPermissionsFetcher
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GithubOrgPermissionsFetcher: """Fetch Github permissions evidence.""" def fetch_repo_forks(self): """Fetch Github repository forks.""" <|body_0|> def fetch_repo_teams(self): """Fetch Github repository teams.""" <|body_1|> <|end_skeleton|> <|body_start_0...
stack_v2_sparse_classes_75kplus_train_006760
3,727
permissive
[ { "docstring": "Fetch Github repository forks.", "name": "fetch_repo_forks", "signature": "def fetch_repo_forks(self)" }, { "docstring": "Fetch Github repository teams.", "name": "fetch_repo_teams", "signature": "def fetch_repo_teams(self)" } ]
2
null
Implement the Python class `GithubOrgPermissionsFetcher` described below. Class description: Fetch Github permissions evidence. Method signatures and docstrings: - def fetch_repo_forks(self): Fetch Github repository forks. - def fetch_repo_teams(self): Fetch Github repository teams.
Implement the Python class `GithubOrgPermissionsFetcher` described below. Class description: Fetch Github permissions evidence. Method signatures and docstrings: - def fetch_repo_forks(self): Fetch Github repository forks. - def fetch_repo_teams(self): Fetch Github repository teams. <|skeleton|> class GithubOrgPermi...
527ff36e8cb56286e5bac1aa4e831b25e925cf09
<|skeleton|> class GithubOrgPermissionsFetcher: """Fetch Github permissions evidence.""" def fetch_repo_forks(self): """Fetch Github repository forks.""" <|body_0|> def fetch_repo_teams(self): """Fetch Github repository teams.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GithubOrgPermissionsFetcher: """Fetch Github permissions evidence.""" def fetch_repo_forks(self): """Fetch Github repository forks.""" for config in self.config.get('org.permissions.org_integrity.orgs'): host, org = config['url'].rsplit('/', 1) url_hash = collabs.g...
the_stack_v2_python_sparse
arboretum/permissions/fetchers/github/fetch_org_permissions.py
degenaro/auditree-arboretum
train
0
25a37b381847da5cc83a0ef0fb4ca098ce5af34f
[ "is_markerless = node_types.MARKERLESS_REGEX.match\nprefix = list(takewhile(lambda l: not is_markerless(l), node['label']))\nif 'intro' in prefix:\n title = node.get('title', '').rstrip(':')\n return 'Intro: ' + title\nelif len(prefix) > 1:\n label = 'Section ' + '.'.join(prefix[1:])\n count = len(node[...
<|body_start_0|> is_markerless = node_types.MARKERLESS_REGEX.match prefix = list(takewhile(lambda l: not is_markerless(l), node['label'])) if 'intro' in prefix: title = node.get('title', '').rstrip(':') return 'Intro: ' + title elif len(prefix) > 1: la...
PreambleHTMLBuilder
[ "CC0-1.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PreambleHTMLBuilder: def human_label(node): """Derive a human-readable description for this node. Override""" <|body_0|> def process_node(self, node, indexes=None): """Overrides with custom, additional processing""" <|body_1|> <|end_skeleton|> <|body_start_...
stack_v2_sparse_classes_75kplus_train_006761
9,837
permissive
[ { "docstring": "Derive a human-readable description for this node. Override", "name": "human_label", "signature": "def human_label(node)" }, { "docstring": "Overrides with custom, additional processing", "name": "process_node", "signature": "def process_node(self, node, indexes=None)" ...
2
stack_v2_sparse_classes_30k_train_014101
Implement the Python class `PreambleHTMLBuilder` described below. Class description: Implement the PreambleHTMLBuilder class. Method signatures and docstrings: - def human_label(node): Derive a human-readable description for this node. Override - def process_node(self, node, indexes=None): Overrides with custom, addi...
Implement the Python class `PreambleHTMLBuilder` described below. Class description: Implement the PreambleHTMLBuilder class. Method signatures and docstrings: - def human_label(node): Derive a human-readable description for this node. Override - def process_node(self, node, indexes=None): Overrides with custom, addi...
4035701a953409bbb1987d371edc6630fd97a862
<|skeleton|> class PreambleHTMLBuilder: def human_label(node): """Derive a human-readable description for this node. Override""" <|body_0|> def process_node(self, node, indexes=None): """Overrides with custom, additional processing""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PreambleHTMLBuilder: def human_label(node): """Derive a human-readable description for this node. Override""" is_markerless = node_types.MARKERLESS_REGEX.match prefix = list(takewhile(lambda l: not is_markerless(l), node['label'])) if 'intro' in prefix: title = node...
the_stack_v2_python_sparse
regulations/generator/html_builder.py
fecgov/regulations-site
train
1
bad80a114e6a23487aa50a1c33f3103c16e1948e
[ "self._worker_func = worker_func\nself._output_obj = output_obj\nself._iterable_kwargs = iter_kwargs\nif noniter_kwargs is None:\n noniter_kwargs = {}\nself._noniterable_kwargs = noniter_kwargs", "if num_cores is None:\n num_cores = max(multi.cpu_count() - 1, 1)\nall_pipes = []\nall_processes = []\nwhile le...
<|body_start_0|> self._worker_func = worker_func self._output_obj = output_obj self._iterable_kwargs = iter_kwargs if noniter_kwargs is None: noniter_kwargs = {} self._noniterable_kwargs = noniter_kwargs <|end_body_0|> <|body_start_1|> if num_cores is None: ...
Manually implemented asynchronous pipe-based pool-like system. No error handling implemented yet. Hopefully handles memory better than starmap/map_async/apply_async, where all data is saved on memory until pool is complete. However, those approaches are viable for a lot of systems.
PipePool
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PipePool: """Manually implemented asynchronous pipe-based pool-like system. No error handling implemented yet. Hopefully handles memory better than starmap/map_async/apply_async, where all data is saved on memory until pool is complete. However, those approaches are viable for a lot of systems.""...
stack_v2_sparse_classes_75kplus_train_006762
17,760
no_license
[ { "docstring": "Create a pool-like object to perform a process in parallel Parameters ---------- worker_func Target function, must be structured as f(pipe_access, *args, **kwargs) Target function should return (index for output_obj, vals to put into output_obj) - pipe_access is used to send data back to the Poo...
2
null
Implement the Python class `PipePool` described below. Class description: Manually implemented asynchronous pipe-based pool-like system. No error handling implemented yet. Hopefully handles memory better than starmap/map_async/apply_async, where all data is saved on memory until pool is complete. However, those approa...
Implement the Python class `PipePool` described below. Class description: Manually implemented asynchronous pipe-based pool-like system. No error handling implemented yet. Hopefully handles memory better than starmap/map_async/apply_async, where all data is saved on memory until pool is complete. However, those approa...
0bd683b82069dd96f420f965598a3051b909bc7c
<|skeleton|> class PipePool: """Manually implemented asynchronous pipe-based pool-like system. No error handling implemented yet. Hopefully handles memory better than starmap/map_async/apply_async, where all data is saved on memory until pool is complete. However, those approaches are viable for a lot of systems.""...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PipePool: """Manually implemented asynchronous pipe-based pool-like system. No error handling implemented yet. Hopefully handles memory better than starmap/map_async/apply_async, where all data is saved on memory until pool is complete. However, those approaches are viable for a lot of systems.""" def __...
the_stack_v2_python_sparse
exoechopy/utils/math_operations.py
stellar-echo/exoechopy
train
1
501e6a4fbdbad806606ee746fbd27488c03762d1
[ "if not s:\n return 0\nif len(s) == 1:\n return 1\noutput = ''\nstart = 0\nend = 1\n\ndef is_unique(s):\n return len(s) == len(set(s))\nwhile end <= len(s):\n substr = s[start:end]\n if is_unique(substr):\n if len(substr) > len(output):\n output = substr\n end += 1\n elif ...
<|body_start_0|> if not s: return 0 if len(s) == 1: return 1 output = '' start = 0 end = 1 def is_unique(s): return len(s) == len(set(s)) while end <= len(s): substr = s[start:end] if is_unique(substr): ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_0|> def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not s: return 0 if l...
stack_v2_sparse_classes_75kplus_train_006763
1,639
no_license
[ { "docstring": ":type s: str :rtype: int", "name": "lengthOfLongestSubstring", "signature": "def lengthOfLongestSubstring(self, s)" }, { "docstring": ":type s: str :rtype: int", "name": "lengthOfLongestSubstring", "signature": "def lengthOfLongestSubstring(self, s)" } ]
2
stack_v2_sparse_classes_30k_val_001706
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int <|skeleton|> class Solution: def lengthOfL...
f3e01ec2012ac6d22709357db27a487d14c50411
<|skeleton|> class Solution: def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_0|> def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" if not s: return 0 if len(s) == 1: return 1 output = '' start = 0 end = 1 def is_unique(s): return len(s) == len(set(s)) while en...
the_stack_v2_python_sparse
length_of_longest_substr.py
dan-sf/leetcode
train
0
f554712b62d991c5cd4f157f42604d5f98e280d7
[ "def search(node, count):\n if node not in records:\n return 0\n elif (node[0] + 1, (node[1] - 1) * 2 + 1) not in records and (node[0] + 1, (node[1] - 1) * 2 + 2) not in records:\n return count + records[node]\n else:\n return search((node[0] + 1, (node[1] - 1) * 2 + 1), count + record...
<|body_start_0|> def search(node, count): if node not in records: return 0 elif (node[0] + 1, (node[1] - 1) * 2 + 1) not in records and (node[0] + 1, (node[1] - 1) * 2 + 2) not in records: return count + records[node] else: retu...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def pathSum(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def pathSum_v2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def pathSum_verbose(self, nums): """:type nums: List[int] :rtype: int""" ...
stack_v2_sparse_classes_75kplus_train_006764
4,057
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "pathSum", "signature": "def pathSum(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "pathSum_v2", "signature": "def pathSum_v2(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: in...
3
stack_v2_sparse_classes_30k_train_033334
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def pathSum(self, nums): :type nums: List[int] :rtype: int - def pathSum_v2(self, nums): :type nums: List[int] :rtype: int - def pathSum_verbose(self, nums): :type nums: List[int...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def pathSum(self, nums): :type nums: List[int] :rtype: int - def pathSum_v2(self, nums): :type nums: List[int] :rtype: int - def pathSum_verbose(self, nums): :type nums: List[int...
e60ba45fe2f2e5e3b3abfecec3db76f5ce1fde59
<|skeleton|> class Solution: def pathSum(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def pathSum_v2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def pathSum_verbose(self, nums): """:type nums: List[int] :rtype: int""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def pathSum(self, nums): """:type nums: List[int] :rtype: int""" def search(node, count): if node not in records: return 0 elif (node[0] + 1, (node[1] - 1) * 2 + 1) not in records and (node[0] + 1, (node[1] - 1) * 2 + 2) not in records: ...
the_stack_v2_python_sparse
src/lt_666.py
oxhead/CodingYourWay
train
0
79e7d6ee97c7e4a475b1b79dab478cdc71f0c4c6
[ "data = {'name': self.env.user.company_id.name, 'title': '', 'type': 'company', 'className': 'o_hr_organization_chart_company', 'id': '0', 'children': []}\ndepartments = self.env['hr.department'].search([('parent_id', '=', False)])\nfor department in departments:\n data['children'].append(self.get_department_chi...
<|body_start_0|> data = {'name': self.env.user.company_id.name, 'title': '', 'type': 'company', 'className': 'o_hr_organization_chart_company', 'id': '0', 'children': []} departments = self.env['hr.department'].search([('parent_id', '=', False)]) for department in departments: data['...
Hr Organization Chart Model Retrieve the hierarchy of the organization's departments and employees.
HrOrganizationChart
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HrOrganizationChart: """Hr Organization Chart Model Retrieve the hierarchy of the organization's departments and employees.""" def get_organization_data(self): """Retrieve the organization hierarchy of departments and employees :return {'values': data} organization's data. :rtype jso...
stack_v2_sparse_classes_75kplus_train_006765
6,584
no_license
[ { "docstring": "Retrieve the organization hierarchy of departments and employees :return {'values': data} organization's data. :rtype json object. data: is the organization hierarchy in a json object format of {'key': 'value'} including the children key whose value is a list of children, each child can be eithe...
4
stack_v2_sparse_classes_30k_train_003425
Implement the Python class `HrOrganizationChart` described below. Class description: Hr Organization Chart Model Retrieve the hierarchy of the organization's departments and employees. Method signatures and docstrings: - def get_organization_data(self): Retrieve the organization hierarchy of departments and employees...
Implement the Python class `HrOrganizationChart` described below. Class description: Hr Organization Chart Model Retrieve the hierarchy of the organization's departments and employees. Method signatures and docstrings: - def get_organization_data(self): Retrieve the organization hierarchy of departments and employees...
e6b614f1e09b26dcee9fd53c1d16572303e9d965
<|skeleton|> class HrOrganizationChart: """Hr Organization Chart Model Retrieve the hierarchy of the organization's departments and employees.""" def get_organization_data(self): """Retrieve the organization hierarchy of departments and employees :return {'values': data} organization's data. :rtype jso...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class HrOrganizationChart: """Hr Organization Chart Model Retrieve the hierarchy of the organization's departments and employees.""" def get_organization_data(self): """Retrieve the organization hierarchy of departments and employees :return {'values': data} organization's data. :rtype json object. dat...
the_stack_v2_python_sparse
hr_organization_chart/models/hr_organization_chart.py
ebs-odoosh/hr_test
train
0
e19cb802b7b66cf80fdc4da41cf4ae2d6e4bb1bc
[ "if not nums:\n return\nnums.sort()\nhalf = len(nums) // 2\nnums[:half] = nums[:half][::-1]\ni = 1\nj = len(nums) - 1\nwhile j > len(nums) // 2:\n val = nums.pop()\n nums.insert(i, val)\n i += 2\n j -= 1", "arr = sorted(nums)\nfor i in range(1, len(nums), 2):\n nums[i] = arr.pop()\nfor i in rang...
<|body_start_0|> if not nums: return nums.sort() half = len(nums) // 2 nums[:half] = nums[:half][::-1] i = 1 j = len(nums) - 1 while j > len(nums) // 2: val = nums.pop() nums.insert(i, val) i += 2 j -= 1 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def wiggleSort(self, nums): """:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.""" <|body_0|> def wiggleSort2(self, nums): """:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead."""...
stack_v2_sparse_classes_75kplus_train_006766
1,414
no_license
[ { "docstring": ":type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.", "name": "wiggleSort", "signature": "def wiggleSort(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.", "name": "wi...
3
stack_v2_sparse_classes_30k_train_004657
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wiggleSort(self, nums): :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. - def wiggleSort2(self, nums): :type nums: List[int] :rtype: ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wiggleSort(self, nums): :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. - def wiggleSort2(self, nums): :type nums: List[int] :rtype: ...
0fc4c7af59246e3064db41989a45d9db413a624b
<|skeleton|> class Solution: def wiggleSort(self, nums): """:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.""" <|body_0|> def wiggleSort2(self, nums): """:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead."""...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def wiggleSort(self, nums): """:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.""" if not nums: return nums.sort() half = len(nums) // 2 nums[:half] = nums[:half][::-1] i = 1 j = len(nums) - 1...
the_stack_v2_python_sparse
324. Wiggle Sort II/wiggle.py
Macielyoung/LeetCode
train
1
455a8279a99adf6ea41ac7e11a65df30b753d121
[ "room_id = kwargs['pk']\nroom = Room.objects.get(id=room_id)\nform = self.get_form()\nif form.is_valid():\n return self.form_valid(form, room)\nelse:\n return self.form_invalid(form)", "row = form.cleaned_data.get('row')\nseats_quantity = form.cleaned_data.get('seats_quantity')\nfor i in range(1, seats_quan...
<|body_start_0|> room_id = kwargs['pk'] room = Room.objects.get(id=room_id) form = self.get_form() if form.is_valid(): return self.form_valid(form, room) else: return self.form_invalid(form) <|end_body_0|> <|body_start_1|> row = form.cleaned_data....
AddSeatRow
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AddSeatRow: def post(self, request, *args, **kwargs): """Handle POST requests: instantiate a form instance with the passed POST variables and then check if it's valid.""" <|body_0|> def form_valid(self, form, room): """If the form is valid, redirect to the supplied U...
stack_v2_sparse_classes_75kplus_train_006767
3,132
permissive
[ { "docstring": "Handle POST requests: instantiate a form instance with the passed POST variables and then check if it's valid.", "name": "post", "signature": "def post(self, request, *args, **kwargs)" }, { "docstring": "If the form is valid, redirect to the supplied URL.", "name": "form_vali...
3
stack_v2_sparse_classes_30k_train_043413
Implement the Python class `AddSeatRow` described below. Class description: Implement the AddSeatRow class. Method signatures and docstrings: - def post(self, request, *args, **kwargs): Handle POST requests: instantiate a form instance with the passed POST variables and then check if it's valid. - def form_valid(self...
Implement the Python class `AddSeatRow` described below. Class description: Implement the AddSeatRow class. Method signatures and docstrings: - def post(self, request, *args, **kwargs): Handle POST requests: instantiate a form instance with the passed POST variables and then check if it's valid. - def form_valid(self...
d417895904c1a12ba2a9d761d7e60be77b7bcac2
<|skeleton|> class AddSeatRow: def post(self, request, *args, **kwargs): """Handle POST requests: instantiate a form instance with the passed POST variables and then check if it's valid.""" <|body_0|> def form_valid(self, form, room): """If the form is valid, redirect to the supplied U...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AddSeatRow: def post(self, request, *args, **kwargs): """Handle POST requests: instantiate a form instance with the passed POST variables and then check if it's valid.""" room_id = kwargs['pk'] room = Room.objects.get(id=room_id) form = self.get_form() if form.is_valid(...
the_stack_v2_python_sparse
ticketflix/room/views.py
DSW-2018-2/Ticketflix
train
3
63fab33222607228f3677223b6f05a52dc22e224
[ "data = super(JsonApiV10Parser, self).parse(stream, media_type=media_type, parser_context=parser_context)\nfields_extra = parser_context.get('fields_extra', {})\nas_relationship = parser_context.get('as_relationship')\nif as_relationship:\n rel_field_data = fields_extra[as_relationship]\n expected_type = rel_...
<|body_start_0|> data = super(JsonApiV10Parser, self).parse(stream, media_type=media_type, parser_context=parser_context) fields_extra = parser_context.get('fields_extra', {}) as_relationship = parser_context.get('as_relationship') if as_relationship: rel_field_data = fields_...
JSON API v1.0 parser. This is a partial implementation, focused on the current needs of the API. For the full spec, see http://jsonapi.org/format/1.0/
JsonApiV10Parser
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JsonApiV10Parser: """JSON API v1.0 parser. This is a partial implementation, focused on the current needs of the API. For the full spec, see http://jsonapi.org/format/1.0/""" def parse(self, stream, media_type=None, parser_context=None): """Parse JSON API representation into DRF nati...
stack_v2_sparse_classes_75kplus_train_006768
7,890
no_license
[ { "docstring": "Parse JSON API representation into DRF native format.", "name": "parse", "signature": "def parse(self, stream, media_type=None, parser_context=None)" }, { "docstring": "Convert a relationships object. Partially implements full spec at: http://jsonapi.org/format/1.0/#document-reso...
4
stack_v2_sparse_classes_30k_train_009255
Implement the Python class `JsonApiV10Parser` described below. Class description: JSON API v1.0 parser. This is a partial implementation, focused on the current needs of the API. For the full spec, see http://jsonapi.org/format/1.0/ Method signatures and docstrings: - def parse(self, stream, media_type=None, parser_c...
Implement the Python class `JsonApiV10Parser` described below. Class description: JSON API v1.0 parser. This is a partial implementation, focused on the current needs of the API. For the full spec, see http://jsonapi.org/format/1.0/ Method signatures and docstrings: - def parse(self, stream, media_type=None, parser_c...
bc092964153b03381aaff74a4d80f43a2b2dec19
<|skeleton|> class JsonApiV10Parser: """JSON API v1.0 parser. This is a partial implementation, focused on the current needs of the API. For the full spec, see http://jsonapi.org/format/1.0/""" def parse(self, stream, media_type=None, parser_context=None): """Parse JSON API representation into DRF nati...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class JsonApiV10Parser: """JSON API v1.0 parser. This is a partial implementation, focused on the current needs of the API. For the full spec, see http://jsonapi.org/format/1.0/""" def parse(self, stream, media_type=None, parser_context=None): """Parse JSON API representation into DRF native format."""...
the_stack_v2_python_sparse
browsercompat/webplatformcompat/v2/parsers.py
WeilerWebServices/MDN-Web-Docs
train
1
032654970450fdfbd5c5e1e6fbffb0c6f8c538fa
[ "dicoms = glob.glob(os.path.join(directory, '*.DCM'))\nprint(dicoms)\nself.datasets = defaultdict(list)\nfor dicom in dicoms:\n try:\n dataset = pydicom.dcmread(dicom)\n if PLEXEliteParser.__check_plex_elite(dataset):\n file_type = PLEXEliteParser.__file_type(dataset)\n self.d...
<|body_start_0|> dicoms = glob.glob(os.path.join(directory, '*.DCM')) print(dicoms) self.datasets = defaultdict(list) for dicom in dicoms: try: dataset = pydicom.dcmread(dicom) if PLEXEliteParser.__check_plex_elite(dataset): ...
Parses a PLEXElite eye exam in DICOM format.
PLEXEliteParser
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PLEXEliteParser: """Parses a PLEXElite eye exam in DICOM format.""" def __init__(self, directory): """PLEXEliteParser constructor. :param directory: directory containing the DICOM files.""" <|body_0|> def __check_plex_elite(dataset): """Checks that a dataset was ...
stack_v2_sparse_classes_75kplus_train_006769
12,098
no_license
[ { "docstring": "PLEXEliteParser constructor. :param directory: directory containing the DICOM files.", "name": "__init__", "signature": "def __init__(self, directory)" }, { "docstring": "Checks that a dataset was acquired by a PLEXElite. :param dataset: image dataset :return: whether or not the ...
6
null
Implement the Python class `PLEXEliteParser` described below. Class description: Parses a PLEXElite eye exam in DICOM format. Method signatures and docstrings: - def __init__(self, directory): PLEXEliteParser constructor. :param directory: directory containing the DICOM files. - def __check_plex_elite(dataset): Check...
Implement the Python class `PLEXEliteParser` described below. Class description: Parses a PLEXElite eye exam in DICOM format. Method signatures and docstrings: - def __init__(self, directory): PLEXEliteParser constructor. :param directory: directory containing the DICOM files. - def __check_plex_elite(dataset): Check...
43922f7e92ce3c4f6716efb0bff3e9f250f214a0
<|skeleton|> class PLEXEliteParser: """Parses a PLEXElite eye exam in DICOM format.""" def __init__(self, directory): """PLEXEliteParser constructor. :param directory: directory containing the DICOM files.""" <|body_0|> def __check_plex_elite(dataset): """Checks that a dataset was ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PLEXEliteParser: """Parses a PLEXElite eye exam in DICOM format.""" def __init__(self, directory): """PLEXEliteParser constructor. :param directory: directory containing the DICOM files.""" dicoms = glob.glob(os.path.join(directory, '*.DCM')) print(dicoms) self.datasets = ...
the_stack_v2_python_sparse
octip/parser.py
maystroh/GAMMA
train
1
7553913bf7c58bc5fb71dbc371bda143158f9883
[ "trace_data = ' 5414 munmap(0xb7fbc000, 100584) = 0\\n5414 fstat64(1, {st_dev=makedev(0, 21), st_ino=13, st_mode=S_IFCHR|0620, st_nlink=1, st_uid=1000, st_gid=5, st_blksize=1024, st_blocks=0, st_rdev=makedev(136, 10), st_atime=2019/06/06-10:29:52.005720855, st_mtime=2019/06/06-10:29:52.005720855, st_ctime=...
<|body_start_0|> trace_data = ' 5414 munmap(0xb7fbc000, 100584) = 0\n5414 fstat64(1, {st_dev=makedev(0, 21), st_ino=13, st_mode=S_IFCHR|0620, st_nlink=1, st_uid=1000, st_gid=5, st_blksize=1024, st_blocks=0, st_rdev=makedev(136, 10), st_atime=2019/06/06-10:29:52.005720855, st_mtime=2019/06/06-10:29:52.0...
Test identify_opportunities
TestIdentify
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestIdentify: """Test identify_opportunities""" def test_identify_with_no_opportunities(self): """FsyncNoSpaceMutator should find no opportunities in a trace with no stat-like calls""" <|body_0|> def test_identify_with_one_opportunities(self): """FsyncNoSpaceMuta...
stack_v2_sparse_classes_75kplus_train_006770
3,502
no_license
[ { "docstring": "FsyncNoSpaceMutator should find no opportunities in a trace with no stat-like calls", "name": "test_identify_with_no_opportunities", "signature": "def test_identify_with_no_opportunities(self)" }, { "docstring": "FsyncNoSpaceMutator should find one opportunity in a trace with one...
3
stack_v2_sparse_classes_30k_train_006721
Implement the Python class `TestIdentify` described below. Class description: Test identify_opportunities Method signatures and docstrings: - def test_identify_with_no_opportunities(self): FsyncNoSpaceMutator should find no opportunities in a trace with no stat-like calls - def test_identify_with_one_opportunities(se...
Implement the Python class `TestIdentify` described below. Class description: Test identify_opportunities Method signatures and docstrings: - def test_identify_with_no_opportunities(self): FsyncNoSpaceMutator should find no opportunities in a trace with no stat-like calls - def test_identify_with_one_opportunities(se...
e0ef7b8a735f536baa07093c0ecf339c21f7bc43
<|skeleton|> class TestIdentify: """Test identify_opportunities""" def test_identify_with_no_opportunities(self): """FsyncNoSpaceMutator should find no opportunities in a trace with no stat-like calls""" <|body_0|> def test_identify_with_one_opportunities(self): """FsyncNoSpaceMuta...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestIdentify: """Test identify_opportunities""" def test_identify_with_no_opportunities(self): """FsyncNoSpaceMutator should find no opportunities in a trace with no stat-like calls""" trace_data = ' 5414 munmap(0xb7fbc000, 100584) = 0\n5414 fstat64(1, {st_dev=makedev(0, 21), st_...
the_stack_v2_python_sparse
src/mutator/test_FsyncNoSpace.py
pkmoore/rrapper
train
4
c8a995b0cf927e0931eed03fa1d90ea59fa40170
[ "self.tasks_q = tasks_queue\nself.n_workers = n_workers\nself.timeout = timeout\nself.active_processes = []", "workers = [TaskProcessor(self.tasks_q, self.timeout) for _ in range(self.n_workers)]\nfor worker in workers:\n process = Process(target=worker.run)\n self.active_processes.append(process)\n proc...
<|body_start_0|> self.tasks_q = tasks_queue self.n_workers = n_workers self.timeout = timeout self.active_processes = [] <|end_body_0|> <|body_start_1|> workers = [TaskProcessor(self.tasks_q, self.timeout) for _ in range(self.n_workers)] for worker in workers: ...
Мастер-процесс, который управляет воркерами
TaskManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TaskManager: """Мастер-процесс, который управляет воркерами""" def __init__(self, tasks_queue, n_workers, timeout): """:param tasks_queue: Manager.Queue с объектами класса Task :param n_workers: кол-во воркеров :param timeout: таймаут в секундах, воркер не может работать дольше, чем ...
stack_v2_sparse_classes_75kplus_train_006771
3,404
no_license
[ { "docstring": ":param tasks_queue: Manager.Queue с объектами класса Task :param n_workers: кол-во воркеров :param timeout: таймаут в секундах, воркер не может работать дольше, чем timeout секунд", "name": "__init__", "signature": "def __init__(self, tasks_queue, n_workers, timeout)" }, { "docst...
2
null
Implement the Python class `TaskManager` described below. Class description: Мастер-процесс, который управляет воркерами Method signatures and docstrings: - def __init__(self, tasks_queue, n_workers, timeout): :param tasks_queue: Manager.Queue с объектами класса Task :param n_workers: кол-во воркеров :param timeout: ...
Implement the Python class `TaskManager` described below. Class description: Мастер-процесс, который управляет воркерами Method signatures and docstrings: - def __init__(self, tasks_queue, n_workers, timeout): :param tasks_queue: Manager.Queue с объектами класса Task :param n_workers: кол-во воркеров :param timeout: ...
6fac424dfdc2974481712b630ccf587128c84a47
<|skeleton|> class TaskManager: """Мастер-процесс, который управляет воркерами""" def __init__(self, tasks_queue, n_workers, timeout): """:param tasks_queue: Manager.Queue с объектами класса Task :param n_workers: кол-во воркеров :param timeout: таймаут в секундах, воркер не может работать дольше, чем ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TaskManager: """Мастер-процесс, который управляет воркерами""" def __init__(self, tasks_queue, n_workers, timeout): """:param tasks_queue: Manager.Queue с объектами класса Task :param n_workers: кол-во воркеров :param timeout: таймаут в секундах, воркер не может работать дольше, чем timeout секун...
the_stack_v2_python_sparse
technoatom/homework_04/hw4_process_manager.py
alipniczkij/python
train
0
627df901eb782fb4142ecff0970083a9c47db8b5
[ "path = '/'.join([self.LOCKS_BASEURL, quote_plus(scope), quote_plus(name)])\nurl = build_url(choice(self.list_hosts), path=path, params={'did_type': 'dataset'})\nresult = self._send_request(url)\nif result.status_code == codes.ok:\n locks = self._load_json_data(result)\n return locks\nelse:\n exc_cls, exc_...
<|body_start_0|> path = '/'.join([self.LOCKS_BASEURL, quote_plus(scope), quote_plus(name)]) url = build_url(choice(self.list_hosts), path=path, params={'did_type': 'dataset'}) result = self._send_request(url) if result.status_code == codes.ok: locks = self._load_json_data(res...
Lock client class for working with rucio locks
LockClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LockClient: """Lock client class for working with rucio locks""" def get_dataset_locks(self, scope, name): """Get a dataset locks of the specified dataset. :param scope: the scope of the did of the locks to list. :param name: the name of the did of the locks to list.""" <|bod...
stack_v2_sparse_classes_75kplus_train_006772
3,973
permissive
[ { "docstring": "Get a dataset locks of the specified dataset. :param scope: the scope of the did of the locks to list. :param name: the name of the did of the locks to list.", "name": "get_dataset_locks", "signature": "def get_dataset_locks(self, scope, name)" }, { "docstring": "Get list of lock...
3
stack_v2_sparse_classes_30k_val_002530
Implement the Python class `LockClient` described below. Class description: Lock client class for working with rucio locks Method signatures and docstrings: - def get_dataset_locks(self, scope, name): Get a dataset locks of the specified dataset. :param scope: the scope of the did of the locks to list. :param name: t...
Implement the Python class `LockClient` described below. Class description: Lock client class for working with rucio locks Method signatures and docstrings: - def get_dataset_locks(self, scope, name): Get a dataset locks of the specified dataset. :param scope: the scope of the did of the locks to list. :param name: t...
7f0d229ac0b3bc7dec12c6e158bea2b82d414a3b
<|skeleton|> class LockClient: """Lock client class for working with rucio locks""" def get_dataset_locks(self, scope, name): """Get a dataset locks of the specified dataset. :param scope: the scope of the did of the locks to list. :param name: the name of the did of the locks to list.""" <|bod...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LockClient: """Lock client class for working with rucio locks""" def get_dataset_locks(self, scope, name): """Get a dataset locks of the specified dataset. :param scope: the scope of the did of the locks to list. :param name: the name of the did of the locks to list.""" path = '/'.join([s...
the_stack_v2_python_sparse
lib/rucio/client/lockclient.py
rucio/rucio
train
232
4c0e5a891da3bda7d3e16ed287e86cb1c7945509
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn BookingQuestionAnswer()", "from .answer_input_type import AnswerInputType\nfrom .answer_input_type import AnswerInputType\nfields: Dict[str, Callable[[Any], None]] = {'answer': lambda n: setattr(self, 'answer', n.get_str_value()), 'ans...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return BookingQuestionAnswer() <|end_body_0|> <|body_start_1|> from .answer_input_type import AnswerInputType from .answer_input_type import AnswerInputType fields: Dict[str, Callable[[...
BookingQuestionAnswer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BookingQuestionAnswer: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> BookingQuestionAnswer: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create th...
stack_v2_sparse_classes_75kplus_train_006773
4,360
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: BookingQuestionAnswer", "name": "create_from_discriminator_value", "signature": "def create_from_discriminat...
3
null
Implement the Python class `BookingQuestionAnswer` described below. Class description: Implement the BookingQuestionAnswer class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> BookingQuestionAnswer: Creates a new instance of the appropriate class base...
Implement the Python class `BookingQuestionAnswer` described below. Class description: Implement the BookingQuestionAnswer class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> BookingQuestionAnswer: Creates a new instance of the appropriate class base...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class BookingQuestionAnswer: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> BookingQuestionAnswer: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create th...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BookingQuestionAnswer: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> BookingQuestionAnswer: """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 Retur...
the_stack_v2_python_sparse
msgraph/generated/models/booking_question_answer.py
microsoftgraph/msgraph-sdk-python
train
135
74f152c6f1c0b1b497fec4f5b1185c1a4c3a4356
[ "user = request.user\nif user:\n ser = self.serializer_class(user)\n return Response({'data': ser.data}, status=status.HTTP_200_OK)\nelse:\n return Response({'status': status.HTTP_404_NOT_FOUND, 'error': 'User not found'})", "ser_params = self.serializer_class(data=request.data)\nser_params.is_valid(rais...
<|body_start_0|> user = request.user if user: ser = self.serializer_class(user) return Response({'data': ser.data}, status=status.HTTP_200_OK) else: return Response({'status': status.HTTP_404_NOT_FOUND, 'error': 'User not found'}) <|end_body_0|> <|body_start_...
AuthViewSet
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AuthViewSet: def user(self, request): """User profile information""" <|body_0|> def register(self, request): """User registration""" <|body_1|> <|end_skeleton|> <|body_start_0|> user = request.user if user: ser = self.serializer_...
stack_v2_sparse_classes_75kplus_train_006774
3,325
permissive
[ { "docstring": "User profile information", "name": "user", "signature": "def user(self, request)" }, { "docstring": "User registration", "name": "register", "signature": "def register(self, request)" } ]
2
stack_v2_sparse_classes_30k_train_004291
Implement the Python class `AuthViewSet` described below. Class description: Implement the AuthViewSet class. Method signatures and docstrings: - def user(self, request): User profile information - def register(self, request): User registration
Implement the Python class `AuthViewSet` described below. Class description: Implement the AuthViewSet class. Method signatures and docstrings: - def user(self, request): User profile information - def register(self, request): User registration <|skeleton|> class AuthViewSet: def user(self, request): ""...
05daac6bc1504658909dc396e48cc8100ec1747c
<|skeleton|> class AuthViewSet: def user(self, request): """User profile information""" <|body_0|> def register(self, request): """User registration""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AuthViewSet: def user(self, request): """User profile information""" user = request.user if user: ser = self.serializer_class(user) return Response({'data': ser.data}, status=status.HTTP_200_OK) else: return Response({'status': status.HTTP_40...
the_stack_v2_python_sparse
backend/authentication/views.py
vindem22/work-hour-registration
train
0
9056d142a8230576c88507feef5a07ff751284c2
[ "self.attributes = attributes\nself.end_time_seconds = end_time_seconds\nself.error_message = error_message\nself.events = events\nself.expected_end_time_seconds = expected_end_time_seconds\nself.expected_seconds_remaining = expected_seconds_remaining\nself.expected_total_work_count = expected_total_work_count\nsel...
<|body_start_0|> self.attributes = attributes self.end_time_seconds = end_time_seconds self.error_message = error_message self.events = events self.expected_end_time_seconds = expected_end_time_seconds self.expected_seconds_remaining = expected_seconds_remaining s...
Implementation of the 'Task' model. Specifies one task. Attributes: attributes (list of TaskAttribute): The latest attributes reported for this task. end_time_seconds (long|int): Specifies the end time of the task. error_message (string): Specifies an optional error message for this task. events (list of TaskEvent): Sp...
Task
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Task: """Implementation of the 'Task' model. Specifies one task. Attributes: attributes (list of TaskAttribute): The latest attributes reported for this task. end_time_seconds (long|int): Specifies the end time of the task. error_message (string): Specifies an optional error message for this task...
stack_v2_sparse_classes_75kplus_train_006775
6,432
permissive
[ { "docstring": "Constructor for the Task class", "name": "__init__", "signature": "def __init__(self, attributes=None, end_time_seconds=None, error_message=None, events=None, expected_end_time_seconds=None, expected_seconds_remaining=None, expected_total_work_count=None, last_update_time_seconds=None, p...
2
stack_v2_sparse_classes_30k_train_048428
Implement the Python class `Task` described below. Class description: Implementation of the 'Task' model. Specifies one task. Attributes: attributes (list of TaskAttribute): The latest attributes reported for this task. end_time_seconds (long|int): Specifies the end time of the task. error_message (string): Specifies ...
Implement the Python class `Task` described below. Class description: Implementation of the 'Task' model. Specifies one task. Attributes: attributes (list of TaskAttribute): The latest attributes reported for this task. end_time_seconds (long|int): Specifies the end time of the task. error_message (string): Specifies ...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class Task: """Implementation of the 'Task' model. Specifies one task. Attributes: attributes (list of TaskAttribute): The latest attributes reported for this task. end_time_seconds (long|int): Specifies the end time of the task. error_message (string): Specifies an optional error message for this task...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Task: """Implementation of the 'Task' model. Specifies one task. Attributes: attributes (list of TaskAttribute): The latest attributes reported for this task. end_time_seconds (long|int): Specifies the end time of the task. error_message (string): Specifies an optional error message for this task. events (lis...
the_stack_v2_python_sparse
cohesity_management_sdk/models/task.py
cohesity/management-sdk-python
train
24
3b4e9b2c326c5af7e7021de7d27af5a7d0f64da2
[ "if not s:\n return list([''])\nt = deque([s])\nn = len(s)\nfor i in range(0, n, 1):\n if s[i].isalpha():\n t = self.eval_char_loc(i, t)\nreturn list(t)", "if not t:\n return deque()\nm = len(t)\nfor j in range(0, m, 1):\n p = t.popleft()\n l = [p[:i], p[i].lower(), p[i + 1:]]\n t.append(...
<|body_start_0|> if not s: return list(['']) t = deque([s]) n = len(s) for i in range(0, n, 1): if s[i].isalpha(): t = self.eval_char_loc(i, t) return list(t) <|end_body_0|> <|body_start_1|> if not t: return deque() ...
Breadth first traversal (BFT) over all string permutations. Time complexity: O(2 ** n) - Iterate over all string permutations Space complexity: O(2 ** n) - Collect all string permutations
Solution
[ "Unlicense" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """Breadth first traversal (BFT) over all string permutations. Time complexity: O(2 ** n) - Iterate over all string permutations Space complexity: O(2 ** n) - Collect all string permutations""" def permute_letter_case(self, s): """Collects permutations with upper or lower c...
stack_v2_sparse_classes_75kplus_train_006776
2,508
permissive
[ { "docstring": "Collects permutations with upper or lower case alphabetical characters. :param str s: input string :return: list of all string permutations :rtype: list[str]", "name": "permute_letter_case", "signature": "def permute_letter_case(self, s)" }, { "docstring": "Evaluates collected pe...
2
null
Implement the Python class `Solution` described below. Class description: Breadth first traversal (BFT) over all string permutations. Time complexity: O(2 ** n) - Iterate over all string permutations Space complexity: O(2 ** n) - Collect all string permutations Method signatures and docstrings: - def permute_letter_c...
Implement the Python class `Solution` described below. Class description: Breadth first traversal (BFT) over all string permutations. Time complexity: O(2 ** n) - Iterate over all string permutations Space complexity: O(2 ** n) - Collect all string permutations Method signatures and docstrings: - def permute_letter_c...
69f90877c5466927e8b081c4268cbcda074813ec
<|skeleton|> class Solution: """Breadth first traversal (BFT) over all string permutations. Time complexity: O(2 ** n) - Iterate over all string permutations Space complexity: O(2 ** n) - Collect all string permutations""" def permute_letter_case(self, s): """Collects permutations with upper or lower c...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: """Breadth first traversal (BFT) over all string permutations. Time complexity: O(2 ** n) - Iterate over all string permutations Space complexity: O(2 ** n) - Collect all string permutations""" def permute_letter_case(self, s): """Collects permutations with upper or lower case alphabeti...
the_stack_v2_python_sparse
0784_letter_case_permutation/python_source.py
arthurdysart/LeetCode
train
0
a9effcece3f7f39023ef30c09776734e83b61200
[ "self.name = 'ext_term'\nself.num_epoch = num_epoch\nself.fLog = open(save_path + '/outputTraining.csv', 'w')\nself.fLog.write(header)", "log = mainloop.trainlog\noutput_channel = [out.name for out in mainloop.outputs]\nself.fLog.write('{},'.format(log.epoch_seen))\nfor i, out in enumerate(output_channel):\n t...
<|body_start_0|> self.name = 'ext_term' self.num_epoch = num_epoch self.fLog = open(save_path + '/outputTraining.csv', 'w') self.fLog.write(header) <|end_body_0|> <|body_start_1|> log = mainloop.trainlog output_channel = [out.name for out in mainloop.outputs] sel...
EpochCount
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EpochCount: def __init__(self, num_epoch, save_path, header): """.. todo:: WRITEME""" <|body_0|> def exe(self, mainloop): """.. todo:: WRITEME""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.name = 'ext_term' self.num_epoch = num_epoch ...
stack_v2_sparse_classes_75kplus_train_006777
19,556
no_license
[ { "docstring": ".. todo:: WRITEME", "name": "__init__", "signature": "def __init__(self, num_epoch, save_path, header)" }, { "docstring": ".. todo:: WRITEME", "name": "exe", "signature": "def exe(self, mainloop)" } ]
2
stack_v2_sparse_classes_30k_train_034727
Implement the Python class `EpochCount` described below. Class description: Implement the EpochCount class. Method signatures and docstrings: - def __init__(self, num_epoch, save_path, header): .. todo:: WRITEME - def exe(self, mainloop): .. todo:: WRITEME
Implement the Python class `EpochCount` described below. Class description: Implement the EpochCount class. Method signatures and docstrings: - def __init__(self, num_epoch, save_path, header): .. todo:: WRITEME - def exe(self, mainloop): .. todo:: WRITEME <|skeleton|> class EpochCount: def __init__(self, num_e...
d4bc620278f3a4ce33521f23c6632ab512a38de9
<|skeleton|> class EpochCount: def __init__(self, num_epoch, save_path, header): """.. todo:: WRITEME""" <|body_0|> def exe(self, mainloop): """.. todo:: WRITEME""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class EpochCount: def __init__(self, num_epoch, save_path, header): """.. todo:: WRITEME""" self.name = 'ext_term' self.num_epoch = num_epoch self.fLog = open(save_path + '/outputTraining.csv', 'w') self.fLog.write(header) def exe(self, mainloop): """.. todo:: WR...
the_stack_v2_python_sparse
auxiliar-libraries/cle/cle/train/ext.py
oneway3124/disaggregation-vrnn
train
0
a61acef0341ef1e902641da8ed0a0506f5334f30
[ "job_log = JobLog.get(job_id=job_id)\nif not job_log:\n job_log = JobLog(job_id=job_id)\njob_log.last_run = datetime.utcnow()\ncommit()", "job_log = JobLog.get(job_id=job_id)\nif not job_log:\n return False\nreturn job_log.last_run > datetime.utcnow() - timedelta(minutes=recent_minutes)" ]
<|body_start_0|> job_log = JobLog.get(job_id=job_id) if not job_log: job_log = JobLog(job_id=job_id) job_log.last_run = datetime.utcnow() commit() <|end_body_0|> <|body_start_1|> job_log = JobLog.get(job_id=job_id) if not job_log: return False ...
JobLogService
[ "LicenseRef-scancode-warranty-disclaimer" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JobLogService: def update_job_log(self, job_id): """Updates the last run datetime of a specific job""" <|body_0|> def has_run_recently(self, job_id, recent_minutes=5): """:returns True if specified job has been run in the last recent_minutes minutes, False if not""" ...
stack_v2_sparse_classes_75kplus_train_006778
923
no_license
[ { "docstring": "Updates the last run datetime of a specific job", "name": "update_job_log", "signature": "def update_job_log(self, job_id)" }, { "docstring": ":returns True if specified job has been run in the last recent_minutes minutes, False if not", "name": "has_run_recently", "signa...
2
stack_v2_sparse_classes_30k_train_048686
Implement the Python class `JobLogService` described below. Class description: Implement the JobLogService class. Method signatures and docstrings: - def update_job_log(self, job_id): Updates the last run datetime of a specific job - def has_run_recently(self, job_id, recent_minutes=5): :returns True if specified job...
Implement the Python class `JobLogService` described below. Class description: Implement the JobLogService class. Method signatures and docstrings: - def update_job_log(self, job_id): Updates the last run datetime of a specific job - def has_run_recently(self, job_id, recent_minutes=5): :returns True if specified job...
d1be650663224c24b41f675627fff37dfdbcde97
<|skeleton|> class JobLogService: def update_job_log(self, job_id): """Updates the last run datetime of a specific job""" <|body_0|> def has_run_recently(self, job_id, recent_minutes=5): """:returns True if specified job has been run in the last recent_minutes minutes, False if not""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class JobLogService: def update_job_log(self, job_id): """Updates the last run datetime of a specific job""" job_log = JobLog.get(job_id=job_id) if not job_log: job_log = JobLog(job_id=job_id) job_log.last_run = datetime.utcnow() commit() def has_run_recently...
the_stack_v2_python_sparse
components/core/job_log_service.py
jbinder/doforme-bot
train
7
ca0b3e85fbcdf38c17cf9450ed4ba8159bddd551
[ "if instance is None:\n return self\nvalue = instance._new_values.get(self.field.attname, instance._values.get(self.field.attname))\nreturn value", "if instance is None:\n raise Exception()\nif value is not None:\n instance._new_values[self.field.attname] = value" ]
<|body_start_0|> if instance is None: return self value = instance._new_values.get(self.field.attname, instance._values.get(self.field.attname)) return value <|end_body_0|> <|body_start_1|> if instance is None: raise Exception() if value is not None: ...
docstring for StringObject
StringObject
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StringObject: """docstring for StringObject""" def __get__(self, instance, instance_type=None): """docstring for __get__""" <|body_0|> def __set__(self, instance, value): """docstring for __set__""" <|body_1|> <|end_skeleton|> <|body_start_0|> i...
stack_v2_sparse_classes_75kplus_train_006779
907
no_license
[ { "docstring": "docstring for __get__", "name": "__get__", "signature": "def __get__(self, instance, instance_type=None)" }, { "docstring": "docstring for __set__", "name": "__set__", "signature": "def __set__(self, instance, value)" } ]
2
stack_v2_sparse_classes_30k_train_016065
Implement the Python class `StringObject` described below. Class description: docstring for StringObject Method signatures and docstrings: - def __get__(self, instance, instance_type=None): docstring for __get__ - def __set__(self, instance, value): docstring for __set__
Implement the Python class `StringObject` described below. Class description: docstring for StringObject Method signatures and docstrings: - def __get__(self, instance, instance_type=None): docstring for __get__ - def __set__(self, instance, value): docstring for __set__ <|skeleton|> class StringObject: """docst...
bdcc87a177f0ce5c292e1624e82fd61a71b1891f
<|skeleton|> class StringObject: """docstring for StringObject""" def __get__(self, instance, instance_type=None): """docstring for __get__""" <|body_0|> def __set__(self, instance, value): """docstring for __set__""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class StringObject: """docstring for StringObject""" def __get__(self, instance, instance_type=None): """docstring for __get__""" if instance is None: return self value = instance._new_values.get(self.field.attname, instance._values.get(self.field.attname)) return va...
the_stack_v2_python_sparse
tornado_reloaded/db/orm/documents/fields/virtual.py
ohardy/tornado-reloaded
train
0
be16b5eee522ced4ec82c18cc6d43d5fa16dd5b2
[ "super().__init__(**kwds)\nself._slaveWidgets = []\nself._slaveStateWhenMasterIsEnabled = {}\nself._isInMutexGroup = isInMutexGroup", "self._slaveWidgets.append(slaveWidget)\nself._slaveStateWhenMasterIsEnabled[slaveWidget] = isEnabledWhenMasterIsEnabled\nif self.isChecked():\n slaveWidget.setEnabled(self._sla...
<|body_start_0|> super().__init__(**kwds) self._slaveWidgets = [] self._slaveStateWhenMasterIsEnabled = {} self._isInMutexGroup = isInMutexGroup <|end_body_0|> <|body_start_1|> self._slaveWidgets.append(slaveWidget) self._slaveStateWhenMasterIsEnabled[slaveWidget] = isEn...
This abstract class defines a checkbox widget that will disable slave widgets depending on the value of the master widget
NzQDisablingWidget
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NzQDisablingWidget: """This abstract class defines a checkbox widget that will disable slave widgets depending on the value of the master widget""" def __init__(self, isInMutexGroup=False, **kwds): """The class constructor @param[in] _isInMutexGroup bool: To define if the button is p...
stack_v2_sparse_classes_75kplus_train_006780
4,506
no_license
[ { "docstring": "The class constructor @param[in] _isInMutexGroup bool: To define if the button is part of a group of buttons that are mutually exclusive @param[in] kwds** Other parameters are sent to base class constructor", "name": "__init__", "signature": "def __init__(self, isInMutexGroup=False, **kw...
4
stack_v2_sparse_classes_30k_train_054130
Implement the Python class `NzQDisablingWidget` described below. Class description: This abstract class defines a checkbox widget that will disable slave widgets depending on the value of the master widget Method signatures and docstrings: - def __init__(self, isInMutexGroup=False, **kwds): The class constructor @par...
Implement the Python class `NzQDisablingWidget` described below. Class description: This abstract class defines a checkbox widget that will disable slave widgets depending on the value of the master widget Method signatures and docstrings: - def __init__(self, isInMutexGroup=False, **kwds): The class constructor @par...
08bbe9bdf98d9142c2a641ce46947b2e393f8cd6
<|skeleton|> class NzQDisablingWidget: """This abstract class defines a checkbox widget that will disable slave widgets depending on the value of the master widget""" def __init__(self, isInMutexGroup=False, **kwds): """The class constructor @param[in] _isInMutexGroup bool: To define if the button is p...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class NzQDisablingWidget: """This abstract class defines a checkbox widget that will disable slave widgets depending on the value of the master widget""" def __init__(self, isInMutexGroup=False, **kwds): """The class constructor @param[in] _isInMutexGroup bool: To define if the button is part of a grou...
the_stack_v2_python_sparse
vlc_transcoder/NzPyQtToolBox/NzQDisablingWidgets.py
Plouff/VlcTranscoderGui
train
0
d05b7d479a15542f846fef1c9e5247ef2456a926
[ "if not root:\n return 0\nelif not root.left:\n return self.minDepth(root.right) + 1\nelif not root.right:\n return self.minDepth(root.left) + 1\nelse:\n return min(self.minDepth(root.left), self.minDepth(root.right)) + 1", "if not root:\n return 0\nd = deque([(1, root)])\nwhile d:\n height, roo...
<|body_start_0|> if not root: return 0 elif not root.left: return self.minDepth(root.right) + 1 elif not root.right: return self.minDepth(root.left) + 1 else: return min(self.minDepth(root.left), self.minDepth(root.right)) + 1 <|end_body_0|...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def minDepth(self, root): """:type root: TreeNode :rtype: int""" <|body_0|> def minDepthBFS(self, root): """:type root: TreeNode :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not root: return 0 elif not...
stack_v2_sparse_classes_75kplus_train_006781
1,369
no_license
[ { "docstring": ":type root: TreeNode :rtype: int", "name": "minDepth", "signature": "def minDepth(self, root)" }, { "docstring": ":type root: TreeNode :rtype: int", "name": "minDepthBFS", "signature": "def minDepthBFS(self, root)" } ]
2
stack_v2_sparse_classes_30k_train_030192
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minDepth(self, root): :type root: TreeNode :rtype: int - def minDepthBFS(self, root): :type root: TreeNode :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def minDepth(self, root): :type root: TreeNode :rtype: int - def minDepthBFS(self, root): :type root: TreeNode :rtype: int <|skeleton|> class Solution: def minDepth(self, r...
1c584f4ca4cda7a3fb3148801a1ff4c73befed24
<|skeleton|> class Solution: def minDepth(self, root): """:type root: TreeNode :rtype: int""" <|body_0|> def minDepthBFS(self, root): """:type root: TreeNode :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def minDepth(self, root): """:type root: TreeNode :rtype: int""" if not root: return 0 elif not root.left: return self.minDepth(root.right) + 1 elif not root.right: return self.minDepth(root.left) + 1 else: retur...
the_stack_v2_python_sparse
Trees/minDepth.py
kqg13/LeetCode
train
0
b6d751bee3e871bce59453d32b8c4bb19b1aa645
[ "self.parser = reqparse.RequestParser()\nself.parser.add_argument('token')\nsuper(Position, self).__init__()", "args = self.parser.parse_args()\ntoken = args['token']\ndata = me.getAllPositions()\nprint(data)\nl = [o.__dict__ for o in data]\nreturn {'result_code': 'success', 'data': l}" ]
<|body_start_0|> self.parser = reqparse.RequestParser() self.parser.add_argument('token') super(Position, self).__init__() <|end_body_0|> <|body_start_1|> args = self.parser.parse_args() token = args['token'] data = me.getAllPositions() print(data) l = [o...
持仓
Position
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Position: """持仓""" def __init__(self): """初始化""" <|body_0|> def get(self): """查询""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.parser = reqparse.RequestParser() self.parser.add_argument('token') super(Position, self).__ini...
stack_v2_sparse_classes_75kplus_train_006782
24,002
permissive
[ { "docstring": "初始化", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "查询", "name": "get", "signature": "def get(self)" } ]
2
stack_v2_sparse_classes_30k_train_049959
Implement the Python class `Position` described below. Class description: 持仓 Method signatures and docstrings: - def __init__(self): 初始化 - def get(self): 查询
Implement the Python class `Position` described below. Class description: 持仓 Method signatures and docstrings: - def __init__(self): 初始化 - def get(self): 查询 <|skeleton|> class Position: """持仓""" def __init__(self): """初始化""" <|body_0|> def get(self): """查询""" <|body_1|> ...
c316649161086da2543d39bf0455d0f793cdd08f
<|skeleton|> class Position: """持仓""" def __init__(self): """初始化""" <|body_0|> def get(self): """查询""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Position: """持仓""" def __init__(self): """初始化""" self.parser = reqparse.RequestParser() self.parser.add_argument('token') super(Position, self).__init__() def get(self): """查询""" args = self.parser.parse_args() token = args['token'] dat...
the_stack_v2_python_sparse
WebTrader/webServer.py
webclinic017/riskBacktestingPlatform
train
0
8fdc35bf992eeb7d3798c4b46372fbe5127b91b1
[ "self.max_length = 0\nself.sequence_length_histogram = np.zeros(0, dtype=np.int32)\nsuper(BinaryProcessor, self).__init__(conf)", "split = dataline.split(' ')\nseq_length = len(split)\nbinary = np.array(map(int, split)).astype(np.uint8)\nif self.conf['max_length'] != 'None':\n max_length = int(self.conf['max_l...
<|body_start_0|> self.max_length = 0 self.sequence_length_histogram = np.zeros(0, dtype=np.int32) super(BinaryProcessor, self).__init__(conf) <|end_body_0|> <|body_start_1|> split = dataline.split(' ') seq_length = len(split) binary = np.array(map(int, split)).astype(np....
a processor for text data, does normalization
BinaryProcessor
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BinaryProcessor: """a processor for text data, does normalization""" def __init__(self, conf): """TextProcessor constructor Args: conf: processor configuration as a configparser""" <|body_0|> def __call__(self, dataline): """process the data in dataline Args: dat...
stack_v2_sparse_classes_75kplus_train_006783
2,072
permissive
[ { "docstring": "TextProcessor constructor Args: conf: processor configuration as a configparser", "name": "__init__", "signature": "def __init__(self, conf)" }, { "docstring": "process the data in dataline Args: dataline: a line of text Returns: The binary data as an array", "name": "__call_...
3
stack_v2_sparse_classes_30k_train_001612
Implement the Python class `BinaryProcessor` described below. Class description: a processor for text data, does normalization Method signatures and docstrings: - def __init__(self, conf): TextProcessor constructor Args: conf: processor configuration as a configparser - def __call__(self, dataline): process the data ...
Implement the Python class `BinaryProcessor` described below. Class description: a processor for text data, does normalization Method signatures and docstrings: - def __init__(self, conf): TextProcessor constructor Args: conf: processor configuration as a configparser - def __call__(self, dataline): process the data ...
313018a46f68cec1d4a7eb15b8b1cf68111a959c
<|skeleton|> class BinaryProcessor: """a processor for text data, does normalization""" def __init__(self, conf): """TextProcessor constructor Args: conf: processor configuration as a configparser""" <|body_0|> def __call__(self, dataline): """process the data in dataline Args: dat...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BinaryProcessor: """a processor for text data, does normalization""" def __init__(self, conf): """TextProcessor constructor Args: conf: processor configuration as a configparser""" self.max_length = 0 self.sequence_length_histogram = np.zeros(0, dtype=np.int32) super(Binar...
the_stack_v2_python_sparse
nabu/processing/processors/binary_processor.py
ishandutta2007/nabu
train
0
080bd79d5fcd19be00bbec3eb56d01260b5511b9
[ "data = Brand.objects.all()\nser = BrandsSerializer(data, many=True)\nreturn Response(ser.data)", "category = GoodsCategory.objects.filter(parent=None)\nser = CategoriesSerializer(category, many=True)\nreturn Response(ser.data)", "category = GoodsCategory.objects.get(pk=pk)\nser = CategorieSerializer(category)\...
<|body_start_0|> data = Brand.objects.all() ser = BrandsSerializer(data, many=True) return Response(ser.data) <|end_body_0|> <|body_start_1|> category = GoodsCategory.objects.filter(parent=None) ser = CategoriesSerializer(category, many=True) return Response(ser.data) <|...
规格商品的增删改查
SPUViewSet
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SPUViewSet: """规格商品的增删改查""" def simple(self, request): """查询品牌信息""" <|body_0|> def get_category(self, request): """查询一级分类ID""" <|body_1|> def get_categories(self, request, pk): """查询二级分类ID""" <|body_2|> <|end_skeleton|> <|body_start...
stack_v2_sparse_classes_75kplus_train_006784
1,574
permissive
[ { "docstring": "查询品牌信息", "name": "simple", "signature": "def simple(self, request)" }, { "docstring": "查询一级分类ID", "name": "get_category", "signature": "def get_category(self, request)" }, { "docstring": "查询二级分类ID", "name": "get_categories", "signature": "def get_categorie...
3
null
Implement the Python class `SPUViewSet` described below. Class description: 规格商品的增删改查 Method signatures and docstrings: - def simple(self, request): 查询品牌信息 - def get_category(self, request): 查询一级分类ID - def get_categories(self, request, pk): 查询二级分类ID
Implement the Python class `SPUViewSet` described below. Class description: 规格商品的增删改查 Method signatures and docstrings: - def simple(self, request): 查询品牌信息 - def get_category(self, request): 查询一级分类ID - def get_categories(self, request, pk): 查询二级分类ID <|skeleton|> class SPUViewSet: """规格商品的增删改查""" def simple(...
2434231795b3319dfda60b19af18442ee5f6fa73
<|skeleton|> class SPUViewSet: """规格商品的增删改查""" def simple(self, request): """查询品牌信息""" <|body_0|> def get_category(self, request): """查询一级分类ID""" <|body_1|> def get_categories(self, request, pk): """查询二级分类ID""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SPUViewSet: """规格商品的增删改查""" def simple(self, request): """查询品牌信息""" data = Brand.objects.all() ser = BrandsSerializer(data, many=True) return Response(ser.data) def get_category(self, request): """查询一级分类ID""" category = GoodsCategory.objects.filter(par...
the_stack_v2_python_sparse
meiduo_project/meiduo_mall/meiduo_mall/apps/meiduo_admin/views/spus.py
xlztongxue/meiduoshangcheng
train
0
ffd2fd90891382dbdac94833ab7b1ceb9b18bbfb
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn PropertyRule()", "from ..binary_operator import BinaryOperator\nfrom .rule_operation import RuleOperation\nfrom ..binary_operator import BinaryOperator\nfrom .rule_operation import RuleOperation\nfields: Dict[str, Callable[[Any], None]...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return PropertyRule() <|end_body_0|> <|body_start_1|> from ..binary_operator import BinaryOperator from .rule_operation import RuleOperation from ..binary_operator import BinaryOperator...
PropertyRule
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PropertyRule: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PropertyRule: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: ...
stack_v2_sparse_classes_75kplus_train_006785
3,656
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: PropertyRule", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value(...
3
stack_v2_sparse_classes_30k_train_003338
Implement the Python class `PropertyRule` described below. Class description: Implement the PropertyRule class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PropertyRule: Creates a new instance of the appropriate class based on discriminator value Ar...
Implement the Python class `PropertyRule` described below. Class description: Implement the PropertyRule class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PropertyRule: Creates a new instance of the appropriate class based on discriminator value Ar...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class PropertyRule: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PropertyRule: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PropertyRule: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PropertyRule: """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: PropertyRule""...
the_stack_v2_python_sparse
msgraph/generated/models/external_connectors/property_rule.py
microsoftgraph/msgraph-sdk-python
train
135
e6d556866429c2b69668e852169dace2e23259b8
[ "if get_size:\n log.info('%s: %s - %s', name, X.shape, self._size(X))\nelse:\n log.info('%s: %s', name, X.shape)", "s = 1\nfor v in X.shape[1:]:\n s = s * v\nreturn s" ]
<|body_start_0|> if get_size: log.info('%s: %s - %s', name, X.shape, self._size(X)) else: log.info('%s: %s', name, X.shape) <|end_body_0|> <|body_start_1|> s = 1 for v in X.shape[1:]: s = s * v return s <|end_body_1|>
Mixin class for autoencoders.
MixinAE
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MixinAE: """Mixin class for autoencoders.""" def _info(self, name, X, get_size=True): """Log the shape information about the current tensor. Parameters ---------- name: str Id of the step. X: torch.Tensor The tensor to analyse. get_size: bool If `True` the total number of parameters ...
stack_v2_sparse_classes_75kplus_train_006786
11,241
permissive
[ { "docstring": "Log the shape information about the current tensor. Parameters ---------- name: str Id of the step. X: torch.Tensor The tensor to analyse. get_size: bool If `True` the total number of parameters will be computed.", "name": "_info", "signature": "def _info(self, name, X, get_size=True)" ...
2
stack_v2_sparse_classes_30k_train_023113
Implement the Python class `MixinAE` described below. Class description: Mixin class for autoencoders. Method signatures and docstrings: - def _info(self, name, X, get_size=True): Log the shape information about the current tensor. Parameters ---------- name: str Id of the step. X: torch.Tensor The tensor to analyse....
Implement the Python class `MixinAE` described below. Class description: Mixin class for autoencoders. Method signatures and docstrings: - def _info(self, name, X, get_size=True): Log the shape information about the current tensor. Parameters ---------- name: str Id of the step. X: torch.Tensor The tensor to analyse....
01b4a45e3d7361d71f1a4bfee19ccb4e7d1fef3c
<|skeleton|> class MixinAE: """Mixin class for autoencoders.""" def _info(self, name, X, get_size=True): """Log the shape information about the current tensor. Parameters ---------- name: str Id of the step. X: torch.Tensor The tensor to analyse. get_size: bool If `True` the total number of parameters ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MixinAE: """Mixin class for autoencoders.""" def _info(self, name, X, get_size=True): """Log the shape information about the current tensor. Parameters ---------- name: str Id of the step. X: torch.Tensor The tensor to analyse. get_size: bool If `True` the total number of parameters will be compu...
the_stack_v2_python_sparse
AutoEncoders.py
AliceAdenis/paintautoencs
train
0
195ea0ab90fd2ee539ea25d9ed1cc1d9affc1563
[ "grouped = []\nif strs:\n grouped.append([strs.pop(0)])\n for anagram in strs:\n hasGroup = False\n for group in grouped:\n if self.areAnagrams(anagram, group[0]):\n group.append(anagram)\n hasGroup = True\n break\n if not hasGroup:\...
<|body_start_0|> grouped = [] if strs: grouped.append([strs.pop(0)]) for anagram in strs: hasGroup = False for group in grouped: if self.areAnagrams(anagram, group[0]): group.append(anagram) ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def groupAnagrams(self, strs): """Groups anagrams together :type strs: List[str] :rtype: List[List[str]]""" <|body_0|> def areAnagrams(self, A1, A2): """Compares to strings to check if anagrams :type A1: string :type A2: string :rtype: boolean""" <|...
stack_v2_sparse_classes_75kplus_train_006787
2,145
no_license
[ { "docstring": "Groups anagrams together :type strs: List[str] :rtype: List[List[str]]", "name": "groupAnagrams", "signature": "def groupAnagrams(self, strs)" }, { "docstring": "Compares to strings to check if anagrams :type A1: string :type A2: string :rtype: boolean", "name": "areAnagrams"...
2
stack_v2_sparse_classes_30k_train_019765
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def groupAnagrams(self, strs): Groups anagrams together :type strs: List[str] :rtype: List[List[str]] - def areAnagrams(self, A1, A2): Compares to strings to check if anagrams :t...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def groupAnagrams(self, strs): Groups anagrams together :type strs: List[str] :rtype: List[List[str]] - def areAnagrams(self, A1, A2): Compares to strings to check if anagrams :t...
308889e57e71c369aa8516fba8a2064f6a26abee
<|skeleton|> class Solution: def groupAnagrams(self, strs): """Groups anagrams together :type strs: List[str] :rtype: List[List[str]]""" <|body_0|> def areAnagrams(self, A1, A2): """Compares to strings to check if anagrams :type A1: string :type A2: string :rtype: boolean""" <|...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def groupAnagrams(self, strs): """Groups anagrams together :type strs: List[str] :rtype: List[List[str]]""" grouped = [] if strs: grouped.append([strs.pop(0)]) for anagram in strs: hasGroup = False for group in grouped: ...
the_stack_v2_python_sparse
leet_49.py
mike-jolliffe/Learning
train
0
891ed06d4fc182583730bf571ab02d7aae98f228
[ "if slice_hrn:\n self.slice_hrn = slice_hrn\nif experiment_id:\n self.experiment_id = experiment_id\nif end_time:\n self.end_time = end_time", "result = '<lease_table : slice_hrn = %s , experiment_id %s end_time = %s' % (self.slice_hrn, self.experiment_id, self.end_time)\nresult += '>'\nretur...
<|body_start_0|> if slice_hrn: self.slice_hrn = slice_hrn if experiment_id: self.experiment_id = experiment_id if end_time: self.end_time = end_time <|end_body_0|> <|body_start_1|> result = '<lease_table : slice_hrn = %s , experiment_id %s ...
SQL alchemy class to manipulate the rows of the lease_table table in the SFA database. Handles the records representation and creates. Table creation is made by the importer if it is not in the database yet. .. seealso:: init_tables in model.py, run in iotlabimporter.py
LeaseTableXP
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LeaseTableXP: """SQL alchemy class to manipulate the rows of the lease_table table in the SFA database. Handles the records representation and creates. Table creation is made by the importer if it is not in the database yet. .. seealso:: init_tables in model.py, run in iotlabimporter.py""" d...
stack_v2_sparse_classes_75kplus_train_006788
1,466
no_license
[ { "docstring": "Defines a row of the lease_table table", "name": "__init__", "signature": "def __init__(self, slice_hrn=None, experiment_id=None, end_time=None)" }, { "docstring": "Prints the SQLAlchemy record to the format defined by the function.", "name": "__repr__", "signature": "def...
2
stack_v2_sparse_classes_30k_train_035367
Implement the Python class `LeaseTableXP` described below. Class description: SQL alchemy class to manipulate the rows of the lease_table table in the SFA database. Handles the records representation and creates. Table creation is made by the importer if it is not in the database yet. .. seealso:: init_tables in model...
Implement the Python class `LeaseTableXP` described below. Class description: SQL alchemy class to manipulate the rows of the lease_table table in the SFA database. Handles the records representation and creates. Table creation is made by the importer if it is not in the database yet. .. seealso:: init_tables in model...
424616cc2d392aacc0c066fb989406fe2eb8d44d
<|skeleton|> class LeaseTableXP: """SQL alchemy class to manipulate the rows of the lease_table table in the SFA database. Handles the records representation and creates. Table creation is made by the importer if it is not in the database yet. .. seealso:: init_tables in model.py, run in iotlabimporter.py""" d...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LeaseTableXP: """SQL alchemy class to manipulate the rows of the lease_table table in the SFA database. Handles the records representation and creates. Table creation is made by the importer if it is not in the database yet. .. seealso:: init_tables in model.py, run in iotlabimporter.py""" def __init__(s...
the_stack_v2_python_sparse
sfa/sfa/iotlab/iotlabpostgres.py
gnogueras/sfa
train
0
2bec81149662312e79c4bf490537b81533701d67
[ "def _commands_help(topic):\n com = obj.get('endroid.plugins.command')\n return com._help_main(topic, plugin=obj)\nif not 'commands' in obj._help_topics:\n setattr(obj, 'help_topics', {'commands': _commands_help})\nreturn obj._help_topics", "topics = obj._help_topics.copy()\ntopics.update(value)\nobj._he...
<|body_start_0|> def _commands_help(topic): com = obj.get('endroid.plugins.command') return com._help_main(topic, plugin=obj) if not 'commands' in obj._help_topics: setattr(obj, 'help_topics', {'commands': _commands_help}) return obj._help_topics <|end_body_0|...
Descriptor to handle auto-updating of the help_topics. This is required if a plugin doesn't just define its help_topics at the class level, and instead sets it during its initialisation. This descriptor will update the help_topics instead of replacing them when set.
_Topics
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _Topics: """Descriptor to handle auto-updating of the help_topics. This is required if a plugin doesn't just define its help_topics at the class level, and instead sets it during its initialisation. This descriptor will update the help_topics instead of replacing them when set.""" def __get_...
stack_v2_sparse_classes_75kplus_train_006789
13,347
no_license
[ { "docstring": "As well as fetching the help_topics (from the _help_topics field), this also injects the 'commands' entry into topics. It is done here, as this is the first point at which we have an instance of the plugin (needed to do the filtering later when displaying the help). Moral of the story: injecting...
2
stack_v2_sparse_classes_30k_train_042813
Implement the Python class `_Topics` described below. Class description: Descriptor to handle auto-updating of the help_topics. This is required if a plugin doesn't just define its help_topics at the class level, and instead sets it during its initialisation. This descriptor will update the help_topics instead of repl...
Implement the Python class `_Topics` described below. Class description: Descriptor to handle auto-updating of the help_topics. This is required if a plugin doesn't just define its help_topics at the class level, and instead sets it during its initialisation. This descriptor will update the help_topics instead of repl...
26e19a67551c0524186c096439c33eaa003c8f20
<|skeleton|> class _Topics: """Descriptor to handle auto-updating of the help_topics. This is required if a plugin doesn't just define its help_topics at the class level, and instead sets it during its initialisation. This descriptor will update the help_topics instead of replacing them when set.""" def __get_...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class _Topics: """Descriptor to handle auto-updating of the help_topics. This is required if a plugin doesn't just define its help_topics at the class level, and instead sets it during its initialisation. This descriptor will update the help_topics instead of replacing them when set.""" def __get__(self, obj, ...
the_stack_v2_python_sparse
src/endroid/plugins/command.py
ensoft/endroid
train
0
b6778c6aa65d4e23a684bd278a51c00b4fe8e3c4
[ "post_body = json.dumps({'OS-KSADM:service': kwargs})\nresp, body = self.post('/OS-KSADM/services', post_body)\nself.expected_success(200, resp.status)\nbody = json.loads(body)\nreturn rest_client.ResponseBody(resp, body)", "url = '/OS-KSADM/services/%s' % service_id\nresp, body = self.get(url)\nself.expected_suc...
<|body_start_0|> post_body = json.dumps({'OS-KSADM:service': kwargs}) resp, body = self.post('/OS-KSADM/services', post_body) self.expected_success(200, resp.status) body = json.loads(body) return rest_client.ResponseBody(resp, body) <|end_body_0|> <|body_start_1|> url =...
ServicesClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ServicesClient: def create_service(self, **kwargs): """Create a service. For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/identity/v2-ext/#create-service-admin-extension""" <|body_0|> def show_service(sel...
stack_v2_sparse_classes_75kplus_train_006790
2,419
permissive
[ { "docstring": "Create a service. For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/identity/v2-ext/#create-service-admin-extension", "name": "create_service", "signature": "def create_service(self, **kwargs)" }, { "docstring"...
4
stack_v2_sparse_classes_30k_train_036173
Implement the Python class `ServicesClient` described below. Class description: Implement the ServicesClient class. Method signatures and docstrings: - def create_service(self, **kwargs): Create a service. For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/...
Implement the Python class `ServicesClient` described below. Class description: Implement the ServicesClient class. Method signatures and docstrings: - def create_service(self, **kwargs): Create a service. For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/...
3932a799e620a20d7abf7b89e21b520683a1809b
<|skeleton|> class ServicesClient: def create_service(self, **kwargs): """Create a service. For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/identity/v2-ext/#create-service-admin-extension""" <|body_0|> def show_service(sel...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ServicesClient: def create_service(self, **kwargs): """Create a service. For a full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/identity/v2-ext/#create-service-admin-extension""" post_body = json.dumps({'OS-KSADM:service': kwargs...
the_stack_v2_python_sparse
tempest/lib/services/identity/v2/services_client.py
openstack/tempest
train
270
f7480e71fa8ee1ff0e6b60d4eb1a71cd28c036cb
[ "if not root:\n return 'None'\nreturn str(root.val) + ',' + self.serialize(root.left) + ',' + self.serialize(root.right)", "s = data.split(',')\n\ndef helper(s):\n num = s.pop(0)\n if num == 'None':\n return None\n root = TreeNode(num)\n root.left = helper(s)\n root.right = helper(s)\n ...
<|body_start_0|> if not root: return 'None' return str(root.val) + ',' + self.serialize(root.left) + ',' + self.serialize(root.right) <|end_body_0|> <|body_start_1|> s = data.split(',') def helper(s): num = s.pop(0) if num == 'None': ...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_75kplus_train_006791
1,484
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
stack_v2_sparse_classes_30k_train_017929
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
882724c8d50b2f21193c81e5072c31385c5e6b8e
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" if not root: return 'None' return str(root.val) + ',' + self.serialize(root.left) + ',' + self.serialize(root.right) def deserialize(self, data): """Deco...
the_stack_v2_python_sparse
297. Serialize and Deserialize Binary Tree.py
QIAOZHIBAO0104/My-Leetcode-Records
train
0
5ff511d6093794ae4abf074644588086da27c24e
[ "if id is not None:\n self.id = id\nelse:\n Base.__nb_objects += 1\n self.id = Base.__nb_objects", "if list_dictionaries:\n return json.dumps(list_dictionaries)\nelse:\n return '[]'", "if list_objs:\n n_list = [items.to_dictionary() for items in list_objs]\nelse:\n n_list = []\nfile_name = ...
<|body_start_0|> if id is not None: self.id = id else: Base.__nb_objects += 1 self.id = Base.__nb_objects <|end_body_0|> <|body_start_1|> if list_dictionaries: return json.dumps(list_dictionaries) else: return '[]' <|end_body_1...
[summary] Returns: [type]: [description]
Base
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Base: """[summary] Returns: [type]: [description]""" def __init__(self, id=None): """[summary] Args: id ([type], optional): [description]. Defaults to None.""" <|body_0|> def to_json_string(list_dictionaries): """[summary] Args: list_dictionaries ([type]): [descr...
stack_v2_sparse_classes_75kplus_train_006792
2,275
no_license
[ { "docstring": "[summary] Args: id ([type], optional): [description]. Defaults to None.", "name": "__init__", "signature": "def __init__(self, id=None)" }, { "docstring": "[summary] Args: list_dictionaries ([type]): [description] Returns: [type]: [description]", "name": "to_json_string", ...
6
null
Implement the Python class `Base` described below. Class description: [summary] Returns: [type]: [description] Method signatures and docstrings: - def __init__(self, id=None): [summary] Args: id ([type], optional): [description]. Defaults to None. - def to_json_string(list_dictionaries): [summary] Args: list_dictiona...
Implement the Python class `Base` described below. Class description: [summary] Returns: [type]: [description] Method signatures and docstrings: - def __init__(self, id=None): [summary] Args: id ([type], optional): [description]. Defaults to None. - def to_json_string(list_dictionaries): [summary] Args: list_dictiona...
9b6942b509bd32cd8f3570d23277404631096e7d
<|skeleton|> class Base: """[summary] Returns: [type]: [description]""" def __init__(self, id=None): """[summary] Args: id ([type], optional): [description]. Defaults to None.""" <|body_0|> def to_json_string(list_dictionaries): """[summary] Args: list_dictionaries ([type]): [descr...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Base: """[summary] Returns: [type]: [description]""" def __init__(self, id=None): """[summary] Args: id ([type], optional): [description]. Defaults to None.""" if id is not None: self.id = id else: Base.__nb_objects += 1 self.id = Base.__nb_obje...
the_stack_v2_python_sparse
0x0C-python-almost_a_circle/models/base.py
MIlenaMontoya/holbertonschool-higher_level_programming
train
0
65091c0c4f412f92d293ec6552a4370a86c8d513
[ "self.performance_metrics = pd.DataFrame()\nfor model_name in self.reporters:\n current_metrics = self.reporters[model_name].evaluator.get_metrics()\n current_metrics.index = [model_name]\n self.performance_metrics = pd.concat([self.performance_metrics, current_metrics], axis=0)\nself.performance_metrics.c...
<|body_start_0|> self.performance_metrics = pd.DataFrame() for model_name in self.reporters: current_metrics = self.reporters[model_name].evaluator.get_metrics() current_metrics.index = [model_name] self.performance_metrics = pd.concat([self.performance_metrics, curre...
Regression comparison mixin class.
RegressionComparisonMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RegressionComparisonMixin: """Regression comparison mixin class.""" def perf_metrics(self): """Returns a HTML table for the regression metrics for all the models given as list input. Returns ------- Performance metrices table: HTMLTable""" <|body_0|> def pred_error(self)...
stack_v2_sparse_classes_75kplus_train_006793
14,020
no_license
[ { "docstring": "Returns a HTML table for the regression metrics for all the models given as list input. Returns ------- Performance metrices table: HTMLTable", "name": "perf_metrics", "signature": "def perf_metrics(self)" }, { "docstring": "Returns a dictionary of plots of prediction error for m...
5
stack_v2_sparse_classes_30k_train_047062
Implement the Python class `RegressionComparisonMixin` described below. Class description: Regression comparison mixin class. Method signatures and docstrings: - def perf_metrics(self): Returns a HTML table for the regression metrics for all the models given as list input. Returns ------- Performance metrices table: ...
Implement the Python class `RegressionComparisonMixin` described below. Class description: Regression comparison mixin class. Method signatures and docstrings: - def perf_metrics(self): Returns a HTML table for the regression metrics for all the models given as list input. Returns ------- Performance metrices table: ...
be5d8cca769c7e267cfee1932eb82b70c2855bc1
<|skeleton|> class RegressionComparisonMixin: """Regression comparison mixin class.""" def perf_metrics(self): """Returns a HTML table for the regression metrics for all the models given as list input. Returns ------- Performance metrices table: HTMLTable""" <|body_0|> def pred_error(self)...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class RegressionComparisonMixin: """Regression comparison mixin class.""" def perf_metrics(self): """Returns a HTML table for the regression metrics for all the models given as list input. Returns ------- Performance metrices table: HTMLTable""" self.performance_metrics = pd.DataFrame() ...
the_stack_v2_python_sparse
src/ta_lib/_vendor/tigerml/model_eval/plotters/evaluation/regression.py
Seemant-tiger/housing-price-prediction
train
0
dcc0d7caad437457765389524b9c16a6abd2bb2f
[ "super().__init__()\nimport sklearn\nimport sklearn.discriminant_analysis\nself.model = sklearn.discriminant_analysis.LinearDiscriminantAnalysis", "specs = super(LinearDiscriminantAnalysisClassifier, cls).getInputSpecification()\nspecs.description = \"The \\\\xmlNode{LinearDiscriminantAnalysisClassifier} is a cla...
<|body_start_0|> super().__init__() import sklearn import sklearn.discriminant_analysis self.model = sklearn.discriminant_analysis.LinearDiscriminantAnalysis <|end_body_0|> <|body_start_1|> specs = super(LinearDiscriminantAnalysisClassifier, cls).getInputSpecification() ...
KNeighborsClassifier Classifier implementing the k-nearest neighbors vote.
LinearDiscriminantAnalysisClassifier
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "BSD-2-Clause", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LinearDiscriminantAnalysisClassifier: """KNeighborsClassifier Classifier implementing the k-nearest neighbors vote.""" def __init__(self): """Constructor that will appropriately initialize a supervised learning object @ In, None @ Out, None""" <|body_0|> def getInputSpec...
stack_v2_sparse_classes_75kplus_train_006794
7,036
permissive
[ { "docstring": "Constructor that will appropriately initialize a supervised learning object @ In, None @ Out, None", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Method to get a reference to a class that specifies the input data for class cls. @ In, cls, the class for...
3
stack_v2_sparse_classes_30k_train_041870
Implement the Python class `LinearDiscriminantAnalysisClassifier` described below. Class description: KNeighborsClassifier Classifier implementing the k-nearest neighbors vote. Method signatures and docstrings: - def __init__(self): Constructor that will appropriately initialize a supervised learning object @ In, Non...
Implement the Python class `LinearDiscriminantAnalysisClassifier` described below. Class description: KNeighborsClassifier Classifier implementing the k-nearest neighbors vote. Method signatures and docstrings: - def __init__(self): Constructor that will appropriately initialize a supervised learning object @ In, Non...
2b16e7aa3325fe84cab2477947a951414c635381
<|skeleton|> class LinearDiscriminantAnalysisClassifier: """KNeighborsClassifier Classifier implementing the k-nearest neighbors vote.""" def __init__(self): """Constructor that will appropriately initialize a supervised learning object @ In, None @ Out, None""" <|body_0|> def getInputSpec...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LinearDiscriminantAnalysisClassifier: """KNeighborsClassifier Classifier implementing the k-nearest neighbors vote.""" def __init__(self): """Constructor that will appropriately initialize a supervised learning object @ In, None @ Out, None""" super().__init__() import sklearn ...
the_stack_v2_python_sparse
ravenframework/SupervisedLearning/ScikitLearn/DiscriminantAnalysis/LinearDiscriminantAnalysis.py
idaholab/raven
train
201
bb6df218d8d4c54fe6e7c571c0a8fafa610f2eb7
[ "msg = {'code': 1, 'data': []}\nparam = request.query_params.dict()\nyear = param['year']\ntry:\n artsMjorLines = ArtsMajorLine.objects.filter(collegeHistoryId=pk, year=year).all()\n serializers = ArtsMajorLineSerializer(artsMjorLines, many=True)\n msg['code'] = 0\n msg['data'] = serializers.data\n r...
<|body_start_0|> msg = {'code': 1, 'data': []} param = request.query_params.dict() year = param['year'] try: artsMjorLines = ArtsMajorLine.objects.filter(collegeHistoryId=pk, year=year).all() serializers = ArtsMajorLineSerializer(artsMjorLines, many=True) ...
ArtsMajorLineView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ArtsMajorLineView: def get(self, request, pk): """根据collegehistoryid和year查询学校专业录取信息 :param request: :param pk: :return:""" <|body_0|> def post(self, request, *args, **kwargs): """查询某个学校某个专业近几年的录取情况 :param request: :param args: :param kwargs: :return:""" <|bod...
stack_v2_sparse_classes_75kplus_train_006795
31,134
no_license
[ { "docstring": "根据collegehistoryid和year查询学校专业录取信息 :param request: :param pk: :return:", "name": "get", "signature": "def get(self, request, pk)" }, { "docstring": "查询某个学校某个专业近几年的录取情况 :param request: :param args: :param kwargs: :return:", "name": "post", "signature": "def post(self, reque...
2
stack_v2_sparse_classes_30k_train_028777
Implement the Python class `ArtsMajorLineView` described below. Class description: Implement the ArtsMajorLineView class. Method signatures and docstrings: - def get(self, request, pk): 根据collegehistoryid和year查询学校专业录取信息 :param request: :param pk: :return: - def post(self, request, *args, **kwargs): 查询某个学校某个专业近几年的录取情况...
Implement the Python class `ArtsMajorLineView` described below. Class description: Implement the ArtsMajorLineView class. Method signatures and docstrings: - def get(self, request, pk): 根据collegehistoryid和year查询学校专业录取信息 :param request: :param pk: :return: - def post(self, request, *args, **kwargs): 查询某个学校某个专业近几年的录取情况...
942c232f4eeac1d640bc0a153b251eff7bc920b5
<|skeleton|> class ArtsMajorLineView: def get(self, request, pk): """根据collegehistoryid和year查询学校专业录取信息 :param request: :param pk: :return:""" <|body_0|> def post(self, request, *args, **kwargs): """查询某个学校某个专业近几年的录取情况 :param request: :param args: :param kwargs: :return:""" <|bod...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ArtsMajorLineView: def get(self, request, pk): """根据collegehistoryid和year查询学校专业录取信息 :param request: :param pk: :return:""" msg = {'code': 1, 'data': []} param = request.query_params.dict() year = param['year'] try: artsMjorLines = ArtsMajorLine.objects.filte...
the_stack_v2_python_sparse
web/views.py
nngnh/gkweb
train
0
04efbf8ad3cf2ccbb42e30fec9e70f40d0f75c78
[ "print('\\n\\nSORTING ALGORITHMS\\n' + '=' * 80)\nlist1 = [3, 5, 0, 4, 8, 2, 1]\nlist2 = [3, 5, 0, 4, 8, 2]\nprint('\\nUnsorted list')\nprint(f'list1: {list1}')\nprint(f'list2: {list2}')\nprint('\\nRunning merge sort')\nmergesort(list1)\nmergesort(list2)\nprint(f'list1: {list1}')\nprint(f'list2: {list2}')\nlist1 = ...
<|body_start_0|> print('\n\nSORTING ALGORITHMS\n' + '=' * 80) list1 = [3, 5, 0, 4, 8, 2, 1] list2 = [3, 5, 0, 4, 8, 2] print('\nUnsorted list') print(f'list1: {list1}') print(f'list2: {list2}') print('\nRunning merge sort') mergesort(list1) mergeso...
Run project 1's methods
Run
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Run: """Run project 1's methods""" def sorting(self): """Run sorting algorithm for Merge sort and Quick sort""" <|body_0|> def tower_of_hanoi(self): """Run Tower of Hanoi problem""" <|body_1|> def matrix_multiplication(self): """Run classic v...
stack_v2_sparse_classes_75kplus_train_006796
3,637
no_license
[ { "docstring": "Run sorting algorithm for Merge sort and Quick sort", "name": "sorting", "signature": "def sorting(self)" }, { "docstring": "Run Tower of Hanoi problem", "name": "tower_of_hanoi", "signature": "def tower_of_hanoi(self)" }, { "docstring": "Run classic vs Strassen m...
3
stack_v2_sparse_classes_30k_train_054610
Implement the Python class `Run` described below. Class description: Run project 1's methods Method signatures and docstrings: - def sorting(self): Run sorting algorithm for Merge sort and Quick sort - def tower_of_hanoi(self): Run Tower of Hanoi problem - def matrix_multiplication(self): Run classic vs Strassen matr...
Implement the Python class `Run` described below. Class description: Run project 1's methods Method signatures and docstrings: - def sorting(self): Run sorting algorithm for Merge sort and Quick sort - def tower_of_hanoi(self): Run Tower of Hanoi problem - def matrix_multiplication(self): Run classic vs Strassen matr...
25629912104133e95aa9cad1a94f41673502fcf4
<|skeleton|> class Run: """Run project 1's methods""" def sorting(self): """Run sorting algorithm for Merge sort and Quick sort""" <|body_0|> def tower_of_hanoi(self): """Run Tower of Hanoi problem""" <|body_1|> def matrix_multiplication(self): """Run classic v...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Run: """Run project 1's methods""" def sorting(self): """Run sorting algorithm for Merge sort and Quick sort""" print('\n\nSORTING ALGORITHMS\n' + '=' * 80) list1 = [3, 5, 0, 4, 8, 2, 1] list2 = [3, 5, 0, 4, 8, 2] print('\nUnsorted list') print(f'list1: {li...
the_stack_v2_python_sparse
project1/run.py
moredrowsy/algorithms_i
train
0
6d43645774d61c3d803ac1116fe27aa35c57c257
[ "name = model_attr.name\ntry:\n with open(json_file, 'r') as f:\n model_dict = json.load(f)\nexcept FileNotFoundError:\n model_dict = {}\nmodel_dict[name] = model_attr.__dict__\nwith open(json_file, 'w') as f:\n json.dump(model_dict, f)", "try:\n with open(json_file, 'r') as f:\n model_d...
<|body_start_0|> name = model_attr.name try: with open(json_file, 'r') as f: model_dict = json.load(f) except FileNotFoundError: model_dict = {} model_dict[name] = model_attr.__dict__ with open(json_file, 'w') as f: json.dump(mo...
A database class that CRUD ModelAttrs in a single Json file. Users can query and save model attributes by this class. All the ModelAttrs are stored in a single Json file. The json file is located at json_path. The file name is model_attrs.json.
JsonModel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JsonModel: """A database class that CRUD ModelAttrs in a single Json file. Users can query and save model attributes by this class. All the ModelAttrs are stored in a single Json file. The json file is located at json_path. The file name is model_attrs.json.""" def save_attr(model_attr: Mode...
stack_v2_sparse_classes_75kplus_train_006797
6,136
no_license
[ { "docstring": "将某个模型对应的要素添加至本地文件,原来的模型要素不会改变。 Args: model_attr(ModelAttr): 将要存储的Model要素的对象 json_file(str): Json路径及文件名", "name": "save_attr", "signature": "def save_attr(model_attr: ModelAttr, json_file: str) -> None" }, { "docstring": "从本地读取某个模型的要素 Args: name(str): 模型名字 json_file(str): Json路径及文...
4
stack_v2_sparse_classes_30k_train_023987
Implement the Python class `JsonModel` described below. Class description: A database class that CRUD ModelAttrs in a single Json file. Users can query and save model attributes by this class. All the ModelAttrs are stored in a single Json file. The json file is located at json_path. The file name is model_attrs.json....
Implement the Python class `JsonModel` described below. Class description: A database class that CRUD ModelAttrs in a single Json file. Users can query and save model attributes by this class. All the ModelAttrs are stored in a single Json file. The json file is located at json_path. The file name is model_attrs.json....
dfa3d091534e964c431226b673c211971a4cf73a
<|skeleton|> class JsonModel: """A database class that CRUD ModelAttrs in a single Json file. Users can query and save model attributes by this class. All the ModelAttrs are stored in a single Json file. The json file is located at json_path. The file name is model_attrs.json.""" def save_attr(model_attr: Mode...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class JsonModel: """A database class that CRUD ModelAttrs in a single Json file. Users can query and save model attributes by this class. All the ModelAttrs are stored in a single Json file. The json file is located at json_path. The file name is model_attrs.json.""" def save_attr(model_attr: ModelAttr, json_f...
the_stack_v2_python_sparse
fxincome/utils.py
DominicHong/FXIncome
train
4
239519dffa9eff23eff0421662d87e6635d66aea
[ "super(ModelB, self).__init__()\nself.input_dim = input_dim\nself.hidden_dim = hidden_dim\nself.num_classes = num_classes\nself.gcn1 = GraphConvolution(input_dim, hidden_dim)\nself.pool1 = SelfAttentionPooling(hidden_dim, 0.5)\nself.gcn2 = GraphConvolution(hidden_dim, hidden_dim)\nself.pool2 = SelfAttentionPooling(...
<|body_start_0|> super(ModelB, self).__init__() self.input_dim = input_dim self.hidden_dim = hidden_dim self.num_classes = num_classes self.gcn1 = GraphConvolution(input_dim, hidden_dim) self.pool1 = SelfAttentionPooling(hidden_dim, 0.5) self.gcn2 = GraphConvoluti...
ModelB
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ModelB: def __init__(self, input_dim, hidden_dim, num_classes=2): """图分类模型结构,适用于较大的数据集 Args: ----- input_dim: int, 输入特征的维度 hidden_dim: int, 隐藏层单元数 num_classes: int, 分类类别数 (default: 2)""" <|body_0|> def forward(self, adjacency, input_feature, graph_indicator): """每一层G...
stack_v2_sparse_classes_75kplus_train_006798
10,598
no_license
[ { "docstring": "图分类模型结构,适用于较大的数据集 Args: ----- input_dim: int, 输入特征的维度 hidden_dim: int, 隐藏层单元数 num_classes: int, 分类类别数 (default: 2)", "name": "__init__", "signature": "def __init__(self, input_dim, hidden_dim, num_classes=2)" }, { "docstring": "每一层GCN分别进行pooling和输出", "name": "forward", "s...
2
stack_v2_sparse_classes_30k_train_007845
Implement the Python class `ModelB` described below. Class description: Implement the ModelB class. Method signatures and docstrings: - def __init__(self, input_dim, hidden_dim, num_classes=2): 图分类模型结构,适用于较大的数据集 Args: ----- input_dim: int, 输入特征的维度 hidden_dim: int, 隐藏层单元数 num_classes: int, 分类类别数 (default: 2) - def for...
Implement the Python class `ModelB` described below. Class description: Implement the ModelB class. Method signatures and docstrings: - def __init__(self, input_dim, hidden_dim, num_classes=2): 图分类模型结构,适用于较大的数据集 Args: ----- input_dim: int, 输入特征的维度 hidden_dim: int, 隐藏层单元数 num_classes: int, 分类类别数 (default: 2) - def for...
8d8a173b62d51cc98c8e7a2304a1e404448bceb6
<|skeleton|> class ModelB: def __init__(self, input_dim, hidden_dim, num_classes=2): """图分类模型结构,适用于较大的数据集 Args: ----- input_dim: int, 输入特征的维度 hidden_dim: int, 隐藏层单元数 num_classes: int, 分类类别数 (default: 2)""" <|body_0|> def forward(self, adjacency, input_feature, graph_indicator): """每一层G...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ModelB: def __init__(self, input_dim, hidden_dim, num_classes=2): """图分类模型结构,适用于较大的数据集 Args: ----- input_dim: int, 输入特征的维度 hidden_dim: int, 隐藏层单元数 num_classes: int, 分类类别数 (default: 2)""" super(ModelB, self).__init__() self.input_dim = input_dim self.hidden_dim = hidden_dim ...
the_stack_v2_python_sparse
GraphAttentionPool/model.py
RacleRay/DeepLearningFoundation
train
3
34e4481b86cd59c9009e06b4af3e14c6aef9e384
[ "BaseEntity.__init__(self, *args, **kwargs)\nself._base_attributes += ['resources']\nif self.get_resources():\n pass\nelse:\n self.set_resources([])", "if not isinstance(resource, Resource):\n raise BIValueError('Object of Resource expected, but <%s> occured!' % self.__class__.__name__)\nspec = self.spec...
<|body_start_0|> BaseEntity.__init__(self, *args, **kwargs) self._base_attributes += ['resources'] if self.get_resources(): pass else: self.set_resources([]) <|end_body_0|> <|body_start_1|> if not isinstance(resource, Resource): raise BIValueE...
This class incapsulate collections attributes and operations
Collection
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Collection: """This class incapsulate collections attributes and operations""" def __init__(self, *args, **kwargs): """Constructor""" <|body_0|> def append_resource(self, resource): """append resource to collection""" <|body_1|> def remove_resource(s...
stack_v2_sparse_classes_75kplus_train_006799
20,441
no_license
[ { "docstring": "Constructor", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "append resource to collection", "name": "append_resource", "signature": "def append_resource(self, resource)" }, { "docstring": "remove resource from collection...
3
stack_v2_sparse_classes_30k_train_017561
Implement the Python class `Collection` described below. Class description: This class incapsulate collections attributes and operations Method signatures and docstrings: - def __init__(self, *args, **kwargs): Constructor - def append_resource(self, resource): append resource to collection - def remove_resource(self,...
Implement the Python class `Collection` described below. Class description: This class incapsulate collections attributes and operations Method signatures and docstrings: - def __init__(self, *args, **kwargs): Constructor - def append_resource(self, resource): append resource to collection - def remove_resource(self,...
3ee3ded4d901991d3ee6cf3e7b93f733dccc15e9
<|skeleton|> class Collection: """This class incapsulate collections attributes and operations""" def __init__(self, *args, **kwargs): """Constructor""" <|body_0|> def append_resource(self, resource): """append resource to collection""" <|body_1|> def remove_resource(s...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Collection: """This class incapsulate collections attributes and operations""" def __init__(self, *args, **kwargs): """Constructor""" BaseEntity.__init__(self, *args, **kwargs) self._base_attributes += ['resources'] if self.get_resources(): pass else: ...
the_stack_v2_python_sparse
blik/inventory/core/base_entities.py
blik/blik-resource-inventory
train
0