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
2f579a128aabe9b70332277d9e93074cefff1569
[ "if self.machine in ['x86_64', 'AMD64', 'i686']:\n if self.architecture == '32bit':\n return 'i386'\n return 'amd64'\nelif self.machine == 'x86':\n return 'i386'\nreturn self.machine", "result = self.pep425tag\nif result:\n return result\nraise ValueError('PEP 425 Signature not set - this is li...
<|body_start_0|> if self.machine in ['x86_64', 'AMD64', 'i686']: if self.architecture == '32bit': return 'i386' return 'amd64' elif self.machine == 'x86': return 'i386' return self.machine <|end_body_0|> <|body_start_1|> result = self....
A protobuf to represent the current system.
Uname
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Uname: """A protobuf to represent the current system.""" def arch(self): """Return a more standard representation of the architecture.""" <|body_0|> def signature(self): """Returns a unique string that encapsulates the architecture.""" <|body_1|> def...
stack_v2_sparse_classes_36k_train_002600
21,106
permissive
[ { "docstring": "Return a more standard representation of the architecture.", "name": "arch", "signature": "def arch(self)" }, { "docstring": "Returns a unique string that encapsulates the architecture.", "name": "signature", "signature": "def signature(self)" }, { "docstring": "F...
3
null
Implement the Python class `Uname` described below. Class description: A protobuf to represent the current system. Method signatures and docstrings: - def arch(self): Return a more standard representation of the architecture. - def signature(self): Returns a unique string that encapsulates the architecture. - def Fro...
Implement the Python class `Uname` described below. Class description: A protobuf to represent the current system. Method signatures and docstrings: - def arch(self): Return a more standard representation of the architecture. - def signature(self): Returns a unique string that encapsulates the architecture. - def Fro...
44c0eb8c938302098ef7efae8cfd6b90bcfbb2d6
<|skeleton|> class Uname: """A protobuf to represent the current system.""" def arch(self): """Return a more standard representation of the architecture.""" <|body_0|> def signature(self): """Returns a unique string that encapsulates the architecture.""" <|body_1|> def...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Uname: """A protobuf to represent the current system.""" def arch(self): """Return a more standard representation of the architecture.""" if self.machine in ['x86_64', 'AMD64', 'i686']: if self.architecture == '32bit': return 'i386' return 'amd64' ...
the_stack_v2_python_sparse
grr/core/grr_response_core/lib/rdfvalues/client.py
google/grr
train
4,683
00208201d290bf3ba95bb8f0797e723620c166e0
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn AttackSimulationSimulationUserCoverage()", "from .attack_simulation_user import AttackSimulationUser\nfrom .attack_simulation_user import AttackSimulationUser\nfields: Dict[str, Callable[[Any], None]] = {'attackSimulationUser': lambda ...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return AttackSimulationSimulationUserCoverage() <|end_body_0|> <|body_start_1|> from .attack_simulation_user import AttackSimulationUser from .attack_simulation_user import AttackSimulationUser...
AttackSimulationSimulationUserCoverage
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AttackSimulationSimulationUserCoverage: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AttackSimulationSimulationUserCoverage: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the...
stack_v2_sparse_classes_36k_train_002601
4,198
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: AttackSimulationSimulationUserCoverage", "name": "create_from_discriminator_value", "signature": "def create...
3
stack_v2_sparse_classes_30k_train_020824
Implement the Python class `AttackSimulationSimulationUserCoverage` described below. Class description: Implement the AttackSimulationSimulationUserCoverage class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AttackSimulationSimulationUserCoverage: C...
Implement the Python class `AttackSimulationSimulationUserCoverage` described below. Class description: Implement the AttackSimulationSimulationUserCoverage class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AttackSimulationSimulationUserCoverage: C...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class AttackSimulationSimulationUserCoverage: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AttackSimulationSimulationUserCoverage: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AttackSimulationSimulationUserCoverage: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> AttackSimulationSimulationUserCoverage: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator...
the_stack_v2_python_sparse
msgraph/generated/models/attack_simulation_simulation_user_coverage.py
microsoftgraph/msgraph-sdk-python
train
135
e5077a26d041cc9bbed47296fc66fa74cea5ead3
[ "input_size = common.tuplify2d(input_size)\nsuper().__init__(input_tensor_spec=TensorSpec((input_channels,) + input_size), name=name)\nassert isinstance(conv_layer_params, tuple)\nassert len(conv_layer_params) > 0\nif kernel_initializer is None:\n kernel_initializer = functools.partial(variance_scaling_init, mod...
<|body_start_0|> input_size = common.tuplify2d(input_size) super().__init__(input_tensor_spec=TensorSpec((input_channels,) + input_size), name=name) assert isinstance(conv_layer_params, tuple) assert len(conv_layer_params) > 0 if kernel_initializer is None: kernel_ini...
ParamConvNet
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ParamConvNet: def __init__(self, input_channels, input_size, conv_layer_params, same_padding=False, activation=torch.relu_, use_bias=False, use_ln=False, n_groups=None, kernel_initializer=None, flatten_output=False, name='ParamConvNet'): """A fully 2D conv network that does not maintain ...
stack_v2_sparse_classes_36k_train_002602
14,523
permissive
[ { "docstring": "A fully 2D conv network that does not maintain its own network parameters, but accepts them from users. If the given parameter tensor has an extra batch dimension (first dimension), it performs parallel operations. Args: input_channels (int): number of channels in the input image input_size (int...
4
stack_v2_sparse_classes_30k_train_018502
Implement the Python class `ParamConvNet` described below. Class description: Implement the ParamConvNet class. Method signatures and docstrings: - def __init__(self, input_channels, input_size, conv_layer_params, same_padding=False, activation=torch.relu_, use_bias=False, use_ln=False, n_groups=None, kernel_initiali...
Implement the Python class `ParamConvNet` described below. Class description: Implement the ParamConvNet class. Method signatures and docstrings: - def __init__(self, input_channels, input_size, conv_layer_params, same_padding=False, activation=torch.relu_, use_bias=False, use_ln=False, n_groups=None, kernel_initiali...
b00ff2fa5e660de31020338ba340263183fbeaa4
<|skeleton|> class ParamConvNet: def __init__(self, input_channels, input_size, conv_layer_params, same_padding=False, activation=torch.relu_, use_bias=False, use_ln=False, n_groups=None, kernel_initializer=None, flatten_output=False, name='ParamConvNet'): """A fully 2D conv network that does not maintain ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ParamConvNet: def __init__(self, input_channels, input_size, conv_layer_params, same_padding=False, activation=torch.relu_, use_bias=False, use_ln=False, n_groups=None, kernel_initializer=None, flatten_output=False, name='ParamConvNet'): """A fully 2D conv network that does not maintain its own networ...
the_stack_v2_python_sparse
alf/networks/param_networks.py
HorizonRobotics/alf
train
288
db61ba8bb68ca237bade264cca61074760db525a
[ "integral_strategy_settings = member_models.IntegralStrategySettings.select().dj_where(webapp_id=self.corp.webapp_id).first()\nif not integral_strategy_settings:\n return MallConfigFactory.get(self.corp).create_default_integral_strategy()\nelse:\n return IntegralStrategy(integral_strategy_settings)", "mall_...
<|body_start_0|> integral_strategy_settings = member_models.IntegralStrategySettings.select().dj_where(webapp_id=self.corp.webapp_id).first() if not integral_strategy_settings: return MallConfigFactory.get(self.corp).create_default_integral_strategy() else: return Integra...
MallConfigRepository
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MallConfigRepository: def get_integral_strategy(self): """获得积分策略""" <|body_0|> def get_webapp_config(self): """获得WebappConfig对象""" <|body_1|> <|end_skeleton|> <|body_start_0|> integral_strategy_settings = member_models.IntegralStrategySettings.selec...
stack_v2_sparse_classes_36k_train_002603
1,596
no_license
[ { "docstring": "获得积分策略", "name": "get_integral_strategy", "signature": "def get_integral_strategy(self)" }, { "docstring": "获得WebappConfig对象", "name": "get_webapp_config", "signature": "def get_webapp_config(self)" } ]
2
null
Implement the Python class `MallConfigRepository` described below. Class description: Implement the MallConfigRepository class. Method signatures and docstrings: - def get_integral_strategy(self): 获得积分策略 - def get_webapp_config(self): 获得WebappConfig对象
Implement the Python class `MallConfigRepository` described below. Class description: Implement the MallConfigRepository class. Method signatures and docstrings: - def get_integral_strategy(self): 获得积分策略 - def get_webapp_config(self): 获得WebappConfig对象 <|skeleton|> class MallConfigRepository: def get_integral_st...
39860a451678ab50ad93ce8ebe2ef8490af65d62
<|skeleton|> class MallConfigRepository: def get_integral_strategy(self): """获得积分策略""" <|body_0|> def get_webapp_config(self): """获得WebappConfig对象""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MallConfigRepository: def get_integral_strategy(self): """获得积分策略""" integral_strategy_settings = member_models.IntegralStrategySettings.select().dj_where(webapp_id=self.corp.webapp_id).first() if not integral_strategy_settings: return MallConfigFactory.get(self.corp).create...
the_stack_v2_python_sparse
business/mall/config/mall_config_repository.py
chengdg/gaia
train
0
70f0d18e3441844b004032ffdd09af7e1781e974
[ "startTime = datetime.datetime.now()\nclient = dml.pymongo.MongoClient()\nrepo = client.repo\nrepo.authenticate('ckarjadi_johnnyg7', 'ckarjadi_johnnyg7')\ncommGarden = get_Col('commGardens', repo)\nfoodEstabl = get_Col('foodEstabl', repo)\nmaster = count_city(commGarden, 'area')\ncount_gardens = master[0]\ncount_ci...
<|body_start_0|> startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('ckarjadi_johnnyg7', 'ckarjadi_johnnyg7') commGarden = get_Col('commGardens', repo) foodEstabl = get_Col('foodEstabl', repo) master = count...
same_city
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class same_city: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everything hap...
stack_v2_sparse_classes_36k_train_002604
3,674
no_license
[ { "docstring": "Retrieve some data sets (not using the API here for the sake of simplicity).", "name": "execute", "signature": "def execute(trial=False)" }, { "docstring": "Create the provenance document describing everything happening in this script. Each run of the script will generate a new d...
2
null
Implement the Python class `same_city` described below. Class description: Implement the same_city class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=N...
Implement the Python class `same_city` described below. Class description: Implement the same_city class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=N...
9cb0ad789b6ff265222cbd3ea3561ff553b4cdff
<|skeleton|> class same_city: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everything hap...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class same_city: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('ckarjadi_johnnyg7', 'ckarjadi_johnnyg7') ...
the_stack_v2_python_sparse
ckarjadi_johnnyg7/same_city.py
yinghang/course-2016-fal-proj
train
1
457b1fe40503ebce32700436ac7fccb691749bc1
[ "with SftpClient(**config) as writer:\n for configured_stream in configured_catalog.streams:\n if configured_stream.destination_sync_mode == DestinationSyncMode.overwrite:\n writer.delete(configured_stream.stream.name)\n for message in input_messages:\n if message.type == Type.STATE:\...
<|body_start_0|> with SftpClient(**config) as writer: for configured_stream in configured_catalog.streams: if configured_stream.destination_sync_mode == DestinationSyncMode.overwrite: writer.delete(configured_stream.stream.name) for message in input_me...
DestinationSftpJson
[ "MIT", "Apache-2.0", "BSD-3-Clause", "Elastic-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DestinationSftpJson: def write(self, config: Mapping[str, Any], configured_catalog: ConfiguredAirbyteCatalog, input_messages: Iterable[AirbyteMessage]) -> Iterable[AirbyteMessage]: """Reads the input stream of messages, config, and catalog to write data to the destination. This method re...
stack_v2_sparse_classes_36k_train_002605
4,144
permissive
[ { "docstring": "Reads the input stream of messages, config, and catalog to write data to the destination. This method returns an iterable (typically a generator of AirbyteMessages via yield) containing state messages received in the input message stream. Outputting a state message means that every AirbyteRecord...
2
null
Implement the Python class `DestinationSftpJson` described below. Class description: Implement the DestinationSftpJson class. Method signatures and docstrings: - def write(self, config: Mapping[str, Any], configured_catalog: ConfiguredAirbyteCatalog, input_messages: Iterable[AirbyteMessage]) -> Iterable[AirbyteMessag...
Implement the Python class `DestinationSftpJson` described below. Class description: Implement the DestinationSftpJson class. Method signatures and docstrings: - def write(self, config: Mapping[str, Any], configured_catalog: ConfiguredAirbyteCatalog, input_messages: Iterable[AirbyteMessage]) -> Iterable[AirbyteMessag...
8d5f9a2d49ab8f9e85ccf058cb02c2fda287afc6
<|skeleton|> class DestinationSftpJson: def write(self, config: Mapping[str, Any], configured_catalog: ConfiguredAirbyteCatalog, input_messages: Iterable[AirbyteMessage]) -> Iterable[AirbyteMessage]: """Reads the input stream of messages, config, and catalog to write data to the destination. This method re...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DestinationSftpJson: def write(self, config: Mapping[str, Any], configured_catalog: ConfiguredAirbyteCatalog, input_messages: Iterable[AirbyteMessage]) -> Iterable[AirbyteMessage]: """Reads the input stream of messages, config, and catalog to write data to the destination. This method returns an itera...
the_stack_v2_python_sparse
dts/airbyte/airbyte-integrations/connectors/destination-sftp-json/destination_sftp_json/destination.py
alldatacenter/alldata
train
774
3b58def95598cd286c1400c798349ae3b4ea1114
[ "super().__init__(*args, **kwargs)\n'Build layer.'\nself.theta_0 = self.add_weight(name='theta_0', shape=(1,), initializer=Constant(0.0), trainable=True, regularizer=self.regularizer)\ntheta_lc_shape = (1, self.L, self.C)\ntheta_lc_init = np.random.randn(*theta_lc_shape) / np.sqrt(self.L)\nself.theta_lc = self.add_...
<|body_start_0|> super().__init__(*args, **kwargs) 'Build layer.' self.theta_0 = self.add_weight(name='theta_0', shape=(1,), initializer=Constant(0.0), trainable=True, regularizer=self.regularizer) theta_lc_shape = (1, self.L, self.C) theta_lc_init = np.random.randn(*theta_lc_sha...
Represents an additive G-P map.
AdditiveGPMapLayer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdditiveGPMapLayer: """Represents an additive G-P map.""" def __init__(self, *args, **kwargs): """Construct layer instance.""" <|body_0|> def call(self, x_lc): """Process layer input and return output.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_002606
14,529
permissive
[ { "docstring": "Construct layer instance.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Process layer input and return output.", "name": "call", "signature": "def call(self, x_lc)" } ]
2
stack_v2_sparse_classes_30k_val_000595
Implement the Python class `AdditiveGPMapLayer` described below. Class description: Represents an additive G-P map. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Construct layer instance. - def call(self, x_lc): Process layer input and return output.
Implement the Python class `AdditiveGPMapLayer` described below. Class description: Represents an additive G-P map. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Construct layer instance. - def call(self, x_lc): Process layer input and return output. <|skeleton|> class AdditiveGPMapLayer: ...
f83f6e94d3d6ceeb7f19401d369da1908cfac31d
<|skeleton|> class AdditiveGPMapLayer: """Represents an additive G-P map.""" def __init__(self, *args, **kwargs): """Construct layer instance.""" <|body_0|> def call(self, x_lc): """Process layer input and return output.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AdditiveGPMapLayer: """Represents an additive G-P map.""" def __init__(self, *args, **kwargs): """Construct layer instance.""" super().__init__(*args, **kwargs) 'Build layer.' self.theta_0 = self.add_weight(name='theta_0', shape=(1,), initializer=Constant(0.0), trainable=T...
the_stack_v2_python_sparse
mavenn/src/layers/gpmap.py
jbkinney/mavenn
train
21
0bda9f6572a872c51895eb44ebea3c386176da9a
[ "self.analytical_params = analytical_params\nself.geographical_params = geogr_params\nself.deformational_params = deform_params\nself.anal_param_values = self.get_analytical_param_values()\narray_range, array_size, formula = self.anal_param_values\na_min, a_max, b_min, b_max = array_range\na_range, b_range = (a_max...
<|body_start_0|> self.analytical_params = analytical_params self.geographical_params = geogr_params self.deformational_params = deform_params self.anal_param_values = self.get_analytical_param_values() array_range, array_size, formula = self.anal_param_values a_min, a_max...
AnalyticGeosurface
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AnalyticGeosurface: def __init__(self, analytical_params, geogr_params, deform_params): """:param analytical_params: :param geogr_params: :param deform_params:""" <|body_0|> def geosurface_center(self): """:return:""" <|body_1|> def geosurface_XYZ(self):...
stack_v2_sparse_classes_36k_train_002607
18,232
no_license
[ { "docstring": ":param analytical_params: :param geogr_params: :param deform_params:", "name": "__init__", "signature": "def __init__(self, analytical_params, geogr_params, deform_params)" }, { "docstring": ":return:", "name": "geosurface_center", "signature": "def geosurface_center(self...
6
stack_v2_sparse_classes_30k_train_000275
Implement the Python class `AnalyticGeosurface` described below. Class description: Implement the AnalyticGeosurface class. Method signatures and docstrings: - def __init__(self, analytical_params, geogr_params, deform_params): :param analytical_params: :param geogr_params: :param deform_params: - def geosurface_cent...
Implement the Python class `AnalyticGeosurface` described below. Class description: Implement the AnalyticGeosurface class. Method signatures and docstrings: - def __init__(self, analytical_params, geogr_params, deform_params): :param analytical_params: :param geogr_params: :param deform_params: - def geosurface_cent...
b07ab23400b4ff4151555c2e81392a7adf99fc33
<|skeleton|> class AnalyticGeosurface: def __init__(self, analytical_params, geogr_params, deform_params): """:param analytical_params: :param geogr_params: :param deform_params:""" <|body_0|> def geosurface_center(self): """:return:""" <|body_1|> def geosurface_XYZ(self):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AnalyticGeosurface: def __init__(self, analytical_params, geogr_params, deform_params): """:param analytical_params: :param geogr_params: :param deform_params:""" self.analytical_params = analytical_params self.geographical_params = geogr_params self.deformational_params = defo...
the_stack_v2_python_sparse
pygsf/spatial/vectorial/meshes.py
mauroalberti/qgSurf
train
5
cb5ac25b2b79196487cab106cc37255980f58030
[ "super().__init__(config)\nself.constraints = config.get('constraints')\nif not isinstance(self.constraints, dict):\n raise RuntimeError('constraints should be a dict')\nself.qcs_config: QCSClientConfiguration = QCSClientConfiguration.load(profile_name=config.get('qcs_profile_name'), secrets_file_path=config.get...
<|body_start_0|> super().__init__(config) self.constraints = config.get('constraints') if not isinstance(self.constraints, dict): raise RuntimeError('constraints should be a dict') self.qcs_config: QCSClientConfiguration = QCSClientConfiguration.load(profile_name=config.get('...
Billing costs for the Rigetti systems
RigettiBillingInfo
[ "BSD-3-Clause", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RigettiBillingInfo: """Billing costs for the Rigetti systems""" def __init__(self, config): """Read in our toml files and build a client we can use""" <|body_0|> def acquire(self): """Method to be called from Task Manager. redefines acquire from Source.py. Acquir...
stack_v2_sparse_classes_36k_train_002608
3,608
permissive
[ { "docstring": "Read in our toml files and build a client we can use", "name": "__init__", "signature": "def __init__(self, config)" }, { "docstring": "Method to be called from Task Manager. redefines acquire from Source.py. Acquire Regetti costs and return as pandas frame Returns: dict: A dicti...
2
null
Implement the Python class `RigettiBillingInfo` described below. Class description: Billing costs for the Rigetti systems Method signatures and docstrings: - def __init__(self, config): Read in our toml files and build a client we can use - def acquire(self): Method to be called from Task Manager. redefines acquire f...
Implement the Python class `RigettiBillingInfo` described below. Class description: Billing costs for the Rigetti systems Method signatures and docstrings: - def __init__(self, config): Read in our toml files and build a client we can use - def acquire(self): Method to be called from Task Manager. redefines acquire f...
842fdc91a31879084906d71a7d0c317e5035a925
<|skeleton|> class RigettiBillingInfo: """Billing costs for the Rigetti systems""" def __init__(self, config): """Read in our toml files and build a client we can use""" <|body_0|> def acquire(self): """Method to be called from Task Manager. redefines acquire from Source.py. Acquir...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RigettiBillingInfo: """Billing costs for the Rigetti systems""" def __init__(self, config): """Read in our toml files and build a client we can use""" super().__init__(config) self.constraints = config.get('constraints') if not isinstance(self.constraints, dict): ...
the_stack_v2_python_sparse
src/decisionengine_modules/Rigetti/sources/Rigetti_BillingInfo.py
HEPCloud/decisionengine_modules
train
2
14935c8951193de3b8718182b8456168e31f57b4
[ "self.smaller, self.bigger = ([], [])\nheapify(self.smaller)\nheapify(self.bigger)", "heappush(self.bigger, num)\nheappush(self.smaller, -heappop(self.bigger))\nwhile len(self.smaller) > len(self.bigger):\n heappush(self.bigger, -heappop(self.smaller))", "if len(self.smaller) == len(self.bigger):\n return...
<|body_start_0|> self.smaller, self.bigger = ([], []) heapify(self.smaller) heapify(self.bigger) <|end_body_0|> <|body_start_1|> heappush(self.bigger, num) heappush(self.smaller, -heappop(self.bigger)) while len(self.smaller) > len(self.bigger): heappush(self...
MedianFinder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MedianFinder: def __init__(self): """initialize your data structure here.""" <|body_0|> def addNum(self, num): """:type num: int :rtype: None""" <|body_1|> def findMedian(self): """:rtype: float""" <|body_2|> <|end_skeleton|> <|body_sta...
stack_v2_sparse_classes_36k_train_002609
1,169
no_license
[ { "docstring": "initialize your data structure here.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": ":type num: int :rtype: None", "name": "addNum", "signature": "def addNum(self, num)" }, { "docstring": ":rtype: float", "name": "findMedian", "s...
3
stack_v2_sparse_classes_30k_train_000224
Implement the Python class `MedianFinder` described below. Class description: Implement the MedianFinder class. Method signatures and docstrings: - def __init__(self): initialize your data structure here. - def addNum(self, num): :type num: int :rtype: None - def findMedian(self): :rtype: float
Implement the Python class `MedianFinder` described below. Class description: Implement the MedianFinder class. Method signatures and docstrings: - def __init__(self): initialize your data structure here. - def addNum(self, num): :type num: int :rtype: None - def findMedian(self): :rtype: float <|skeleton|> class Me...
76d767ec001649b2df07aac211ac4b43b415ebdd
<|skeleton|> class MedianFinder: def __init__(self): """initialize your data structure here.""" <|body_0|> def addNum(self, num): """:type num: int :rtype: None""" <|body_1|> def findMedian(self): """:rtype: float""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MedianFinder: def __init__(self): """initialize your data structure here.""" self.smaller, self.bigger = ([], []) heapify(self.smaller) heapify(self.bigger) def addNum(self, num): """:type num: int :rtype: None""" heappush(self.bigger, num) heappush...
the_stack_v2_python_sparse
leetcode295 Find Median from Data Stream.py
whglamrock/leetcode_series
train
2
624b25c664ee2cddfab8f45f13247f6f4b39ea9f
[ "if index_uuid in SKIP_IN_PATH:\n raise ValueError(\"Empty value passed for parameter 'index_uuid'\")\nif accept_data_loss is None:\n raise ValueError(\"Empty value passed for parameter 'accept_data_loss'\")\n__path = f'/_dangling/{_quote(index_uuid)}'\n__query: t.Dict[str, t.Any] = {}\nif accept_data_loss is...
<|body_start_0|> if index_uuid in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index_uuid'") if accept_data_loss is None: raise ValueError("Empty value passed for parameter 'accept_data_loss'") __path = f'/_dangling/{_quote(index_uuid)}' __que...
DanglingIndicesClient
[ "Apache-2.0", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DanglingIndicesClient: def delete_dangling_index(self, *, index_uuid: str, accept_data_loss: bool, error_trace: t.Optional[bool]=None, filter_path: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]]=None, human: t.Optional[bool]=None, master_timeout: t.Optional[t.Union['t.Literal[...
stack_v2_sparse_classes_36k_train_002610
6,469
permissive
[ { "docstring": "Deletes the specified dangling index `<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html>`_ :param index_uuid: The UUID of the dangling index :param accept_data_loss: Must be set to true in order to delete the dangling index :param master_timeou...
3
stack_v2_sparse_classes_30k_train_012939
Implement the Python class `DanglingIndicesClient` described below. Class description: Implement the DanglingIndicesClient class. Method signatures and docstrings: - def delete_dangling_index(self, *, index_uuid: str, accept_data_loss: bool, error_trace: t.Optional[bool]=None, filter_path: t.Optional[t.Union[str, t.U...
Implement the Python class `DanglingIndicesClient` described below. Class description: Implement the DanglingIndicesClient class. Method signatures and docstrings: - def delete_dangling_index(self, *, index_uuid: str, accept_data_loss: bool, error_trace: t.Optional[bool]=None, filter_path: t.Optional[t.Union[str, t.U...
915bbd784831ccb84e1559af0f829736652d2e78
<|skeleton|> class DanglingIndicesClient: def delete_dangling_index(self, *, index_uuid: str, accept_data_loss: bool, error_trace: t.Optional[bool]=None, filter_path: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]]=None, human: t.Optional[bool]=None, master_timeout: t.Optional[t.Union['t.Literal[...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DanglingIndicesClient: def delete_dangling_index(self, *, index_uuid: str, accept_data_loss: bool, error_trace: t.Optional[bool]=None, filter_path: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]]=None, human: t.Optional[bool]=None, master_timeout: t.Optional[t.Union['t.Literal[-1]', 't.Liter...
the_stack_v2_python_sparse
elasticsearch/_sync/client/dangling_indices.py
elastic/elasticsearch-py
train
3,845
add483eab35ac4ad2938837fe89e066f11ac77ff
[ "super().__init__(coordinator=coordinator)\nself._sensor_key = sensor_key\nself._service_key = service_key\nself.entity_id = f'{SENSOR_DOMAIN}.{service_key}_{sensor_key}'\nself._attr_device_class = sensor.get(ATTR_DEVICE_CLASS)\nself._attr_entity_registry_enabled_default = sensor.get(ATTR_ENABLED_BY_DEFAULT, True)\...
<|body_start_0|> super().__init__(coordinator=coordinator) self._sensor_key = sensor_key self._service_key = service_key self.entity_id = f'{SENSOR_DOMAIN}.{service_key}_{sensor_key}' self._attr_device_class = sensor.get(ATTR_DEVICE_CLASS) self._attr_entity_registry_enabl...
Defines an Ambee sensor.
AmbeeSensorEntity
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AmbeeSensorEntity: """Defines an Ambee sensor.""" def __init__(self, *, coordinator: DataUpdateCoordinator, entry_id: str, sensor_key: str, sensor: AmbeeSensor, service_key: str, service: str) -> None: """Initialize Ambee sensor.""" <|body_0|> def state(self) -> StateTyp...
stack_v2_sparse_classes_36k_train_002611
3,042
permissive
[ { "docstring": "Initialize Ambee sensor.", "name": "__init__", "signature": "def __init__(self, *, coordinator: DataUpdateCoordinator, entry_id: str, sensor_key: str, sensor: AmbeeSensor, service_key: str, service: str) -> None" }, { "docstring": "Return the state of the sensor.", "name": "s...
2
null
Implement the Python class `AmbeeSensorEntity` described below. Class description: Defines an Ambee sensor. Method signatures and docstrings: - def __init__(self, *, coordinator: DataUpdateCoordinator, entry_id: str, sensor_key: str, sensor: AmbeeSensor, service_key: str, service: str) -> None: Initialize Ambee senso...
Implement the Python class `AmbeeSensorEntity` described below. Class description: Defines an Ambee sensor. Method signatures and docstrings: - def __init__(self, *, coordinator: DataUpdateCoordinator, entry_id: str, sensor_key: str, sensor: AmbeeSensor, service_key: str, service: str) -> None: Initialize Ambee senso...
2fee32fce03bc49e86cf2e7b741a15621a97cce5
<|skeleton|> class AmbeeSensorEntity: """Defines an Ambee sensor.""" def __init__(self, *, coordinator: DataUpdateCoordinator, entry_id: str, sensor_key: str, sensor: AmbeeSensor, service_key: str, service: str) -> None: """Initialize Ambee sensor.""" <|body_0|> def state(self) -> StateTyp...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AmbeeSensorEntity: """Defines an Ambee sensor.""" def __init__(self, *, coordinator: DataUpdateCoordinator, entry_id: str, sensor_key: str, sensor: AmbeeSensor, service_key: str, service: str) -> None: """Initialize Ambee sensor.""" super().__init__(coordinator=coordinator) self._...
the_stack_v2_python_sparse
homeassistant/components/ambee/sensor.py
BenWoodford/home-assistant
train
11
b92fa70a8837a069fb303ff5c1e6e3011aa91780
[ "red = white = blue = 0\nfor num in nums:\n if num == 0:\n red += 1\n elif num == 1:\n white += 1\n else:\n blue += 1\nfor i in range(len(nums)):\n if red:\n red -= 1\n nums[i] = 0\n elif white:\n white -= 1\n nums[i] = 1\n elif blue:\n blue ...
<|body_start_0|> red = white = blue = 0 for num in nums: if num == 0: red += 1 elif num == 1: white += 1 else: blue += 1 for i in range(len(nums)): if red: red -= 1 num...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def _sortColors(self, nums): """:type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead.""" <|body_0|> def sortColors(self, nums): """:type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead."""...
stack_v2_sparse_classes_36k_train_002612
2,792
permissive
[ { "docstring": ":type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead.", "name": "_sortColors", "signature": "def _sortColors(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead.", "name": "...
2
stack_v2_sparse_classes_30k_train_016313
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _sortColors(self, nums): :type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead. - def sortColors(self, nums): :type nums: List[int] :rtype: ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _sortColors(self, nums): :type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead. - def sortColors(self, nums): :type nums: List[int] :rtype: ...
0dd67edca4e0b0323cb5a7239f02ea46383cd15a
<|skeleton|> class Solution: def _sortColors(self, nums): """:type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead.""" <|body_0|> def sortColors(self, nums): """:type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead."""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def _sortColors(self, nums): """:type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead.""" red = white = blue = 0 for num in nums: if num == 0: red += 1 elif num == 1: white += 1 ...
the_stack_v2_python_sparse
75.sort-colors.py
windard/leeeeee
train
0
0dbe5d508dfc4613ef8dd5352c6f2801ce135631
[ "conn, cursor = get_db_cursor()\nbuild = 'toy_build'\ndatabase = 'scratch/toy.db'\ntalon.get_counters(database)\nedge_dict = init_refs.make_edge_dict(cursor)\nlocation_dict = init_refs.make_location_dict(build, cursor)\nrun_info = talon.init_run_info(database, build)\ntranscript_dict = init_refs.make_transcript_dic...
<|body_start_0|> conn, cursor = get_db_cursor() build = 'toy_build' database = 'scratch/toy.db' talon.get_counters(database) edge_dict = init_refs.make_edge_dict(cursor) location_dict = init_refs.make_location_dict(build, cursor) run_info = talon.init_run_info(dat...
TestIdentifyRemaining
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestIdentifyRemaining: def test_intergenic(self): """Example where the transcript is an NIC match to an existing one by virtue of a new splice donor.""" <|body_0|> def test_antisense(self): """Example where the transcript is antisense but contains no known splice ver...
stack_v2_sparse_classes_36k_train_002613
6,699
permissive
[ { "docstring": "Example where the transcript is an NIC match to an existing one by virtue of a new splice donor.", "name": "test_intergenic", "signature": "def test_intergenic(self)" }, { "docstring": "Example where the transcript is antisense but contains no known splice vertices", "name": ...
3
stack_v2_sparse_classes_30k_train_000715
Implement the Python class `TestIdentifyRemaining` described below. Class description: Implement the TestIdentifyRemaining class. Method signatures and docstrings: - def test_intergenic(self): Example where the transcript is an NIC match to an existing one by virtue of a new splice donor. - def test_antisense(self): ...
Implement the Python class `TestIdentifyRemaining` described below. Class description: Implement the TestIdentifyRemaining class. Method signatures and docstrings: - def test_intergenic(self): Example where the transcript is an NIC match to an existing one by virtue of a new splice donor. - def test_antisense(self): ...
8014faed5f982e5e106ec05239e47d65878e76c3
<|skeleton|> class TestIdentifyRemaining: def test_intergenic(self): """Example where the transcript is an NIC match to an existing one by virtue of a new splice donor.""" <|body_0|> def test_antisense(self): """Example where the transcript is antisense but contains no known splice ver...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestIdentifyRemaining: def test_intergenic(self): """Example where the transcript is an NIC match to an existing one by virtue of a new splice donor.""" conn, cursor = get_db_cursor() build = 'toy_build' database = 'scratch/toy.db' talon.get_counters(database) e...
the_stack_v2_python_sparse
testing_suite/test_process_remaining_mult_cases.py
kopardev/TALON
train
0
47b0cdc517c1632cbee89a7b25476eb381d3c579
[ "super(mesh_to_mesh_1d_periodic, self).__init__(fine_level, coarse_level, params)\nfine_grid = np.array([i * fine_level.prob.dx for i in range(fine_level.prob.nvars)])\ncoarse_grid = np.array([i * coarse_level.prob.dx for i in range(coarse_level.prob.nvars)])\nif self.init_c == self.init_f:\n self.Rspace = np.ey...
<|body_start_0|> super(mesh_to_mesh_1d_periodic, self).__init__(fine_level, coarse_level, params) fine_grid = np.array([i * fine_level.prob.dx for i in range(fine_level.prob.nvars)]) coarse_grid = np.array([i * coarse_level.prob.dx for i in range(coarse_level.prob.nvars)]) if self.init_c...
Custon transfer class, implements Transfer.py This implementation can restrict and prolong between 1d meshes via matrix-vector products Attributes: fine: reference to the fine level coarse: reference to the coarse level init_f: number of variables on the fine level (whatever init represents there) init_c: number of var...
mesh_to_mesh_1d_periodic
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class mesh_to_mesh_1d_periodic: """Custon transfer class, implements Transfer.py This implementation can restrict and prolong between 1d meshes via matrix-vector products Attributes: fine: reference to the fine level coarse: reference to the coarse level init_f: number of variables on the fine level (w...
stack_v2_sparse_classes_36k_train_002614
3,644
permissive
[ { "docstring": "Initialization routine Args: fine_level: fine level connected with the transfer operations (passed to parent) coarse_level: coarse level connected with the transfer operations (passed to parent) params: parameters for the transfer operators", "name": "__init__", "signature": "def __init_...
3
null
Implement the Python class `mesh_to_mesh_1d_periodic` described below. Class description: Custon transfer class, implements Transfer.py This implementation can restrict and prolong between 1d meshes via matrix-vector products Attributes: fine: reference to the fine level coarse: reference to the coarse level init_f: n...
Implement the Python class `mesh_to_mesh_1d_periodic` described below. Class description: Custon transfer class, implements Transfer.py This implementation can restrict and prolong between 1d meshes via matrix-vector products Attributes: fine: reference to the fine level coarse: reference to the coarse level init_f: n...
1a51834bedffd4472e344bed28f4d766614b1537
<|skeleton|> class mesh_to_mesh_1d_periodic: """Custon transfer class, implements Transfer.py This implementation can restrict and prolong between 1d meshes via matrix-vector products Attributes: fine: reference to the fine level coarse: reference to the coarse level init_f: number of variables on the fine level (w...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class mesh_to_mesh_1d_periodic: """Custon transfer class, implements Transfer.py This implementation can restrict and prolong between 1d meshes via matrix-vector products Attributes: fine: reference to the fine level coarse: reference to the coarse level init_f: number of variables on the fine level (whatever init ...
the_stack_v2_python_sparse
pySDC/playgrounds/deprecated/advection_1d_implicit/TransferClass.py
Parallel-in-Time/pySDC
train
30
f6ef462086bcc8079410619ca20a62f022e5683c
[ "print('load Pre_process')\ndata = pd.concat([pd.read_csv(config.train_data_path, sep='\\t'), pd.read_csv(config.dev_data_path, sep='\\t'), pd.read_csv(config.test_data_path, sep='\\t')])\nprint('读取数据集完成')\ndata['text'] = data['title'] + data['desc']\ndata['text'] = data['text'].apply(query_cut)\ndata['text'] = dat...
<|body_start_0|> print('load Pre_process') data = pd.concat([pd.read_csv(config.train_data_path, sep='\t'), pd.read_csv(config.dev_data_path, sep='\t'), pd.read_csv(config.test_data_path, sep='\t')]) print('读取数据集完成') data['text'] = data['title'] + data['desc'] data['text'] = data...
Build_Corpus
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Build_Corpus: def load_data(self): """函数说明:该函数用于加载数据集 return: -data: 表示所有数据拼接的原始数据 -data_text: 表示数据集中的特征数据集 -datatext: 表示经过分词之后的特征数据集 -stopWords: 表示读取的停用词""" <|body_0|> def write_csv(self, datatext, stopWords): """将三个数据文件的 text 合并起来到一个文件,并且去除停用词 :param datatext: 三个数据...
stack_v2_sparse_classes_36k_train_002615
4,601
no_license
[ { "docstring": "函数说明:该函数用于加载数据集 return: -data: 表示所有数据拼接的原始数据 -data_text: 表示数据集中的特征数据集 -datatext: 表示经过分词之后的特征数据集 -stopWords: 表示读取的停用词", "name": "load_data", "signature": "def load_data(self)" }, { "docstring": "将三个数据文件的 text 合并起来到一个文件,并且去除停用词 :param datatext: 三个数据文件合并后的list,没有去除停用词 :param stopWor...
3
stack_v2_sparse_classes_30k_train_009546
Implement the Python class `Build_Corpus` described below. Class description: Implement the Build_Corpus class. Method signatures and docstrings: - def load_data(self): 函数说明:该函数用于加载数据集 return: -data: 表示所有数据拼接的原始数据 -data_text: 表示数据集中的特征数据集 -datatext: 表示经过分词之后的特征数据集 -stopWords: 表示读取的停用词 - def write_csv(self, datatext, ...
Implement the Python class `Build_Corpus` described below. Class description: Implement the Build_Corpus class. Method signatures and docstrings: - def load_data(self): 函数说明:该函数用于加载数据集 return: -data: 表示所有数据拼接的原始数据 -data_text: 表示数据集中的特征数据集 -datatext: 表示经过分词之后的特征数据集 -stopWords: 表示读取的停用词 - def write_csv(self, datatext, ...
d9d3848f2075350141d7736c7d53126daa0e1751
<|skeleton|> class Build_Corpus: def load_data(self): """函数说明:该函数用于加载数据集 return: -data: 表示所有数据拼接的原始数据 -data_text: 表示数据集中的特征数据集 -datatext: 表示经过分词之后的特征数据集 -stopWords: 表示读取的停用词""" <|body_0|> def write_csv(self, datatext, stopWords): """将三个数据文件的 text 合并起来到一个文件,并且去除停用词 :param datatext: 三个数据...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Build_Corpus: def load_data(self): """函数说明:该函数用于加载数据集 return: -data: 表示所有数据拼接的原始数据 -data_text: 表示数据集中的特征数据集 -datatext: 表示经过分词之后的特征数据集 -stopWords: 表示读取的停用词""" print('load Pre_process') data = pd.concat([pd.read_csv(config.train_data_path, sep='\t'), pd.read_csv(config.dev_data_path, sep...
the_stack_v2_python_sparse
src/data_process/build_corpus.py
WAng91An/Book_Classification
train
0
4a0521e733d7580ef3eba6519f3e26a369b68637
[ "super().__init__()\nself.pooling = pooling\nself.spherical_cheb_bn = SphericalChebBN(in_channels, out_channels, lap, kernel_size)", "x = self.pooling(x)\nx = self.spherical_cheb_bn(x)\nreturn x" ]
<|body_start_0|> super().__init__() self.pooling = pooling self.spherical_cheb_bn = SphericalChebBN(in_channels, out_channels, lap, kernel_size) <|end_body_0|> <|body_start_1|> x = self.pooling(x) x = self.spherical_cheb_bn(x) return x <|end_body_1|>
Building Block with a pooling/unpooling, a calling the SphericalChebBN block.
SphericalChebBNPool
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SphericalChebBNPool: """Building Block with a pooling/unpooling, a calling the SphericalChebBN block.""" def __init__(self, in_channels, out_channels, lap, pooling, kernel_size): """Initialization. Args: in_channels (int): initial number of channels. out_channels (int): output number...
stack_v2_sparse_classes_36k_train_002616
41,403
no_license
[ { "docstring": "Initialization. Args: in_channels (int): initial number of channels. out_channels (int): output number of channels. lap (:obj:`torch.sparse.FloatTensor`): laplacian. pooling (:obj:`torch.nn.Module`): pooling/unpooling module. kernel_size (int, optional): polynomial degree. Defaults to 3.", "...
2
stack_v2_sparse_classes_30k_train_015576
Implement the Python class `SphericalChebBNPool` described below. Class description: Building Block with a pooling/unpooling, a calling the SphericalChebBN block. Method signatures and docstrings: - def __init__(self, in_channels, out_channels, lap, pooling, kernel_size): Initialization. Args: in_channels (int): init...
Implement the Python class `SphericalChebBNPool` described below. Class description: Building Block with a pooling/unpooling, a calling the SphericalChebBN block. Method signatures and docstrings: - def __init__(self, in_channels, out_channels, lap, pooling, kernel_size): Initialization. Args: in_channels (int): init...
7e55a422588c1d1e00f35a3d3a3ff896cce59e18
<|skeleton|> class SphericalChebBNPool: """Building Block with a pooling/unpooling, a calling the SphericalChebBN block.""" def __init__(self, in_channels, out_channels, lap, pooling, kernel_size): """Initialization. Args: in_channels (int): initial number of channels. out_channels (int): output number...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SphericalChebBNPool: """Building Block with a pooling/unpooling, a calling the SphericalChebBN block.""" def __init__(self, in_channels, out_channels, lap, pooling, kernel_size): """Initialization. Args: in_channels (int): initial number of channels. out_channels (int): output number of channels....
the_stack_v2_python_sparse
generated/test_deepsphere_deepsphere_pytorch.py
jansel/pytorch-jit-paritybench
train
35
c5a20ac67445f00292775ffcf0888d6a074169e3
[ "world = vehicle.get_world()\nblueprint = world.get_blueprint_library().find('sensor.lidar.ray_cast')\nblueprint.set_attribute('upper_fov', str(config_yaml['upper_fov']))\nblueprint.set_attribute('lower_fov', str(config_yaml['lower_fov']))\nblueprint.set_attribute('channels', str(config_yaml['channels']))\nblueprin...
<|body_start_0|> world = vehicle.get_world() blueprint = world.get_blueprint_library().find('sensor.lidar.ray_cast') blueprint.set_attribute('upper_fov', str(config_yaml['upper_fov'])) blueprint.set_attribute('lower_fov', str(config_yaml['lower_fov'])) blueprint.set_attribute('ch...
Lidar sensor manager. Parameters -vehicle : carla.Vehicle The carla.Vehicle. We need this class to spawn sensors. -config_yaml : dict Configuration for lidar sensor. Attributes -o3d_pointcloud : o3d.PointCloud Recieved point cloud saved in o3d.PointCloud format. -sensor : CARLA actor The current sensor actors that will...
LidarSensor
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LidarSensor: """Lidar sensor manager. Parameters -vehicle : carla.Vehicle The carla.Vehicle. We need this class to spawn sensors. -config_yaml : dict Configuration for lidar sensor. Attributes -o3d_pointcloud : o3d.PointCloud Recieved point cloud saved in o3d.PointCloud format. -sensor : CARLA ac...
stack_v2_sparse_classes_36k_train_002617
14,680
permissive
[ { "docstring": "Construct class. Args: vehicle (carla.Vehicle): The attached vehicle. config_yaml (dict): Configuration for lidar.", "name": "__init__", "signature": "def __init__(self, vehicle, config_yaml)" }, { "docstring": "CAMERA method", "name": "_on_data_event", "signature": "def ...
2
stack_v2_sparse_classes_30k_train_005941
Implement the Python class `LidarSensor` described below. Class description: Lidar sensor manager. Parameters -vehicle : carla.Vehicle The carla.Vehicle. We need this class to spawn sensors. -config_yaml : dict Configuration for lidar sensor. Attributes -o3d_pointcloud : o3d.PointCloud Recieved point cloud saved in o3...
Implement the Python class `LidarSensor` described below. Class description: Lidar sensor manager. Parameters -vehicle : carla.Vehicle The carla.Vehicle. We need this class to spawn sensors. -config_yaml : dict Configuration for lidar sensor. Attributes -o3d_pointcloud : o3d.PointCloud Recieved point cloud saved in o3...
1ad4b368d4287dae8b282bac1665816a496d57c6
<|skeleton|> class LidarSensor: """Lidar sensor manager. Parameters -vehicle : carla.Vehicle The carla.Vehicle. We need this class to spawn sensors. -config_yaml : dict Configuration for lidar sensor. Attributes -o3d_pointcloud : o3d.PointCloud Recieved point cloud saved in o3d.PointCloud format. -sensor : CARLA ac...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LidarSensor: """Lidar sensor manager. Parameters -vehicle : carla.Vehicle The carla.Vehicle. We need this class to spawn sensors. -config_yaml : dict Configuration for lidar sensor. Attributes -o3d_pointcloud : o3d.PointCloud Recieved point cloud saved in o3d.PointCloud format. -sensor : CARLA actor The curre...
the_stack_v2_python_sparse
opencda/core/sensing/perception/perception_manager.py
xiaxin2000/OpenCDA-Documents
train
0
eafcd083db6bbd489e71a8f21a8fd33d464df199
[ "data = request.get_json()\npath = data.get('config_file_path')\nif not path:\n path = '.'\ncode, image = client.build(data.get('repository_URL'), data.get('image_tag'), path)\nif code == '0':\n return ({'image': image.id}, 200)\nelse:\n return ({'code': code}, 400)", "data = request.get_json()\nclient.d...
<|body_start_0|> data = request.get_json() path = data.get('config_file_path') if not path: path = '.' code, image = client.build(data.get('repository_URL'), data.get('image_tag'), path) if code == '0': return ({'image': image.id}, 200) else: ...
deployment
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class deployment: def post(self): """docker build""" <|body_0|> def delete(self): """docker rmi""" <|body_1|> <|end_skeleton|> <|body_start_0|> data = request.get_json() path = data.get('config_file_path') if not path: path = '...
stack_v2_sparse_classes_36k_train_002618
1,181
no_license
[ { "docstring": "docker build", "name": "post", "signature": "def post(self)" }, { "docstring": "docker rmi", "name": "delete", "signature": "def delete(self)" } ]
2
stack_v2_sparse_classes_30k_train_013033
Implement the Python class `deployment` described below. Class description: Implement the deployment class. Method signatures and docstrings: - def post(self): docker build - def delete(self): docker rmi
Implement the Python class `deployment` described below. Class description: Implement the deployment class. Method signatures and docstrings: - def post(self): docker build - def delete(self): docker rmi <|skeleton|> class deployment: def post(self): """docker build""" <|body_0|> def delete...
2cd55cbfb023e79b92dc31a96b9de6d2db138767
<|skeleton|> class deployment: def post(self): """docker build""" <|body_0|> def delete(self): """docker rmi""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class deployment: def post(self): """docker build""" data = request.get_json() path = data.get('config_file_path') if not path: path = '.' code, image = client.build(data.get('repository_URL'), data.get('image_tag'), path) if code == '0': retur...
the_stack_v2_python_sparse
src/image/namespaces/views.py
LCTheo/DeployT_PoC
train
0
3e7feda020db856d99ba9e26a11f5c088d2f4896
[ "def ser(root, array):\n if not root:\n array.append('None')\n else:\n array.append(root.val)\n ser(root.left, array)\n ser(root.right, array)\n return array\nreturn ser(root, [])", "def des(data_):\n if data_[0] == 'None':\n data_.pop(0)\n return None\n ro...
<|body_start_0|> def ser(root, array): if not root: array.append('None') else: array.append(root.val) ser(root.left, array) ser(root.right, array) return array return ser(root, []) <|end_body_0|> <|body_...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_002619
1,312
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
1bcf3206cd3acc428ec690cb883c612aaf708aac
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" def ser(root, array): if not root: array.append('None') else: array.append(root.val) ser(root.left, array) ...
the_stack_v2_python_sparse
top100/297.py
KevinChen1994/leetcode-algorithm
train
2
5f477eaf8233cc0cd2d72366b75ff88c2b2b54f7
[ "db = self.request.app['db']\nif not await db.otus.count_documents({'_id': otu_id, 'isolates.id': isolate_id}, limit=1):\n raise NotFound\nprojection = list(virtool.otus.db.SEQUENCE_PROJECTION)\nprojection.remove('otu_id')\nprojection.remove('isolate_id')\nreturn json_response([base_processor(d) async for d in d...
<|body_start_0|> db = self.request.app['db'] if not await db.otus.count_documents({'_id': otu_id, 'isolates.id': isolate_id}, limit=1): raise NotFound projection = list(virtool.otus.db.SEQUENCE_PROJECTION) projection.remove('otu_id') projection.remove('isolate_id') ...
SequencesView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SequencesView: async def get(self, otu_id: str, isolate_id: str, /) -> Union[r200[List[OTUIsolate]], r401, r403, r404]: """List sequences. Lists the sequences for an isolate.""" <|body_0|> async def post(self, otu_id: str, isolate_id: str, /, data: CreateSequenceRequest) -> ...
stack_v2_sparse_classes_36k_train_002620
16,946
permissive
[ { "docstring": "List sequences. Lists the sequences for an isolate.", "name": "get", "signature": "async def get(self, otu_id: str, isolate_id: str, /) -> Union[r200[List[OTUIsolate]], r401, r403, r404]" }, { "docstring": "Create a sequence. Creates a new sequence for an isolate identified by `o...
2
null
Implement the Python class `SequencesView` described below. Class description: Implement the SequencesView class. Method signatures and docstrings: - async def get(self, otu_id: str, isolate_id: str, /) -> Union[r200[List[OTUIsolate]], r401, r403, r404]: List sequences. Lists the sequences for an isolate. - async def...
Implement the Python class `SequencesView` described below. Class description: Implement the SequencesView class. Method signatures and docstrings: - async def get(self, otu_id: str, isolate_id: str, /) -> Union[r200[List[OTUIsolate]], r401, r403, r404]: List sequences. Lists the sequences for an isolate. - async def...
1d17d2ba570cf5487e7514bec29250a5b368bb0a
<|skeleton|> class SequencesView: async def get(self, otu_id: str, isolate_id: str, /) -> Union[r200[List[OTUIsolate]], r401, r403, r404]: """List sequences. Lists the sequences for an isolate.""" <|body_0|> async def post(self, otu_id: str, isolate_id: str, /, data: CreateSequenceRequest) -> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SequencesView: async def get(self, otu_id: str, isolate_id: str, /) -> Union[r200[List[OTUIsolate]], r401, r403, r404]: """List sequences. Lists the sequences for an isolate.""" db = self.request.app['db'] if not await db.otus.count_documents({'_id': otu_id, 'isolates.id': isolate_id},...
the_stack_v2_python_sparse
virtool/otus/api.py
virtool/virtool
train
45
c420be450f11e407bbde261381ba750e6af00724
[ "if api.dashboard_config.IS_ACTIVATE_AUTH:\n user_id = get_jwt_identity()\n role: ProjectUserRoleModel = db.session.query(ProjectUserRoleModel).filter(ProjectUserRoleModel.project_id == project_id, ProjectUserRoleModel.user_id == user_id).one_or_none()\n if role is None:\n raise ProjectUserRoleExcep...
<|body_start_0|> if api.dashboard_config.IS_ACTIVATE_AUTH: user_id = get_jwt_identity() role: ProjectUserRoleModel = db.session.query(ProjectUserRoleModel).filter(ProjectUserRoleModel.project_id == project_id, ProjectUserRoleModel.user_id == user_id).one_or_none() if role is ...
ApiKubernetes
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ApiKubernetes: def get(self, project_id: int): """get_kubernetes""" <|body_0|> def post(self, project_id: int): """add_kubernetes""" <|body_1|> <|end_skeleton|> <|body_start_0|> if api.dashboard_config.IS_ACTIVATE_AUTH: user_id = get_jwt...
stack_v2_sparse_classes_36k_train_002621
10,859
permissive
[ { "docstring": "get_kubernetes", "name": "get", "signature": "def get(self, project_id: int)" }, { "docstring": "add_kubernetes", "name": "post", "signature": "def post(self, project_id: int)" } ]
2
stack_v2_sparse_classes_30k_test_000280
Implement the Python class `ApiKubernetes` described below. Class description: Implement the ApiKubernetes class. Method signatures and docstrings: - def get(self, project_id: int): get_kubernetes - def post(self, project_id: int): add_kubernetes
Implement the Python class `ApiKubernetes` described below. Class description: Implement the ApiKubernetes class. Method signatures and docstrings: - def get(self, project_id: int): get_kubernetes - def post(self, project_id: int): add_kubernetes <|skeleton|> class ApiKubernetes: def get(self, project_id: int):...
c246a7c4c18c8aa6332482661cd55fc67cacf869
<|skeleton|> class ApiKubernetes: def get(self, project_id: int): """get_kubernetes""" <|body_0|> def post(self, project_id: int): """add_kubernetes""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ApiKubernetes: def get(self, project_id: int): """get_kubernetes""" if api.dashboard_config.IS_ACTIVATE_AUTH: user_id = get_jwt_identity() role: ProjectUserRoleModel = db.session.query(ProjectUserRoleModel).filter(ProjectUserRoleModel.project_id == project_id, ProjectUs...
the_stack_v2_python_sparse
rekcurd_dashboard/apis/api_kubernetes.py
frankiegu/dashboard
train
0
6873a63a854d455c62a31192f0699a1e89bec8a2
[ "if not nums:\n return []\nmaxVal = max(nums[:k])\nresult = [maxVal]\nfor i in range(k, len(nums)):\n if nums[i - k] < maxVal:\n maxVal = max(maxVal, nums[i])\n else:\n maxVal = max(nums[i - k + 1:i + 1])\n result.append(maxVal)\nreturn result", "if not nums:\n return []\nresult = []\...
<|body_start_0|> if not nums: return [] maxVal = max(nums[:k]) result = [maxVal] for i in range(k, len(nums)): if nums[i - k] < maxVal: maxVal = max(maxVal, nums[i]) else: maxVal = max(nums[i - k + 1:i + 1]) ...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxSlidingWindow2(self, nums, k): """200ms maxVal是前一个窗口的最大值。 当把第i个元素加入到当前窗口时, if maxVal不是前一个窗口的第一个值: 当前窗口的最大值是max(maxVal, nums[i]) else: 当前窗口的最大值需要从整个窗口中查找 :type nums: List[int] :type k: int :rtype: List[int]""" <|body_0|> def maxSlidingWindow(self, nums, k): ...
stack_v2_sparse_classes_36k_train_002622
2,769
permissive
[ { "docstring": "200ms maxVal是前一个窗口的最大值。 当把第i个元素加入到当前窗口时, if maxVal不是前一个窗口的第一个值: 当前窗口的最大值是max(maxVal, nums[i]) else: 当前窗口的最大值需要从整个窗口中查找 :type nums: List[int] :type k: int :rtype: List[int]", "name": "maxSlidingWindow2", "signature": "def maxSlidingWindow2(self, nums, k)" }, { "docstring": "220ms ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxSlidingWindow2(self, nums, k): 200ms maxVal是前一个窗口的最大值。 当把第i个元素加入到当前窗口时, if maxVal不是前一个窗口的第一个值: 当前窗口的最大值是max(maxVal, nums[i]) else: 当前窗口的最大值需要从整个窗口中查找 :type nums: List[int]...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxSlidingWindow2(self, nums, k): 200ms maxVal是前一个窗口的最大值。 当把第i个元素加入到当前窗口时, if maxVal不是前一个窗口的第一个值: 当前窗口的最大值是max(maxVal, nums[i]) else: 当前窗口的最大值需要从整个窗口中查找 :type nums: List[int]...
2830c7e2ada8dfd3dcdda7c06846116d4f944a27
<|skeleton|> class Solution: def maxSlidingWindow2(self, nums, k): """200ms maxVal是前一个窗口的最大值。 当把第i个元素加入到当前窗口时, if maxVal不是前一个窗口的第一个值: 当前窗口的最大值是max(maxVal, nums[i]) else: 当前窗口的最大值需要从整个窗口中查找 :type nums: List[int] :type k: int :rtype: List[int]""" <|body_0|> def maxSlidingWindow(self, nums, k): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxSlidingWindow2(self, nums, k): """200ms maxVal是前一个窗口的最大值。 当把第i个元素加入到当前窗口时, if maxVal不是前一个窗口的第一个值: 当前窗口的最大值是max(maxVal, nums[i]) else: 当前窗口的最大值需要从整个窗口中查找 :type nums: List[int] :type k: int :rtype: List[int]""" if not nums: return [] maxVal = max(nums[:k]) ...
the_stack_v2_python_sparse
leetcode/hard/Sliding_Window_Maximum.py
shhuan/algorithms
train
0
194cdbbee0b4a77826161e6fcc423a12d5b82d40
[ "x = 9\nn = 2\nresult = ReturnsNthRoot(x, n)\nroot = 3\nself.assertEqual(result, root)", "x = 9\nn = 3\nresult = ReturnsNthRoot(x, n)\nroot = None\nself.assertEqual(result, root)" ]
<|body_start_0|> x = 9 n = 2 result = ReturnsNthRoot(x, n) root = 3 self.assertEqual(result, root) <|end_body_0|> <|body_start_1|> x = 9 n = 3 result = ReturnsNthRoot(x, n) root = None self.assertEqual(result, root) <|end_body_1|>
TestRootPower
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestRootPower: def test_ReturnsNthRoot_Existent(self): """Test ReturnsNthRoot if it exists as an Integer""" <|body_0|> def test_ReturnsNthRoot_NonExistent(self): """Test ReturnsNthRoot if it exists as an Integer""" <|body_1|> <|end_skeleton|> <|body_start_0...
stack_v2_sparse_classes_36k_train_002623
1,474
no_license
[ { "docstring": "Test ReturnsNthRoot if it exists as an Integer", "name": "test_ReturnsNthRoot_Existent", "signature": "def test_ReturnsNthRoot_Existent(self)" }, { "docstring": "Test ReturnsNthRoot if it exists as an Integer", "name": "test_ReturnsNthRoot_NonExistent", "signature": "def ...
2
null
Implement the Python class `TestRootPower` described below. Class description: Implement the TestRootPower class. Method signatures and docstrings: - def test_ReturnsNthRoot_Existent(self): Test ReturnsNthRoot if it exists as an Integer - def test_ReturnsNthRoot_NonExistent(self): Test ReturnsNthRoot if it exists as ...
Implement the Python class `TestRootPower` described below. Class description: Implement the TestRootPower class. Method signatures and docstrings: - def test_ReturnsNthRoot_Existent(self): Test ReturnsNthRoot if it exists as an Integer - def test_ReturnsNthRoot_NonExistent(self): Test ReturnsNthRoot if it exists as ...
cd85abea9d91ed8b17334f744ab150e790044da6
<|skeleton|> class TestRootPower: def test_ReturnsNthRoot_Existent(self): """Test ReturnsNthRoot if it exists as an Integer""" <|body_0|> def test_ReturnsNthRoot_NonExistent(self): """Test ReturnsNthRoot if it exists as an Integer""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestRootPower: def test_ReturnsNthRoot_Existent(self): """Test ReturnsNthRoot if it exists as an Integer""" x = 9 n = 2 result = ReturnsNthRoot(x, n) root = 3 self.assertEqual(result, root) def test_ReturnsNthRoot_NonExistent(self): """Test ReturnsN...
the_stack_v2_python_sparse
Chapters/Chapter3/FingerExercises/RootPower/testRootPower.py
ppysjp93/Introduction-to-Computation-and-Programming-Using-Python-
train
0
ae4c923a26bf1f8cd1bd8039078c957125ca73ae
[ "self.old_x = 0\nself.old_y = 0\nself.vector = vector\nself.damage = damage\nself.duration = 150\nself.position_debt = (0.0, 0.0)\nif damage > 1:\n self.bullet = HotBulletSprite(center)\nelse:\n self.bullet = BulletSprite(center)", "if self in GAME_DATA.elements.bullets:\n GAME_DATA.elements.bullets.remo...
<|body_start_0|> self.old_x = 0 self.old_y = 0 self.vector = vector self.damage = damage self.duration = 150 self.position_debt = (0.0, 0.0) if damage > 1: self.bullet = HotBulletSprite(center) else: self.bullet = BulletSprite(cente...
Controls Bullet
Bullet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Bullet: """Controls Bullet""" def __init__(self, vector, center, damage=1): """:param vector: path for bullet :param center: starting point for bullet :param damage: damage to be dealt on impact :param speed: movement speed of bullet :param duration: time after which bullet will be d...
stack_v2_sparse_classes_36k_train_002624
21,421
no_license
[ { "docstring": ":param vector: path for bullet :param center: starting point for bullet :param damage: damage to be dealt on impact :param speed: movement speed of bullet :param duration: time after which bullet will be destroyed", "name": "__init__", "signature": "def __init__(self, vector, center, dam...
5
stack_v2_sparse_classes_30k_train_015230
Implement the Python class `Bullet` described below. Class description: Controls Bullet Method signatures and docstrings: - def __init__(self, vector, center, damage=1): :param vector: path for bullet :param center: starting point for bullet :param damage: damage to be dealt on impact :param speed: movement speed of ...
Implement the Python class `Bullet` described below. Class description: Controls Bullet Method signatures and docstrings: - def __init__(self, vector, center, damage=1): :param vector: path for bullet :param center: starting point for bullet :param damage: damage to be dealt on impact :param speed: movement speed of ...
51a2f2ecc09a05672a2c3deb00ab8c273d3b756b
<|skeleton|> class Bullet: """Controls Bullet""" def __init__(self, vector, center, damage=1): """:param vector: path for bullet :param center: starting point for bullet :param damage: damage to be dealt on impact :param speed: movement speed of bullet :param duration: time after which bullet will be d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Bullet: """Controls Bullet""" def __init__(self, vector, center, damage=1): """:param vector: path for bullet :param center: starting point for bullet :param damage: damage to be dealt on impact :param speed: movement speed of bullet :param duration: time after which bullet will be destroyed""" ...
the_stack_v2_python_sparse
game_core/game_data.py
asmodeii/tanki
train
0
706b7ad62c3bb54c939b0f103732f6893723af52
[ "self._view = qw.QGraphicsView()\nself._view.setScene(qw.QGraphicsScene())\nself._project = project", "rpt_dir, _, _ = make_report_file_names(self._project['proj_full_path'])\nimage_dir = rpt_dir.joinpath('images')\nimages = [i for i in image_dir.iterdir() if i.suffix == '.ppm']\nreturn images", "images = self....
<|body_start_0|> self._view = qw.QGraphicsView() self._view.setScene(qw.QGraphicsScene()) self._project = project <|end_body_0|> <|body_start_1|> rpt_dir, _, _ = make_report_file_names(self._project['proj_full_path']) image_dir = rpt_dir.joinpath('images') images = [i fo...
an off-screen renderer for images
OffScreenRender
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OffScreenRender: """an off-screen renderer for images""" def __init__(self, project): """set up the object Args: project (CGTProject): the project data""" <|body_0|> def list_pixmaps(self): """get a list of all the pixmaps""" <|body_1|> def render_re...
stack_v2_sparse_classes_36k_train_002625
3,848
permissive
[ { "docstring": "set up the object Args: project (CGTProject): the project data", "name": "__init__", "signature": "def __init__(self, project)" }, { "docstring": "get a list of all the pixmaps", "name": "list_pixmaps", "signature": "def list_pixmaps(self)" }, { "docstring": "rend...
5
stack_v2_sparse_classes_30k_train_009500
Implement the Python class `OffScreenRender` described below. Class description: an off-screen renderer for images Method signatures and docstrings: - def __init__(self, project): set up the object Args: project (CGTProject): the project data - def list_pixmaps(self): get a list of all the pixmaps - def render_region...
Implement the Python class `OffScreenRender` described below. Class description: an off-screen renderer for images Method signatures and docstrings: - def __init__(self, project): set up the object Args: project (CGTProject): the project data - def list_pixmaps(self): get a list of all the pixmaps - def render_region...
d92f82d400cbc41f73d2f476ca6227e767ab3d4b
<|skeleton|> class OffScreenRender: """an off-screen renderer for images""" def __init__(self, project): """set up the object Args: project (CGTProject): the project data""" <|body_0|> def list_pixmaps(self): """get a list of all the pixmaps""" <|body_1|> def render_re...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OffScreenRender: """an off-screen renderer for images""" def __init__(self, project): """set up the object Args: project (CGTProject): the project data""" self._view = qw.QGraphicsView() self._view.setScene(qw.QGraphicsScene()) self._project = project def list_pixmaps...
the_stack_v2_python_sparse
cgt/io/offscreenrender.py
jonathanHuwP/CrystalGrowthTracker
train
0
bbcdc1844d97f559edeb426e83156f6881993669
[ "self.GET_PARSER.add_argument('id', required=True, type=int, location='args')\nargs = self.GET_PARSER.parse_args()\nid_ = args['id']\npassenger = common.query_single_by_id(models.Passenger, id_)\nif passenger is None:\n return ({'error': 'not found'}, 404)\nreturn marshal(passenger, PASSENGER_STRUCTURE)", "sel...
<|body_start_0|> self.GET_PARSER.add_argument('id', required=True, type=int, location='args') args = self.GET_PARSER.parse_args() id_ = args['id'] passenger = common.query_single_by_id(models.Passenger, id_) if passenger is None: return ({'error': 'not found'}, 404) ...
PassengerResource
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PassengerResource: def get(self): """获取拼车的人的信息 API请求地址: /interaction/api/v2/passenger 方法: GET 参数: 必选参数: id 乘客的id""" <|body_0|> def post(self): """加入某个拼车 API请求地址: /interaction/api/v2/passenger 方法: POST 参数: 参数位置为form 必选参数: carpool_id 已经存在的某个拼车id uid 用户id token 用户token ...
stack_v2_sparse_classes_36k_train_002626
7,122
no_license
[ { "docstring": "获取拼车的人的信息 API请求地址: /interaction/api/v2/passenger 方法: GET 参数: 必选参数: id 乘客的id", "name": "get", "signature": "def get(self)" }, { "docstring": "加入某个拼车 API请求地址: /interaction/api/v2/passenger 方法: POST 参数: 参数位置为form 必选参数: carpool_id 已经存在的某个拼车id uid 用户id token 用户token contact 用户自己的联系信息,...
4
stack_v2_sparse_classes_30k_train_009191
Implement the Python class `PassengerResource` described below. Class description: Implement the PassengerResource class. Method signatures and docstrings: - def get(self): 获取拼车的人的信息 API请求地址: /interaction/api/v2/passenger 方法: GET 参数: 必选参数: id 乘客的id - def post(self): 加入某个拼车 API请求地址: /interaction/api/v2/passenger 方法: P...
Implement the Python class `PassengerResource` described below. Class description: Implement the PassengerResource class. Method signatures and docstrings: - def get(self): 获取拼车的人的信息 API请求地址: /interaction/api/v2/passenger 方法: GET 参数: 必选参数: id 乘客的id - def post(self): 加入某个拼车 API请求地址: /interaction/api/v2/passenger 方法: P...
076f2a6ed334f8a96b741d0c5c9d268f3716c8b3
<|skeleton|> class PassengerResource: def get(self): """获取拼车的人的信息 API请求地址: /interaction/api/v2/passenger 方法: GET 参数: 必选参数: id 乘客的id""" <|body_0|> def post(self): """加入某个拼车 API请求地址: /interaction/api/v2/passenger 方法: POST 参数: 参数位置为form 必选参数: carpool_id 已经存在的某个拼车id uid 用户id token 用户token ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PassengerResource: def get(self): """获取拼车的人的信息 API请求地址: /interaction/api/v2/passenger 方法: GET 参数: 必选参数: id 乘客的id""" self.GET_PARSER.add_argument('id', required=True, type=int, location='args') args = self.GET_PARSER.parse_args() id_ = args['id'] passenger = common.query...
the_stack_v2_python_sparse
app/mod_interaction/resources/PassengerResource.py
xiaofud/syllabus_backend
train
0
93d0667bffb15dcd26766440ea7a204f309186ab
[ "m, n = (len(s), len(p))\ndp = [[0] * (n + 1) for _ in range(m + 1)]\ns = ' ' + s\np = ' ' + p\ndp[0][0] = 1\nfor i in range(0, m + 1):\n for j in range(1, n + 1):\n if i > 0 and (s[i] == p[j] or p[j] == '.'):\n dp[i][j] = dp[i - 1][j - 1] | dp[i][j]\n if p[j] == '*':\n dp[i][...
<|body_start_0|> m, n = (len(s), len(p)) dp = [[0] * (n + 1) for _ in range(m + 1)] s = ' ' + s p = ' ' + p dp[0][0] = 1 for i in range(0, m + 1): for j in range(1, n + 1): if i > 0 and (s[i] == p[j] or p[j] == '.'): dp[i][j...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def isMatch(self, s, p): """:type s: str :type p: str :rtype: bool""" <|body_0|> def isMatch2(self, s, p): """直接使用re :param s: :param p: :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> m, n = (len(s), len(p)) dp = [[0] * (...
stack_v2_sparse_classes_36k_train_002627
2,903
no_license
[ { "docstring": ":type s: str :type p: str :rtype: bool", "name": "isMatch", "signature": "def isMatch(self, s, p)" }, { "docstring": "直接使用re :param s: :param p: :return:", "name": "isMatch2", "signature": "def isMatch2(self, s, p)" } ]
2
stack_v2_sparse_classes_30k_train_007236
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def isMatch(self, s, p): :type s: str :type p: str :rtype: bool - def isMatch2(self, s, p): 直接使用re :param s: :param p: :return:
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def isMatch(self, s, p): :type s: str :type p: str :rtype: bool - def isMatch2(self, s, p): 直接使用re :param s: :param p: :return: <|skeleton|> class Solution: def isMatch(sel...
5d3574ccd282d0146c83c286ae28d8baaabd4910
<|skeleton|> class Solution: def isMatch(self, s, p): """:type s: str :type p: str :rtype: bool""" <|body_0|> def isMatch2(self, s, p): """直接使用re :param s: :param p: :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def isMatch(self, s, p): """:type s: str :type p: str :rtype: bool""" m, n = (len(s), len(p)) dp = [[0] * (n + 1) for _ in range(m + 1)] s = ' ' + s p = ' ' + p dp[0][0] = 1 for i in range(0, m + 1): for j in range(1, n + 1): ...
the_stack_v2_python_sparse
10_ 正则表达式匹配.py
lovehhf/LeetCode
train
0
edd9edce56896948402695c41423ff48c23c1503
[ "edges = defaultdict(set)\nindegrees = [0] * numCourses\nfor second, first in prerequisites:\n indegrees[second] += 1\n edges[first].add(second)\nqueue = []\nfor i in range(numCourses):\n if indegrees[i] == 0:\n queue.append(i)\nvisited = 0\nwhile queue:\n course = queue.pop(0)\n visited += 1\...
<|body_start_0|> edges = defaultdict(set) indegrees = [0] * numCourses for second, first in prerequisites: indegrees[second] += 1 edges[first].add(second) queue = [] for i in range(numCourses): if indegrees[i] == 0: queue.append...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: """BFS""" <|body_0|> def canFinishDFS(self, numCourses: int, prerequisites: List[List[int]]) -> bool: """DFS""" <|body_1|> <|end_skeleton|> <|body_start_0|> edge...
stack_v2_sparse_classes_36k_train_002628
3,200
no_license
[ { "docstring": "BFS", "name": "canFinish", "signature": "def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool" }, { "docstring": "DFS", "name": "canFinishDFS", "signature": "def canFinishDFS(self, numCourses: int, prerequisites: List[List[int]]) -> bool" } ]
2
stack_v2_sparse_classes_30k_train_000014
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: BFS - def canFinishDFS(self, numCourses: int, prerequisites: List[List[int]]) -> bool: DFS
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: BFS - def canFinishDFS(self, numCourses: int, prerequisites: List[List[int]]) -> bool: DFS <|skelet...
52756b30e9d51794591aca030bc918e707f473f1
<|skeleton|> class Solution: def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: """BFS""" <|body_0|> def canFinishDFS(self, numCourses: int, prerequisites: List[List[int]]) -> bool: """DFS""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: """BFS""" edges = defaultdict(set) indegrees = [0] * numCourses for second, first in prerequisites: indegrees[second] += 1 edges[first].add(second) queue = []...
the_stack_v2_python_sparse
207.课程表/solution.py
QtTao/daily_leetcode
train
0
90a8560e68210f05645872a3614e8aeea3b75853
[ "try:\n parser = DocumentParser.post_parser()\n request_data = parser.parse_args()\n size_in_limit = DocumentHandler.max_document_size(request_data['documents'][0])\n if not size_in_limit:\n return ('File size limit exceeds the max size', 413)\n result = DocumentHandler.upload_document(request...
<|body_start_0|> try: parser = DocumentParser.post_parser() request_data = parser.parse_args() size_in_limit = DocumentHandler.max_document_size(request_data['documents'][0]) if not size_in_limit: return ('File size limit exceeds the max size', 413...
Documents
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Documents: def post(self): """The POST request will upload the document on the S3 bucket, If the upload is successful then we will save the Details in the database @return: Saved Document details in Json Format""" <|body_0|> def get(self): """This GET request will fe...
stack_v2_sparse_classes_36k_train_002629
7,627
no_license
[ { "docstring": "The POST request will upload the document on the S3 bucket, If the upload is successful then we will save the Details in the database @return: Saved Document details in Json Format", "name": "post", "signature": "def post(self)" }, { "docstring": "This GET request will fetch the ...
3
null
Implement the Python class `Documents` described below. Class description: Implement the Documents class. Method signatures and docstrings: - def post(self): The POST request will upload the document on the S3 bucket, If the upload is successful then we will save the Details in the database @return: Saved Document de...
Implement the Python class `Documents` described below. Class description: Implement the Documents class. Method signatures and docstrings: - def post(self): The POST request will upload the document on the S3 bucket, If the upload is successful then we will save the Details in the database @return: Saved Document de...
17b93889c6945db15ed8b57147def2ae89a07de5
<|skeleton|> class Documents: def post(self): """The POST request will upload the document on the S3 bucket, If the upload is successful then we will save the Details in the database @return: Saved Document details in Json Format""" <|body_0|> def get(self): """This GET request will fe...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Documents: def post(self): """The POST request will upload the document on the S3 bucket, If the upload is successful then we will save the Details in the database @return: Saved Document details in Json Format""" try: parser = DocumentParser.post_parser() request_data ...
the_stack_v2_python_sparse
FiledInfluencer/Api/routers.py
jssellars/aniket_filed
train
0
fa4e99b78515dc081319c1bdd6bb716e9d53dbe8
[ "token_verification.verify_tokens()\nquery = \"SELECT * FROM products WHERE product_id = '{}'\".format(product_id)\nfetched_product = db.select_from_db(query)\nif not fetched_product:\n return make_response(jsonify({'message': 'Product with id {} is not existing'.format(product_id)}), 404)\nreturn make_response(...
<|body_start_0|> token_verification.verify_tokens() query = "SELECT * FROM products WHERE product_id = '{}'".format(product_id) fetched_product = db.select_from_db(query) if not fetched_product: return make_response(jsonify({'message': 'Product with id {} is not existing'.for...
Simple class to fetch specific product
FetchSpecificProduct
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FetchSpecificProduct: """Simple class to fetch specific product""" def get(self, product_id): """GET /products/<int:product_id> fetches specific product""" <|body_0|> def put(self, product_id): """PUT /product/""" <|body_1|> def delete(self, product_...
stack_v2_sparse_classes_36k_train_002630
5,144
no_license
[ { "docstring": "GET /products/<int:product_id> fetches specific product", "name": "get", "signature": "def get(self, product_id)" }, { "docstring": "PUT /product/", "name": "put", "signature": "def put(self, product_id)" }, { "docstring": "Delete products by id", "name": "del...
3
stack_v2_sparse_classes_30k_train_000953
Implement the Python class `FetchSpecificProduct` described below. Class description: Simple class to fetch specific product Method signatures and docstrings: - def get(self, product_id): GET /products/<int:product_id> fetches specific product - def put(self, product_id): PUT /product/ - def delete(self, product_id):...
Implement the Python class `FetchSpecificProduct` described below. Class description: Simple class to fetch specific product Method signatures and docstrings: - def get(self, product_id): GET /products/<int:product_id> fetches specific product - def put(self, product_id): PUT /product/ - def delete(self, product_id):...
944173cf41648ea218fd8440c3741939d9cd2754
<|skeleton|> class FetchSpecificProduct: """Simple class to fetch specific product""" def get(self, product_id): """GET /products/<int:product_id> fetches specific product""" <|body_0|> def put(self, product_id): """PUT /product/""" <|body_1|> def delete(self, product_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FetchSpecificProduct: """Simple class to fetch specific product""" def get(self, product_id): """GET /products/<int:product_id> fetches specific product""" token_verification.verify_tokens() query = "SELECT * FROM products WHERE product_id = '{}'".format(product_id) fetche...
the_stack_v2_python_sparse
app/api/v2/views/products.py
TooColline/Store-Manager-Api-V2
train
1
db6989622dcdc274ab2ca809178b0a4f327c1ecb
[ "nums = {}\nfor task in tasks:\n nums[task] = nums.get(task, 0) + 1\nsorted_nums = sorted(nums.items(), key=lambda x: x[1], reverse=True)\nmax_count = sorted_nums[0][1]\nres = (max_count - 1) * (n + 1)\nfor tmp in sorted_nums:\n if tmp[1] == max_count:\n res += 1\nres = res if res >= len(tasks) else le...
<|body_start_0|> nums = {} for task in tasks: nums[task] = nums.get(task, 0) + 1 sorted_nums = sorted(nums.items(), key=lambda x: x[1], reverse=True) max_count = sorted_nums[0][1] res = (max_count - 1) * (n + 1) for tmp in sorted_nums: if tmp[1] ==...
桶思想: 自己实现了Counter功能
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """桶思想: 自己实现了Counter功能""" def leastInterval(self, tasks, n): """:type tasks: List[str] :type n: int :rtype: int""" <|body_0|> def leastInterval(self, tasks, n): """:type tasks: List[str] :type n: int :rtype: int""" <|body_1|> <|end_skeleton|> ...
stack_v2_sparse_classes_36k_train_002631
1,556
no_license
[ { "docstring": ":type tasks: List[str] :type n: int :rtype: int", "name": "leastInterval", "signature": "def leastInterval(self, tasks, n)" }, { "docstring": ":type tasks: List[str] :type n: int :rtype: int", "name": "leastInterval", "signature": "def leastInterval(self, tasks, n)" } ]
2
null
Implement the Python class `Solution` described below. Class description: 桶思想: 自己实现了Counter功能 Method signatures and docstrings: - def leastInterval(self, tasks, n): :type tasks: List[str] :type n: int :rtype: int - def leastInterval(self, tasks, n): :type tasks: List[str] :type n: int :rtype: int
Implement the Python class `Solution` described below. Class description: 桶思想: 自己实现了Counter功能 Method signatures and docstrings: - def leastInterval(self, tasks, n): :type tasks: List[str] :type n: int :rtype: int - def leastInterval(self, tasks, n): :type tasks: List[str] :type n: int :rtype: int <|skeleton|> class ...
c162817f717b78997197649c084c27af48c3fd6f
<|skeleton|> class Solution: """桶思想: 自己实现了Counter功能""" def leastInterval(self, tasks, n): """:type tasks: List[str] :type n: int :rtype: int""" <|body_0|> def leastInterval(self, tasks, n): """:type tasks: List[str] :type n: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: """桶思想: 自己实现了Counter功能""" def leastInterval(self, tasks, n): """:type tasks: List[str] :type n: int :rtype: int""" nums = {} for task in tasks: nums[task] = nums.get(task, 0) + 1 sorted_nums = sorted(nums.items(), key=lambda x: x[1], reverse=True) ...
the_stack_v2_python_sparse
Week_06/621.任务调度器.py
dream201188/algorithm017
train
1
6449243f07327101a2eaa009506ec67d49b74395
[ "min_date = timezone.now() + timedelta(minutes=10)\nif data < min_date:\n raise serializers.ValidationError('Departure time must be at least pass the next 20 minutes window.')\nreturn data", "if self.context['request'].user != data['offered_by']:\n raise serializers.ValidationError('Rides offered on behalf ...
<|body_start_0|> min_date = timezone.now() + timedelta(minutes=10) if data < min_date: raise serializers.ValidationError('Departure time must be at least pass the next 20 minutes window.') return data <|end_body_0|> <|body_start_1|> if self.context['request'].user != data['o...
Ride model serializer.
CreateRideSerializer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CreateRideSerializer: """Ride model serializer.""" def validate_departure_date(self, data): """Verify date is not in the past.""" <|body_0|> def validate(self, data): """Validate. Verify that the person who offers the ride is member and also the same user making ...
stack_v2_sparse_classes_36k_train_002632
5,840
permissive
[ { "docstring": "Verify date is not in the past.", "name": "validate_departure_date", "signature": "def validate_departure_date(self, data)" }, { "docstring": "Validate. Verify that the person who offers the ride is member and also the same user making the request.", "name": "validate", "...
3
stack_v2_sparse_classes_30k_train_006284
Implement the Python class `CreateRideSerializer` described below. Class description: Ride model serializer. Method signatures and docstrings: - def validate_departure_date(self, data): Verify date is not in the past. - def validate(self, data): Validate. Verify that the person who offers the ride is member and also ...
Implement the Python class `CreateRideSerializer` described below. Class description: Ride model serializer. Method signatures and docstrings: - def validate_departure_date(self, data): Verify date is not in the past. - def validate(self, data): Validate. Verify that the person who offers the ride is member and also ...
642576deaf569663d5dbc0d5820cfbc49c17fd2e
<|skeleton|> class CreateRideSerializer: """Ride model serializer.""" def validate_departure_date(self, data): """Verify date is not in the past.""" <|body_0|> def validate(self, data): """Validate. Verify that the person who offers the ride is member and also the same user making ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CreateRideSerializer: """Ride model serializer.""" def validate_departure_date(self, data): """Verify date is not in the past.""" min_date = timezone.now() + timedelta(minutes=10) if data < min_date: raise serializers.ValidationError('Departure time must be at least pa...
the_stack_v2_python_sparse
cride/rides/serializers/rides.py
stalinch98/Advanced_Django
train
2
45468e7a7f60f0a25a453b7be12ab91a254defda
[ "self.image = pygame.Surface((size[0], size[1]))\nif type(background) == str:\n background = pygame.image.load(background).convert()\n background = pygame.transform.scale(background, size)\n self.image.blit(background, (0, 0))\nelif type(background) == tuple:\n self.image.fill(background)\nself.pos = (0...
<|body_start_0|> self.image = pygame.Surface((size[0], size[1])) if type(background) == str: background = pygame.image.load(background).convert() background = pygame.transform.scale(background, size) self.image.blit(background, (0, 0)) elif type(background) ==...
BaseScreen
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseScreen: def __init__(self, size, background=None): """This is a base class for the other screens offered in the pygametools module. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Inputs: size - an (x,y) tuple defining the width and height of the screen to be...
stack_v2_sparse_classes_36k_train_002633
35,070
no_license
[ { "docstring": "This is a base class for the other screens offered in the pygametools module. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Inputs: size - an (x,y) tuple defining the width and height of the screen to be made (in pixels). background - The background can either be a rgb...
2
stack_v2_sparse_classes_30k_test_000574
Implement the Python class `BaseScreen` described below. Class description: Implement the BaseScreen class. Method signatures and docstrings: - def __init__(self, size, background=None): This is a base class for the other screens offered in the pygametools module. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
Implement the Python class `BaseScreen` described below. Class description: Implement the BaseScreen class. Method signatures and docstrings: - def __init__(self, size, background=None): This is a base class for the other screens offered in the pygametools module. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
3eae1428fdd30fddc66669d40b8bb0a715d5595a
<|skeleton|> class BaseScreen: def __init__(self, size, background=None): """This is a base class for the other screens offered in the pygametools module. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Inputs: size - an (x,y) tuple defining the width and height of the screen to be...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseScreen: def __init__(self, size, background=None): """This is a base class for the other screens offered in the pygametools module. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Inputs: size - an (x,y) tuple defining the width and height of the screen to be made (in pixe...
the_stack_v2_python_sparse
Games/Torric's Quest/pygametools.py
jbm950/personal_projects
train
0
4d318608495c9bdf6111d54cc9713e621d18a33f
[ "self.dateValueDict = dateValueDict\nself.length = len(dateValueDict.keys())\nself.lowMargin = lowMargin\nself.upMargin = upMargin\nself.leftMargin = leftMargin\nself.rightMargin = rightMargin\nself.dateFormat = dateFormat\nself.rect = []\nheight = float(1 - self.lowMargin - self.upMargin - (self.length - 1) * betw...
<|body_start_0|> self.dateValueDict = dateValueDict self.length = len(dateValueDict.keys()) self.lowMargin = lowMargin self.upMargin = upMargin self.leftMargin = leftMargin self.rightMargin = rightMargin self.dateFormat = dateFormat self.rect = [] ...
plot dict with date value
PlotDateValueDict
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PlotDateValueDict: """plot dict with date value""" def __init__(self, dateValueDict, dateFormat='%Y%m%d', lowMargin=0.05, upMargin=0.05, rightMargin=0.05, leftMargin=0.05, betweenMargin=0.05): """constructor""" <|body_0|> def plot(self): """plot dataValue""" ...
stack_v2_sparse_classes_36k_train_002634
2,303
no_license
[ { "docstring": "constructor", "name": "__init__", "signature": "def __init__(self, dateValueDict, dateFormat='%Y%m%d', lowMargin=0.05, upMargin=0.05, rightMargin=0.05, leftMargin=0.05, betweenMargin=0.05)" }, { "docstring": "plot dataValue", "name": "plot", "signature": "def plot(self)" ...
2
null
Implement the Python class `PlotDateValueDict` described below. Class description: plot dict with date value Method signatures and docstrings: - def __init__(self, dateValueDict, dateFormat='%Y%m%d', lowMargin=0.05, upMargin=0.05, rightMargin=0.05, leftMargin=0.05, betweenMargin=0.05): constructor - def plot(self): p...
Implement the Python class `PlotDateValueDict` described below. Class description: plot dict with date value Method signatures and docstrings: - def __init__(self, dateValueDict, dateFormat='%Y%m%d', lowMargin=0.05, upMargin=0.05, rightMargin=0.05, leftMargin=0.05, betweenMargin=0.05): constructor - def plot(self): p...
d494b3041069d377d6a7a9c296a14334f2fa5acc
<|skeleton|> class PlotDateValueDict: """plot dict with date value""" def __init__(self, dateValueDict, dateFormat='%Y%m%d', lowMargin=0.05, upMargin=0.05, rightMargin=0.05, leftMargin=0.05, betweenMargin=0.05): """constructor""" <|body_0|> def plot(self): """plot dataValue""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PlotDateValueDict: """plot dict with date value""" def __init__(self, dateValueDict, dateFormat='%Y%m%d', lowMargin=0.05, upMargin=0.05, rightMargin=0.05, leftMargin=0.05, betweenMargin=0.05): """constructor""" self.dateValueDict = dateValueDict self.length = len(dateValueDict.key...
the_stack_v2_python_sparse
python/panpanpandas_ultrafinance/ultrafinance-master/ultrafinance/lib/plotDateValueDict.py
LiuFang816/SALSTM_py_data
train
10
3b9c8e90d27032b1555763a46768ec74570b2d23
[ "Maze.__init__(self, length, width, initialP)\nself.fire = fire\nself.fireSpots = []\nself.probabilityDistribution = {}\nfor state in self.maze.keys():\n self.probabilityDistribution[state] = 0\nself.utility = {}", "coordinates = []\nfor x in range(self.length // 4 + 1, 3 * self.length // 4):\n for y in ran...
<|body_start_0|> Maze.__init__(self, length, width, initialP) self.fire = fire self.fireSpots = [] self.probabilityDistribution = {} for state in self.maze.keys(): self.probabilityDistribution[state] = 0 self.utility = {} <|end_body_0|> <|body_start_1|> ...
FireMaze
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FireMaze: def __init__(self, length, width, initialP, fire): """initialize the number of the fire spots""" <|body_0|> def setFire(self): """randomly distribute the fire spots""" <|body_1|> def fireProbability(self, state): """Input: - a state coo...
stack_v2_sparse_classes_36k_train_002635
22,307
no_license
[ { "docstring": "initialize the number of the fire spots", "name": "__init__", "signature": "def __init__(self, length, width, initialP, fire)" }, { "docstring": "randomly distribute the fire spots", "name": "setFire", "signature": "def setFire(self)" }, { "docstring": "Input: - a...
6
stack_v2_sparse_classes_30k_train_019706
Implement the Python class `FireMaze` described below. Class description: Implement the FireMaze class. Method signatures and docstrings: - def __init__(self, length, width, initialP, fire): initialize the number of the fire spots - def setFire(self): randomly distribute the fire spots - def fireProbability(self, sta...
Implement the Python class `FireMaze` described below. Class description: Implement the FireMaze class. Method signatures and docstrings: - def __init__(self, length, width, initialP, fire): initialize the number of the fire spots - def setFire(self): randomly distribute the fire spots - def fireProbability(self, sta...
ea0ca361e3c47c3b38d6e5bcbe69762ab18a1262
<|skeleton|> class FireMaze: def __init__(self, length, width, initialP, fire): """initialize the number of the fire spots""" <|body_0|> def setFire(self): """randomly distribute the fire spots""" <|body_1|> def fireProbability(self, state): """Input: - a state coo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FireMaze: def __init__(self, length, width, initialP, fire): """initialize the number of the fire spots""" Maze.__init__(self, length, width, initialP) self.fire = fire self.fireSpots = [] self.probabilityDistribution = {} for state in self.maze.keys(): ...
the_stack_v2_python_sparse
Introduction to Artificial Intelligence/Assignment/MazeRunner/maze.py
hello-roderickwang/CourseWork
train
3
edcb7ee2c2b5737fd3bc387079b573c5293a9f48
[ "if data is None:\n if n <= 0:\n raise ValueError('n must be a positive value')\n if p >= 1 or p <= 0:\n raise ValueError('p must be greater than 0 and less than 1')\n self.n = n\n self.p = p\nelse:\n if type(data) is not list:\n raise TypeError('data must be a list')\n if len...
<|body_start_0|> if data is None: if n <= 0: raise ValueError('n must be a positive value') if p >= 1 or p <= 0: raise ValueError('p must be greater than 0 and less than 1') self.n = n self.p = p else: if type(da...
binomial dist class
Binomial
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Binomial: """binomial dist class""" def __init__(self, data=None, n=1, p=0.5): """initialize constructor for binomial class""" <|body_0|> def pmf(self, k): """calculates PMF for a given number of successes Args: k (int):s the number of “successes” Returns: (float...
stack_v2_sparse_classes_36k_train_002636
1,977
no_license
[ { "docstring": "initialize constructor for binomial class", "name": "__init__", "signature": "def __init__(self, data=None, n=1, p=0.5)" }, { "docstring": "calculates PMF for a given number of successes Args: k (int):s the number of “successes” Returns: (float) the PMF value for k", "name": ...
3
null
Implement the Python class `Binomial` described below. Class description: binomial dist class Method signatures and docstrings: - def __init__(self, data=None, n=1, p=0.5): initialize constructor for binomial class - def pmf(self, k): calculates PMF for a given number of successes Args: k (int):s the number of “succe...
Implement the Python class `Binomial` described below. Class description: binomial dist class Method signatures and docstrings: - def __init__(self, data=None, n=1, p=0.5): initialize constructor for binomial class - def pmf(self, k): calculates PMF for a given number of successes Args: k (int):s the number of “succe...
2eb7965900fd018f4092d2fb1e2055d35ba4899e
<|skeleton|> class Binomial: """binomial dist class""" def __init__(self, data=None, n=1, p=0.5): """initialize constructor for binomial class""" <|body_0|> def pmf(self, k): """calculates PMF for a given number of successes Args: k (int):s the number of “successes” Returns: (float...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Binomial: """binomial dist class""" def __init__(self, data=None, n=1, p=0.5): """initialize constructor for binomial class""" if data is None: if n <= 0: raise ValueError('n must be a positive value') if p >= 1 or p <= 0: raise Valu...
the_stack_v2_python_sparse
math/0x03-probability/binomial.py
s0m35h1t/holbertonschool-machine_learning
train
0
6f3979926a7fcc962601e2867f7d6c01bc51fe5f
[ "i = 0\nfor user, msg in self._queue:\n if user == nick:\n return i\n i += 1\nreturn -1", "outfile = self.registryValue('dumpFile')\nwith open(outfile, 'w') as h:\n i = 1\n for nick, msg in self._queue:\n if msg is None:\n msg = '[no message]'\n h.write('% 2d\\t%s\\t%s\...
<|body_start_0|> i = 0 for user, msg in self._queue: if user == nick: return i i += 1 return -1 <|end_body_0|> <|body_start_1|> outfile = self.registryValue('dumpFile') with open(outfile, 'w') as h: i = 1 for nick, ...
A simple queue manager for meetings. You can add yourself to the queue by using the queue command, giving an optional notice that the bot can display when it's your turn. If you call the queue command again, you can change the saved notice. Doing so won't make you lose your queue position. In case you changed your mind...
Queue
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Queue: """A simple queue manager for meetings. You can add yourself to the queue by using the queue command, giving an optional notice that the bot can display when it's your turn. If you call the queue command again, you can change the saved notice. Doing so won't make you lose your queue positi...
stack_v2_sparse_classes_36k_train_002637
5,983
permissive
[ { "docstring": "Check if a given user is in the queue", "name": "_find_in_queue", "signature": "def _find_in_queue(self, nick)" }, { "docstring": "Dump the queue to a file", "name": "_dump_queue", "signature": "def _dump_queue(self)" }, { "docstring": "[<notice>] Queue up for say...
6
stack_v2_sparse_classes_30k_train_005424
Implement the Python class `Queue` described below. Class description: A simple queue manager for meetings. You can add yourself to the queue by using the queue command, giving an optional notice that the bot can display when it's your turn. If you call the queue command again, you can change the saved notice. Doing s...
Implement the Python class `Queue` described below. Class description: A simple queue manager for meetings. You can add yourself to the queue by using the queue command, giving an optional notice that the bot can display when it's your turn. If you call the queue command again, you can change the saved notice. Doing s...
656f42f8d6b3fe4544a5270e0dab816fd3603118
<|skeleton|> class Queue: """A simple queue manager for meetings. You can add yourself to the queue by using the queue command, giving an optional notice that the bot can display when it's your turn. If you call the queue command again, you can change the saved notice. Doing so won't make you lose your queue positi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Queue: """A simple queue manager for meetings. You can add yourself to the queue by using the queue command, giving an optional notice that the bot can display when it's your turn. If you call the queue command again, you can change the saved notice. Doing so won't make you lose your queue position. In case y...
the_stack_v2_python_sparse
plugins/Queue/plugin.py
kblin/supybot-gsoc
train
2
d0de5f960c50d72d8860ae9ba0b7270b3a707df1
[ "super(NFM, self).__init__()\nself.cate_fea_size = len(cate_fea_uniques)\nself.num_fea_size = num_fea_size\nself.emb_size = emb_size\nself.embed_layers = nn.ModuleList([nn.Embedding(voc_size, self.emb_size) for voc_size in cate_fea_uniques])\nself.all_dims = [self.emb_size + self.num_fea_size] + hidden_dims\nfor i ...
<|body_start_0|> super(NFM, self).__init__() self.cate_fea_size = len(cate_fea_uniques) self.num_fea_size = num_fea_size self.emb_size = emb_size self.embed_layers = nn.ModuleList([nn.Embedding(voc_size, self.emb_size) for voc_size in cate_fea_uniques]) self.all_dims = [s...
NFM
[ "Apache-2.0", "BSD-2-Clause", "MIT", "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-unknown-license-reference", "GPL-1.0-or-later" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NFM: def __init__(self, cate_fea_uniques, num_fea_size=0, emb_size=8, hidden_dims=[256, 128], dropout=[0.2, 0.2], num_classes=1): """:param cate_fea_uniques: :param num_fea_size: 数字特征 也就是连续特征 :param emb_size: embed_dim""" <|body_0|> def forward(self, X_sparse, X_dense=None):...
stack_v2_sparse_classes_36k_train_002638
4,551
permissive
[ { "docstring": ":param cate_fea_uniques: :param num_fea_size: 数字特征 也就是连续特征 :param emb_size: embed_dim", "name": "__init__", "signature": "def __init__(self, cate_fea_uniques, num_fea_size=0, emb_size=8, hidden_dims=[256, 128], dropout=[0.2, 0.2], num_classes=1)" }, { "docstring": "X_sparse: spar...
2
null
Implement the Python class `NFM` described below. Class description: Implement the NFM class. Method signatures and docstrings: - def __init__(self, cate_fea_uniques, num_fea_size=0, emb_size=8, hidden_dims=[256, 128], dropout=[0.2, 0.2], num_classes=1): :param cate_fea_uniques: :param num_fea_size: 数字特征 也就是连续特征 :par...
Implement the Python class `NFM` described below. Class description: Implement the NFM class. Method signatures and docstrings: - def __init__(self, cate_fea_uniques, num_fea_size=0, emb_size=8, hidden_dims=[256, 128], dropout=[0.2, 0.2], num_classes=1): :param cate_fea_uniques: :param num_fea_size: 数字特征 也就是连续特征 :par...
92acc188d3a0f634de58463b6676e70df83ef808
<|skeleton|> class NFM: def __init__(self, cate_fea_uniques, num_fea_size=0, emb_size=8, hidden_dims=[256, 128], dropout=[0.2, 0.2], num_classes=1): """:param cate_fea_uniques: :param num_fea_size: 数字特征 也就是连续特征 :param emb_size: embed_dim""" <|body_0|> def forward(self, X_sparse, X_dense=None):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NFM: def __init__(self, cate_fea_uniques, num_fea_size=0, emb_size=8, hidden_dims=[256, 128], dropout=[0.2, 0.2], num_classes=1): """:param cate_fea_uniques: :param num_fea_size: 数字特征 也就是连续特征 :param emb_size: embed_dim""" super(NFM, self).__init__() self.cate_fea_size = len(cate_fea_un...
the_stack_v2_python_sparse
PyTorch/dev/others/Widedeep_ID2866_for_PyTorch/NFM/model.py
Ascend/ModelZoo-PyTorch
train
23
63f69511a39807cdf3e749c84e04b5daffbee5a6
[ "@lru_cache(None)\ndef _rec(i, sign):\n if i == 0:\n return [nums[i]]\n max_arr = []\n for j in range(i - 1, -1, -1):\n if j + 2 <= len(max_arr):\n break\n arr = _rec(j, -sign)\n if sign * (nums[i] - arr[-1]) > 0:\n arr = arr + [nums[i]]\n else:\n ...
<|body_start_0|> @lru_cache(None) def _rec(i, sign): if i == 0: return [nums[i]] max_arr = [] for j in range(i - 1, -1, -1): if j + 2 <= len(max_arr): break arr = _rec(j, -sign) if sig...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def wiggleMaxLength(self, nums: List[int]) -> int: """04/12/2020 19:20""" <|body_0|> def wiggleMaxLength(self, nums: List[int]) -> int: """04/12/2020 20:18""" <|body_1|> def wiggleMaxLength(self, nums: List[int]) -> int: """07/24/2022 1...
stack_v2_sparse_classes_36k_train_002639
3,929
no_license
[ { "docstring": "04/12/2020 19:20", "name": "wiggleMaxLength", "signature": "def wiggleMaxLength(self, nums: List[int]) -> int" }, { "docstring": "04/12/2020 20:18", "name": "wiggleMaxLength", "signature": "def wiggleMaxLength(self, nums: List[int]) -> int" }, { "docstring": "07/2...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wiggleMaxLength(self, nums: List[int]) -> int: 04/12/2020 19:20 - def wiggleMaxLength(self, nums: List[int]) -> int: 04/12/2020 20:18 - def wiggleMaxLength(self, nums: List[i...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wiggleMaxLength(self, nums: List[int]) -> int: 04/12/2020 19:20 - def wiggleMaxLength(self, nums: List[int]) -> int: 04/12/2020 20:18 - def wiggleMaxLength(self, nums: List[i...
1389a009a02e90e8700a7a00e0b7f797c129cdf4
<|skeleton|> class Solution: def wiggleMaxLength(self, nums: List[int]) -> int: """04/12/2020 19:20""" <|body_0|> def wiggleMaxLength(self, nums: List[int]) -> int: """04/12/2020 20:18""" <|body_1|> def wiggleMaxLength(self, nums: List[int]) -> int: """07/24/2022 1...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def wiggleMaxLength(self, nums: List[int]) -> int: """04/12/2020 19:20""" @lru_cache(None) def _rec(i, sign): if i == 0: return [nums[i]] max_arr = [] for j in range(i - 1, -1, -1): if j + 2 <= len(max_arr): ...
the_stack_v2_python_sparse
leetcode/solved/376_Wiggle_Subsequence/solution.py
sungminoh/algorithms
train
0
663fe62f82d8b7b2433a3e65f432f1b76483a40a
[ "if len(args_translators) < 2:\n return None\nret = []\nbase_args_t = args_translators[0]\nfor arg_name, arg_val in base_args_t.actual_args.items():\n for args_t in args_translators[1:]:\n val = args_t.actual_args.get(arg_name)\n if val is None:\n raise ValueError('Unable to find the ...
<|body_start_0|> if len(args_translators) < 2: return None ret = [] base_args_t = args_translators[0] for arg_name, arg_val in base_args_t.actual_args.items(): for args_t in args_translators[1:]: val = args_t.actual_args.get(arg_name) ...
Define operations related to ArgsTranslation instances.
ArgsTranslationHelper
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause", "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ArgsTranslationHelper: """Define operations related to ArgsTranslation instances.""" def find_formal_args_in_modules(args_translators): """Find formal args among multiple args translators. Args: args_translators(list[ArgsTranslation]): a list of args translator to be checked. Returns...
stack_v2_sparse_classes_36k_train_002640
9,892
permissive
[ { "docstring": "Find formal args among multiple args translators. Args: args_translators(list[ArgsTranslation]): a list of args translator to be checked. Returns: list, name of args to be formal.", "name": "find_formal_args_in_modules", "signature": "def find_formal_args_in_modules(args_translators)" ...
2
stack_v2_sparse_classes_30k_train_012326
Implement the Python class `ArgsTranslationHelper` described below. Class description: Define operations related to ArgsTranslation instances. Method signatures and docstrings: - def find_formal_args_in_modules(args_translators): Find formal args among multiple args translators. Args: args_translators(list[ArgsTransl...
Implement the Python class `ArgsTranslationHelper` described below. Class description: Define operations related to ArgsTranslation instances. Method signatures and docstrings: - def find_formal_args_in_modules(args_translators): Find formal args among multiple args translators. Args: args_translators(list[ArgsTransl...
db5769eb80cbd13a2a9af7682c11f5667d8bf141
<|skeleton|> class ArgsTranslationHelper: """Define operations related to ArgsTranslation instances.""" def find_formal_args_in_modules(args_translators): """Find formal args among multiple args translators. Args: args_translators(list[ArgsTranslation]): a list of args translator to be checked. Returns...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ArgsTranslationHelper: """Define operations related to ArgsTranslation instances.""" def find_formal_args_in_modules(args_translators): """Find formal args among multiple args translators. Args: args_translators(list[ArgsTranslation]): a list of args translator to be checked. Returns: list, name ...
the_stack_v2_python_sparse
mindinsight/mindconverter/graph_based_converter/generator/args_translator.py
fapbatista/mindinsight
train
0
1140f76c2b095e5c0a953fabea8160566e617335
[ "if queryset is None:\n queryset = self.get_queryset()\npk = self.kwargs.get('pk', None)\nslug = self.kwargs.get('slug', None)\ntry:\n if pk is not None:\n return queryset.get(pk=self.kwargs['pk'])\n elif slug is not None:\n slug_field = self.get_slug_field()\n return queryset.get(**{s...
<|body_start_0|> if queryset is None: queryset = self.get_queryset() pk = self.kwargs.get('pk', None) slug = self.kwargs.get('slug', None) try: if pk is not None: return queryset.get(pk=self.kwargs['pk']) elif slug is not None: ...
SingleObjectMixin
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SingleObjectMixin: def get_object(self, queryset=None): """Returns the object the view is displaying. By default this requires `self.queryset` and a `pk` or `slug` argument in the URLconf, but subclasses can override this to return any object.""" <|body_0|> def get_queryset(...
stack_v2_sparse_classes_36k_train_002641
2,256
permissive
[ { "docstring": "Returns the object the view is displaying. By default this requires `self.queryset` and a `pk` or `slug` argument in the URLconf, but subclasses can override this to return any object.", "name": "get_object", "signature": "def get_object(self, queryset=None)" }, { "docstring": "G...
2
stack_v2_sparse_classes_30k_train_006665
Implement the Python class `SingleObjectMixin` described below. Class description: Implement the SingleObjectMixin class. Method signatures and docstrings: - def get_object(self, queryset=None): Returns the object the view is displaying. By default this requires `self.queryset` and a `pk` or `slug` argument in the UR...
Implement the Python class `SingleObjectMixin` described below. Class description: Implement the SingleObjectMixin class. Method signatures and docstrings: - def get_object(self, queryset=None): Returns the object the view is displaying. By default this requires `self.queryset` and a `pk` or `slug` argument in the UR...
406734280ca6b55f66b73b3b4ec5e97ba58f045d
<|skeleton|> class SingleObjectMixin: def get_object(self, queryset=None): """Returns the object the view is displaying. By default this requires `self.queryset` and a `pk` or `slug` argument in the URLconf, but subclasses can override this to return any object.""" <|body_0|> def get_queryset(...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SingleObjectMixin: def get_object(self, queryset=None): """Returns the object the view is displaying. By default this requires `self.queryset` and a `pk` or `slug` argument in the URLconf, but subclasses can override this to return any object.""" if queryset is None: queryset = sel...
the_stack_v2_python_sparse
dockit/views/detail.py
cuker/django-dockit
train
0
2e98cccd2886e0945089a80f0c302bc3e6a7fbaa
[ "self.mins_to_checkpoint = 0.05\nself.timer_checkpoint = -1\nself.debug = debug\nitem_structure = {'start_time': float, 'end_time': float, 'frequency': int, 'targets': list}\nself.context_tracker = managers['tracking'].init_tracker('context', item_structure)\nself.current_context = self.context_tracker.new_item([0,...
<|body_start_0|> self.mins_to_checkpoint = 0.05 self.timer_checkpoint = -1 self.debug = debug item_structure = {'start_time': float, 'end_time': float, 'frequency': int, 'targets': list} self.context_tracker = managers['tracking'].init_tracker('context', item_structure) s...
A manager for Aria's context tracking system. Only one ContextManager should be active at a time.
ContextManager
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ContextManager: """A manager for Aria's context tracking system. Only one ContextManager should be active at a time.""" def __init__(self, managers, debug=False): """Constructs a ContextManager object. Parameters: managers : [Manager] - A list of references to all manager objects. de...
stack_v2_sparse_classes_36k_train_002642
23,341
permissive
[ { "docstring": "Constructs a ContextManager object. Parameters: managers : [Manager] - A list of references to all manager objects. debug : boolean - Optional setting to enable verbose feedback.", "name": "__init__", "signature": "def __init__(self, managers, debug=False)" }, { "docstring": "Upd...
5
stack_v2_sparse_classes_30k_train_013587
Implement the Python class `ContextManager` described below. Class description: A manager for Aria's context tracking system. Only one ContextManager should be active at a time. Method signatures and docstrings: - def __init__(self, managers, debug=False): Constructs a ContextManager object. Parameters: managers : [M...
Implement the Python class `ContextManager` described below. Class description: A manager for Aria's context tracking system. Only one ContextManager should be active at a time. Method signatures and docstrings: - def __init__(self, managers, debug=False): Constructs a ContextManager object. Parameters: managers : [M...
aff4c3a69f24026974bc6f944bb769a30f31e405
<|skeleton|> class ContextManager: """A manager for Aria's context tracking system. Only one ContextManager should be active at a time.""" def __init__(self, managers, debug=False): """Constructs a ContextManager object. Parameters: managers : [Manager] - A list of references to all manager objects. de...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ContextManager: """A manager for Aria's context tracking system. Only one ContextManager should be active at a time.""" def __init__(self, managers, debug=False): """Constructs a ContextManager object. Parameters: managers : [Manager] - A list of references to all manager objects. debug : boolean...
the_stack_v2_python_sparse
Managers.py
SKaplanOfficial/Aria
train
2
8ca541803db3cc0f2be5551f1758cbbea8bb5c20
[ "self.movie = movie\nself.creator = creator\nself.__dict__.update(kwargs)", "stream = {'href': url_for('streamdetailview', stream_id=self.id, _external=True), 'name': self.name, 'published': self.public, 'description': self.description, 'author': {'username': self.creator.username, 'href': url_for('userdetailview...
<|body_start_0|> self.movie = movie self.creator = creator self.__dict__.update(kwargs) <|end_body_0|> <|body_start_1|> stream = {'href': url_for('streamdetailview', stream_id=self.id, _external=True), 'name': self.name, 'published': self.public, 'description': self.description, 'author...
A collection of related, timecoded entries that accompanies a movie. Entries in a stream will usually have some common theme, like annoucing new actors that enter the screen, or providing references for topics mentioned in a movie.
Stream
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Stream: """A collection of related, timecoded entries that accompanies a movie. Entries in a stream will usually have some common theme, like annoucing new actors that enter the screen, or providing references for topics mentioned in a movie.""" def __init__(self, movie=None, creator=None, *...
stack_v2_sparse_classes_36k_train_002643
15,064
permissive
[ { "docstring": "Create new stream. :param movie: The movie this stream should be associated to. :param creator: The user that created the stream. :param kwargs: Set object properties from constructor.", "name": "__init__", "signature": "def __init__(self, movie=None, creator=None, **kwargs)" }, { ...
2
stack_v2_sparse_classes_30k_train_002861
Implement the Python class `Stream` described below. Class description: A collection of related, timecoded entries that accompanies a movie. Entries in a stream will usually have some common theme, like annoucing new actors that enter the screen, or providing references for topics mentioned in a movie. Method signatu...
Implement the Python class `Stream` described below. Class description: A collection of related, timecoded entries that accompanies a movie. Entries in a stream will usually have some common theme, like annoucing new actors that enter the screen, or providing references for topics mentioned in a movie. Method signatu...
7a44abd88283ac5d145137a87f3d87f42e449032
<|skeleton|> class Stream: """A collection of related, timecoded entries that accompanies a movie. Entries in a stream will usually have some common theme, like annoucing new actors that enter the screen, or providing references for topics mentioned in a movie.""" def __init__(self, movie=None, creator=None, *...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Stream: """A collection of related, timecoded entries that accompanies a movie. Entries in a stream will usually have some common theme, like annoucing new actors that enter the screen, or providing references for topics mentioned in a movie.""" def __init__(self, movie=None, creator=None, **kwargs): ...
the_stack_v2_python_sparse
marvin/models.py
streamr/marvin
train
0
9b3641d6d88aeee24e7ca0539d59f916e5a8c513
[ "major, count = (0, 0)\nfor n in nums:\n if count == 0:\n count += 1\n major = n\n elif major == n:\n count += 1\n else:\n count -= 1\nreturn major", "d = {}\nlength = len(nums)\nfor n in nums:\n d[n] = d.get(n, 0) + 1\n if d[n] > length // 2:\n return n", "coun...
<|body_start_0|> major, count = (0, 0) for n in nums: if count == 0: count += 1 major = n elif major == n: count += 1 else: count -= 1 return major <|end_body_0|> <|body_start_1|> d = {} ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def majorityElement(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def majorityElement1(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def majorityElement_II(self, nums): """:type nums: List[int] :rtype...
stack_v2_sparse_classes_36k_train_002644
1,805
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "majorityElement", "signature": "def majorityElement(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "majorityElement1", "signature": "def majorityElement1(self, nums)" }, { "docstring": ":typ...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def majorityElement(self, nums): :type nums: List[int] :rtype: int - def majorityElement1(self, nums): :type nums: List[int] :rtype: int - def majorityElement_II(self, nums): :ty...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def majorityElement(self, nums): :type nums: List[int] :rtype: int - def majorityElement1(self, nums): :type nums: List[int] :rtype: int - def majorityElement_II(self, nums): :ty...
f234bd7b62cb7bc2150faa764bf05a9095e19192
<|skeleton|> class Solution: def majorityElement(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def majorityElement1(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> def majorityElement_II(self, nums): """:type nums: List[int] :rtype...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def majorityElement(self, nums): """:type nums: List[int] :rtype: int""" major, count = (0, 0) for n in nums: if count == 0: count += 1 major = n elif major == n: count += 1 else: ...
the_stack_v2_python_sparse
alg/majority_element.py
nyannko/leetcode-python
train
0
ff8a5b4bdc35b434c17814a02ed456594c7c3a01
[ "if not root or not root.left:\n return root\nl_root = self.upsideDownBinaryTree(root.left)\nr_most = l_root\nwhile r_most.right:\n r_most = r_most.right\nroot = l_root\nr_most.left = root.right\nr_most.right = TreeNode(root.val)\nreturn root", "if not root or not root.left:\n return root\nparent = None\...
<|body_start_0|> if not root or not root.left: return root l_root = self.upsideDownBinaryTree(root.left) r_most = l_root while r_most.right: r_most = r_most.right root = l_root r_most.left = root.right r_most.right = TreeNode(root.val) ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def upsideDownBinaryTree(self, root): """:type root: TreeNode :rtype: TreeNode beats 24.21%""" <|body_0|> def upsideDownBinaryTree1(self, root): """:param root: :return: beats 55.79%""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not r...
stack_v2_sparse_classes_36k_train_002645
1,159
no_license
[ { "docstring": ":type root: TreeNode :rtype: TreeNode beats 24.21%", "name": "upsideDownBinaryTree", "signature": "def upsideDownBinaryTree(self, root)" }, { "docstring": ":param root: :return: beats 55.79%", "name": "upsideDownBinaryTree1", "signature": "def upsideDownBinaryTree1(self, ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def upsideDownBinaryTree(self, root): :type root: TreeNode :rtype: TreeNode beats 24.21% - def upsideDownBinaryTree1(self, root): :param root: :return: beats 55.79%
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def upsideDownBinaryTree(self, root): :type root: TreeNode :rtype: TreeNode beats 24.21% - def upsideDownBinaryTree1(self, root): :param root: :return: beats 55.79% <|skeleton|>...
7e0e917c15d3e35f49da3a00ef395bd5ff180d79
<|skeleton|> class Solution: def upsideDownBinaryTree(self, root): """:type root: TreeNode :rtype: TreeNode beats 24.21%""" <|body_0|> def upsideDownBinaryTree1(self, root): """:param root: :return: beats 55.79%""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def upsideDownBinaryTree(self, root): """:type root: TreeNode :rtype: TreeNode beats 24.21%""" if not root or not root.left: return root l_root = self.upsideDownBinaryTree(root.left) r_most = l_root while r_most.right: r_most = r_most.r...
the_stack_v2_python_sparse
LeetCode/156_binary_tree_upside_down.py
yao23/Machine_Learning_Playground
train
12
fc63e69a02c228ba2121691b51d8be44b8102992
[ "EventHandler.__init__(self)\nself._win = win\nself._button = Rectangle(120, 100, (100, 630))\nself._button.setFillColor('lavender')\nself._text = Text('Done with Turn!', (100, 630), 16)\nself._button.addHandler(self)\nself._block = Rectangle(210, 30, (340, 645))\nself._block.setDepth(1)\nself._block.setFillColor('...
<|body_start_0|> EventHandler.__init__(self) self._win = win self._button = Rectangle(120, 100, (100, 630)) self._button.setFillColor('lavender') self._text = Text('Done with Turn!', (100, 630), 16) self._button.addHandler(self) self._block = Rectangle(210, 30, (3...
A class that is used to create a done button that will switch players' turns
Done
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Done: """A class that is used to create a done button that will switch players' turns""" def __init__(self, win): """Creates the parts of the button and the rectangular block""" <|body_0|> def addTo(self, win): """Adds the button and block to the window""" ...
stack_v2_sparse_classes_36k_train_002646
23,085
no_license
[ { "docstring": "Creates the parts of the button and the rectangular block", "name": "__init__", "signature": "def __init__(self, win)" }, { "docstring": "Adds the button and block to the window", "name": "addTo", "signature": "def addTo(self, win)" }, { "docstring": "Changes the ...
3
null
Implement the Python class `Done` described below. Class description: A class that is used to create a done button that will switch players' turns Method signatures and docstrings: - def __init__(self, win): Creates the parts of the button and the rectangular block - def addTo(self, win): Adds the button and block to...
Implement the Python class `Done` described below. Class description: A class that is used to create a done button that will switch players' turns Method signatures and docstrings: - def __init__(self, win): Creates the parts of the button and the rectangular block - def addTo(self, win): Adds the button and block to...
e5d96a65fc84481b85072cfb55dea9a0666634b5
<|skeleton|> class Done: """A class that is used to create a done button that will switch players' turns""" def __init__(self, win): """Creates the parts of the button and the rectangular block""" <|body_0|> def addTo(self, win): """Adds the button and block to the window""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Done: """A class that is used to create a done button that will switch players' turns""" def __init__(self, win): """Creates the parts of the button and the rectangular block""" EventHandler.__init__(self) self._win = win self._button = Rectangle(120, 100, (100, 630)) ...
the_stack_v2_python_sparse
Games-2017/21/Game.py
paulmagnus/CSPy
train
0
eff864014e5328433d897d836c0bbd3de8948fca
[ "self._top = Toplevel()\nself._top.focus_set()\nself._top.grab_set()\nself._reason = reason_window\nself._a = a\nself._b = b\nself._make_widgets(n)", "self._all_input = []\nfor i in range(n):\n tmp_frame = Frame(self._top)\n Label(tmp_frame, text='x{}:'.format(i), font=('arial', '16', 'bold')).pack(side=LEF...
<|body_start_0|> self._top = Toplevel() self._top.focus_set() self._top.grab_set() self._reason = reason_window self._a = a self._b = b self._make_widgets(n) <|end_body_0|> <|body_start_1|> self._all_input = [] for i in range(n): tmp_f...
Діалогове вікно, в якому необхідно ввести n координат вектора.
Dialog
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Dialog: """Діалогове вікно, в якому необхідно ввести n координат вектора.""" def __init__(self, n: int, a: float, b: float, reason_window): """Ініціалізація :param n: к-ть компонент вектора :param a: ліва межа відрізку :param b: права межа відрізку :param reason_window: вікно, яке сп...
stack_v2_sparse_classes_36k_train_002647
5,760
no_license
[ { "docstring": "Ініціалізація :param n: к-ть компонент вектора :param a: ліва межа відрізку :param b: права межа відрізку :param reason_window: вікно, яке спричинило даний екземпляр класу", "name": "__init__", "signature": "def __init__(self, n: int, a: float, b: float, reason_window)" }, { "doc...
3
stack_v2_sparse_classes_30k_train_021060
Implement the Python class `Dialog` described below. Class description: Діалогове вікно, в якому необхідно ввести n координат вектора. Method signatures and docstrings: - def __init__(self, n: int, a: float, b: float, reason_window): Ініціалізація :param n: к-ть компонент вектора :param a: ліва межа відрізку :param b...
Implement the Python class `Dialog` described below. Class description: Діалогове вікно, в якому необхідно ввести n координат вектора. Method signatures and docstrings: - def __init__(self, n: int, a: float, b: float, reason_window): Ініціалізація :param n: к-ть компонент вектора :param a: ліва межа відрізку :param b...
e44bf2b535b34bc31fb323c20901a77b0b3072f2
<|skeleton|> class Dialog: """Діалогове вікно, в якому необхідно ввести n координат вектора.""" def __init__(self, n: int, a: float, b: float, reason_window): """Ініціалізація :param n: к-ть компонент вектора :param a: ліва межа відрізку :param b: права межа відрізку :param reason_window: вікно, яке сп...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Dialog: """Діалогове вікно, в якому необхідно ввести n координат вектора.""" def __init__(self, n: int, a: float, b: float, reason_window): """Ініціалізація :param n: к-ть компонент вектора :param a: ліва межа відрізку :param b: права межа відрізку :param reason_window: вікно, яке спричинило дани...
the_stack_v2_python_sparse
dz_others/subject24_gui/t24_22/t24_7.py
davendiy/ads_course2
train
0
1dba2fc0eedf3346a22d55a8da465066eecdfa0f
[ "if n <= 1:\n return 1\nugly = []\nfactor = {}\nfor _ in primes:\n factor[_] = 0\nugly.append(1)\nfor i in xrange(1, n):\n ugly.append(sys.maxint)\n for p in factor:\n ugly[i] = min(ugly[i], ugly[factor[p]] * p)\n for p in factor:\n if ugly[i] == ugly[factor[p]] * p:\n factor...
<|body_start_0|> if n <= 1: return 1 ugly = [] factor = {} for _ in primes: factor[_] = 0 ugly.append(1) for i in xrange(1, n): ugly.append(sys.maxint) for p in factor: ugly[i] = min(ugly[i], ugly[factor[p]] ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def nthSuperUglyNumber(self, n, primes): """:type n: int :type primes: List[int] :rtype: int""" <|body_0|> def nthSuperUglyNumber_heapq_TLE(self, n, primes): """:type n: int :type primes: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body...
stack_v2_sparse_classes_36k_train_002648
2,165
no_license
[ { "docstring": ":type n: int :type primes: List[int] :rtype: int", "name": "nthSuperUglyNumber", "signature": "def nthSuperUglyNumber(self, n, primes)" }, { "docstring": ":type n: int :type primes: List[int] :rtype: int", "name": "nthSuperUglyNumber_heapq_TLE", "signature": "def nthSuper...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def nthSuperUglyNumber(self, n, primes): :type n: int :type primes: List[int] :rtype: int - def nthSuperUglyNumber_heapq_TLE(self, n, primes): :type n: int :type primes: List[int...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def nthSuperUglyNumber(self, n, primes): :type n: int :type primes: List[int] :rtype: int - def nthSuperUglyNumber_heapq_TLE(self, n, primes): :type n: int :type primes: List[int...
2d5fa4cd696d5035ea8859befeadc5cc436959c9
<|skeleton|> class Solution: def nthSuperUglyNumber(self, n, primes): """:type n: int :type primes: List[int] :rtype: int""" <|body_0|> def nthSuperUglyNumber_heapq_TLE(self, n, primes): """:type n: int :type primes: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def nthSuperUglyNumber(self, n, primes): """:type n: int :type primes: List[int] :rtype: int""" if n <= 1: return 1 ugly = [] factor = {} for _ in primes: factor[_] = 0 ugly.append(1) for i in xrange(1, n): u...
the_stack_v2_python_sparse
SourceCode/Python/Problem/00313.Super Ugly Number.py
roger6blog/LeetCode
train
0
19d886d1ddfa8484f38c9a367e8b349cc80fd200
[ "parts = shlex.split(args)\nsearch = self._search_terms(parts, user_default_filter=False)\nheaders = ['id', 'hostname', 'ip', 'max_vms', 'running_vms']\nvalues = []\nfor slave in self._talus_client.slave_iter(**search):\n values.append([slave.id, slave.hostname, slave.ip, slave.max_vms, slave.running_vms])\nprin...
<|body_start_0|> parts = shlex.split(args) search = self._search_terms(parts, user_default_filter=False) headers = ['id', 'hostname', 'ip', 'max_vms', 'running_vms'] values = [] for slave in self._talus_client.slave_iter(**search): values.append([slave.id, slave.hostn...
The Talus slave command processor
SlaveCmd
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SlaveCmd: """The Talus slave command processor""" def do_list(self, args): """List existing slaves connected to Talus. slave list""" <|body_0|> def do_info(self, args): """List information about a slave talus slave info ID_OR_HOSTNAME_OR_IP""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_002649
2,389
permissive
[ { "docstring": "List existing slaves connected to Talus. slave list", "name": "do_list", "signature": "def do_list(self, args)" }, { "docstring": "List information about a slave talus slave info ID_OR_HOSTNAME_OR_IP", "name": "do_info", "signature": "def do_info(self, args)" } ]
2
stack_v2_sparse_classes_30k_train_015984
Implement the Python class `SlaveCmd` described below. Class description: The Talus slave command processor Method signatures and docstrings: - def do_list(self, args): List existing slaves connected to Talus. slave list - def do_info(self, args): List information about a slave talus slave info ID_OR_HOSTNAME_OR_IP
Implement the Python class `SlaveCmd` described below. Class description: The Talus slave command processor Method signatures and docstrings: - def do_list(self, args): List existing slaves connected to Talus. slave list - def do_info(self, args): List information about a slave talus slave info ID_OR_HOSTNAME_OR_IP ...
0168e92e7b4a872270f3c246960d0664f1e43eb2
<|skeleton|> class SlaveCmd: """The Talus slave command processor""" def do_list(self, args): """List existing slaves connected to Talus. slave list""" <|body_0|> def do_info(self, args): """List information about a slave talus slave info ID_OR_HOSTNAME_OR_IP""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SlaveCmd: """The Talus slave command processor""" def do_list(self, args): """List existing slaves connected to Talus. slave list""" parts = shlex.split(args) search = self._search_terms(parts, user_default_filter=False) headers = ['id', 'hostname', 'ip', 'max_vms', 'runni...
the_stack_v2_python_sparse
talus_client/cmds/slaves.py
d0c-s4vage/talus_client
train
4
c96c3895a12e4cc80fc65eb4603d2df319cb9b3f
[ "startTime = datetime.datetime.now()\nclient = dml.pymongo.MongoClient()\nrepo = client.repo\nrepo.authenticate('jgrishey', 'jgrishey')\nurl = 'http://datamechanics.io/data/hospitalsgeo.json'\ndata = urllib.request.urlopen(url).read().decode('utf-8')\nresponse = json.loads(data)\nhospitals = []\nID = 0\nfor hospita...
<|body_start_0|> startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('jgrishey', 'jgrishey') url = 'http://datamechanics.io/data/hospitalsgeo.json' data = urllib.request.urlopen(url).read().decode('utf-8') re...
getHospitals
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class getHospitals: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everything ...
stack_v2_sparse_classes_36k_train_002650
3,600
no_license
[ { "docstring": "Retrieve some data sets (not using the API here for the sake of simplicity).", "name": "execute", "signature": "def execute(trial=False)" }, { "docstring": "Create the provenance document describing everything happening in this script. Each run of the script will generate a new d...
2
stack_v2_sparse_classes_30k_train_014319
Implement the Python class `getHospitals` described below. Class description: Implement the getHospitals class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=None, end...
Implement the Python class `getHospitals` described below. Class description: Implement the getHospitals class. Method signatures and docstrings: - def execute(trial=False): Retrieve some data sets (not using the API here for the sake of simplicity). - def provenance(doc=prov.model.ProvDocument(), startTime=None, end...
0df485d0469c5451ebdcd684bed2a0960ba3ab84
<|skeleton|> class getHospitals: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" <|body_0|> def provenance(doc=prov.model.ProvDocument(), startTime=None, endTime=None): """Create the provenance document describing everything ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class getHospitals: def execute(trial=False): """Retrieve some data sets (not using the API here for the sake of simplicity).""" startTime = datetime.datetime.now() client = dml.pymongo.MongoClient() repo = client.repo repo.authenticate('jgrishey', 'jgrishey') url = '...
the_stack_v2_python_sparse
jgrishey/getHospitals.py
lingyigu/course-2017-spr-proj
train
0
9a33814ae5deb069859d26d54dc75e9e56c3dacf
[ "params = request.body\njsonParams = json.loads(params)\nuser = User_Info.objects.get(email__exact=jsonParams.get('email'))\nrecord = EmailVerifyRecord.objects.filter(code__exact=jsonParams.get('r_code'))\nif not record.exists():\n return JsonResponse({'status': False, 'err': '重置失败'}, status=404)\nrecord.code_st...
<|body_start_0|> params = request.body jsonParams = json.loads(params) user = User_Info.objects.get(email__exact=jsonParams.get('email')) record = EmailVerifyRecord.objects.filter(code__exact=jsonParams.get('r_code')) if not record.exists(): return JsonResponse({'stat...
ResetView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResetView: def post(self, request): """忘记密码后重置密码 :param request: :return:""" <|body_0|> def get(self, request, r_code): """检查重置密码验证码正确性 :param request: :param r_code: :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> params = request.body ...
stack_v2_sparse_classes_36k_train_002651
2,218
no_license
[ { "docstring": "忘记密码后重置密码 :param request: :return:", "name": "post", "signature": "def post(self, request)" }, { "docstring": "检查重置密码验证码正确性 :param request: :param r_code: :return:", "name": "get", "signature": "def get(self, request, r_code)" } ]
2
stack_v2_sparse_classes_30k_train_016019
Implement the Python class `ResetView` described below. Class description: Implement the ResetView class. Method signatures and docstrings: - def post(self, request): 忘记密码后重置密码 :param request: :return: - def get(self, request, r_code): 检查重置密码验证码正确性 :param request: :param r_code: :return:
Implement the Python class `ResetView` described below. Class description: Implement the ResetView class. Method signatures and docstrings: - def post(self, request): 忘记密码后重置密码 :param request: :return: - def get(self, request, r_code): 检查重置密码验证码正确性 :param request: :param r_code: :return: <|skeleton|> class ResetView...
526dea540048fc92260bce611c520c50af744e0b
<|skeleton|> class ResetView: def post(self, request): """忘记密码后重置密码 :param request: :return:""" <|body_0|> def get(self, request, r_code): """检查重置密码验证码正确性 :param request: :param r_code: :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResetView: def post(self, request): """忘记密码后重置密码 :param request: :return:""" params = request.body jsonParams = json.loads(params) user = User_Info.objects.get(email__exact=jsonParams.get('email')) record = EmailVerifyRecord.objects.filter(code__exact=jsonParams.get('r_...
the_stack_v2_python_sparse
apps/account/views/userInfo/reset_password.py
DICKQI/ALGYunXS
train
0
a9c81744cc487fd9de4159c139d6aa6e01b28b52
[ "self._orders = orders\nself._traded = []\nself._max_heap = MaxHeapPriorityQueue()\nself._min_heap = HeapPriorityQueue()\nself._construct_heaps()", "for movement, price, quantity in self._orders:\n if movement == 'buy':\n self._max_heap.add(price, quantity)\n elif movement == 'sell':\n self._m...
<|body_start_0|> self._orders = orders self._traded = [] self._max_heap = MaxHeapPriorityQueue() self._min_heap = HeapPriorityQueue() self._construct_heaps() <|end_body_0|> <|body_start_1|> for movement, price, quantity in self._orders: if movement == 'buy': ...
OnlineStockTrade
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OnlineStockTrade: def __init__(self, orders): """Construct two heaps from orders. NOTE: the quantiry of all orders are the same for now.""" <|body_0|> def _construct_heaps(self): """construct the max-oriented heap for buying order and the min-oriented heap for sellin...
stack_v2_sparse_classes_36k_train_002652
2,295
no_license
[ { "docstring": "Construct two heaps from orders. NOTE: the quantiry of all orders are the same for now.", "name": "__init__", "signature": "def __init__(self, orders)" }, { "docstring": "construct the max-oriented heap for buying order and the min-oriented heap for selling order.", "name": "...
3
stack_v2_sparse_classes_30k_train_014653
Implement the Python class `OnlineStockTrade` described below. Class description: Implement the OnlineStockTrade class. Method signatures and docstrings: - def __init__(self, orders): Construct two heaps from orders. NOTE: the quantiry of all orders are the same for now. - def _construct_heaps(self): construct the ma...
Implement the Python class `OnlineStockTrade` described below. Class description: Implement the OnlineStockTrade class. Method signatures and docstrings: - def __init__(self, orders): Construct two heaps from orders. NOTE: the quantiry of all orders are the same for now. - def _construct_heaps(self): construct the ma...
70b23ead7a89e46a84d9d914e7c8fa678edd1f90
<|skeleton|> class OnlineStockTrade: def __init__(self, orders): """Construct two heaps from orders. NOTE: the quantiry of all orders are the same for now.""" <|body_0|> def _construct_heaps(self): """construct the max-oriented heap for buying order and the min-oriented heap for sellin...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OnlineStockTrade: def __init__(self, orders): """Construct two heaps from orders. NOTE: the quantiry of all orders are the same for now.""" self._orders = orders self._traded = [] self._max_heap = MaxHeapPriorityQueue() self._min_heap = HeapPriorityQueue() self....
the_stack_v2_python_sparse
priority_queue_ch09/projects/online_stock_trade_p9_55.py
wanyikang/dsap
train
1
b515fc2c779e886541ef78cb5230f62679e8e254
[ "super().__init__()\nself.local_coordinate_system: LocalCoordinateSystem = local_coordinate_system\nself.length: float = float(length)\nself.aperture_radius = float(aperture_radius)\nself.magnetic_field = float(magnetic_field)\nself.magnetic_field_vector: P3 = self.local_coordinate_system.YI * self.magnetic_field",...
<|body_start_0|> super().__init__() self.local_coordinate_system: LocalCoordinateSystem = local_coordinate_system self.length: float = float(length) self.aperture_radius = float(aperture_radius) self.magnetic_field = float(magnetic_field) self.magnetic_field_vector: P3 = ...
局部圆柱区域产生均匀磁场的磁铁,可以看作一个直线二极磁铁 local_coordinate_system 局部坐标系 局部坐标系的原点即二极磁铁的起点 局部坐标系的 z 方向即二极磁铁延申方向 局部坐标系的 y 方向即磁场方向 length 磁铁长度 aperture_radius 磁铁孔径,磁铁外部磁场为零 magnetic_field 磁场大小,标量。磁场方向由 local_coordinate_system 确定
LocalUniformMagnet
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LocalUniformMagnet: """局部圆柱区域产生均匀磁场的磁铁,可以看作一个直线二极磁铁 local_coordinate_system 局部坐标系 局部坐标系的原点即二极磁铁的起点 局部坐标系的 z 方向即二极磁铁延申方向 局部坐标系的 y 方向即磁场方向 length 磁铁长度 aperture_radius 磁铁孔径,磁铁外部磁场为零 magnetic_field 磁场大小,标量。磁场方向由 local_coordinate_system 确定""" def __init__(self, local_coordinate_system: LocalCoord...
stack_v2_sparse_classes_36k_train_002653
28,633
permissive
[ { "docstring": "构造器 输入磁场 magnetic_field", "name": "__init__", "signature": "def __init__(self, local_coordinate_system: LocalCoordinateSystem, length: float, aperture_radius: float, magnetic_field: float) -> None" }, { "docstring": "point 全局坐标系的点", "name": "magnetic_field_at", "signature...
4
null
Implement the Python class `LocalUniformMagnet` described below. Class description: 局部圆柱区域产生均匀磁场的磁铁,可以看作一个直线二极磁铁 local_coordinate_system 局部坐标系 局部坐标系的原点即二极磁铁的起点 局部坐标系的 z 方向即二极磁铁延申方向 局部坐标系的 y 方向即磁场方向 length 磁铁长度 aperture_radius 磁铁孔径,磁铁外部磁场为零 magnetic_field 磁场大小,标量。磁场方向由 local_coordinate_system 确定 Method signatures and ...
Implement the Python class `LocalUniformMagnet` described below. Class description: 局部圆柱区域产生均匀磁场的磁铁,可以看作一个直线二极磁铁 local_coordinate_system 局部坐标系 局部坐标系的原点即二极磁铁的起点 局部坐标系的 z 方向即二极磁铁延申方向 局部坐标系的 y 方向即磁场方向 length 磁铁长度 aperture_radius 磁铁孔径,磁铁外部磁场为零 magnetic_field 磁场大小,标量。磁场方向由 local_coordinate_system 确定 Method signatures and ...
b02c64220ea533a4fc9cad0b882d1be6edadf1c0
<|skeleton|> class LocalUniformMagnet: """局部圆柱区域产生均匀磁场的磁铁,可以看作一个直线二极磁铁 local_coordinate_system 局部坐标系 局部坐标系的原点即二极磁铁的起点 局部坐标系的 z 方向即二极磁铁延申方向 局部坐标系的 y 方向即磁场方向 length 磁铁长度 aperture_radius 磁铁孔径,磁铁外部磁场为零 magnetic_field 磁场大小,标量。磁场方向由 local_coordinate_system 确定""" def __init__(self, local_coordinate_system: LocalCoord...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LocalUniformMagnet: """局部圆柱区域产生均匀磁场的磁铁,可以看作一个直线二极磁铁 local_coordinate_system 局部坐标系 局部坐标系的原点即二极磁铁的起点 局部坐标系的 z 方向即二极磁铁延申方向 局部坐标系的 y 方向即磁场方向 length 磁铁长度 aperture_radius 磁铁孔径,磁铁外部磁场为零 magnetic_field 磁场大小,标量。磁场方向由 local_coordinate_system 确定""" def __init__(self, local_coordinate_system: LocalCoordinateSystem, ...
the_stack_v2_python_sparse
final_code/packages/magnets.py
madokast/cctpy
train
1
c9814933116a5858e2482310c4b30a68b4f749d1
[ "self.logger = Loggers.get_logger()\nself.connection_successful = False\nnumber_of_retries = 0\nif from_email is None:\n from_email = settings.SFU_CSSS_GMAIL_USERNAME\nif password is None:\n password = settings.SFU_CSSS_GMAIL_PASSWORD\nself.from_email = from_email\nself.max_number_of_retries = max_number_of_r...
<|body_start_0|> self.logger = Loggers.get_logger() self.connection_successful = False number_of_retries = 0 if from_email is None: from_email = settings.SFU_CSSS_GMAIL_USERNAME if password is None: password = settings.SFU_CSSS_GMAIL_PASSWORD self....
Gmail
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Gmail: def __init__(self, from_email=None, password=None, smtp='smtp.gmail.com', port=587, max_number_of_retries=5): """initialized the gmail object for a gmail account Keyword Argument from_email -- the email address to log into password -- the password for the email to log into smtp --...
stack_v2_sparse_classes_36k_train_002654
5,999
no_license
[ { "docstring": "initialized the gmail object for a gmail account Keyword Argument from_email -- the email address to log into password -- the password for the email to log into smtp -- the server that hosts the smptlib server for gmail port -- the port for the smptlib server for gmail max_number_of_retries -- t...
3
null
Implement the Python class `Gmail` described below. Class description: Implement the Gmail class. Method signatures and docstrings: - def __init__(self, from_email=None, password=None, smtp='smtp.gmail.com', port=587, max_number_of_retries=5): initialized the gmail object for a gmail account Keyword Argument from_ema...
Implement the Python class `Gmail` described below. Class description: Implement the Gmail class. Method signatures and docstrings: - def __init__(self, from_email=None, password=None, smtp='smtp.gmail.com', port=587, max_number_of_retries=5): initialized the gmail object for a gmail account Keyword Argument from_ema...
5152787e8db3b1c4a73362e8f06a117f5fadc817
<|skeleton|> class Gmail: def __init__(self, from_email=None, password=None, smtp='smtp.gmail.com', port=587, max_number_of_retries=5): """initialized the gmail object for a gmail account Keyword Argument from_email -- the email address to log into password -- the password for the email to log into smtp --...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Gmail: def __init__(self, from_email=None, password=None, smtp='smtp.gmail.com', port=587, max_number_of_retries=5): """initialized the gmail object for a gmail account Keyword Argument from_email -- the email address to log into password -- the password for the email to log into smtp -- the server th...
the_stack_v2_python_sparse
csss-site/src/csss/Gmail.py
CSSS/csss-site
train
9
5614132ffaceb5ea3e84b0434d7dc4e71450f20b
[ "super().__init__(adguard, entry)\nself.entity_description = description\nself._attr_unique_id = '_'.join([DOMAIN, adguard.host, str(adguard.port), 'sensor', description.key])", "value = await self.entity_description.value_fn(self.adguard)\nself._attr_native_value = value\nif isinstance(value, float):\n self._...
<|body_start_0|> super().__init__(adguard, entry) self.entity_description = description self._attr_unique_id = '_'.join([DOMAIN, adguard.host, str(adguard.port), 'sensor', description.key]) <|end_body_0|> <|body_start_1|> value = await self.entity_description.value_fn(self.adguard) ...
Defines a AdGuard Home sensor.
AdGuardHomeSensor
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdGuardHomeSensor: """Defines a AdGuard Home sensor.""" def __init__(self, adguard: AdGuardHome, entry: ConfigEntry, description: AdGuardHomeEntityDescription) -> None: """Initialize AdGuard Home sensor.""" <|body_0|> async def _adguard_update(self) -> None: """U...
stack_v2_sparse_classes_36k_train_002655
4,982
permissive
[ { "docstring": "Initialize AdGuard Home sensor.", "name": "__init__", "signature": "def __init__(self, adguard: AdGuardHome, entry: ConfigEntry, description: AdGuardHomeEntityDescription) -> None" }, { "docstring": "Update AdGuard Home entity.", "name": "_adguard_update", "signature": "a...
2
stack_v2_sparse_classes_30k_train_007873
Implement the Python class `AdGuardHomeSensor` described below. Class description: Defines a AdGuard Home sensor. Method signatures and docstrings: - def __init__(self, adguard: AdGuardHome, entry: ConfigEntry, description: AdGuardHomeEntityDescription) -> None: Initialize AdGuard Home sensor. - async def _adguard_up...
Implement the Python class `AdGuardHomeSensor` described below. Class description: Defines a AdGuard Home sensor. Method signatures and docstrings: - def __init__(self, adguard: AdGuardHome, entry: ConfigEntry, description: AdGuardHomeEntityDescription) -> None: Initialize AdGuard Home sensor. - async def _adguard_up...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class AdGuardHomeSensor: """Defines a AdGuard Home sensor.""" def __init__(self, adguard: AdGuardHome, entry: ConfigEntry, description: AdGuardHomeEntityDescription) -> None: """Initialize AdGuard Home sensor.""" <|body_0|> async def _adguard_update(self) -> None: """U...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AdGuardHomeSensor: """Defines a AdGuard Home sensor.""" def __init__(self, adguard: AdGuardHome, entry: ConfigEntry, description: AdGuardHomeEntityDescription) -> None: """Initialize AdGuard Home sensor.""" super().__init__(adguard, entry) self.entity_description = description ...
the_stack_v2_python_sparse
homeassistant/components/adguard/sensor.py
home-assistant/core
train
35,501
cf8dcdce5fa201e390cada3b4aeefb034f093d58
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn Room()", "from .booking_type import BookingType\nfrom .place import Place\nfrom .booking_type import BookingType\nfrom .place import Place\nfields: Dict[str, Callable[[Any], None]] = {'audioDeviceName': lambda n: setattr(self, 'audio_d...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return Room() <|end_body_0|> <|body_start_1|> from .booking_type import BookingType from .place import Place from .booking_type import BookingType from .place import Place ...
Room
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Room: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Room: """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: Room""" ...
stack_v2_sparse_classes_36k_train_002656
5,259
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: Room", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value(parse_no...
3
stack_v2_sparse_classes_30k_train_011261
Implement the Python class `Room` described below. Class description: Implement the Room class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Room: Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The pars...
Implement the Python class `Room` described below. Class description: Implement the Room class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Room: Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The pars...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class Room: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Room: """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: Room""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Room: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> Room: """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: Room""" if not parse_n...
the_stack_v2_python_sparse
msgraph/generated/models/room.py
microsoftgraph/msgraph-sdk-python
train
135
1b7575a64366b7da437ac0ffd9fddd6860b639ac
[ "self.cutoff = cutoff\nself.box_width = box_width\nself.voxel_width = voxel_width\nself.reduce_to_contacts = reduce_to_contacts", "if 'complex' in kwargs:\n datapoint = kwargs.get('complex')\n raise DeprecationWarning('Complex is being phased out as a parameter, please pass \"datapoint\" instead.')\ntry:\n ...
<|body_start_0|> self.cutoff = cutoff self.box_width = box_width self.voxel_width = voxel_width self.reduce_to_contacts = reduce_to_contacts <|end_body_0|> <|body_start_1|> if 'complex' in kwargs: datapoint = kwargs.get('complex') raise DeprecationWarning...
Localize partial charges of atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute the partial (Gasteiger charge) on each molecule. For each atom, localize this partial charge in the voxel in which it originated to create a local charge array. Sum contribut...
ChargeVoxelizer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ChargeVoxelizer: """Localize partial charges of atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute the partial (Gasteiger charge) on each molecule. For each atom, localize this partial charge in the voxel in which it originated to...
stack_v2_sparse_classes_36k_train_002657
27,676
permissive
[ { "docstring": "Parameters ---------- cutoff: float (default 4.5) Distance cutoff in angstroms for molecules in complex. box_width: float, optional (default 16.0) Size of a box in which voxel features are calculated. Box is centered on a ligand centroid. voxel_width: float, optional (default 1.0) Size of a 3D v...
2
null
Implement the Python class `ChargeVoxelizer` described below. Class description: Localize partial charges of atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute the partial (Gasteiger charge) on each molecule. For each atom, localize this partial charge...
Implement the Python class `ChargeVoxelizer` described below. Class description: Localize partial charges of atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute the partial (Gasteiger charge) on each molecule. For each atom, localize this partial charge...
ee6e67ebcf7bf04259cf13aff6388e2b791fea3d
<|skeleton|> class ChargeVoxelizer: """Localize partial charges of atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute the partial (Gasteiger charge) on each molecule. For each atom, localize this partial charge in the voxel in which it originated to...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ChargeVoxelizer: """Localize partial charges of atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute the partial (Gasteiger charge) on each molecule. For each atom, localize this partial charge in the voxel in which it originated to create a loc...
the_stack_v2_python_sparse
deepchem/feat/complex_featurizers/grid_featurizers.py
deepchem/deepchem
train
4,876
ef8c6d0f9594ac8273f5ab09744c1f3096aab49e
[ "if not fpath:\n fpath = self.generate_fpath(rootdir, product, utc)\nsuper().__init__(fpath)", "valid_products = ('PRECIPRATE',)\npdb.set_trace()\nif prod not in valid_products:\n raise Exception('Product name not valid.')\nfname = '{0}.{1}{2}{3}.{4}{5}{6}'.format(prod, utc.year, utc.month, utc.day, utc.hou...
<|body_start_0|> if not fpath: fpath = self.generate_fpath(rootdir, product, utc) super().__init__(fpath) <|end_body_0|> <|body_start_1|> valid_products = ('PRECIPRATE',) pdb.set_trace() if prod not in valid_products: raise Exception('Product name not val...
MRMS
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MRMS: def __init__(self, fpath=False, rootdir=False, product=False, utc=False): """A helper function to automatically generate file name to load needs to be written. Arguments: fpath (str, optional): file path to data. If False, other information must be presented to search for data (bel...
stack_v2_sparse_classes_36k_train_002658
18,802
no_license
[ { "docstring": "A helper function to automatically generate file name to load needs to be written. Arguments: fpath (str, optional): file path to data. If False, other information must be presented to search for data (below). rootdir (str, optional): if fpath is False, this is required to search for data based ...
2
stack_v2_sparse_classes_30k_train_018159
Implement the Python class `MRMS` described below. Class description: Implement the MRMS class. Method signatures and docstrings: - def __init__(self, fpath=False, rootdir=False, product=False, utc=False): A helper function to automatically generate file name to load needs to be written. Arguments: fpath (str, option...
Implement the Python class `MRMS` described below. Class description: Implement the MRMS class. Method signatures and docstrings: - def __init__(self, fpath=False, rootdir=False, product=False, utc=False): A helper function to automatically generate file name to load needs to be written. Arguments: fpath (str, option...
08f0472a59a910aaeb1c52baedffc2cec45fb54d
<|skeleton|> class MRMS: def __init__(self, fpath=False, rootdir=False, product=False, utc=False): """A helper function to automatically generate file name to load needs to be written. Arguments: fpath (str, optional): file path to data. If False, other information must be presented to search for data (bel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MRMS: def __init__(self, fpath=False, rootdir=False, product=False, utc=False): """A helper function to automatically generate file name to load needs to be written. Arguments: fpath (str, optional): file path to data. If False, other information must be presented to search for data (below). rootdir (...
the_stack_v2_python_sparse
postWRF/postWRF/obs.py
johnrobertlawson/WEM
train
33
f163413944d747da568e3daa022813b03070f873
[ "if not kwargs.get('obj_ids'):\n obj_model = facade.get_vlan_by_search(self.search)\n vlans = obj_model['query_set']\n only_main_property = False\nelse:\n obj_ids = kwargs['obj_ids'].split(';')\n vlans = facade.get_vlan_by_ids(obj_ids)\n obj_model = None\n only_main_property = True\nserializer_...
<|body_start_0|> if not kwargs.get('obj_ids'): obj_model = facade.get_vlan_by_search(self.search) vlans = obj_model['query_set'] only_main_property = False else: obj_ids = kwargs['obj_ids'].split(';') vlans = facade.get_vlan_by_ids(obj_ids) ...
VlanDBView
[ "Apache-2.0", "BSD-3-Clause", "MIT", "LicenseRef-scancode-public-domain", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VlanDBView: def get(self, request, *args, **kwargs): """Returns a list of vlans with details by ids ou dict.""" <|body_0|> def post(self, request, *args, **kwargs): """Creates list of vlans.""" <|body_1|> def put(self, request, *args, **kwargs): ...
stack_v2_sparse_classes_36k_train_002659
6,313
permissive
[ { "docstring": "Returns a list of vlans with details by ids ou dict.", "name": "get", "signature": "def get(self, request, *args, **kwargs)" }, { "docstring": "Creates list of vlans.", "name": "post", "signature": "def post(self, request, *args, **kwargs)" }, { "docstring": "Upda...
4
stack_v2_sparse_classes_30k_train_011739
Implement the Python class `VlanDBView` described below. Class description: Implement the VlanDBView class. Method signatures and docstrings: - def get(self, request, *args, **kwargs): Returns a list of vlans with details by ids ou dict. - def post(self, request, *args, **kwargs): Creates list of vlans. - def put(sel...
Implement the Python class `VlanDBView` described below. Class description: Implement the VlanDBView class. Method signatures and docstrings: - def get(self, request, *args, **kwargs): Returns a list of vlans with details by ids ou dict. - def post(self, request, *args, **kwargs): Creates list of vlans. - def put(sel...
eb27e1d977a1c4bb1fee8fb51b8d8050c64696d9
<|skeleton|> class VlanDBView: def get(self, request, *args, **kwargs): """Returns a list of vlans with details by ids ou dict.""" <|body_0|> def post(self, request, *args, **kwargs): """Creates list of vlans.""" <|body_1|> def put(self, request, *args, **kwargs): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class VlanDBView: def get(self, request, *args, **kwargs): """Returns a list of vlans with details by ids ou dict.""" if not kwargs.get('obj_ids'): obj_model = facade.get_vlan_by_search(self.search) vlans = obj_model['query_set'] only_main_property = False ...
the_stack_v2_python_sparse
networkapi/api_vlan/views/v3.py
globocom/GloboNetworkAPI
train
86
fa786575b9c7c156ee9e2d03d4d477d0db8db939
[ "book = get_object_or_404(models.Edition, id=book_id)\ndata = {'file_link_form': forms.FileLinkForm(), 'book': book}\nreturn TemplateResponse(request, 'book/file_links/file_link_page.html', data)", "book = get_object_or_404(models.Book.objects.select_subclasses(), id=book_id)\nlink = get_object_or_404(models.File...
<|body_start_0|> book = get_object_or_404(models.Edition, id=book_id) data = {'file_link_form': forms.FileLinkForm(), 'book': book} return TemplateResponse(request, 'book/file_links/file_link_page.html', data) <|end_body_0|> <|body_start_1|> book = get_object_or_404(models.Book.objects....
a book! this is the stuff
AddFileLink
[ "LicenseRef-scancode-warranty-disclaimer" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AddFileLink: """a book! this is the stuff""" def get(self, request, book_id): """Create link form""" <|body_0|> def post(self, request, book_id, link_id=None): """Add a link to a copy of the book you can read""" <|body_1|> <|end_skeleton|> <|body_start_...
stack_v2_sparse_classes_36k_train_002660
3,716
no_license
[ { "docstring": "Create link form", "name": "get", "signature": "def get(self, request, book_id)" }, { "docstring": "Add a link to a copy of the book you can read", "name": "post", "signature": "def post(self, request, book_id, link_id=None)" } ]
2
stack_v2_sparse_classes_30k_train_014255
Implement the Python class `AddFileLink` described below. Class description: a book! this is the stuff Method signatures and docstrings: - def get(self, request, book_id): Create link form - def post(self, request, book_id, link_id=None): Add a link to a copy of the book you can read
Implement the Python class `AddFileLink` described below. Class description: a book! this is the stuff Method signatures and docstrings: - def get(self, request, book_id): Create link form - def post(self, request, book_id, link_id=None): Add a link to a copy of the book you can read <|skeleton|> class AddFileLink: ...
0f8da5b738047f3c34d60d93f59bdedd8f797224
<|skeleton|> class AddFileLink: """a book! this is the stuff""" def get(self, request, book_id): """Create link form""" <|body_0|> def post(self, request, book_id, link_id=None): """Add a link to a copy of the book you can read""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AddFileLink: """a book! this is the stuff""" def get(self, request, book_id): """Create link form""" book = get_object_or_404(models.Edition, id=book_id) data = {'file_link_form': forms.FileLinkForm(), 'book': book} return TemplateResponse(request, 'book/file_links/file_li...
the_stack_v2_python_sparse
bookwyrm/views/books/links.py
bookwyrm-social/bookwyrm
train
1,398
9be1c49ec9fa16f1d1f430d11f07db66827e4410
[ "self._observer = observer\nself._path_handler = path_handler\nself._watch: Optional[ObservedWatch] = initial_watch", "if event.event_type == EVENT_TYPE_OPENED:\n LOG.debug('Ignoring file system OPENED event.')\n return\nif self._watch and (not self._path_handler.path.exists()):\n if self._path_handler.s...
<|body_start_0|> self._observer = observer self._path_handler = path_handler self._watch: Optional[ObservedWatch] = initial_watch <|end_body_0|> <|body_start_1|> if event.event_type == EVENT_TYPE_OPENED: LOG.debug('Ignoring file system OPENED event.') return ...
This class is used to alter the behavior of watchdog folder watches. https://github.com/gorakhargosh/watchdog/issues/415 By default, if a folder is renamed, the handler will still get triggered for the new folder Ex: 1. Create FolderA 2. Watch FolderA 3. Rename FolderA to FolderB 4. Add file to FolderB 5. Handler will ...
StaticFolderWrapper
[ "Apache-2.0", "BSD-3-Clause", "MIT", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StaticFolderWrapper: """This class is used to alter the behavior of watchdog folder watches. https://github.com/gorakhargosh/watchdog/issues/415 By default, if a folder is renamed, the handler will still get triggered for the new folder Ex: 1. Create FolderA 2. Watch FolderA 3. Rename FolderA to ...
stack_v2_sparse_classes_36k_train_002661
6,436
permissive
[ { "docstring": "[summary] Parameters ---------- observer : HandlerObserver HandlerObserver initial_watch : ObservedWatch Initial watch for the folder to be watched that gets returned by HandlerObserver path_handler : PathHandler PathHandler of the folder to be watched.", "name": "__init__", "signature":...
3
null
Implement the Python class `StaticFolderWrapper` described below. Class description: This class is used to alter the behavior of watchdog folder watches. https://github.com/gorakhargosh/watchdog/issues/415 By default, if a folder is renamed, the handler will still get triggered for the new folder Ex: 1. Create FolderA...
Implement the Python class `StaticFolderWrapper` described below. Class description: This class is used to alter the behavior of watchdog folder watches. https://github.com/gorakhargosh/watchdog/issues/415 By default, if a folder is renamed, the handler will still get triggered for the new folder Ex: 1. Create FolderA...
b297ff015f2b69d7c74059c2d42ece1c29ea73ee
<|skeleton|> class StaticFolderWrapper: """This class is used to alter the behavior of watchdog folder watches. https://github.com/gorakhargosh/watchdog/issues/415 By default, if a folder is renamed, the handler will still get triggered for the new folder Ex: 1. Create FolderA 2. Watch FolderA 3. Rename FolderA to ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StaticFolderWrapper: """This class is used to alter the behavior of watchdog folder watches. https://github.com/gorakhargosh/watchdog/issues/415 By default, if a folder is renamed, the handler will still get triggered for the new folder Ex: 1. Create FolderA 2. Watch FolderA 3. Rename FolderA to FolderB 4. Ad...
the_stack_v2_python_sparse
samcli/lib/utils/path_observer.py
aws/aws-sam-cli
train
1,402
2ce1ac1110cb38ece8fb709bb976e905e64b62ec
[ "params = book_review_getter.parse_args()\npg_size, pg_num = (int(params['pg-size']), int(params['pg-num']))\nstart = (pg_num - 1) * pg_size\nend = start + pg_size\nnew_records = LiveReview.find_by_asin(asin)\nold_records = OldReview.find_by_asin(asin)\nrecords = old_records + new_records\nif records == [] or start...
<|body_start_0|> params = book_review_getter.parse_args() pg_size, pg_num = (int(params['pg-size']), int(params['pg-num'])) start = (pg_num - 1) * pg_size end = start + pg_size new_records = LiveReview.find_by_asin(asin) old_records = OldReview.find_by_asin(asin) ...
BookReview
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BookReview: def get(self, asin): """Returns new and old Reviews for the book given asin (B000FA64PK). New and old reviews are differentiated by their "old_review" field's value. Page Number starts from 1""" <|body_0|> def post(self, asin): """JWT required in Headers ...
stack_v2_sparse_classes_36k_train_002662
5,907
no_license
[ { "docstring": "Returns new and old Reviews for the book given asin (B000FA64PK). New and old reviews are differentiated by their \"old_review\" field's value. Page Number starts from 1", "name": "get", "signature": "def get(self, asin)" }, { "docstring": "JWT required in Headers {Authorization:...
3
stack_v2_sparse_classes_30k_train_020843
Implement the Python class `BookReview` described below. Class description: Implement the BookReview class. Method signatures and docstrings: - def get(self, asin): Returns new and old Reviews for the book given asin (B000FA64PK). New and old reviews are differentiated by their "old_review" field's value. Page Number...
Implement the Python class `BookReview` described below. Class description: Implement the BookReview class. Method signatures and docstrings: - def get(self, asin): Returns new and old Reviews for the book given asin (B000FA64PK). New and old reviews are differentiated by their "old_review" field's value. Page Number...
ef4336ad7a9e8b30281cc3cb828d08ebba9022e5
<|skeleton|> class BookReview: def get(self, asin): """Returns new and old Reviews for the book given asin (B000FA64PK). New and old reviews are differentiated by their "old_review" field's value. Page Number starts from 1""" <|body_0|> def post(self, asin): """JWT required in Headers ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BookReview: def get(self, asin): """Returns new and old Reviews for the book given asin (B000FA64PK). New and old reviews are differentiated by their "old_review" field's value. Page Number starts from 1""" params = book_review_getter.parse_args() pg_size, pg_num = (int(params['pg-size...
the_stack_v2_python_sparse
app/namespaces/book_review.py
FavebookSUTD/favebook_backend
train
0
50b3595b58b65b73ed9cc313d9088143e904aa8e
[ "self.model_class = model_class\nself.graph_db = graph_db\nself.results: Optional[pd.DataFrame] = []\nif not self.graph_db.splits:\n raise ValueError('Database contains no splits')\nif self.graph_db.splits != list(range(len(self.graph_db.splits))):\n raise ValueError(f'Graph database splits are not a contiguo...
<|body_start_0|> self.model_class = model_class self.graph_db = graph_db self.results: Optional[pd.DataFrame] = [] if not self.graph_db.splits: raise ValueError('Database contains no splits') if self.graph_db.splits != list(range(len(self.graph_db.splits))): ...
A k cross-validation jobs. This runs the requested train/val/test schedule using every split in the graph database.
KFoldCrossValidation
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KFoldCrossValidation: """A k cross-validation jobs. This runs the requested train/val/test schedule using every split in the graph database.""" def __init__(self, model_class, graph_db: graph_tuple_database.Database): """Constructor. Args: model_class: A model constructor. Raises: Va...
stack_v2_sparse_classes_36k_train_002663
21,195
permissive
[ { "docstring": "Constructor. Args: model_class: A model constructor. Raises: ValueError: If the database contains invalid splits.", "name": "__init__", "signature": "def __init__(self, model_class, graph_db: graph_tuple_database.Database)" }, { "docstring": "Run the train/val/test loop.", "n...
2
null
Implement the Python class `KFoldCrossValidation` described below. Class description: A k cross-validation jobs. This runs the requested train/val/test schedule using every split in the graph database. Method signatures and docstrings: - def __init__(self, model_class, graph_db: graph_tuple_database.Database): Constr...
Implement the Python class `KFoldCrossValidation` described below. Class description: A k cross-validation jobs. This runs the requested train/val/test schedule using every split in the graph database. Method signatures and docstrings: - def __init__(self, model_class, graph_db: graph_tuple_database.Database): Constr...
cd99d2c5362acd0b24ee224492bb3e8c4d4736fb
<|skeleton|> class KFoldCrossValidation: """A k cross-validation jobs. This runs the requested train/val/test schedule using every split in the graph database.""" def __init__(self, model_class, graph_db: graph_tuple_database.Database): """Constructor. Args: model_class: A model constructor. Raises: Va...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KFoldCrossValidation: """A k cross-validation jobs. This runs the requested train/val/test schedule using every split in the graph database.""" def __init__(self, model_class, graph_db: graph_tuple_database.Database): """Constructor. Args: model_class: A model constructor. Raises: ValueError: If ...
the_stack_v2_python_sparse
deeplearning/ml4pl/models/run.py
Zacharias030/ProGraML
train
0
e986bbb719341bbf139eec56a34e63e96a1881d7
[ "if value is None:\n return ''\nordered_uuids = [(k, v) for k, v in value.items()]\nordered_uuids.sort(key=lambda x: x[1]['order'])\nreturn '\\r\\n'.join([i[0] for i in ordered_uuids])", "if not len(value) or not isinstance(value, dict):\n return self.field.missing_value\nreturn value" ]
<|body_start_0|> if value is None: return '' ordered_uuids = [(k, v) for k, v in value.items()] ordered_uuids.sort(key=lambda x: x[1]['order']) return '\r\n'.join([i[0] for i in ordered_uuids]) <|end_body_0|> <|body_start_1|> if not len(value) or not isinstance(value...
A data converter using the field's ``fromUnicode()`` method.
UUIDSFieldDataConverter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UUIDSFieldDataConverter: """A data converter using the field's ``fromUnicode()`` method.""" def toWidgetValue(self, value): """Convert the internal stored value into something that a z3c.form widget understands. :param value: [required] The internally stored value :type value: Dict :...
stack_v2_sparse_classes_36k_train_002664
6,453
no_license
[ { "docstring": "Convert the internal stored value into something that a z3c.form widget understands. :param value: [required] The internally stored value :type value: Dict :returns: A string with UUIDs separated by", "name": "toWidgetValue", "signature": "def toWidgetValue(self, value)" }, { "do...
2
stack_v2_sparse_classes_30k_train_012163
Implement the Python class `UUIDSFieldDataConverter` described below. Class description: A data converter using the field's ``fromUnicode()`` method. Method signatures and docstrings: - def toWidgetValue(self, value): Convert the internal stored value into something that a z3c.form widget understands. :param value: [...
Implement the Python class `UUIDSFieldDataConverter` described below. Class description: A data converter using the field's ``fromUnicode()`` method. Method signatures and docstrings: - def toWidgetValue(self, value): Convert the internal stored value into something that a z3c.form widget understands. :param value: [...
c3a27fa8a48eb527d52179b8c007df5bc28220ee
<|skeleton|> class UUIDSFieldDataConverter: """A data converter using the field's ``fromUnicode()`` method.""" def toWidgetValue(self, value): """Convert the internal stored value into something that a z3c.form widget understands. :param value: [required] The internally stored value :type value: Dict :...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UUIDSFieldDataConverter: """A data converter using the field's ``fromUnicode()`` method.""" def toWidgetValue(self, value): """Convert the internal stored value into something that a z3c.form widget understands. :param value: [required] The internally stored value :type value: Dict :returns: A st...
the_stack_v2_python_sparse
src/collective/cover/tiles/carousel.py
collective/collective.cover
train
23
3f2182fed3b446fed3e3b342c1f22ddb93e5d681
[ "self._dbName = os.environ['MOPS_DBINSTANCE']\nself._instance = mopsInstance = Instance(self._dbName)\nself._conn = self._instance.get_dbh()\nself._cursor = self._conn.cursor()\nsql = 'select f.field_id, f.epoch_mjd, f.ra_deg, f.dec_deg, ' + 'f.survey_mode, f.time_start, f.time_stop, f.filter_id, ' + 'f.limiting_ma...
<|body_start_0|> self._dbName = os.environ['MOPS_DBINSTANCE'] self._instance = mopsInstance = Instance(self._dbName) self._conn = self._instance.get_dbh() self._cursor = self._conn.cursor() sql = 'select f.field_id, f.epoch_mjd, f.ra_deg, f.dec_deg, ' + 'f.survey_mode, f.time_sta...
FieldTest
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FieldTest: def setUp(self): """Just create a Field instance from data in the DB. We will use that instance in our tests. We choose a field with tracklets associated to it.""" <|body_0|> def testInsert(self): """Test the insertion of a dummy Field instance in the DB."...
stack_v2_sparse_classes_36k_train_002665
17,613
no_license
[ { "docstring": "Just create a Field instance from data in the DB. We will use that instance in our tests. We choose a field with tracklets associated to it.", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Test the insertion of a dummy Field instance in the DB.", "name": ...
3
stack_v2_sparse_classes_30k_train_003731
Implement the Python class `FieldTest` described below. Class description: Implement the FieldTest class. Method signatures and docstrings: - def setUp(self): Just create a Field instance from data in the DB. We will use that instance in our tests. We choose a field with tracklets associated to it. - def testInsert(s...
Implement the Python class `FieldTest` described below. Class description: Implement the FieldTest class. Method signatures and docstrings: - def setUp(self): Just create a Field instance from data in the DB. We will use that instance in our tests. We choose a field with tracklets associated to it. - def testInsert(s...
06858b7e935243da7a3f55b3e5097d6440e0c1c2
<|skeleton|> class FieldTest: def setUp(self): """Just create a Field instance from data in the DB. We will use that instance in our tests. We choose a field with tracklets associated to it.""" <|body_0|> def testInsert(self): """Test the insertion of a dummy Field instance in the DB."...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FieldTest: def setUp(self): """Just create a Field instance from data in the DB. We will use that instance in our tests. We choose a field with tracklets associated to it.""" self._dbName = os.environ['MOPS_DBINSTANCE'] self._instance = mopsInstance = Instance(self._dbName) sel...
the_stack_v2_python_sparse
python/MOPS/test.py
ldenneau/mopsng
train
0
efb06163268d634718ad95ead6295f3d41378371
[ "if filters is None:\n self.filters = []\nelse:\n self.filters = filters", "flags = self.check_flags(flags, **kwargs)\nfor f in self.filters:\n flags = f(flags, **kwargs)\nreturn flags", "if flags is None:\n length = 0\n if predictions:\n length = len(predictions)\n if observations:\n ...
<|body_start_0|> if filters is None: self.filters = [] else: self.filters = filters <|end_body_0|> <|body_start_1|> flags = self.check_flags(flags, **kwargs) for f in self.filters: flags = f(flags, **kwargs) return flags <|end_body_1|> <|body...
A class to run multiple filters in succession.
FilterRunner
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FilterRunner: """A class to run multiple filters in succession.""" def __init__(self, filters=None): """Initialise with a list of filters. :param filters: The list of filters""" <|body_0|> def __call__(self, flags, **kwargs): """Call the filters one by one. :para...
stack_v2_sparse_classes_36k_train_002666
17,726
permissive
[ { "docstring": "Initialise with a list of filters. :param filters: The list of filters", "name": "__init__", "signature": "def __init__(self, filters=None)" }, { "docstring": "Call the filters one by one. :param flags: The input flags :returns: The filtered flags", "name": "__call__", "s...
3
null
Implement the Python class `FilterRunner` described below. Class description: A class to run multiple filters in succession. Method signatures and docstrings: - def __init__(self, filters=None): Initialise with a list of filters. :param filters: The list of filters - def __call__(self, flags, **kwargs): Call the filt...
Implement the Python class `FilterRunner` described below. Class description: A class to run multiple filters in succession. Method signatures and docstrings: - def __init__(self, filters=None): Initialise with a list of filters. :param filters: The list of filters - def __call__(self, flags, **kwargs): Call the filt...
88bf7f7c5ac44defc046ebf0719cde748092cfff
<|skeleton|> class FilterRunner: """A class to run multiple filters in succession.""" def __init__(self, filters=None): """Initialise with a list of filters. :param filters: The list of filters""" <|body_0|> def __call__(self, flags, **kwargs): """Call the filters one by one. :para...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FilterRunner: """A class to run multiple filters in succession.""" def __init__(self, filters=None): """Initialise with a list of filters. :param filters: The list of filters""" if filters is None: self.filters = [] else: self.filters = filters def __c...
the_stack_v2_python_sparse
src/dials/algorithms/spot_finding/factory.py
dials/dials
train
71
8e254edc3fe9fe441d9316ae640f7cdc342ba064
[ "if isinstance(tags, str):\n return tags.split(',')\nreturn list(tags)", "obj = super().dict(**kwargs)\nif 'tags' in obj:\n obj['tags'] = ','.join(obj['tags'])\nreturn obj" ]
<|body_start_0|> if isinstance(tags, str): return tags.split(',') return list(tags) <|end_body_0|> <|body_start_1|> obj = super().dict(**kwargs) if 'tags' in obj: obj['tags'] = ','.join(obj['tags']) return obj <|end_body_1|>
Define a base class for elements and relationships. Attributes: id (str): tags (set of str): properties (dict): perspectives (set of Perspective):
ModelItemIO
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ModelItemIO: """Define a base class for elements and relationships. Attributes: id (str): tags (set of str): properties (dict): perspectives (set of Perspective):""" def split_tags(cls, tags: Union[str, Iterable[str]]) -> List[str]: """Convert comma-separated tag list into list if ne...
stack_v2_sparse_classes_36k_train_002667
3,127
permissive
[ { "docstring": "Convert comma-separated tag list into list if needed.", "name": "split_tags", "signature": "def split_tags(cls, tags: Union[str, Iterable[str]]) -> List[str]" }, { "docstring": "Map this IO into a dictionary suitable for serialisation.", "name": "dict", "signature": "def ...
2
stack_v2_sparse_classes_30k_train_011193
Implement the Python class `ModelItemIO` described below. Class description: Define a base class for elements and relationships. Attributes: id (str): tags (set of str): properties (dict): perspectives (set of Perspective): Method signatures and docstrings: - def split_tags(cls, tags: Union[str, Iterable[str]]) -> Li...
Implement the Python class `ModelItemIO` described below. Class description: Define a base class for elements and relationships. Attributes: id (str): tags (set of str): properties (dict): perspectives (set of Perspective): Method signatures and docstrings: - def split_tags(cls, tags: Union[str, Iterable[str]]) -> Li...
31f1dcadb3ff113d8a77ce132657237ea01c307b
<|skeleton|> class ModelItemIO: """Define a base class for elements and relationships. Attributes: id (str): tags (set of str): properties (dict): perspectives (set of Perspective):""" def split_tags(cls, tags: Union[str, Iterable[str]]) -> List[str]: """Convert comma-separated tag list into list if ne...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ModelItemIO: """Define a base class for elements and relationships. Attributes: id (str): tags (set of str): properties (dict): perspectives (set of Perspective):""" def split_tags(cls, tags: Union[str, Iterable[str]]) -> List[str]: """Convert comma-separated tag list into list if needed.""" ...
the_stack_v2_python_sparse
src/structurizr/model/model_item.py
Midnighter/structurizr-python
train
61
2cd96929bc880be241eaffb5995dc6f3db974730
[ "self.capture_tail_logs = capture_tail_logs\nself.continue_after_error = continue_after_error\nself.data_file_destination = data_file_destination\nself.db_restore_overwrite_policy = db_restore_overwrite_policy\nself.enable_checksum = enable_checksum\nself.instance_name = instance_name\nself.is_auto_sync_enabled = i...
<|body_start_0|> self.capture_tail_logs = capture_tail_logs self.continue_after_error = continue_after_error self.data_file_destination = data_file_destination self.db_restore_overwrite_policy = db_restore_overwrite_policy self.enable_checksum = enable_checksum self.insta...
Implementation of the 'RestoreSqlAppObjectParams' model. TODO: type description here. Attributes: capture_tail_logs (bool): Set to true if tail logs are to be captured before the restore operation. This is only applicable if we are restoring the SQL database to its original source, and the database is not being renamed...
RestoreSqlAppObjectParams
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RestoreSqlAppObjectParams: """Implementation of the 'RestoreSqlAppObjectParams' model. TODO: type description here. Attributes: capture_tail_logs (bool): Set to true if tail logs are to be captured before the restore operation. This is only applicable if we are restoring the SQL database to its o...
stack_v2_sparse_classes_36k_train_002668
10,408
permissive
[ { "docstring": "Constructor for the RestoreSqlAppObjectParams class", "name": "__init__", "signature": "def __init__(self, capture_tail_logs=None, continue_after_error=None, data_file_destination=None, db_restore_overwrite_policy=None, enable_checksum=None, instance_name=None, is_auto_sync_enabled=None,...
2
null
Implement the Python class `RestoreSqlAppObjectParams` described below. Class description: Implementation of the 'RestoreSqlAppObjectParams' model. TODO: type description here. Attributes: capture_tail_logs (bool): Set to true if tail logs are to be captured before the restore operation. This is only applicable if we ...
Implement the Python class `RestoreSqlAppObjectParams` described below. Class description: Implementation of the 'RestoreSqlAppObjectParams' model. TODO: type description here. Attributes: capture_tail_logs (bool): Set to true if tail logs are to be captured before the restore operation. This is only applicable if we ...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class RestoreSqlAppObjectParams: """Implementation of the 'RestoreSqlAppObjectParams' model. TODO: type description here. Attributes: capture_tail_logs (bool): Set to true if tail logs are to be captured before the restore operation. This is only applicable if we are restoring the SQL database to its o...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RestoreSqlAppObjectParams: """Implementation of the 'RestoreSqlAppObjectParams' model. TODO: type description here. Attributes: capture_tail_logs (bool): Set to true if tail logs are to be captured before the restore operation. This is only applicable if we are restoring the SQL database to its original sourc...
the_stack_v2_python_sparse
cohesity_management_sdk/models/restore_sql_app_object_params.py
cohesity/management-sdk-python
train
24
81869ed310e4298eb98d90991cda817223667f52
[ "super(Csv, self).start(**kwargs)\nself._temp_file = tempfile.NamedTemporaryFile(mode='w+', encoding='utf-8')\nself.echo(msg=f'Writing JSON to temporary file {self._temp_file.name!r}')", "super(Csv, self).stop(**kwargs)\nself._start(**kwargs)\nself.echo(msg='Re-reading temporary file and converting to CSV')\nself...
<|body_start_0|> super(Csv, self).start(**kwargs) self._temp_file = tempfile.NamedTemporaryFile(mode='w+', encoding='utf-8') self.echo(msg=f'Writing JSON to temporary file {self._temp_file.name!r}') <|end_body_0|> <|body_start_1|> super(Csv, self).stop(**kwargs) self._start(**kw...
Pass.
JsonToCsv
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JsonToCsv: """Pass.""" def start(self, **kwargs): """Create temp file for writing to.""" <|body_0|> def stop(self, **kwargs): """Create CSV file, process each row in temp file, then close temp and csv.""" <|body_1|> def process_row(self, row): ...
stack_v2_sparse_classes_36k_train_002669
1,648
permissive
[ { "docstring": "Create temp file for writing to.", "name": "start", "signature": "def start(self, **kwargs)" }, { "docstring": "Create CSV file, process each row in temp file, then close temp and csv.", "name": "stop", "signature": "def stop(self, **kwargs)" }, { "docstring": "Wr...
3
null
Implement the Python class `JsonToCsv` described below. Class description: Pass. Method signatures and docstrings: - def start(self, **kwargs): Create temp file for writing to. - def stop(self, **kwargs): Create CSV file, process each row in temp file, then close temp and csv. - def process_row(self, row): Write row ...
Implement the Python class `JsonToCsv` described below. Class description: Pass. Method signatures and docstrings: - def start(self, **kwargs): Create temp file for writing to. - def stop(self, **kwargs): Create CSV file, process each row in temp file, then close temp and csv. - def process_row(self, row): Write row ...
09fd564d62f0ddf7aa44db14a509eaafaf0c930f
<|skeleton|> class JsonToCsv: """Pass.""" def start(self, **kwargs): """Create temp file for writing to.""" <|body_0|> def stop(self, **kwargs): """Create CSV file, process each row in temp file, then close temp and csv.""" <|body_1|> def process_row(self, row): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class JsonToCsv: """Pass.""" def start(self, **kwargs): """Create temp file for writing to.""" super(Csv, self).start(**kwargs) self._temp_file = tempfile.NamedTemporaryFile(mode='w+', encoding='utf-8') self.echo(msg=f'Writing JSON to temporary file {self._temp_file.name!r}') ...
the_stack_v2_python_sparse
axonius_api_client/api/asset_callbacks/base_json_to_csv.py
geransmith/axonius_api_client
train
0
39dfb3338d71ee5da837cfd2f2aacf3e63c43563
[ "k_bits = k_max.bit_length()\ndub = [[0] * n for _ in range(k_bits)]\nfor j in range(n):\n dub[0][j] = f(j)\nfor i in range(1, k_bits):\n for j in range(n):\n dub[i][j] = dub[i - 1][dub[i - 1][j]]\nself.doubling_table = dub", "now = x\nfor i in range(k.bit_length()):\n if k >> i & 1:\n now ...
<|body_start_0|> k_bits = k_max.bit_length() dub = [[0] * n for _ in range(k_bits)] for j in range(n): dub[0][j] = f(j) for i in range(1, k_bits): for j in range(n): dub[i][j] = dub[i - 1][dub[i - 1][j]] self.doubling_table = dub <|end_body...
Doubling
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Doubling: def __init__(self, n, k_max, f) -> None: """要素数nのダブリングテーブルを作成します。""" <|body_0|> def get(self, x, k): """xをk回操作した値を取得します。""" <|body_1|> <|end_skeleton|> <|body_start_0|> k_bits = k_max.bit_length() dub = [[0] * n for _ in range(k_bi...
stack_v2_sparse_classes_36k_train_002670
1,506
no_license
[ { "docstring": "要素数nのダブリングテーブルを作成します。", "name": "__init__", "signature": "def __init__(self, n, k_max, f) -> None" }, { "docstring": "xをk回操作した値を取得します。", "name": "get", "signature": "def get(self, x, k)" } ]
2
stack_v2_sparse_classes_30k_train_009649
Implement the Python class `Doubling` described below. Class description: Implement the Doubling class. Method signatures and docstrings: - def __init__(self, n, k_max, f) -> None: 要素数nのダブリングテーブルを作成します。 - def get(self, x, k): xをk回操作した値を取得します。
Implement the Python class `Doubling` described below. Class description: Implement the Doubling class. Method signatures and docstrings: - def __init__(self, n, k_max, f) -> None: 要素数nのダブリングテーブルを作成します。 - def get(self, x, k): xをk回操作した値を取得します。 <|skeleton|> class Doubling: def __init__(self, n, k_max, f) -> None:...
1259be8d4214209b7c7d3783f33aa6de4ea04a01
<|skeleton|> class Doubling: def __init__(self, n, k_max, f) -> None: """要素数nのダブリングテーブルを作成します。""" <|body_0|> def get(self, x, k): """xをk回操作した値を取得します。""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Doubling: def __init__(self, n, k_max, f) -> None: """要素数nのダブリングテーブルを作成します。""" k_bits = k_max.bit_length() dub = [[0] * n for _ in range(k_bits)] for j in range(n): dub[0][j] = f(j) for i in range(1, k_bits): for j in range(n): du...
the_stack_v2_python_sparse
solve_python/058.py
Nishin-0141/kyopro_educational_90_python
train
0
6054d4546b89cf5f69a90fe5a87df736fea407b3
[ "name = base_name + str(len(self.containers[base_name]))\ncontainer = KubernetesContainer(container_spec, name)\nself.containers[base_name].append(container)\ncontainer.Create()", "service = KubernetesContainerService(container_spec, name)\nself.services[name] = service\nservice.Create()" ]
<|body_start_0|> name = base_name + str(len(self.containers[base_name])) container = KubernetesContainer(container_spec, name) self.containers[base_name].append(container) container.Create() <|end_body_0|> <|body_start_1|> service = KubernetesContainerService(container_spec, nam...
A Kubernetes flavor of Container Cluster.
KubernetesCluster
[ "Apache-2.0", "GPL-2.0-only", "LicenseRef-scancode-public-domain", "Classpath-exception-2.0", "AGPL-3.0-only", "MIT", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KubernetesCluster: """A Kubernetes flavor of Container Cluster.""" def DeployContainer(self, base_name, container_spec): """Deploys Containers according to the ContainerSpec.""" <|body_0|> def DeployContainerService(self, name, container_spec): """Deploys a Conta...
stack_v2_sparse_classes_36k_train_002671
22,185
permissive
[ { "docstring": "Deploys Containers according to the ContainerSpec.", "name": "DeployContainer", "signature": "def DeployContainer(self, base_name, container_spec)" }, { "docstring": "Deploys a ContainerSerivice according to the ContainerSpec.", "name": "DeployContainerService", "signatur...
2
null
Implement the Python class `KubernetesCluster` described below. Class description: A Kubernetes flavor of Container Cluster. Method signatures and docstrings: - def DeployContainer(self, base_name, container_spec): Deploys Containers according to the ContainerSpec. - def DeployContainerService(self, name, container_s...
Implement the Python class `KubernetesCluster` described below. Class description: A Kubernetes flavor of Container Cluster. Method signatures and docstrings: - def DeployContainer(self, base_name, container_spec): Deploys Containers according to the ContainerSpec. - def DeployContainerService(self, name, container_s...
86ff6a8c3aaf2407f6692d207208b7c60bca0d2f
<|skeleton|> class KubernetesCluster: """A Kubernetes flavor of Container Cluster.""" def DeployContainer(self, base_name, container_spec): """Deploys Containers according to the ContainerSpec.""" <|body_0|> def DeployContainerService(self, name, container_spec): """Deploys a Conta...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KubernetesCluster: """A Kubernetes flavor of Container Cluster.""" def DeployContainer(self, base_name, container_spec): """Deploys Containers according to the ContainerSpec.""" name = base_name + str(len(self.containers[base_name])) container = KubernetesContainer(container_spec,...
the_stack_v2_python_sparse
perfkitbenchmarker/container_service.py
sylvanasbeta/PerfKitBenchmarker
train
1
3d118cc93d51dbb468cf22f532c3136620d16d7e
[ "counter = 0\nlength = len(nums)\narray = {}\nfor i in range(len(nums) - 1, -1, -1):\n for index in range(length - i):\n sum = array.get(index, 0)\n array[index] = nums[i] + sum\n if array[index] == k:\n counter += 1\nreturn counter", "count = sum = 0\nmap = {}\nmap[0] = 1\nfor ...
<|body_start_0|> counter = 0 length = len(nums) array = {} for i in range(len(nums) - 1, -1, -1): for index in range(length - i): sum = array.get(index, 0) array[index] = nums[i] + sum if array[index] == k: c...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def subarraySum(self, nums, k): """:type nums: List[int] :type k: int :rtype: int""" <|body_0|> def subarraySum2(self, nums, k): """:type nums: List[int] :type k: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> counter = 0 ...
stack_v2_sparse_classes_36k_train_002672
1,119
no_license
[ { "docstring": ":type nums: List[int] :type k: int :rtype: int", "name": "subarraySum", "signature": "def subarraySum(self, nums, k)" }, { "docstring": ":type nums: List[int] :type k: int :rtype: int", "name": "subarraySum2", "signature": "def subarraySum2(self, nums, k)" } ]
2
stack_v2_sparse_classes_30k_train_017851
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def subarraySum(self, nums, k): :type nums: List[int] :type k: int :rtype: int - def subarraySum2(self, nums, k): :type nums: List[int] :type k: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def subarraySum(self, nums, k): :type nums: List[int] :type k: int :rtype: int - def subarraySum2(self, nums, k): :type nums: List[int] :type k: int :rtype: int <|skeleton|> cla...
a8b59573dc201438ebd5a5ab64e9ac61255a4abd
<|skeleton|> class Solution: def subarraySum(self, nums, k): """:type nums: List[int] :type k: int :rtype: int""" <|body_0|> def subarraySum2(self, nums, k): """:type nums: List[int] :type k: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def subarraySum(self, nums, k): """:type nums: List[int] :type k: int :rtype: int""" counter = 0 length = len(nums) array = {} for i in range(len(nums) - 1, -1, -1): for index in range(length - i): sum = array.get(index, 0) ...
the_stack_v2_python_sparse
summer/2018_07_13/subarray-sum-equals-k.py
shaheming/leecode
train
0
06bdb34f3ffc77a71db13eed330ae21a129c0a1f
[ "self.body_spec = body_spec\nself.nn_spec = nn_spec\nself.body_encoder = BodyEncoder(body_spec)\nself.brain_encoder = NeuralNetworkEncoder(nn_spec)", "yaml.add_representer(unicode, unicode_representer)\nbot_yaml = {}\nid = bot_pb.id\nbody = bot_pb.body\nbrain = bot_pb.brain\nbot_yaml['id'] = id\nbot_yaml['body'] ...
<|body_start_0|> self.body_spec = body_spec self.nn_spec = nn_spec self.body_encoder = BodyEncoder(body_spec) self.brain_encoder = NeuralNetworkEncoder(nn_spec) <|end_body_0|> <|body_start_1|> yaml.add_representer(unicode, unicode_representer) bot_yaml = {} id = ...
Sample converter creates a YAML stream from a Robot protobuf message and a body / neural net spec.
RobotToYaml
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RobotToYaml: """Sample converter creates a YAML stream from a Robot protobuf message and a body / neural net spec.""" def __init__(self, body_spec, nn_spec): """::param body_spec: :type body_spec: BodyImplementation :param nn_spec: :type nn_spec: NeuralNetImplementation""" <|...
stack_v2_sparse_classes_36k_train_002673
3,202
permissive
[ { "docstring": "::param body_spec: :type body_spec: BodyImplementation :param nn_spec: :type nn_spec: NeuralNetImplementation", "name": "__init__", "signature": "def __init__(self, body_spec, nn_spec)" }, { "docstring": "Converts a protobuf robot object into YAML file which it then returns :para...
2
stack_v2_sparse_classes_30k_test_000950
Implement the Python class `RobotToYaml` described below. Class description: Sample converter creates a YAML stream from a Robot protobuf message and a body / neural net spec. Method signatures and docstrings: - def __init__(self, body_spec, nn_spec): ::param body_spec: :type body_spec: BodyImplementation :param nn_s...
Implement the Python class `RobotToYaml` described below. Class description: Sample converter creates a YAML stream from a Robot protobuf message and a body / neural net spec. Method signatures and docstrings: - def __init__(self, body_spec, nn_spec): ::param body_spec: :type body_spec: BodyImplementation :param nn_s...
70e65320a28fe04e121145b2cdde289d3052728a
<|skeleton|> class RobotToYaml: """Sample converter creates a YAML stream from a Robot protobuf message and a body / neural net spec.""" def __init__(self, body_spec, nn_spec): """::param body_spec: :type body_spec: BodyImplementation :param nn_spec: :type nn_spec: NeuralNetImplementation""" <|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RobotToYaml: """Sample converter creates a YAML stream from a Robot protobuf message and a body / neural net spec.""" def __init__(self, body_spec, nn_spec): """::param body_spec: :type body_spec: BodyImplementation :param nn_spec: :type nn_spec: NeuralNetImplementation""" self.body_spec ...
the_stack_v2_python_sparse
revolve/convert/yaml.py
ElteHupkes/revolve
train
0
220d9922ce7854b19ab7d07d532f37bb7d621402
[ "if n == 0:\n return ['']\noutput = []\nfor c in range(n):\n for left in self.generates(c):\n for right in self.generates(n - 1 - c):\n output.append('({}){}'.format(left, right))\nreturn output", "def back_track(s='', left=0, right=0):\n if len(s) == n * 2:\n output.append(s)\n ...
<|body_start_0|> if n == 0: return [''] output = [] for c in range(n): for left in self.generates(c): for right in self.generates(n - 1 - c): output.append('({}){}'.format(left, right)) return output <|end_body_0|> <|body_start...
Parentheses
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Parentheses: def generates(self, n: int) -> List[str]: """Approach: Closure Time Complexity: O(4^n/root(n)) Space Complexity: O(4^n/root(n)) :param n: :return:""" <|body_0|> def generate(self, n: int) -> List[str]: """Approach: Back tracking Time Complexity: O(4^n/ro...
stack_v2_sparse_classes_36k_train_002674
1,294
no_license
[ { "docstring": "Approach: Closure Time Complexity: O(4^n/root(n)) Space Complexity: O(4^n/root(n)) :param n: :return:", "name": "generates", "signature": "def generates(self, n: int) -> List[str]" }, { "docstring": "Approach: Back tracking Time Complexity: O(4^n/root(n)) Space Complexity: O(4^n/...
2
null
Implement the Python class `Parentheses` described below. Class description: Implement the Parentheses class. Method signatures and docstrings: - def generates(self, n: int) -> List[str]: Approach: Closure Time Complexity: O(4^n/root(n)) Space Complexity: O(4^n/root(n)) :param n: :return: - def generate(self, n: int)...
Implement the Python class `Parentheses` described below. Class description: Implement the Parentheses class. Method signatures and docstrings: - def generates(self, n: int) -> List[str]: Approach: Closure Time Complexity: O(4^n/root(n)) Space Complexity: O(4^n/root(n)) :param n: :return: - def generate(self, n: int)...
65cc78b5afa0db064f9fe8f06597e3e120f7363d
<|skeleton|> class Parentheses: def generates(self, n: int) -> List[str]: """Approach: Closure Time Complexity: O(4^n/root(n)) Space Complexity: O(4^n/root(n)) :param n: :return:""" <|body_0|> def generate(self, n: int) -> List[str]: """Approach: Back tracking Time Complexity: O(4^n/ro...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Parentheses: def generates(self, n: int) -> List[str]: """Approach: Closure Time Complexity: O(4^n/root(n)) Space Complexity: O(4^n/root(n)) :param n: :return:""" if n == 0: return [''] output = [] for c in range(n): for left in self.generates(c): ...
the_stack_v2_python_sparse
revisited/back_tracking/generate_parentheses.py
Shiv2157k/leet_code
train
1
b19697dd2141337e43e8637db3d1b3194c5727c4
[ "inps = [model.input, K.learning_phase()]\nouts = [layer.output for layer in model.layers]\nself.forward_pass = K.function(inps, outs)\nself.model = model", "x_value = np.expand_dims(input_image, axis=0)\nvisual_bpr = None\nlayer_outs = self.forward_pass([x_value, 0])\nfor i in range(len(self.model.layers) - 1, -...
<|body_start_0|> inps = [model.input, K.learning_phase()] outs = [layer.output for layer in model.layers] self.forward_pass = K.function(inps, outs) self.model = model <|end_body_0|> <|body_start_1|> x_value = np.expand_dims(input_image, axis=0) visual_bpr = None ...
A SaliencyMask class that computes saliency masks with VisualBackprop (https://arxiv.org/abs/1611.05418).
VisualBackprop
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VisualBackprop: """A SaliencyMask class that computes saliency masks with VisualBackprop (https://arxiv.org/abs/1611.05418).""" def __init__(self, model, output_index=0): """Constructs a VisualProp SaliencyMask.""" <|body_0|> def get_mask(self, input_image): """R...
stack_v2_sparse_classes_36k_train_002675
2,437
permissive
[ { "docstring": "Constructs a VisualProp SaliencyMask.", "name": "__init__", "signature": "def __init__(self, model, output_index=0)" }, { "docstring": "Returns a VisualBackprop mask.", "name": "get_mask", "signature": "def get_mask(self, input_image)" }, { "docstring": "The decon...
3
stack_v2_sparse_classes_30k_train_009507
Implement the Python class `VisualBackprop` described below. Class description: A SaliencyMask class that computes saliency masks with VisualBackprop (https://arxiv.org/abs/1611.05418). Method signatures and docstrings: - def __init__(self, model, output_index=0): Constructs a VisualProp SaliencyMask. - def get_mask(...
Implement the Python class `VisualBackprop` described below. Class description: A SaliencyMask class that computes saliency masks with VisualBackprop (https://arxiv.org/abs/1611.05418). Method signatures and docstrings: - def __init__(self, model, output_index=0): Constructs a VisualProp SaliencyMask. - def get_mask(...
692785e881dc12a1500a9e651b07c7ff6fef6f9d
<|skeleton|> class VisualBackprop: """A SaliencyMask class that computes saliency masks with VisualBackprop (https://arxiv.org/abs/1611.05418).""" def __init__(self, model, output_index=0): """Constructs a VisualProp SaliencyMask.""" <|body_0|> def get_mask(self, input_image): """R...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class VisualBackprop: """A SaliencyMask class that computes saliency masks with VisualBackprop (https://arxiv.org/abs/1611.05418).""" def __init__(self, model, output_index=0): """Constructs a VisualProp SaliencyMask.""" inps = [model.input, K.learning_phase()] outs = [layer.output for ...
the_stack_v2_python_sparse
keras_explain/deep_viz_keras/visual_backprop.py
PrimozGodec/keras-explain
train
18
8bb21978e524a29431c1ac7687cd13b09d51e8dc
[ "super(Transformer, self).__init__()\nencoder_layer = TransformerEncoderLayer(d_model, num_heads, units, dropout, activation)\nencoder_norm = torch.nn.LayerNorm(d_model)\nself.encoder = TransformerEncoder(encoder_layer, num_encoder_layers, encoder_norm)\ndecoder_layer = TransformerDecoderLayer(d_model, num_heads, u...
<|body_start_0|> super(Transformer, self).__init__() encoder_layer = TransformerEncoderLayer(d_model, num_heads, units, dropout, activation) encoder_norm = torch.nn.LayerNorm(d_model) self.encoder = TransformerEncoder(encoder_layer, num_encoder_layers, encoder_norm) decoder_layer...
Transformer Model
Transformer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Transformer: """Transformer Model""" def __init__(self, d_model: int=512, num_heads: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, units: int=2048, dropout: float=0.1, activation: str='relu') -> NoReturn: """:param d_model: 深度,词嵌入维度 :param num_heads: 注意力头数 :param num_e...
stack_v2_sparse_classes_36k_train_002676
4,188
permissive
[ { "docstring": ":param d_model: 深度,词嵌入维度 :param num_heads: 注意力头数 :param num_encoder_layers: encoder层数 :param num_decoder_layers: decoder层数 :param units: 单元数 :param dropout: 采样率 :param activation: 激活方法", "name": "__init__", "signature": "def __init__(self, d_model: int=512, num_heads: int=8, num_encoder_...
3
stack_v2_sparse_classes_30k_train_011323
Implement the Python class `Transformer` described below. Class description: Transformer Model Method signatures and docstrings: - def __init__(self, d_model: int=512, num_heads: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, units: int=2048, dropout: float=0.1, activation: str='relu') -> NoReturn: :par...
Implement the Python class `Transformer` described below. Class description: Transformer Model Method signatures and docstrings: - def __init__(self, d_model: int=512, num_heads: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, units: int=2048, dropout: float=0.1, activation: str='relu') -> NoReturn: :par...
d47c1438cb5c45c2c2aebfb82fea92bef4c3d65c
<|skeleton|> class Transformer: """Transformer Model""" def __init__(self, d_model: int=512, num_heads: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, units: int=2048, dropout: float=0.1, activation: str='relu') -> NoReturn: """:param d_model: 深度,词嵌入维度 :param num_heads: 注意力头数 :param num_e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Transformer: """Transformer Model""" def __init__(self, d_model: int=512, num_heads: int=8, num_encoder_layers: int=6, num_decoder_layers: int=6, units: int=2048, dropout: float=0.1, activation: str='relu') -> NoReturn: """:param d_model: 深度,词嵌入维度 :param num_heads: 注意力头数 :param num_encoder_layers...
the_stack_v2_python_sparse
dialogue/pytorch/transformer/model.py
Jiadwu2/nlp-dialogue
train
0
f13b1fa990e6406d844d49d3acfb179377bb6dda
[ "super(ADBShellSSHConnection, self).__init__(*args, **kwargs)\nself.command_prefix += ' shell '\nself._unknown_command = None\nreturn", "if self._unknown_command is None:\n self._unknown_command = re.compile(SPACES.join([NAMED.format(n=COMMAND_GROUP, p=ALPHA + ONE_OR_MORE) + '/sh:', EVERYTHING, 'not', 'found']...
<|body_start_0|> super(ADBShellSSHConnection, self).__init__(*args, **kwargs) self.command_prefix += ' shell ' self._unknown_command = None return <|end_body_0|> <|body_start_1|> if self._unknown_command is None: self._unknown_command = re.compile(SPACES.join([NAMED....
A class to talk to the shell, note the adb-server
ADBShellSSHConnection
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ADBShellSSHConnection: """A class to talk to the shell, note the adb-server""" def __init__(self, *args, **kwargs): """:param: (see the ADBSSHConnection)""" <|body_0|> def unknown_command(self): """A regular expression to match unknown command errors. Uses: '\\w+...
stack_v2_sparse_classes_36k_train_002677
9,298
permissive
[ { "docstring": ":param: (see the ADBSSHConnection)", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "A regular expression to match unknown command errors. Uses: '\\\\w+/sh: *.* *not *found' :rtype: SRE_Pattern :return: regex to match unknown_command erro...
3
null
Implement the Python class `ADBShellSSHConnection` described below. Class description: A class to talk to the shell, note the adb-server Method signatures and docstrings: - def __init__(self, *args, **kwargs): :param: (see the ADBSSHConnection) - def unknown_command(self): A regular expression to match unknown comman...
Implement the Python class `ADBShellSSHConnection` described below. Class description: A class to talk to the shell, note the adb-server Method signatures and docstrings: - def __init__(self, *args, **kwargs): :param: (see the ADBSSHConnection) - def unknown_command(self): A regular expression to match unknown comman...
b4d1c77e1d611fe2b30768b42bdc7493afb0ea95
<|skeleton|> class ADBShellSSHConnection: """A class to talk to the shell, note the adb-server""" def __init__(self, *args, **kwargs): """:param: (see the ADBSSHConnection)""" <|body_0|> def unknown_command(self): """A regular expression to match unknown command errors. Uses: '\\w+...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ADBShellSSHConnection: """A class to talk to the shell, note the adb-server""" def __init__(self, *args, **kwargs): """:param: (see the ADBSSHConnection)""" super(ADBShellSSHConnection, self).__init__(*args, **kwargs) self.command_prefix += ' shell ' self._unknown_command ...
the_stack_v2_python_sparse
apetools/connections/adbconnection.py
russell-n/oldape
train
0
765e942119ad5c735ba49c67ca98f3ce40a55ace
[ "node_list = response.xpath(\"//tr[@class='even'] | //tr[@class='odd']\")\nfor node in node_list:\n item = TencentItem()\n item['position_name'] = node.xpath('./td[1]/a/text()').extract_first()\n item['position_link'] = 'https://hr.tencent.com/' + node.xpath('./td[1]/a/@href').extract_first()\n item['po...
<|body_start_0|> node_list = response.xpath("//tr[@class='even'] | //tr[@class='odd']") for node in node_list: item = TencentItem() item['position_name'] = node.xpath('./td[1]/a/text()').extract_first() item['position_link'] = 'https://hr.tencent.com/' + node.xpath('....
TencentSpider
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TencentSpider: def parse(self, response): """默认列表页的解析方法""" <|body_0|> def parse_detail(self, response): """解析详情页的响应内容""" <|body_1|> <|end_skeleton|> <|body_start_0|> node_list = response.xpath("//tr[@class='even'] | //tr[@class='odd']") for ...
stack_v2_sparse_classes_36k_train_002678
2,985
no_license
[ { "docstring": "默认列表页的解析方法", "name": "parse", "signature": "def parse(self, response)" }, { "docstring": "解析详情页的响应内容", "name": "parse_detail", "signature": "def parse_detail(self, response)" } ]
2
stack_v2_sparse_classes_30k_train_019682
Implement the Python class `TencentSpider` described below. Class description: Implement the TencentSpider class. Method signatures and docstrings: - def parse(self, response): 默认列表页的解析方法 - def parse_detail(self, response): 解析详情页的响应内容
Implement the Python class `TencentSpider` described below. Class description: Implement the TencentSpider class. Method signatures and docstrings: - def parse(self, response): 默认列表页的解析方法 - def parse_detail(self, response): 解析详情页的响应内容 <|skeleton|> class TencentSpider: def parse(self, response): """默认列表页...
a51e31acff41292e568ac22b0e213e6cb48218fa
<|skeleton|> class TencentSpider: def parse(self, response): """默认列表页的解析方法""" <|body_0|> def parse_detail(self, response): """解析详情页的响应内容""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TencentSpider: def parse(self, response): """默认列表页的解析方法""" node_list = response.xpath("//tr[@class='even'] | //tr[@class='odd']") for node in node_list: item = TencentItem() item['position_name'] = node.xpath('./td[1]/a/text()').extract_first() item[...
the_stack_v2_python_sparse
爬虫项目/code10/2.Spider类多级页面数据采集/Tencent2/Tencent2/spiders/tencent2.py
byst4nder/his_spider
train
1
3b68a7c7b99f0457a500ab76a2ca35bb0552376c
[ "self.uy = uy\nself.kocha = kocha\nself.tuman = tuman\nself.viloyat = viloyat", "manzil = f'{self.viloyat} viloyati, {self.tuman} tumani, '\nmanzil += f\"{self.kocha} ko'chasi, {self.uy}-uy\"\nreturn manzil" ]
<|body_start_0|> self.uy = uy self.kocha = kocha self.tuman = tuman self.viloyat = viloyat <|end_body_0|> <|body_start_1|> manzil = f'{self.viloyat} viloyati, {self.tuman} tumani, ' manzil += f"{self.kocha} ko'chasi, {self.uy}-uy" return manzil <|end_body_1|>
Manzil saqlash uchun klass
Manzil
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Manzil: """Manzil saqlash uchun klass""" def __init__(self, uy, kocha, tuman, viloyat): """Manzil xususiyatlari""" <|body_0|> def get_manzil(self): """Manzilni ko'rish""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.uy = uy self.koc...
stack_v2_sparse_classes_36k_train_002679
1,994
no_license
[ { "docstring": "Manzil xususiyatlari", "name": "__init__", "signature": "def __init__(self, uy, kocha, tuman, viloyat)" }, { "docstring": "Manzilni ko'rish", "name": "get_manzil", "signature": "def get_manzil(self)" } ]
2
null
Implement the Python class `Manzil` described below. Class description: Manzil saqlash uchun klass Method signatures and docstrings: - def __init__(self, uy, kocha, tuman, viloyat): Manzil xususiyatlari - def get_manzil(self): Manzilni ko'rish
Implement the Python class `Manzil` described below. Class description: Manzil saqlash uchun klass Method signatures and docstrings: - def __init__(self, uy, kocha, tuman, viloyat): Manzil xususiyatlari - def get_manzil(self): Manzilni ko'rish <|skeleton|> class Manzil: """Manzil saqlash uchun klass""" def ...
1fd2409b6b532fe6dd8cc9d6cb19753a40bbe83c
<|skeleton|> class Manzil: """Manzil saqlash uchun klass""" def __init__(self, uy, kocha, tuman, viloyat): """Manzil xususiyatlari""" <|body_0|> def get_manzil(self): """Manzilni ko'rish""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Manzil: """Manzil saqlash uchun klass""" def __init__(self, uy, kocha, tuman, viloyat): """Manzil xususiyatlari""" self.uy = uy self.kocha = kocha self.tuman = tuman self.viloyat = viloyat def get_manzil(self): """Manzilni ko'rish""" manzil = f...
the_stack_v2_python_sparse
30-inheritance/darslar-30-manzil.py
eldorbaxtiyorov/python-darslar
train
1
9c7e6e5d58e57bc5a0209e2dcb38a8a2cec6a092
[ "super(RNNDecoder, self).__init__()\nself.units = units\nself.batch = batch\nself.embedding = tf.keras.layers.Embedding(vocab, embedding)\nself.gru = tf.keras.layers.GRU(units, return_sequences=True, return_state=True, recurrent_initializer='glorot_uniform')\nself.F = tf.keras.layers.Dense(vocab)", "self_attentio...
<|body_start_0|> super(RNNDecoder, self).__init__() self.units = units self.batch = batch self.embedding = tf.keras.layers.Embedding(vocab, embedding) self.gru = tf.keras.layers.GRU(units, return_sequences=True, return_state=True, recurrent_initializer='glorot_uniform') s...
RNNDecoder class decodes for machine translation
RNNDecoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RNNDecoder: """RNNDecoder class decodes for machine translation""" def __init__(self, vocab, embedding, units, batch) -> None: """Initializer Arguments: vocab {int} -- Is representing the size of the input vocabulary embedding {int} -- Is representing the dimensionality of embedding ...
stack_v2_sparse_classes_36k_train_002680
2,173
no_license
[ { "docstring": "Initializer Arguments: vocab {int} -- Is representing the size of the input vocabulary embedding {int} -- Is representing the dimensionality of embedding units {int} -- Is the number of hidden units in the RNN cell batch {int} -- Is representing the batch size", "name": "__init__", "sign...
2
null
Implement the Python class `RNNDecoder` described below. Class description: RNNDecoder class decodes for machine translation Method signatures and docstrings: - def __init__(self, vocab, embedding, units, batch) -> None: Initializer Arguments: vocab {int} -- Is representing the size of the input vocabulary embedding ...
Implement the Python class `RNNDecoder` described below. Class description: RNNDecoder class decodes for machine translation Method signatures and docstrings: - def __init__(self, vocab, embedding, units, batch) -> None: Initializer Arguments: vocab {int} -- Is representing the size of the input vocabulary embedding ...
2ddae38cc25d914488451b8c30e1234f1fa55ebe
<|skeleton|> class RNNDecoder: """RNNDecoder class decodes for machine translation""" def __init__(self, vocab, embedding, units, batch) -> None: """Initializer Arguments: vocab {int} -- Is representing the size of the input vocabulary embedding {int} -- Is representing the dimensionality of embedding ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RNNDecoder: """RNNDecoder class decodes for machine translation""" def __init__(self, vocab, embedding, units, batch) -> None: """Initializer Arguments: vocab {int} -- Is representing the size of the input vocabulary embedding {int} -- Is representing the dimensionality of embedding units {int} -...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/2-rnn_decoder.py
KoeusIss/holbertonschool-machine_learning
train
0
bc4bd704e0e28659c92d5af3cf8dc43c1e6965be
[ "super(DecomposedLinear, self).__init__()\ndevice = layer.weight.device\nweight = layer.weight.data\nout_dim, in_dim = weight.shape\nout_rank, in_rank = ranks\nself.in_layer = nn.Linear(in_features=in_dim, out_features=in_rank, bias=False).to(device)\nself.core_layer = nn.Linear(in_features=in_rank, out_features=ou...
<|body_start_0|> super(DecomposedLinear, self).__init__() device = layer.weight.device weight = layer.weight.data out_dim, in_dim = weight.shape out_rank, in_rank = ranks self.in_layer = nn.Linear(in_features=in_dim, out_features=in_rank, bias=False).to(device) se...
Decomposed (or compressed) linear layer.
DecomposedLinear
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DecomposedLinear: """Decomposed (or compressed) linear layer.""" def __init__(self, layer, ranks, init=True): """Class initializer.""" <|body_0|> def forward(self, x): """Forward propagation.""" <|body_1|> <|end_skeleton|> <|body_start_0|> super...
stack_v2_sparse_classes_36k_train_002681
5,386
permissive
[ { "docstring": "Class initializer.", "name": "__init__", "signature": "def __init__(self, layer, ranks, init=True)" }, { "docstring": "Forward propagation.", "name": "forward", "signature": "def forward(self, x)" } ]
2
stack_v2_sparse_classes_30k_train_015207
Implement the Python class `DecomposedLinear` described below. Class description: Decomposed (or compressed) linear layer. Method signatures and docstrings: - def __init__(self, layer, ranks, init=True): Class initializer. - def forward(self, x): Forward propagation.
Implement the Python class `DecomposedLinear` described below. Class description: Decomposed (or compressed) linear layer. Method signatures and docstrings: - def __init__(self, layer, ranks, init=True): Class initializer. - def forward(self, x): Forward propagation. <|skeleton|> class DecomposedLinear: """Decom...
fe5d1eb5ab5453be70c4be473fd3da71afe4b06c
<|skeleton|> class DecomposedLinear: """Decomposed (or compressed) linear layer.""" def __init__(self, layer, ranks, init=True): """Class initializer.""" <|body_0|> def forward(self, x): """Forward propagation.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DecomposedLinear: """Decomposed (or compressed) linear layer.""" def __init__(self, layer, ranks, init=True): """Class initializer.""" super(DecomposedLinear, self).__init__() device = layer.weight.device weight = layer.weight.data out_dim, in_dim = weight.shape ...
the_stack_v2_python_sparse
src/kegnet/utils/tucker.py
videoturingtest/KegNet
train
0
85074eba64968786f4a0832b269de08ebfc4a5b3
[ "super().__init__()\nself.transformer = nn.Transformer(hidden_dim * 2, nheads, num_encoder_layers, num_decoder_layers, dropout=0.05)\nself.query_pos = nn.Parameter(torch.rand(100, hidden_dim * 2))\nself.row_embed = nn.Parameter(torch.rand(50, hidden_dim))\nself.col_embed = nn.Parameter(torch.rand(50, hidden_dim))\n...
<|body_start_0|> super().__init__() self.transformer = nn.Transformer(hidden_dim * 2, nheads, num_encoder_layers, num_decoder_layers, dropout=0.05) self.query_pos = nn.Parameter(torch.rand(100, hidden_dim * 2)) self.row_embed = nn.Parameter(torch.rand(50, hidden_dim)) self.col_em...
Decoder
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Decoder: def __init__(self, num_classes, hidden_dim: int=256, nheads: int=16, num_encoder_layers=6, num_decoder_layers=6): """num_classes: int, should be number of classes WITHOUT "no object" class""" <|body_0|> def forward(self, h_left: torch.Tensor, h_right: torch.Tensor):...
stack_v2_sparse_classes_36k_train_002682
9,933
permissive
[ { "docstring": "num_classes: int, should be number of classes WITHOUT \"no object\" class", "name": "__init__", "signature": "def __init__(self, num_classes, hidden_dim: int=256, nheads: int=16, num_encoder_layers=6, num_decoder_layers=6)" }, { "docstring": "h_left: N, C, H, W h_right: N, C, H, ...
2
stack_v2_sparse_classes_30k_train_012537
Implement the Python class `Decoder` described below. Class description: Implement the Decoder class. Method signatures and docstrings: - def __init__(self, num_classes, hidden_dim: int=256, nheads: int=16, num_encoder_layers=6, num_decoder_layers=6): num_classes: int, should be number of classes WITHOUT "no object" ...
Implement the Python class `Decoder` described below. Class description: Implement the Decoder class. Method signatures and docstrings: - def __init__(self, num_classes, hidden_dim: int=256, nheads: int=16, num_encoder_layers=6, num_decoder_layers=6): num_classes: int, should be number of classes WITHOUT "no object" ...
2f97eae4750ea9766bcad60c26dee9f9a14fafa4
<|skeleton|> class Decoder: def __init__(self, num_classes, hidden_dim: int=256, nheads: int=16, num_encoder_layers=6, num_decoder_layers=6): """num_classes: int, should be number of classes WITHOUT "no object" class""" <|body_0|> def forward(self, h_left: torch.Tensor, h_right: torch.Tensor):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Decoder: def __init__(self, num_classes, hidden_dim: int=256, nheads: int=16, num_encoder_layers=6, num_decoder_layers=6): """num_classes: int, should be number of classes WITHOUT "no object" class""" super().__init__() self.transformer = nn.Transformer(hidden_dim * 2, nheads, num_enco...
the_stack_v2_python_sparse
volume/fishdetr3d_alt.py
Napam/INF399-Master-DeepLearning
train
1
cc2bb94cdc1a11747fb1863437e7bc3f1f00b61c
[ "self._server_config = CONFIG\nsnmp_config = CONFIG_SNMP\nself._hostname = hostname\nself._snmp_object = None\nvalidate = snmp_manager.Validate(hostname, snmp_config.snmp_auth())\nsnmp_params = validate.credentials()\nif _do_poll(snmp_params) is True:\n self._snmp_object = snmp_manager.Interact(snmp_params)\nels...
<|body_start_0|> self._server_config = CONFIG snmp_config = CONFIG_SNMP self._hostname = hostname self._snmp_object = None validate = snmp_manager.Validate(hostname, snmp_config.snmp_auth()) snmp_params = validate.credentials() if _do_poll(snmp_params) is True: ...
Switchmap-NG agent that gathers data. Args: None Returns: None Functions: __init__: populate: post:
Poll
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Poll: """Switchmap-NG agent that gathers data. Args: None Returns: None Functions: __init__: populate: post:""" def __init__(self, hostname): """Method initializing the class. Args: hostname: Hostname to poll Returns: None""" <|body_0|> def query(self): """Query ...
stack_v2_sparse_classes_36k_train_002683
2,651
permissive
[ { "docstring": "Method initializing the class. Args: hostname: Hostname to poll Returns: None", "name": "__init__", "signature": "def __init__(self, hostname)" }, { "docstring": "Query all remote hosts for data. Args: None Returns: None", "name": "query", "signature": "def query(self)" ...
2
null
Implement the Python class `Poll` described below. Class description: Switchmap-NG agent that gathers data. Args: None Returns: None Functions: __init__: populate: post: Method signatures and docstrings: - def __init__(self, hostname): Method initializing the class. Args: hostname: Hostname to poll Returns: None - de...
Implement the Python class `Poll` described below. Class description: Switchmap-NG agent that gathers data. Args: None Returns: None Functions: __init__: populate: post: Method signatures and docstrings: - def __init__(self, hostname): Method initializing the class. Args: hostname: Hostname to poll Returns: None - de...
ae82589fbbab77fef6d6be09c1fcca5846f595a8
<|skeleton|> class Poll: """Switchmap-NG agent that gathers data. Args: None Returns: None Functions: __init__: populate: post:""" def __init__(self, hostname): """Method initializing the class. Args: hostname: Hostname to poll Returns: None""" <|body_0|> def query(self): """Query ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Poll: """Switchmap-NG agent that gathers data. Args: None Returns: None Functions: __init__: populate: post:""" def __init__(self, hostname): """Method initializing the class. Args: hostname: Hostname to poll Returns: None""" self._server_config = CONFIG snmp_config = CONFIG_SNMP ...
the_stack_v2_python_sparse
switchmap/snmp/poller.py
PalisadoesFoundation/switchmap-ng
train
8
6ddec57a7d6617d15cc6cea4d8d1852ca282272a
[ "len_a = self.len_list(headA)\nlen_b = self.len_list(headB)\nif len_a > len_b:\n gap = len_a - len_b\n while gap > 0:\n headA = headA.next\n gap -= 1\nelse:\n gap = len_b - len_a\n while gap > 0:\n headB = headB.next\n gap -= 1\nwhile headA and headB:\n if headA == headB:\...
<|body_start_0|> len_a = self.len_list(headA) len_b = self.len_list(headB) if len_a > len_b: gap = len_a - len_b while gap > 0: headA = headA.next gap -= 1 else: gap = len_b - len_a while gap > 0: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def getIntersectionNode(self, headA, headB): """:type headA, headB: ListNode :rtype: ListNode""" <|body_0|> def len_list(self, head): """:param head: ListNode :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> len_a = self.len_list(h...
stack_v2_sparse_classes_36k_train_002684
1,212
no_license
[ { "docstring": ":type headA, headB: ListNode :rtype: ListNode", "name": "getIntersectionNode", "signature": "def getIntersectionNode(self, headA, headB)" }, { "docstring": ":param head: ListNode :return:", "name": "len_list", "signature": "def len_list(self, head)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def getIntersectionNode(self, headA, headB): :type headA, headB: ListNode :rtype: ListNode - def len_list(self, head): :param head: ListNode :return:
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def getIntersectionNode(self, headA, headB): :type headA, headB: ListNode :rtype: ListNode - def len_list(self, head): :param head: ListNode :return: <|skeleton|> class Solution...
a75310a96d2b165b15d5ee10ec409a17cdc880ba
<|skeleton|> class Solution: def getIntersectionNode(self, headA, headB): """:type headA, headB: ListNode :rtype: ListNode""" <|body_0|> def len_list(self, head): """:param head: ListNode :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def getIntersectionNode(self, headA, headB): """:type headA, headB: ListNode :rtype: ListNode""" len_a = self.len_list(headA) len_b = self.len_list(headB) if len_a > len_b: gap = len_a - len_b while gap > 0: headA = headA.next ...
the_stack_v2_python_sparse
leetcode/linked_list/code/offer-52.py
skyxyz-lang/CS_Note
train
0
0e1c35cd8ab0cbcf2cacc0aae5f3a3d1ecdb0faa
[ "self.page = page\nself.per_page_count = per_page\nself.page_count = page_count\nself.page_url = page_url\npage_show_count = current_page_count\navg_page_count = page_show_count // 2\nself.start_page_show = page - avg_page_count\nself.end_page_show = page + avg_page_count\nif self.start_page_show <= 0:\n self.st...
<|body_start_0|> self.page = page self.per_page_count = per_page self.page_count = page_count self.page_url = page_url page_show_count = current_page_count avg_page_count = page_show_count // 2 self.start_page_show = page - avg_page_count self.end_page_sho...
Page
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Page: def __init__(self, page, page_count, page_url, per_page=10, current_page_count=10): """初始化分页的所有参数 :param page: :param page_count: :param page_url: :param per_page: :param current_page_count:""" <|body_0|> def get_page_show(self): """根据初始化的参数拼接page分页 :return:"""...
stack_v2_sparse_classes_36k_train_002685
4,235
no_license
[ { "docstring": "初始化分页的所有参数 :param page: :param page_count: :param page_url: :param per_page: :param current_page_count:", "name": "__init__", "signature": "def __init__(self, page, page_count, page_url, per_page=10, current_page_count=10)" }, { "docstring": "根据初始化的参数拼接page分页 :return:", "name...
2
stack_v2_sparse_classes_30k_train_009697
Implement the Python class `Page` described below. Class description: Implement the Page class. Method signatures and docstrings: - def __init__(self, page, page_count, page_url, per_page=10, current_page_count=10): 初始化分页的所有参数 :param page: :param page_count: :param page_url: :param per_page: :param current_page_count...
Implement the Python class `Page` described below. Class description: Implement the Page class. Method signatures and docstrings: - def __init__(self, page, page_count, page_url, per_page=10, current_page_count=10): 初始化分页的所有参数 :param page: :param page_count: :param page_url: :param per_page: :param current_page_count...
5a1a6dd59cdd903563389fa7c73a283e8657d731
<|skeleton|> class Page: def __init__(self, page, page_count, page_url, per_page=10, current_page_count=10): """初始化分页的所有参数 :param page: :param page_count: :param page_url: :param per_page: :param current_page_count:""" <|body_0|> def get_page_show(self): """根据初始化的参数拼接page分页 :return:"""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Page: def __init__(self, page, page_count, page_url, per_page=10, current_page_count=10): """初始化分页的所有参数 :param page: :param page_count: :param page_url: :param per_page: :param current_page_count:""" self.page = page self.per_page_count = per_page self.page_count = page_count ...
the_stack_v2_python_sparse
python/Django/20190625/test01/utils/page.py
wjl626nice/1902
train
4
e28b0b77a0b0103929b573c155153bdf76f45e91
[ "super(GaussianNoise, self).__init__()\nself._mu = mu\nassert sigma >= 0, \"GaussianNoise's sigma should be positive.\"\nself._sigma = sigma", "noise = torch.randn(shape, device=device)\nnoise = noise * self._sigma + self._mu\nreturn noise" ]
<|body_start_0|> super(GaussianNoise, self).__init__() self._mu = mu assert sigma >= 0, "GaussianNoise's sigma should be positive." self._sigma = sigma <|end_body_0|> <|body_start_1|> noise = torch.randn(shape, device=device) noise = noise * self._sigma + self._mu ...
Overview: Derived class for generating gaussian noise, which satisfies :math:`X \\sim N(\\mu, \\sigma^2)` Interface: __init__, __call__
GaussianNoise
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GaussianNoise: """Overview: Derived class for generating gaussian noise, which satisfies :math:`X \\sim N(\\mu, \\sigma^2)` Interface: __init__, __call__""" def __init__(self, mu: float=0.0, sigma: float=1.0) -> None: """Overview: Initialize :math:`\\mu` and :math:`\\sigma` in Gaussi...
stack_v2_sparse_classes_36k_train_002686
7,610
permissive
[ { "docstring": "Overview: Initialize :math:`\\\\mu` and :math:`\\\\sigma` in Gaussian Distribution Arguments: - mu (:obj:`float`): :math:`\\\\mu` , mean value - sigma (:obj:`float`): :math:`\\\\sigma` , standard deviation, should be positive", "name": "__init__", "signature": "def __init__(self, mu: flo...
2
null
Implement the Python class `GaussianNoise` described below. Class description: Overview: Derived class for generating gaussian noise, which satisfies :math:`X \\sim N(\\mu, \\sigma^2)` Interface: __init__, __call__ Method signatures and docstrings: - def __init__(self, mu: float=0.0, sigma: float=1.0) -> None: Overvi...
Implement the Python class `GaussianNoise` described below. Class description: Overview: Derived class for generating gaussian noise, which satisfies :math:`X \\sim N(\\mu, \\sigma^2)` Interface: __init__, __call__ Method signatures and docstrings: - def __init__(self, mu: float=0.0, sigma: float=1.0) -> None: Overvi...
eb483fa6e46602d58c8e7d2ca1e566adca28e703
<|skeleton|> class GaussianNoise: """Overview: Derived class for generating gaussian noise, which satisfies :math:`X \\sim N(\\mu, \\sigma^2)` Interface: __init__, __call__""" def __init__(self, mu: float=0.0, sigma: float=1.0) -> None: """Overview: Initialize :math:`\\mu` and :math:`\\sigma` in Gaussi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GaussianNoise: """Overview: Derived class for generating gaussian noise, which satisfies :math:`X \\sim N(\\mu, \\sigma^2)` Interface: __init__, __call__""" def __init__(self, mu: float=0.0, sigma: float=1.0) -> None: """Overview: Initialize :math:`\\mu` and :math:`\\sigma` in Gaussian Distributi...
the_stack_v2_python_sparse
ding/rl_utils/exploration.py
shengxuesun/DI-engine
train
1
51c6a749ce8e9be0b4b63a8604f008556254ccbb
[ "super(DecodePredictions, self).__init__(**kwargs)\nself.anchor_box = AnchorBox()\nself.box_variance = tf.convert_to_tensor([0.1, 0.1, 0.2, 0.2], dtype=tf.float32)\nself.max_detections_per_class = max_detections_per_class\nself.max_detections = max_detections\nself.nms_iou_threshold = nms_iou_threshold\nself.confid...
<|body_start_0|> super(DecodePredictions, self).__init__(**kwargs) self.anchor_box = AnchorBox() self.box_variance = tf.convert_to_tensor([0.1, 0.1, 0.2, 0.2], dtype=tf.float32) self.max_detections_per_class = max_detections_per_class self.max_detections = max_detections ...
解码预测值网络层, 将RetinaNet的预测值使用非极大值抑制解码成人类可读形式. Attributes: anchor_box: RetinaNet.preprocessing.label_ops.AnchorBox, 锚框. box_variance: tf.Tensor, 框方差, 用来增大损失(小于1), 便于计算梯度. max_detections_per_class: int, default=100, 每类目标出现的最大数量. max_detections: int, default=100, 图片上出现的目前的最大数量. nms_iou_threshold: float, default=0.5, 使用非极大值抑制...
DecodePredictions
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DecodePredictions: """解码预测值网络层, 将RetinaNet的预测值使用非极大值抑制解码成人类可读形式. Attributes: anchor_box: RetinaNet.preprocessing.label_ops.AnchorBox, 锚框. box_variance: tf.Tensor, 框方差, 用来增大损失(小于1), 便于计算梯度. max_detections_per_class: int, default=100, 每类目标出现的最大数量. max_detections: int, default=100, 图片上出现的目前的最大数量. nm...
stack_v2_sparse_classes_36k_train_002687
3,904
permissive
[ { "docstring": "初始化解码预测值网络层. Args: max_detections_per_class: int, default=100, 每类目标出现的最大数量. max_detections: int, default=100, 图片上出现的目前的最大数量. nms_iou_threshold: float, default=0.5, 使用非极大值抑制时的IoU阈值. confidence_threshold: float, default=00.5, 样本置信度阈值.", "name": "__init__", "signature": "def __init__(self, ...
3
stack_v2_sparse_classes_30k_train_009483
Implement the Python class `DecodePredictions` described below. Class description: 解码预测值网络层, 将RetinaNet的预测值使用非极大值抑制解码成人类可读形式. Attributes: anchor_box: RetinaNet.preprocessing.label_ops.AnchorBox, 锚框. box_variance: tf.Tensor, 框方差, 用来增大损失(小于1), 便于计算梯度. max_detections_per_class: int, default=100, 每类目标出现的最大数量. max_detectio...
Implement the Python class `DecodePredictions` described below. Class description: 解码预测值网络层, 将RetinaNet的预测值使用非极大值抑制解码成人类可读形式. Attributes: anchor_box: RetinaNet.preprocessing.label_ops.AnchorBox, 锚框. box_variance: tf.Tensor, 框方差, 用来增大损失(小于1), 便于计算梯度. max_detections_per_class: int, default=100, 每类目标出现的最大数量. max_detectio...
357edda03cdc1f976764b6ed4fcad6e639646142
<|skeleton|> class DecodePredictions: """解码预测值网络层, 将RetinaNet的预测值使用非极大值抑制解码成人类可读形式. Attributes: anchor_box: RetinaNet.preprocessing.label_ops.AnchorBox, 锚框. box_variance: tf.Tensor, 框方差, 用来增大损失(小于1), 便于计算梯度. max_detections_per_class: int, default=100, 每类目标出现的最大数量. max_detections: int, default=100, 图片上出现的目前的最大数量. nm...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DecodePredictions: """解码预测值网络层, 将RetinaNet的预测值使用非极大值抑制解码成人类可读形式. Attributes: anchor_box: RetinaNet.preprocessing.label_ops.AnchorBox, 锚框. box_variance: tf.Tensor, 框方差, 用来增大损失(小于1), 便于计算梯度. max_detections_per_class: int, default=100, 每类目标出现的最大数量. max_detections: int, default=100, 图片上出现的目前的最大数量. nms_iou_thresho...
the_stack_v2_python_sparse
RetinaNet/model/decode_predictions.py
sun1638650145/RetinaNet
train
2
8a6066a5bb7e4ea269a605e65c427388c0d8bdd4
[ "output = []\nif len(matrix[0]) == 0:\n return []\nexpected_out_len = len(matrix) * len(matrix[0])\nfor i in matrix[0]:\n output.append(i)\ndel matrix[0]\nreversed = list(zip(*matrix))\nwhile reversed:\n for i in reversed[-1]:\n output.append(i)\n del reversed[-1]\n reversed = list(zip(*revers...
<|body_start_0|> output = [] if len(matrix[0]) == 0: return [] expected_out_len = len(matrix) * len(matrix[0]) for i in matrix[0]: output.append(i) del matrix[0] reversed = list(zip(*matrix)) while reversed: for i in reversed[-1...
SpiralMatrix
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SpiralMatrix: def spiralOrder(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" <|body_0|> def spiralOrder1(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> output =...
stack_v2_sparse_classes_36k_train_002688
1,808
no_license
[ { "docstring": ":type matrix: List[List[int]] :rtype: List[int]", "name": "spiralOrder", "signature": "def spiralOrder(self, matrix)" }, { "docstring": ":type matrix: List[List[int]] :rtype: List[int]", "name": "spiralOrder1", "signature": "def spiralOrder1(self, matrix)" } ]
2
null
Implement the Python class `SpiralMatrix` described below. Class description: Implement the SpiralMatrix class. Method signatures and docstrings: - def spiralOrder(self, matrix): :type matrix: List[List[int]] :rtype: List[int] - def spiralOrder1(self, matrix): :type matrix: List[List[int]] :rtype: List[int]
Implement the Python class `SpiralMatrix` described below. Class description: Implement the SpiralMatrix class. Method signatures and docstrings: - def spiralOrder(self, matrix): :type matrix: List[List[int]] :rtype: List[int] - def spiralOrder1(self, matrix): :type matrix: List[List[int]] :rtype: List[int] <|skelet...
6163a781364e4a79f03543cc151cea77c6738369
<|skeleton|> class SpiralMatrix: def spiralOrder(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" <|body_0|> def spiralOrder1(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SpiralMatrix: def spiralOrder(self, matrix): """:type matrix: List[List[int]] :rtype: List[int]""" output = [] if len(matrix[0]) == 0: return [] expected_out_len = len(matrix) * len(matrix[0]) for i in matrix[0]: output.append(i) del matr...
the_stack_v2_python_sparse
SpiralMatrix.py
MichaelArslangul/python_Sandbox
train
0
dc51a51fdb8487c872371d1707baa72d27f6027e
[ "tag = get_object_or_404(Tag, pk=pk)\nself.check_object_permissions(request, tag)\nserializer = TagRetrieveUpdateDestroySerializer(tag, many=False)\nreturn Response(data=serializer.data, status=status.HTTP_200_OK)", "tag = get_object_or_404(Tag, pk=pk)\nself.check_object_permissions(request, tag)\nserializer = Ta...
<|body_start_0|> tag = get_object_or_404(Tag, pk=pk) self.check_object_permissions(request, tag) serializer = TagRetrieveUpdateDestroySerializer(tag, many=False) return Response(data=serializer.data, status=status.HTTP_200_OK) <|end_body_0|> <|body_start_1|> tag = get_object_or_...
TagRetrieveUpdateDestroyAPIView
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TagRetrieveUpdateDestroyAPIView: def get(self, request, pk=None): """Retrieve""" <|body_0|> def put(self, request, pk=None): """Update""" <|body_1|> def delete(self, request, pk=None): """Delete""" <|body_2|> <|end_skeleton|> <|body_sta...
stack_v2_sparse_classes_36k_train_002689
2,948
permissive
[ { "docstring": "Retrieve", "name": "get", "signature": "def get(self, request, pk=None)" }, { "docstring": "Update", "name": "put", "signature": "def put(self, request, pk=None)" }, { "docstring": "Delete", "name": "delete", "signature": "def delete(self, request, pk=None...
3
stack_v2_sparse_classes_30k_test_000794
Implement the Python class `TagRetrieveUpdateDestroyAPIView` described below. Class description: Implement the TagRetrieveUpdateDestroyAPIView class. Method signatures and docstrings: - def get(self, request, pk=None): Retrieve - def put(self, request, pk=None): Update - def delete(self, request, pk=None): Delete
Implement the Python class `TagRetrieveUpdateDestroyAPIView` described below. Class description: Implement the TagRetrieveUpdateDestroyAPIView class. Method signatures and docstrings: - def get(self, request, pk=None): Retrieve - def put(self, request, pk=None): Update - def delete(self, request, pk=None): Delete <|...
289318b0333d830c089f4492716c38d409c365ed
<|skeleton|> class TagRetrieveUpdateDestroyAPIView: def get(self, request, pk=None): """Retrieve""" <|body_0|> def put(self, request, pk=None): """Update""" <|body_1|> def delete(self, request, pk=None): """Delete""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TagRetrieveUpdateDestroyAPIView: def get(self, request, pk=None): """Retrieve""" tag = get_object_or_404(Tag, pk=pk) self.check_object_permissions(request, tag) serializer = TagRetrieveUpdateDestroySerializer(tag, many=False) return Response(data=serializer.data, status...
the_stack_v2_python_sparse
workery/tenant_api/views/tag.py
wahello/workery-django
train
0
67aa284bdcc63ba77e510d6cb03cdedaa9c3ddc8
[ "latest = self._latest()\nif latest is None:\n return None\nreturn SparkCloud(SparkSettings().API_URI, latest.access_token)", "latest = self._latest()\nif latest is None:\n return None\nreturn latest.access_token", "latest = self._latest()\nif latest is None or latest.expires_soon():\n cloud = SparkClo...
<|body_start_0|> latest = self._latest() if latest is None: return None return SparkCloud(SparkSettings().API_URI, latest.access_token) <|end_body_0|> <|body_start_1|> latest = self._latest() if latest is None: return None return latest.access_tok...
Custom model manager for `CloudCredentials`.
CloudCredentialsManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CloudCredentialsManager: """Custom model manager for `CloudCredentials`.""" def cloud_service(self): """Get a cloud service instance initialized with the most current credentials.""" <|body_0|> def _access_token(self): """Get the most recent valid `access_token`,...
stack_v2_sparse_classes_36k_train_002690
5,716
no_license
[ { "docstring": "Get a cloud service instance initialized with the most current credentials.", "name": "cloud_service", "signature": "def cloud_service(self)" }, { "docstring": "Get the most recent valid `access_token`, if one isn't found then None is returned.", "name": "_access_token", ...
6
stack_v2_sparse_classes_30k_train_016687
Implement the Python class `CloudCredentialsManager` described below. Class description: Custom model manager for `CloudCredentials`. Method signatures and docstrings: - def cloud_service(self): Get a cloud service instance initialized with the most current credentials. - def _access_token(self): Get the most recent ...
Implement the Python class `CloudCredentialsManager` described below. Class description: Custom model manager for `CloudCredentials`. Method signatures and docstrings: - def cloud_service(self): Get a cloud service instance initialized with the most current credentials. - def _access_token(self): Get the most recent ...
c7d792db975b72b9b058298f9309238da05351a9
<|skeleton|> class CloudCredentialsManager: """Custom model manager for `CloudCredentials`.""" def cloud_service(self): """Get a cloud service instance initialized with the most current credentials.""" <|body_0|> def _access_token(self): """Get the most recent valid `access_token`,...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CloudCredentialsManager: """Custom model manager for `CloudCredentials`.""" def cloud_service(self): """Get a cloud service instance initialized with the most current credentials.""" latest = self._latest() if latest is None: return None return SparkCloud(Spark...
the_stack_v2_python_sparse
sparkdoor/apps/spark/models.py
dummerbd/sparkdoor
train
0
a35d3b721d3bda8b25c3dec503597fc393dda2fa
[ "self.Whf = np.random.normal(size=(i + h, h))\nself.Whb = np.random.normal(size=(i + h, h))\nself.Wy = np.random.normal(size=(h + h, o))\nself.bhf = np.zeros((1, h))\nself.bhb = np.zeros((1, h))\nself.by = np.zeros((1, o))", "concat = np.concatenate((h_prev, x_t), axis=1)\nh_next = np.tanh(concat @ self.Whf + sel...
<|body_start_0|> self.Whf = np.random.normal(size=(i + h, h)) self.Whb = np.random.normal(size=(i + h, h)) self.Wy = np.random.normal(size=(h + h, o)) self.bhf = np.zeros((1, h)) self.bhb = np.zeros((1, h)) self.by = np.zeros((1, o)) <|end_body_0|> <|body_start_1|> ...
Represents a bidirectional cell of an RNN
BidirectionalCell
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BidirectionalCell: """Represents a bidirectional cell of an RNN""" def __init__(self, i, h, o): """Class constructor""" <|body_0|> def forward(self, h_prev, x_t): """Calculates the hidden state in the forward direction for one time step. Returns: h_next""" ...
stack_v2_sparse_classes_36k_train_002691
1,460
no_license
[ { "docstring": "Class constructor", "name": "__init__", "signature": "def __init__(self, i, h, o)" }, { "docstring": "Calculates the hidden state in the forward direction for one time step. Returns: h_next", "name": "forward", "signature": "def forward(self, h_prev, x_t)" }, { "d...
3
null
Implement the Python class `BidirectionalCell` described below. Class description: Represents a bidirectional cell of an RNN Method signatures and docstrings: - def __init__(self, i, h, o): Class constructor - def forward(self, h_prev, x_t): Calculates the hidden state in the forward direction for one time step. Retu...
Implement the Python class `BidirectionalCell` described below. Class description: Represents a bidirectional cell of an RNN Method signatures and docstrings: - def __init__(self, i, h, o): Class constructor - def forward(self, h_prev, x_t): Calculates the hidden state in the forward direction for one time step. Retu...
161e33b23d398d7d01ad0d7740b78dda3f27e787
<|skeleton|> class BidirectionalCell: """Represents a bidirectional cell of an RNN""" def __init__(self, i, h, o): """Class constructor""" <|body_0|> def forward(self, h_prev, x_t): """Calculates the hidden state in the forward direction for one time step. Returns: h_next""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BidirectionalCell: """Represents a bidirectional cell of an RNN""" def __init__(self, i, h, o): """Class constructor""" self.Whf = np.random.normal(size=(i + h, h)) self.Whb = np.random.normal(size=(i + h, h)) self.Wy = np.random.normal(size=(h + h, o)) self.bhf = ...
the_stack_v2_python_sparse
supervised_learning/0x0D-RNNs/6-bi_backward.py
felipeserna/holbertonschool-machine_learning
train
0
eab857f30da47331032acbe062f2a8aa906a001f
[ "self._memory_raise = memory_raise\nself._kernel = kernel\nself._conv_pixels = conv_pixels\nself._nx, self._ny = np.shape(conv_pixels)\nif compute_pixels is None:\n compute_pixels = np.ones_like(conv_pixels)\n compute_pixels = np.array(compute_pixels, dtype=bool)\nassert np.shape(conv_pixels) == np.shape(comp...
<|body_start_0|> self._memory_raise = memory_raise self._kernel = kernel self._conv_pixels = conv_pixels self._nx, self._ny = np.shape(conv_pixels) if compute_pixels is None: compute_pixels = np.ones_like(conv_pixels) compute_pixels = np.array(compute_pixe...
class to convolve explicit pixels only the convolution is inspired by pyautolens: https://github.com/Jammy2211/PyAutoLens
NumbaConvolution
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumbaConvolution: """class to convolve explicit pixels only the convolution is inspired by pyautolens: https://github.com/Jammy2211/PyAutoLens""" def __init__(self, kernel, conv_pixels, compute_pixels=None, nopython=True, cache=True, parallel=False, memory_raise=True): """:param kern...
stack_v2_sparse_classes_36k_train_002692
11,652
permissive
[ { "docstring": ":param kernel: convolution kernel in units of the image pixels provided, odd length per axis :param conv_pixels: bool array same size as data, pixels to be convolved and their light to be blurred :param compute_pixels: bool array of size of image, these pixels (if True) will get blurred light fr...
4
null
Implement the Python class `NumbaConvolution` described below. Class description: class to convolve explicit pixels only the convolution is inspired by pyautolens: https://github.com/Jammy2211/PyAutoLens Method signatures and docstrings: - def __init__(self, kernel, conv_pixels, compute_pixels=None, nopython=True, ca...
Implement the Python class `NumbaConvolution` described below. Class description: class to convolve explicit pixels only the convolution is inspired by pyautolens: https://github.com/Jammy2211/PyAutoLens Method signatures and docstrings: - def __init__(self, kernel, conv_pixels, compute_pixels=None, nopython=True, ca...
73c9645f26f6983fe7961104075ebe8bf7a4b54c
<|skeleton|> class NumbaConvolution: """class to convolve explicit pixels only the convolution is inspired by pyautolens: https://github.com/Jammy2211/PyAutoLens""" def __init__(self, kernel, conv_pixels, compute_pixels=None, nopython=True, cache=True, parallel=False, memory_raise=True): """:param kern...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NumbaConvolution: """class to convolve explicit pixels only the convolution is inspired by pyautolens: https://github.com/Jammy2211/PyAutoLens""" def __init__(self, kernel, conv_pixels, compute_pixels=None, nopython=True, cache=True, parallel=False, memory_raise=True): """:param kernel: convoluti...
the_stack_v2_python_sparse
lenstronomy/ImSim/Numerics/numba_convolution.py
lenstronomy/lenstronomy
train
41
aa9a8f904c78f4d42eb038f8faccabf856f48b0a
[ "with tf.gfile.GFile(model_path, 'rb') as f:\n graph_def = tf.GraphDef()\n graph_def.ParseFromString(f.read())\ngraph = tf.Graph()\nwith graph.as_default():\n tf.import_graph_def(graph_def, name='import')\nself.input_image = graph.get_tensor_by_name('import/image_tensor:0')\nself.output_ops = [graph.get_te...
<|body_start_0|> with tf.gfile.GFile(model_path, 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) graph = tf.Graph() with graph.as_default(): tf.import_graph_def(graph_def, name='import') self.input_image = graph.get_tensor_by_...
FaceDetector
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FaceDetector: def __init__(self, model_path): """Arguments: model_path: a string, path to a pb file.""" <|body_0|> def __call__(self, image, score_threshold=0.5): """Detect faces. Arguments: image: a numpy uint8 array with shape [height, width, 3], that represents a ...
stack_v2_sparse_classes_36k_train_002693
2,412
permissive
[ { "docstring": "Arguments: model_path: a string, path to a pb file.", "name": "__init__", "signature": "def __init__(self, model_path)" }, { "docstring": "Detect faces. Arguments: image: a numpy uint8 array with shape [height, width, 3], that represents a RGB image. score_threshold: a float numb...
2
stack_v2_sparse_classes_30k_train_003227
Implement the Python class `FaceDetector` described below. Class description: Implement the FaceDetector class. Method signatures and docstrings: - def __init__(self, model_path): Arguments: model_path: a string, path to a pb file. - def __call__(self, image, score_threshold=0.5): Detect faces. Arguments: image: a nu...
Implement the Python class `FaceDetector` described below. Class description: Implement the FaceDetector class. Method signatures and docstrings: - def __init__(self, model_path): Arguments: model_path: a string, path to a pb file. - def __call__(self, image, score_threshold=0.5): Detect faces. Arguments: image: a nu...
8f701ea68515927163d5904d58262d1b480a9a97
<|skeleton|> class FaceDetector: def __init__(self, model_path): """Arguments: model_path: a string, path to a pb file.""" <|body_0|> def __call__(self, image, score_threshold=0.5): """Detect faces. Arguments: image: a numpy uint8 array with shape [height, width, 3], that represents a ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FaceDetector: def __init__(self, model_path): """Arguments: model_path: a string, path to a pb file.""" with tf.gfile.GFile(model_path, 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) graph = tf.Graph() with graph.as_default(): ...
the_stack_v2_python_sparse
faceR/alignment/face_boxes.py
hritools/faceR
train
0
7b11f370668ec6220db220bb569eae5578e71243
[ "self.sigma = sigma\nself.use_errors = use_errors\nself.use_widths = use_widths", "sigma = config('prior_passer', 'sigma')\nuse_errors = config('prior_passer', 'use_errors')\nuse_widths = config('prior_passer', 'use_widths')\nreturn PriorPasser(sigma=sigma, use_errors=use_errors, use_widths=use_widths)" ]
<|body_start_0|> self.sigma = sigma self.use_errors = use_errors self.use_widths = use_widths <|end_body_0|> <|body_start_1|> sigma = config('prior_passer', 'sigma') use_errors = config('prior_passer', 'use_errors') use_widths = config('prior_passer', 'use_widths') ...
PriorPasser
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PriorPasser: def __init__(self, sigma, use_errors, use_widths): """Class to package the API for prior passing. This class contains the parameters that controls how priors are passed from the results of one non-linear search to the next. Using the Phase API, we can pass priors from the re...
stack_v2_sparse_classes_36k_train_002694
29,292
permissive
[ { "docstring": "Class to package the API for prior passing. This class contains the parameters that controls how priors are passed from the results of one non-linear search to the next. Using the Phase API, we can pass priors from the result of one search to another follows: model_component.parameter = search1_...
2
null
Implement the Python class `PriorPasser` described below. Class description: Implement the PriorPasser class. Method signatures and docstrings: - def __init__(self, sigma, use_errors, use_widths): Class to package the API for prior passing. This class contains the parameters that controls how priors are passed from t...
Implement the Python class `PriorPasser` described below. Class description: Implement the PriorPasser class. Method signatures and docstrings: - def __init__(self, sigma, use_errors, use_widths): Class to package the API for prior passing. This class contains the parameters that controls how priors are passed from t...
324007a6bbda32baf94f09918e0aef04fda0c7d0
<|skeleton|> class PriorPasser: def __init__(self, sigma, use_errors, use_widths): """Class to package the API for prior passing. This class contains the parameters that controls how priors are passed from the results of one non-linear search to the next. Using the Phase API, we can pass priors from the re...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PriorPasser: def __init__(self, sigma, use_errors, use_widths): """Class to package the API for prior passing. This class contains the parameters that controls how priors are passed from the results of one non-linear search to the next. Using the Phase API, we can pass priors from the result of one se...
the_stack_v2_python_sparse
autofit/non_linear/abstract_search.py
philastrophist/PyAutoFit
train
0
608bb69fed018b3543f702428b642d34a23c2328
[ "if not os.path.isdir(path + 'birdvox_dcase_20k'):\n print('Creating birdvox_dcase_20k Directory')\n os.mkdir(path + 'birdvox_dcase_20k')\nbase = 'https://zenodo.org/record/1208080/files/'\nfilename = 'BirdVox-DCASE-20k.zip'\nif not os.path.exists(path + 'birdvox_dcase_20k/' + filename):\n url = base + fil...
<|body_start_0|> if not os.path.isdir(path + 'birdvox_dcase_20k'): print('Creating birdvox_dcase_20k Directory') os.mkdir(path + 'birdvox_dcase_20k') base = 'https://zenodo.org/record/1208080/files/' filename = 'BirdVox-DCASE-20k.zip' if not os.path.exists(path + ...
Binary bird detection classification Dataset is 16.5Go compressed. BirdVox-DCASE-20k: a dataset for bird audio detection in 10-second clips Version 2.0, March 2018. Created By Vincent Lostanlen (1, 2, 3), Justin Salamon (2, 3), Andrew Farnsworth (1), Steve Kelling (1), and Juan Pablo Bello (2, 3). (1): Cornell Lab of O...
birdvox_dcase_20k
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class birdvox_dcase_20k: """Binary bird detection classification Dataset is 16.5Go compressed. BirdVox-DCASE-20k: a dataset for bird audio detection in 10-second clips Version 2.0, March 2018. Created By Vincent Lostanlen (1, 2, 3), Justin Salamon (2, 3), Andrew Farnsworth (1), Steve Kelling (1), and J...
stack_v2_sparse_classes_36k_train_002695
6,924
permissive
[ { "docstring": "Download the Birdvox dataset and store the result into the given path Parameters ---------- path: str the path where the downloaded files will be stored. If the directory does not exist, it is created.", "name": "download", "signature": "def download(path)" }, { "docstring": "Par...
2
stack_v2_sparse_classes_30k_train_015024
Implement the Python class `birdvox_dcase_20k` described below. Class description: Binary bird detection classification Dataset is 16.5Go compressed. BirdVox-DCASE-20k: a dataset for bird audio detection in 10-second clips Version 2.0, March 2018. Created By Vincent Lostanlen (1, 2, 3), Justin Salamon (2, 3), Andrew F...
Implement the Python class `birdvox_dcase_20k` described below. Class description: Binary bird detection classification Dataset is 16.5Go compressed. BirdVox-DCASE-20k: a dataset for bird audio detection in 10-second clips Version 2.0, March 2018. Created By Vincent Lostanlen (1, 2, 3), Justin Salamon (2, 3), Andrew F...
d8778c2eb3254b478cef4f45d934bf921e695619
<|skeleton|> class birdvox_dcase_20k: """Binary bird detection classification Dataset is 16.5Go compressed. BirdVox-DCASE-20k: a dataset for bird audio detection in 10-second clips Version 2.0, March 2018. Created By Vincent Lostanlen (1, 2, 3), Justin Salamon (2, 3), Andrew Farnsworth (1), Steve Kelling (1), and J...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class birdvox_dcase_20k: """Binary bird detection classification Dataset is 16.5Go compressed. BirdVox-DCASE-20k: a dataset for bird audio detection in 10-second clips Version 2.0, March 2018. Created By Vincent Lostanlen (1, 2, 3), Justin Salamon (2, 3), Andrew Farnsworth (1), Steve Kelling (1), and Juan Pablo Bel...
the_stack_v2_python_sparse
symjax/data/birdvox_dcase_20k.py
SymJAX/SymJAX
train
52
a6bd5408f79b2c52f1f1677df3da3f21e634fc84
[ "if k == 1 or not head:\n return head\nfull_cycle = False\ncount = 1\ncur = head\ndummy = new_head = ListNode(0)\nwhile cur:\n next_head = cur.next\n if count % k != 0:\n full_cycle = False\n cur = cur.next\n else:\n full_cycle = True\n cur.next = None\n new_head.next ...
<|body_start_0|> if k == 1 or not head: return head full_cycle = False count = 1 cur = head dummy = new_head = ListNode(0) while cur: next_head = cur.next if count % k != 0: full_cycle = False cur = cur.n...
Solution_B
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution_B: def reverseKGroup(self, head: ListNode, k: int) -> ListNode: """Non-recursive, using counter cycling Slower than recursive""" <|body_0|> def reverseNodes(self, head: ListNode) -> ListNode: """Helper for both Solution A and Solution B 参见Leetcode LC206, rev...
stack_v2_sparse_classes_36k_train_002696
4,335
permissive
[ { "docstring": "Non-recursive, using counter cycling Slower than recursive", "name": "reverseKGroup", "signature": "def reverseKGroup(self, head: ListNode, k: int) -> ListNode" }, { "docstring": "Helper for both Solution A and Solution B 参见Leetcode LC206, reverse the whole linked-list", "nam...
2
null
Implement the Python class `Solution_B` described below. Class description: Implement the Solution_B class. Method signatures and docstrings: - def reverseKGroup(self, head: ListNode, k: int) -> ListNode: Non-recursive, using counter cycling Slower than recursive - def reverseNodes(self, head: ListNode) -> ListNode: ...
Implement the Python class `Solution_B` described below. Class description: Implement the Solution_B class. Method signatures and docstrings: - def reverseKGroup(self, head: ListNode, k: int) -> ListNode: Non-recursive, using counter cycling Slower than recursive - def reverseNodes(self, head: ListNode) -> ListNode: ...
143422321cbc3715ca08f6c3af8f960a55887ced
<|skeleton|> class Solution_B: def reverseKGroup(self, head: ListNode, k: int) -> ListNode: """Non-recursive, using counter cycling Slower than recursive""" <|body_0|> def reverseNodes(self, head: ListNode) -> ListNode: """Helper for both Solution A and Solution B 参见Leetcode LC206, rev...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution_B: def reverseKGroup(self, head: ListNode, k: int) -> ListNode: """Non-recursive, using counter cycling Slower than recursive""" if k == 1 or not head: return head full_cycle = False count = 1 cur = head dummy = new_head = ListNode(0) ...
the_stack_v2_python_sparse
LeetCode/LC025_reverse_nodes_in_k_group.py
jxie0755/Learning_Python
train
0
0fbb6316cf1ef95d3d0799e23cca30eb4cdd2e5e
[ "s_counter = Counter(s)\nfor i, char in enumerate(s):\n if s_counter.get(char) == 1:\n return i\nreturn -1", "checked = set()\nfor i, char in enumerate(s):\n if char not in checked and s.count(char, i) == 1:\n return i\n checked.add(char)\nreturn -1" ]
<|body_start_0|> s_counter = Counter(s) for i, char in enumerate(s): if s_counter.get(char) == 1: return i return -1 <|end_body_0|> <|body_start_1|> checked = set() for i, char in enumerate(s): if char not in checked and s.count(char, i) =...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def firstUniqChar(self, s): """:type s: str :rtype: int""" <|body_0|> def firstUniqChar(self, s): """Time: N^2 Space: N :type s: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> s_counter = Counter(s) for i, char in ...
stack_v2_sparse_classes_36k_train_002697
847
permissive
[ { "docstring": ":type s: str :rtype: int", "name": "firstUniqChar", "signature": "def firstUniqChar(self, s)" }, { "docstring": "Time: N^2 Space: N :type s: str :rtype: int", "name": "firstUniqChar", "signature": "def firstUniqChar(self, s)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def firstUniqChar(self, s): :type s: str :rtype: int - def firstUniqChar(self, s): Time: N^2 Space: N :type s: str :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def firstUniqChar(self, s): :type s: str :rtype: int - def firstUniqChar(self, s): Time: N^2 Space: N :type s: str :rtype: int <|skeleton|> class Solution: def firstUniqCha...
d2ffcccede5d1543aea48f18a39cdbd3d83e3ed8
<|skeleton|> class Solution: def firstUniqChar(self, s): """:type s: str :rtype: int""" <|body_0|> def firstUniqChar(self, s): """Time: N^2 Space: N :type s: str :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def firstUniqChar(self, s): """:type s: str :rtype: int""" s_counter = Counter(s) for i, char in enumerate(s): if s_counter.get(char) == 1: return i return -1 def firstUniqChar(self, s): """Time: N^2 Space: N :type s: str :rtyp...
the_stack_v2_python_sparse
strings/first_unique_char.py
kandarpck/leetcode
train
0
5a55163857061eb0ad0b238870270e86ccdeb487
[ "super().__init__(*args, **kwargs)\nself._all_traces = None\nself._syscall_information_content = None", "if self._all_traces is not all_traces or self._syscall_information_content is None:\n logger.info('Computing document frequencies.')\n self._all_traces = all_traces\n counter = Counter(chain.from_iter...
<|body_start_0|> super().__init__(*args, **kwargs) self._all_traces = None self._syscall_information_content = None <|end_body_0|> <|body_start_1|> if self._all_traces is not all_traces or self._syscall_information_content is None: logger.info('Computing document frequencies...
Scoring method using information content. The final similarity score for two straces is the sum of information content for each matching syscall found in both traces. Syscall information content is computed using the standard definition where P is the probability of finding that syscall in any given strace (from all_tr...
NormalizedInformationContent
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NormalizedInformationContent: """Scoring method using information content. The final similarity score for two straces is the sum of information content for each matching syscall found in both traces. Syscall information content is computed using the standard definition where P is the probability ...
stack_v2_sparse_classes_36k_train_002698
34,744
no_license
[ { "docstring": "Init.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Compute and cache normalized information content.", "name": "_information_content", "signature": "def _information_content(self, all_traces: Set[Strace]) -> Dict[Syscall, flo...
3
stack_v2_sparse_classes_30k_train_018802
Implement the Python class `NormalizedInformationContent` described below. Class description: Scoring method using information content. The final similarity score for two straces is the sum of information content for each matching syscall found in both traces. Syscall information content is computed using the standard...
Implement the Python class `NormalizedInformationContent` described below. Class description: Scoring method using information content. The final similarity score for two straces is the sum of information content for each matching syscall found in both traces. Syscall information content is computed using the standard...
96ca42d65a91b5505316831318863f1963ff7c23
<|skeleton|> class NormalizedInformationContent: """Scoring method using information content. The final similarity score for two straces is the sum of information content for each matching syscall found in both traces. Syscall information content is computed using the standard definition where P is the probability ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NormalizedInformationContent: """Scoring method using information content. The final similarity score for two straces is the sum of information content for each matching syscall found in both traces. Syscall information content is computed using the standard definition where P is the probability of finding th...
the_stack_v2_python_sparse
lib/strace/comparison/scoring.py
config-migration/dozer
train
2
cb4730bb7558a3616d5ca131cef9cc014a13ca06
[ "self.auth_url = auth_url\nself.domain_id = domain_id\nself.domain_name = domain_name\nself.project_id = project_id\nself.project_name = project_name\nself.project_domain_id = project_domain_id\nself.project_domain_name = project_domain_name", "scope_headers = {}\nif self.project_id:\n scope_headers['X-Project...
<|body_start_0|> self.auth_url = auth_url self.domain_id = domain_id self.domain_name = domain_name self.project_id = project_id self.project_name = project_name self.project_domain_id = project_domain_id self.project_domain_name = project_domain_name <|end_body_0...
A plugin for authenticating with Tokenless Auth. This is for Tokenless Authentication. Scoped information like domain name and project ID will be passed in the headers and token validation request will be authenticated based on the provided HTTPS certificate along with the scope information.
TokenlessAuth
[ "Apache-2.0", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TokenlessAuth: """A plugin for authenticating with Tokenless Auth. This is for Tokenless Authentication. Scoped information like domain name and project ID will be passed in the headers and token validation request will be authenticated based on the provided HTTPS certificate along with the scope...
stack_v2_sparse_classes_36k_train_002699
4,706
permissive
[ { "docstring": "A init method for TokenlessAuth. :param string auth_url: Identity service endpoint for authentication. The URL must include a version or any request will result in a 404 NotFound error. :param string domain_id: Domain ID for domain scoping. :param string domain_name: Domain name for domain scopi...
3
stack_v2_sparse_classes_30k_train_018522
Implement the Python class `TokenlessAuth` described below. Class description: A plugin for authenticating with Tokenless Auth. This is for Tokenless Authentication. Scoped information like domain name and project ID will be passed in the headers and token validation request will be authenticated based on the provided...
Implement the Python class `TokenlessAuth` described below. Class description: A plugin for authenticating with Tokenless Auth. This is for Tokenless Authentication. Scoped information like domain name and project ID will be passed in the headers and token validation request will be authenticated based on the provided...
e6f3999c6f2f846e3dda505343166ab8c8346c2a
<|skeleton|> class TokenlessAuth: """A plugin for authenticating with Tokenless Auth. This is for Tokenless Authentication. Scoped information like domain name and project ID will be passed in the headers and token validation request will be authenticated based on the provided HTTPS certificate along with the scope...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TokenlessAuth: """A plugin for authenticating with Tokenless Auth. This is for Tokenless Authentication. Scoped information like domain name and project ID will be passed in the headers and token validation request will be authenticated based on the provided HTTPS certificate along with the scope information....
the_stack_v2_python_sparse
keystoneauth1/identity/v3/tokenless_auth.py
openstack/keystoneauth
train
51