blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
6.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
438
7.52k
id
stringlengths
40
40
length_bytes
int64
506
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.25k
prompted_full_text
stringlengths
645
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.34k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
302
7.33k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
c512c29e936921f2ad8fd937d3100dea310ce9eb
[ "response = await self.client(Operation(operation_type='RUNNER_READ_ALL'))\nself.set_header('Content-Type', 'application/json; charset=UTF-8')\nself.write(response)", "patch = SchemaParser.parse_patch(self.request.decoded_body, from_string=True)\nfor op in patch:\n operation = op.operation.lower()\n if oper...
<|body_start_0|> response = await self.client(Operation(operation_type='RUNNER_READ_ALL')) self.set_header('Content-Type', 'application/json; charset=UTF-8') self.write(response) <|end_body_0|> <|body_start_1|> patch = SchemaParser.parse_patch(self.request.decoded_body, from_string=True...
RunnerListAPI
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RunnerListAPI: async def get(self): """--- summary: Retrieve runners responses: 200: description: List of runner states schema: $ref: '#/definitions/Runner' 404: $ref: '#/definitions/404Error' 50x: $ref: '#/definitions/50xError' tags: - Runners""" <|body_0|> async def patch(...
stack_v2_sparse_classes_36k_train_007800
6,146
permissive
[ { "docstring": "--- summary: Retrieve runners responses: 200: description: List of runner states schema: $ref: '#/definitions/Runner' 404: $ref: '#/definitions/404Error' 50x: $ref: '#/definitions/50xError' tags: - Runners", "name": "get", "signature": "async def get(self)" }, { "docstring": "---...
2
stack_v2_sparse_classes_30k_train_003305
Implement the Python class `RunnerListAPI` described below. Class description: Implement the RunnerListAPI class. Method signatures and docstrings: - async def get(self): --- summary: Retrieve runners responses: 200: description: List of runner states schema: $ref: '#/definitions/Runner' 404: $ref: '#/definitions/404...
Implement the Python class `RunnerListAPI` described below. Class description: Implement the RunnerListAPI class. Method signatures and docstrings: - async def get(self): --- summary: Retrieve runners responses: 200: description: List of runner states schema: $ref: '#/definitions/Runner' 404: $ref: '#/definitions/404...
a5fd2dcc2444409e243d3fdaa43d86695e5cb142
<|skeleton|> class RunnerListAPI: async def get(self): """--- summary: Retrieve runners responses: 200: description: List of runner states schema: $ref: '#/definitions/Runner' 404: $ref: '#/definitions/404Error' 50x: $ref: '#/definitions/50xError' tags: - Runners""" <|body_0|> async def patch(...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RunnerListAPI: async def get(self): """--- summary: Retrieve runners responses: 200: description: List of runner states schema: $ref: '#/definitions/Runner' 404: $ref: '#/definitions/404Error' 50x: $ref: '#/definitions/50xError' tags: - Runners""" response = await self.client(Operation(operati...
the_stack_v2_python_sparse
src/app/beer_garden/api/http/handlers/vbeta/runner.py
beer-garden/beer-garden
train
254
d21ffde04f29a5cbc938c708913679b3035fe5a9
[ "self.auto_log_backup = auto_log_backup\nself.dynamic_config = dynamic_config\nself.entity_support = entity_support\nself.full_backup = full_backup\nself.incr_backup = incr_backup\nself.log_backup = log_backup\nself.multi_object_restore = multi_object_restore", "if dictionary is None:\n return None\nauto_log_b...
<|body_start_0|> self.auto_log_backup = auto_log_backup self.dynamic_config = dynamic_config self.entity_support = entity_support self.full_backup = full_backup self.incr_backup = incr_backup self.log_backup = log_backup self.multi_object_restore = multi_object_re...
Implementation of the 'UdaSourceCapabilities' model. TODO: type description here. Attributes: auto_log_backup (bool): TODO: Type description here. dynamic_config (bool): Specifies whether the source supports the 'Dynamic Configuration' capability. entity_support (bool): Indicates if source has entity capability. full_b...
UdaSourceCapabilities
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UdaSourceCapabilities: """Implementation of the 'UdaSourceCapabilities' model. TODO: type description here. Attributes: auto_log_backup (bool): TODO: Type description here. dynamic_config (bool): Specifies whether the source supports the 'Dynamic Configuration' capability. entity_support (bool): ...
stack_v2_sparse_classes_36k_train_007801
3,068
permissive
[ { "docstring": "Constructor for the UdaSourceCapabilities class", "name": "__init__", "signature": "def __init__(self, auto_log_backup=None, dynamic_config=None, entity_support=None, full_backup=None, incr_backup=None, log_backup=None, multi_object_restore=None)" }, { "docstring": "Creates an in...
2
stack_v2_sparse_classes_30k_train_016829
Implement the Python class `UdaSourceCapabilities` described below. Class description: Implementation of the 'UdaSourceCapabilities' model. TODO: type description here. Attributes: auto_log_backup (bool): TODO: Type description here. dynamic_config (bool): Specifies whether the source supports the 'Dynamic Configurati...
Implement the Python class `UdaSourceCapabilities` described below. Class description: Implementation of the 'UdaSourceCapabilities' model. TODO: type description here. Attributes: auto_log_backup (bool): TODO: Type description here. dynamic_config (bool): Specifies whether the source supports the 'Dynamic Configurati...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class UdaSourceCapabilities: """Implementation of the 'UdaSourceCapabilities' model. TODO: type description here. Attributes: auto_log_backup (bool): TODO: Type description here. dynamic_config (bool): Specifies whether the source supports the 'Dynamic Configuration' capability. entity_support (bool): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UdaSourceCapabilities: """Implementation of the 'UdaSourceCapabilities' model. TODO: type description here. Attributes: auto_log_backup (bool): TODO: Type description here. dynamic_config (bool): Specifies whether the source supports the 'Dynamic Configuration' capability. entity_support (bool): Indicates if ...
the_stack_v2_python_sparse
cohesity_management_sdk/models/uda_source_capabilities.py
cohesity/management-sdk-python
train
24
79d23678a5920cced12ab90bb570cd4637464ceb
[ "for rec in self:\n if rec.container_id and rec.billing_type:\n if rec.billing_type == 'weight':\n if rec.container_id.weight < rec.weight:\n raise ValidationError('The weight is must be less than or equal to %s' % rec.container_id.weight)", "for rec in self:\n if rec.contai...
<|body_start_0|> for rec in self: if rec.container_id and rec.billing_type: if rec.billing_type == 'weight': if rec.container_id.weight < rec.weight: raise ValidationError('The weight is must be less than or equal to %s' % rec.container_id....
FreightOrderLine
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FreightOrderLine: def _check_weight(self): """Checking the weight of containers""" <|body_0|> def _check_volume(self): """Checking the volume of containers""" <|body_1|> def onchange_price(self): """Calculate the weight and volume of container"""...
stack_v2_sparse_classes_36k_train_007802
22,800
no_license
[ { "docstring": "Checking the weight of containers", "name": "_check_weight", "signature": "def _check_weight(self)" }, { "docstring": "Checking the volume of containers", "name": "_check_volume", "signature": "def _check_volume(self)" }, { "docstring": "Calculate the weight and v...
4
stack_v2_sparse_classes_30k_train_009461
Implement the Python class `FreightOrderLine` described below. Class description: Implement the FreightOrderLine class. Method signatures and docstrings: - def _check_weight(self): Checking the weight of containers - def _check_volume(self): Checking the volume of containers - def onchange_price(self): Calculate the ...
Implement the Python class `FreightOrderLine` described below. Class description: Implement the FreightOrderLine class. Method signatures and docstrings: - def _check_weight(self): Checking the weight of containers - def _check_volume(self): Checking the volume of containers - def onchange_price(self): Calculate the ...
4b1bcb8f17aad44fe9c80a8180eb0128e6bb2c14
<|skeleton|> class FreightOrderLine: def _check_weight(self): """Checking the weight of containers""" <|body_0|> def _check_volume(self): """Checking the volume of containers""" <|body_1|> def onchange_price(self): """Calculate the weight and volume of container"""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FreightOrderLine: def _check_weight(self): """Checking the weight of containers""" for rec in self: if rec.container_id and rec.billing_type: if rec.billing_type == 'weight': if rec.container_id.weight < rec.weight: raise ...
the_stack_v2_python_sparse
freight_management_system/model/freight_order.py
CybroOdoo/CybroAddons
train
209
7c6fb64589b773c34f34333e6508acfe1dec1fd9
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn LifecycleManagementSettings()", "from ..email_settings import EmailSettings\nfrom ..entity import Entity\nfrom ..email_settings import EmailSettings\nfrom ..entity import Entity\nfields: Dict[str, Callable[[Any], None]] = {'emailSettin...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return LifecycleManagementSettings() <|end_body_0|> <|body_start_1|> from ..email_settings import EmailSettings from ..entity import Entity from ..email_settings import EmailSettings ...
LifecycleManagementSettings
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LifecycleManagementSettings: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> LifecycleManagementSettings: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value a...
stack_v2_sparse_classes_36k_train_007803
2,715
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: LifecycleManagementSettings", "name": "create_from_discriminator_value", "signature": "def create_from_discr...
3
stack_v2_sparse_classes_30k_val_000144
Implement the Python class `LifecycleManagementSettings` described below. Class description: Implement the LifecycleManagementSettings class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> LifecycleManagementSettings: Creates a new instance of the appr...
Implement the Python class `LifecycleManagementSettings` described below. Class description: Implement the LifecycleManagementSettings class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> LifecycleManagementSettings: Creates a new instance of the appr...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class LifecycleManagementSettings: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> LifecycleManagementSettings: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value a...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LifecycleManagementSettings: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> LifecycleManagementSettings: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the ...
the_stack_v2_python_sparse
msgraph/generated/models/identity_governance/lifecycle_management_settings.py
microsoftgraph/msgraph-sdk-python
train
135
e0c26bfdb27fee2eb9eb2b33840c0005e36987d1
[ "self.batched_inputs = inputs\nproposals_boxes = proposals[PD_BOXES]\nif self.is_training:\n proposals = self.label_and_sample_proposals(inputs, proposals_boxes)\nfeatures_list = [features[f] for f in self.in_features]\nimg_size = get_img_size_from_batched_inputs(inputs)\nif self.is_training:\n pred_instances...
<|body_start_0|> self.batched_inputs = inputs proposals_boxes = proposals[PD_BOXES] if self.is_training: proposals = self.label_and_sample_proposals(inputs, proposals_boxes) features_list = [features[f] for f in self.in_features] img_size = get_img_size_from_batched_i...
RepeatableROIHeads
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RepeatableROIHeads: def forward(self, inputs, features, proposals: ProposalsData): """See :class:`ROIHeads.forward`.""" <|body_0|> def forward_with_given_boxes(self, inputs, features, instances, img_size): """Use the given boxes in `instances` to produce other (non-b...
stack_v2_sparse_classes_36k_train_007804
6,801
permissive
[ { "docstring": "See :class:`ROIHeads.forward`.", "name": "forward", "signature": "def forward(self, inputs, features, proposals: ProposalsData)" }, { "docstring": "Use the given boxes in `instances` to produce other (non-box) per-ROI outputs. This is useful for downstream tasks where a box is kn...
3
stack_v2_sparse_classes_30k_train_013757
Implement the Python class `RepeatableROIHeads` described below. Class description: Implement the RepeatableROIHeads class. Method signatures and docstrings: - def forward(self, inputs, features, proposals: ProposalsData): See :class:`ROIHeads.forward`. - def forward_with_given_boxes(self, inputs, features, instances...
Implement the Python class `RepeatableROIHeads` described below. Class description: Implement the RepeatableROIHeads class. Method signatures and docstrings: - def forward(self, inputs, features, proposals: ProposalsData): See :class:`ROIHeads.forward`. - def forward_with_given_boxes(self, inputs, features, instances...
8fbf060088816cd1a366d7cbd5dfe1a0e00f8d79
<|skeleton|> class RepeatableROIHeads: def forward(self, inputs, features, proposals: ProposalsData): """See :class:`ROIHeads.forward`.""" <|body_0|> def forward_with_given_boxes(self, inputs, features, instances, img_size): """Use the given boxes in `instances` to produce other (non-b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RepeatableROIHeads: def forward(self, inputs, features, proposals: ProposalsData): """See :class:`ROIHeads.forward`.""" self.batched_inputs = inputs proposals_boxes = proposals[PD_BOXES] if self.is_training: proposals = self.label_and_sample_proposals(inputs, propos...
the_stack_v2_python_sparse
object_detection2/modeling/roi_heads/repeatable_roi_heads.py
seantangtao/wml
train
0
66617fa2583b9f290ef6cc0b8dfbc3de79e900a8
[ "print('setUp')\nitem_code = 6546\ndescription = 'Couch'\nmarket_price = 600\nrental_price = 10\nmaterial = 'Fabric'\nsize = 'S'\nself.test_furniture_item = furniture_class.Furniture(item_code, description, market_price, rental_price, material, size)\nself.test_furn_dict = self.test_furniture_item.return_as_diction...
<|body_start_0|> print('setUp') item_code = 6546 description = 'Couch' market_price = 600 rental_price = 10 material = 'Fabric' size = 'S' self.test_furniture_item = furniture_class.Furniture(item_code, description, market_price, rental_price, material, si...
Perform tests on furniture_class. module.
FurnitureTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FurnitureTests: """Perform tests on furniture_class. module.""" def setUp(self): """Define set up characteristics of furniture class tests.""" <|body_0|> def test_furniture_creation(self): """Test creation of furniture item.""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_36k_train_007805
10,660
no_license
[ { "docstring": "Define set up characteristics of furniture class tests.", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Test creation of furniture item.", "name": "test_furniture_creation", "signature": "def test_furniture_creation(self)" } ]
2
null
Implement the Python class `FurnitureTests` described below. Class description: Perform tests on furniture_class. module. Method signatures and docstrings: - def setUp(self): Define set up characteristics of furniture class tests. - def test_furniture_creation(self): Test creation of furniture item.
Implement the Python class `FurnitureTests` described below. Class description: Perform tests on furniture_class. module. Method signatures and docstrings: - def setUp(self): Define set up characteristics of furniture class tests. - def test_furniture_creation(self): Test creation of furniture item. <|skeleton|> cla...
5dac60f39e3909ff05b26721d602ed20f14d6be3
<|skeleton|> class FurnitureTests: """Perform tests on furniture_class. module.""" def setUp(self): """Define set up characteristics of furniture class tests.""" <|body_0|> def test_furniture_creation(self): """Test creation of furniture item.""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FurnitureTests: """Perform tests on furniture_class. module.""" def setUp(self): """Define set up characteristics of furniture class tests.""" print('setUp') item_code = 6546 description = 'Couch' market_price = 600 rental_price = 10 material = 'Fab...
the_stack_v2_python_sparse
students/Reem_Alqaysi/Lesson_01/test_unit.py
JavaRod/SP_Python220B_2019
train
1
b639c08c9685a2228306dcc994609bd14ed0fdeb
[ "self.audit_logs = audit_logs\nself.cluster_id = cluster_id\nself.health = health\nself.iops = iops\nself.job_runs = job_runs\nself.protected_objects = protected_objects\nself.protection = protection\nself.recoveries = recoveries\nself.storage_efficiency = storage_efficiency\nself.throughput = throughput", "if di...
<|body_start_0|> self.audit_logs = audit_logs self.cluster_id = cluster_id self.health = health self.iops = iops self.job_runs = job_runs self.protected_objects = protected_objects self.protection = protection self.recoveries = recoveries self.stor...
Implementation of the 'Dashboard' model. Data shown on Dashboard. Attributes: audit_logs (AuditLogsTile): Audit Logs. cluster_id (long|int): Id of the cluster for which dashboard is given. health (HealthTile): Cluster Health and alerts. iops (IopsTile): IOPs. job_runs (JobRunsTile): Protection Job Runs. protected_objec...
Dashboard
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Dashboard: """Implementation of the 'Dashboard' model. Data shown on Dashboard. Attributes: audit_logs (AuditLogsTile): Audit Logs. cluster_id (long|int): Id of the cluster for which dashboard is given. health (HealthTile): Cluster Health and alerts. iops (IopsTile): IOPs. job_runs (JobRunsTile):...
stack_v2_sparse_classes_36k_train_007806
5,063
permissive
[ { "docstring": "Constructor for the Dashboard class", "name": "__init__", "signature": "def __init__(self, audit_logs=None, cluster_id=None, health=None, iops=None, job_runs=None, protected_objects=None, protection=None, recoveries=None, storage_efficiency=None, throughput=None)" }, { "docstring...
2
null
Implement the Python class `Dashboard` described below. Class description: Implementation of the 'Dashboard' model. Data shown on Dashboard. Attributes: audit_logs (AuditLogsTile): Audit Logs. cluster_id (long|int): Id of the cluster for which dashboard is given. health (HealthTile): Cluster Health and alerts. iops (I...
Implement the Python class `Dashboard` described below. Class description: Implementation of the 'Dashboard' model. Data shown on Dashboard. Attributes: audit_logs (AuditLogsTile): Audit Logs. cluster_id (long|int): Id of the cluster for which dashboard is given. health (HealthTile): Cluster Health and alerts. iops (I...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class Dashboard: """Implementation of the 'Dashboard' model. Data shown on Dashboard. Attributes: audit_logs (AuditLogsTile): Audit Logs. cluster_id (long|int): Id of the cluster for which dashboard is given. health (HealthTile): Cluster Health and alerts. iops (IopsTile): IOPs. job_runs (JobRunsTile):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Dashboard: """Implementation of the 'Dashboard' model. Data shown on Dashboard. Attributes: audit_logs (AuditLogsTile): Audit Logs. cluster_id (long|int): Id of the cluster for which dashboard is given. health (HealthTile): Cluster Health and alerts. iops (IopsTile): IOPs. job_runs (JobRunsTile): Protection J...
the_stack_v2_python_sparse
cohesity_management_sdk/models/dashboard.py
cohesity/management-sdk-python
train
24
9ce3643d6cff710217ed8aacacbd733cc21717ec
[ "super().__init__(cost_multiplier=cost_multiplier)\nself.forbidden_densities_dagger = conjugate_transpose(forbidden_densities)\nself.density_normalization_constants = np.array([density_forbidden_densities.shape[0] for density_forbidden_densities in forbidden_densities])\nself.hilbert_size = forbidden_densities.shap...
<|body_start_0|> super().__init__(cost_multiplier=cost_multiplier) self.forbidden_densities_dagger = conjugate_transpose(forbidden_densities) self.density_normalization_constants = np.array([density_forbidden_densities.shape[0] for density_forbidden_densities in forbidden_densities]) sel...
This class encapsulates a cost function that penalizes the occupation of forbidden densities. Fields: cost_multiplier :: float - the wieght factor for this cost density_normalization_constants :: ndarray - the number of densities that each evolving density is forbidden from hilbert_size :: int - the dimension of the hi...
ForbidDensities
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ForbidDensities: """This class encapsulates a cost function that penalizes the occupation of forbidden densities. Fields: cost_multiplier :: float - the wieght factor for this cost density_normalization_constants :: ndarray - the number of densities that each evolving density is forbidden from hi...
stack_v2_sparse_classes_36k_train_007807
4,874
permissive
[ { "docstring": "See class definition for arguments not listed here. Args: forbidden_densities :: ndarray - an array where each entry in the first axis is an array of densities that the corresponding evolving density is forbidden from, that is, each evolving density has its own list of forbidden densities system...
2
stack_v2_sparse_classes_30k_train_017101
Implement the Python class `ForbidDensities` described below. Class description: This class encapsulates a cost function that penalizes the occupation of forbidden densities. Fields: cost_multiplier :: float - the wieght factor for this cost density_normalization_constants :: ndarray - the number of densities that eac...
Implement the Python class `ForbidDensities` described below. Class description: This class encapsulates a cost function that penalizes the occupation of forbidden densities. Fields: cost_multiplier :: float - the wieght factor for this cost density_normalization_constants :: ndarray - the number of densities that eac...
64c1eed34c9a4200a01a7152932482a29a1fd89e
<|skeleton|> class ForbidDensities: """This class encapsulates a cost function that penalizes the occupation of forbidden densities. Fields: cost_multiplier :: float - the wieght factor for this cost density_normalization_constants :: ndarray - the number of densities that each evolving density is forbidden from hi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ForbidDensities: """This class encapsulates a cost function that penalizes the occupation of forbidden densities. Fields: cost_multiplier :: float - the wieght factor for this cost density_normalization_constants :: ndarray - the number of densities that each evolving density is forbidden from hilbert_size ::...
the_stack_v2_python_sparse
qoc/standard/costs/forbiddensities.py
jmbaker94/qoc
train
0
63674f287632baa99b4736c3f1e17aaff0840a6a
[ "args = reqparse.RequestParser().add_argument('random', type=bool, location='args').add_argument('school_id', type=int, location='args', required=True, help='学校id不能为空').add_argument('fullinfo', type=bool, location='args', required=False, default=False).parse_args()\nif args.get('fullinfo', False):\n seller = Sho...
<|body_start_0|> args = reqparse.RequestParser().add_argument('random', type=bool, location='args').add_argument('school_id', type=int, location='args', required=True, help='学校id不能为空').add_argument('fullinfo', type=bool, location='args', required=False, default=False).parse_args() if args.get('fullinfo'...
Shop
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Shop: def get(self): """根据学校id和商店类别返回符合条件的所有商家或一个随机商家 :return:""" <|body_0|> def post(self): """添加商家 :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> args = reqparse.RequestParser().add_argument('random', type=bool, location='args').add_argu...
stack_v2_sparse_classes_36k_train_007808
14,722
no_license
[ { "docstring": "根据学校id和商店类别返回符合条件的所有商家或一个随机商家 :return:", "name": "get", "signature": "def get(self)" }, { "docstring": "添加商家 :return:", "name": "post", "signature": "def post(self)" } ]
2
stack_v2_sparse_classes_30k_train_004164
Implement the Python class `Shop` described below. Class description: Implement the Shop class. Method signatures and docstrings: - def get(self): 根据学校id和商店类别返回符合条件的所有商家或一个随机商家 :return: - def post(self): 添加商家 :return:
Implement the Python class `Shop` described below. Class description: Implement the Shop class. Method signatures and docstrings: - def get(self): 根据学校id和商店类别返回符合条件的所有商家或一个随机商家 :return: - def post(self): 添加商家 :return: <|skeleton|> class Shop: def get(self): """根据学校id和商店类别返回符合条件的所有商家或一个随机商家 :return:""" ...
34a2bf4a51cc40a22dd43cb5eb88af7c2f2c5120
<|skeleton|> class Shop: def get(self): """根据学校id和商店类别返回符合条件的所有商家或一个随机商家 :return:""" <|body_0|> def post(self): """添加商家 :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Shop: def get(self): """根据学校id和商店类别返回符合条件的所有商家或一个随机商家 :return:""" args = reqparse.RequestParser().add_argument('random', type=bool, location='args').add_argument('school_id', type=int, location='args', required=True, help='学校id不能为空').add_argument('fullinfo', type=bool, location='args', require...
the_stack_v2_python_sparse
App/Shop/Controller/ShopResource.py
Vulcanhy/api.grooo-master
train
0
f624bddda1ed65fc53decffb560ff6f21b9921e2
[ "super().__init__(config)\nself.vision_model = CLIPVisionModel(config.vision_config)\nself.visual_projection = nn.Linear(config.vision_config.hidden_size, config.projection_dim, bias=False)\nself.concept_embeds = nn.Parameter(torch.ones(17, config.projection_dim), requires_grad=False)\nself.special_care_embeds = nn...
<|body_start_0|> super().__init__(config) self.vision_model = CLIPVisionModel(config.vision_config) self.visual_projection = nn.Linear(config.vision_config.hidden_size, config.projection_dim, bias=False) self.concept_embeds = nn.Parameter(torch.ones(17, config.projection_dim), requires_g...
StableDiffusionSafetyChecker
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StableDiffusionSafetyChecker: def __init__(self, config: CLIPConfig): """check result image for stable diffusion to prevent NSFW content generated. Args: config(CLIPConfig): config for transformers clip.""" <|body_0|> def forward(self, clip_input, images): """return ...
stack_v2_sparse_classes_36k_train_007809
7,642
permissive
[ { "docstring": "check result image for stable diffusion to prevent NSFW content generated. Args: config(CLIPConfig): config for transformers clip.", "name": "__init__", "signature": "def __init__(self, config: CLIPConfig)" }, { "docstring": "return black image if input image has nsfw content. Ar...
2
null
Implement the Python class `StableDiffusionSafetyChecker` described below. Class description: Implement the StableDiffusionSafetyChecker class. Method signatures and docstrings: - def __init__(self, config: CLIPConfig): check result image for stable diffusion to prevent NSFW content generated. Args: config(CLIPConfig...
Implement the Python class `StableDiffusionSafetyChecker` described below. Class description: Implement the StableDiffusionSafetyChecker class. Method signatures and docstrings: - def __init__(self, config: CLIPConfig): check result image for stable diffusion to prevent NSFW content generated. Args: config(CLIPConfig...
a382f143c0fd20d227e1e5524831ba26a568190d
<|skeleton|> class StableDiffusionSafetyChecker: def __init__(self, config: CLIPConfig): """check result image for stable diffusion to prevent NSFW content generated. Args: config(CLIPConfig): config for transformers clip.""" <|body_0|> def forward(self, clip_input, images): """return ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StableDiffusionSafetyChecker: def __init__(self, config: CLIPConfig): """check result image for stable diffusion to prevent NSFW content generated. Args: config(CLIPConfig): config for transformers clip.""" super().__init__(config) self.vision_model = CLIPVisionModel(config.vision_conf...
the_stack_v2_python_sparse
mmagic/models/editors/stable_diffusion/clip_wrapper.py
open-mmlab/mmagic
train
1,370
1788ca7326b0e64b945734d3c535aa35f5f0b8bb
[ "self.copy_tasks = copy_tasks\nself.job_id = job_id\nself.job_name = job_name\nself.job_run_id = job_run_id\nself.job_run_start_time_usecs = job_run_start_time_usecs\nself.last_run_end_time_usecs = last_run_end_time_usecs\nself.last_run_start_time_usecs = last_run_start_time_usecs\nself.message = message\nself.num_...
<|body_start_0|> self.copy_tasks = copy_tasks self.job_id = job_id self.job_name = job_name self.job_run_id = job_run_id self.job_run_start_time_usecs = job_run_start_time_usecs self.last_run_end_time_usecs = last_run_end_time_usecs self.last_run_start_time_usecs ...
Implementation of the 'ProtectionSourceSnapshotInformation' model. Specifies details about a Snapshot that backups up a leaf Protection Source Object. Attributes: copy_tasks (list of SnapshotCopyTask): Array of Snapshot Copy Tasks. Specifies a list of copy tasks (such as replication and archival tasks). job_id (long|in...
ProtectionSourceSnapshotInformation
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProtectionSourceSnapshotInformation: """Implementation of the 'ProtectionSourceSnapshotInformation' model. Specifies details about a Snapshot that backups up a leaf Protection Source Object. Attributes: copy_tasks (list of SnapshotCopyTask): Array of Snapshot Copy Tasks. Specifies a list of copy ...
stack_v2_sparse_classes_36k_train_007810
7,225
permissive
[ { "docstring": "Constructor for the ProtectionSourceSnapshotInformation class", "name": "__init__", "signature": "def __init__(self, copy_tasks=None, job_id=None, job_name=None, job_run_id=None, job_run_start_time_usecs=None, last_run_end_time_usecs=None, last_run_start_time_usecs=None, message=None, nu...
2
stack_v2_sparse_classes_30k_train_015020
Implement the Python class `ProtectionSourceSnapshotInformation` described below. Class description: Implementation of the 'ProtectionSourceSnapshotInformation' model. Specifies details about a Snapshot that backups up a leaf Protection Source Object. Attributes: copy_tasks (list of SnapshotCopyTask): Array of Snapsho...
Implement the Python class `ProtectionSourceSnapshotInformation` described below. Class description: Implementation of the 'ProtectionSourceSnapshotInformation' model. Specifies details about a Snapshot that backups up a leaf Protection Source Object. Attributes: copy_tasks (list of SnapshotCopyTask): Array of Snapsho...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class ProtectionSourceSnapshotInformation: """Implementation of the 'ProtectionSourceSnapshotInformation' model. Specifies details about a Snapshot that backups up a leaf Protection Source Object. Attributes: copy_tasks (list of SnapshotCopyTask): Array of Snapshot Copy Tasks. Specifies a list of copy ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProtectionSourceSnapshotInformation: """Implementation of the 'ProtectionSourceSnapshotInformation' model. Specifies details about a Snapshot that backups up a leaf Protection Source Object. Attributes: copy_tasks (list of SnapshotCopyTask): Array of Snapshot Copy Tasks. Specifies a list of copy tasks (such a...
the_stack_v2_python_sparse
cohesity_management_sdk/models/protection_source_snapshot_information.py
cohesity/management-sdk-python
train
24
80b464c07b5c9bc4c87f05365b1e5a3f807fe066
[ "if s is None or len(s) == 0:\n return 0\nif len(s) == 1:\n return ord(s[0]) - ord('A') + 1\nreturn self.title_to_number_recursive(s[0]) * pow(26, len(s) - 1) + self.title_to_number_recursive(s[1:])", "if s is None or len(s) == 0:\n return 0\nl = len(s)\nret = 0\nfor c in s:\n d = ord(c) - ord('A') + ...
<|body_start_0|> if s is None or len(s) == 0: return 0 if len(s) == 1: return ord(s[0]) - ord('A') + 1 return self.title_to_number_recursive(s[0]) * pow(26, len(s) - 1) + self.title_to_number_recursive(s[1:]) <|end_body_0|> <|body_start_1|> if s is None or len(s)...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def title_to_number_recursive(self, s): """:type s: str :rtype: int""" <|body_0|> def title_to_number_iterative(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if s is None or len(s) == 0: ...
stack_v2_sparse_classes_36k_train_007811
996
no_license
[ { "docstring": ":type s: str :rtype: int", "name": "title_to_number_recursive", "signature": "def title_to_number_recursive(self, s)" }, { "docstring": ":type s: str :rtype: int", "name": "title_to_number_iterative", "signature": "def title_to_number_iterative(self, s)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def title_to_number_recursive(self, s): :type s: str :rtype: int - def title_to_number_iterative(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 title_to_number_recursive(self, s): :type s: str :rtype: int - def title_to_number_iterative(self, s): :type s: str :rtype: int <|skeleton|> class Solution: def title_t...
b7b5d15e6a3c9ab11916550f0ed40ed6a9a2901e
<|skeleton|> class Solution: def title_to_number_recursive(self, s): """:type s: str :rtype: int""" <|body_0|> def title_to_number_iterative(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def title_to_number_recursive(self, s): """:type s: str :rtype: int""" if s is None or len(s) == 0: return 0 if len(s) == 1: return ord(s[0]) - ord('A') + 1 return self.title_to_number_recursive(s[0]) * pow(26, len(s) - 1) + self.title_to_numbe...
the_stack_v2_python_sparse
src/excel_sheet_column_number.py
fifa007/Leetcode
train
0
6af940cc2225fd3a2fefcb2d105878856acb5e03
[ "tmp = []\nfor a in arr:\n if a == 0:\n tmp.append(0)\n tmp.append(0)\n else:\n tmp.append(a)\n if len(tmp) == len(arr):\n break\nfor i in range(len(arr)):\n arr[i] = tmp[i]\nreturn", "possible_dups = 0\nlength_ = len(arr) - 1\nfor left in range(length_ + 1):\n if left >...
<|body_start_0|> tmp = [] for a in arr: if a == 0: tmp.append(0) tmp.append(0) else: tmp.append(a) if len(tmp) == len(arr): break for i in range(len(arr)): arr[i] = tmp[i] retu...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def duplicateZeros(self, arr: List[int]) -> None: """Do not return anything, modify arr in-place instead.""" <|body_0|> def duplicateZeros2(self, arr: List[int]) -> None: """Do not return anything, modify arr in-place instead.""" <|body_1|> <|end_s...
stack_v2_sparse_classes_36k_train_007812
2,706
no_license
[ { "docstring": "Do not return anything, modify arr in-place instead.", "name": "duplicateZeros", "signature": "def duplicateZeros(self, arr: List[int]) -> None" }, { "docstring": "Do not return anything, modify arr in-place instead.", "name": "duplicateZeros2", "signature": "def duplicat...
2
stack_v2_sparse_classes_30k_train_016876
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def duplicateZeros(self, arr: List[int]) -> None: Do not return anything, modify arr in-place instead. - def duplicateZeros2(self, arr: List[int]) -> None: Do not return anything...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def duplicateZeros(self, arr: List[int]) -> None: Do not return anything, modify arr in-place instead. - def duplicateZeros2(self, arr: List[int]) -> None: Do not return anything...
810575368ecffa97677bdb51744d1f716140bbb1
<|skeleton|> class Solution: def duplicateZeros(self, arr: List[int]) -> None: """Do not return anything, modify arr in-place instead.""" <|body_0|> def duplicateZeros2(self, arr: List[int]) -> None: """Do not return anything, modify arr in-place instead.""" <|body_1|> <|end_s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def duplicateZeros(self, arr: List[int]) -> None: """Do not return anything, modify arr in-place instead.""" tmp = [] for a in arr: if a == 0: tmp.append(0) tmp.append(0) else: tmp.append(a) i...
the_stack_v2_python_sparse
D/DuplicateZeros.py
bssrdf/pyleet
train
2
26841a961821eec14490ca74ee9cdf7d4d9b0d83
[ "random.shuffle(nums)\nmid_index = len(nums) // 2\nself.quick_select(nums, mid_index)\nmid = nums[mid_index]\ni = 0\nj = 0\nk = len(nums) - 1\nwhile j < k:\n if nums[j] > mid:\n nums[j], nums[k] = (nums[k], nums[j])\n k -= 1\n elif nums[j] < mid:\n nums[i], nums[j] = (nums[j], nums[i])\n ...
<|body_start_0|> random.shuffle(nums) mid_index = len(nums) // 2 self.quick_select(nums, mid_index) mid = nums[mid_index] i = 0 j = 0 k = len(nums) - 1 while j < k: if nums[j] > mid: nums[j], nums[k] = (nums[k], nums[j]) ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def wiggleSort(self, nums): """Do not return anything, modify nums in-place instead. Args: nums: list[int]""" <|body_0|> def quick_select(self, nums, target): """Args: nums: list[int target: int""" <|body_1|> def partition(self, nums, left, rig...
stack_v2_sparse_classes_36k_train_007813
2,730
no_license
[ { "docstring": "Do not return anything, modify nums in-place instead. Args: nums: list[int]", "name": "wiggleSort", "signature": "def wiggleSort(self, nums)" }, { "docstring": "Args: nums: list[int target: int", "name": "quick_select", "signature": "def quick_select(self, nums, target)" ...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wiggleSort(self, nums): Do not return anything, modify nums in-place instead. Args: nums: list[int] - def quick_select(self, nums, target): Args: nums: list[int target: int -...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wiggleSort(self, nums): Do not return anything, modify nums in-place instead. Args: nums: list[int] - def quick_select(self, nums, target): Args: nums: list[int target: int -...
101bce2fac8b188a4eb2f5e017293d21ad0ecb21
<|skeleton|> class Solution: def wiggleSort(self, nums): """Do not return anything, modify nums in-place instead. Args: nums: list[int]""" <|body_0|> def quick_select(self, nums, target): """Args: nums: list[int target: int""" <|body_1|> def partition(self, nums, left, rig...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def wiggleSort(self, nums): """Do not return anything, modify nums in-place instead. Args: nums: list[int]""" random.shuffle(nums) mid_index = len(nums) // 2 self.quick_select(nums, mid_index) mid = nums[mid_index] i = 0 j = 0 k = len(n...
the_stack_v2_python_sparse
code/324. 摆动排序 II.py
AiZhanghan/Leetcode
train
0
545c15a4b6637af0e1342282047d0e3d77d6de37
[ "if data is not None:\n self.batch_size = len(data)\n self.dataset = dataset\n self.train = train\n for name, field in dataset.fields.items():\n if field is not None:\n setattr(self, name, field.numericalize(field.pad((x.__dict__[name] for x in data)), device=device, train=train))", ...
<|body_start_0|> if data is not None: self.batch_size = len(data) self.dataset = dataset self.train = train for name, field in dataset.fields.items(): if field is not None: setattr(self, name, field.numericalize(field.pad((x.__d...
Defines a batch of examples along with its Fields. Attributes: batch_size: Number of examples in the batch. dataset: A reference to the dataset object the examples come from (which itself contains the dataset's Field objects). train: Whether the batch is from a training set. Also stores the Variable for each column in ...
Batch
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Batch: """Defines a batch of examples along with its Fields. Attributes: batch_size: Number of examples in the batch. dataset: A reference to the dataset object the examples come from (which itself contains the dataset's Field objects). train: Whether the batch is from a training set. Also stores...
stack_v2_sparse_classes_36k_train_007814
25,729
permissive
[ { "docstring": "Create a Batch from a list of examples.", "name": "__init__", "signature": "def __init__(self, data=None, dataset=None, device=None, train=True)" }, { "docstring": "Create a Batch directly from a number of Variables.", "name": "fromvars", "signature": "def fromvars(cls, d...
2
stack_v2_sparse_classes_30k_train_008030
Implement the Python class `Batch` described below. Class description: Defines a batch of examples along with its Fields. Attributes: batch_size: Number of examples in the batch. dataset: A reference to the dataset object the examples come from (which itself contains the dataset's Field objects). train: Whether the ba...
Implement the Python class `Batch` described below. Class description: Defines a batch of examples along with its Fields. Attributes: batch_size: Number of examples in the batch. dataset: A reference to the dataset object the examples come from (which itself contains the dataset's Field objects). train: Whether the ba...
5de55545049fa05b2f47cd7355362fd9f755f19f
<|skeleton|> class Batch: """Defines a batch of examples along with its Fields. Attributes: batch_size: Number of examples in the batch. dataset: A reference to the dataset object the examples come from (which itself contains the dataset's Field objects). train: Whether the batch is from a training set. Also stores...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Batch: """Defines a batch of examples along with its Fields. Attributes: batch_size: Number of examples in the batch. dataset: A reference to the dataset object the examples come from (which itself contains the dataset's Field objects). train: Whether the batch is from a training set. Also stores the Variable...
the_stack_v2_python_sparse
cnn_text_classification/torchtext/data.py
eriche2016/pytorch_projects_misc
train
5
43831fef13a3936df5194fad1959be2b81879e71
[ "super(Htaccess, self).__init__(atts)\nself.sections = []\nif 'sections' in atts:\n for sfile in atts['sections']:\n section = HtaccessSection(sfile)\n self.sections.append(section)\nif not self.exists() or not prompt('Use existing htaccess file?'):\n for section in self.sections:\n self....
<|body_start_0|> super(Htaccess, self).__init__(atts) self.sections = [] if 'sections' in atts: for sfile in atts['sections']: section = HtaccessSection(sfile) self.sections.append(section) if not self.exists() or not prompt('Use existing htacc...
A class that describes an Apache htaccess file. This is primarily a wrapper for htaccess managment.
Htaccess
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Htaccess: """A class that describes an Apache htaccess file. This is primarily a wrapper for htaccess managment.""" def __init__(self, atts): """Initialize an Htaccess class.""" <|body_0|> def verify(self, repair=False): """Verifies the htaccess file and contents...
stack_v2_sparse_classes_36k_train_007815
2,521
permissive
[ { "docstring": "Initialize an Htaccess class.", "name": "__init__", "signature": "def __init__(self, atts)" }, { "docstring": "Verifies the htaccess file and contents. This checks to make sure sections exist. It does", "name": "verify", "signature": "def verify(self, repair=False)" } ]
2
stack_v2_sparse_classes_30k_train_015729
Implement the Python class `Htaccess` described below. Class description: A class that describes an Apache htaccess file. This is primarily a wrapper for htaccess managment. Method signatures and docstrings: - def __init__(self, atts): Initialize an Htaccess class. - def verify(self, repair=False): Verifies the htacc...
Implement the Python class `Htaccess` described below. Class description: A class that describes an Apache htaccess file. This is primarily a wrapper for htaccess managment. Method signatures and docstrings: - def __init__(self, atts): Initialize an Htaccess class. - def verify(self, repair=False): Verifies the htacc...
5a537ab6865fcfb43a253cdb8cf2397a53d940a7
<|skeleton|> class Htaccess: """A class that describes an Apache htaccess file. This is primarily a wrapper for htaccess managment.""" def __init__(self, atts): """Initialize an Htaccess class.""" <|body_0|> def verify(self, repair=False): """Verifies the htaccess file and contents...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Htaccess: """A class that describes an Apache htaccess file. This is primarily a wrapper for htaccess managment.""" def __init__(self, atts): """Initialize an Htaccess class.""" super(Htaccess, self).__init__(atts) self.sections = [] if 'sections' in atts: for ...
the_stack_v2_python_sparse
ww/htaccess.py
hbradleyiii/ww
train
0
401420b047544e8b038f10f0935649c278b479b5
[ "self._client = client\nself._is_time_of_use = is_time_of_use\nsuper().__init__(hass, LOGGER, name=DOMAIN, update_interval=MIN_TIME_BETWEEN_UPDATES)", "LOGGER.debug('async_update_data enter')\nphx_time_zone = dt_util.get_time_zone(PHOENIX_TIME_ZONE)\nend_date = dt_util.now(phx_time_zone)\nstart_date = end_date - ...
<|body_start_0|> self._client = client self._is_time_of_use = is_time_of_use super().__init__(hass, LOGGER, name=DOMAIN, update_interval=MIN_TIME_BETWEEN_UPDATES) <|end_body_0|> <|body_start_1|> LOGGER.debug('async_update_data enter') phx_time_zone = dt_util.get_time_zone(PHOENI...
A srp_energy Data Update Coordinator.
SRPEnergyDataUpdateCoordinator
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SRPEnergyDataUpdateCoordinator: """A srp_energy Data Update Coordinator.""" def __init__(self, hass: HomeAssistant, client: SrpEnergyClient, is_time_of_use: bool) -> None: """Initialize the srp_energy data coordinator.""" <|body_0|> async def _async_update_data(self) -> ...
stack_v2_sparse_classes_36k_train_007816
2,450
permissive
[ { "docstring": "Initialize the srp_energy data coordinator.", "name": "__init__", "signature": "def __init__(self, hass: HomeAssistant, client: SrpEnergyClient, is_time_of_use: bool) -> None" }, { "docstring": "Fetch data from API endpoint. This is the place to pre-process the data to lookup tab...
2
null
Implement the Python class `SRPEnergyDataUpdateCoordinator` described below. Class description: A srp_energy Data Update Coordinator. Method signatures and docstrings: - def __init__(self, hass: HomeAssistant, client: SrpEnergyClient, is_time_of_use: bool) -> None: Initialize the srp_energy data coordinator. - async ...
Implement the Python class `SRPEnergyDataUpdateCoordinator` described below. Class description: A srp_energy Data Update Coordinator. Method signatures and docstrings: - def __init__(self, hass: HomeAssistant, client: SrpEnergyClient, is_time_of_use: bool) -> None: Initialize the srp_energy data coordinator. - async ...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class SRPEnergyDataUpdateCoordinator: """A srp_energy Data Update Coordinator.""" def __init__(self, hass: HomeAssistant, client: SrpEnergyClient, is_time_of_use: bool) -> None: """Initialize the srp_energy data coordinator.""" <|body_0|> async def _async_update_data(self) -> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SRPEnergyDataUpdateCoordinator: """A srp_energy Data Update Coordinator.""" def __init__(self, hass: HomeAssistant, client: SrpEnergyClient, is_time_of_use: bool) -> None: """Initialize the srp_energy data coordinator.""" self._client = client self._is_time_of_use = is_time_of_use...
the_stack_v2_python_sparse
homeassistant/components/srp_energy/coordinator.py
home-assistant/core
train
35,501
ff93229ff67b4803028dd06366636ee8ee202387
[ "andinopy_logger.debug('Terminal starting initialization')\nself.andinoio_instance = andinoio_instance if andinoio_instance is not None else andinoio.andinoio()\nself.display_instance = display_instance if display_instance is not None else display()\nself.rfid_keyboard_instance = rfid_keyboard_instance if rfid_keyb...
<|body_start_0|> andinopy_logger.debug('Terminal starting initialization') self.andinoio_instance = andinoio_instance if andinoio_instance is not None else andinoio.andinoio() self.display_instance = display_instance if display_instance is not None else display() self.rfid_keyboard_insta...
terminal
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class terminal: def __init__(self, andinoio_instance: andinoio.andinoio=None, display_instance: 'display'=None, rfid_keyboard_instance: 'rfid_keyboard'=None): """Create a new Terminal instance Can be passed preconfigured handles""" <|body_0|> def start(self): """Start the ...
stack_v2_sparse_classes_36k_train_007817
8,903
permissive
[ { "docstring": "Create a new Terminal instance Can be passed preconfigured handles", "name": "__init__", "signature": "def __init__(self, andinoio_instance: andinoio.andinoio=None, display_instance: 'display'=None, rfid_keyboard_instance: 'rfid_keyboard'=None)" }, { "docstring": "Start the termi...
3
stack_v2_sparse_classes_30k_train_014927
Implement the Python class `terminal` described below. Class description: Implement the terminal class. Method signatures and docstrings: - def __init__(self, andinoio_instance: andinoio.andinoio=None, display_instance: 'display'=None, rfid_keyboard_instance: 'rfid_keyboard'=None): Create a new Terminal instance Can ...
Implement the Python class `terminal` described below. Class description: Implement the terminal class. Method signatures and docstrings: - def __init__(self, andinoio_instance: andinoio.andinoio=None, display_instance: 'display'=None, rfid_keyboard_instance: 'rfid_keyboard'=None): Create a new Terminal instance Can ...
27f7246933c40b5fca4db5cb0590544d80555d51
<|skeleton|> class terminal: def __init__(self, andinoio_instance: andinoio.andinoio=None, display_instance: 'display'=None, rfid_keyboard_instance: 'rfid_keyboard'=None): """Create a new Terminal instance Can be passed preconfigured handles""" <|body_0|> def start(self): """Start the ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class terminal: def __init__(self, andinoio_instance: andinoio.andinoio=None, display_instance: 'display'=None, rfid_keyboard_instance: 'rfid_keyboard'=None): """Create a new Terminal instance Can be passed preconfigured handles""" andinopy_logger.debug('Terminal starting initialization') se...
the_stack_v2_python_sparse
Andino-Common/src/andinopy/build/lib/andinopy/terminal.py
matt2005/Andino
train
0
1ffa5814cc5ee2da8d735c79e1674aef1aecfad4
[ "host = 'foo.com:1234'\npath_info = '/_ah/login'\ncookie_dict = {}\naction = ''\nset_email = ''\nset_admin = False\ncontinue_url = ''\nstatus, location, set_cookie, content_type = self._run_test(host, path_info, cookie_dict, action, set_email, set_admin, continue_url)\nself.assertEqual(302, status)\nself.assertFals...
<|body_start_0|> host = 'foo.com:1234' path_info = '/_ah/login' cookie_dict = {} action = '' set_email = '' set_admin = False continue_url = '' status, location, set_cookie, content_type = self._run_test(host, path_info, cookie_dict, action, set_email, set...
Tests the various ways of invoking the login page.
LoginPageTest
[ "Apache-2.0", "LGPL-2.1-or-later", "BSD-3-Clause", "MIT", "GPL-2.0-or-later", "MPL-1.1" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoginPageTest: """Tests the various ways of invoking the login page.""" def test_no_params(self): """Tests just accessing the login URL with no params.""" <|body_0|> def test_login(self): """Tests when setting the user info with and without continue URL.""" ...
stack_v2_sparse_classes_36k_train_007818
12,436
permissive
[ { "docstring": "Tests just accessing the login URL with no params.", "name": "test_no_params", "signature": "def test_no_params(self)" }, { "docstring": "Tests when setting the user info with and without continue URL.", "name": "test_login", "signature": "def test_login(self)" }, { ...
5
stack_v2_sparse_classes_30k_train_006802
Implement the Python class `LoginPageTest` described below. Class description: Tests the various ways of invoking the login page. Method signatures and docstrings: - def test_no_params(self): Tests just accessing the login URL with no params. - def test_login(self): Tests when setting the user info with and without c...
Implement the Python class `LoginPageTest` described below. Class description: Tests the various ways of invoking the login page. Method signatures and docstrings: - def test_no_params(self): Tests just accessing the login URL with no params. - def test_login(self): Tests when setting the user info with and without c...
be17e5f658d7b42b5aa7eeb7a5ddd4962f3ea82f
<|skeleton|> class LoginPageTest: """Tests the various ways of invoking the login page.""" def test_no_params(self): """Tests just accessing the login URL with no params.""" <|body_0|> def test_login(self): """Tests when setting the user info with and without continue URL.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LoginPageTest: """Tests the various ways of invoking the login page.""" def test_no_params(self): """Tests just accessing the login URL with no params.""" host = 'foo.com:1234' path_info = '/_ah/login' cookie_dict = {} action = '' set_email = '' set...
the_stack_v2_python_sparse
AppServer/google/appengine/tools/devappserver2/login_test.py
obino/appscale
train
1
0dc0e9f25f358e1a1207b99e048f56e41526df62
[ "super().__init__()\nself.word_embedding_dim = word_embedding_dim\nself.char_embedding_dim = char_embedding_dim\nself.word_lstm_size = word_lstm_size\nself.char_lstm_size = char_lstm_size\nself.fc_dim = fc_dim\nself.dropout = dropout\nself.embedding = None\nself.use_char = True\nself.use_crf = True\nself.batch_size...
<|body_start_0|> super().__init__() self.word_embedding_dim = word_embedding_dim self.char_embedding_dim = char_embedding_dim self.word_lstm_size = word_lstm_size self.char_lstm_size = char_lstm_size self.fc_dim = fc_dim self.dropout = dropout self.embeddi...
BiLstmCrfNER
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BiLstmCrfNER: def __init__(self, word_embedding_dim=100, char_embedding_dim=25, word_lstm_size=100, char_lstm_size=25, fc_dim=100, dropout=0.5, embeddings=None, use_char=True, use_crf=True, batch_size=16, learning_rate=0.001, max_iter=10): """Construct a BiLSTM-CRF NER model. Model is au...
stack_v2_sparse_classes_36k_train_007819
7,645
permissive
[ { "docstring": "Construct a BiLSTM-CRF NER model. Model is augmented with character level embeddings as well as word embeddings by default. Implementation is provided by the Anago project. Parameters ---------- word_embedding_dim : int, optional, default 100 word embedding dimensions. char_embedding_dim : int, ...
5
stack_v2_sparse_classes_30k_train_003520
Implement the Python class `BiLstmCrfNER` described below. Class description: Implement the BiLstmCrfNER class. Method signatures and docstrings: - def __init__(self, word_embedding_dim=100, char_embedding_dim=25, word_lstm_size=100, char_lstm_size=25, fc_dim=100, dropout=0.5, embeddings=None, use_char=True, use_crf=...
Implement the Python class `BiLstmCrfNER` described below. Class description: Implement the BiLstmCrfNER class. Method signatures and docstrings: - def __init__(self, word_embedding_dim=100, char_embedding_dim=25, word_lstm_size=100, char_lstm_size=25, fc_dim=100, dropout=0.5, embeddings=None, use_char=True, use_crf=...
366420b2ec57bf790562de62a79f4973cbd6b3ed
<|skeleton|> class BiLstmCrfNER: def __init__(self, word_embedding_dim=100, char_embedding_dim=25, word_lstm_size=100, char_lstm_size=25, fc_dim=100, dropout=0.5, embeddings=None, use_char=True, use_crf=True, batch_size=16, learning_rate=0.001, max_iter=10): """Construct a BiLSTM-CRF NER model. Model is au...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BiLstmCrfNER: def __init__(self, word_embedding_dim=100, char_embedding_dim=25, word_lstm_size=100, char_lstm_size=25, fc_dim=100, dropout=0.5, embeddings=None, use_char=True, use_crf=True, batch_size=16, learning_rate=0.001, max_iter=10): """Construct a BiLSTM-CRF NER model. Model is augmented with c...
the_stack_v2_python_sparse
nerds/models/bilstm.py
fyuval/nerds
train
0
f368e03cbb16215c38e9139fcfb9a5589cf5c7c9
[ "self.mvid = mvid\nself.logdir = '{}/{}'.format(settings['log_dir'], self.mvid)\nself.mvm = get_model_version(mvid)\nif self.mvm.empty:\n raise RuntimeError(f'Model version for {mvid} is empty.')\nself.run_cv = self.mvm.cross_validate_id.values[0] == 1\nself.meid = self.mvm.modelable_entity_id.values[0]\nif self...
<|body_start_0|> self.mvid = mvid self.logdir = '{}/{}'.format(settings['log_dir'], self.mvid) self.mvm = get_model_version(mvid) if self.mvm.empty: raise RuntimeError(f'Model version for {mvid} is empty.') self.run_cv = self.mvm.cross_validate_id.values[0] == 1 ...
Driver
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Driver: def __init__(self, mvid): """Makes directories in preparation for launching cascade. Then launches jobmon to manage rest of cascade. Args: mvid (int): model version of dismod job""" <|body_0|> def build_jobmon_workflow(self, identifier=None, extra_arguments=None): ...
stack_v2_sparse_classes_36k_train_007820
5,762
no_license
[ { "docstring": "Makes directories in preparation for launching cascade. Then launches jobmon to manage rest of cascade. Args: mvid (int): model version of dismod job", "name": "__init__", "signature": "def __init__(self, mvid)" }, { "docstring": "Returns jobmon workflow that represents cascade j...
2
null
Implement the Python class `Driver` described below. Class description: Implement the Driver class. Method signatures and docstrings: - def __init__(self, mvid): Makes directories in preparation for launching cascade. Then launches jobmon to manage rest of cascade. Args: mvid (int): model version of dismod job - def ...
Implement the Python class `Driver` described below. Class description: Implement the Driver class. Method signatures and docstrings: - def __init__(self, mvid): Makes directories in preparation for launching cascade. Then launches jobmon to manage rest of cascade. Args: mvid (int): model version of dismod job - def ...
746ea5fb76a9c049c37a8c15aa089c041a90a6d5
<|skeleton|> class Driver: def __init__(self, mvid): """Makes directories in preparation for launching cascade. Then launches jobmon to manage rest of cascade. Args: mvid (int): model version of dismod job""" <|body_0|> def build_jobmon_workflow(self, identifier=None, extra_arguments=None): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Driver: def __init__(self, mvid): """Makes directories in preparation for launching cascade. Then launches jobmon to manage rest of cascade. Args: mvid (int): model version of dismod job""" self.mvid = mvid self.logdir = '{}/{}'.format(settings['log_dir'], self.mvid) self.mvm =...
the_stack_v2_python_sparse
gbd_2019/shared_code/central_comp/nonfatal/dismod/driver.py
Nermin-Ghith/ihme-modeling
train
0
17b5711bb87a1f078f5827530eae3afb8a4b9077
[ "self._property1 = property1\nself._operation = operation\nself._property2 = property2", "name = path if path != None else 'value'\nvalue1 = ObjectReader.get_property(value, self._property1)\nvalue2 = ObjectReader.get_property(value, self._property2)\nif not ObjectComparator.compare(value1, self._operation, value...
<|body_start_0|> self._property1 = property1 self._operation = operation self._property2 = property2 <|end_body_0|> <|body_start_1|> name = path if path != None else 'value' value1 = ObjectReader.get_property(value, self._property1) value2 = ObjectReader.get_property(val...
Validation rule that compares two object properties. Example: schema = ObjectSchema().with_rule(PropertyComparisonRule("field1", "NE", "field2")) schema.validate({ field1: 1, field2: 2 }) // Result: no errors schema.validate({ field1: 1, field2: 1 }) // Result: field1 shall not be equal to field2 schema.validate({}) //...
PropertiesComparisonRule
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PropertiesComparisonRule: """Validation rule that compares two object properties. Example: schema = ObjectSchema().with_rule(PropertyComparisonRule("field1", "NE", "field2")) schema.validate({ field1: 1, field2: 2 }) // Result: no errors schema.validate({ field1: 1, field2: 1 }) // Result: field1...
stack_v2_sparse_classes_36k_train_007821
2,738
permissive
[ { "docstring": "Creates a new validation rule and sets its arguments. :param property1: a name of the first property to compare. :param operation: a comparison operation: \"==\" (\"=\", \"EQ\"), \"!= \" (\"<>\", \"NE\"); \"<\"/\">\" (\"LT\"/\"GT\"), \"<=\"/\">=\" (\"LE\"/\"GE\"); \"LIKE\". :param property2: a n...
2
stack_v2_sparse_classes_30k_val_000730
Implement the Python class `PropertiesComparisonRule` described below. Class description: Validation rule that compares two object properties. Example: schema = ObjectSchema().with_rule(PropertyComparisonRule("field1", "NE", "field2")) schema.validate({ field1: 1, field2: 2 }) // Result: no errors schema.validate({ fi...
Implement the Python class `PropertiesComparisonRule` described below. Class description: Validation rule that compares two object properties. Example: schema = ObjectSchema().with_rule(PropertyComparisonRule("field1", "NE", "field2")) schema.validate({ field1: 1, field2: 2 }) // Result: no errors schema.validate({ fi...
4be674228adcf447c1579cbeb45b7aee89d4322c
<|skeleton|> class PropertiesComparisonRule: """Validation rule that compares two object properties. Example: schema = ObjectSchema().with_rule(PropertyComparisonRule("field1", "NE", "field2")) schema.validate({ field1: 1, field2: 2 }) // Result: no errors schema.validate({ field1: 1, field2: 1 }) // Result: field1...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PropertiesComparisonRule: """Validation rule that compares two object properties. Example: schema = ObjectSchema().with_rule(PropertyComparisonRule("field1", "NE", "field2")) schema.validate({ field1: 1, field2: 2 }) // Result: no errors schema.validate({ field1: 1, field2: 1 }) // Result: field1 shall not be...
the_stack_v2_python_sparse
pip_services3_commons/validate/PropertiesComparisonRule.py
banalna/pip-services3-commons-python
train
0
e07859eaa2012b4bdf1ade7e5c92331cf6522ffc
[ "data = self.get_json()\nschema = Telescope.__schema__()\ntry:\n telescope = schema.load(data)\nexcept ValidationError as e:\n return self.error(f'Invalid/missing parameters: {e.normalized_messages()}')\nDBSession().add(telescope)\nself.verify_and_commit()\nself.push_all(action='skyportal/REFRESH_TELESCOPES')...
<|body_start_0|> data = self.get_json() schema = Telescope.__schema__() try: telescope = schema.load(data) except ValidationError as e: return self.error(f'Invalid/missing parameters: {e.normalized_messages()}') DBSession().add(telescope) self.veri...
TelescopeHandler
[ "BSD-3-Clause", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TelescopeHandler: def post(self): """--- description: Create telescopes tags: - telescopes requestBody: content: application/json: schema: TelescopeNoID responses: 200: content: application/json: schema: allOf: - $ref: '#/components/schemas/Success' - type: object properties: data: type:...
stack_v2_sparse_classes_36k_train_007822
5,371
permissive
[ { "docstring": "--- description: Create telescopes tags: - telescopes requestBody: content: application/json: schema: TelescopeNoID responses: 200: content: application/json: schema: allOf: - $ref: '#/components/schemas/Success' - type: object properties: data: type: object properties: id: type: integer descrip...
4
null
Implement the Python class `TelescopeHandler` described below. Class description: Implement the TelescopeHandler class. Method signatures and docstrings: - def post(self): --- description: Create telescopes tags: - telescopes requestBody: content: application/json: schema: TelescopeNoID responses: 200: content: appli...
Implement the Python class `TelescopeHandler` described below. Class description: Implement the TelescopeHandler class. Method signatures and docstrings: - def post(self): --- description: Create telescopes tags: - telescopes requestBody: content: application/json: schema: TelescopeNoID responses: 200: content: appli...
2433d5ae0b2f41faac3c76ed4ae8d9a4da5522fb
<|skeleton|> class TelescopeHandler: def post(self): """--- description: Create telescopes tags: - telescopes requestBody: content: application/json: schema: TelescopeNoID responses: 200: content: application/json: schema: allOf: - $ref: '#/components/schemas/Success' - type: object properties: data: type:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TelescopeHandler: def post(self): """--- description: Create telescopes tags: - telescopes requestBody: content: application/json: schema: TelescopeNoID responses: 200: content: application/json: schema: allOf: - $ref: '#/components/schemas/Success' - type: object properties: data: type: object proper...
the_stack_v2_python_sparse
skyportal/handlers/api/telescope.py
dmitryduev/skyportal
train
1
4e9a3fd6f67c4dd82575ad113a453549f56b4d93
[ "if len(prices) < 2:\n return 0\nminPrice = prices[0]\nmaxPrice = prices[0]\nresArr = list()\nfor i in range(1, len(prices)):\n if prices[i] < minPrice:\n minPrice = prices[i]\n maxPrice = prices[i]\n elif prices[i] > maxPrice:\n maxPrice = prices[i]\n resArr.append(maxPrice - m...
<|body_start_0|> if len(prices) < 2: return 0 minPrice = prices[0] maxPrice = prices[0] resArr = list() for i in range(1, len(prices)): if prices[i] < minPrice: minPrice = prices[i] maxPrice = prices[i] elif pric...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProfit1(self, prices): """:type prices: List[int] :rtype: int""" <|body_0|> def maxProfit2(self, prices): """:type prices: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if len(prices) < 2: return ...
stack_v2_sparse_classes_36k_train_007823
960
permissive
[ { "docstring": ":type prices: List[int] :rtype: int", "name": "maxProfit1", "signature": "def maxProfit1(self, prices)" }, { "docstring": ":type prices: List[int] :rtype: int", "name": "maxProfit2", "signature": "def maxProfit2(self, prices)" } ]
2
stack_v2_sparse_classes_30k_train_020884
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit1(self, prices): :type prices: List[int] :rtype: int - def maxProfit2(self, prices): :type prices: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit1(self, prices): :type prices: List[int] :rtype: int - def maxProfit2(self, prices): :type prices: List[int] :rtype: int <|skeleton|> class Solution: def maxPr...
03876232521a20d32f8fa4e7d6d19cf208739a79
<|skeleton|> class Solution: def maxProfit1(self, prices): """:type prices: List[int] :rtype: int""" <|body_0|> def maxProfit2(self, prices): """:type prices: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxProfit1(self, prices): """:type prices: List[int] :rtype: int""" if len(prices) < 2: return 0 minPrice = prices[0] maxPrice = prices[0] resArr = list() for i in range(1, len(prices)): if prices[i] < minPrice: ...
the_stack_v2_python_sparse
Python/best-time-to-buy-and-sell-stock.py
coolryze/LeetCode
train
4
403b4b9ba23ba10354f7848c7a985f2d35c59b54
[ "selector = '#ae-appbar-version-id option[selected=\"selected\"]'\nversion_element, = self.doc.cssselect(selector)\nreturn version_element.text.strip()", "details = []\nselector = '#ae-instances-details-table tbody tr'\nfor element in self.doc.cssselect(selector):\n children = list(element)\n assert len(chi...
<|body_start_0|> selector = '#ae-appbar-version-id option[selected="selected"]' version_element, = self.doc.cssselect(selector) return version_element.text.strip() <|end_body_0|> <|body_start_1|> details = [] selector = '#ae-instances-details-table tbody tr' for element ...
An API for the contents of /instances as structured data.
Instances
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Instances: """An API for the contents of /instances as structured data.""" def version(self): """The app version that owns these instances.""" <|body_0|> def raw_detail_dicts(self): """Performance statistics specific to each instance. Returns: A list of dicts wit...
stack_v2_sparse_classes_36k_train_007824
15,505
no_license
[ { "docstring": "The app version that owns these instances.", "name": "version", "signature": "def version(self)" }, { "docstring": "Performance statistics specific to each instance. Returns: A list of dicts with (as of App Engine 1.7.2) fields like this: [{'instance_id': '01c61b117c08b2b562c94f2...
2
stack_v2_sparse_classes_30k_train_004662
Implement the Python class `Instances` described below. Class description: An API for the contents of /instances as structured data. Method signatures and docstrings: - def version(self): The app version that owns these instances. - def raw_detail_dicts(self): Performance statistics specific to each instance. Returns...
Implement the Python class `Instances` described below. Class description: An API for the contents of /instances as structured data. Method signatures and docstrings: - def version(self): The app version that owns these instances. - def raw_detail_dicts(self): Performance statistics specific to each instance. Returns...
c4ad2ad67b497ce411a9e5d6d6db407ee304491f
<|skeleton|> class Instances: """An API for the contents of /instances as structured data.""" def version(self): """The app version that owns these instances.""" <|body_0|> def raw_detail_dicts(self): """Performance statistics specific to each instance. Returns: A list of dicts wit...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Instances: """An API for the contents of /instances as structured data.""" def version(self): """The app version that owns these instances.""" selector = '#ae-appbar-version-id option[selected="selected"]' version_element, = self.doc.cssselect(selector) return version_elem...
the_stack_v2_python_sparse
src/gae_dashboard/parsers.py
summer-liu/analytics
train
1
aef499a01cb90d14f70e7b19f8501bddbce1854c
[ "n = len(nums)\nlo, hi = (0, n - 1)\nwhile lo < hi and nums[lo] <= nums[lo + 1]:\n lo += 1\nwhile lo < hi and nums[hi - 1] <= nums[hi]:\n hi -= 1\nif hi <= lo:\n return 0\nmini = float('inf')\nmaxa = -float('inf')\nfor i in range(lo, hi + 1):\n mini = min(mini, nums[i])\n maxa = max(maxa, nums[i])\nw...
<|body_start_0|> n = len(nums) lo, hi = (0, n - 1) while lo < hi and nums[lo] <= nums[lo + 1]: lo += 1 while lo < hi and nums[hi - 1] <= nums[hi]: hi -= 1 if hi <= lo: return 0 mini = float('inf') maxa = -float('inf') fo...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findUnsortedSubarray(self, nums: List[int]) -> int: """Sorted at both ends Then search for the two ends by nums[i+1] > nums[i] on the left side (right side similar) Problem: may over-include, consider 1 2 5 9 4 6 ... need to shrink from 1 2 5 9 to 1 2 according to min value...
stack_v2_sparse_classes_36k_train_007825
2,142
no_license
[ { "docstring": "Sorted at both ends Then search for the two ends by nums[i+1] > nums[i] on the left side (right side similar) Problem: may over-include, consider 1 2 5 9 4 6 ... need to shrink from 1 2 5 9 to 1 2 according to min value nums[lo - 1] <= min && max <= nums[hi + 1]", "name": "findUnsortedSubarr...
2
stack_v2_sparse_classes_30k_train_010643
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findUnsortedSubarray(self, nums: List[int]) -> int: Sorted at both ends Then search for the two ends by nums[i+1] > nums[i] on the left side (right side similar) Problem: may...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findUnsortedSubarray(self, nums: List[int]) -> int: Sorted at both ends Then search for the two ends by nums[i+1] > nums[i] on the left side (right side similar) Problem: may...
929dde1723fb2f54870c8a9badc80fc23e8400d3
<|skeleton|> class Solution: def findUnsortedSubarray(self, nums: List[int]) -> int: """Sorted at both ends Then search for the two ends by nums[i+1] > nums[i] on the left side (right side similar) Problem: may over-include, consider 1 2 5 9 4 6 ... need to shrink from 1 2 5 9 to 1 2 according to min value...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findUnsortedSubarray(self, nums: List[int]) -> int: """Sorted at both ends Then search for the two ends by nums[i+1] > nums[i] on the left side (right side similar) Problem: may over-include, consider 1 2 5 9 4 6 ... need to shrink from 1 2 5 9 to 1 2 according to min value nums[lo - 1] ...
the_stack_v2_python_sparse
_algorithms_challenges/leetcode/LeetCode/581 Shortest Unsorted Continuous Subarray.py
syurskyi/Algorithms_and_Data_Structure
train
4
cac3ed1bdfb11ffb1e90e27ab15ceb71a7e99c8b
[ "Galkin.__init__(self, kwargs_model=kwargs_model, kwargs_aperture=kwargs_aperture, kwargs_psf=kwargs_psf, kwargs_cosmo=kwargs_cosmo, kwargs_numerics=kwargs_numerics, analytic_kinematics=analytic_kinematics)\nif not self.aperture_type == 'IFU_shells':\n raise ValueError('GalkinShells is not supported with apertur...
<|body_start_0|> Galkin.__init__(self, kwargs_model=kwargs_model, kwargs_aperture=kwargs_aperture, kwargs_psf=kwargs_psf, kwargs_cosmo=kwargs_cosmo, kwargs_numerics=kwargs_numerics, analytic_kinematics=analytic_kinematics) if not self.aperture_type == 'IFU_shells': raise ValueError('GalkinSh...
class to calculate velocity dispersion for radial shells in a fast way
GalkinShells
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GalkinShells: """class to calculate velocity dispersion for radial shells in a fast way""" def __init__(self, kwargs_model, kwargs_aperture, kwargs_psf, kwargs_cosmo, kwargs_numerics=None, analytic_kinematics=False): """:param kwargs_model: keyword arguments describing the model comp...
stack_v2_sparse_classes_36k_train_007826
3,570
permissive
[ { "docstring": ":param kwargs_model: keyword arguments describing the model components :param kwargs_aperture: keyword arguments describing the spectroscopic aperture, see Aperture() class :param kwargs_psf: keyword argument specifying the PSF of the observation :param kwargs_cosmo: keyword arguments that defin...
2
null
Implement the Python class `GalkinShells` described below. Class description: class to calculate velocity dispersion for radial shells in a fast way Method signatures and docstrings: - def __init__(self, kwargs_model, kwargs_aperture, kwargs_psf, kwargs_cosmo, kwargs_numerics=None, analytic_kinematics=False): :param ...
Implement the Python class `GalkinShells` described below. Class description: class to calculate velocity dispersion for radial shells in a fast way Method signatures and docstrings: - def __init__(self, kwargs_model, kwargs_aperture, kwargs_psf, kwargs_cosmo, kwargs_numerics=None, analytic_kinematics=False): :param ...
73c9645f26f6983fe7961104075ebe8bf7a4b54c
<|skeleton|> class GalkinShells: """class to calculate velocity dispersion for radial shells in a fast way""" def __init__(self, kwargs_model, kwargs_aperture, kwargs_psf, kwargs_cosmo, kwargs_numerics=None, analytic_kinematics=False): """:param kwargs_model: keyword arguments describing the model comp...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GalkinShells: """class to calculate velocity dispersion for radial shells in a fast way""" def __init__(self, kwargs_model, kwargs_aperture, kwargs_psf, kwargs_cosmo, kwargs_numerics=None, analytic_kinematics=False): """:param kwargs_model: keyword arguments describing the model components :param...
the_stack_v2_python_sparse
lenstronomy/GalKin/galkin_shells.py
lenstronomy/lenstronomy
train
41
2b5f0e0897df9c1f5f0d5137c993215bf6d784a1
[ "try:\n tag_ord = None\n if isinstance(tag, bytes) and len(tag) == 1:\n tag_ord = ord(tag)\n if tag_ord in (ord(self.OK_STATUS), ord(self.DATA_TO_NETWORK), ord(self.DATA_TO_SLS)):\n return True\nexcept TypeError:\n pass\nreturn False", "if isinstance(data, (bytes, bytearray)):\n tag =...
<|body_start_0|> try: tag_ord = None if isinstance(tag, bytes) and len(tag) == 1: tag_ord = ord(tag) if tag_ord in (ord(self.OK_STATUS), ord(self.DATA_TO_NETWORK), ord(self.DATA_TO_SLS)): return True except TypeError: pass ...
Outbound data tag class
TagOutbound
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TagOutbound: """Outbound data tag class""" def in_this_scope(self, tag): """Check tag is in this scope""" <|body_0|> def assemble_for_network(self, data): """Assemble data to network""" <|body_1|> def assemble_for_sls(self, data): """Assemble...
stack_v2_sparse_classes_36k_train_007827
8,293
permissive
[ { "docstring": "Check tag is in this scope", "name": "in_this_scope", "signature": "def in_this_scope(self, tag)" }, { "docstring": "Assemble data to network", "name": "assemble_for_network", "signature": "def assemble_for_network(self, data)" }, { "docstring": "Assemble data to ...
4
stack_v2_sparse_classes_30k_train_014680
Implement the Python class `TagOutbound` described below. Class description: Outbound data tag class Method signatures and docstrings: - def in_this_scope(self, tag): Check tag is in this scope - def assemble_for_network(self, data): Assemble data to network - def assemble_for_sls(self, data): Assemble data to sls - ...
Implement the Python class `TagOutbound` described below. Class description: Outbound data tag class Method signatures and docstrings: - def in_this_scope(self, tag): Check tag is in this scope - def assemble_for_network(self, data): Assemble data to network - def assemble_for_sls(self, data): Assemble data to sls - ...
ff4577c321b1ac3439856c98e9ca6d8b88462d7e
<|skeleton|> class TagOutbound: """Outbound data tag class""" def in_this_scope(self, tag): """Check tag is in this scope""" <|body_0|> def assemble_for_network(self, data): """Assemble data to network""" <|body_1|> def assemble_for_sls(self, data): """Assemble...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TagOutbound: """Outbound data tag class""" def in_this_scope(self, tag): """Check tag is in this scope""" try: tag_ord = None if isinstance(tag, bytes) and len(tag) == 1: tag_ord = ord(tag) if tag_ord in (ord(self.OK_STATUS), ord(self.DA...
the_stack_v2_python_sparse
uhost/utilities/tag.py
connax-utim/uhost-python
train
1
f4721ca826652c250ee16fd6435ff4437abc407e
[ "super().__init__('efetch.fcgi', tool, email, apikey=apikey, threads=threads, qid=qid)\nself.logger = entrezpy.log.logger.get_class_logger(Efetcher)\nself.logger.debug(json.dumps({'init': self.dump()}))", "param = entrezpy.efetch.efetch_parameter.EfetchParameter(parameter)\nself.logger.debug(json.dumps({'paramete...
<|body_start_0|> super().__init__('efetch.fcgi', tool, email, apikey=apikey, threads=threads, qid=qid) self.logger = entrezpy.log.logger.get_class_logger(Efetcher) self.logger.debug(json.dumps({'init': self.dump()})) <|end_body_0|> <|body_start_1|> param = entrezpy.efetch.efetch_paramet...
Efetcher implements Efetch E-Utilities queries [0]. It implements :meth:`entrezpy.base.query.EutilsQuery.inquire` to fetch data from NCBI Entrez servers. [0]: https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch [1]: https://www.ncbi.nlm.nih.gov/books/NBK25497/table/ chapter2.T._entrez_unique_identifiers_ui/?re...
Efetcher
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Efetcher: """Efetcher implements Efetch E-Utilities queries [0]. It implements :meth:`entrezpy.base.query.EutilsQuery.inquire` to fetch data from NCBI Entrez servers. [0]: https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch [1]: https://www.ncbi.nlm.nih.gov/books/NBK25497/table/ chapter2...
stack_v2_sparse_classes_36k_train_007828
3,185
no_license
[ { "docstring": ":ivar result: :class:`entrezpy.base.result.EutilsResult`", "name": "__init__", "signature": "def __init__(self, tool, email, apikey=None, apikey_var=None, threads=None, qid=None)" }, { "docstring": "Implements :meth:`entrezpy.base.query.EutilsQuery.inquire` and configures fetch. ...
2
null
Implement the Python class `Efetcher` described below. Class description: Efetcher implements Efetch E-Utilities queries [0]. It implements :meth:`entrezpy.base.query.EutilsQuery.inquire` to fetch data from NCBI Entrez servers. [0]: https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch [1]: https://www.ncbi.nlm...
Implement the Python class `Efetcher` described below. Class description: Efetcher implements Efetch E-Utilities queries [0]. It implements :meth:`entrezpy.base.query.EutilsQuery.inquire` to fetch data from NCBI Entrez servers. [0]: https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch [1]: https://www.ncbi.nlm...
be9e22fc41153060da306366b6d3aa26d5f60f23
<|skeleton|> class Efetcher: """Efetcher implements Efetch E-Utilities queries [0]. It implements :meth:`entrezpy.base.query.EutilsQuery.inquire` to fetch data from NCBI Entrez servers. [0]: https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch [1]: https://www.ncbi.nlm.nih.gov/books/NBK25497/table/ chapter2...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Efetcher: """Efetcher implements Efetch E-Utilities queries [0]. It implements :meth:`entrezpy.base.query.EutilsQuery.inquire` to fetch data from NCBI Entrez servers. [0]: https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch [1]: https://www.ncbi.nlm.nih.gov/books/NBK25497/table/ chapter2.T._entrez_un...
the_stack_v2_python_sparse
venv/Lib/site-packages/entrezpy/efetch/efetcher.py
lvn3668/variantAnnotation
train
2
0890c266b7406f69d3faf5884c15b145a2854976
[ "rota_tool = getToolByName(self, 'portal_rotatool')\nmembers = rota_tool.getAvailableReporters()\nreturn DisplayList([(m.UID(), m.Title()) for m in members])", "catalog = getToolByName(self, 'uid_catalog')\nteam_ids = [p.UID for p in catalog(portal_type='DebateRecordOffice')]\nreturn team_ids", "rota_tool = get...
<|body_start_0|> rota_tool = getToolByName(self, 'portal_rotatool') members = rota_tool.getAvailableReporters() return DisplayList([(m.UID(), m.Title()) for m in members]) <|end_body_0|> <|body_start_1|> catalog = getToolByName(self, 'uid_catalog') team_ids = [p.UID for p in cat...
DebateRecordFolder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DebateRecordFolder: def getReportersForSittingVocab(self): """Get the current parliament's team of reporters, and return the active memberships.""" <|body_0|> def getSpaceTeamsDefault(self): """Used from space_team_edit.pt""" <|body_1|> def getNotAddable...
stack_v2_sparse_classes_36k_train_007829
5,607
no_license
[ { "docstring": "Get the current parliament's team of reporters, and return the active memberships.", "name": "getReportersForSittingVocab", "signature": "def getReportersForSittingVocab(self)" }, { "docstring": "Used from space_team_edit.pt", "name": "getSpaceTeamsDefault", "signature": ...
4
null
Implement the Python class `DebateRecordFolder` described below. Class description: Implement the DebateRecordFolder class. Method signatures and docstrings: - def getReportersForSittingVocab(self): Get the current parliament's team of reporters, and return the active memberships. - def getSpaceTeamsDefault(self): Us...
Implement the Python class `DebateRecordFolder` described below. Class description: Implement the DebateRecordFolder class. Method signatures and docstrings: - def getReportersForSittingVocab(self): Get the current parliament's team of reporters, and return the active memberships. - def getSpaceTeamsDefault(self): Us...
5cf0ba31dfbff8d2c1b4aa8ab6f69c7a0ae9870d
<|skeleton|> class DebateRecordFolder: def getReportersForSittingVocab(self): """Get the current parliament's team of reporters, and return the active memberships.""" <|body_0|> def getSpaceTeamsDefault(self): """Used from space_team_edit.pt""" <|body_1|> def getNotAddable...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DebateRecordFolder: def getReportersForSittingVocab(self): """Get the current parliament's team of reporters, and return the active memberships.""" rota_tool = getToolByName(self, 'portal_rotatool') members = rota_tool.getAvailableReporters() return DisplayList([(m.UID(), m.Tit...
the_stack_v2_python_sparse
archived/Bungeni/branches/ooo2tools-branch/debaterecord/DebateRecordFolder.py
malangalanga/bungeni-portal
train
0
719d78b5fc72a0524b9c6c21fc50e2df08176e42
[ "super().__init__()\nself.init_point = init_point\nself.sigma = sigma", "sq_diff = torch.norm(X - self.init_point, p=2, dim=-1) ** 2\npdf = torch.exp(sq_diff / 2 / self.sigma ** 2)\nregularization_term = pdf.max(dim=-1).values\nreturn regularization_term" ]
<|body_start_0|> super().__init__() self.init_point = init_point self.sigma = sigma <|end_body_0|> <|body_start_1|> sq_diff = torch.norm(X - self.init_point, p=2, dim=-1) ** 2 pdf = torch.exp(sq_diff / 2 / self.sigma ** 2) regularization_term = pdf.max(dim=-1).values ...
Gaussian penalty class to be added to any arbitrary acquisition function to construct a PenalizedAcquisitionFunction.
GaussianPenalty
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GaussianPenalty: """Gaussian penalty class to be added to any arbitrary acquisition function to construct a PenalizedAcquisitionFunction.""" def __init__(self, init_point: Tensor, sigma: float): """Initializing Gaussian regularization. Args: init_point: The "1 x dim" reference point ...
stack_v2_sparse_classes_36k_train_007830
14,396
permissive
[ { "docstring": "Initializing Gaussian regularization. Args: init_point: The \"1 x dim\" reference point against which we want to regularize. sigma: The parameter used in gaussian function.", "name": "__init__", "signature": "def __init__(self, init_point: Tensor, sigma: float)" }, { "docstring":...
2
null
Implement the Python class `GaussianPenalty` described below. Class description: Gaussian penalty class to be added to any arbitrary acquisition function to construct a PenalizedAcquisitionFunction. Method signatures and docstrings: - def __init__(self, init_point: Tensor, sigma: float): Initializing Gaussian regular...
Implement the Python class `GaussianPenalty` described below. Class description: Gaussian penalty class to be added to any arbitrary acquisition function to construct a PenalizedAcquisitionFunction. Method signatures and docstrings: - def __init__(self, init_point: Tensor, sigma: float): Initializing Gaussian regular...
4cc5ed59b2e8a9c780f786830c548e05cc74d53c
<|skeleton|> class GaussianPenalty: """Gaussian penalty class to be added to any arbitrary acquisition function to construct a PenalizedAcquisitionFunction.""" def __init__(self, init_point: Tensor, sigma: float): """Initializing Gaussian regularization. Args: init_point: The "1 x dim" reference point ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GaussianPenalty: """Gaussian penalty class to be added to any arbitrary acquisition function to construct a PenalizedAcquisitionFunction.""" def __init__(self, init_point: Tensor, sigma: float): """Initializing Gaussian regularization. Args: init_point: The "1 x dim" reference point against which...
the_stack_v2_python_sparse
botorch/acquisition/penalized.py
pytorch/botorch
train
2,891
a6d54e3d94d5674435b144b4f4f099c24316cbbe
[ "sub_list = re.findall('.{%s}' % self.word_len, substring)\nsub_dict = self.gen_dict(sub_list)\nif sub_dict == self.word_dic:\n return True\nreturn False", "word_dic = dict.fromkeys(word_list, 0)\nfor w in word_list:\n word_dic[w] += 1\nreturn word_dic", "if len(words) == 0:\n return []\nself.word_len ...
<|body_start_0|> sub_list = re.findall('.{%s}' % self.word_len, substring) sub_dict = self.gen_dict(sub_list) if sub_dict == self.word_dic: return True return False <|end_body_0|> <|body_start_1|> word_dic = dict.fromkeys(word_list, 0) for w in word_list: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def check(self, substring): """:type substring: str :rtype: bool""" <|body_0|> def gen_dict(word_list): """:type word_list: List[str :rtype: dict""" <|body_1|> def findSubstring(self, s, words): """:type s: str :type words: List[str] :r...
stack_v2_sparse_classes_36k_train_007831
2,182
no_license
[ { "docstring": ":type substring: str :rtype: bool", "name": "check", "signature": "def check(self, substring)" }, { "docstring": ":type word_list: List[str :rtype: dict", "name": "gen_dict", "signature": "def gen_dict(word_list)" }, { "docstring": ":type s: str :type words: List[...
3
stack_v2_sparse_classes_30k_train_018922
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def check(self, substring): :type substring: str :rtype: bool - def gen_dict(word_list): :type word_list: List[str :rtype: dict - def findSubstring(self, s, words): :type s: str ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def check(self, substring): :type substring: str :rtype: bool - def gen_dict(word_list): :type word_list: List[str :rtype: dict - def findSubstring(self, s, words): :type s: str ...
f8f3b0cdb47ee6bb4bf9bdc7c2a983f4a882d9dd
<|skeleton|> class Solution: def check(self, substring): """:type substring: str :rtype: bool""" <|body_0|> def gen_dict(word_list): """:type word_list: List[str :rtype: dict""" <|body_1|> def findSubstring(self, s, words): """:type s: str :type words: List[str] :r...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def check(self, substring): """:type substring: str :rtype: bool""" sub_list = re.findall('.{%s}' % self.word_len, substring) sub_dict = self.gen_dict(sub_list) if sub_dict == self.word_dic: return True return False def gen_dict(word_list): ...
the_stack_v2_python_sparse
solutions/030-substring-with-concatenation-of-all-words/main.py
CallMeNP/leetcode
train
0
0101cb4e170a8d168a24134fee231c0d44274d44
[ "session = db_apis.get_session()\nwith session.begin():\n db_lb = self.loadbalancer_repo.get(session, id=loadbalancer[constants.LOADBALANCER_ID])\namphorae = {amp.id: amp for amp in db_lb.amphorae}\nupdated_ports = {}\nhandle_delta = HandleNetworkDelta()\nfor amp_id, delta in deltas.items():\n ret = handle_de...
<|body_start_0|> session = db_apis.get_session() with session.begin(): db_lb = self.loadbalancer_repo.get(session, id=loadbalancer[constants.LOADBALANCER_ID]) amphorae = {amp.id: amp for amp in db_lb.amphorae} updated_ports = {} handle_delta = HandleNetworkDelta() ...
Task to plug and unplug networks Loop through the deltas and plug or unplug networks based on delta
HandleNetworkDeltas
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HandleNetworkDeltas: """Task to plug and unplug networks Loop through the deltas and plug or unplug networks based on delta""" def execute(self, deltas, loadbalancer): """Handle network plugging based off deltas.""" <|body_0|> def revert(self, result, deltas, *args, **kw...
stack_v2_sparse_classes_36k_train_007832
44,034
permissive
[ { "docstring": "Handle network plugging based off deltas.", "name": "execute", "signature": "def execute(self, deltas, loadbalancer)" }, { "docstring": "Handle a network plug or unplug failures.", "name": "revert", "signature": "def revert(self, result, deltas, *args, **kwargs)" } ]
2
stack_v2_sparse_classes_30k_train_003005
Implement the Python class `HandleNetworkDeltas` described below. Class description: Task to plug and unplug networks Loop through the deltas and plug or unplug networks based on delta Method signatures and docstrings: - def execute(self, deltas, loadbalancer): Handle network plugging based off deltas. - def revert(s...
Implement the Python class `HandleNetworkDeltas` described below. Class description: Task to plug and unplug networks Loop through the deltas and plug or unplug networks based on delta Method signatures and docstrings: - def execute(self, deltas, loadbalancer): Handle network plugging based off deltas. - def revert(s...
0426285a41464a5015494584f109eed35a0d44db
<|skeleton|> class HandleNetworkDeltas: """Task to plug and unplug networks Loop through the deltas and plug or unplug networks based on delta""" def execute(self, deltas, loadbalancer): """Handle network plugging based off deltas.""" <|body_0|> def revert(self, result, deltas, *args, **kw...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HandleNetworkDeltas: """Task to plug and unplug networks Loop through the deltas and plug or unplug networks based on delta""" def execute(self, deltas, loadbalancer): """Handle network plugging based off deltas.""" session = db_apis.get_session() with session.begin(): ...
the_stack_v2_python_sparse
octavia/controller/worker/v2/tasks/network_tasks.py
openstack/octavia
train
147
36f1f1176ca5b91d8e496019f7b037101f623504
[ "rval = zeros(len(string), float32)\nrval[:] = nan\n_pwm.score_string(self.values, self.char_to_index, string, rval)\nreturn rval", "rval = zeros(len(string), float32)\nrval[:] = nan\n_pwm.score_string_with_gaps(self.values, self.char_to_index, string, rval)\nreturn rval" ]
<|body_start_0|> rval = zeros(len(string), float32) rval[:] = nan _pwm.score_string(self.values, self.char_to_index, string, rval) return rval <|end_body_0|> <|body_start_1|> rval = zeros(len(string), float32) rval[:] = nan _pwm.score_string_with_gaps(self.values...
A position specific matrix containing values that are suitable for scoring a sequence.
ScoringMatrix
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ScoringMatrix: """A position specific matrix containing values that are suitable for scoring a sequence.""" def score_string(self, string): """Score each valid position in `string` using this scoring matrix. Positions which were not scored are set to nan.""" <|body_0|> d...
stack_v2_sparse_classes_36k_train_007833
5,401
permissive
[ { "docstring": "Score each valid position in `string` using this scoring matrix. Positions which were not scored are set to nan.", "name": "score_string", "signature": "def score_string(self, string)" }, { "docstring": "Score each valid position in `string` using this scoring matrix. Positions w...
2
null
Implement the Python class `ScoringMatrix` described below. Class description: A position specific matrix containing values that are suitable for scoring a sequence. Method signatures and docstrings: - def score_string(self, string): Score each valid position in `string` using this scoring matrix. Positions which wer...
Implement the Python class `ScoringMatrix` described below. Class description: A position specific matrix containing values that are suitable for scoring a sequence. Method signatures and docstrings: - def score_string(self, string): Score each valid position in `string` using this scoring matrix. Positions which wer...
7758bc4492626ffdbaa90c8fc5dd7620b1e2f3f8
<|skeleton|> class ScoringMatrix: """A position specific matrix containing values that are suitable for scoring a sequence.""" def score_string(self, string): """Score each valid position in `string` using this scoring matrix. Positions which were not scored are set to nan.""" <|body_0|> d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ScoringMatrix: """A position specific matrix containing values that are suitable for scoring a sequence.""" def score_string(self, string): """Score each valid position in `string` using this scoring matrix. Positions which were not scored are set to nan.""" rval = zeros(len(string), floa...
the_stack_v2_python_sparse
lib/bx/motif/pwm.py
bxlab/bx-python
train
141
42825c29669586cea2c74137ad127ea6773ce7e0
[ "if not mr.auth.user_id:\n return {'error': 'User is not logged in.'}\njson_data = {}\nwith self.profiler.Phase('page processing'):\n json_data.update(self._GatherHotlists(mr))\nreturn json_data", "with self.profiler.Phase('GetUserHotlists'):\n user_hotlists = self.services.features.GetHotlistsByUserID(m...
<|body_start_0|> if not mr.auth.user_id: return {'error': 'User is not logged in.'} json_data = {} with self.profiler.Phase('page processing'): json_data.update(self._GatherHotlists(mr)) return json_data <|end_body_0|> <|body_start_1|> with self.profiler....
Servlet to get all of a user's hotlists in JSON format.
HotlistsJsonFeed
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HotlistsJsonFeed: """Servlet to get all of a user's hotlists in JSON format.""" def HandleRequest(self, mr): """Retrieve list of a user's hotlists for the "My hotlists" menu. Args: mr: common information parsed from the HTTP request. Returns: Results dictionary in JSON format""" ...
stack_v2_sparse_classes_36k_train_007834
2,958
permissive
[ { "docstring": "Retrieve list of a user's hotlists for the \"My hotlists\" menu. Args: mr: common information parsed from the HTTP request. Returns: Results dictionary in JSON format", "name": "HandleRequest", "signature": "def HandleRequest(self, mr)" }, { "docstring": "Return a dict of hotlist...
2
null
Implement the Python class `HotlistsJsonFeed` described below. Class description: Servlet to get all of a user's hotlists in JSON format. Method signatures and docstrings: - def HandleRequest(self, mr): Retrieve list of a user's hotlists for the "My hotlists" menu. Args: mr: common information parsed from the HTTP re...
Implement the Python class `HotlistsJsonFeed` described below. Class description: Servlet to get all of a user's hotlists in JSON format. Method signatures and docstrings: - def HandleRequest(self, mr): Retrieve list of a user's hotlists for the "My hotlists" menu. Args: mr: common information parsed from the HTTP re...
09064105713603f7bf75c772e8354800a1bfa256
<|skeleton|> class HotlistsJsonFeed: """Servlet to get all of a user's hotlists in JSON format.""" def HandleRequest(self, mr): """Retrieve list of a user's hotlists for the "My hotlists" menu. Args: mr: common information parsed from the HTTP request. Returns: Results dictionary in JSON format""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HotlistsJsonFeed: """Servlet to get all of a user's hotlists in JSON format.""" def HandleRequest(self, mr): """Retrieve list of a user's hotlists for the "My hotlists" menu. Args: mr: common information parsed from the HTTP request. Returns: Results dictionary in JSON format""" if not mr...
the_stack_v2_python_sparse
appengine/monorail/sitewide/userhotlistsmenu.py
mcgreevy/chromium-infra
train
1
10ff3efab79c8e7290680587c754d4c7b0f087f9
[ "def generate(sequence: List[str]) -> None:\n \"\"\"递归生成所有序列,并将有效序列加入结果。\"\"\"\n if len(sequence) == 2 * n:\n if valid(sequence):\n ans.append(''.join(sequence))\n else:\n sequence.append('(')\n generate(sequence)\n sequence.pop()\n sequence.append(')')\n ...
<|body_start_0|> def generate(sequence: List[str]) -> None: """递归生成所有序列,并将有效序列加入结果。""" if len(sequence) == 2 * n: if valid(sequence): ans.append(''.join(sequence)) else: sequence.append('(') generate(sequence...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def generate_parenthesis(self, n: int) -> List[str]: """暴力。""" <|body_0|> def generate_parenthesis_2(self, n: int) -> List[str]: """回溯法。""" <|body_1|> <|end_skeleton|> <|body_start_0|> def generate(sequence: List[str]) -> None: ...
stack_v2_sparse_classes_36k_train_007835
3,775
no_license
[ { "docstring": "暴力。", "name": "generate_parenthesis", "signature": "def generate_parenthesis(self, n: int) -> List[str]" }, { "docstring": "回溯法。", "name": "generate_parenthesis_2", "signature": "def generate_parenthesis_2(self, n: int) -> List[str]" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def generate_parenthesis(self, n: int) -> List[str]: 暴力。 - def generate_parenthesis_2(self, n: int) -> List[str]: 回溯法。
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def generate_parenthesis(self, n: int) -> List[str]: 暴力。 - def generate_parenthesis_2(self, n: int) -> List[str]: 回溯法。 <|skeleton|> class Solution: def generate_parenthesis...
6932d69353b94ec824dd0ddc86a92453f6673232
<|skeleton|> class Solution: def generate_parenthesis(self, n: int) -> List[str]: """暴力。""" <|body_0|> def generate_parenthesis_2(self, n: int) -> List[str]: """回溯法。""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def generate_parenthesis(self, n: int) -> List[str]: """暴力。""" def generate(sequence: List[str]) -> None: """递归生成所有序列,并将有效序列加入结果。""" if len(sequence) == 2 * n: if valid(sequence): ans.append(''.join(sequence)) el...
the_stack_v2_python_sparse
0022_generate-parentheses.py
Nigirimeshi/leetcode
train
0
8d2fb863d28d654b66d405c337cf97922b8ada51
[ "vk_account = user.get_vk_account()\nif vk_account is not None:\n vk_session = VkApi(token=vk_account.access_token)\n self.vk = vk_session.get_api()\n self.vk_id = vk_account.uid\nself.user = user", "friends_ids: List['User'] = []\nuser_model: 'User' = get_user_model()\nreturn user_model.objects.filter(s...
<|body_start_0|> vk_account = user.get_vk_account() if vk_account is not None: vk_session = VkApi(token=vk_account.access_token) self.vk = vk_session.get_api() self.vk_id = vk_account.uid self.user = user <|end_body_0|> <|body_start_1|> friends_ids: L...
VK.
Vk
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Vk: """VK.""" def __init__(self, user: 'User'): """Init.""" <|body_0|> def get_friends(self) -> QuerySet['User']: """Get friends.""" <|body_1|> def get_data(self, fields: list[str]) -> UntypedObject: """Get data.""" <|body_2|> de...
stack_v2_sparse_classes_36k_train_007836
3,092
no_license
[ { "docstring": "Init.", "name": "__init__", "signature": "def __init__(self, user: 'User')" }, { "docstring": "Get friends.", "name": "get_friends", "signature": "def get_friends(self) -> QuerySet['User']" }, { "docstring": "Get data.", "name": "get_data", "signature": "d...
4
stack_v2_sparse_classes_30k_train_003558
Implement the Python class `Vk` described below. Class description: VK. Method signatures and docstrings: - def __init__(self, user: 'User'): Init. - def get_friends(self) -> QuerySet['User']: Get friends. - def get_data(self, fields: list[str]) -> UntypedObject: Get data. - def get_countries(self, country_codes: lis...
Implement the Python class `Vk` described below. Class description: VK. Method signatures and docstrings: - def __init__(self, user: 'User'): Init. - def get_friends(self) -> QuerySet['User']: Get friends. - def get_data(self, fields: list[str]) -> UntypedObject: Get data. - def get_countries(self, country_codes: lis...
04141e4cfc885ba6c53328e1222980b85d9828ef
<|skeleton|> class Vk: """VK.""" def __init__(self, user: 'User'): """Init.""" <|body_0|> def get_friends(self) -> QuerySet['User']: """Get friends.""" <|body_1|> def get_data(self, fields: list[str]) -> UntypedObject: """Get data.""" <|body_2|> de...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Vk: """VK.""" def __init__(self, user: 'User'): """Init.""" vk_account = user.get_vk_account() if vk_account is not None: vk_session = VkApi(token=vk_account.access_token) self.vk = vk_session.get_api() self.vk_id = vk_account.uid self.u...
the_stack_v2_python_sparse
src/moviesapp/vk.py
desecho/movies
train
14
39f37c617dafc865c826b1a37429e32a561afd20
[ "try:\n return inv(v)\nexcept:\n return None", "from ambry.build import meta_source_schema, get_specs\nspecs = get_specs(self)\nmeta_source_schema(self, self)" ]
<|body_start_0|> try: return inv(v) except: return None <|end_body_0|> <|body_start_1|> from ambry.build import meta_source_schema, get_specs specs = get_specs(self) meta_source_schema(self, self) <|end_body_1|>
Bundle
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Bundle: def illegal_to_none(self, v): """Converts '4 7' value from hlthcvrg field, on row 127231, to None.""" <|body_0|> def meta_source_schema(self): """Read the spec from the HTML file, and bergest it with the descriptions from the codebook.txt file. Does *not* use...
stack_v2_sparse_classes_36k_train_007837
672
no_license
[ { "docstring": "Converts '4 7' value from hlthcvrg field, on row 127231, to None.", "name": "illegal_to_none", "signature": "def illegal_to_none(self, v)" }, { "docstring": "Read the spec from the HTML file, and bergest it with the descriptions from the codebook.txt file. Does *not* use the conv...
2
stack_v2_sparse_classes_30k_train_015128
Implement the Python class `Bundle` described below. Class description: Implement the Bundle class. Method signatures and docstrings: - def illegal_to_none(self, v): Converts '4 7' value from hlthcvrg field, on row 127231, to None. - def meta_source_schema(self): Read the spec from the HTML file, and bergest it with ...
Implement the Python class `Bundle` described below. Class description: Implement the Bundle class. Method signatures and docstrings: - def illegal_to_none(self, v): Converts '4 7' value from hlthcvrg field, on row 127231, to None. - def meta_source_schema(self): Read the spec from the HTML file, and bergest it with ...
a084bb965cb7b3ff5871a547709bc3975d1fe936
<|skeleton|> class Bundle: def illegal_to_none(self, v): """Converts '4 7' value from hlthcvrg field, on row 127231, to None.""" <|body_0|> def meta_source_schema(self): """Read the spec from the HTML file, and bergest it with the descriptions from the codebook.txt file. Does *not* use...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Bundle: def illegal_to_none(self, v): """Converts '4 7' value from hlthcvrg field, on row 127231, to None.""" try: return inv(v) except: return None def meta_source_schema(self): """Read the spec from the HTML file, and bergest it with the descripti...
the_stack_v2_python_sparse
cdc.gov/brfss-2013/bundle.py
CivicSpleen/ambry10-bundles
train
0
cc77c2e54c9cde7f39170d329d288ccd483dd08e
[ "metric_struct_field = StructField('metric', StructType([StructField('dimensions', MapType(StringType(), StringType(), True), True), StructField('value_meta', MapType(StringType(), StringType(), True), True), StructField('name', StringType(), True), StructField('timestamp', StringType(), True), StructField('value',...
<|body_start_0|> metric_struct_field = StructField('metric', StructType([StructField('dimensions', MapType(StringType(), StringType(), True), True), StructField('value_meta', MapType(StringType(), StringType(), True), True), StructField('name', StringType(), True), StructField('timestamp', StringType(), True), ...
utility methods to transform raw metric.
MonMetricUtils
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MonMetricUtils: """utility methods to transform raw metric.""" def _get_mon_metric_json_schema(): """get the schema of the incoming monasca metric.""" <|body_0|> def create_mon_metrics_df_from_json_rdd(sql_context, jsonrdd): """create mon metrics df from json rdd...
stack_v2_sparse_classes_36k_train_007838
23,930
permissive
[ { "docstring": "get the schema of the incoming monasca metric.", "name": "_get_mon_metric_json_schema", "signature": "def _get_mon_metric_json_schema()" }, { "docstring": "create mon metrics df from json rdd.", "name": "create_mon_metrics_df_from_json_rdd", "signature": "def create_mon_m...
2
stack_v2_sparse_classes_30k_train_018886
Implement the Python class `MonMetricUtils` described below. Class description: utility methods to transform raw metric. Method signatures and docstrings: - def _get_mon_metric_json_schema(): get the schema of the incoming monasca metric. - def create_mon_metrics_df_from_json_rdd(sql_context, jsonrdd): create mon met...
Implement the Python class `MonMetricUtils` described below. Class description: utility methods to transform raw metric. Method signatures and docstrings: - def _get_mon_metric_json_schema(): get the schema of the incoming monasca metric. - def create_mon_metrics_df_from_json_rdd(sql_context, jsonrdd): create mon met...
6d76487028926b50d93f70e8dc61dc90ed318256
<|skeleton|> class MonMetricUtils: """utility methods to transform raw metric.""" def _get_mon_metric_json_schema(): """get the schema of the incoming monasca metric.""" <|body_0|> def create_mon_metrics_df_from_json_rdd(sql_context, jsonrdd): """create mon metrics df from json rdd...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MonMetricUtils: """utility methods to transform raw metric.""" def _get_mon_metric_json_schema(): """get the schema of the incoming monasca metric.""" metric_struct_field = StructField('metric', StructType([StructField('dimensions', MapType(StringType(), StringType(), True), True), Struct...
the_stack_v2_python_sparse
monasca_transform/transform/transform_utils.py
xiashuijun/monasca-transform
train
0
edca37b31261169336906d806fc37b6d3e0f0266
[ "print('ouput level = ' + str(ILog.get_output_level()))\nself.__test_output_all('default')\nfor i in range(1, 4):\n ILog.set_output_level(i)\n print('set ouput level = ' + str(i))\n self.__test_output_all('lv = ' + str(i))", "ILog.error('error message: ' + _postfix)\nILog.warn('warning message: ' + _po...
<|body_start_0|> print('ouput level = ' + str(ILog.get_output_level())) self.__test_output_all('default') for i in range(1, 4): ILog.set_output_level(i) print('set ouput level = ' + str(i)) self.__test_output_all('lv = ' + str(i)) <|end_body_0|> <|body_start_...
test: Logger
TestIFGILogger
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestIFGILogger: """test: Logger""" def test_logger(self): """test logger.""" <|body_0|> def __test_output_all(self, _postfix): """test subroutine to test all the output level""" <|body_1|> <|end_skeleton|> <|body_start_0|> print('ouput level = '...
stack_v2_sparse_classes_36k_train_007839
1,114
no_license
[ { "docstring": "test logger.", "name": "test_logger", "signature": "def test_logger(self)" }, { "docstring": "test subroutine to test all the output level", "name": "__test_output_all", "signature": "def __test_output_all(self, _postfix)" } ]
2
stack_v2_sparse_classes_30k_train_010017
Implement the Python class `TestIFGILogger` described below. Class description: test: Logger Method signatures and docstrings: - def test_logger(self): test logger. - def __test_output_all(self, _postfix): test subroutine to test all the output level
Implement the Python class `TestIFGILogger` described below. Class description: test: Logger Method signatures and docstrings: - def test_logger(self): test logger. - def __test_output_all(self, _postfix): test subroutine to test all the output level <|skeleton|> class TestIFGILogger: """test: Logger""" def...
f163b6b9e15100d223ddf4e180727a2b63fbae2d
<|skeleton|> class TestIFGILogger: """test: Logger""" def test_logger(self): """test logger.""" <|body_0|> def __test_output_all(self, _postfix): """test subroutine to test all the output level""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestIFGILogger: """test: Logger""" def test_logger(self): """test logger.""" print('ouput level = ' + str(ILog.get_output_level())) self.__test_output_all('default') for i in range(1, 4): ILog.set_output_level(i) print('set ouput level = ' + str(i))...
the_stack_v2_python_sparse
ifgi/base/test_ILog.py
yamauchih/ifgi-path-tracer
train
0
35b856c324cb40ca03d3a6af3f2448ebc3c74975
[ "self._action_ph = tf.placeholder(tf.float32, (batch_size, action_size))\nself._batch_size = batch_size\nself._action_size = action_size\nself._build_target = build_target\nself._action_space = spaces.Box(low=-1, high=1, shape=(action_size,))\nself._include_timestep = include_timestep\nsuper(CEMActorPolicy, self)._...
<|body_start_0|> self._action_ph = tf.placeholder(tf.float32, (batch_size, action_size)) self._batch_size = batch_size self._action_size = action_size self._build_target = build_target self._action_space = spaces.Box(low=-1, high=1, shape=(action_size,)) self._include_tim...
Learned policy for grasping (continuous). Uses CEM for selecting actions.
CEMActorPolicy
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CEMActorPolicy: """Learned policy for grasping (continuous). Uses CEM for selecting actions.""" def __init__(self, q_func, state_shape, action_size, use_gpu=True, batch_size=64, build_target=False, include_timestep=True, checkpoint=None): """Initializes the policy. Args: q_func: Pyth...
stack_v2_sparse_classes_36k_train_007840
14,341
permissive
[ { "docstring": "Initializes the policy. Args: q_func: Python function that takes in state, action, scope as input and returns Q(state, action) and intermediate endpoints dictionary. state_shape: Tuple of ints describing shape of the state observation. action_size: (int) Size of the vector-encoded action. use_gp...
3
stack_v2_sparse_classes_30k_train_000151
Implement the Python class `CEMActorPolicy` described below. Class description: Learned policy for grasping (continuous). Uses CEM for selecting actions. Method signatures and docstrings: - def __init__(self, q_func, state_shape, action_size, use_gpu=True, batch_size=64, build_target=False, include_timestep=True, che...
Implement the Python class `CEMActorPolicy` described below. Class description: Learned policy for grasping (continuous). Uses CEM for selecting actions. Method signatures and docstrings: - def __init__(self, q_func, state_shape, action_size, use_gpu=True, batch_size=64, build_target=False, include_timestep=True, che...
dea327aa9e7ef7f7bca5a6c225dbdca1077a06e9
<|skeleton|> class CEMActorPolicy: """Learned policy for grasping (continuous). Uses CEM for selecting actions.""" def __init__(self, q_func, state_shape, action_size, use_gpu=True, batch_size=64, build_target=False, include_timestep=True, checkpoint=None): """Initializes the policy. Args: q_func: Pyth...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CEMActorPolicy: """Learned policy for grasping (continuous). Uses CEM for selecting actions.""" def __init__(self, q_func, state_shape, action_size, use_gpu=True, batch_size=64, build_target=False, include_timestep=True, checkpoint=None): """Initializes the policy. Args: q_func: Python function t...
the_stack_v2_python_sparse
dql_grasping/policies.py
Tarkiyah/googleResearch
train
11
6b2866f37f7e3dbed3b736b42b75bc701b392ad3
[ "cache = [v1[::-1], v2[::-1]]\nself.list_all = [i for i in cache if i]\nself.cur = 0", "if self.cur == -1 or not self.list_all:\n return False\nnext_val = self.list_all[self.cur].pop()\nif self.list_all[self.cur]:\n self.cur = self.cur + 1 if self.cur < len(self.list_all) - 1 else 0\nelse:\n while self.c...
<|body_start_0|> cache = [v1[::-1], v2[::-1]] self.list_all = [i for i in cache if i] self.cur = 0 <|end_body_0|> <|body_start_1|> if self.cur == -1 or not self.list_all: return False next_val = self.list_all[self.cur].pop() if self.list_all[self.cur]: ...
ZigzagIterator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ZigzagIterator: def __init__(self, v1, v2): """Initialize your data structure here. :type v1: List[int] :type v2: List[int]""" <|body_0|> def next(self): """:rtype: int""" <|body_1|> def hasNext(self): """:rtype: bool""" <|body_2|> <|end...
stack_v2_sparse_classes_36k_train_007841
2,162
no_license
[ { "docstring": "Initialize your data structure here. :type v1: List[int] :type v2: List[int]", "name": "__init__", "signature": "def __init__(self, v1, v2)" }, { "docstring": ":rtype: int", "name": "next", "signature": "def next(self)" }, { "docstring": ":rtype: bool", "name"...
3
null
Implement the Python class `ZigzagIterator` described below. Class description: Implement the ZigzagIterator class. Method signatures and docstrings: - def __init__(self, v1, v2): Initialize your data structure here. :type v1: List[int] :type v2: List[int] - def next(self): :rtype: int - def hasNext(self): :rtype: bo...
Implement the Python class `ZigzagIterator` described below. Class description: Implement the ZigzagIterator class. Method signatures and docstrings: - def __init__(self, v1, v2): Initialize your data structure here. :type v1: List[int] :type v2: List[int] - def next(self): :rtype: int - def hasNext(self): :rtype: bo...
56383c2b07448a9017a7a707afb66e08b403ee76
<|skeleton|> class ZigzagIterator: def __init__(self, v1, v2): """Initialize your data structure here. :type v1: List[int] :type v2: List[int]""" <|body_0|> def next(self): """:rtype: int""" <|body_1|> def hasNext(self): """:rtype: bool""" <|body_2|> <|end...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ZigzagIterator: def __init__(self, v1, v2): """Initialize your data structure here. :type v1: List[int] :type v2: List[int]""" cache = [v1[::-1], v2[::-1]] self.list_all = [i for i in cache if i] self.cur = 0 def next(self): """:rtype: int""" if self.cur ==...
the_stack_v2_python_sparse
ALL_SOLUTIONS/281_Zigzag_Iterator.py
jamiezeminzhang/Leetcode_Python
train
2
74287659e00de320b5cca17a048fd0f1914775ec
[ "if value is None:\n return len(values['frequency'])\nreturn value", "if arg == 'frequency':\n return np.array(self.frequency)\nif arg == 'magnitude':\n return np.array(self.magnitude)\nif arg == 'phase':\n return np.array(self.phase)\nraise ValueError(f\"Unknown arg {arg}, must be: 'frequency', 'magn...
<|body_start_0|> if value is None: return len(values['frequency']) return value <|end_body_0|> <|body_start_1|> if arg == 'frequency': return np.array(self.frequency) if arg == 'magnitude': return np.array(self.magnitude) if arg == 'phase': ...
Class for holding calibration data Calibration is usually the transfer function of the instrument or sensor to be removed from the data. It is expected to be in the frequency domain. Regarding units: - Magnitude units are dependent on use case - Phase is in radians
CalibrationData
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CalibrationData: """Class for holding calibration data Calibration is usually the transfer function of the instrument or sensor to be removed from the data. It is expected to be in the frequency domain. Regarding units: - Magnitude units are dependent on use case - Phase is in radians""" def...
stack_v2_sparse_classes_36k_train_007842
18,607
permissive
[ { "docstring": "Validate number of samples", "name": "validate_n_samples", "signature": "def validate_n_samples(cls, value: Union[int, None], values: Dict[str, Any]) -> int" }, { "docstring": "Get data mainly for the purposes of plotting", "name": "__getitem__", "signature": "def __getit...
4
stack_v2_sparse_classes_30k_train_012599
Implement the Python class `CalibrationData` described below. Class description: Class for holding calibration data Calibration is usually the transfer function of the instrument or sensor to be removed from the data. It is expected to be in the frequency domain. Regarding units: - Magnitude units are dependent on use...
Implement the Python class `CalibrationData` described below. Class description: Class for holding calibration data Calibration is usually the transfer function of the instrument or sensor to be removed from the data. It is expected to be in the frequency domain. Regarding units: - Magnitude units are dependent on use...
cba60747803b6c582eaaf1a670a7f455f5724ebd
<|skeleton|> class CalibrationData: """Class for holding calibration data Calibration is usually the transfer function of the instrument or sensor to be removed from the data. It is expected to be in the frequency domain. Regarding units: - Magnitude units are dependent on use case - Phase is in radians""" def...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CalibrationData: """Class for holding calibration data Calibration is usually the transfer function of the instrument or sensor to be removed from the data. It is expected to be in the frequency domain. Regarding units: - Magnitude units are dependent on use case - Phase is in radians""" def validate_n_s...
the_stack_v2_python_sparse
resistics/calibrate.py
resistics/resistics
train
47
b059a4fdf533e041f07557755a8dfb1bafbdc92c
[ "i *= 10\nfor j in range(10):\n i2 = i + j\n if i2 > n:\n break\n r.append(i2)\n self.go(n, i2, r)", "r = []\nfor i in range(1, 10):\n if i > n:\n break\n r.append(i)\n self.go(n, i, r)\nreturn r" ]
<|body_start_0|> i *= 10 for j in range(10): i2 = i + j if i2 > n: break r.append(i2) self.go(n, i2, r) <|end_body_0|> <|body_start_1|> r = [] for i in range(1, 10): if i > n: break r...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def go(self, n, i, r): """:type i: int :type p: int :type r: List[int]""" <|body_0|> def lexicalOrder(self, n): """:type n: int :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> i *= 10 for j in range(10): ...
stack_v2_sparse_classes_36k_train_007843
931
no_license
[ { "docstring": ":type i: int :type p: int :type r: List[int]", "name": "go", "signature": "def go(self, n, i, r)" }, { "docstring": ":type n: int :rtype: List[int]", "name": "lexicalOrder", "signature": "def lexicalOrder(self, n)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def go(self, n, i, r): :type i: int :type p: int :type r: List[int] - def lexicalOrder(self, n): :type n: int :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def go(self, n, i, r): :type i: int :type p: int :type r: List[int] - def lexicalOrder(self, n): :type n: int :rtype: List[int] <|skeleton|> class Solution: def go(self, n,...
f08b8a3f7de7a456a55573f3c4d8920a80f03a1a
<|skeleton|> class Solution: def go(self, n, i, r): """:type i: int :type p: int :type r: List[int]""" <|body_0|> def lexicalOrder(self, n): """:type n: int :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def go(self, n, i, r): """:type i: int :type p: int :type r: List[int]""" i *= 10 for j in range(10): i2 = i + j if i2 > n: break r.append(i2) self.go(n, i2, r) def lexicalOrder(self, n): """:type n:...
the_stack_v2_python_sparse
py/386.py
pipi32167/LeetCode
train
1
2c211f1fb3b4ccf847ff2a4dbbe6683c999d96f0
[ "revoked_token = self._client.revoke_token(token=token)\nif check:\n self.check_token_is_revoked(revoked_token, must_revoked=False)\nreturn revoked_token", "def predicate():\n try:\n self.get_token_validate(token)\n is_revoked = True\n except exceptions.NotFound:\n is_revoked = False...
<|body_start_0|> revoked_token = self._client.revoke_token(token=token) if check: self.check_token_is_revoked(revoked_token, must_revoked=False) return revoked_token <|end_body_0|> <|body_start_1|> def predicate(): try: self.get_token_validate(tok...
Token steps.
TokenSteps
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TokenSteps: """Token steps.""" def revoke_token(self, token, check=True): """Step to revoke a token. Args: token (str): The token to be revoked. check (bool): flag whether to check step or not Returns: keystoneclient.access.AccessInfo: token""" <|body_0|> def check_token...
stack_v2_sparse_classes_36k_train_007844
4,425
no_license
[ { "docstring": "Step to revoke a token. Args: token (str): The token to be revoked. check (bool): flag whether to check step or not Returns: keystoneclient.access.AccessInfo: token", "name": "revoke_token", "signature": "def revoke_token(self, token, check=True)" }, { "docstring": "Step to check...
4
stack_v2_sparse_classes_30k_train_001083
Implement the Python class `TokenSteps` described below. Class description: Token steps. Method signatures and docstrings: - def revoke_token(self, token, check=True): Step to revoke a token. Args: token (str): The token to be revoked. check (bool): flag whether to check step or not Returns: keystoneclient.access.Acc...
Implement the Python class `TokenSteps` described below. Class description: Token steps. Method signatures and docstrings: - def revoke_token(self, token, check=True): Step to revoke a token. Args: token (str): The token to be revoked. check (bool): flag whether to check step or not Returns: keystoneclient.access.Acc...
e7583444cd24893ec6ae237b47db7c605b99b0c5
<|skeleton|> class TokenSteps: """Token steps.""" def revoke_token(self, token, check=True): """Step to revoke a token. Args: token (str): The token to be revoked. check (bool): flag whether to check step or not Returns: keystoneclient.access.AccessInfo: token""" <|body_0|> def check_token...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TokenSteps: """Token steps.""" def revoke_token(self, token, check=True): """Step to revoke a token. Args: token (str): The token to be revoked. check (bool): flag whether to check step or not Returns: keystoneclient.access.AccessInfo: token""" revoked_token = self._client.revoke_token(to...
the_stack_v2_python_sparse
stepler/keystone/steps/tokens.py
Mirantis/stepler
train
16
37a00cc28e9012c07ef55ced741290f62404f5c8
[ "classes = [cls]\nparameterschema = {'type': 'object', 'additionalProperties': False}\nwhile len(classes):\n curr_cls = classes.pop(0)\n classes.extend(curr_cls.__bases__)\n if not hasattr(curr_cls, 'arguments_structure'):\n continue\n add_parameterschema_argument(parameterschema, curr_cls.argume...
<|body_start_0|> classes = [cls] parameterschema = {'type': 'object', 'additionalProperties': False} while len(classes): curr_cls = classes.pop(0) classes.extend(curr_cls.__bases__) if not hasattr(curr_cls, 'arguments_structure'): continue ...
Class responsible for creating parsers for arguments from command line or json configs. The child class should define its own `arguments_structure` and from_argparse/from_json methods so that it could be instantiated from command line arguments or json config.
ArgumentsHandler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ArgumentsHandler: """Class responsible for creating parsers for arguments from command line or json configs. The child class should define its own `arguments_structure` and from_argparse/from_json methods so that it could be instantiated from command line arguments or json config.""" def for...
stack_v2_sparse_classes_36k_train_007845
17,901
permissive
[ { "docstring": "Creates parameter schema based on `arguments_structure` of class and its all parent classes. Returns ------- Dict : Parameter schema for the class.", "name": "form_parameterschema", "signature": "def form_parameterschema(cls) -> Dict" }, { "docstring": "Creates argparse parser ba...
2
stack_v2_sparse_classes_30k_train_000439
Implement the Python class `ArgumentsHandler` described below. Class description: Class responsible for creating parsers for arguments from command line or json configs. The child class should define its own `arguments_structure` and from_argparse/from_json methods so that it could be instantiated from command line ar...
Implement the Python class `ArgumentsHandler` described below. Class description: Class responsible for creating parsers for arguments from command line or json configs. The child class should define its own `arguments_structure` and from_argparse/from_json methods so that it could be instantiated from command line ar...
9ec31ca0da1ba4d3445b98c08a8de4da45a198a8
<|skeleton|> class ArgumentsHandler: """Class responsible for creating parsers for arguments from command line or json configs. The child class should define its own `arguments_structure` and from_argparse/from_json methods so that it could be instantiated from command line arguments or json config.""" def for...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ArgumentsHandler: """Class responsible for creating parsers for arguments from command line or json configs. The child class should define its own `arguments_structure` and from_argparse/from_json methods so that it could be instantiated from command line arguments or json config.""" def form_parametersc...
the_stack_v2_python_sparse
kenning/utils/args_manager.py
antmicro/kenning
train
55
1e99306d2916f977f93567f6069f0638d0fdee8f
[ "if pos_label not in (0, 1):\n raise ValueError('only {0, 1} are accepted for `pos_label`')\ny_true = convert_binary_labels(y_true).ravel()\nscore = _check_binary_score(score, pos_label)\nh = 1.0 - y_true * score\nh[h < 0] = 0.0\nreturn h", "if pos_label not in (0, 1):\n raise ValueError('only {0, 1} are ac...
<|body_start_0|> if pos_label not in (0, 1): raise ValueError('only {0, 1} are accepted for `pos_label`') y_true = convert_binary_labels(y_true).ravel() score = _check_binary_score(score, pos_label) h = 1.0 - y_true * score h[h < 0] = 0.0 return h <|end_body_0...
Hinge Loss Function. The function computes the average distance between the model and the data using hinge loss, a one-sided metric that considers only prediction errors. Hinge loss is used in maximal margin classifiers such as support vector machines. After converting the labels to {-1, +1}, then the hinge loss is def...
CLossHinge
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CLossHinge: """Hinge Loss Function. The function computes the average distance between the model and the data using hinge loss, a one-sided metric that considers only prediction errors. Hinge loss is used in maximal margin classifiers such as support vector machines. After converting the labels t...
stack_v2_sparse_classes_36k_train_007846
6,353
permissive
[ { "docstring": "Computes the value of the hinge loss function. Parameters ---------- y_true : CArray Ground truth (correct), targets. Vector-like array. score : CArray Outputs (predicted), targets. 2-D array of shape (n_samples, n_classes) or 1-D flat array of shape (n_samples,). If 1-D array, the probabilities...
2
null
Implement the Python class `CLossHinge` described below. Class description: Hinge Loss Function. The function computes the average distance between the model and the data using hinge loss, a one-sided metric that considers only prediction errors. Hinge loss is used in maximal margin classifiers such as support vector ...
Implement the Python class `CLossHinge` described below. Class description: Hinge Loss Function. The function computes the average distance between the model and the data using hinge loss, a one-sided metric that considers only prediction errors. Hinge loss is used in maximal margin classifiers such as support vector ...
431373e65d8cfe2cb7cf042ce1a6c9519ea5a14a
<|skeleton|> class CLossHinge: """Hinge Loss Function. The function computes the average distance between the model and the data using hinge loss, a one-sided metric that considers only prediction errors. Hinge loss is used in maximal margin classifiers such as support vector machines. After converting the labels t...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CLossHinge: """Hinge Loss Function. The function computes the average distance between the model and the data using hinge loss, a one-sided metric that considers only prediction errors. Hinge loss is used in maximal margin classifiers such as support vector machines. After converting the labels to {-1, +1}, t...
the_stack_v2_python_sparse
src/secml/ml/classifiers/loss/c_loss_hinge.py
Cinofix/secml
train
0
d01e533c15be3ffa5d7717e6909ec649a258309c
[ "self.__ops = ops\nself.__nops = len(ops)\nfor iop in range(self.__nops):\n if not isinstance(self.__ops[iop], operator):\n raise Exception('Elements of ops list must be of type operator')\nif self.__nops != len(dims):\n raise Exception('Number of dimensions (%d) must equal number of operators (%d)' % ...
<|body_start_0|> self.__ops = ops self.__nops = len(ops) for iop in range(self.__nops): if not isinstance(self.__ops[iop], operator): raise Exception('Elements of ops list must be of type operator') if self.__nops != len(dims): raise Exception('Num...
A chain operator
chainop
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class chainop: """A chain operator""" def __init__(self, ops, dims): """chainop constructor Parameters: ops - a list of operators to be chained dims - a list of dictionaries that contain the dimensions of the inputs and outputs of the arrays For example dims = [{'nrows': 10, 'ncols': 10},....
stack_v2_sparse_classes_36k_train_007847
13,837
no_license
[ { "docstring": "chainop constructor Parameters: ops - a list of operators to be chained dims - a list of dictionaries that contain the dimensions of the inputs and outputs of the arrays For example dims = [{'nrows': 10, 'ncols': 10},...] Note that the operators will be applied in the order they come in the list...
4
stack_v2_sparse_classes_30k_train_020130
Implement the Python class `chainop` described below. Class description: A chain operator Method signatures and docstrings: - def __init__(self, ops, dims): chainop constructor Parameters: ops - a list of operators to be chained dims - a list of dictionaries that contain the dimensions of the inputs and outputs of th...
Implement the Python class `chainop` described below. Class description: A chain operator Method signatures and docstrings: - def __init__(self, ops, dims): chainop constructor Parameters: ops - a list of operators to be chained dims - a list of dictionaries that contain the dimensions of the inputs and outputs of th...
32a303eddd13385d8778b8bb3b4fbbfbe78bea51
<|skeleton|> class chainop: """A chain operator""" def __init__(self, ops, dims): """chainop constructor Parameters: ops - a list of operators to be chained dims - a list of dictionaries that contain the dimensions of the inputs and outputs of the arrays For example dims = [{'nrows': 10, 'ncols': 10},....
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class chainop: """A chain operator""" def __init__(self, ops, dims): """chainop constructor Parameters: ops - a list of operators to be chained dims - a list of dictionaries that contain the dimensions of the inputs and outputs of the arrays For example dims = [{'nrows': 10, 'ncols': 10},...] Note that...
the_stack_v2_python_sparse
opt/linopt/combops.py
ke0m/scaas
train
2
c731af8fa4328a291e66766b9bf16f9a99a8a052
[ "if not function:\n raise ArgumentError('No window function provided')\nif window_size < 1:\n raise ArgumentError('Window size should be >= 1')\nif not source_attribute:\n raise ArgumentError('Source attribute not specified')\nif not target_attribute:\n raise ArgumentError('Target attribute not specifie...
<|body_start_0|> if not function: raise ArgumentError('No window function provided') if window_size < 1: raise ArgumentError('Window size should be >= 1') if not source_attribute: raise ArgumentError('Source attribute not specified') if not target_attr...
WindowFunction
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WindowFunction: def __init__(self, function, window_key, target_attribute, source_attribute, window_size, label): """Creates a window function.""" <|body_0|> def __call__(self, record): """Collects the source value. If the window for the `window_key` is filled, then ...
stack_v2_sparse_classes_36k_train_007848
8,406
no_license
[ { "docstring": "Creates a window function.", "name": "__init__", "signature": "def __init__(self, function, window_key, target_attribute, source_attribute, window_size, label)" }, { "docstring": "Collects the source value. If the window for the `window_key` is filled, then apply the window funct...
2
stack_v2_sparse_classes_30k_train_008464
Implement the Python class `WindowFunction` described below. Class description: Implement the WindowFunction class. Method signatures and docstrings: - def __init__(self, function, window_key, target_attribute, source_attribute, window_size, label): Creates a window function. - def __call__(self, record): Collects th...
Implement the Python class `WindowFunction` described below. Class description: Implement the WindowFunction class. Method signatures and docstrings: - def __init__(self, function, window_key, target_attribute, source_attribute, window_size, label): Creates a window function. - def __call__(self, record): Collects th...
067f502154eefc4199ad3f3e0d54fad4acd2d274
<|skeleton|> class WindowFunction: def __init__(self, function, window_key, target_attribute, source_attribute, window_size, label): """Creates a window function.""" <|body_0|> def __call__(self, record): """Collects the source value. If the window for the `window_key` is filled, then ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WindowFunction: def __init__(self, function, window_key, target_attribute, source_attribute, window_size, label): """Creates a window function.""" if not function: raise ArgumentError('No window function provided') if window_size < 1: raise ArgumentError('Window...
the_stack_v2_python_sparse
env/Lib/site-packages/cubes/statutils.py
wgiovanni/teg-backend-integration
train
0
b4ec57017ae83b2a6e36f965081115befbc706c7
[ "self.assert_parse_received_correct_type(raw_value, str)\nif self.should_strip_input:\n return raw_value.strip()\nreturn raw_value", "value = self.empty_value\nif raw_value is not UNSET:\n raw_value = self.parse_as_text(raw_value)\nif raw_value:\n value = raw_value\nreturn value" ]
<|body_start_0|> self.assert_parse_received_correct_type(raw_value, str) if self.should_strip_input: return raw_value.strip() return raw_value <|end_body_0|> <|body_start_1|> value = self.empty_value if raw_value is not UNSET: raw_value = self.parse_as_te...
CharField
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CharField: def parse_as_text(self, raw_value): """Responsible for raising an error if the raw extracted value is not a string instance. If it recognizes the input as a string, use Django's `force_text` as an additional safety check. Strip the input based on `.should_strip_input`""" ...
stack_v2_sparse_classes_36k_train_007849
16,303
permissive
[ { "docstring": "Responsible for raising an error if the raw extracted value is not a string instance. If it recognizes the input as a string, use Django's `force_text` as an additional safety check. Strip the input based on `.should_strip_input`", "name": "parse_as_text", "signature": "def parse_as_text...
2
null
Implement the Python class `CharField` described below. Class description: Implement the CharField class. Method signatures and docstrings: - def parse_as_text(self, raw_value): Responsible for raising an error if the raw extracted value is not a string instance. If it recognizes the input as a string, use Django's `...
Implement the Python class `CharField` described below. Class description: Implement the CharField class. Method signatures and docstrings: - def parse_as_text(self, raw_value): Responsible for raising an error if the raw extracted value is not a string instance. If it recognizes the input as a string, use Django's `...
8755e64c13e2b6f9bef9bbee47011253f20e7e0d
<|skeleton|> class CharField: def parse_as_text(self, raw_value): """Responsible for raising an error if the raw extracted value is not a string instance. If it recognizes the input as a string, use Django's `force_text` as an additional safety check. Strip the input based on `.should_strip_input`""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CharField: def parse_as_text(self, raw_value): """Responsible for raising an error if the raw extracted value is not a string instance. If it recognizes the input as a string, use Django's `force_text` as an additional safety check. Strip the input based on `.should_strip_input`""" self.assert...
the_stack_v2_python_sparse
formation/field_types.py
codeforamerica/intake
train
51
251ad93753c985faa78c2fd3e4807b6fd486ac80
[ "if not nums:\n return []\ncnt = {}\nfor i in range(len(nums)):\n if nums[i] not in cnt:\n cnt[nums[i]] = 1\n else:\n cnt[nums[i]] += 1\nreturn [key for key, value in sorted(cnt.items(), key=lambda x: x[1], reverse=True)][:k]", "counts = collections.Counter(nums)\nprint(counts)\nheap = []\n...
<|body_start_0|> if not nums: return [] cnt = {} for i in range(len(nums)): if nums[i] not in cnt: cnt[nums[i]] = 1 else: cnt[nums[i]] += 1 return [key for key, value in sorted(cnt.items(), key=lambda x: x[1], reverse=Tr...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def topKFrequent(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" <|body_0|> def topKFrequent2(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_007850
1,371
no_license
[ { "docstring": ":type nums: List[int] :type k: int :rtype: List[int]", "name": "topKFrequent", "signature": "def topKFrequent(self, nums, k)" }, { "docstring": ":type nums: List[int] :type k: int :rtype: List[int]", "name": "topKFrequent2", "signature": "def topKFrequent2(self, nums, k)"...
2
stack_v2_sparse_classes_30k_train_013935
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def topKFrequent(self, nums, k): :type nums: List[int] :type k: int :rtype: List[int] - def topKFrequent2(self, nums, k): :type nums: List[int] :type k: int :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def topKFrequent(self, nums, k): :type nums: List[int] :type k: int :rtype: List[int] - def topKFrequent2(self, nums, k): :type nums: List[int] :type k: int :rtype: List[int] <|...
4960986edae561c1f9f32f3c97ce144f976d7844
<|skeleton|> class Solution: def topKFrequent(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" <|body_0|> def topKFrequent2(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def topKFrequent(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" if not nums: return [] cnt = {} for i in range(len(nums)): if nums[i] not in cnt: cnt[nums[i]] = 1 else: cnt...
the_stack_v2_python_sparse
hash_table/top_k_frequent_elements.py
AlexSchumi/Algorithms
train
0
c28878f7620d703a5c876272e0403f265ddd2004
[ "pth = os.path.join(self.root, 'imagenet100.txt')\nif not os.path.isfile(pth):\n url = 'https://raw.githubusercontent.com/HobbitLong/CMC/master/imagenet100.txt'\n try:\n from urllib.request import urlretrieve\n urlretrieve(url, pth)\n except Exception:\n raise FileNotFoundError('File %...
<|body_start_0|> pth = os.path.join(self.root, 'imagenet100.txt') if not os.path.isfile(pth): url = 'https://raw.githubusercontent.com/HobbitLong/CMC/master/imagenet100.txt' try: from urllib.request import urlretrieve urlretrieve(url, pth) ...
ImageNet100Dataset
[ "LicenseRef-scancode-cecill-b-en" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageNet100Dataset: def _extract_classes(self, all_classes=None): """:param all_classes: list of all class names used to check if filtered class are inside them :return: a list of 100 class names extracted from 'imagenet100.txt' sorted alphabetically""" <|body_0|> def _find_...
stack_v2_sparse_classes_36k_train_007851
19,654
permissive
[ { "docstring": ":param all_classes: list of all class names used to check if filtered class are inside them :return: a list of 100 class names extracted from 'imagenet100.txt' sorted alphabetically", "name": "_extract_classes", "signature": "def _extract_classes(self, all_classes=None)" }, { "do...
2
null
Implement the Python class `ImageNet100Dataset` described below. Class description: Implement the ImageNet100Dataset class. Method signatures and docstrings: - def _extract_classes(self, all_classes=None): :param all_classes: list of all class names used to check if filtered class are inside them :return: a list of 1...
Implement the Python class `ImageNet100Dataset` described below. Class description: Implement the ImageNet100Dataset class. Method signatures and docstrings: - def _extract_classes(self, all_classes=None): :param all_classes: list of all class names used to check if filtered class are inside them :return: a list of 1...
7a807ed690929563ce36086eaf0998d0e8856aea
<|skeleton|> class ImageNet100Dataset: def _extract_classes(self, all_classes=None): """:param all_classes: list of all class names used to check if filtered class are inside them :return: a list of 100 class names extracted from 'imagenet100.txt' sorted alphabetically""" <|body_0|> def _find_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImageNet100Dataset: def _extract_classes(self, all_classes=None): """:param all_classes: list of all class names used to check if filtered class are inside them :return: a list of 100 class names extracted from 'imagenet100.txt' sorted alphabetically""" pth = os.path.join(self.root, 'imagenet1...
the_stack_v2_python_sparse
pynet/datasets/imagenet.py
Duplums/pynet
train
0
3abb49531763c60f4767c32a85c2440ef42740d7
[ "self.detect_language = detect_language\nself.callback_url = callback_url\nself.callback_method = callback_method\nself.username = username\nself.password = password\nself.tag = tag\nself.callback_timeout = callback_timeout", "if dictionary is None:\n return None\ndetect_language = dictionary.get('detectLangua...
<|body_start_0|> self.detect_language = detect_language self.callback_url = callback_url self.callback_method = callback_method self.username = username self.password = password self.tag = tag self.callback_timeout = callback_timeout <|end_body_0|> <|body_start_1...
Implementation of the 'TranscribeRecordingRequest' model. TODO: type model description here. Attributes: detect_language (bool): Indicates that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and transcribe accordingly. Current supported l...
TranscribeRecordingRequest
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TranscribeRecordingRequest: """Implementation of the 'TranscribeRecordingRequest' model. TODO: type model description here. Attributes: detect_language (bool): Indicates that the recording may not be in English, and the transcription service will need to detect the dominant language the recording...
stack_v2_sparse_classes_36k_train_007852
3,233
permissive
[ { "docstring": "Constructor for the TranscribeRecordingRequest class", "name": "__init__", "signature": "def __init__(self, detect_language=None, callback_url=None, callback_method=None, username=None, password=None, tag=None, callback_timeout=None)" }, { "docstring": "Creates an instance of thi...
2
null
Implement the Python class `TranscribeRecordingRequest` described below. Class description: Implementation of the 'TranscribeRecordingRequest' model. TODO: type model description here. Attributes: detect_language (bool): Indicates that the recording may not be in English, and the transcription service will need to det...
Implement the Python class `TranscribeRecordingRequest` described below. Class description: Implementation of the 'TranscribeRecordingRequest' model. TODO: type model description here. Attributes: detect_language (bool): Indicates that the recording may not be in English, and the transcription service will need to det...
447df3cc8cb7acaf3361d842630c432a9c31ce6e
<|skeleton|> class TranscribeRecordingRequest: """Implementation of the 'TranscribeRecordingRequest' model. TODO: type model description here. Attributes: detect_language (bool): Indicates that the recording may not be in English, and the transcription service will need to detect the dominant language the recording...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TranscribeRecordingRequest: """Implementation of the 'TranscribeRecordingRequest' model. TODO: type model description here. Attributes: detect_language (bool): Indicates that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and tr...
the_stack_v2_python_sparse
bandwidth/voice/models/transcribe_recording_request.py
Bandwidth/python-sdk
train
10
080f763229dc6df2d2a54807ffab2b120f726c4e
[ "self.config = config\nprint(config)\nself.model = TiSASRec(config['model'])\nself.num_batch = config['model']['n_users'] // config['model']['batch_size']\nself.bce_criterion = torch.nn.BCEWithLogitsLoss()\nsuper(TiSASRecEngine, self).__init__(config)", "assert hasattr(self, 'model'), 'Please specify the exact mo...
<|body_start_0|> self.config = config print(config) self.model = TiSASRec(config['model']) self.num_batch = config['model']['n_users'] // config['model']['batch_size'] self.bce_criterion = torch.nn.BCEWithLogitsLoss() super(TiSASRecEngine, self).__init__(config) <|end_bod...
Engine for training & evaluating TiSASRec model.
TiSASRecEngine
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TiSASRecEngine: """Engine for training & evaluating TiSASRec model.""" def __init__(self, config): """Initialize TiSASRecEngine Class.""" <|body_0|> def train_single_batch(self, batch_data, ratings=None): """Train the model in a single batch.""" <|body_1|...
stack_v2_sparse_classes_36k_train_007853
15,823
permissive
[ { "docstring": "Initialize TiSASRecEngine Class.", "name": "__init__", "signature": "def __init__(self, config)" }, { "docstring": "Train the model in a single batch.", "name": "train_single_batch", "signature": "def train_single_batch(self, batch_data, ratings=None)" }, { "docst...
3
stack_v2_sparse_classes_30k_train_011966
Implement the Python class `TiSASRecEngine` described below. Class description: Engine for training & evaluating TiSASRec model. Method signatures and docstrings: - def __init__(self, config): Initialize TiSASRecEngine Class. - def train_single_batch(self, batch_data, ratings=None): Train the model in a single batch....
Implement the Python class `TiSASRecEngine` described below. Class description: Engine for training & evaluating TiSASRec model. Method signatures and docstrings: - def __init__(self, config): Initialize TiSASRecEngine Class. - def train_single_batch(self, batch_data, ratings=None): Train the model in a single batch....
625189d5e1002a3edc27c3e3ce075fddf7ae1c92
<|skeleton|> class TiSASRecEngine: """Engine for training & evaluating TiSASRec model.""" def __init__(self, config): """Initialize TiSASRecEngine Class.""" <|body_0|> def train_single_batch(self, batch_data, ratings=None): """Train the model in a single batch.""" <|body_1|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TiSASRecEngine: """Engine for training & evaluating TiSASRec model.""" def __init__(self, config): """Initialize TiSASRecEngine Class.""" self.config = config print(config) self.model = TiSASRec(config['model']) self.num_batch = config['model']['n_users'] // config...
the_stack_v2_python_sparse
beta_rec/models/tisasrec.py
beta-team/beta-recsys
train
156
8276e1b589c31740fca51c035d2c0f21d9683078
[ "if config is None:\n raise TypeError('Input parameter config is None')\nif not isinstance(config, StubConfiguration):\n raise TypeError('Input parameter config is not a StubConfiguration')\nself._config = config", "path_split = service_name.split('.')\nmodule_name = '%s_client' % '.'.join(path_split[:-1])\...
<|body_start_0|> if config is None: raise TypeError('Input parameter config is None') if not isinstance(config, StubConfiguration): raise TypeError('Input parameter config is not a StubConfiguration') self._config = config <|end_body_0|> <|body_start_1|> path_spl...
Factory for client-side vAPI stubs
StubFactory
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StubFactory: """Factory for client-side vAPI stubs""" def __init__(self, config): """Initialize the stub factory :type config: :class:`StubConfiguration` :param config: Configuration data for vAPI stubs""" <|body_0|> def create_stub(self, service_name): """Create...
stack_v2_sparse_classes_36k_train_007854
16,678
no_license
[ { "docstring": "Initialize the stub factory :type config: :class:`StubConfiguration` :param config: Configuration data for vAPI stubs", "name": "__init__", "signature": "def __init__(self, config)" }, { "docstring": "Create a stub corresponding to the specified service name :type service_name: :...
2
null
Implement the Python class `StubFactory` described below. Class description: Factory for client-side vAPI stubs Method signatures and docstrings: - def __init__(self, config): Initialize the stub factory :type config: :class:`StubConfiguration` :param config: Configuration data for vAPI stubs - def create_stub(self, ...
Implement the Python class `StubFactory` described below. Class description: Factory for client-side vAPI stubs Method signatures and docstrings: - def __init__(self, config): Initialize the stub factory :type config: :class:`StubConfiguration` :param config: Configuration data for vAPI stubs - def create_stub(self, ...
5d395700ab3d0d1d45b497e48beab8c366fca9f5
<|skeleton|> class StubFactory: """Factory for client-side vAPI stubs""" def __init__(self, config): """Initialize the stub factory :type config: :class:`StubConfiguration` :param config: Configuration data for vAPI stubs""" <|body_0|> def create_stub(self, service_name): """Create...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StubFactory: """Factory for client-side vAPI stubs""" def __init__(self, config): """Initialize the stub factory :type config: :class:`StubConfiguration` :param config: Configuration data for vAPI stubs""" if config is None: raise TypeError('Input parameter config is None') ...
the_stack_v2_python_sparse
alexa-program/vmware/vapi/bindings/stub.py
taromurata/TDP2018_VMCAPI
train
1
ad10a6b19597963f86834e618fa4dd179df85216
[ "connection = client_object.connection\ncommand = 'get certificate api thumbprint'\npylogger.debug('Command to get manager thumbprint %s' % command)\nexpect_prompt = ['bytes*', '>']\nresult = connection.request(command, expect_prompt)\nstdout_lines = result.response_data.splitlines()\nthumbprint_index_in_output = 0...
<|body_start_0|> connection = client_object.connection command = 'get certificate api thumbprint' pylogger.debug('Command to get manager thumbprint %s' % command) expect_prompt = ['bytes*', '>'] result = connection.request(command, expect_prompt) stdout_lines = result.res...
NSX70CRUDImpl
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NSX70CRUDImpl: def get_manager_thumbprint(cls, client_object): """Method to NSX manager thumbprint Sample output of the command 'show api certificate thumbprint': nimbus-cloud-nsxmanager> show api certificate thumbprint f71250ab638c9939a91b0db1b89619a43a9cda44a2c8628167ce5327d44bd16f nim...
stack_v2_sparse_classes_36k_train_007855
2,819
no_license
[ { "docstring": "Method to NSX manager thumbprint Sample output of the command 'show api certificate thumbprint': nimbus-cloud-nsxmanager> show api certificate thumbprint f71250ab638c9939a91b0db1b89619a43a9cda44a2c8628167ce5327d44bd16f nimbus-cloud-nsxmanager>", "name": "get_manager_thumbprint", "signatu...
2
null
Implement the Python class `NSX70CRUDImpl` described below. Class description: Implement the NSX70CRUDImpl class. Method signatures and docstrings: - def get_manager_thumbprint(cls, client_object): Method to NSX manager thumbprint Sample output of the command 'show api certificate thumbprint': nimbus-cloud-nsxmanager...
Implement the Python class `NSX70CRUDImpl` described below. Class description: Implement the NSX70CRUDImpl class. Method signatures and docstrings: - def get_manager_thumbprint(cls, client_object): Method to NSX manager thumbprint Sample output of the command 'show api certificate thumbprint': nimbus-cloud-nsxmanager...
5b55817c050b637e2747084290f6206d2e622938
<|skeleton|> class NSX70CRUDImpl: def get_manager_thumbprint(cls, client_object): """Method to NSX manager thumbprint Sample output of the command 'show api certificate thumbprint': nimbus-cloud-nsxmanager> show api certificate thumbprint f71250ab638c9939a91b0db1b89619a43a9cda44a2c8628167ce5327d44bd16f nim...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NSX70CRUDImpl: def get_manager_thumbprint(cls, client_object): """Method to NSX manager thumbprint Sample output of the command 'show api certificate thumbprint': nimbus-cloud-nsxmanager> show api certificate thumbprint f71250ab638c9939a91b0db1b89619a43a9cda44a2c8628167ce5327d44bd16f nimbus-cloud-nsxm...
the_stack_v2_python_sparse
SystemTesting/pylib/vmware/nsx/manager/cli/nsx70_crud_impl.py
Cloudxtreme/MyProject
train
0
c0ddf5ca0ef1bc8e4b2a8c34e87b8fa2fba8a98b
[ "self.certificate = certificate\nself.exchange = exchange\nself.filer_id = filer_id\nself.password = password\nself.server_ip = server_ip\nself.username = username\nself.virtual_host = virtual_host", "if dictionary is None:\n return None\ncertificate = dictionary.get('certificate')\nexchange = dictionary.get('...
<|body_start_0|> self.certificate = certificate self.exchange = exchange self.filer_id = filer_id self.password = password self.server_ip = server_ip self.username = username self.virtual_host = virtual_host <|end_body_0|> <|body_start_1|> if dictionary i...
Implementation of the 'AMQPTargetConfig' model. TODO: type description here. Attributes: certificate (string): Specifies the certificate. exchange (string): Specifies the exchange. filer_id (long|int): Specifies the filer id. password (string): Specifies the password. server_ip (string): Specifies the server ip. userna...
AMQPTargetConfig
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AMQPTargetConfig: """Implementation of the 'AMQPTargetConfig' model. TODO: type description here. Attributes: certificate (string): Specifies the certificate. exchange (string): Specifies the exchange. filer_id (long|int): Specifies the filer id. password (string): Specifies the password. server_...
stack_v2_sparse_classes_36k_train_007856
2,660
permissive
[ { "docstring": "Constructor for the AMQPTargetConfig class", "name": "__init__", "signature": "def __init__(self, certificate=None, exchange=None, filer_id=None, password=None, server_ip=None, username=None, virtual_host=None)" }, { "docstring": "Creates an instance of this model from a dictiona...
2
stack_v2_sparse_classes_30k_train_010696
Implement the Python class `AMQPTargetConfig` described below. Class description: Implementation of the 'AMQPTargetConfig' model. TODO: type description here. Attributes: certificate (string): Specifies the certificate. exchange (string): Specifies the exchange. filer_id (long|int): Specifies the filer id. password (s...
Implement the Python class `AMQPTargetConfig` described below. Class description: Implementation of the 'AMQPTargetConfig' model. TODO: type description here. Attributes: certificate (string): Specifies the certificate. exchange (string): Specifies the exchange. filer_id (long|int): Specifies the filer id. password (s...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class AMQPTargetConfig: """Implementation of the 'AMQPTargetConfig' model. TODO: type description here. Attributes: certificate (string): Specifies the certificate. exchange (string): Specifies the exchange. filer_id (long|int): Specifies the filer id. password (string): Specifies the password. server_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AMQPTargetConfig: """Implementation of the 'AMQPTargetConfig' model. TODO: type description here. Attributes: certificate (string): Specifies the certificate. exchange (string): Specifies the exchange. filer_id (long|int): Specifies the filer id. password (string): Specifies the password. server_ip (string): ...
the_stack_v2_python_sparse
cohesity_management_sdk/models/amqp_target_config.py
cohesity/management-sdk-python
train
24
7102898c76ab92c702557deb0f20aa42967d2770
[ "with mute_signals(post_save):\n profile = ProfileFactory(address=None)\nassert profile.address1 is None\nassert profile.address2 is None\nassert profile.address3 is None", "with mute_signals(post_save):\n profile = ProfileFactory(address='')\nassert profile.address1 == ''\nassert profile.address2 == ''\nas...
<|body_start_0|> with mute_signals(post_save): profile = ProfileFactory(address=None) assert profile.address1 is None assert profile.address2 is None assert profile.address3 is None <|end_body_0|> <|body_start_1|> with mute_signals(post_save): profile = P...
Tests for splitting a user's address field
ProfileAddressTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProfileAddressTests: """Tests for splitting a user's address field""" def test_unset_address(self): """Test splitting an unset address""" <|body_0|> def test_empty_address(self): """Test splitting an empty address""" <|body_1|> def test_short_address...
stack_v2_sparse_classes_36k_train_007857
10,083
permissive
[ { "docstring": "Test splitting an unset address", "name": "test_unset_address", "signature": "def test_unset_address(self)" }, { "docstring": "Test splitting an empty address", "name": "test_empty_address", "signature": "def test_empty_address(self)" }, { "docstring": "Test split...
4
null
Implement the Python class `ProfileAddressTests` described below. Class description: Tests for splitting a user's address field Method signatures and docstrings: - def test_unset_address(self): Test splitting an unset address - def test_empty_address(self): Test splitting an empty address - def test_short_address(sel...
Implement the Python class `ProfileAddressTests` described below. Class description: Tests for splitting a user's address field Method signatures and docstrings: - def test_unset_address(self): Test splitting an unset address - def test_empty_address(self): Test splitting an empty address - def test_short_address(sel...
d6564caca0b7bbfd31e67a751564107fd17d6eb0
<|skeleton|> class ProfileAddressTests: """Tests for splitting a user's address field""" def test_unset_address(self): """Test splitting an unset address""" <|body_0|> def test_empty_address(self): """Test splitting an empty address""" <|body_1|> def test_short_address...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProfileAddressTests: """Tests for splitting a user's address field""" def test_unset_address(self): """Test splitting an unset address""" with mute_signals(post_save): profile = ProfileFactory(address=None) assert profile.address1 is None assert profile.address...
the_stack_v2_python_sparse
profiles/models_test.py
mitodl/micromasters
train
35
a212d9d8608fcfbdfc79ea5c0289d97581e8ba04
[ "self.__parser = argparse.ArgumentParser(description='Executes a configuration in kombi')\nself.__parser.add_argument('config', help='path for a configuration file or a directory containing configurations files.')\nself.__parser.add_argument('source', metavar='FILE', nargs='*', help='path for a file or directory. I...
<|body_start_0|> self.__parser = argparse.ArgumentParser(description='Executes a configuration in kombi') self.__parser.add_argument('config', help='path for a configuration file or a directory containing configurations files.') self.__parser.add_argument('source', metavar='FILE', nargs='*', hel...
Runs a kombi configuration through command-line.
Cli
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Cli: """Runs a kombi configuration through command-line.""" def __init__(self): """Create a cli object.""" <|body_0|> def run(self, args, outStream=sys.stdout, errStream=subprocess.STDOUT): """Execute the configuration.""" <|body_1|> def __loadCrawle...
stack_v2_sparse_classes_36k_train_007858
3,968
permissive
[ { "docstring": "Create a cli object.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Execute the configuration.", "name": "run", "signature": "def run(self, args, outStream=sys.stdout, errStream=subprocess.STDOUT)" }, { "docstring": "Return the source c...
3
null
Implement the Python class `Cli` described below. Class description: Runs a kombi configuration through command-line. Method signatures and docstrings: - def __init__(self): Create a cli object. - def run(self, args, outStream=sys.stdout, errStream=subprocess.STDOUT): Execute the configuration. - def __loadCrawlers(s...
Implement the Python class `Cli` described below. Class description: Runs a kombi configuration through command-line. Method signatures and docstrings: - def __init__(self): Create a cli object. - def run(self, args, outStream=sys.stdout, errStream=subprocess.STDOUT): Execute the configuration. - def __loadCrawlers(s...
046dbb0c1b4ff20ea5f2e1679f8d89f3089b6aa4
<|skeleton|> class Cli: """Runs a kombi configuration through command-line.""" def __init__(self): """Create a cli object.""" <|body_0|> def run(self, args, outStream=sys.stdout, errStream=subprocess.STDOUT): """Execute the configuration.""" <|body_1|> def __loadCrawle...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Cli: """Runs a kombi configuration through command-line.""" def __init__(self): """Create a cli object.""" self.__parser = argparse.ArgumentParser(description='Executes a configuration in kombi') self.__parser.add_argument('config', help='path for a configuration file or a directo...
the_stack_v2_python_sparse
src/lib/kombi/Cli.py
kombiHQ/kombi
train
2
6a0c7d909f128c2d51ec8a42d8d737accf8b91d2
[ "if options is None:\n options = {}\nroot_dir = options.get('rootDir', os.environ['DEFAULT_CACHE_PATH'])\nif not os.path.isdir(root_dir):\n os.makedirs(root_dir, exist_ok=True)\nself.root_dir = root_dir\nself.ttl = ttl\nself.size = size", "if not isinstance(key, str):\n raise ValueError('key must be stri...
<|body_start_0|> if options is None: options = {} root_dir = options.get('rootDir', os.environ['DEFAULT_CACHE_PATH']) if not os.path.isdir(root_dir): os.makedirs(root_dir, exist_ok=True) self.root_dir = root_dir self.ttl = ttl self.size = size <|en...
FileSystemCache
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileSystemCache: def __init__(self, options=None, size=1000, ttl=1000): """docs""" <|body_0|> def set(self, key, value): """set or add a key and value to the cache :param key: str or int type of key :param value: pickled value :return:""" <|body_1|> def ...
stack_v2_sparse_classes_36k_train_007859
2,737
permissive
[ { "docstring": "docs", "name": "__init__", "signature": "def __init__(self, options=None, size=1000, ttl=1000)" }, { "docstring": "set or add a key and value to the cache :param key: str or int type of key :param value: pickled value :return:", "name": "set", "signature": "def set(self, ...
5
null
Implement the Python class `FileSystemCache` described below. Class description: Implement the FileSystemCache class. Method signatures and docstrings: - def __init__(self, options=None, size=1000, ttl=1000): docs - def set(self, key, value): set or add a key and value to the cache :param key: str or int type of key ...
Implement the Python class `FileSystemCache` described below. Class description: Implement the FileSystemCache class. Method signatures and docstrings: - def __init__(self, options=None, size=1000, ttl=1000): docs - def set(self, key, value): set or add a key and value to the cache :param key: str or int type of key ...
54f86662095e74ccd2ba59e928410725ae5bf354
<|skeleton|> class FileSystemCache: def __init__(self, options=None, size=1000, ttl=1000): """docs""" <|body_0|> def set(self, key, value): """set or add a key and value to the cache :param key: str or int type of key :param value: pickled value :return:""" <|body_1|> def ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileSystemCache: def __init__(self, options=None, size=1000, ttl=1000): """docs""" if options is None: options = {} root_dir = options.get('rootDir', os.environ['DEFAULT_CACHE_PATH']) if not os.path.isdir(root_dir): os.makedirs(root_dir, exist_ok=True) ...
the_stack_v2_python_sparse
dtlpy/caches/filesystem_cache.py
dataloop-ai/dtlpy
train
16
e9d5f911db466574d83bbbdff41d017b178f8281
[ "if not isinstance(shear_range, (list, tuple)) or len(shear_range) != 2:\n raise ValueError('shear_range argument must be list/tuple with two values!')\nself.shear_range = shear_range\nself.reference = reference\nself.lazy = lazy", "shear_x = random.gauss(self.shear_range[0], self.shear_range[1])\nshear_y = ra...
<|body_start_0|> if not isinstance(shear_range, (list, tuple)) or len(shear_range) != 2: raise ValueError('shear_range argument must be list/tuple with two values!') self.shear_range = shear_range self.reference = reference self.lazy = lazy <|end_body_0|> <|body_start_1|> ...
Apply a Shear2D transform to an image, but with the shear parameters randomly generated from a user-specified range. The range is determined by a mean (first parameter) and standard deviation (second parameter) via calls to random.gauss.
RandomShear2D
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RandomShear2D: """Apply a Shear2D transform to an image, but with the shear parameters randomly generated from a user-specified range. The range is determined by a mean (first parameter) and standard deviation (second parameter) via calls to random.gauss.""" def __init__(self, shear_range, r...
stack_v2_sparse_classes_36k_train_007860
21,674
permissive
[ { "docstring": "Initialize a RandomShear2D object Arguments --------- shear_range : list or tuple Lower and Upper bounds on rotation parameter, in degrees. e.g. shear_range = (-10,10) will result in a random draw of the rotation parameters between -10 and 10 degrees reference : ANTsImage (optional but recommend...
2
null
Implement the Python class `RandomShear2D` described below. Class description: Apply a Shear2D transform to an image, but with the shear parameters randomly generated from a user-specified range. The range is determined by a mean (first parameter) and standard deviation (second parameter) via calls to random.gauss. M...
Implement the Python class `RandomShear2D` described below. Class description: Apply a Shear2D transform to an image, but with the shear parameters randomly generated from a user-specified range. The range is determined by a mean (first parameter) and standard deviation (second parameter) via calls to random.gauss. M...
41f2dd3fcf72654f284dac1a9448033e963f0afb
<|skeleton|> class RandomShear2D: """Apply a Shear2D transform to an image, but with the shear parameters randomly generated from a user-specified range. The range is determined by a mean (first parameter) and standard deviation (second parameter) via calls to random.gauss.""" def __init__(self, shear_range, r...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RandomShear2D: """Apply a Shear2D transform to an image, but with the shear parameters randomly generated from a user-specified range. The range is determined by a mean (first parameter) and standard deviation (second parameter) via calls to random.gauss.""" def __init__(self, shear_range, reference=None...
the_stack_v2_python_sparse
ants/contrib/sampling/affine2d.py
ANTsX/ANTsPy
train
483
28fdbff0af061fcdc4b58a724418db2d027abc6a
[ "recent = self.listRecentPaths()\nif path in recent:\n return\nrecent.append(path)\nif len(recent) > 10:\n recent = recent[-10:]\nrecent = op.pathsep.join(recent)\nfslsettings.write('fsleyes.recentFiles', recent)\nself.notify()", "recent = fslsettings.read('fsleyes.recentFiles', None)\nif recent is None:\n ...
<|body_start_0|> recent = self.listRecentPaths() if path in recent: return recent.append(path) if len(recent) > 10: recent = recent[-10:] recent = op.pathsep.join(recent) fslsettings.write('fsleyes.recentFiles', recent) self.notify() <|end_...
The ``RecentPathManager`` is a simple class which provides access to a list of recently loaded files, and can notify registered listeners when that list changes. See the :attr:`recentPathManager` singleton instance.
RecentPathManager
[ "BSD-3-Clause", "CC-BY-3.0", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RecentPathManager: """The ``RecentPathManager`` is a simple class which provides access to a list of recently loaded files, and can notify registered listeners when that list changes. See the :attr:`recentPathManager` singleton instance.""" def recordPath(self, path): """Adds the giv...
stack_v2_sparse_classes_36k_train_007861
16,912
permissive
[ { "docstring": "Adds the given ``path`` to the recent files list.", "name": "recordPath", "signature": "def recordPath(self, path)" }, { "docstring": "Returns a list of recently loaded files.", "name": "listRecentPaths", "signature": "def listRecentPaths(self)" } ]
2
stack_v2_sparse_classes_30k_train_004124
Implement the Python class `RecentPathManager` described below. Class description: The ``RecentPathManager`` is a simple class which provides access to a list of recently loaded files, and can notify registered listeners when that list changes. See the :attr:`recentPathManager` singleton instance. Method signatures a...
Implement the Python class `RecentPathManager` described below. Class description: The ``RecentPathManager`` is a simple class which provides access to a list of recently loaded files, and can notify registered listeners when that list changes. See the :attr:`recentPathManager` singleton instance. Method signatures a...
46ccb4fe2b2346eb57576247f49714032b61307a
<|skeleton|> class RecentPathManager: """The ``RecentPathManager`` is a simple class which provides access to a list of recently loaded files, and can notify registered listeners when that list changes. See the :attr:`recentPathManager` singleton instance.""" def recordPath(self, path): """Adds the giv...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RecentPathManager: """The ``RecentPathManager`` is a simple class which provides access to a list of recently loaded files, and can notify registered listeners when that list changes. See the :attr:`recentPathManager` singleton instance.""" def recordPath(self, path): """Adds the given ``path`` t...
the_stack_v2_python_sparse
fsleyes/actions/loadoverlay.py
sanjayankur31/fsleyes
train
1
1609c7618fce4de791b6ff624936bed7cbbc5917
[ "ref_key_attributes = closest_neighbors(self.synthetic_dict.keys(), key_data)\nref_sensitive_attributes = []\nfor key in ref_key_attributes:\n ref_sensitive_attributes.extend(self.synthetic_dict[key])\nreturn majority(ref_sensitive_attributes)", "ref_key_attributes = closest_neighbors(self.synthetic_dict.keys(...
<|body_start_0|> ref_key_attributes = closest_neighbors(self.synthetic_dict.keys(), key_data) ref_sensitive_attributes = [] for key in ref_key_attributes: ref_sensitive_attributes.extend(self.synthetic_dict[key]) return majority(ref_sensitive_attributes) <|end_body_0|> <|bod...
The GeneralizedCAP privacy attacker. It will find out all rows in synthetic table that are closest (in hamming distance) to the target key attributes, and predict the sensitive entry that appears most frequently among them. The privacy score for each row in the real table will be calculated as the frequency that the tr...
GeneralizedCAPAttacker
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GeneralizedCAPAttacker: """The GeneralizedCAP privacy attacker. It will find out all rows in synthetic table that are closest (in hamming distance) to the target key attributes, and predict the sensitive entry that appears most frequently among them. The privacy score for each row in the real tab...
stack_v2_sparse_classes_36k_train_007862
6,127
permissive
[ { "docstring": "Make a prediction of the sensitive data given keys. Args: key_data (tuple): The key data. Returns: tuple: The predicted sensitive data.", "name": "predict", "signature": "def predict(self, key_data)" }, { "docstring": "Score based on the belief of the attacker, in the form P(sens...
2
stack_v2_sparse_classes_30k_train_010532
Implement the Python class `GeneralizedCAPAttacker` described below. Class description: The GeneralizedCAP privacy attacker. It will find out all rows in synthetic table that are closest (in hamming distance) to the target key attributes, and predict the sensitive entry that appears most frequently among them. The pri...
Implement the Python class `GeneralizedCAPAttacker` described below. Class description: The GeneralizedCAP privacy attacker. It will find out all rows in synthetic table that are closest (in hamming distance) to the target key attributes, and predict the sensitive entry that appears most frequently among them. The pri...
a4e05fd57edc990b716340cffaa969a61144062e
<|skeleton|> class GeneralizedCAPAttacker: """The GeneralizedCAP privacy attacker. It will find out all rows in synthetic table that are closest (in hamming distance) to the target key attributes, and predict the sensitive entry that appears most frequently among them. The privacy score for each row in the real tab...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GeneralizedCAPAttacker: """The GeneralizedCAP privacy attacker. It will find out all rows in synthetic table that are closest (in hamming distance) to the target key attributes, and predict the sensitive entry that appears most frequently among them. The privacy score for each row in the real table will be ca...
the_stack_v2_python_sparse
sdmetrics/single_table/privacy/cap.py
sdv-dev/SDMetrics
train
170
46301e88ca00c2414752ddb3e5c5785876cd697b
[ "self.name = name\nif criteria is None:\n self.criteria = []\nelse:\n self.criteria = criteria\nself.color = color", "all_indices = set()\nself.criteria.sort(key=lambda x: x.and_or, reverse=True)\nfor i, c in enumerate(self.criteria):\n indices = c.select(sca)\n m = c.and_or\n if m == 'and' and i >...
<|body_start_0|> self.name = name if criteria is None: self.criteria = [] else: self.criteria = criteria self.color = color <|end_body_0|> <|body_start_1|> all_indices = set() self.criteria.sort(key=lambda x: x.and_or, reverse=True) for i,...
this class represents a single label
CustomLabel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomLabel: """this class represents a single label""" def __init__(self, name, criteria=None, color=None): """Args: name (str) criteria: list of LabelCriterion objects""" <|body_0|> def select_cells(self, sca): """Selects cells corresponding to the given label"...
stack_v2_sparse_classes_36k_train_007863
6,289
no_license
[ { "docstring": "Args: name (str) criteria: list of LabelCriterion objects", "name": "__init__", "signature": "def __init__(self, name, criteria=None, color=None)" }, { "docstring": "Selects cells corresponding to the given label", "name": "select_cells", "signature": "def select_cells(se...
2
stack_v2_sparse_classes_30k_train_001388
Implement the Python class `CustomLabel` described below. Class description: this class represents a single label Method signatures and docstrings: - def __init__(self, name, criteria=None, color=None): Args: name (str) criteria: list of LabelCriterion objects - def select_cells(self, sca): Selects cells correspondin...
Implement the Python class `CustomLabel` described below. Class description: this class represents a single label Method signatures and docstrings: - def __init__(self, name, criteria=None, color=None): Args: name (str) criteria: list of LabelCriterion objects - def select_cells(self, sca): Selects cells correspondin...
a64425ca5bff57c3fe336e47fddf00fe2bbc1e75
<|skeleton|> class CustomLabel: """this class represents a single label""" def __init__(self, name, criteria=None, color=None): """Args: name (str) criteria: list of LabelCriterion objects""" <|body_0|> def select_cells(self, sca): """Selects cells corresponding to the given label"...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomLabel: """this class represents a single label""" def __init__(self, name, criteria=None, color=None): """Args: name (str) criteria: list of LabelCriterion objects""" self.name = name if criteria is None: self.criteria = [] else: self.criteria...
the_stack_v2_python_sparse
uncurl_analysis/custom_cell_selection.py
yjzhang/uncurl_analysis
train
1
847c02a4e39af8f9bebd87081d62aceeede77984
[ "name = None\nif 'name' in kwargs:\n name = kwargs.pop('name')\nsuper().__init__(*args, **kwargs)\nif name:\n self.fields['file'].label = _(f'{name.title()} File')\n self.fields['file'].help_text = _(f'Select {name} file to upload')", "file = self.cleaned_data['file']\nFileManager.validate(file)\nreturn ...
<|body_start_0|> name = None if 'name' in kwargs: name = kwargs.pop('name') super().__init__(*args, **kwargs) if name: self.fields['file'].label = _(f'{name.title()} File') self.fields['file'].help_text = _(f'Select {name} file to upload') <|end_body_0...
Step 1 of FileManagementFormView.
UploadFileForm
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UploadFileForm: """Step 1 of FileManagementFormView.""" def __init__(self, *args, **kwargs): """Update label and help_text.""" <|body_0|> def clean_file(self): """Run tabular file validation. If anything is wrong with the file, it will raise ValidationError""" ...
stack_v2_sparse_classes_36k_train_007864
6,816
permissive
[ { "docstring": "Update label and help_text.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Run tabular file validation. If anything is wrong with the file, it will raise ValidationError", "name": "clean_file", "signature": "def clean_file(self...
2
stack_v2_sparse_classes_30k_train_015860
Implement the Python class `UploadFileForm` described below. Class description: Step 1 of FileManagementFormView. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Update label and help_text. - def clean_file(self): Run tabular file validation. If anything is wrong with the file, it will raise ...
Implement the Python class `UploadFileForm` described below. Class description: Step 1 of FileManagementFormView. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Update label and help_text. - def clean_file(self): Run tabular file validation. If anything is wrong with the file, it will raise ...
e88a8e99a5f0b201c67a95cba097c729f090d5e2
<|skeleton|> class UploadFileForm: """Step 1 of FileManagementFormView.""" def __init__(self, *args, **kwargs): """Update label and help_text.""" <|body_0|> def clean_file(self): """Run tabular file validation. If anything is wrong with the file, it will raise ValidationError""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UploadFileForm: """Step 1 of FileManagementFormView.""" def __init__(self, *args, **kwargs): """Update label and help_text.""" name = None if 'name' in kwargs: name = kwargs.pop('name') super().__init__(*args, **kwargs) if name: self.fields[...
the_stack_v2_python_sparse
InvenTree/common/forms.py
inventree/InvenTree
train
3,077
96e43b3c79f540436db71d0a3b5656f11cf04f70
[ "self.pid = pid\nself.host = host\nself.port = port\nself.keys = keys\nself._prfs = {}", "try:\n return self._prfs[bound]\nexcept KeyError:\n self._prfs[bound] = {}\n for subset, key in self.keys.items():\n self._prfs[bound][subset] = thresha.PRF(key, bound)\n return self._prfs[bound]", "if s...
<|body_start_0|> self.pid = pid self.host = host self.port = port self.keys = keys self._prfs = {} <|end_body_0|> <|body_start_1|> try: return self._prfs[bound] except KeyError: self._prfs[bound] = {} for subset, key in self.ke...
Information about a party in the MPC protocol.
_Party
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _Party: """Information about a party in the MPC protocol.""" def __init__(self, pid, host=None, port=None, keys=None): """Initialize a party with given party identity pid.""" <|body_0|> def prfs(self, bound): """PRFs with codomain range(bound) for pseudorandom se...
stack_v2_sparse_classes_36k_train_007865
45,303
permissive
[ { "docstring": "Initialize a party with given party identity pid.", "name": "__init__", "signature": "def __init__(self, pid, host=None, port=None, keys=None)" }, { "docstring": "PRFs with codomain range(bound) for pseudorandom secret sharing. Return a mapping from sets of parties to PRFs.", ...
3
stack_v2_sparse_classes_30k_train_005032
Implement the Python class `_Party` described below. Class description: Information about a party in the MPC protocol. Method signatures and docstrings: - def __init__(self, pid, host=None, port=None, keys=None): Initialize a party with given party identity pid. - def prfs(self, bound): PRFs with codomain range(bound...
Implement the Python class `_Party` described below. Class description: Information about a party in the MPC protocol. Method signatures and docstrings: - def __init__(self, pid, host=None, port=None, keys=None): Initialize a party with given party identity pid. - def prfs(self, bound): PRFs with codomain range(bound...
ae8e421fb840937ccd7c8d5c35a011e5eb2c63df
<|skeleton|> class _Party: """Information about a party in the MPC protocol.""" def __init__(self, pid, host=None, port=None, keys=None): """Initialize a party with given party identity pid.""" <|body_0|> def prfs(self, bound): """PRFs with codomain range(bound) for pseudorandom se...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _Party: """Information about a party in the MPC protocol.""" def __init__(self, pid, host=None, port=None, keys=None): """Initialize a party with given party identity pid.""" self.pid = pid self.host = host self.port = port self.keys = keys self._prfs = {} ...
the_stack_v2_python_sparse
server/mpyc/mpyc/runtime.py
Fluxmux/securefacematching
train
4
01bc6c49b9c70bd1c5e8a6845fca7e5af15239ca
[ "start_index = 0\nend_index = len(filename)\nif filename.endswith('.py'):\n end_index = -3\nif filename[1] == ':':\n start_index = 2\nmodulename = filename[start_index:end_index]\nl = modulename.split(os.path.sep)\nmodulename = '.'.join(l)\nreturn modulename", "m = self.filename_to_module(self.filename)\nm ...
<|body_start_0|> start_index = 0 end_index = len(filename) if filename.endswith('.py'): end_index = -3 if filename[1] == ':': start_index = 2 modulename = filename[start_index:end_index] l = modulename.split(os.path.sep) modulename = '.'.jo...
Build packages from wralea file Use 'register_package' function
PyPackageReader
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PyPackageReader: """Build packages from wralea file Use 'register_package' function""" def filename_to_module(self, filename): """Transform the filename ending with .py to the module name""" <|body_0|> def get_pkg_name(self): """Return the OpenAlea (uniq) full pa...
stack_v2_sparse_classes_36k_train_007866
29,195
permissive
[ { "docstring": "Transform the filename ending with .py to the module name", "name": "filename_to_module", "signature": "def filename_to_module(self, filename)" }, { "docstring": "Return the OpenAlea (uniq) full package name", "name": "get_pkg_name", "signature": "def get_pkg_name(self)" ...
4
stack_v2_sparse_classes_30k_train_017351
Implement the Python class `PyPackageReader` described below. Class description: Build packages from wralea file Use 'register_package' function Method signatures and docstrings: - def filename_to_module(self, filename): Transform the filename ending with .py to the module name - def get_pkg_name(self): Return the Op...
Implement the Python class `PyPackageReader` described below. Class description: Build packages from wralea file Use 'register_package' function Method signatures and docstrings: - def filename_to_module(self, filename): Transform the filename ending with .py to the module name - def get_pkg_name(self): Return the Op...
d8322b1db73677ef821adc319ef578f6bec96a79
<|skeleton|> class PyPackageReader: """Build packages from wralea file Use 'register_package' function""" def filename_to_module(self, filename): """Transform the filename ending with .py to the module name""" <|body_0|> def get_pkg_name(self): """Return the OpenAlea (uniq) full pa...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PyPackageReader: """Build packages from wralea file Use 'register_package' function""" def filename_to_module(self, filename): """Transform the filename ending with .py to the module name""" start_index = 0 end_index = len(filename) if filename.endswith('.py'): ...
the_stack_v2_python_sparse
src/pycropml/package.py
AgriculturalModelExchangeInitiative/PyCrop2ML
train
10
0c0813e31c49d554d24899e597976eb6350f6bd3
[ "self.acc = acc\nself.frame = frame\nself.app = app\nself.script = script\nself.word_ctx = self._getWordContext(x, y)", "if not self.script or not self.script.speakWordUnderMouse(self.acc):\n return None\nword, start, end = self.script.getWordAtCoords(self.acc, x, y)\nreturn _WordContext(word, self.acc, start,...
<|body_start_0|> self.acc = acc self.frame = frame self.app = app self.script = script self.word_ctx = self._getWordContext(x, y) <|end_body_0|> <|body_start_1|> if not self.script or not self.script.speakWordUnderMouse(self.acc): return None word, st...
An _ItemContext holds all the information of the item we are currently hovering above. If the accessible supports word speaking, we also store a word context here.
_ItemContext
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _ItemContext: """An _ItemContext holds all the information of the item we are currently hovering above. If the accessible supports word speaking, we also store a word context here.""" def __init__(self, x=0, y=0, acc=None, frame=None, app=None, script=None): """Initialize an _ItemCon...
stack_v2_sparse_classes_36k_train_007867
12,279
no_license
[ { "docstring": "Initialize an _ItemContext with all the information we have. Arguments: - x: The X coordinate of the pointer. - y: The Y coordinate of the pointer. - acc: The end-node accessible at that coordinate. - frame: The top-level frame below the pointer. - app: The application the pointer is hovering ab...
2
null
Implement the Python class `_ItemContext` described below. Class description: An _ItemContext holds all the information of the item we are currently hovering above. If the accessible supports word speaking, we also store a word context here. Method signatures and docstrings: - def __init__(self, x=0, y=0, acc=None, f...
Implement the Python class `_ItemContext` described below. Class description: An _ItemContext holds all the information of the item we are currently hovering above. If the accessible supports word speaking, we also store a word context here. Method signatures and docstrings: - def __init__(self, x=0, y=0, acc=None, f...
d08f7bf370a82b6970387bb9f165d374a9d9092b
<|skeleton|> class _ItemContext: """An _ItemContext holds all the information of the item we are currently hovering above. If the accessible supports word speaking, we also store a word context here.""" def __init__(self, x=0, y=0, acc=None, frame=None, app=None, script=None): """Initialize an _ItemCon...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _ItemContext: """An _ItemContext holds all the information of the item we are currently hovering above. If the accessible supports word speaking, we also store a word context here.""" def __init__(self, x=0, y=0, acc=None, frame=None, app=None, script=None): """Initialize an _ItemContext with all...
the_stack_v2_python_sparse
usr/share/python-support/gnome-orca/orca/mouse_review.py
haniokasai/netwalker-rootfs
train
2
76acccb5facaa79724457ed963b8ee3f82a89c94
[ "tmpl_context.widget = new_fase_form\nheader_file = 'abstract'\nself.params['title'] = 'Nueva Fase'\nself.params['modelname'] = 'Fase'\nself.params['header_file'] = 'abstract'\nself.params['permiso'] = 'crear_fase'\nself.params['cancelar_url'] = '/miproyecto/ver/' + str(idproyecto)\nreturn dict(value=kw, params=sel...
<|body_start_0|> tmpl_context.widget = new_fase_form header_file = 'abstract' self.params['title'] = 'Nueva Fase' self.params['modelname'] = 'Fase' self.params['header_file'] = 'abstract' self.params['permiso'] = 'crear_fase' self.params['cancelar_url'] = '/miproy...
Controlador de las fases del proyecto
FaseController
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FaseController: """Controlador de las fases del proyecto""" def new(self, idproyecto, args={}, **kw): """Encargado de cargar el widget para crear nuevas instancias, solo tienen acceso aquellos usuarios que posean el premiso de crear @type idproyecto : Integer @param idproyecto : Iden...
stack_v2_sparse_classes_36k_train_007868
6,423
no_license
[ { "docstring": "Encargado de cargar el widget para crear nuevas instancias, solo tienen acceso aquellos usuarios que posean el premiso de crear @type idproyecto : Integer @param idproyecto : Identificador del Proyecto. @type args : Hash @param args : Argumentos de template @type kw : Hash @param kw : Keywords @...
6
stack_v2_sparse_classes_30k_train_006533
Implement the Python class `FaseController` described below. Class description: Controlador de las fases del proyecto Method signatures and docstrings: - def new(self, idproyecto, args={}, **kw): Encargado de cargar el widget para crear nuevas instancias, solo tienen acceso aquellos usuarios que posean el premiso de ...
Implement the Python class `FaseController` described below. Class description: Controlador de las fases del proyecto Method signatures and docstrings: - def new(self, idproyecto, args={}, **kw): Encargado de cargar el widget para crear nuevas instancias, solo tienen acceso aquellos usuarios que posean el premiso de ...
f3da55a822dd45ed577844479c58eea69cdad754
<|skeleton|> class FaseController: """Controlador de las fases del proyecto""" def new(self, idproyecto, args={}, **kw): """Encargado de cargar el widget para crear nuevas instancias, solo tienen acceso aquellos usuarios que posean el premiso de crear @type idproyecto : Integer @param idproyecto : Iden...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FaseController: """Controlador de las fases del proyecto""" def new(self, idproyecto, args={}, **kw): """Encargado de cargar el widget para crear nuevas instancias, solo tienen acceso aquellos usuarios que posean el premiso de crear @type idproyecto : Integer @param idproyecto : Identificador del...
the_stack_v2_python_sparse
Tg-SAP/sap/controllers/fase.py
mbaez/SAP
train
1
606b20d61989f236fcd05885436e84495a70d594
[ "super().__init__()\nself.blocks = nn.ModuleList()\ninput_channels = num_input_channels\nfor output_channels in layer_output_channels:\n self.blocks.append(nn.ModuleList([nn.Sequential(nn.Conv2d(input_channels, output_channels, 3, 1, padding=1, bias=False), nn.BatchNorm2d(output_channels), nn.ReLU(), nn.Conv2d(o...
<|body_start_0|> super().__init__() self.blocks = nn.ModuleList() input_channels = num_input_channels for output_channels in layer_output_channels: self.blocks.append(nn.ModuleList([nn.Sequential(nn.Conv2d(input_channels, output_channels, 3, 1, padding=1, bias=False), nn.Batc...
Construct a basic UNet encoder. This class builds a basic UNet encoder with batch normalization. The number of channels in each down-sampling block and the number of down-sampling levels are customisable. Args: num_input_channels (int): Number of channels in the input images. layer_output_channels (list): A list of int...
UnetEncoder
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UnetEncoder: """Construct a basic UNet encoder. This class builds a basic UNet encoder with batch normalization. The number of channels in each down-sampling block and the number of down-sampling levels are customisable. Args: num_input_channels (int): Number of channels in the input images. laye...
stack_v2_sparse_classes_36k_train_007869
14,906
permissive
[ { "docstring": "Initialize :class:`UnetEncoder`.", "name": "__init__", "signature": "def __init__(self, num_input_channels: int, layer_output_channels: list[int]) -> None" }, { "docstring": "Logic for using layers defined in init. This method defines how layers are used in forward operation. Arg...
2
stack_v2_sparse_classes_30k_train_003100
Implement the Python class `UnetEncoder` described below. Class description: Construct a basic UNet encoder. This class builds a basic UNet encoder with batch normalization. The number of channels in each down-sampling block and the number of down-sampling levels are customisable. Args: num_input_channels (int): Numbe...
Implement the Python class `UnetEncoder` described below. Class description: Construct a basic UNet encoder. This class builds a basic UNet encoder with batch normalization. The number of channels in each down-sampling block and the number of down-sampling levels are customisable. Args: num_input_channels (int): Numbe...
f26387f46f675a7b9a8a48c95dad26e819229f2f
<|skeleton|> class UnetEncoder: """Construct a basic UNet encoder. This class builds a basic UNet encoder with batch normalization. The number of channels in each down-sampling block and the number of down-sampling levels are customisable. Args: num_input_channels (int): Number of channels in the input images. laye...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UnetEncoder: """Construct a basic UNet encoder. This class builds a basic UNet encoder with batch normalization. The number of channels in each down-sampling block and the number of down-sampling levels are customisable. Args: num_input_channels (int): Number of channels in the input images. layer_output_chan...
the_stack_v2_python_sparse
tiatoolbox/models/architecture/unet.py
TissueImageAnalytics/tiatoolbox
train
222
ff97b4f78d97d2ef13d21f60b8704045c1f5755c
[ "json_response = []\ncomments_query = self.sess.query(Comment).filter_by(problem_id=problem_id).all()\nif not comments_query:\n self.write(json.dumps(json_response))\n return\nfor comment_query in comments_query:\n user_query = self.sess.query(User).get(comment_query.user_id)\n if comment_query.modified...
<|body_start_0|> json_response = [] comments_query = self.sess.query(Comment).filter_by(problem_id=problem_id).all() if not comments_query: self.write(json.dumps(json_response)) return for comment_query in comments_query: user_query = self.sess.query(U...
ProblemCommentsHandler
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProblemCommentsHandler: def get(self, problem_id): """Return comments for current problem. Answer format: .. code-block: json { "count": <count of data elements>, "data": [ { "modified_date": "2015-06-25T22:30:49.000Z", "modified_by": "user_1", "created_by": "user_2", "content": "comment...
stack_v2_sparse_classes_36k_train_007870
4,646
no_license
[ { "docstring": "Return comments for current problem. Answer format: .. code-block: json { \"count\": <count of data elements>, \"data\": [ { \"modified_date\": \"2015-06-25T22:30:49.000Z\", \"modified_by\": \"user_1\", \"created_by\": \"user_2\", \"content\": \"comment_1_content\", \"created_date\": \"2015-06-2...
2
stack_v2_sparse_classes_30k_train_001950
Implement the Python class `ProblemCommentsHandler` described below. Class description: Implement the ProblemCommentsHandler class. Method signatures and docstrings: - def get(self, problem_id): Return comments for current problem. Answer format: .. code-block: json { "count": <count of data elements>, "data": [ { "m...
Implement the Python class `ProblemCommentsHandler` described below. Class description: Implement the ProblemCommentsHandler class. Method signatures and docstrings: - def get(self, problem_id): Return comments for current problem. Answer format: .. code-block: json { "count": <count of data elements>, "data": [ { "m...
e911ce6bcaa73e15248586d40c95beeb1a05da47
<|skeleton|> class ProblemCommentsHandler: def get(self, problem_id): """Return comments for current problem. Answer format: .. code-block: json { "count": <count of data elements>, "data": [ { "modified_date": "2015-06-25T22:30:49.000Z", "modified_by": "user_1", "created_by": "user_2", "content": "comment...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ProblemCommentsHandler: def get(self, problem_id): """Return comments for current problem. Answer format: .. code-block: json { "count": <count of data elements>, "data": [ { "modified_date": "2015-06-25T22:30:49.000Z", "modified_by": "user_1", "created_by": "user_2", "content": "comment_1_content", "...
the_stack_v2_python_sparse
ecomap/api/v1_0/handlers/comments.py
ITsvetkoFF/Kv-008
train
3
e6f852078244dd609b1abaf24f71ee0a0233eb22
[ "elems = [e for row in matrix for e in row]\n\ndef search():\n left, right = (0, len(elems) - 1)\n while left <= right:\n mid = left + (right - left) / 2\n if elems[mid] == target:\n return True\n elif elems[mid] < target:\n left = mid + 1\n else:\n ...
<|body_start_0|> elems = [e for row in matrix for e in row] def search(): left, right = (0, len(elems) - 1) while left <= right: mid = left + (right - left) / 2 if elems[mid] == target: return True elif elems[mi...
编写一个高效的算法来判断 m x n 矩阵中,是否存在一个目标值。该矩阵具有如下特性: 1. 每行中的整数从左到右按升序排列。 2. 每行的第一个整数大于前一行的最后一个整数。 示例 1: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 3 输出: true 示例 2: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 13 输出: false
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """编写一个高效的算法来判断 m x n 矩阵中,是否存在一个目标值。该矩阵具有如下特性: 1. 每行中的整数从左到右按升序排列。 2. 每行的第一个整数大于前一行的最后一个整数。 示例 1: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 3 输出: true 示例 2: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 13 输出: false""" d...
stack_v2_sparse_classes_36k_train_007871
4,231
no_license
[ { "docstring": ":type matrix: List[List[int]] :type target: int :rtype: bool 暴力破解:将二维数组转成一维有序数组,然后使用二分查找判断target是否在其中 时间复杂度:遍历二维数组O(m*n),二分查找O(log(m*n)),因此最终的时间复杂度为O(m*n) 空间复杂度:O(m*n)", "name": "search_matrix", "signature": "def search_matrix(self, matrix, target)" }, { "docstring": ":type matri...
3
null
Implement the Python class `Solution` described below. Class description: 编写一个高效的算法来判断 m x n 矩阵中,是否存在一个目标值。该矩阵具有如下特性: 1. 每行中的整数从左到右按升序排列。 2. 每行的第一个整数大于前一行的最后一个整数。 示例 1: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 3 输出: true 示例 2: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34...
Implement the Python class `Solution` described below. Class description: 编写一个高效的算法来判断 m x n 矩阵中,是否存在一个目标值。该矩阵具有如下特性: 1. 每行中的整数从左到右按升序排列。 2. 每行的第一个整数大于前一行的最后一个整数。 示例 1: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 3 输出: true 示例 2: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34...
2c534185854c1a6f5ffdb2698f9db9989f30a25b
<|skeleton|> class Solution: """编写一个高效的算法来判断 m x n 矩阵中,是否存在一个目标值。该矩阵具有如下特性: 1. 每行中的整数从左到右按升序排列。 2. 每行的第一个整数大于前一行的最后一个整数。 示例 1: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 3 输出: true 示例 2: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 13 输出: false""" d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: """编写一个高效的算法来判断 m x n 矩阵中,是否存在一个目标值。该矩阵具有如下特性: 1. 每行中的整数从左到右按升序排列。 2. 每行的第一个整数大于前一行的最后一个整数。 示例 1: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 3 输出: true 示例 2: 输入: matrix = [ [1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 50] ] target = 13 输出: false""" def search_mat...
the_stack_v2_python_sparse
Week 03/id_668/leetcode_74_668.py
Carryours/algorithm004-03
train
2
4173a20e82302795abb156d9058f1fa362e74c82
[ "urls = super(PhotoFrameAdmin, self).get_urls()\nmy_urls = patterns('', url('^add_fotos/(?P<app>[\\\\w]+)/(?P<model>[\\\\w]+)/(?P<id>\\\\d+)?$', self.admin_site.admin_view(self.add_fotos), name='admin_add_fotos'), url('^ajax_edit_foto/$', self.admin_site.admin_view(self.ajax_edit_foto), name='admin_ajax_edit_foto')...
<|body_start_0|> urls = super(PhotoFrameAdmin, self).get_urls() my_urls = patterns('', url('^add_fotos/(?P<app>[\\w]+)/(?P<model>[\\w]+)/(?P<id>\\d+)?$', self.admin_site.admin_view(self.add_fotos), name='admin_add_fotos'), url('^ajax_edit_foto/$', self.admin_site.admin_view(self.ajax_edit_foto), name='a...
Modelo para subir fotos usando el widget en un iframe mediante ajax
PhotoFrameAdmin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PhotoFrameAdmin: """Modelo para subir fotos usando el widget en un iframe mediante ajax""" def get_urls(self): """URLs para subir fotos y borrarlas""" <|body_0|> def add_fotos(self, request, app, model, id): """página que muestra la herramienta para subir y edita...
stack_v2_sparse_classes_36k_train_007872
2,780
no_license
[ { "docstring": "URLs para subir fotos y borrarlas", "name": "get_urls", "signature": "def get_urls(self)" }, { "docstring": "página que muestra la herramienta para subir y editar fotos", "name": "add_fotos", "signature": "def add_fotos(self, request, app, model, id)" }, { "docstr...
3
stack_v2_sparse_classes_30k_train_002961
Implement the Python class `PhotoFrameAdmin` described below. Class description: Modelo para subir fotos usando el widget en un iframe mediante ajax Method signatures and docstrings: - def get_urls(self): URLs para subir fotos y borrarlas - def add_fotos(self, request, app, model, id): página que muestra la herramien...
Implement the Python class `PhotoFrameAdmin` described below. Class description: Modelo para subir fotos usando el widget en un iframe mediante ajax Method signatures and docstrings: - def get_urls(self): URLs para subir fotos y borrarlas - def add_fotos(self, request, app, model, id): página que muestra la herramien...
872e7deca73ccd8417d0d963a043cb2e79d64ffb
<|skeleton|> class PhotoFrameAdmin: """Modelo para subir fotos usando el widget en un iframe mediante ajax""" def get_urls(self): """URLs para subir fotos y borrarlas""" <|body_0|> def add_fotos(self, request, app, model, id): """página que muestra la herramienta para subir y edita...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PhotoFrameAdmin: """Modelo para subir fotos usando el widget en un iframe mediante ajax""" def get_urls(self): """URLs para subir fotos y borrarlas""" urls = super(PhotoFrameAdmin, self).get_urls() my_urls = patterns('', url('^add_fotos/(?P<app>[\\w]+)/(?P<model>[\\w]+)/(?P<id>\\d...
the_stack_v2_python_sparse
adminphotoload/models.py
ljarufe/quimerahg
train
0
8f6ed2d4688ce647416f63e216a040a65d7e44a0
[ "result = Statistics()\nassert result.num_games == 0\nassert len(result.metrics) == 8", "stat_tracker = Statistics()\nstat_tracker.add_result(example_medium_game_result)\ncorrect = [4, 4, 0, 0, 0, 0, 0, 1]\ntotal = [6, 6, 1, 1, 1, 1, 1, 1]\nassert stat_tracker.num_games == 1\nassert [metric.correct for metric in ...
<|body_start_0|> result = Statistics() assert result.num_games == 0 assert len(result.metrics) == 8 <|end_body_0|> <|body_start_1|> stat_tracker = Statistics() stat_tracker.add_result(example_medium_game_result) correct = [4, 4, 0, 0, 0, 0, 0, 1] total = [6, 6, 1...
Tests for the Statistics class.
TestStatistics
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestStatistics: """Tests for the Statistics class.""" def test_constructor() -> None: """Should initialize correctly.""" <|body_0|> def test_add_result(example_medium_game_result: GameResult) -> None: """Should correctly add a single game result to the aggregate....
stack_v2_sparse_classes_36k_train_007873
4,589
permissive
[ { "docstring": "Should initialize correctly.", "name": "test_constructor", "signature": "def test_constructor() -> None" }, { "docstring": "Should correctly add a single game result to the aggregate.", "name": "test_add_result", "signature": "def test_add_result(example_medium_game_resul...
3
null
Implement the Python class `TestStatistics` described below. Class description: Tests for the Statistics class. Method signatures and docstrings: - def test_constructor() -> None: Should initialize correctly. - def test_add_result(example_medium_game_result: GameResult) -> None: Should correctly add a single game res...
Implement the Python class `TestStatistics` described below. Class description: Tests for the Statistics class. Method signatures and docstrings: - def test_constructor() -> None: Should initialize correctly. - def test_add_result(example_medium_game_result: GameResult) -> None: Should correctly add a single game res...
6e91c2f24e72f9374c4f703bd966963ea6626e8e
<|skeleton|> class TestStatistics: """Tests for the Statistics class.""" def test_constructor() -> None: """Should initialize correctly.""" <|body_0|> def test_add_result(example_medium_game_result: GameResult) -> None: """Should correctly add a single game result to the aggregate....
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestStatistics: """Tests for the Statistics class.""" def test_constructor() -> None: """Should initialize correctly.""" result = Statistics() assert result.num_games == 0 assert len(result.metrics) == 8 def test_add_result(example_medium_game_result: GameResult) -> N...
the_stack_v2_python_sparse
unit_test/stats_test.py
srijan-deepsource/wolfbot
train
0
312588e7ffe7dd1fc6b11cd866583e8563f9c34f
[ "if m >= n:\n return head\nparent = None\np = head\nfor _ in range(m - 1):\n parent = p\n p = p.next\nt = p\ntmp = p.next\nchild = tmp\nfor _ in range(n - m):\n child = tmp\n if child:\n tmp = child.next\n child.next = p\n p = child\n else:\n break\nt.next = tmp\nif par...
<|body_start_0|> if m >= n: return head parent = None p = head for _ in range(m - 1): parent = p p = p.next t = p tmp = p.next child = tmp for _ in range(n - m): child = tmp if child: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def reverseBetween(self, head, m, n): """05/06/2018 01:00""" <|body_0|> def reverseBetween(self, head: Optional[ListNode], left: int, right: int) -> Optional[ListNode]: """08/08/2021 17:38""" <|body_1|> def reverseBetween(self, head: Optional[L...
stack_v2_sparse_classes_36k_train_007874
3,687
no_license
[ { "docstring": "05/06/2018 01:00", "name": "reverseBetween", "signature": "def reverseBetween(self, head, m, n)" }, { "docstring": "08/08/2021 17:38", "name": "reverseBetween", "signature": "def reverseBetween(self, head: Optional[ListNode], left: int, right: int) -> Optional[ListNode]" ...
3
stack_v2_sparse_classes_30k_train_015047
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverseBetween(self, head, m, n): 05/06/2018 01:00 - def reverseBetween(self, head: Optional[ListNode], left: int, right: int) -> Optional[ListNode]: 08/08/2021 17:38 - def r...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverseBetween(self, head, m, n): 05/06/2018 01:00 - def reverseBetween(self, head: Optional[ListNode], left: int, right: int) -> Optional[ListNode]: 08/08/2021 17:38 - def r...
1389a009a02e90e8700a7a00e0b7f797c129cdf4
<|skeleton|> class Solution: def reverseBetween(self, head, m, n): """05/06/2018 01:00""" <|body_0|> def reverseBetween(self, head: Optional[ListNode], left: int, right: int) -> Optional[ListNode]: """08/08/2021 17:38""" <|body_1|> def reverseBetween(self, head: Optional[L...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def reverseBetween(self, head, m, n): """05/06/2018 01:00""" if m >= n: return head parent = None p = head for _ in range(m - 1): parent = p p = p.next t = p tmp = p.next child = tmp for _ in ...
the_stack_v2_python_sparse
leetcode/solved/92_Reverse_Linked_List_II/solution.py
sungminoh/algorithms
train
0
fad7bcfc3cad488dcc8ecfc419219d994157af07
[ "if not matrix or not matrix[0]:\n return\nrow, col = (len(matrix), len(matrix[0]))\nself.mtx = [[0] * (col + 1) for _ in range(row + 1)]\nfor r in range(row):\n for c in range(col):\n self.mtx[r + 1][c + 1] = self.mtx[r][c + 1] + self.mtx[r + 1][c] - self.mtx[r][c] + matrix[r][c]\nprint(self.mtx)", ...
<|body_start_0|> if not matrix or not matrix[0]: return row, col = (len(matrix), len(matrix[0])) self.mtx = [[0] * (col + 1) for _ in range(row + 1)] for r in range(row): for c in range(col): self.mtx[r + 1][c + 1] = self.mtx[r][c + 1] + self.mtx[r...
NumMatrix_1
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumMatrix_1: def __init__(self, matrix): """:type matrix: List[List[int]]""" <|body_0|> def sumRegion(self, row1, col1, row2, col2): """:type row1: int :type col1: int :type row2: int :type col2: int :rtype: int 59ms""" <|body_1|> <|end_skeleton|> <|body_st...
stack_v2_sparse_classes_36k_train_007875
2,823
no_license
[ { "docstring": ":type matrix: List[List[int]]", "name": "__init__", "signature": "def __init__(self, matrix)" }, { "docstring": ":type row1: int :type col1: int :type row2: int :type col2: int :rtype: int 59ms", "name": "sumRegion", "signature": "def sumRegion(self, row1, col1, row2, col...
2
null
Implement the Python class `NumMatrix_1` described below. Class description: Implement the NumMatrix_1 class. Method signatures and docstrings: - def __init__(self, matrix): :type matrix: List[List[int]] - def sumRegion(self, row1, col1, row2, col2): :type row1: int :type col1: int :type row2: int :type col2: int :rt...
Implement the Python class `NumMatrix_1` described below. Class description: Implement the NumMatrix_1 class. Method signatures and docstrings: - def __init__(self, matrix): :type matrix: List[List[int]] - def sumRegion(self, row1, col1, row2, col2): :type row1: int :type col1: int :type row2: int :type col2: int :rt...
679a2b246b8b6bb7fc55ed1c8096d3047d6d4461
<|skeleton|> class NumMatrix_1: def __init__(self, matrix): """:type matrix: List[List[int]]""" <|body_0|> def sumRegion(self, row1, col1, row2, col2): """:type row1: int :type col1: int :type row2: int :type col2: int :rtype: int 59ms""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NumMatrix_1: def __init__(self, matrix): """:type matrix: List[List[int]]""" if not matrix or not matrix[0]: return row, col = (len(matrix), len(matrix[0])) self.mtx = [[0] * (col + 1) for _ in range(row + 1)] for r in range(row): for c in range(...
the_stack_v2_python_sparse
RangeSumQuery2D_Immutable_MID_304.py
953250587/leetcode-python
train
2
20e841202d99ae745f8555313623f54e72a9f1fc
[ "payload = cls.payload_for_create(type, value)\nbase_doc = base_document.update(virtual_documents=[payload])\nvirtual_doc = [doc for doc in base_doc.virtual_documents if doc.type == type][0]\nreturn virtual_doc", "doc = super(VirtualDocument, cls).from_response(response)\nif response.get('status') == 'SUBMITTED|M...
<|body_start_0|> payload = cls.payload_for_create(type, value) base_doc = base_document.update(virtual_documents=[payload]) virtual_doc = [doc for doc in base_doc.virtual_documents if doc.type == type][0] return virtual_doc <|end_body_0|> <|body_start_1|> doc = super(VirtualDocu...
Object representation of a supporting virtual document. Virtual documents are normally ID numbers that help verify the user's identity. https://docs.synapsepay.com/docs/user-resources#section-virtual-document-types
VirtualDocument
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VirtualDocument: """Object representation of a supporting virtual document. Virtual documents are normally ID numbers that help verify the user's identity. https://docs.synapsepay.com/docs/user-resources#section-virtual-document-types""" def create(cls, base_document, type=None, value=None):...
stack_v2_sparse_classes_36k_train_007876
2,913
permissive
[ { "docstring": "Add a VirtualDocument to the BaseDocument. Args: type (str): https://docs.synapsepay.com/docs/user-resources#section-virtual-document-types value (str): SSN or TIN, for example Returns: VirtualDocument: a new VirtualDocument instance", "name": "create", "signature": "def create(cls, base...
4
stack_v2_sparse_classes_30k_train_011562
Implement the Python class `VirtualDocument` described below. Class description: Object representation of a supporting virtual document. Virtual documents are normally ID numbers that help verify the user's identity. https://docs.synapsepay.com/docs/user-resources#section-virtual-document-types Method signatures and ...
Implement the Python class `VirtualDocument` described below. Class description: Object representation of a supporting virtual document. Virtual documents are normally ID numbers that help verify the user's identity. https://docs.synapsepay.com/docs/user-resources#section-virtual-document-types Method signatures and ...
e7647191b386bdda84c0f2f1eb097569e36c27ae
<|skeleton|> class VirtualDocument: """Object representation of a supporting virtual document. Virtual documents are normally ID numbers that help verify the user's identity. https://docs.synapsepay.com/docs/user-resources#section-virtual-document-types""" def create(cls, base_document, type=None, value=None):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class VirtualDocument: """Object representation of a supporting virtual document. Virtual documents are normally ID numbers that help verify the user's identity. https://docs.synapsepay.com/docs/user-resources#section-virtual-document-types""" def create(cls, base_document, type=None, value=None): """A...
the_stack_v2_python_sparse
synapse_pay_rest/models/users/virtual_document.py
SynapseFI/SynapseFI-Python
train
4
39fa9fa2c3fbc41dfded2200a7a87a423d3dbf93
[ "try:\n from bigdl.llm.transformers import AutoModel\n from transformers import AutoTokenizer, LlamaTokenizer\nexcept ImportError:\n raise ValueError('Could not import transformers python package. Please install it with `pip install transformers`.')\n_model_kwargs = model_kwargs or {}\ntry:\n tokenizer ...
<|body_start_0|> try: from bigdl.llm.transformers import AutoModel from transformers import AutoTokenizer, LlamaTokenizer except ImportError: raise ValueError('Could not import transformers python package. Please install it with `pip install transformers`.') _...
Wrapper around bigdl-llm transformers embedding models. To use, you should have the ``transformers`` python package installed. Example: .. code-block:: python from bigdl.llm.langchain.embeddings import TransformersEmbeddings embeddings = TransformersEmbeddings.from_model_id(model_id)
TransformersEmbeddings
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TransformersEmbeddings: """Wrapper around bigdl-llm transformers embedding models. To use, you should have the ``transformers`` python package installed. Example: .. code-block:: python from bigdl.llm.langchain.embeddings import TransformersEmbeddings embeddings = TransformersEmbeddings.from_mode...
stack_v2_sparse_classes_36k_train_007877
5,917
permissive
[ { "docstring": "Construct object from model_id", "name": "from_model_id", "signature": "def from_model_id(cls, model_id: str, model_kwargs: Optional[dict]=None, **kwargs: Any)" }, { "docstring": "Compute doc embeddings using a HuggingFace transformer model. Args: texts: The list of texts to embe...
4
null
Implement the Python class `TransformersEmbeddings` described below. Class description: Wrapper around bigdl-llm transformers embedding models. To use, you should have the ``transformers`` python package installed. Example: .. code-block:: python from bigdl.llm.langchain.embeddings import TransformersEmbeddings embedd...
Implement the Python class `TransformersEmbeddings` described below. Class description: Wrapper around bigdl-llm transformers embedding models. To use, you should have the ``transformers`` python package installed. Example: .. code-block:: python from bigdl.llm.langchain.embeddings import TransformersEmbeddings embedd...
4ffa012a426e0d16ed13b707b03d8787ddca6aa4
<|skeleton|> class TransformersEmbeddings: """Wrapper around bigdl-llm transformers embedding models. To use, you should have the ``transformers`` python package installed. Example: .. code-block:: python from bigdl.llm.langchain.embeddings import TransformersEmbeddings embeddings = TransformersEmbeddings.from_mode...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TransformersEmbeddings: """Wrapper around bigdl-llm transformers embedding models. To use, you should have the ``transformers`` python package installed. Example: .. code-block:: python from bigdl.llm.langchain.embeddings import TransformersEmbeddings embeddings = TransformersEmbeddings.from_model_id(model_id...
the_stack_v2_python_sparse
python/llm/src/bigdl/llm/langchain/embeddings/transformersembeddings.py
intel-analytics/BigDL
train
4,913
63bbe4ebda6c4ec097ba6b494b067d9bbbfc7a95
[ "i, j = (len(S) - 1, len(T) - 1)\nwhile True:\n bs = 0\n while i >= 0 and (S[i] == '#' or bs > 0):\n if S[i] == '#':\n bs += 1\n else:\n bs -= 1\n i -= 1\n while j >= 0 and (T[j] == '#' or bs > 0):\n if T[j] == '#':\n bs += 1\n else:\n ...
<|body_start_0|> i, j = (len(S) - 1, len(T) - 1) while True: bs = 0 while i >= 0 and (S[i] == '#' or bs > 0): if S[i] == '#': bs += 1 else: bs -= 1 i -= 1 while j >= 0 and (T[j] ==...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def backspaceCompare(self, S, T): """:type S: str :type T: str :rtype: bool""" <|body_0|> def backspaceCompare(self, S, T): """:type S: str :type T: str :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> i, j = (len(S) - 1, len(T...
stack_v2_sparse_classes_36k_train_007878
1,311
no_license
[ { "docstring": ":type S: str :type T: str :rtype: bool", "name": "backspaceCompare", "signature": "def backspaceCompare(self, S, T)" }, { "docstring": ":type S: str :type T: str :rtype: bool", "name": "backspaceCompare", "signature": "def backspaceCompare(self, S, T)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def backspaceCompare(self, S, T): :type S: str :type T: str :rtype: bool - def backspaceCompare(self, S, T): :type S: str :type T: str :rtype: bool
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def backspaceCompare(self, S, T): :type S: str :type T: str :rtype: bool - def backspaceCompare(self, S, T): :type S: str :type T: str :rtype: bool <|skeleton|> class Solution: ...
c27f19fac14b4acef8c631ad5569e1a5c29e9e1f
<|skeleton|> class Solution: def backspaceCompare(self, S, T): """:type S: str :type T: str :rtype: bool""" <|body_0|> def backspaceCompare(self, S, T): """:type S: str :type T: str :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def backspaceCompare(self, S, T): """:type S: str :type T: str :rtype: bool""" i, j = (len(S) - 1, len(T) - 1) while True: bs = 0 while i >= 0 and (S[i] == '#' or bs > 0): if S[i] == '#': bs += 1 else...
the_stack_v2_python_sparse
leetcode/p0844 - Backspace String Compare.py
liseyko/CtCI
train
0
319b5d45886ad147530a86f5b52e5048ce1a62db
[ "comp = lambda a, b: 1 if a + b > b + a else -1\nnum_to_str = map(str, nums)\nnum_to_str.sort(cmp=comp, reverse=True)\nlargest = ''\nfor i in xrange(len(num_to_str)):\n largest = ''.join([largest, num_to_str[i]])\nif largest[0] == '0':\n return '0'\nprint(largest)\nreturn largest", "def cmp(a, b):\n if a...
<|body_start_0|> comp = lambda a, b: 1 if a + b > b + a else -1 num_to_str = map(str, nums) num_to_str.sort(cmp=comp, reverse=True) largest = '' for i in xrange(len(num_to_str)): largest = ''.join([largest, num_to_str[i]]) if largest[0] == '0': ret...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def largestNumber(self, nums): """:type nums: List[int] :rtype: str""" <|body_0|> def largestNumber2(self, nums): """:type nums: List[int] :rtype: str""" <|body_1|> <|end_skeleton|> <|body_start_0|> comp = lambda a, b: 1 if a + b > b + a e...
stack_v2_sparse_classes_36k_train_007879
1,394
no_license
[ { "docstring": ":type nums: List[int] :rtype: str", "name": "largestNumber", "signature": "def largestNumber(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: str", "name": "largestNumber2", "signature": "def largestNumber2(self, nums)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def largestNumber(self, nums): :type nums: List[int] :rtype: str - def largestNumber2(self, nums): :type nums: List[int] :rtype: str
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def largestNumber(self, nums): :type nums: List[int] :rtype: str - def largestNumber2(self, nums): :type nums: List[int] :rtype: str <|skeleton|> class Solution: def larges...
2d5fa4cd696d5035ea8859befeadc5cc436959c9
<|skeleton|> class Solution: def largestNumber(self, nums): """:type nums: List[int] :rtype: str""" <|body_0|> def largestNumber2(self, nums): """:type nums: List[int] :rtype: str""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def largestNumber(self, nums): """:type nums: List[int] :rtype: str""" comp = lambda a, b: 1 if a + b > b + a else -1 num_to_str = map(str, nums) num_to_str.sort(cmp=comp, reverse=True) largest = '' for i in xrange(len(num_to_str)): largest...
the_stack_v2_python_sparse
SourceCode/Python/Problem/00179.Largest Number.py
roger6blog/LeetCode
train
0
ebcb97e058c714c3c336aa38be84fa4228d4f6f6
[ "if not root:\n return []\nres = []\nqueue = [root]\nwhile queue:\n level_node = []\n temp = []\n for i in queue:\n level_node.append(i.val)\n if i.left:\n temp.append(i.left)\n if i.right:\n temp.append(i.right)\n res.append(level_node)\n queue = temp\nr...
<|body_start_0|> if not root: return [] res = [] queue = [root] while queue: level_node = [] temp = [] for i in queue: level_node.append(i.val) if i.left: temp.append(i.left) ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def levelOrder(self, root: TreeNode) -> List[List[int]]: """bfs 迭代:相对来说用队列就能实现""" <|body_0|> def levelOrder1(self, root: TreeNode) -> List[List[int]]: """递归""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not root: return []...
stack_v2_sparse_classes_36k_train_007880
1,795
no_license
[ { "docstring": "bfs 迭代:相对来说用队列就能实现", "name": "levelOrder", "signature": "def levelOrder(self, root: TreeNode) -> List[List[int]]" }, { "docstring": "递归", "name": "levelOrder1", "signature": "def levelOrder1(self, root: TreeNode) -> List[List[int]]" } ]
2
stack_v2_sparse_classes_30k_train_003916
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def levelOrder(self, root: TreeNode) -> List[List[int]]: bfs 迭代:相对来说用队列就能实现 - def levelOrder1(self, root: TreeNode) -> List[List[int]]: 递归
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def levelOrder(self, root: TreeNode) -> List[List[int]]: bfs 迭代:相对来说用队列就能实现 - def levelOrder1(self, root: TreeNode) -> List[List[int]]: 递归 <|skeleton|> class Solution: def ...
069bb0b751ef7f469036b9897436eb5d138ffa24
<|skeleton|> class Solution: def levelOrder(self, root: TreeNode) -> List[List[int]]: """bfs 迭代:相对来说用队列就能实现""" <|body_0|> def levelOrder1(self, root: TreeNode) -> List[List[int]]: """递归""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def levelOrder(self, root: TreeNode) -> List[List[int]]: """bfs 迭代:相对来说用队列就能实现""" if not root: return [] res = [] queue = [root] while queue: level_node = [] temp = [] for i in queue: level_node.a...
the_stack_v2_python_sparse
算法/Week_02/102. 二叉树的层序遍历.py
RichieSong/algorithm
train
0
60623294a2ea0333045f1d14b7aee33888e8f283
[ "parser.add_argument('name', help='The name of this cluster.')\nparser.add_argument('--size', required=True, type=int, help='Target number of nodes in the cluster.')\nparser.add_argument('--wait', action='store_true', default=True, help='Poll the operation for completion after issuing an resize request.')", "adap...
<|body_start_0|> parser.add_argument('name', help='The name of this cluster.') parser.add_argument('--size', required=True, type=int, help='Target number of nodes in the cluster.') parser.add_argument('--wait', action='store_true', default=True, help='Poll the operation for completion after issu...
Resizes an existing cluster for running containers.
Resize
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Resize: """Resizes an existing cluster for running containers.""" def Args(parser): """Register flags for this command. Args: parser: An argparse.ArgumentParser-like object. It is mocked out in order to capture some information, but behaves like an ArgumentParser.""" <|body_0...
stack_v2_sparse_classes_36k_train_007881
4,051
permissive
[ { "docstring": "Register flags for this command. Args: parser: An argparse.ArgumentParser-like object. It is mocked out in order to capture some information, but behaves like an ArgumentParser.", "name": "Args", "signature": "def Args(parser)" }, { "docstring": "This is what gets called when the...
2
stack_v2_sparse_classes_30k_train_016715
Implement the Python class `Resize` described below. Class description: Resizes an existing cluster for running containers. Method signatures and docstrings: - def Args(parser): Register flags for this command. Args: parser: An argparse.ArgumentParser-like object. It is mocked out in order to capture some information...
Implement the Python class `Resize` described below. Class description: Resizes an existing cluster for running containers. Method signatures and docstrings: - def Args(parser): Register flags for this command. Args: parser: An argparse.ArgumentParser-like object. It is mocked out in order to capture some information...
dcf4886d4ec06b13282143ef795c5f0ff20ffee3
<|skeleton|> class Resize: """Resizes an existing cluster for running containers.""" def Args(parser): """Register flags for this command. Args: parser: An argparse.ArgumentParser-like object. It is mocked out in order to capture some information, but behaves like an ArgumentParser.""" <|body_0...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Resize: """Resizes an existing cluster for running containers.""" def Args(parser): """Register flags for this command. Args: parser: An argparse.ArgumentParser-like object. It is mocked out in order to capture some information, but behaves like an ArgumentParser.""" parser.add_argument('...
the_stack_v2_python_sparse
google-cloud-sdk/.install/.backup/lib/surface/container/clusters/resize.py
MD-Anderson-Bioinformatics/NG-CHM_Galaxy
train
0
f7ac0c24b999710288fa4acd6e663b5b6e71df72
[ "if app == 'cmdb':\n engine = create_engine(config_name.CMDB_DATABASE_URI)\nelif app == 'earthworm':\n engine = create_engine(config_name.EARTHWORM_DATABASE_URI)\nelif app == 'medusa':\n engine = create_engine(config_name.MEDUSA_DATABASE_URI)\nelif app == 'bigdata':\n engine = create_engine(config_name....
<|body_start_0|> if app == 'cmdb': engine = create_engine(config_name.CMDB_DATABASE_URI) elif app == 'earthworm': engine = create_engine(config_name.EARTHWORM_DATABASE_URI) elif app == 'medusa': engine = create_engine(config_name.MEDUSA_DATABASE_URI) e...
Define MySQL_query
MySQL_query
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MySQL_query: """Define MySQL_query""" def sql_query(self, sql, app): """Define sql_query""" <|body_0|> def mysql_RowProxy_to_str(self, sql, app): """将MySQl Proxy数据转换为字符串数据""" <|body_1|> def mysql_RowProxy_to_list(self, sql, fields, app): """将...
stack_v2_sparse_classes_36k_train_007882
4,991
no_license
[ { "docstring": "Define sql_query", "name": "sql_query", "signature": "def sql_query(self, sql, app)" }, { "docstring": "将MySQl Proxy数据转换为字符串数据", "name": "mysql_RowProxy_to_str", "signature": "def mysql_RowProxy_to_str(self, sql, app)" }, { "docstring": "将MySQl Proxy数据转换为列表数据", ...
4
stack_v2_sparse_classes_30k_train_020394
Implement the Python class `MySQL_query` described below. Class description: Define MySQL_query Method signatures and docstrings: - def sql_query(self, sql, app): Define sql_query - def mysql_RowProxy_to_str(self, sql, app): 将MySQl Proxy数据转换为字符串数据 - def mysql_RowProxy_to_list(self, sql, fields, app): 将MySQl Proxy数据转换...
Implement the Python class `MySQL_query` described below. Class description: Define MySQL_query Method signatures and docstrings: - def sql_query(self, sql, app): Define sql_query - def mysql_RowProxy_to_str(self, sql, app): 将MySQl Proxy数据转换为字符串数据 - def mysql_RowProxy_to_list(self, sql, fields, app): 将MySQl Proxy数据转换...
2de82e898524194b3b735835c044f078cc6ee5ba
<|skeleton|> class MySQL_query: """Define MySQL_query""" def sql_query(self, sql, app): """Define sql_query""" <|body_0|> def mysql_RowProxy_to_str(self, sql, app): """将MySQl Proxy数据转换为字符串数据""" <|body_1|> def mysql_RowProxy_to_list(self, sql, fields, app): """将...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MySQL_query: """Define MySQL_query""" def sql_query(self, sql, app): """Define sql_query""" if app == 'cmdb': engine = create_engine(config_name.CMDB_DATABASE_URI) elif app == 'earthworm': engine = create_engine(config_name.EARTHWORM_DATABASE_URI) e...
the_stack_v2_python_sparse
project/business_0321/app/db.py
visionguo/python
train
0
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_36k_train_007883
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
null
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_36k
data/stack_v2_sparse_classes_30k
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
e9222265dbb0c5a516e2e8ee11841331c0710897
[ "args = self.parser.parse_args()\ndata = self.build_data(args=args, collection='github_task')\nreturn data", "args = self.parse_args(add_github_task_fields)\nname = args.pop('name')\nkeyword = args.pop('keyword')\nkeyword = keyword.strip()\nif not keyword:\n return utils.build_ret(ErrorMsg.GithubKeywordEmpty, ...
<|body_start_0|> args = self.parser.parse_args() data = self.build_data(args=args, collection='github_task') return data <|end_body_0|> <|body_start_1|> args = self.parse_args(add_github_task_fields) name = args.pop('name') keyword = args.pop('keyword') keyword =...
ARLGithubTask
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ARLGithubTask: def get(self): """Github 任务信息查询""" <|body_0|> def post(self): """Github 任务添加""" <|body_1|> <|end_skeleton|> <|body_start_0|> args = self.parser.parse_args() data = self.build_data(args=args, collection='github_task') r...
stack_v2_sparse_classes_36k_train_007884
4,825
no_license
[ { "docstring": "Github 任务信息查询", "name": "get", "signature": "def get(self)" }, { "docstring": "Github 任务添加", "name": "post", "signature": "def post(self)" } ]
2
null
Implement the Python class `ARLGithubTask` described below. Class description: Implement the ARLGithubTask class. Method signatures and docstrings: - def get(self): Github 任务信息查询 - def post(self): Github 任务添加
Implement the Python class `ARLGithubTask` described below. Class description: Implement the ARLGithubTask class. Method signatures and docstrings: - def get(self): Github 任务信息查询 - def post(self): Github 任务添加 <|skeleton|> class ARLGithubTask: def get(self): """Github 任务信息查询""" <|body_0|> de...
5ca64806252b9e7e6d2b31a6bfaeecbfdc4baf06
<|skeleton|> class ARLGithubTask: def get(self): """Github 任务信息查询""" <|body_0|> def post(self): """Github 任务添加""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ARLGithubTask: def get(self): """Github 任务信息查询""" args = self.parser.parse_args() data = self.build_data(args=args, collection='github_task') return data def post(self): """Github 任务添加""" args = self.parse_args(add_github_task_fields) name = args.po...
the_stack_v2_python_sparse
app/routes/github_task.py
QmF0c3UK/ARL
train
0
eb18669ec44bb22f4136f5cbfc51746a4af27340
[ "super(LinkTask, self).__init__(*args, **kwargs)\nself.setOption('type', self.__defaultLinkType)\nself.setMetadata('dispatch.split', True)\nself.setMetadata('dispatch.splitSize', 20)", "assert self.option('type') in ('hardlink', 'symlink'), 'Invalid link type {}'.format(self.option())\nfor crawler in self.crawler...
<|body_start_0|> super(LinkTask, self).__init__(*args, **kwargs) self.setOption('type', self.__defaultLinkType) self.setMetadata('dispatch.split', True) self.setMetadata('dispatch.splitSize', 20) <|end_body_0|> <|body_start_1|> assert self.option('type') in ('hardlink', 'symlink...
Links (hardlink or symlink) a file to the target file path.
LinkTask
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LinkTask: """Links (hardlink or symlink) a file to the target file path.""" def __init__(self, *args, **kwargs): """Create a Link task.""" <|body_0|> def _perform(self): """Perform the task.""" <|body_1|> def __linkOnWindows(self, sourceFilePath, tar...
stack_v2_sparse_classes_36k_train_007885
3,884
permissive
[ { "docstring": "Create a Link task.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Perform the task.", "name": "_perform", "signature": "def _perform(self)" }, { "docstring": "Create a link on windows.", "name": "__linkOnWindows", ...
4
stack_v2_sparse_classes_30k_train_011863
Implement the Python class `LinkTask` described below. Class description: Links (hardlink or symlink) a file to the target file path. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Create a Link task. - def _perform(self): Perform the task. - def __linkOnWindows(self, sourceFilePath, targetF...
Implement the Python class `LinkTask` described below. Class description: Links (hardlink or symlink) a file to the target file path. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Create a Link task. - def _perform(self): Perform the task. - def __linkOnWindows(self, sourceFilePath, targetF...
046dbb0c1b4ff20ea5f2e1679f8d89f3089b6aa4
<|skeleton|> class LinkTask: """Links (hardlink or symlink) a file to the target file path.""" def __init__(self, *args, **kwargs): """Create a Link task.""" <|body_0|> def _perform(self): """Perform the task.""" <|body_1|> def __linkOnWindows(self, sourceFilePath, tar...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LinkTask: """Links (hardlink or symlink) a file to the target file path.""" def __init__(self, *args, **kwargs): """Create a Link task.""" super(LinkTask, self).__init__(*args, **kwargs) self.setOption('type', self.__defaultLinkType) self.setMetadata('dispatch.split', True...
the_stack_v2_python_sparse
src/lib/kombi/Task/Fs/LinkTask.py
kombiHQ/kombi
train
2
a322709883ba2162eda57f91394f82336c53fa2e
[ "cur = 0\ncount = 1\nwhile cur < len(chars) - 1:\n if chars[cur] == chars[cur + 1]:\n chars.pop(cur + 1)\n count += 1\n elif count > 1:\n tmp = list(str(count))\n for i in range(len(tmp)):\n chars.insert(cur + 1 + i, tmp[i])\n cur += len(tmp) + 1\n count = ...
<|body_start_0|> cur = 0 count = 1 while cur < len(chars) - 1: if chars[cur] == chars[cur + 1]: chars.pop(cur + 1) count += 1 elif count > 1: tmp = list(str(count)) for i in range(len(tmp)): ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def compress(self, chars): """1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype: int""" <|body_0|> def compress2(self, chars): """1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|...
stack_v2_sparse_classes_36k_train_007886
2,481
no_license
[ { "docstring": "1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype: int", "name": "compress", "signature": "def compress(self, chars)" }, { "docstring": "1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype: int", "name": "compress2", "signature": "def compress2(self, chars)"...
2
stack_v2_sparse_classes_30k_train_008085
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def compress(self, chars): 1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype: int - def compress2(self, chars): 1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype:...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def compress(self, chars): 1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype: int - def compress2(self, chars): 1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype:...
5d3574ccd282d0146c83c286ae28d8baaabd4910
<|skeleton|> class Solution: def compress(self, chars): """1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype: int""" <|body_0|> def compress2(self, chars): """1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def compress(self, chars): """1个字符保持不动 2个以上连续字符以字符,出现次数代替 :type chars: List[str] :rtype: int""" cur = 0 count = 1 while cur < len(chars) - 1: if chars[cur] == chars[cur + 1]: chars.pop(cur + 1) count += 1 elif co...
the_stack_v2_python_sparse
443_压缩字符串.py
lovehhf/LeetCode
train
0
75ed678640172f8257fa267e9ee9d61cc00d8d3e
[ "assert isinstance(lambda_lineno, int), f'{repr(lambda_lineno)} not integer.'\nassert lambda_lineno >= 0, f'{lambda_lineno} < 0.'\nsuper().__init__()\nself._lambda_lineno = lambda_lineno\nself.lambdas_code: List[str] = []", "if node.lineno == self._lambda_lineno:\n self.lambdas_code.append(ast_unparse(node))\n...
<|body_start_0|> assert isinstance(lambda_lineno, int), f'{repr(lambda_lineno)} not integer.' assert lambda_lineno >= 0, f'{lambda_lineno} < 0.' super().__init__() self._lambda_lineno = lambda_lineno self.lambdas_code: List[str] = [] <|end_body_0|> <|body_start_1|> if no...
**Lambda node unparser** (i.e., object decompiling the abstract syntax tree (AST) nodes of *all* pure-Python lambda functions defined in a caller-specified block of source code into the exact substrings of that block defining those lambda functions by applying the visitor design pattern to an AST parsed from that block...
_LambdaNodeUnparser
[ "MIT", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _LambdaNodeUnparser: """**Lambda node unparser** (i.e., object decompiling the abstract syntax tree (AST) nodes of *all* pure-Python lambda functions defined in a caller-specified block of source code into the exact substrings of that block defining those lambda functions by applying the visitor ...
stack_v2_sparse_classes_36k_train_007887
32,447
permissive
[ { "docstring": "Initialize this visitor. Parameters ---------- lambda_lineno : int Caller-specific line number (of the code from which the AST visited by this object was parsed) starting the definition of the lambda functions to be unparsed by this visitor.", "name": "__init__", "signature": "def __init...
2
null
Implement the Python class `_LambdaNodeUnparser` described below. Class description: **Lambda node unparser** (i.e., object decompiling the abstract syntax tree (AST) nodes of *all* pure-Python lambda functions defined in a caller-specified block of source code into the exact substrings of that block defining those la...
Implement the Python class `_LambdaNodeUnparser` described below. Class description: **Lambda node unparser** (i.e., object decompiling the abstract syntax tree (AST) nodes of *all* pure-Python lambda functions defined in a caller-specified block of source code into the exact substrings of that block defining those la...
0cfd53391eb4de2f8297a4632aa5895b8d82a5b7
<|skeleton|> class _LambdaNodeUnparser: """**Lambda node unparser** (i.e., object decompiling the abstract syntax tree (AST) nodes of *all* pure-Python lambda functions defined in a caller-specified block of source code into the exact substrings of that block defining those lambda functions by applying the visitor ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _LambdaNodeUnparser: """**Lambda node unparser** (i.e., object decompiling the abstract syntax tree (AST) nodes of *all* pure-Python lambda functions defined in a caller-specified block of source code into the exact substrings of that block defining those lambda functions by applying the visitor design patter...
the_stack_v2_python_sparse
beartype/_util/func/utilfunccode.py
beartype/beartype
train
1,992
60d1c2446d772b0cd36a17b045f1f3f9b432cf6e
[ "super().__init__()\nself.steps = None\nself.dt = None\nself.max_t = None", "if 'steps' in conf:\n self.steps = conf.getint('steps')\nif 'dt' in conf:\n self.dt = conf.getfloat('dt')\nif 'max_t' in conf:\n self.max_t = conf.getfloat('max_t')" ]
<|body_start_0|> super().__init__() self.steps = None self.dt = None self.max_t = None <|end_body_0|> <|body_start_1|> if 'steps' in conf: self.steps = conf.getint('steps') if 'dt' in conf: self.dt = conf.getfloat('dt') if 'max_t' in conf:...
A parser for the time section of the config file. Attributes: steps (int): The instantiated number of steps for time iteration. dt (float): The value for dt (change in time) max_t (float): The time to iterate until.
TimeParser
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TimeParser: """A parser for the time section of the config file. Attributes: steps (int): The instantiated number of steps for time iteration. dt (float): The value for dt (change in time) max_t (float): The time to iterate until.""" def __init__(self): """Initialiser for the TimePar...
stack_v2_sparse_classes_36k_train_007888
1,165
permissive
[ { "docstring": "Initialiser for the TimeParser class.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Parse the given config section into the relevent time values. Args: conf (configparser section): The config section for the time values.", "name": "parse", "si...
2
stack_v2_sparse_classes_30k_train_018113
Implement the Python class `TimeParser` described below. Class description: A parser for the time section of the config file. Attributes: steps (int): The instantiated number of steps for time iteration. dt (float): The value for dt (change in time) max_t (float): The time to iterate until. Method signatures and docs...
Implement the Python class `TimeParser` described below. Class description: A parser for the time section of the config file. Attributes: steps (int): The instantiated number of steps for time iteration. dt (float): The value for dt (change in time) max_t (float): The time to iterate until. Method signatures and docs...
cc4e7f7b9abb498893aaa05e2b25416f513905b0
<|skeleton|> class TimeParser: """A parser for the time section of the config file. Attributes: steps (int): The instantiated number of steps for time iteration. dt (float): The value for dt (change in time) max_t (float): The time to iterate until.""" def __init__(self): """Initialiser for the TimePar...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TimeParser: """A parser for the time section of the config file. Attributes: steps (int): The instantiated number of steps for time iteration. dt (float): The value for dt (change in time) max_t (float): The time to iterate until.""" def __init__(self): """Initialiser for the TimeParser class."""...
the_stack_v2_python_sparse
TTiP/parsers/time_parser.py
AndrewLister-STFC/TTiP
train
0
e6732ba6a86095764ae879dd4265332e695d1e85
[ "self.ddve = DDVEManager()\nself.ddboost = DDBoostManager()\nself.parameters = ParameterManager()\nself.database = DatabaseManager()", "storage_unit = self.database.get_storage_unit_by_id(operation.storage_unit_id)\nself.ddve.clear_results()\nself.parameters.set_parameters(storage_unit.name, operation.parameters)...
<|body_start_0|> self.ddve = DDVEManager() self.ddboost = DDBoostManager() self.parameters = ParameterManager() self.database = DatabaseManager() <|end_body_0|> <|body_start_1|> storage_unit = self.database.get_storage_unit_by_id(operation.storage_unit_id) self.ddve.clea...
Maintains the subsystems required for the execution of an operation.
OperationManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OperationManager: """Maintains the subsystems required for the execution of an operation.""" def __init__(self): """Initializes the subsystems required for the execution of an operation.""" <|body_0|> def execute_operation(self, operation: Operation) -> None: """...
stack_v2_sparse_classes_36k_train_007889
1,429
no_license
[ { "docstring": "Initializes the subsystems required for the execution of an operation.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Executes an operation by passing it to the subsystems in the proper order. :param operation: operation inputs and storage for outputs ...
2
stack_v2_sparse_classes_30k_train_013575
Implement the Python class `OperationManager` described below. Class description: Maintains the subsystems required for the execution of an operation. Method signatures and docstrings: - def __init__(self): Initializes the subsystems required for the execution of an operation. - def execute_operation(self, operation:...
Implement the Python class `OperationManager` described below. Class description: Maintains the subsystems required for the execution of an operation. Method signatures and docstrings: - def __init__(self): Initializes the subsystems required for the execution of an operation. - def execute_operation(self, operation:...
d8ee7c1608cad88f7c64410de49a07bf7b621be0
<|skeleton|> class OperationManager: """Maintains the subsystems required for the execution of an operation.""" def __init__(self): """Initializes the subsystems required for the execution of an operation.""" <|body_0|> def execute_operation(self, operation: Operation) -> None: """...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OperationManager: """Maintains the subsystems required for the execution of an operation.""" def __init__(self): """Initializes the subsystems required for the execution of an operation.""" self.ddve = DDVEManager() self.ddboost = DDBoostManager() self.parameters = Paramet...
the_stack_v2_python_sparse
readop/managers/operation.py
wma8/SeniorDesign
train
0
4f5627fc3183b6714c6c39d26d80be832e9f5f16
[ "self.fileHandle = fileHandle\nself.dagPath = dagPath\nself.fFluid = OpenMayaFX.MFnFluid(dagPath)", "xPtr = OpenMaya.MScriptUtil().asDoublePtr()\nyPtr = OpenMaya.MScriptUtil().asDoublePtr()\nzPtr = OpenMaya.MScriptUtil().asDoublePtr()\nself.fFluid.getDimensions(xPtr, yPtr, zPtr)\ndimX = OpenMaya.MScriptUtil(xPtr)...
<|body_start_0|> self.fileHandle = fileHandle self.dagPath = dagPath self.fFluid = OpenMayaFX.MFnFluid(dagPath) <|end_body_0|> <|body_start_1|> xPtr = OpenMaya.MScriptUtil().asDoublePtr() yPtr = OpenMaya.MScriptUtil().asDoublePtr() zPtr = OpenMaya.MScriptUtil().asDoubleP...
Fluid volume export module
Volume
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Volume: """Fluid volume export module""" def __init__(self, fileHandle, dagPath): """Set up the objects we're dealing with""" <|body_0|> def getOutput(self): """Read Fluid data and export as volumegrid""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_007890
2,972
no_license
[ { "docstring": "Set up the objects we're dealing with", "name": "__init__", "signature": "def __init__(self, fileHandle, dagPath)" }, { "docstring": "Read Fluid data and export as volumegrid", "name": "getOutput", "signature": "def getOutput(self)" } ]
2
stack_v2_sparse_classes_30k_test_001198
Implement the Python class `Volume` described below. Class description: Fluid volume export module Method signatures and docstrings: - def __init__(self, fileHandle, dagPath): Set up the objects we're dealing with - def getOutput(self): Read Fluid data and export as volumegrid
Implement the Python class `Volume` described below. Class description: Fluid volume export module Method signatures and docstrings: - def __init__(self, fileHandle, dagPath): Set up the objects we're dealing with - def getOutput(self): Read Fluid data and export as volumegrid <|skeleton|> class Volume: """Fluid...
3891e40c3c4c3a054e5ff1ff16d051d4e690cc4a
<|skeleton|> class Volume: """Fluid volume export module""" def __init__(self, fileHandle, dagPath): """Set up the objects we're dealing with""" <|body_0|> def getOutput(self): """Read Fluid data and export as volumegrid""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Volume: """Fluid volume export module""" def __init__(self, fileHandle, dagPath): """Set up the objects we're dealing with""" self.fileHandle = fileHandle self.dagPath = dagPath self.fFluid = OpenMayaFX.MFnFluid(dagPath) def getOutput(self): """Read Fluid data...
the_stack_v2_python_sparse
luxPlugin/Lux/LuxExportModules/Volume.py
LuxRender/LuxMaya
train
0
06712df722daef3cad57696b16caa699ca04d773
[ "self.cap = capacity\nself.cache = {}\nself.freqs = {}\nself.freqstart, self.freqend = new_link()", "if key not in self.cache:\n return -1\nnode = self.cache[key]\nfreq = self.freqs[node.freq]\nif detach(node):\n detach(freq)\n del self.freqs[node.freq]\nnode.freq += 1\nif node.freq not in self.freqs:\n ...
<|body_start_0|> self.cap = capacity self.cache = {} self.freqs = {} self.freqstart, self.freqend = new_link() <|end_body_0|> <|body_start_1|> if key not in self.cache: return -1 node = self.cache[key] freq = self.freqs[node.freq] if detach(no...
LFUCache
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LFUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: void""" <|body_2|> <|end_s...
stack_v2_sparse_classes_36k_train_007891
2,486
no_license
[ { "docstring": ":type capacity: int", "name": "__init__", "signature": "def __init__(self, capacity)" }, { "docstring": ":type key: int :rtype: int", "name": "get", "signature": "def get(self, key)" }, { "docstring": ":type key: int :type value: int :rtype: void", "name": "pu...
3
stack_v2_sparse_classes_30k_train_020431
Implement the Python class `LFUCache` described below. Class description: Implement the LFUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: void
Implement the Python class `LFUCache` described below. Class description: Implement the LFUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: void <|sk...
882f0223bbc139ef201a777aa2dca6df01cd06ce
<|skeleton|> class LFUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: void""" <|body_2|> <|end_s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LFUCache: def __init__(self, capacity): """:type capacity: int""" self.cap = capacity self.cache = {} self.freqs = {} self.freqstart, self.freqend = new_link() def get(self, key): """:type key: int :rtype: int""" if key not in self.cache: ...
the_stack_v2_python_sparse
2017/460.py
linmounong/leetcode
train
0
50c524c38b70846de1e18cbc5a633ccf162dae6a
[ "from ..objects.volumes import VolumeObject\nnode = self.get_object_or_404(objects.Node, node_id)\nnode_volumes = VolumeObject.get_volumes(node)\nreturn DisksFormatConvertor.format_disks_to_simple(node_volumes)", "from ..objects.volumes import VolumeObject\nnode = self.get_object_or_404(objects.Node, node_id)\nda...
<|body_start_0|> from ..objects.volumes import VolumeObject node = self.get_object_or_404(objects.Node, node_id) node_volumes = VolumeObject.get_volumes(node) return DisksFormatConvertor.format_disks_to_simple(node_volumes) <|end_body_0|> <|body_start_1|> from ..objects.volumes ...
NodeDisksHandler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NodeDisksHandler: def GET(self, node_id): """:returns: JSONized node disks. :http: * 200 (OK) * 404 (node not found in db)""" <|body_0|> def PUT(self, node_id): """:returns: JSONized node disks. :http: * 200 (OK) * 400 (invalid disks data specified) * 404 (node not f...
stack_v2_sparse_classes_36k_train_007892
3,280
permissive
[ { "docstring": ":returns: JSONized node disks. :http: * 200 (OK) * 404 (node not found in db)", "name": "GET", "signature": "def GET(self, node_id)" }, { "docstring": ":returns: JSONized node disks. :http: * 200 (OK) * 400 (invalid disks data specified) * 404 (node not found in db)", "name":...
2
null
Implement the Python class `NodeDisksHandler` described below. Class description: Implement the NodeDisksHandler class. Method signatures and docstrings: - def GET(self, node_id): :returns: JSONized node disks. :http: * 200 (OK) * 404 (node not found in db) - def PUT(self, node_id): :returns: JSONized node disks. :ht...
Implement the Python class `NodeDisksHandler` described below. Class description: Implement the NodeDisksHandler class. Method signatures and docstrings: - def GET(self, node_id): :returns: JSONized node disks. :http: * 200 (OK) * 404 (node not found in db) - def PUT(self, node_id): :returns: JSONized node disks. :ht...
0e09dce510927f2cc490b898e5fe3f813bd791be
<|skeleton|> class NodeDisksHandler: def GET(self, node_id): """:returns: JSONized node disks. :http: * 200 (OK) * 404 (node not found in db)""" <|body_0|> def PUT(self, node_id): """:returns: JSONized node disks. :http: * 200 (OK) * 400 (invalid disks data specified) * 404 (node not f...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NodeDisksHandler: def GET(self, node_id): """:returns: JSONized node disks. :http: * 200 (OK) * 404 (node not found in db)""" from ..objects.volumes import VolumeObject node = self.get_object_or_404(objects.Node, node_id) node_volumes = VolumeObject.get_volumes(node) re...
the_stack_v2_python_sparse
nailgun/nailgun/extensions/volume_manager/handlers/disks.py
mba811/fuel-web
train
1
479f18f93a6cdadd8747296c789277857a1cde25
[ "if datasrc is None:\n args = parser.parse_args()\n datasrc = args.datasrc\nsuper().__init__(id_=id_, original_id=original_id, env_knl=env_knl, connection=connection, agts_addrs=agts_addrs, variant=variant, depth=depth, gpu=gpu, interaction=interaction, datasrc=datasrc)", "vtx = self.pos[0]\nscalar_ngbs = g...
<|body_start_0|> if datasrc is None: args = parser.parse_args() datasrc = args.datasrc super().__init__(id_=id_, original_id=original_id, env_knl=env_knl, connection=connection, agts_addrs=agts_addrs, variant=variant, depth=depth, gpu=gpu, interaction=interaction, datasrc=datasrc...
RNNLSTMPathMaker
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RNNLSTMPathMaker: def __init__(self, id_: int, original_id: str, env_knl: EnvironmentKnowledge, connection: Connection, agts_addrs: list, variant: str='', gpu: bool=False, depth: float=3.0, interaction: bool=True, datasrc: str=None): """Args: id_ (int): original_id (str): env_knl (Enviro...
stack_v2_sparse_classes_36k_train_007893
2,604
permissive
[ { "docstring": "Args: id_ (int): original_id (str): env_knl (EnvironmentKnowledge): connection (Connection): agts_addrs (list): variant (str): gpu (bool): depth (float): interaction (bool): datasrc (str):", "name": "__init__", "signature": "def __init__(self, id_: int, original_id: str, env_knl: Environ...
2
stack_v2_sparse_classes_30k_train_003392
Implement the Python class `RNNLSTMPathMaker` described below. Class description: Implement the RNNLSTMPathMaker class. Method signatures and docstrings: - def __init__(self, id_: int, original_id: str, env_knl: EnvironmentKnowledge, connection: Connection, agts_addrs: list, variant: str='', gpu: bool=False, depth: f...
Implement the Python class `RNNLSTMPathMaker` described below. Class description: Implement the RNNLSTMPathMaker class. Method signatures and docstrings: - def __init__(self, id_: int, original_id: str, env_knl: EnvironmentKnowledge, connection: Connection, agts_addrs: list, variant: str='', gpu: bool=False, depth: f...
1b9634fb97e77407b4c609399c27663396a8d7e3
<|skeleton|> class RNNLSTMPathMaker: def __init__(self, id_: int, original_id: str, env_knl: EnvironmentKnowledge, connection: Connection, agts_addrs: list, variant: str='', gpu: bool=False, depth: float=3.0, interaction: bool=True, datasrc: str=None): """Args: id_ (int): original_id (str): env_knl (Enviro...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RNNLSTMPathMaker: def __init__(self, id_: int, original_id: str, env_knl: EnvironmentKnowledge, connection: Connection, agts_addrs: list, variant: str='', gpu: bool=False, depth: float=3.0, interaction: bool=True, datasrc: str=None): """Args: id_ (int): original_id (str): env_knl (EnvironmentKnowledge...
the_stack_v2_python_sparse
pytrol/control/agent/RNNLSTMPathMaker.py
mothguib/pytrol
train
0
2abaee166f1a4df5b395d72c015ba69770a13432
[ "self.flow_hash = flow_hash\nself.classified = 0\nself.classification_tag = ''\nself.classification_time = 0\nself.actions = {}\nself.clsfn = clsfn\nself.time_limit = time_limit\nself.logger = logger\ndb_data = {'flow_hash': self.flow_hash}\ndb_data['classification_time'] = {'$gte': datetime.datetime.now() - self.t...
<|body_start_0|> self.flow_hash = flow_hash self.classified = 0 self.classification_tag = '' self.classification_time = 0 self.actions = {} self.clsfn = clsfn self.time_limit = time_limit self.logger = logger db_data = {'flow_hash': self.flow_hash}...
An object that represents an individual traffic classification
Classification
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Classification: """An object that represents an individual traffic classification""" def __init__(self, flow_hash, clsfn, time_limit, logger): """Retrieve classification data from MongoDB collection for a particular flow hash within a time range. time range is from current time backw...
stack_v2_sparse_classes_36k_train_007894
44,404
permissive
[ { "docstring": "Retrieve classification data from MongoDB collection for a particular flow hash within a time range. time range is from current time backwards by number of seconds defined in config for classification_time_limit Setting test returns database query execution statistics", "name": "__init__", ...
4
stack_v2_sparse_classes_30k_test_000092
Implement the Python class `Classification` described below. Class description: An object that represents an individual traffic classification Method signatures and docstrings: - def __init__(self, flow_hash, clsfn, time_limit, logger): Retrieve classification data from MongoDB collection for a particular flow hash w...
Implement the Python class `Classification` described below. Class description: An object that represents an individual traffic classification Method signatures and docstrings: - def __init__(self, flow_hash, clsfn, time_limit, logger): Retrieve classification data from MongoDB collection for a particular flow hash w...
55cc27e81defc42775ff563bfbef31800e089b14
<|skeleton|> class Classification: """An object that represents an individual traffic classification""" def __init__(self, flow_hash, clsfn, time_limit, logger): """Retrieve classification data from MongoDB collection for a particular flow hash within a time range. time range is from current time backw...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Classification: """An object that represents an individual traffic classification""" def __init__(self, flow_hash, clsfn, time_limit, logger): """Retrieve classification data from MongoDB collection for a particular flow hash within a time range. time range is from current time backwards by numbe...
the_stack_v2_python_sparse
nmeta/flows.py
awesome-nfv/nmeta
train
0
8dc8a8158830ee2d541d9f69a388c4de03808826
[ "self.subsampling_factor = subsampling_factor\nself.ignore_id = -1\nself.dtype = dtype\nself.load_aux_input = load_aux_input\nself.load_aux_output = load_aux_output", "assert len(batch) == 1\ndata, utts = batch[0]\nxs_data, ys_data = ([], [])\nfor ud in data:\n if ud[0].ndim > 1:\n xs_data.append(ud)\n ...
<|body_start_0|> self.subsampling_factor = subsampling_factor self.ignore_id = -1 self.dtype = dtype self.load_aux_input = load_aux_input self.load_aux_output = load_aux_output <|end_body_0|> <|body_start_1|> assert len(batch) == 1 data, utts = batch[0] x...
Custom batch converter. Args: subsampling_factor (int): The subsampling factor. dtype (np.dtype): Data type to convert.
CustomConverter
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomConverter: """Custom batch converter. Args: subsampling_factor (int): The subsampling factor. dtype (np.dtype): Data type to convert.""" def __init__(self, subsampling_factor=1, dtype=np.float32, load_aux_input=False, load_aux_output=False): """Construct a CustomConverter objec...
stack_v2_sparse_classes_36k_train_007895
3,438
permissive
[ { "docstring": "Construct a CustomConverter object.", "name": "__init__", "signature": "def __init__(self, subsampling_factor=1, dtype=np.float32, load_aux_input=False, load_aux_output=False)" }, { "docstring": "Transform a batch and send it to a device. Args: batch (list): The batch to transfor...
2
null
Implement the Python class `CustomConverter` described below. Class description: Custom batch converter. Args: subsampling_factor (int): The subsampling factor. dtype (np.dtype): Data type to convert. Method signatures and docstrings: - def __init__(self, subsampling_factor=1, dtype=np.float32, load_aux_input=False, ...
Implement the Python class `CustomConverter` described below. Class description: Custom batch converter. Args: subsampling_factor (int): The subsampling factor. dtype (np.dtype): Data type to convert. Method signatures and docstrings: - def __init__(self, subsampling_factor=1, dtype=np.float32, load_aux_input=False, ...
17854a04d43c231eff66bfed9d6aa55e94a29e79
<|skeleton|> class CustomConverter: """Custom batch converter. Args: subsampling_factor (int): The subsampling factor. dtype (np.dtype): Data type to convert.""" def __init__(self, subsampling_factor=1, dtype=np.float32, load_aux_input=False, load_aux_output=False): """Construct a CustomConverter objec...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomConverter: """Custom batch converter. Args: subsampling_factor (int): The subsampling factor. dtype (np.dtype): Data type to convert.""" def __init__(self, subsampling_factor=1, dtype=np.float32, load_aux_input=False, load_aux_output=False): """Construct a CustomConverter object.""" ...
the_stack_v2_python_sparse
paddlespeech/s2t/io/converter.py
anniyanvr/DeepSpeech-1
train
0
6e088a415b74b4137737d4446c87067d7db42359
[ "if not num_rows:\n return []\npascal = [1] * (num_rows + 1)\nfor i in range(2, num_rows + 1):\n for j in range(1, i):\n pascal[i - j] += pascal[i - j - 1]\nreturn pascal", "if not num_rows:\n return []\ntriangle = []\nfor row_num in range(num_rows):\n row = [None for _ in range(row_num + 1)]\n...
<|body_start_0|> if not num_rows: return [] pascal = [1] * (num_rows + 1) for i in range(2, num_rows + 1): for j in range(1, i): pascal[i - j] += pascal[i - j - 1] return pascal <|end_body_0|> <|body_start_1|> if not num_rows: ...
PascalTriangle
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PascalTriangle: def get_nth_row(self, num_rows: int) -> List[List[int]]: """Approach: DP Time Complexity: O(num_rows^2) Space Complexity: O(num_row) :param num_rows: :return:""" <|body_0|> def generate(self, num_rows: int) -> List[List[int]]: """Approach: DP Time Com...
stack_v2_sparse_classes_36k_train_007896
1,473
no_license
[ { "docstring": "Approach: DP Time Complexity: O(num_rows^2) Space Complexity: O(num_row) :param num_rows: :return:", "name": "get_nth_row", "signature": "def get_nth_row(self, num_rows: int) -> List[List[int]]" }, { "docstring": "Approach: DP Time Complexity: O(num_rows^2) Space Complexity: O(nu...
2
null
Implement the Python class `PascalTriangle` described below. Class description: Implement the PascalTriangle class. Method signatures and docstrings: - def get_nth_row(self, num_rows: int) -> List[List[int]]: Approach: DP Time Complexity: O(num_rows^2) Space Complexity: O(num_row) :param num_rows: :return: - def gene...
Implement the Python class `PascalTriangle` described below. Class description: Implement the PascalTriangle class. Method signatures and docstrings: - def get_nth_row(self, num_rows: int) -> List[List[int]]: Approach: DP Time Complexity: O(num_rows^2) Space Complexity: O(num_row) :param num_rows: :return: - def gene...
65cc78b5afa0db064f9fe8f06597e3e120f7363d
<|skeleton|> class PascalTriangle: def get_nth_row(self, num_rows: int) -> List[List[int]]: """Approach: DP Time Complexity: O(num_rows^2) Space Complexity: O(num_row) :param num_rows: :return:""" <|body_0|> def generate(self, num_rows: int) -> List[List[int]]: """Approach: DP Time Com...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PascalTriangle: def get_nth_row(self, num_rows: int) -> List[List[int]]: """Approach: DP Time Complexity: O(num_rows^2) Space Complexity: O(num_row) :param num_rows: :return:""" if not num_rows: return [] pascal = [1] * (num_rows + 1) for i in range(2, num_rows + 1)...
the_stack_v2_python_sparse
revisited/2d_arrays/pascal_triangle.py
Shiv2157k/leet_code
train
1
e89ef6f86e716dba631971f85e881459eb8d18a2
[ "super().__init__('custom_unitary', children, None)\nself.id = children[0]\nself.name = self.id.name\nif len(children) == 3:\n self.arguments = children[1]\n self.bitlist = children[2]\nelse:\n self.arguments = None\n self.bitlist = children[1]", "string = self.name\nif self.arguments is not None:\n ...
<|body_start_0|> super().__init__('custom_unitary', children, None) self.id = children[0] self.name = self.id.name if len(children) == 3: self.arguments = children[1] self.bitlist = children[2] else: self.arguments = None self.bitli...
Node for an OPENQASM custom gate statement. children[0] is an id node. children[1] is an exp_list (if len==3) or primary_list. children[2], if present, is a primary_list. Has properties: .id = id node .name = gate name string .arguments = None or exp_list node .bitlist = primary_list node
CustomUnitary
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomUnitary: """Node for an OPENQASM custom gate statement. children[0] is an id node. children[1] is an exp_list (if len==3) or primary_list. children[2], if present, is a primary_list. Has properties: .id = id node .name = gate name string .arguments = None or exp_list node .bitlist = primary...
stack_v2_sparse_classes_36k_train_007897
1,663
permissive
[ { "docstring": "Create the custom gate node.", "name": "__init__", "signature": "def __init__(self, children)" }, { "docstring": "Return the corresponding OPENQASM string.", "name": "qasm", "signature": "def qasm(self, prec=15)" } ]
2
stack_v2_sparse_classes_30k_train_010655
Implement the Python class `CustomUnitary` described below. Class description: Node for an OPENQASM custom gate statement. children[0] is an id node. children[1] is an exp_list (if len==3) or primary_list. children[2], if present, is a primary_list. Has properties: .id = id node .name = gate name string .arguments = N...
Implement the Python class `CustomUnitary` described below. Class description: Node for an OPENQASM custom gate statement. children[0] is an id node. children[1] is an exp_list (if len==3) or primary_list. children[2], if present, is a primary_list. Has properties: .id = id node .name = gate name string .arguments = N...
abf6c23d4ab6c63f9c01c7434fb46321e6a69200
<|skeleton|> class CustomUnitary: """Node for an OPENQASM custom gate statement. children[0] is an id node. children[1] is an exp_list (if len==3) or primary_list. children[2], if present, is a primary_list. Has properties: .id = id node .name = gate name string .arguments = None or exp_list node .bitlist = primary...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomUnitary: """Node for an OPENQASM custom gate statement. children[0] is an id node. children[1] is an exp_list (if len==3) or primary_list. children[2], if present, is a primary_list. Has properties: .id = id node .name = gate name string .arguments = None or exp_list node .bitlist = primary_list node"""...
the_stack_v2_python_sparse
qiskit/qasm/node/customunitary.py
indian-institute-of-science-qc/qiskit-aakash
train
37
bd84700fa22473710204eab2fb0a9af8cadc356f
[ "assert isinstance(path_and_filename, str)\nassert width > 0 and height > 0\nassert output_format in [self.PNG, self.SVG, self.JPG, self.GIF]\nself.path_and_filename = path_and_filename\nself.plot_obj = plot_obj\nself.width = width\nself.height = height\nself.output_format = output_format", "header = '#!/usr/bin/...
<|body_start_0|> assert isinstance(path_and_filename, str) assert width > 0 and height > 0 assert output_format in [self.PNG, self.SVG, self.JPG, self.GIF] self.path_and_filename = path_and_filename self.plot_obj = plot_obj self.width = width self.height = height ...
The scripts represents a whole gnuplot script. The main intention is to define the format, the file and to run gnuplot to generate the image (like png).
script
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class script: """The scripts represents a whole gnuplot script. The main intention is to define the format, the file and to run gnuplot to generate the image (like png).""" def __init__(self, path_and_filename, plot_obj, width=640, height=480, output_format=PNG): """Init script and assert ...
stack_v2_sparse_classes_36k_train_007898
3,546
permissive
[ { "docstring": "Init script and assert parameters. :param path_and_filename: location to write script and where also to generate image. :param plot_obj: instance of a plot (or a multiplot) :param width: width of the final image (default 640) :param height: height of the final image (default 480) :param output_f...
3
stack_v2_sparse_classes_30k_train_003824
Implement the Python class `script` described below. Class description: The scripts represents a whole gnuplot script. The main intention is to define the format, the file and to run gnuplot to generate the image (like png). Method signatures and docstrings: - def __init__(self, path_and_filename, plot_obj, width=640...
Implement the Python class `script` described below. Class description: The scripts represents a whole gnuplot script. The main intention is to define the format, the file and to run gnuplot to generate the image (like png). Method signatures and docstrings: - def __init__(self, path_and_filename, plot_obj, width=640...
64e1f82de144f959cdf3c6dcf0f692bbc0ceb20f
<|skeleton|> class script: """The scripts represents a whole gnuplot script. The main intention is to define the format, the file and to run gnuplot to generate the image (like png).""" def __init__(self, path_and_filename, plot_obj, width=640, height=480, output_format=PNG): """Init script and assert ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class script: """The scripts represents a whole gnuplot script. The main intention is to define the format, the file and to run gnuplot to generate the image (like png).""" def __init__(self, path_and_filename, plot_obj, width=640, height=480, output_format=PNG): """Init script and assert parameters. :...
the_stack_v2_python_sparse
concept/graph/gnuplot/script.py
Nachtfeuer/concept-py
train
2
46cbd726862a2c1d26e2813f68439fa48c908e69
[ "self._config = config\nself._config_entry = config_entry\nself.device_id = device_id\nself.discovery_data = discovery_data\nself.hass = hass\nself._mqtt_data = get_mqtt_data(hass)\nMqttDiscoveryDeviceUpdate.__init__(self, hass, discovery_data, device_id, config_entry, LOG_NAME)", "discovery_hash = self.discovery...
<|body_start_0|> self._config = config self._config_entry = config_entry self.device_id = device_id self.discovery_data = discovery_data self.hass = hass self._mqtt_data = get_mqtt_data(hass) MqttDiscoveryDeviceUpdate.__init__(self, hass, discovery_data, device_id...
Setup a MQTT device trigger with auto discovery.
MqttDeviceTrigger
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MqttDeviceTrigger: """Setup a MQTT device trigger with auto discovery.""" def __init__(self, hass: HomeAssistant, config: ConfigType, device_id: str, discovery_data: DiscoveryInfoType, config_entry: ConfigEntry) -> None: """Initialize.""" <|body_0|> async def async_setup...
stack_v2_sparse_classes_36k_train_007899
11,475
permissive
[ { "docstring": "Initialize.", "name": "__init__", "signature": "def __init__(self, hass: HomeAssistant, config: ConfigType, device_id: str, discovery_data: DiscoveryInfoType, config_entry: ConfigEntry) -> None" }, { "docstring": "Initialize the device trigger.", "name": "async_setup", "s...
4
null
Implement the Python class `MqttDeviceTrigger` described below. Class description: Setup a MQTT device trigger with auto discovery. Method signatures and docstrings: - def __init__(self, hass: HomeAssistant, config: ConfigType, device_id: str, discovery_data: DiscoveryInfoType, config_entry: ConfigEntry) -> None: Ini...
Implement the Python class `MqttDeviceTrigger` described below. Class description: Setup a MQTT device trigger with auto discovery. Method signatures and docstrings: - def __init__(self, hass: HomeAssistant, config: ConfigType, device_id: str, discovery_data: DiscoveryInfoType, config_entry: ConfigEntry) -> None: Ini...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class MqttDeviceTrigger: """Setup a MQTT device trigger with auto discovery.""" def __init__(self, hass: HomeAssistant, config: ConfigType, device_id: str, discovery_data: DiscoveryInfoType, config_entry: ConfigEntry) -> None: """Initialize.""" <|body_0|> async def async_setup...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MqttDeviceTrigger: """Setup a MQTT device trigger with auto discovery.""" def __init__(self, hass: HomeAssistant, config: ConfigType, device_id: str, discovery_data: DiscoveryInfoType, config_entry: ConfigEntry) -> None: """Initialize.""" self._config = config self._config_entry =...
the_stack_v2_python_sparse
homeassistant/components/mqtt/device_trigger.py
home-assistant/core
train
35,501