body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
f0cc50473800554c680c047d096a7b7c3dd15a2fac235c93df845a66eec7a879 | @classmethod
def register_temp_plugin(cls, class_, identifier=None, dist='xblock'):
'Decorate a function to run with a temporary plugin available.\n\n Use it like this in tests::\n\n @register_temp_plugin(MyXBlockClass):\n def test_the_thing():\n # Here I can load MyXBloc... | Decorate a function to run with a temporary plugin available.
Use it like this in tests::
@register_temp_plugin(MyXBlockClass):
def test_the_thing():
# Here I can load MyXBlockClass by name. | xblock/plugin.py | register_temp_plugin | d3vel0per/XBlock | 126 | python | @classmethod
def register_temp_plugin(cls, class_, identifier=None, dist='xblock'):
'Decorate a function to run with a temporary plugin available.\n\n Use it like this in tests::\n\n @register_temp_plugin(MyXBlockClass):\n def test_the_thing():\n # Here I can load MyXBloc... | @classmethod
def register_temp_plugin(cls, class_, identifier=None, dist='xblock'):
'Decorate a function to run with a temporary plugin available.\n\n Use it like this in tests::\n\n @register_temp_plugin(MyXBlockClass):\n def test_the_thing():\n # Here I can load MyXBloc... |
f54f7de69e2d9ded33b570e547ab788575013173da77343ced2431adae2a3dfc | def resolver(schema):
'Default implementation of a schema name resolver function\n '
name = schema.__name__
if name.endswith('Schema'):
return (name[:(- 6)] or name)
return name | Default implementation of a schema name resolver function | app/smpa/openapi/schematics/__init__.py | resolver | LBHackney-IT/smpa-backend | 1 | python | def resolver(schema):
'\n '
name = schema.__name__
if name.endswith('Schema'):
return (name[:(- 6)] or name)
return name | def resolver(schema):
'\n '
name = schema.__name__
if name.endswith('Schema'):
return (name[:(- 6)] or name)
return name<|docstring|>Default implementation of a schema name resolver function<|endoftext|> |
95cbcbe3d6b1d89a09263d4e04b1dfa7de208a68b3bf23ed49feea14d765f047 | def resolve_schema_in_request_body(self, request_body):
'Function to resolve a schema in a requestBody object - modifies then\n response dict to convert Marshmallow Schema object or class into dict\n '
content = request_body['content']
for content_type in content:
schema = content[cont... | Function to resolve a schema in a requestBody object - modifies then
response dict to convert Marshmallow Schema object or class into dict | app/smpa/openapi/schematics/__init__.py | resolve_schema_in_request_body | LBHackney-IT/smpa-backend | 1 | python | def resolve_schema_in_request_body(self, request_body):
'Function to resolve a schema in a requestBody object - modifies then\n response dict to convert Marshmallow Schema object or class into dict\n '
content = request_body['content']
for content_type in content:
schema = content[cont... | def resolve_schema_in_request_body(self, request_body):
'Function to resolve a schema in a requestBody object - modifies then\n response dict to convert Marshmallow Schema object or class into dict\n '
content = request_body['content']
for content_type in content:
schema = content[cont... |
bd2b4607531b16d7767275d32355d55b3adc6493022a78dd081970683d6a5026 | def resolve_schema(self, data):
'Function to resolve a schema in a parameter or response - modifies the\n corresponding dict to convert Marshmallow Schema object or class into dict\n\n :param APISpec spec: `APISpec` containing refs.\n :param dict|str data: either a parameter or response diction... | Function to resolve a schema in a parameter or response - modifies the
corresponding dict to convert Marshmallow Schema object or class into dict
:param APISpec spec: `APISpec` containing refs.
:param dict|str data: either a parameter or response dictionary that may
contain a schema, or a reference provided as str... | app/smpa/openapi/schematics/__init__.py | resolve_schema | LBHackney-IT/smpa-backend | 1 | python | def resolve_schema(self, data):
'Function to resolve a schema in a parameter or response - modifies the\n corresponding dict to convert Marshmallow Schema object or class into dict\n\n :param APISpec spec: `APISpec` containing refs.\n :param dict|str data: either a parameter or response diction... | def resolve_schema(self, data):
'Function to resolve a schema in a parameter or response - modifies the\n corresponding dict to convert Marshmallow Schema object or class into dict\n\n :param APISpec spec: `APISpec` containing refs.\n :param dict|str data: either a parameter or response diction... |
86983e1b7d685d163f825ab7f9d7b4775047f558758d1cdcf9020794db95ef37 | def map_to_openapi_type(self, *args):
"Decorator to set mapping for custom fields.\n\n ``*args`` can be:\n\n - a pair of the form ``(type, format)``\n - a core marshmallow field type (in which case we reuse that type's mapping)\n\n Examples: ::\n\n @ma_plugin.map_to_openapi_ty... | Decorator to set mapping for custom fields.
``*args`` can be:
- a pair of the form ``(type, format)``
- a core marshmallow field type (in which case we reuse that type's mapping)
Examples: ::
@ma_plugin.map_to_openapi_type('string', 'uuid')
class MyCustomField(Integer):
# ...
@ma_plugin.map_to_... | app/smpa/openapi/schematics/__init__.py | map_to_openapi_type | LBHackney-IT/smpa-backend | 1 | python | def map_to_openapi_type(self, *args):
"Decorator to set mapping for custom fields.\n\n ``*args`` can be:\n\n - a pair of the form ``(type, format)``\n - a core marshmallow field type (in which case we reuse that type's mapping)\n\n Examples: ::\n\n @ma_plugin.map_to_openapi_ty... | def map_to_openapi_type(self, *args):
"Decorator to set mapping for custom fields.\n\n ``*args`` can be:\n\n - a pair of the form ``(type, format)``\n - a core marshmallow field type (in which case we reuse that type's mapping)\n\n Examples: ::\n\n @ma_plugin.map_to_openapi_ty... |
7af5143524945beb320d6224a8e3ebcf702de964e08a14781c669add95db3022 | def schema_helper(self, name, _, schema=None, **kwargs):
'Definition helper that allows using a marshmallow\n :class:`Schema <marshmallow.Schema>` to provide OpenAPI\n metadata.\n\n :param type|Schema schema: A marshmallow Schema class or instance.\n '
if (schema is None):
re... | Definition helper that allows using a marshmallow
:class:`Schema <marshmallow.Schema>` to provide OpenAPI
metadata.
:param type|Schema schema: A marshmallow Schema class or instance. | app/smpa/openapi/schematics/__init__.py | schema_helper | LBHackney-IT/smpa-backend | 1 | python | def schema_helper(self, name, _, schema=None, **kwargs):
'Definition helper that allows using a marshmallow\n :class:`Schema <marshmallow.Schema>` to provide OpenAPI\n metadata.\n\n :param type|Schema schema: A marshmallow Schema class or instance.\n '
if (schema is None):
re... | def schema_helper(self, name, _, schema=None, **kwargs):
'Definition helper that allows using a marshmallow\n :class:`Schema <marshmallow.Schema>` to provide OpenAPI\n metadata.\n\n :param type|Schema schema: A marshmallow Schema class or instance.\n '
if (schema is None):
re... |
fb1b181b180b28f785ad202e56fd70d04858d430fc3b6587dd46c491eacbacf9 | def parameter_helper(self, parameter, **kwargs):
'Parameter component helper that allows using a marshmallow\n :class:`Schema <marshmallow.Schema>` in parameter definition.\n\n :param dict parameter: parameter fields. May contain a marshmallow\n Schema class or instance.\n '
self... | Parameter component helper that allows using a marshmallow
:class:`Schema <marshmallow.Schema>` in parameter definition.
:param dict parameter: parameter fields. May contain a marshmallow
Schema class or instance. | app/smpa/openapi/schematics/__init__.py | parameter_helper | LBHackney-IT/smpa-backend | 1 | python | def parameter_helper(self, parameter, **kwargs):
'Parameter component helper that allows using a marshmallow\n :class:`Schema <marshmallow.Schema>` in parameter definition.\n\n :param dict parameter: parameter fields. May contain a marshmallow\n Schema class or instance.\n '
self... | def parameter_helper(self, parameter, **kwargs):
'Parameter component helper that allows using a marshmallow\n :class:`Schema <marshmallow.Schema>` in parameter definition.\n\n :param dict parameter: parameter fields. May contain a marshmallow\n Schema class or instance.\n '
self... |
f37643710b2901acc37b787620dd2f293efa311c959fea2a194640092e7e8cec | def response_helper(self, response, **kwargs):
'Response component helper that allows using a marshmallow\n :class:`Schema <marshmallow.Schema>` in response definition.\n\n :param dict parameter: response fields. May contain a marshmallow\n Schema class or instance.\n '
self.reso... | Response component helper that allows using a marshmallow
:class:`Schema <marshmallow.Schema>` in response definition.
:param dict parameter: response fields. May contain a marshmallow
Schema class or instance. | app/smpa/openapi/schematics/__init__.py | response_helper | LBHackney-IT/smpa-backend | 1 | python | def response_helper(self, response, **kwargs):
'Response component helper that allows using a marshmallow\n :class:`Schema <marshmallow.Schema>` in response definition.\n\n :param dict parameter: response fields. May contain a marshmallow\n Schema class or instance.\n '
self.reso... | def response_helper(self, response, **kwargs):
'Response component helper that allows using a marshmallow\n :class:`Schema <marshmallow.Schema>` in response definition.\n\n :param dict parameter: response fields. May contain a marshmallow\n Schema class or instance.\n '
self.reso... |
2c393bbe95ae6e3467c7b743a3949b4b0d124852f9a3ab7a6cf2abb77d369b68 | def warn_if_schema_already_in_spec(self, schema_key):
'Method to warn the user if the schema has already been added to the\n spec.\n '
if (schema_key in self.openapi.refs):
warnings.warn('{} has already been added to the spec. Adding it twice may cause references to not resolve properly.'.... | Method to warn the user if the schema has already been added to the
spec. | app/smpa/openapi/schematics/__init__.py | warn_if_schema_already_in_spec | LBHackney-IT/smpa-backend | 1 | python | def warn_if_schema_already_in_spec(self, schema_key):
'Method to warn the user if the schema has already been added to the\n spec.\n '
if (schema_key in self.openapi.refs):
warnings.warn('{} has already been added to the spec. Adding it twice may cause references to not resolve properly.'.... | def warn_if_schema_already_in_spec(self, schema_key):
'Method to warn the user if the schema has already been added to the\n spec.\n '
if (schema_key in self.openapi.refs):
warnings.warn('{} has already been added to the spec. Adding it twice may cause references to not resolve properly.'.... |
6ce6e5f73aebcd4f2705d1ea78a72162da8c016559193bf89ee0c57f0f00133e | def preprocess_data(config, force=False):
'\n Ensures that all the necessary data have been inserted in db from the raw\n opendata files.\n\n :params config: A config dictionary.\n :params force: Whether to force rebuild or not.\n :return bool: Whether data have been built or not.\n '
get_sess... | Ensures that all the necessary data have been inserted in db from the raw
opendata files.
:params config: A config dictionary.
:params force: Whether to force rebuild or not.
:return bool: Whether data have been built or not. | flatisfy/data.py | preprocess_data | Phyks/Flatisfy | 15 | python | def preprocess_data(config, force=False):
'\n Ensures that all the necessary data have been inserted in db from the raw\n opendata files.\n\n :params config: A config dictionary.\n :params force: Whether to force rebuild or not.\n :return bool: Whether data have been built or not.\n '
get_sess... | def preprocess_data(config, force=False):
'\n Ensures that all the necessary data have been inserted in db from the raw\n opendata files.\n\n :params config: A config dictionary.\n :params force: Whether to force rebuild or not.\n :return bool: Whether data have been built or not.\n '
get_sess... |
046731f0c021c8e4f9b7c05cf90abaf1c903eab6641c1b0f5d062978d18ef423 | @hash_dict
@lru_cache(maxsize=5)
def load_data(model, constraint, config):
'\n Load data of the specified model from the database. Only load data for the\n specific areas of the postal codes in config.\n\n :param model: SQLAlchemy model to load.\n :param constraint: A constraint from configuration to li... | Load data of the specified model from the database. Only load data for the
specific areas of the postal codes in config.
:param model: SQLAlchemy model to load.
:param constraint: A constraint from configuration to limit the spatial
extension of the loaded data.
:param config: A config dictionary.
:returns: A list of ... | flatisfy/data.py | load_data | Phyks/Flatisfy | 15 | python | @hash_dict
@lru_cache(maxsize=5)
def load_data(model, constraint, config):
'\n Load data of the specified model from the database. Only load data for the\n specific areas of the postal codes in config.\n\n :param model: SQLAlchemy model to load.\n :param constraint: A constraint from configuration to li... | @hash_dict
@lru_cache(maxsize=5)
def load_data(model, constraint, config):
'\n Load data of the specified model from the database. Only load data for the\n specific areas of the postal codes in config.\n\n :param model: SQLAlchemy model to load.\n :param constraint: A constraint from configuration to li... |
1763a518d2c0569961a22a42fe696598f71dd1e6773bf063d8a8022f34e83b9e | def lru_cache(maxsize=None):
'\n Identity implementation of ``lru_cache`` for fallback.\n '
return (lambda func: func) | Identity implementation of ``lru_cache`` for fallback. | flatisfy/data.py | lru_cache | Phyks/Flatisfy | 15 | python | def lru_cache(maxsize=None):
'\n \n '
return (lambda func: func) | def lru_cache(maxsize=None):
'\n \n '
return (lambda func: func)<|docstring|>Identity implementation of ``lru_cache`` for fallback.<|endoftext|> |
15e584502e4e114f9c3689c87c9e28ff8afdca6a574b48003ae835c5629df4cd | def process_msci_zip(instruction):
'\n Process the MSCI zip files.\n :param instruction: (filename, input_directory, output_directory)\n :return:\n '
(filename, input_dir, output_dir) = instruction
create_folder_from_zip(filename, input_dir, output_dir)
list(map((lambda x: io_msci(filename, ... | Process the MSCI zip files.
:param instruction: (filename, input_directory, output_directory)
:return: | main_functional_msci_process.py | process_msci_zip | ginkgodango/lgs | 1 | python | def process_msci_zip(instruction):
'\n Process the MSCI zip files.\n :param instruction: (filename, input_directory, output_directory)\n :return:\n '
(filename, input_dir, output_dir) = instruction
create_folder_from_zip(filename, input_dir, output_dir)
list(map((lambda x: io_msci(filename, ... | def process_msci_zip(instruction):
'\n Process the MSCI zip files.\n :param instruction: (filename, input_directory, output_directory)\n :return:\n '
(filename, input_dir, output_dir) = instruction
create_folder_from_zip(filename, input_dir, output_dir)
list(map((lambda x: io_msci(filename, ... |
56c20312135b64f74f77a2767c6be63d0785d80992d921c2e621c760d51a1ef3 | def parse_xml_to_dataframe(file):
'\n Parses the .xml file to dataframe file.\n :param filepath:\n :return:\n '
return pd.DataFrame([child1.attrib for child0 in ET.parse(file).getroot() for child1 in child0]) | Parses the .xml file to dataframe file.
:param filepath:
:return: | main_functional_msci_process.py | parse_xml_to_dataframe | ginkgodango/lgs | 1 | python | def parse_xml_to_dataframe(file):
'\n Parses the .xml file to dataframe file.\n :param filepath:\n :return:\n '
return pd.DataFrame([child1.attrib for child0 in ET.parse(file).getroot() for child1 in child0]) | def parse_xml_to_dataframe(file):
'\n Parses the .xml file to dataframe file.\n :param filepath:\n :return:\n '
return pd.DataFrame([child1.attrib for child0 in ET.parse(file).getroot() for child1 in child0])<|docstring|>Parses the .xml file to dataframe file.
:param filepath:
:return:<|endoftext|> |
c13e09275c068a3d863283d8736553e37e6df7265c9668ea514e26d850b8b09c | def __init__(self, model, train_dataset, train_labels, batch_size=128, weight_penalty=0):
'Inits trainer.\n\n Args:\n model: model to train\n train_dataset: Train dataset.\n train_labels: Train dataset labels.\n batch_size: number of examples from dataset used duri... | Inits trainer.
Args:
model: model to train
train_dataset: Train dataset.
train_labels: Train dataset labels.
batch_size: number of examples from dataset used during each step. | deepmodel/trainers/AdamTrainer.py | __init__ | KarolAntczak/DeepModel | 4 | python | def __init__(self, model, train_dataset, train_labels, batch_size=128, weight_penalty=0):
'Inits trainer.\n\n Args:\n model: model to train\n train_dataset: Train dataset.\n train_labels: Train dataset labels.\n batch_size: number of examples from dataset used duri... | def __init__(self, model, train_dataset, train_labels, batch_size=128, weight_penalty=0):
'Inits trainer.\n\n Args:\n model: model to train\n train_dataset: Train dataset.\n train_labels: Train dataset labels.\n batch_size: number of examples from dataset used duri... |
a10b6b2cf72547ea1078fa55d46fe703ace35a094667dfd912d2f0e5d3539381 | def train(self, steps=1000):
'Train model.\n\n Args:\n steps: Maximum number of training steps.\n\n Yields:\n Loss value in current training step.\n '
variables = [var for var in tf.global_variables() if ('Adam' or ('beta1_power' in var.name))]
tf.variables_initial... | Train model.
Args:
steps: Maximum number of training steps.
Yields:
Loss value in current training step. | deepmodel/trainers/AdamTrainer.py | train | KarolAntczak/DeepModel | 4 | python | def train(self, steps=1000):
'Train model.\n\n Args:\n steps: Maximum number of training steps.\n\n Yields:\n Loss value in current training step.\n '
variables = [var for var in tf.global_variables() if ('Adam' or ('beta1_power' in var.name))]
tf.variables_initial... | def train(self, steps=1000):
'Train model.\n\n Args:\n steps: Maximum number of training steps.\n\n Yields:\n Loss value in current training step.\n '
variables = [var for var in tf.global_variables() if ('Adam' or ('beta1_power' in var.name))]
tf.variables_initial... |
39acb9ce0604760f88d277167c160f3e61464387eb8a3835c264e21a00385dad | def validate_attestation(state: BeaconState, attestation: Attestation, genesis_epoch: EpochNumber, epoch_length: int, min_attestation_inclusion_delay: int, latest_block_roots_length: int, target_committee_size: int, shard_count: int) -> None:
"\n Validate the given ``attestation``.\n Raise ``ValidationError``... | Validate the given ``attestation``.
Raise ``ValidationError`` if it's invalid. | eth2/beacon/state_machines/forks/serenity/block_validation.py | validate_attestation | Jwomers/trinity | 0 | python | def validate_attestation(state: BeaconState, attestation: Attestation, genesis_epoch: EpochNumber, epoch_length: int, min_attestation_inclusion_delay: int, latest_block_roots_length: int, target_committee_size: int, shard_count: int) -> None:
"\n Validate the given ``attestation``.\n Raise ``ValidationError``... | def validate_attestation(state: BeaconState, attestation: Attestation, genesis_epoch: EpochNumber, epoch_length: int, min_attestation_inclusion_delay: int, latest_block_roots_length: int, target_committee_size: int, shard_count: int) -> None:
"\n Validate the given ``attestation``.\n Raise ``ValidationError``... |
581140ffd9168dcd4e75c8c3b968e7fc234cd7c1efb7e974243162189f48c9b1 | def validate_attestation_slot(attestation_data: AttestationData, current_slot: SlotNumber, epoch_length: int, min_attestation_inclusion_delay: int) -> None:
"\n Validate ``slot`` field of ``attestation_data``.\n Raise ``ValidationError`` if it's invalid.\n "
if (attestation_data.slot > (current_slot - ... | Validate ``slot`` field of ``attestation_data``.
Raise ``ValidationError`` if it's invalid. | eth2/beacon/state_machines/forks/serenity/block_validation.py | validate_attestation_slot | Jwomers/trinity | 0 | python | def validate_attestation_slot(attestation_data: AttestationData, current_slot: SlotNumber, epoch_length: int, min_attestation_inclusion_delay: int) -> None:
"\n Validate ``slot`` field of ``attestation_data``.\n Raise ``ValidationError`` if it's invalid.\n "
if (attestation_data.slot > (current_slot - ... | def validate_attestation_slot(attestation_data: AttestationData, current_slot: SlotNumber, epoch_length: int, min_attestation_inclusion_delay: int) -> None:
"\n Validate ``slot`` field of ``attestation_data``.\n Raise ``ValidationError`` if it's invalid.\n "
if (attestation_data.slot > (current_slot - ... |
97d71cf77db5c5844d5683f97e2e6e2015c7e3decb27b6eafd6470d2e9dd30a8 | def validate_attestation_justified_epoch(attestation_data: AttestationData, current_epoch: EpochNumber, previous_justified_epoch: EpochNumber, justified_epoch: EpochNumber, epoch_length: int) -> None:
"\n Validate ``justified_epoch`` field of ``attestation_data``.\n Raise ``ValidationError`` if it's invalid.\... | Validate ``justified_epoch`` field of ``attestation_data``.
Raise ``ValidationError`` if it's invalid. | eth2/beacon/state_machines/forks/serenity/block_validation.py | validate_attestation_justified_epoch | Jwomers/trinity | 0 | python | def validate_attestation_justified_epoch(attestation_data: AttestationData, current_epoch: EpochNumber, previous_justified_epoch: EpochNumber, justified_epoch: EpochNumber, epoch_length: int) -> None:
"\n Validate ``justified_epoch`` field of ``attestation_data``.\n Raise ``ValidationError`` if it's invalid.\... | def validate_attestation_justified_epoch(attestation_data: AttestationData, current_epoch: EpochNumber, previous_justified_epoch: EpochNumber, justified_epoch: EpochNumber, epoch_length: int) -> None:
"\n Validate ``justified_epoch`` field of ``attestation_data``.\n Raise ``ValidationError`` if it's invalid.\... |
a55877db75d9c4213717b8a636d0d1f60e1a2e06544b41d802582d1578216123 | def validate_attestation_justified_block_root(attestation_data: AttestationData, justified_block_root: Hash32) -> None:
"\n Validate ``justified_block_root`` field of ``attestation_data``.\n Raise ``ValidationError`` if it's invalid.\n "
if (attestation_data.justified_block_root != justified_block_root... | Validate ``justified_block_root`` field of ``attestation_data``.
Raise ``ValidationError`` if it's invalid. | eth2/beacon/state_machines/forks/serenity/block_validation.py | validate_attestation_justified_block_root | Jwomers/trinity | 0 | python | def validate_attestation_justified_block_root(attestation_data: AttestationData, justified_block_root: Hash32) -> None:
"\n Validate ``justified_block_root`` field of ``attestation_data``.\n Raise ``ValidationError`` if it's invalid.\n "
if (attestation_data.justified_block_root != justified_block_root... | def validate_attestation_justified_block_root(attestation_data: AttestationData, justified_block_root: Hash32) -> None:
"\n Validate ``justified_block_root`` field of ``attestation_data``.\n Raise ``ValidationError`` if it's invalid.\n "
if (attestation_data.justified_block_root != justified_block_root... |
fc70340a29e520c4a9f2106cb68416fdc7dcd1ba6f53061c19c53dd885ff6bf9 | def validate_attestation_latest_crosslink_root(attestation_data: AttestationData, latest_crosslink_root: Hash32) -> None:
"\n Validate that either the attestation ``latest_crosslink_root`` or ``shard_block_root``\n field of ``attestation_data`` is the provided ``latest_crosslink_root``.\n Raise ``Validatio... | Validate that either the attestation ``latest_crosslink_root`` or ``shard_block_root``
field of ``attestation_data`` is the provided ``latest_crosslink_root``.
Raise ``ValidationError`` if it's invalid. | eth2/beacon/state_machines/forks/serenity/block_validation.py | validate_attestation_latest_crosslink_root | Jwomers/trinity | 0 | python | def validate_attestation_latest_crosslink_root(attestation_data: AttestationData, latest_crosslink_root: Hash32) -> None:
"\n Validate that either the attestation ``latest_crosslink_root`` or ``shard_block_root``\n field of ``attestation_data`` is the provided ``latest_crosslink_root``.\n Raise ``Validatio... | def validate_attestation_latest_crosslink_root(attestation_data: AttestationData, latest_crosslink_root: Hash32) -> None:
"\n Validate that either the attestation ``latest_crosslink_root`` or ``shard_block_root``\n field of ``attestation_data`` is the provided ``latest_crosslink_root``.\n Raise ``Validatio... |
2908c5456ba0f15da66d31eed967d4db6e4e5af6d0b07243f4d04418b1dbafff | def validate_attestation_shard_block_root(attestation_data: AttestationData) -> None:
"\n Validate ``shard_block_root`` field of `attestation_data`.\n Raise ``ValidationError`` if it's invalid.\n\n Note: This is the Phase 0 version of ``shard_block_root`` validation.\n This is a built-in stub and will b... | Validate ``shard_block_root`` field of `attestation_data`.
Raise ``ValidationError`` if it's invalid.
Note: This is the Phase 0 version of ``shard_block_root`` validation.
This is a built-in stub and will be changed in phase 1. | eth2/beacon/state_machines/forks/serenity/block_validation.py | validate_attestation_shard_block_root | Jwomers/trinity | 0 | python | def validate_attestation_shard_block_root(attestation_data: AttestationData) -> None:
"\n Validate ``shard_block_root`` field of `attestation_data`.\n Raise ``ValidationError`` if it's invalid.\n\n Note: This is the Phase 0 version of ``shard_block_root`` validation.\n This is a built-in stub and will b... | def validate_attestation_shard_block_root(attestation_data: AttestationData) -> None:
"\n Validate ``shard_block_root`` field of `attestation_data`.\n Raise ``ValidationError`` if it's invalid.\n\n Note: This is the Phase 0 version of ``shard_block_root`` validation.\n This is a built-in stub and will b... |
becd8f6b76ac443ae995b916aceb5de99afab57b94ca90d2817b9d23fce2a416 | def validate_attestation_aggregate_signature(state: BeaconState, attestation: Attestation, genesis_epoch: EpochNumber, epoch_length: int, target_committee_size: int, shard_count: int) -> None:
"\n Validate ``aggregate_signature`` field of ``attestation``.\n Raise ``ValidationError`` if it's invalid.\n\n No... | Validate ``aggregate_signature`` field of ``attestation``.
Raise ``ValidationError`` if it's invalid.
Note: This is the phase 0 version of `aggregate_signature`` validation.
All proof of custody bits are assumed to be 0 within the signed data.
This will change to reflect real proof of custody bits in the Phase 1. | eth2/beacon/state_machines/forks/serenity/block_validation.py | validate_attestation_aggregate_signature | Jwomers/trinity | 0 | python | def validate_attestation_aggregate_signature(state: BeaconState, attestation: Attestation, genesis_epoch: EpochNumber, epoch_length: int, target_committee_size: int, shard_count: int) -> None:
"\n Validate ``aggregate_signature`` field of ``attestation``.\n Raise ``ValidationError`` if it's invalid.\n\n No... | def validate_attestation_aggregate_signature(state: BeaconState, attestation: Attestation, genesis_epoch: EpochNumber, epoch_length: int, target_committee_size: int, shard_count: int) -> None:
"\n Validate ``aggregate_signature`` field of ``attestation``.\n Raise ``ValidationError`` if it's invalid.\n\n No... |
9ce1c6005d2eff2d7838fcef544c2021e3dc749ea594488478ed5513f50c9e07 | def complexity_ordinalpatterns(signal, delay=1, dimension=3, algorithm='quicksort', **kwargs):
'**Find Ordinal Patterns for Permutation Procedures**\n\n The seminal work by Bandt and Pompe (2002) introduced a symbolization approach to obtain a\n sequence of ordinal patterns (permutations) from continuous data... | **Find Ordinal Patterns for Permutation Procedures**
The seminal work by Bandt and Pompe (2002) introduced a symbolization approach to obtain a
sequence of ordinal patterns (permutations) from continuous data. It is used in
:func:`permutation entropy <entropy_permutation>` and its different variants.
Parameters
-----... | neurokit2/complexity/utils_complexity_ordinalpatterns.py | complexity_ordinalpatterns | danibene/NeuroKit | 0 | python | def complexity_ordinalpatterns(signal, delay=1, dimension=3, algorithm='quicksort', **kwargs):
'**Find Ordinal Patterns for Permutation Procedures**\n\n The seminal work by Bandt and Pompe (2002) introduced a symbolization approach to obtain a\n sequence of ordinal patterns (permutations) from continuous data... | def complexity_ordinalpatterns(signal, delay=1, dimension=3, algorithm='quicksort', **kwargs):
'**Find Ordinal Patterns for Permutation Procedures**\n\n The seminal work by Bandt and Pompe (2002) introduced a symbolization approach to obtain a\n sequence of ordinal patterns (permutations) from continuous data... |
6d877c54f48b0f04ce0abc3f691e0f41ecaea2f141e00af0600484d67c15443c | def _bubblesort(embedded):
'\n Manis, G., Aktaruzzaman, M. D., & Sassi, R. (2017). Bubble entropy: An entropy almost free of\n parameters. IEEE Transactions on Biomedical Engineering, 64(11), 2711-2718.\n '
(n, n_dim) = np.shape(embedded)
swaps = np.zeros(n)
for y in range(n):
for t in ... | Manis, G., Aktaruzzaman, M. D., & Sassi, R. (2017). Bubble entropy: An entropy almost free of
parameters. IEEE Transactions on Biomedical Engineering, 64(11), 2711-2718. | neurokit2/complexity/utils_complexity_ordinalpatterns.py | _bubblesort | danibene/NeuroKit | 0 | python | def _bubblesort(embedded):
'\n Manis, G., Aktaruzzaman, M. D., & Sassi, R. (2017). Bubble entropy: An entropy almost free of\n parameters. IEEE Transactions on Biomedical Engineering, 64(11), 2711-2718.\n '
(n, n_dim) = np.shape(embedded)
swaps = np.zeros(n)
for y in range(n):
for t in ... | def _bubblesort(embedded):
'\n Manis, G., Aktaruzzaman, M. D., & Sassi, R. (2017). Bubble entropy: An entropy almost free of\n parameters. IEEE Transactions on Biomedical Engineering, 64(11), 2711-2718.\n '
(n, n_dim) = np.shape(embedded)
swaps = np.zeros(n)
for y in range(n):
for t in ... |
4e5aca6e0bcf8c70f9ef1407cd4c364a4b9e96d475613f11fd976ba80eff1bc4 | def findSDK(obj):
' Wrapper for pdil.anim.findSetDrivenKeys(), converting the driver node into a fossil idSpec.\n '
return [[destAttr, ids.getIdSpec(driverNode), driveAttr, curve] for (destAttr, driverNode, driveAttr, curve) in pdil.anim.findSetDrivenKeys(obj)] | Wrapper for pdil.anim.findSetDrivenKeys(), converting the driver node into a fossil idSpec. | pdil/tool/fossil/_lib/misc.py | findSDK | Mikfr83/fossil | 0 | python | def findSDK(obj):
' \n '
return [[destAttr, ids.getIdSpec(driverNode), driveAttr, curve] for (destAttr, driverNode, driveAttr, curve) in pdil.anim.findSetDrivenKeys(obj)] | def findSDK(obj):
' \n '
return [[destAttr, ids.getIdSpec(driverNode), driveAttr, curve] for (destAttr, driverNode, driveAttr, curve) in pdil.anim.findSetDrivenKeys(obj)]<|docstring|>Wrapper for pdil.anim.findSetDrivenKeys(), converting the driver node into a fossil idSpec.<|endoftext|> |
3ae9935d2fc46a1e8c4c9dee9d7f341471e8faa9c8369502e8c0397de42dbc3a | def applySDK(obj, info):
' Wrapper for pdil.anim.applySetDrivenKeys(), coverting the driver spec into a node.\n '
processed = [[destAttr, ids.readIdSpec(driverSpec), driveAttr, curve] for (destAttr, driverSpec, driveAttr, curve) in info]
pdil.anim.applySetDrivenKeys(obj, processed) | Wrapper for pdil.anim.applySetDrivenKeys(), coverting the driver spec into a node. | pdil/tool/fossil/_lib/misc.py | applySDK | Mikfr83/fossil | 0 | python | def applySDK(obj, info):
' \n '
processed = [[destAttr, ids.readIdSpec(driverSpec), driveAttr, curve] for (destAttr, driverSpec, driveAttr, curve) in info]
pdil.anim.applySetDrivenKeys(obj, processed) | def applySDK(obj, info):
' \n '
processed = [[destAttr, ids.readIdSpec(driverSpec), driveAttr, curve] for (destAttr, driverSpec, driveAttr, curve) in info]
pdil.anim.applySetDrivenKeys(obj, processed)<|docstring|>Wrapper for pdil.anim.applySetDrivenKeys(), coverting the driver spec into a node.<|endoftex... |
06ed2dfed7f7f145a65d3e91a3447aa1cce08359a7686d97ea4f5d3eaa71cbc9 | def test_probailities(self):
'\n Integration test for probability prediction\n '
(encoding, lengths) = encode_batch([self.sequence], self.max_length)
m = generate_mask(encoding, lengths)
with torch.no_grad():
pr = self.model(encoding, m, lengths)
v = clean_output(pr[0], lengths... | Integration test for probability prediction | parapred/tests/test_parapred.py | test_probailities | alchemab/parapred-pytorch | 14 | python | def test_probailities(self):
'\n \n '
(encoding, lengths) = encode_batch([self.sequence], self.max_length)
m = generate_mask(encoding, lengths)
with torch.no_grad():
pr = self.model(encoding, m, lengths)
v = clean_output(pr[0], lengths[0].item())
self.assertTrue(torch.allcl... | def test_probailities(self):
'\n \n '
(encoding, lengths) = encode_batch([self.sequence], self.max_length)
m = generate_mask(encoding, lengths)
with torch.no_grad():
pr = self.model(encoding, m, lengths)
v = clean_output(pr[0], lengths[0].item())
self.assertTrue(torch.allcl... |
6aeba9b3f6635e02fe0d5cd1ec92ab8b97bb48329ea9d3c8e885fb2eb71bc334 | def test_encoding(self):
'\n Unit test the encoding function\n '
encoded_representation = encode_parapred(self.sequence, len(self.sequence))
self.assertTrue(torch.allclose(torch.Tensor([[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.... | Unit test the encoding function | parapred/tests/test_parapred.py | test_encoding | alchemab/parapred-pytorch | 14 | python | def test_encoding(self):
'\n \n '
encoded_representation = encode_parapred(self.sequence, len(self.sequence))
self.assertTrue(torch.allclose(torch.Tensor([[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.94, 0.3, 6.47, 0.96, 5.66, 0.25... | def test_encoding(self):
'\n \n '
encoded_representation = encode_parapred(self.sequence, len(self.sequence))
self.assertTrue(torch.allclose(torch.Tensor([[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.94, 0.3, 6.47, 0.96, 5.66, 0.25... |
d0686f672fe54a757fcb746f0744422b904d7f40aed3feb275d3dc45dddad40a | def test_batch_prediction(self):
'\n Integration testing for a batch of sequences\n '
batch = ['SRWGGDGFYAMDYWG', 'YCQRYNRAPYTFG']
(encoding, lengths) = encode_batch(batch, self.max_length)
m = generate_mask(encoding, lengths)
with torch.no_grad():
pr = self.model(encoding, m, ... | Integration testing for a batch of sequences | parapred/tests/test_parapred.py | test_batch_prediction | alchemab/parapred-pytorch | 14 | python | def test_batch_prediction(self):
'\n \n '
batch = ['SRWGGDGFYAMDYWG', 'YCQRYNRAPYTFG']
(encoding, lengths) = encode_batch(batch, self.max_length)
m = generate_mask(encoding, lengths)
with torch.no_grad():
pr = self.model(encoding, m, lengths)
v1 = clean_output(pr[0], length... | def test_batch_prediction(self):
'\n \n '
batch = ['SRWGGDGFYAMDYWG', 'YCQRYNRAPYTFG']
(encoding, lengths) = encode_batch(batch, self.max_length)
m = generate_mask(encoding, lengths)
with torch.no_grad():
pr = self.model(encoding, m, lengths)
v1 = clean_output(pr[0], length... |
67f6ffe9598b6ac327c7ecea3ea384eab7ab3476fc2c2fd0a202f7652b4f9465 | def PseudomonasPutidaKt2440(directed: bool=False, verbose: int=2, cache_path: str='graphs/string', **additional_graph_kwargs: Dict) -> EnsmallenGraph:
'Return new instance of the Pseudomonas putida KT2440 graph.\n\n The graph is automatically retrieved from the STRING repository. \n\n\t\n\n Parameters\n --... | Return new instance of the Pseudomonas putida KT2440 graph.
The graph is automatically retrieved from the STRING repository.
Parameters
-------------------
directed: bool = False,
Wether to load the graph as directed or undirected.
By default false.
verbose: int = 2,
Wether to show loading bars dur... | bindings/python/ensmallen_graph/datasets/string/pseudomonasputidakt2440.py | PseudomonasPutidaKt2440 | caufieldjh/ensmallen_graph | 0 | python | def PseudomonasPutidaKt2440(directed: bool=False, verbose: int=2, cache_path: str='graphs/string', **additional_graph_kwargs: Dict) -> EnsmallenGraph:
'Return new instance of the Pseudomonas putida KT2440 graph.\n\n The graph is automatically retrieved from the STRING repository. \n\n\t\n\n Parameters\n --... | def PseudomonasPutidaKt2440(directed: bool=False, verbose: int=2, cache_path: str='graphs/string', **additional_graph_kwargs: Dict) -> EnsmallenGraph:
'Return new instance of the Pseudomonas putida KT2440 graph.\n\n The graph is automatically retrieved from the STRING repository. \n\n\t\n\n Parameters\n --... |
b02f4bc95637df232935e2bdbe1bdceef6233bd3116be3a0a5b43bf0c1713bfc | def plot_cv_img(input_image, output_image1, output_image2):
' \n Converts an image from BGR to RGB and plots \n '
(fig, ax) = plt.subplots(nrows=1, ncols=3)
ax[0].imshow(input_image, cmap='gray')
ax[0].set_title('Input Image')
ax[0].axis('off')
ax[1].imshow(output_image1, cmap='gra... | Converts an image from BGR to RGB and plots | Chapter03/03_image_derivatives.py | plot_cv_img | PacktPublishing/Practical-Computer-Vision | 23 | python | def plot_cv_img(input_image, output_image1, output_image2):
' \n \n '
(fig, ax) = plt.subplots(nrows=1, ncols=3)
ax[0].imshow(input_image, cmap='gray')
ax[0].set_title('Input Image')
ax[0].axis('off')
ax[1].imshow(output_image1, cmap='gray')
ax[1].set_title('Laplacian Image')
... | def plot_cv_img(input_image, output_image1, output_image2):
' \n \n '
(fig, ax) = plt.subplots(nrows=1, ncols=3)
ax[0].imshow(input_image, cmap='gray')
ax[0].set_title('Input Image')
ax[0].axis('off')
ax[1].imshow(output_image1, cmap='gray')
ax[1].set_title('Laplacian Image')
... |
bbd3a40968042a7229d85c68303dc4b2c0f7c0fee805f9a2dbc9b7df95cdddcd | def temp(self, v_adc):
'\n Accept ADC value from thermistor connected to ADC_IN0.\n Return temperature in Kelvin\n '
return (self.beta / numpy.log(((self.r_sense / self.r_inf) * ((float(4095) / v_adc) - 1)))) | Accept ADC value from thermistor connected to ADC_IN0.
Return temperature in Kelvin | python/thermo/steinhart.py | temp | kloper/thermo | 0 | python | def temp(self, v_adc):
'\n Accept ADC value from thermistor connected to ADC_IN0.\n Return temperature in Kelvin\n '
return (self.beta / numpy.log(((self.r_sense / self.r_inf) * ((float(4095) / v_adc) - 1)))) | def temp(self, v_adc):
'\n Accept ADC value from thermistor connected to ADC_IN0.\n Return temperature in Kelvin\n '
return (self.beta / numpy.log(((self.r_sense / self.r_inf) * ((float(4095) / v_adc) - 1))))<|docstring|>Accept ADC value from thermistor connected to ADC_IN0.
Return temperat... |
10e7fea1b177c96f38d96de7fa3faba38eea33620a8add2ed17b5f6d7d25c523 | def resistance(self, temp):
'\n Calculate resistance of a thermistor based on temperature\n '
return (self.r_inf * (numpy.e ** (self.beta / temp))) | Calculate resistance of a thermistor based on temperature | python/thermo/steinhart.py | resistance | kloper/thermo | 0 | python | def resistance(self, temp):
'\n \n '
return (self.r_inf * (numpy.e ** (self.beta / temp))) | def resistance(self, temp):
'\n \n '
return (self.r_inf * (numpy.e ** (self.beta / temp)))<|docstring|>Calculate resistance of a thermistor based on temperature<|endoftext|> |
e8a1fd9f6363efa3fa2e9b80b585e9f4da202e8a82737afd94924cf56538811b | def temp_approximation(self, adc_start=100, adc_stop=3900, epsilon=0.3):
'\n Calculate linear approximation to temperature curve for a range of\n ADC values.\n '
adc_values = numpy.arange(adc_start, adc_stop)
return rdp(zip(adc_values, self.temp(adc_values)), epsilon=epsilon) | Calculate linear approximation to temperature curve for a range of
ADC values. | python/thermo/steinhart.py | temp_approximation | kloper/thermo | 0 | python | def temp_approximation(self, adc_start=100, adc_stop=3900, epsilon=0.3):
'\n Calculate linear approximation to temperature curve for a range of\n ADC values.\n '
adc_values = numpy.arange(adc_start, adc_stop)
return rdp(zip(adc_values, self.temp(adc_values)), epsilon=epsilon) | def temp_approximation(self, adc_start=100, adc_stop=3900, epsilon=0.3):
'\n Calculate linear approximation to temperature curve for a range of\n ADC values.\n '
adc_values = numpy.arange(adc_start, adc_stop)
return rdp(zip(adc_values, self.temp(adc_values)), epsilon=epsilon)<|docstring... |
45b7be7257060c4ef594f04069587b69cf70f95f052f499ad70f4459a8b6ddfe | def voltage(self, sense, thermo):
'\n Calculate voltage on thermistor/sense resistor junction based on\n their resistances\n '
return ((float(sense) / (sense + thermo)) * self.vdd) | Calculate voltage on thermistor/sense resistor junction based on
their resistances | python/thermo/steinhart.py | voltage | kloper/thermo | 0 | python | def voltage(self, sense, thermo):
'\n Calculate voltage on thermistor/sense resistor junction based on\n their resistances\n '
return ((float(sense) / (sense + thermo)) * self.vdd) | def voltage(self, sense, thermo):
'\n Calculate voltage on thermistor/sense resistor junction based on\n their resistances\n '
return ((float(sense) / (sense + thermo)) * self.vdd)<|docstring|>Calculate voltage on thermistor/sense resistor junction based on
their resistances<|endoftext|> |
5b56c8ce86ea324ac2601e71b240a815bed6e5324f020fb894026eb6bd0193b3 | def delta(self, sense):
'\n Calculate thermistor/sense voltage range depending on\n sense resistance and required thermistor resistance ranges\n '
return abs((self.voltage(sense, self.thermo_range[0]) - self.voltage(sense, self.thermo_range[1]))) | Calculate thermistor/sense voltage range depending on
sense resistance and required thermistor resistance ranges | python/thermo/steinhart.py | delta | kloper/thermo | 0 | python | def delta(self, sense):
'\n Calculate thermistor/sense voltage range depending on\n sense resistance and required thermistor resistance ranges\n '
return abs((self.voltage(sense, self.thermo_range[0]) - self.voltage(sense, self.thermo_range[1]))) | def delta(self, sense):
'\n Calculate thermistor/sense voltage range depending on\n sense resistance and required thermistor resistance ranges\n '
return abs((self.voltage(sense, self.thermo_range[0]) - self.voltage(sense, self.thermo_range[1])))<|docstring|>Calculate thermistor/sense volta... |
70587b66d1528480c278b013cfdf31321027a9f4f7f4fc9b8a23c1a37fd4d4c3 | def optimum_sense(self, start, stop, step):
'\n Find sense resistance in specified interval that leads to a\n maximum voltage range in thermistor/sense junction for specified\n thermistor resistance ranges.\n '
sense_values = range(start, stop, step)
sense = sense_values[numpy.ar... | Find sense resistance in specified interval that leads to a
maximum voltage range in thermistor/sense junction for specified
thermistor resistance ranges. | python/thermo/steinhart.py | optimum_sense | kloper/thermo | 0 | python | def optimum_sense(self, start, stop, step):
'\n Find sense resistance in specified interval that leads to a\n maximum voltage range in thermistor/sense junction for specified\n thermistor resistance ranges.\n '
sense_values = range(start, stop, step)
sense = sense_values[numpy.ar... | def optimum_sense(self, start, stop, step):
'\n Find sense resistance in specified interval that leads to a\n maximum voltage range in thermistor/sense junction for specified\n thermistor resistance ranges.\n '
sense_values = range(start, stop, step)
sense = sense_values[numpy.ar... |
f9f5a25d90a85cec9b13230fcd582e39c18e2e883e03026448a3c09a87fd69bb | def listdir(path, ext=None, onlyfiles=False):
'\n @param[in] onlyfiles Boolean.\n @param[in] ext If not None, a list of valid extensions.\n '
listing = os.listdir(path)
if onlyfiles:
listing = [f for f in listing if os.path.isfile(os.path.join(path, f))]
if (ext is not None):
... | @param[in] onlyfiles Boolean.
@param[in] ext If not None, a list of valid extensions. | src/wat/common.py | listdir | luiscarlosgph/keypoint-annotation-tool | 6 | python | def listdir(path, ext=None, onlyfiles=False):
'\n @param[in] onlyfiles Boolean.\n @param[in] ext If not None, a list of valid extensions.\n '
listing = os.listdir(path)
if onlyfiles:
listing = [f for f in listing if os.path.isfile(os.path.join(path, f))]
if (ext is not None):
... | def listdir(path, ext=None, onlyfiles=False):
'\n @param[in] onlyfiles Boolean.\n @param[in] ext If not None, a list of valid extensions.\n '
listing = os.listdir(path)
if onlyfiles:
listing = [f for f in listing if os.path.isfile(os.path.join(path, f))]
if (ext is not None):
... |
638b42ff1bc1ac34b858f9e15a62ddf0550bcec50364fcfcf2e66cb1352f62a7 | def mkdir(path):
'\n @brief Create folder.\n @param[in] path to the new folder.\n @returns nothing.\n '
if os.path.exists(path):
raise RuntimeError('[mkdir] Error, this path already exists so a folder cannot be created.')
os.makedirs(path) | @brief Create folder.
@param[in] path to the new folder.
@returns nothing. | src/wat/common.py | mkdir | luiscarlosgph/keypoint-annotation-tool | 6 | python | def mkdir(path):
'\n @brief Create folder.\n @param[in] path to the new folder.\n @returns nothing.\n '
if os.path.exists(path):
raise RuntimeError('[mkdir] Error, this path already exists so a folder cannot be created.')
os.makedirs(path) | def mkdir(path):
'\n @brief Create folder.\n @param[in] path to the new folder.\n @returns nothing.\n '
if os.path.exists(path):
raise RuntimeError('[mkdir] Error, this path already exists so a folder cannot be created.')
os.makedirs(path)<|docstring|>@brief Create folder.
@param[in] pat... |
2b9db18327f5a5179690ce3f73195bc3dc96d6014947e02080cc418aa454cde0 | def dir_exists(dpath):
'\n @param[in] path Path to the folder whose existance you want to check.\n @returns true if folder exists, otherwise returns false.\n '
return (True if os.path.isdir(dpath) else False) | @param[in] path Path to the folder whose existance you want to check.
@returns true if folder exists, otherwise returns false. | src/wat/common.py | dir_exists | luiscarlosgph/keypoint-annotation-tool | 6 | python | def dir_exists(dpath):
'\n @param[in] path Path to the folder whose existance you want to check.\n @returns true if folder exists, otherwise returns false.\n '
return (True if os.path.isdir(dpath) else False) | def dir_exists(dpath):
'\n @param[in] path Path to the folder whose existance you want to check.\n @returns true if folder exists, otherwise returns false.\n '
return (True if os.path.isdir(dpath) else False)<|docstring|>@param[in] path Path to the folder whose existance you want to check.
@returns tru... |
f7489af3d1617506e1e896cfdfbd2b7b47f77a6b09c1916cc772278b0f064c57 | def file_exists(fpath):
'\n @param[in] path Path to the file whose existance you want to check.\n @returns true if the file exists, otherwise returns false.\n '
return (True if os.path.isfile(fpath) else False) | @param[in] path Path to the file whose existance you want to check.
@returns true if the file exists, otherwise returns false. | src/wat/common.py | file_exists | luiscarlosgph/keypoint-annotation-tool | 6 | python | def file_exists(fpath):
'\n @param[in] path Path to the file whose existance you want to check.\n @returns true if the file exists, otherwise returns false.\n '
return (True if os.path.isfile(fpath) else False) | def file_exists(fpath):
'\n @param[in] path Path to the file whose existance you want to check.\n @returns true if the file exists, otherwise returns false.\n '
return (True if os.path.isfile(fpath) else False)<|docstring|>@param[in] path Path to the file whose existance you want to check.
@returns tru... |
2b9db18327f5a5179690ce3f73195bc3dc96d6014947e02080cc418aa454cde0 | def dir_exists(dpath):
'\n @param[in] path Path to the folder whose existance you want to check.\n @returns true if folder exists, otherwise returns false.\n '
return (True if os.path.isdir(dpath) else False) | @param[in] path Path to the folder whose existance you want to check.
@returns true if folder exists, otherwise returns false. | src/wat/common.py | dir_exists | luiscarlosgph/keypoint-annotation-tool | 6 | python | def dir_exists(dpath):
'\n @param[in] path Path to the folder whose existance you want to check.\n @returns true if folder exists, otherwise returns false.\n '
return (True if os.path.isdir(dpath) else False) | def dir_exists(dpath):
'\n @param[in] path Path to the folder whose existance you want to check.\n @returns true if folder exists, otherwise returns false.\n '
return (True if os.path.isdir(dpath) else False)<|docstring|>@param[in] path Path to the folder whose existance you want to check.
@returns tru... |
eea2fb9ef855c4ac13e11fe2546c9c583e9b84042af3783a5180ae20adb9e54b | @token.setter
def token(self, token):
'\n Allows the user to set the token.\n\n :param token: token to set in config\n '
self._token = token | Allows the user to set the token.
:param token: token to set in config | external_tools/common/ServiceConfig.py | token | isabella232/scorebot | 63 | python | @token.setter
def token(self, token):
'\n Allows the user to set the token.\n\n :param token: token to set in config\n '
self._token = token | @token.setter
def token(self, token):
'\n Allows the user to set the token.\n\n :param token: token to set in config\n '
self._token = token<|docstring|>Allows the user to set the token.
:param token: token to set in config<|endoftext|> |
b72ba44d53d7b1dcc94673b9e08eeb11095dd480f1cb4ef14bd2e980b91461a7 | @classmethod
def importprojectdir(cls, dir_project, file_type):
'Imports all descriptor files under a given folder\n\n this method is specific for Toscanfv project type\n '
project = {'toscayaml': {}, 'positions': {}}
for desc_type in project:
cur_type_path = os.path.join(dir_project, ... | Imports all descriptor files under a given folder
this method is specific for Toscanfv project type | code/lib/toscanfv/toscanfv_parser.py | importprojectdir | superfluidity/RDCL3D | 8 | python | @classmethod
def importprojectdir(cls, dir_project, file_type):
'Imports all descriptor files under a given folder\n\n this method is specific for Toscanfv project type\n '
project = {'toscayaml': {}, 'positions': {}}
for desc_type in project:
cur_type_path = os.path.join(dir_project, ... | @classmethod
def importprojectdir(cls, dir_project, file_type):
'Imports all descriptor files under a given folder\n\n this method is specific for Toscanfv project type\n '
project = {'toscayaml': {}, 'positions': {}}
for desc_type in project:
cur_type_path = os.path.join(dir_project, ... |
afaf4f74b257ecac4c9c6b78a9d612e8b8559fdd2984391567480ee52fdfbbb9 | @classmethod
def importprojectfiles(cls, file_dict):
'Imports descriptors (extracted from the new project POST)\n\n The keys in the dictionary are the file types\n '
project = {'toscayaml': {}}
for desc_type in project:
if (desc_type in file_dict):
files_desc_type = file_di... | Imports descriptors (extracted from the new project POST)
The keys in the dictionary are the file types | code/lib/toscanfv/toscanfv_parser.py | importprojectfiles | superfluidity/RDCL3D | 8 | python | @classmethod
def importprojectfiles(cls, file_dict):
'Imports descriptors (extracted from the new project POST)\n\n The keys in the dictionary are the file types\n '
project = {'toscayaml': {}}
for desc_type in project:
if (desc_type in file_dict):
files_desc_type = file_di... | @classmethod
def importprojectfiles(cls, file_dict):
'Imports descriptors (extracted from the new project POST)\n\n The keys in the dictionary are the file types\n '
project = {'toscayaml': {}}
for desc_type in project:
if (desc_type in file_dict):
files_desc_type = file_di... |
32bf6989279d8ccc117f1310110564a468d64d79284da1799ab8129026c3189f | def plot_2D_Data_Animated(self, animated_axis, *param_list, nb_frames=50, fps=10, **param_dict):
'Gen\n\n Parameters\n ----------\n animated_axis : str\n The field will be animated along this axis\n nb_frames : int\n number of frames used to build the gif\n fps: int\n frames disp... | Gen
Parameters
----------
animated_axis : str
The field will be animated along this axis
nb_frames : int
number of frames used to build the gif
fps: int
frames displayed per second | SciDataTool/Methods/DataND/plot_2D_Data_Animated.py | plot_2D_Data_Animated | Igarciac117/SciDataTool | 24 | python | def plot_2D_Data_Animated(self, animated_axis, *param_list, nb_frames=50, fps=10, **param_dict):
'Gen\n\n Parameters\n ----------\n animated_axis : str\n The field will be animated along this axis\n nb_frames : int\n number of frames used to build the gif\n fps: int\n frames disp... | def plot_2D_Data_Animated(self, animated_axis, *param_list, nb_frames=50, fps=10, **param_dict):
'Gen\n\n Parameters\n ----------\n animated_axis : str\n The field will be animated along this axis\n nb_frames : int\n number of frames used to build the gif\n fps: int\n frames disp... |
37e82fd90f28f63de6c394709ec3ee5dabc81ad6ef4f0a0da9aeba248ad37933 | def __init__(self, id=None, type=None, objectives=None, timestamp=None, timestamp_utc=None, correct_responses=None, weighting=None, learner_response=None, result=None, latency=None, description=None):
'\n RuntimeInteractionSchema - a model defined in Swagger\n\n :param dict swaggerTypes: The key is at... | RuntimeInteractionSchema - a model defined in Swagger
:param dict swaggerTypes: The key is attribute name
and the value is attribute type.
:param dict attributeMap: The key is attribute name
and the value is json key in definition. | rustici_software_cloud_v2/models/runtime_interaction_schema.py | __init__ | ryanhope2/scormcloud-api-v2-client-python | 0 | python | def __init__(self, id=None, type=None, objectives=None, timestamp=None, timestamp_utc=None, correct_responses=None, weighting=None, learner_response=None, result=None, latency=None, description=None):
'\n RuntimeInteractionSchema - a model defined in Swagger\n\n :param dict swaggerTypes: The key is at... | def __init__(self, id=None, type=None, objectives=None, timestamp=None, timestamp_utc=None, correct_responses=None, weighting=None, learner_response=None, result=None, latency=None, description=None):
'\n RuntimeInteractionSchema - a model defined in Swagger\n\n :param dict swaggerTypes: The key is at... |
21173d692f5cd59c8e538bd3644fdc615fd1a8f32da2191beebe5f33136d3a7f | @property
def id(self):
'\n Gets the id of this RuntimeInteractionSchema.\n\n :return: The id of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._id | Gets the id of this RuntimeInteractionSchema.
:return: The id of this RuntimeInteractionSchema.
:rtype: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | id | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def id(self):
'\n Gets the id of this RuntimeInteractionSchema.\n\n :return: The id of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._id | @property
def id(self):
'\n Gets the id of this RuntimeInteractionSchema.\n\n :return: The id of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._id<|docstring|>Gets the id of this RuntimeInteractionSchema.
:return: The id of this RuntimeInteractionSchema.
:rtype: str<|... |
7836e42cae4a157ef6694504c3263fbe722b20e65b10aa691544faeb12b8131d | @id.setter
def id(self, id):
'\n Sets the id of this RuntimeInteractionSchema.\n\n :param id: The id of this RuntimeInteractionSchema.\n :type: str\n '
self._id = id | Sets the id of this RuntimeInteractionSchema.
:param id: The id of this RuntimeInteractionSchema.
:type: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | id | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @id.setter
def id(self, id):
'\n Sets the id of this RuntimeInteractionSchema.\n\n :param id: The id of this RuntimeInteractionSchema.\n :type: str\n '
self._id = id | @id.setter
def id(self, id):
'\n Sets the id of this RuntimeInteractionSchema.\n\n :param id: The id of this RuntimeInteractionSchema.\n :type: str\n '
self._id = id<|docstring|>Sets the id of this RuntimeInteractionSchema.
:param id: The id of this RuntimeInteractionSchema.
:type: ... |
377a0ca6b93490d410024ef7143e94907c028960d500ec7be6522683bcc9e3a3 | @property
def type(self):
'\n Gets the type of this RuntimeInteractionSchema.\n\n :return: The type of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._type | Gets the type of this RuntimeInteractionSchema.
:return: The type of this RuntimeInteractionSchema.
:rtype: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | type | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def type(self):
'\n Gets the type of this RuntimeInteractionSchema.\n\n :return: The type of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._type | @property
def type(self):
'\n Gets the type of this RuntimeInteractionSchema.\n\n :return: The type of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._type<|docstring|>Gets the type of this RuntimeInteractionSchema.
:return: The type of this RuntimeInteractionSchema.
:... |
ae4438557eeb76c26ae2df9024f8840480c80bee258e0fccd3e1fbb3cff7f814 | @type.setter
def type(self, type):
'\n Sets the type of this RuntimeInteractionSchema.\n\n :param type: The type of this RuntimeInteractionSchema.\n :type: str\n '
allowed_values = ['TrueFalse', 'Choice', 'FillIn', 'LongFillIn', 'Likert', 'Matching', 'Performance', 'Sequencing', 'Num... | Sets the type of this RuntimeInteractionSchema.
:param type: The type of this RuntimeInteractionSchema.
:type: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | type | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @type.setter
def type(self, type):
'\n Sets the type of this RuntimeInteractionSchema.\n\n :param type: The type of this RuntimeInteractionSchema.\n :type: str\n '
allowed_values = ['TrueFalse', 'Choice', 'FillIn', 'LongFillIn', 'Likert', 'Matching', 'Performance', 'Sequencing', 'Num... | @type.setter
def type(self, type):
'\n Sets the type of this RuntimeInteractionSchema.\n\n :param type: The type of this RuntimeInteractionSchema.\n :type: str\n '
allowed_values = ['TrueFalse', 'Choice', 'FillIn', 'LongFillIn', 'Likert', 'Matching', 'Performance', 'Sequencing', 'Num... |
4e5400db4bbf4c2573748a8566c8cc1992acb1f289308d34c5bd84c6d6753592 | @property
def objectives(self):
'\n Gets the objectives of this RuntimeInteractionSchema.\n\n :return: The objectives of this RuntimeInteractionSchema.\n :rtype: list[str]\n '
return self._objectives | Gets the objectives of this RuntimeInteractionSchema.
:return: The objectives of this RuntimeInteractionSchema.
:rtype: list[str] | rustici_software_cloud_v2/models/runtime_interaction_schema.py | objectives | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def objectives(self):
'\n Gets the objectives of this RuntimeInteractionSchema.\n\n :return: The objectives of this RuntimeInteractionSchema.\n :rtype: list[str]\n '
return self._objectives | @property
def objectives(self):
'\n Gets the objectives of this RuntimeInteractionSchema.\n\n :return: The objectives of this RuntimeInteractionSchema.\n :rtype: list[str]\n '
return self._objectives<|docstring|>Gets the objectives of this RuntimeInteractionSchema.
:return: The obje... |
c109a629caa27de8c804d318d38cf2630686ccc4ca4ec36e771f2eb6a8e7d515 | @objectives.setter
def objectives(self, objectives):
'\n Sets the objectives of this RuntimeInteractionSchema.\n\n :param objectives: The objectives of this RuntimeInteractionSchema.\n :type: list[str]\n '
self._objectives = objectives | Sets the objectives of this RuntimeInteractionSchema.
:param objectives: The objectives of this RuntimeInteractionSchema.
:type: list[str] | rustici_software_cloud_v2/models/runtime_interaction_schema.py | objectives | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @objectives.setter
def objectives(self, objectives):
'\n Sets the objectives of this RuntimeInteractionSchema.\n\n :param objectives: The objectives of this RuntimeInteractionSchema.\n :type: list[str]\n '
self._objectives = objectives | @objectives.setter
def objectives(self, objectives):
'\n Sets the objectives of this RuntimeInteractionSchema.\n\n :param objectives: The objectives of this RuntimeInteractionSchema.\n :type: list[str]\n '
self._objectives = objectives<|docstring|>Sets the objectives of this RuntimeI... |
85586343ca0bf6b019aecd4dbd8836f9201e59270a10dd484c8bfcfd7f154bf5 | @property
def timestamp(self):
'\n Gets the timestamp of this RuntimeInteractionSchema.\n\n :return: The timestamp of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._timestamp | Gets the timestamp of this RuntimeInteractionSchema.
:return: The timestamp of this RuntimeInteractionSchema.
:rtype: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | timestamp | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def timestamp(self):
'\n Gets the timestamp of this RuntimeInteractionSchema.\n\n :return: The timestamp of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._timestamp | @property
def timestamp(self):
'\n Gets the timestamp of this RuntimeInteractionSchema.\n\n :return: The timestamp of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._timestamp<|docstring|>Gets the timestamp of this RuntimeInteractionSchema.
:return: The timestamp of th... |
e33b4537dcce3e2a3cef17ab8e5fe2044af83c2ec8bdf7c810e1199227326763 | @timestamp.setter
def timestamp(self, timestamp):
'\n Sets the timestamp of this RuntimeInteractionSchema.\n\n :param timestamp: The timestamp of this RuntimeInteractionSchema.\n :type: str\n '
self._timestamp = timestamp | Sets the timestamp of this RuntimeInteractionSchema.
:param timestamp: The timestamp of this RuntimeInteractionSchema.
:type: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | timestamp | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @timestamp.setter
def timestamp(self, timestamp):
'\n Sets the timestamp of this RuntimeInteractionSchema.\n\n :param timestamp: The timestamp of this RuntimeInteractionSchema.\n :type: str\n '
self._timestamp = timestamp | @timestamp.setter
def timestamp(self, timestamp):
'\n Sets the timestamp of this RuntimeInteractionSchema.\n\n :param timestamp: The timestamp of this RuntimeInteractionSchema.\n :type: str\n '
self._timestamp = timestamp<|docstring|>Sets the timestamp of this RuntimeInteractionSchem... |
253d88a543f6b100b1fe89c38661ccef4aa1b8556f597519e03bc741d36ed6af | @property
def timestamp_utc(self):
'\n Gets the timestamp_utc of this RuntimeInteractionSchema.\n\n :return: The timestamp_utc of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._timestamp_utc | Gets the timestamp_utc of this RuntimeInteractionSchema.
:return: The timestamp_utc of this RuntimeInteractionSchema.
:rtype: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | timestamp_utc | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def timestamp_utc(self):
'\n Gets the timestamp_utc of this RuntimeInteractionSchema.\n\n :return: The timestamp_utc of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._timestamp_utc | @property
def timestamp_utc(self):
'\n Gets the timestamp_utc of this RuntimeInteractionSchema.\n\n :return: The timestamp_utc of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._timestamp_utc<|docstring|>Gets the timestamp_utc of this RuntimeInteractionSchema.
:return:... |
45464198267c55fe045166004c6bba41957d9f8e6892a4ee0aa350a5a1a7da41 | @timestamp_utc.setter
def timestamp_utc(self, timestamp_utc):
'\n Sets the timestamp_utc of this RuntimeInteractionSchema.\n\n :param timestamp_utc: The timestamp_utc of this RuntimeInteractionSchema.\n :type: str\n '
self._timestamp_utc = timestamp_utc | Sets the timestamp_utc of this RuntimeInteractionSchema.
:param timestamp_utc: The timestamp_utc of this RuntimeInteractionSchema.
:type: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | timestamp_utc | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @timestamp_utc.setter
def timestamp_utc(self, timestamp_utc):
'\n Sets the timestamp_utc of this RuntimeInteractionSchema.\n\n :param timestamp_utc: The timestamp_utc of this RuntimeInteractionSchema.\n :type: str\n '
self._timestamp_utc = timestamp_utc | @timestamp_utc.setter
def timestamp_utc(self, timestamp_utc):
'\n Sets the timestamp_utc of this RuntimeInteractionSchema.\n\n :param timestamp_utc: The timestamp_utc of this RuntimeInteractionSchema.\n :type: str\n '
self._timestamp_utc = timestamp_utc<|docstring|>Sets the timestamp... |
01931d9e7a6b8ae8238323ccd92d0756d8b308e64458642a1c0b5a138a99e287 | @property
def correct_responses(self):
'\n Gets the correct_responses of this RuntimeInteractionSchema.\n\n :return: The correct_responses of this RuntimeInteractionSchema.\n :rtype: list[str]\n '
return self._correct_responses | Gets the correct_responses of this RuntimeInteractionSchema.
:return: The correct_responses of this RuntimeInteractionSchema.
:rtype: list[str] | rustici_software_cloud_v2/models/runtime_interaction_schema.py | correct_responses | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def correct_responses(self):
'\n Gets the correct_responses of this RuntimeInteractionSchema.\n\n :return: The correct_responses of this RuntimeInteractionSchema.\n :rtype: list[str]\n '
return self._correct_responses | @property
def correct_responses(self):
'\n Gets the correct_responses of this RuntimeInteractionSchema.\n\n :return: The correct_responses of this RuntimeInteractionSchema.\n :rtype: list[str]\n '
return self._correct_responses<|docstring|>Gets the correct_responses of this RuntimeIn... |
576e36f4ba2982bd598b3182837e8dd34ad2a4fbdf3b6f66168ba60497e32976 | @correct_responses.setter
def correct_responses(self, correct_responses):
'\n Sets the correct_responses of this RuntimeInteractionSchema.\n\n :param correct_responses: The correct_responses of this RuntimeInteractionSchema.\n :type: list[str]\n '
self._correct_responses = correct_re... | Sets the correct_responses of this RuntimeInteractionSchema.
:param correct_responses: The correct_responses of this RuntimeInteractionSchema.
:type: list[str] | rustici_software_cloud_v2/models/runtime_interaction_schema.py | correct_responses | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @correct_responses.setter
def correct_responses(self, correct_responses):
'\n Sets the correct_responses of this RuntimeInteractionSchema.\n\n :param correct_responses: The correct_responses of this RuntimeInteractionSchema.\n :type: list[str]\n '
self._correct_responses = correct_re... | @correct_responses.setter
def correct_responses(self, correct_responses):
'\n Sets the correct_responses of this RuntimeInteractionSchema.\n\n :param correct_responses: The correct_responses of this RuntimeInteractionSchema.\n :type: list[str]\n '
self._correct_responses = correct_re... |
10b6472ae9b0c32b667ae8846298c06d429dd7169489f597f6dc70371e359911 | @property
def weighting(self):
'\n Gets the weighting of this RuntimeInteractionSchema.\n\n :return: The weighting of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._weighting | Gets the weighting of this RuntimeInteractionSchema.
:return: The weighting of this RuntimeInteractionSchema.
:rtype: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | weighting | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def weighting(self):
'\n Gets the weighting of this RuntimeInteractionSchema.\n\n :return: The weighting of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._weighting | @property
def weighting(self):
'\n Gets the weighting of this RuntimeInteractionSchema.\n\n :return: The weighting of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._weighting<|docstring|>Gets the weighting of this RuntimeInteractionSchema.
:return: The weighting of th... |
31abbbbaf7790cb7f57d905acb39eaec93c6ae693606a3460830d8f2af69063e | @weighting.setter
def weighting(self, weighting):
'\n Sets the weighting of this RuntimeInteractionSchema.\n\n :param weighting: The weighting of this RuntimeInteractionSchema.\n :type: str\n '
self._weighting = weighting | Sets the weighting of this RuntimeInteractionSchema.
:param weighting: The weighting of this RuntimeInteractionSchema.
:type: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | weighting | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @weighting.setter
def weighting(self, weighting):
'\n Sets the weighting of this RuntimeInteractionSchema.\n\n :param weighting: The weighting of this RuntimeInteractionSchema.\n :type: str\n '
self._weighting = weighting | @weighting.setter
def weighting(self, weighting):
'\n Sets the weighting of this RuntimeInteractionSchema.\n\n :param weighting: The weighting of this RuntimeInteractionSchema.\n :type: str\n '
self._weighting = weighting<|docstring|>Sets the weighting of this RuntimeInteractionSchem... |
6dce99938012da693ea8d73182f2672aa3aee81fa03795013dae84abe7f7712b | @property
def learner_response(self):
'\n Gets the learner_response of this RuntimeInteractionSchema.\n\n :return: The learner_response of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._learner_response | Gets the learner_response of this RuntimeInteractionSchema.
:return: The learner_response of this RuntimeInteractionSchema.
:rtype: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | learner_response | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def learner_response(self):
'\n Gets the learner_response of this RuntimeInteractionSchema.\n\n :return: The learner_response of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._learner_response | @property
def learner_response(self):
'\n Gets the learner_response of this RuntimeInteractionSchema.\n\n :return: The learner_response of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._learner_response<|docstring|>Gets the learner_response of this RuntimeInteractionSc... |
1235adbe74b54828c75d357bd09ae6e241ee35e78c50039fbcec8a159036bb20 | @learner_response.setter
def learner_response(self, learner_response):
'\n Sets the learner_response of this RuntimeInteractionSchema.\n\n :param learner_response: The learner_response of this RuntimeInteractionSchema.\n :type: str\n '
self._learner_response = learner_response | Sets the learner_response of this RuntimeInteractionSchema.
:param learner_response: The learner_response of this RuntimeInteractionSchema.
:type: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | learner_response | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @learner_response.setter
def learner_response(self, learner_response):
'\n Sets the learner_response of this RuntimeInteractionSchema.\n\n :param learner_response: The learner_response of this RuntimeInteractionSchema.\n :type: str\n '
self._learner_response = learner_response | @learner_response.setter
def learner_response(self, learner_response):
'\n Sets the learner_response of this RuntimeInteractionSchema.\n\n :param learner_response: The learner_response of this RuntimeInteractionSchema.\n :type: str\n '
self._learner_response = learner_response<|docst... |
325ee889183189ad3ead74e7cd8260eb4172f0cb8d1334dd33fd6337ddb3be77 | @property
def result(self):
'\n Gets the result of this RuntimeInteractionSchema.\n\n :return: The result of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._result | Gets the result of this RuntimeInteractionSchema.
:return: The result of this RuntimeInteractionSchema.
:rtype: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | result | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def result(self):
'\n Gets the result of this RuntimeInteractionSchema.\n\n :return: The result of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._result | @property
def result(self):
'\n Gets the result of this RuntimeInteractionSchema.\n\n :return: The result of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._result<|docstring|>Gets the result of this RuntimeInteractionSchema.
:return: The result of this RuntimeInteract... |
3fa01dac142f02c209201ea74cbe5f1219365d5f5cce6fc7fceba63bf6b2bf32 | @result.setter
def result(self, result):
'\n Sets the result of this RuntimeInteractionSchema.\n\n :param result: The result of this RuntimeInteractionSchema.\n :type: str\n '
self._result = result | Sets the result of this RuntimeInteractionSchema.
:param result: The result of this RuntimeInteractionSchema.
:type: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | result | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @result.setter
def result(self, result):
'\n Sets the result of this RuntimeInteractionSchema.\n\n :param result: The result of this RuntimeInteractionSchema.\n :type: str\n '
self._result = result | @result.setter
def result(self, result):
'\n Sets the result of this RuntimeInteractionSchema.\n\n :param result: The result of this RuntimeInteractionSchema.\n :type: str\n '
self._result = result<|docstring|>Sets the result of this RuntimeInteractionSchema.
:param result: The resu... |
44a70b35c82bac6b3db3e6eb30edeaff5538df3cec4ffea70acc04b6bd7b3a1b | @property
def latency(self):
'\n Gets the latency of this RuntimeInteractionSchema.\n\n :return: The latency of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._latency | Gets the latency of this RuntimeInteractionSchema.
:return: The latency of this RuntimeInteractionSchema.
:rtype: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | latency | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def latency(self):
'\n Gets the latency of this RuntimeInteractionSchema.\n\n :return: The latency of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._latency | @property
def latency(self):
'\n Gets the latency of this RuntimeInteractionSchema.\n\n :return: The latency of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._latency<|docstring|>Gets the latency of this RuntimeInteractionSchema.
:return: The latency of this RuntimeIn... |
65026f8318fb74b99c78b3d9e8a1eb893115b22d5d5490a51b5896ae9ab54afb | @latency.setter
def latency(self, latency):
'\n Sets the latency of this RuntimeInteractionSchema.\n\n :param latency: The latency of this RuntimeInteractionSchema.\n :type: str\n '
self._latency = latency | Sets the latency of this RuntimeInteractionSchema.
:param latency: The latency of this RuntimeInteractionSchema.
:type: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | latency | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @latency.setter
def latency(self, latency):
'\n Sets the latency of this RuntimeInteractionSchema.\n\n :param latency: The latency of this RuntimeInteractionSchema.\n :type: str\n '
self._latency = latency | @latency.setter
def latency(self, latency):
'\n Sets the latency of this RuntimeInteractionSchema.\n\n :param latency: The latency of this RuntimeInteractionSchema.\n :type: str\n '
self._latency = latency<|docstring|>Sets the latency of this RuntimeInteractionSchema.
:param latency... |
5bdf645d9bb555612b227bdcd6077c3c6af529efc9b3d89a043065108ff52db8 | @property
def description(self):
'\n Gets the description of this RuntimeInteractionSchema.\n\n :return: The description of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._description | Gets the description of this RuntimeInteractionSchema.
:return: The description of this RuntimeInteractionSchema.
:rtype: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | description | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @property
def description(self):
'\n Gets the description of this RuntimeInteractionSchema.\n\n :return: The description of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._description | @property
def description(self):
'\n Gets the description of this RuntimeInteractionSchema.\n\n :return: The description of this RuntimeInteractionSchema.\n :rtype: str\n '
return self._description<|docstring|>Gets the description of this RuntimeInteractionSchema.
:return: The descr... |
48d2f4a44d55741281b7cf3bd8524170da1c09781288492f809bfc338b1a2bb5 | @description.setter
def description(self, description):
'\n Sets the description of this RuntimeInteractionSchema.\n\n :param description: The description of this RuntimeInteractionSchema.\n :type: str\n '
self._description = description | Sets the description of this RuntimeInteractionSchema.
:param description: The description of this RuntimeInteractionSchema.
:type: str | rustici_software_cloud_v2/models/runtime_interaction_schema.py | description | ryanhope2/scormcloud-api-v2-client-python | 0 | python | @description.setter
def description(self, description):
'\n Sets the description of this RuntimeInteractionSchema.\n\n :param description: The description of this RuntimeInteractionSchema.\n :type: str\n '
self._description = description | @description.setter
def description(self, description):
'\n Sets the description of this RuntimeInteractionSchema.\n\n :param description: The description of this RuntimeInteractionSchema.\n :type: str\n '
self._description = description<|docstring|>Sets the description of this Runti... |
f92515cd38effc7eee4069f2288d78a0f0836df932fb36a84e3b4f7e14233415 | def to_dict(self):
'\n Returns the model properties as a dict\n '
result = {}
for (attr, _) in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), v... | Returns the model properties as a dict | rustici_software_cloud_v2/models/runtime_interaction_schema.py | to_dict | ryanhope2/scormcloud-api-v2-client-python | 0 | python | def to_dict(self):
'\n \n '
result = {}
for (attr, _) in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to... | def to_dict(self):
'\n \n '
result = {}
for (attr, _) in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to... |
c373d87dd29c1e96dce460ab571bff86e58edb298ba83c85d8cc7603a6505de4 | def to_str(self):
'\n Returns the string representation of the model\n '
return pformat(self.to_dict()) | Returns the string representation of the model | rustici_software_cloud_v2/models/runtime_interaction_schema.py | to_str | ryanhope2/scormcloud-api-v2-client-python | 0 | python | def to_str(self):
'\n \n '
return pformat(self.to_dict()) | def to_str(self):
'\n \n '
return pformat(self.to_dict())<|docstring|>Returns the string representation of the model<|endoftext|> |
1034ff7dd2eef24d21e3c2fa7409b793ab5cbb8cd75a2eb0ab3e62604b26264d | def __repr__(self):
'\n For `print` and `pprint`\n '
return self.to_str() | For `print` and `pprint` | rustici_software_cloud_v2/models/runtime_interaction_schema.py | __repr__ | ryanhope2/scormcloud-api-v2-client-python | 0 | python | def __repr__(self):
'\n \n '
return self.to_str() | def __repr__(self):
'\n \n '
return self.to_str()<|docstring|>For `print` and `pprint`<|endoftext|> |
280ac351f2e52b61576030fb4139c666aef5e03c168bcef9821266708be9cc34 | def __eq__(self, other):
'\n Returns true if both objects are equal\n '
if (not isinstance(other, RuntimeInteractionSchema)):
return False
return (self.__dict__ == other.__dict__) | Returns true if both objects are equal | rustici_software_cloud_v2/models/runtime_interaction_schema.py | __eq__ | ryanhope2/scormcloud-api-v2-client-python | 0 | python | def __eq__(self, other):
'\n \n '
if (not isinstance(other, RuntimeInteractionSchema)):
return False
return (self.__dict__ == other.__dict__) | def __eq__(self, other):
'\n \n '
if (not isinstance(other, RuntimeInteractionSchema)):
return False
return (self.__dict__ == other.__dict__)<|docstring|>Returns true if both objects are equal<|endoftext|> |
e5050f8e1402e3a4c90d6c6e229c4c9e2b8ec61e0be457915ea9d976f7e6b0b4 | def __ne__(self, other):
'\n Returns true if both objects are not equal\n '
return (not (self == other)) | Returns true if both objects are not equal | rustici_software_cloud_v2/models/runtime_interaction_schema.py | __ne__ | ryanhope2/scormcloud-api-v2-client-python | 0 | python | def __ne__(self, other):
'\n \n '
return (not (self == other)) | def __ne__(self, other):
'\n \n '
return (not (self == other))<|docstring|>Returns true if both objects are not equal<|endoftext|> |
1f1d85f875665142dabe299e41be9429bb4de8707e7f8de3bff552a8c2151e7e | def __init__(self, filepath, opts):
'\n Read actions file\n and return options\n '
self.config = ConfigParser.RawConfigParser()
self.filepath = filepath
self.opts = opts | Read actions file
and return options | src/modules/ActionsReader.py | __init__ | dorneanu/icmpKNOCK | 7 | python | def __init__(self, filepath, opts):
'\n Read actions file\n and return options\n '
self.config = ConfigParser.RawConfigParser()
self.filepath = filepath
self.opts = opts | def __init__(self, filepath, opts):
'\n Read actions file\n and return options\n '
self.config = ConfigParser.RawConfigParser()
self.filepath = filepath
self.opts = opts<|docstring|>Read actions file
and return options<|endoftext|> |
89818059f88edf59aea004b96babd9e0d4bbb8fda1c2c1f303b4665fd66e958c | def read_actions(self):
' Read config file and check options '
res = {}
self.config.read(self.filepath)
for s in self.config.sections():
opts = {}
for o in sections['action']:
if self.config.has_option(s, o):
opts[o] = self.config.get(s, o)
if ... | Read config file and check options | src/modules/ActionsReader.py | read_actions | dorneanu/icmpKNOCK | 7 | python | def read_actions(self):
' '
res = {}
self.config.read(self.filepath)
for s in self.config.sections():
opts = {}
for o in sections['action']:
if self.config.has_option(s, o):
opts[o] = self.config.get(s, o)
if self.opts['debug']:
... | def read_actions(self):
' '
res = {}
self.config.read(self.filepath)
for s in self.config.sections():
opts = {}
for o in sections['action']:
if self.config.has_option(s, o):
opts[o] = self.config.get(s, o)
if self.opts['debug']:
... |
4c5cc8fc9d7a9f44998f1d4e86245499efc4c7804a0f5b78f2162bbb6aeb14be | def clean_actions(self, actions):
' Clean/sanitize actions options '
for a in actions:
keys = actions[a]['keys']
keys = keys.replace('\n', '')
actions[a]['keys'] = keys
return actions | Clean/sanitize actions options | src/modules/ActionsReader.py | clean_actions | dorneanu/icmpKNOCK | 7 | python | def clean_actions(self, actions):
' '
for a in actions:
keys = actions[a]['keys']
keys = keys.replace('\n', )
actions[a]['keys'] = keys
return actions | def clean_actions(self, actions):
' '
for a in actions:
keys = actions[a]['keys']
keys = keys.replace('\n', )
actions[a]['keys'] = keys
return actions<|docstring|>Clean/sanitize actions options<|endoftext|> |
c066f75a1e82c18a836df07800f3f09f9cc418e6444f03abed134b5b8d592dd8 | @classmethod
def launch_neuron(cls, neuron):
'\n Start a neuron plugin\n :param neuron: neuron object\n :type neuron: Neuron\n :return:\n '
logger.debug(('Run neuron: "%s"' % neuron.__str__()))
sl = SettingLoader()
settings = sl.settings
neuron_folder = None
if... | Start a neuron plugin
:param neuron: neuron object
:type neuron: Neuron
:return: | kalliope/core/NeuronLauncher.py | launch_neuron | skulblaka24/kalliope-master | 1 | python | @classmethod
def launch_neuron(cls, neuron):
'\n Start a neuron plugin\n :param neuron: neuron object\n :type neuron: Neuron\n :return:\n '
logger.debug(('Run neuron: "%s"' % neuron.__str__()))
sl = SettingLoader()
settings = sl.settings
neuron_folder = None
if... | @classmethod
def launch_neuron(cls, neuron):
'\n Start a neuron plugin\n :param neuron: neuron object\n :type neuron: Neuron\n :return:\n '
logger.debug(('Run neuron: "%s"' % neuron.__str__()))
sl = SettingLoader()
settings = sl.settings
neuron_folder = None
if... |
d8790afdcc9ec60a18645db6155f0a27bea3411654a850957c9dd63d5414e44c | @classmethod
def start_neuron(cls, neuron, parameters_dict=None):
'\n Execute each neuron from the received neuron_list.\n Replace parameter if exist in the received dict of parameters_dict\n :param neuron: Neuron object to run\n :param parameters_dict: dict of parameter to load in each ... | Execute each neuron from the received neuron_list.
Replace parameter if exist in the received dict of parameters_dict
:param neuron: Neuron object to run
:param parameters_dict: dict of parameter to load in each neuron if expecting a parameter
:return: List of the instantiated neurons (no errors detected) | kalliope/core/NeuronLauncher.py | start_neuron | skulblaka24/kalliope-master | 1 | python | @classmethod
def start_neuron(cls, neuron, parameters_dict=None):
'\n Execute each neuron from the received neuron_list.\n Replace parameter if exist in the received dict of parameters_dict\n :param neuron: Neuron object to run\n :param parameters_dict: dict of parameter to load in each ... | @classmethod
def start_neuron(cls, neuron, parameters_dict=None):
'\n Execute each neuron from the received neuron_list.\n Replace parameter if exist in the received dict of parameters_dict\n :param neuron: Neuron object to run\n :param parameters_dict: dict of parameter to load in each ... |
550cb8e90219c5348bb18ede3f3abb2f29c49d1f36777c28665c7cacf60747db | @classmethod
def _replace_brackets_by_loaded_parameter(cls, neuron_parameters, loaded_parameters):
'\n Receive a value (which can be a str or dict or list) and instantiate value in double brace bracket\n by the value specified in the loaded_parameters dict.\n This method will call itself until ... | Receive a value (which can be a str or dict or list) and instantiate value in double brace bracket
by the value specified in the loaded_parameters dict.
This method will call itself until all values has been instantiated
:param neuron_parameters: value to instantiate. Str or dict or list
:param loaded_parameters: dict ... | kalliope/core/NeuronLauncher.py | _replace_brackets_by_loaded_parameter | skulblaka24/kalliope-master | 1 | python | @classmethod
def _replace_brackets_by_loaded_parameter(cls, neuron_parameters, loaded_parameters):
'\n Receive a value (which can be a str or dict or list) and instantiate value in double brace bracket\n by the value specified in the loaded_parameters dict.\n This method will call itself until ... | @classmethod
def _replace_brackets_by_loaded_parameter(cls, neuron_parameters, loaded_parameters):
'\n Receive a value (which can be a str or dict or list) and instantiate value in double brace bracket\n by the value specified in the loaded_parameters dict.\n This method will call itself until ... |
56cdad37e5a25843f79eae1c780ff281bd8f799cfbc1277aa82b1c21a36b29fb | @staticmethod
def _neuron_parameters_are_available_in_loaded_parameters(string_parameters, loaded_parameters):
'\n Check that all parameters in brackets are available in the loaded_parameters dict\n \n E.g:\n string_parameters = "this is a {{ parameter1 }}"\n \n Will return... | Check that all parameters in brackets are available in the loaded_parameters dict
E.g:
string_parameters = "this is a {{ parameter1 }}"
Will return true if the loaded_parameters looks like the following
loaded_parameters { "parameter1": "a value"}
:param string_parameters: The string that contains one or mor... | kalliope/core/NeuronLauncher.py | _neuron_parameters_are_available_in_loaded_parameters | skulblaka24/kalliope-master | 1 | python | @staticmethod
def _neuron_parameters_are_available_in_loaded_parameters(string_parameters, loaded_parameters):
'\n Check that all parameters in brackets are available in the loaded_parameters dict\n \n E.g:\n string_parameters = "this is a {{ parameter1 }}"\n \n Will return... | @staticmethod
def _neuron_parameters_are_available_in_loaded_parameters(string_parameters, loaded_parameters):
'\n Check that all parameters in brackets are available in the loaded_parameters dict\n \n E.g:\n string_parameters = "this is a {{ parameter1 }}"\n \n Will return... |
8ec108a1524ad0f70113ae421a753eefcd83e094e8fee5da914df91cb90d9cac | def error(update, context):
'Log Errors caused by Updates.'
logger.warning('Update "%s" caused error "%s"', update, context.error) | Log Errors caused by Updates. | bot.py | error | Hashir-xyz/instadpsection | 2 | python | def error(update, context):
logger.warning('Update "%s" caused error "%s"', update, context.error) | def error(update, context):
logger.warning('Update "%s" caused error "%s"', update, context.error)<|docstring|>Log Errors caused by Updates.<|endoftext|> |
c1f97e72f50cd5b4bd34e2788df8e58e2d861438c2090f7103296193b6db80c8 | def escape_html(text: str) -> str:
'Replaces all angle brackets with HTML entities.'
return text.replace('<', '<').replace('>', '>') | Replaces all angle brackets with HTML entities. | app/handler/util.py | escape_html | liozek/kozRandBot | 0 | python | def escape_html(text: str) -> str:
return text.replace('<', '<').replace('>', '>') | def escape_html(text: str) -> str:
return text.replace('<', '<').replace('>', '>')<|docstring|>Replaces all angle brackets with HTML entities.<|endoftext|> |
d1c5c72e6252cbe35de8d6c909f407a2fd4ad0e63c87d77b91de3ab8202e3083 | def from_email(self):
'\n Use name and email for the "From:" header\n '
return ('"%s" <%s>' % (self.cleaned_data['name'], self.cleaned_data['email'])) | Use name and email for the "From:" header | contact_form/forms.py | from_email | maru/django-contact-form-recaptcha | 2 | python | def from_email(self):
'\n \n '
return ('"%s" <%s>' % (self.cleaned_data['name'], self.cleaned_data['email'])) | def from_email(self):
'\n \n '
return ('"%s" <%s>' % (self.cleaned_data['name'], self.cleaned_data['email']))<|docstring|>Use name and email for the "From:" header<|endoftext|> |
fded04dddaa48edc6f229f56ffb5a6416e47bc957e40af2b368e0497ddca81ab | def message(self):
'\n Render the body of the message to a string.\n\n '
template_name = (self.template_name() if callable(self.template_name) else self.template_name)
return loader.render_to_string(template_name, self.get_context(), request=self.request) | Render the body of the message to a string. | contact_form/forms.py | message | maru/django-contact-form-recaptcha | 2 | python | def message(self):
'\n \n\n '
template_name = (self.template_name() if callable(self.template_name) else self.template_name)
return loader.render_to_string(template_name, self.get_context(), request=self.request) | def message(self):
'\n \n\n '
template_name = (self.template_name() if callable(self.template_name) else self.template_name)
return loader.render_to_string(template_name, self.get_context(), request=self.request)<|docstring|>Render the body of the message to a string.<|endoftext|> |
13daf3ffa836d68db9f2b909e553d93feae32cbbe4221299a8ea5af3d161db85 | def subject(self):
'\n Render the subject of the message to a string.\n\n '
template_name = (self.subject_template_name() if callable(self.subject_template_name) else self.subject_template_name)
subject = loader.render_to_string(template_name, self.get_context(), request=self.request)
retu... | Render the subject of the message to a string. | contact_form/forms.py | subject | maru/django-contact-form-recaptcha | 2 | python | def subject(self):
'\n \n\n '
template_name = (self.subject_template_name() if callable(self.subject_template_name) else self.subject_template_name)
subject = loader.render_to_string(template_name, self.get_context(), request=self.request)
return .join(subject.splitlines()) | def subject(self):
'\n \n\n '
template_name = (self.subject_template_name() if callable(self.subject_template_name) else self.subject_template_name)
subject = loader.render_to_string(template_name, self.get_context(), request=self.request)
return .join(subject.splitlines())<|docstring|>Ren... |
4424c2debc2615850a5b741b041e2222aea6fac7327a028c374d38f13903a9b1 | def get_context(self):
'\n Return the context used to render the templates for the email\n subject and body.\n\n By default, this context includes:\n\n * All of the validated values in the form, as variables of the\n same names as their fields.\n\n * The current ``Site`` ... | Return the context used to render the templates for the email
subject and body.
By default, this context includes:
* All of the validated values in the form, as variables of the
same names as their fields.
* The current ``Site`` object, as the variable ``site``.
* Any additional variables added by context process... | contact_form/forms.py | get_context | maru/django-contact-form-recaptcha | 2 | python | def get_context(self):
'\n Return the context used to render the templates for the email\n subject and body.\n\n By default, this context includes:\n\n * All of the validated values in the form, as variables of the\n same names as their fields.\n\n * The current ``Site`` ... | def get_context(self):
'\n Return the context used to render the templates for the email\n subject and body.\n\n By default, this context includes:\n\n * All of the validated values in the form, as variables of the\n same names as their fields.\n\n * The current ``Site`` ... |
527964e5b1a32efd3cc02a1182b2f2dbf0941c0cd1f141f6ff645af734640d95 | def get_message_dict(self):
'\n Generate the various parts of the message and return them in a\n dictionary, suitable for passing directly as keyword arguments\n to ``django.core.mail.send_mail()``.\n\n By default, the following values are returned:\n\n * ``from_email``\n\n ... | Generate the various parts of the message and return them in a
dictionary, suitable for passing directly as keyword arguments
to ``django.core.mail.send_mail()``.
By default, the following values are returned:
* ``from_email``
* ``message``
* ``recipient_list``
* ``subject`` | contact_form/forms.py | get_message_dict | maru/django-contact-form-recaptcha | 2 | python | def get_message_dict(self):
'\n Generate the various parts of the message and return them in a\n dictionary, suitable for passing directly as keyword arguments\n to ``django.core.mail.send_mail()``.\n\n By default, the following values are returned:\n\n * ``from_email``\n\n ... | def get_message_dict(self):
'\n Generate the various parts of the message and return them in a\n dictionary, suitable for passing directly as keyword arguments\n to ``django.core.mail.send_mail()``.\n\n By default, the following values are returned:\n\n * ``from_email``\n\n ... |
46ce6423a356cd7199b1298bfc42a65cbf843b72cdc6345ff1899eb530e94ae9 | def save(self, fail_silently=False):
'\n Build and send the email message.\n\n '
send_mail(fail_silently=fail_silently, **self.get_message_dict()) | Build and send the email message. | contact_form/forms.py | save | maru/django-contact-form-recaptcha | 2 | python | def save(self, fail_silently=False):
'\n \n\n '
send_mail(fail_silently=fail_silently, **self.get_message_dict()) | def save(self, fail_silently=False):
'\n \n\n '
send_mail(fail_silently=fail_silently, **self.get_message_dict())<|docstring|>Build and send the email message.<|endoftext|> |
3faf5f3193e8de25428af2c660a51bc87c53583dc0135a85d9d96426d1a72bcc | def create():
'Create a new IRBuilder\n\n Returns\n -------\n builder : IRBuilder\n The created IRBuilder\n '
return IRBuilder() | Create a new IRBuilder
Returns
-------
builder : IRBuilder
The created IRBuilder | third_party/incubator-tvm/python/tvm/ir_builder.py | create | tianjiashuo/akg | 286 | python | def create():
'Create a new IRBuilder\n\n Returns\n -------\n builder : IRBuilder\n The created IRBuilder\n '
return IRBuilder() | def create():
'Create a new IRBuilder\n\n Returns\n -------\n builder : IRBuilder\n The created IRBuilder\n '
return IRBuilder()<|docstring|>Create a new IRBuilder
Returns
-------
builder : IRBuilder
The created IRBuilder<|endoftext|> |
c3b8f0af9269b503d90a510b2b827f9e41c2c5484fcb1f6cc59a9eef032dcc3f | def _pop_seq(self):
'Pop sequence from stack'
seq = self._seq_stack.pop()
if ((not seq) or callable(seq[(- 1)])):
seq.append(_make.Evaluate(0))
stmt = seq[(- 1)]
for s in reversed(seq[:(- 1)]):
if callable(s):
stmt = s(stmt)
else:
assert isinstance(s, ... | Pop sequence from stack | third_party/incubator-tvm/python/tvm/ir_builder.py | _pop_seq | tianjiashuo/akg | 286 | python | def _pop_seq(self):
seq = self._seq_stack.pop()
if ((not seq) or callable(seq[(- 1)])):
seq.append(_make.Evaluate(0))
stmt = seq[(- 1)]
for s in reversed(seq[:(- 1)]):
if callable(s):
stmt = s(stmt)
else:
assert isinstance(s, _stmt.Stmt)
s... | def _pop_seq(self):
seq = self._seq_stack.pop()
if ((not seq) or callable(seq[(- 1)])):
seq.append(_make.Evaluate(0))
stmt = seq[(- 1)]
for s in reversed(seq[:(- 1)]):
if callable(s):
stmt = s(stmt)
else:
assert isinstance(s, _stmt.Stmt)
s... |
dab26f4d0a7d5531edda555556706ee4dad2139e468523068d8438ece534956b | def emit(self, stmt):
'Emit a statement to the end of current scope.\n\n Parameters\n ----------\n stmt : Stmt or callable.\n The statement to be emitted or callable that build stmt given body.\n '
if isinstance(stmt, _expr.Call):
stmt = _make.Evaluate(stmt)
ass... | Emit a statement to the end of current scope.
Parameters
----------
stmt : Stmt or callable.
The statement to be emitted or callable that build stmt given body. | third_party/incubator-tvm/python/tvm/ir_builder.py | emit | tianjiashuo/akg | 286 | python | def emit(self, stmt):
'Emit a statement to the end of current scope.\n\n Parameters\n ----------\n stmt : Stmt or callable.\n The statement to be emitted or callable that build stmt given body.\n '
if isinstance(stmt, _expr.Call):
stmt = _make.Evaluate(stmt)
ass... | def emit(self, stmt):
'Emit a statement to the end of current scope.\n\n Parameters\n ----------\n stmt : Stmt or callable.\n The statement to be emitted or callable that build stmt given body.\n '
if isinstance(stmt, _expr.Call):
stmt = _make.Evaluate(stmt)
ass... |
86fd6aeae7326651efa04ca84c0774201dd6e9529be5c8a448a801040c01b9d4 | def scope_attr(self, node, attr_key, value):
'Create an AttrStmt at current scope.\n\n Parameters\n ----------\n attr_key : str\n The key of the attribute type.\n\n node : Node\n The attribute node to annottate on.\n\n value : Expr\n Attribute valu... | Create an AttrStmt at current scope.
Parameters
----------
attr_key : str
The key of the attribute type.
node : Node
The attribute node to annottate on.
value : Expr
Attribute value.
Examples
--------
.. code-block:: python
ib = tvm.ir_builder.create()
i = tvm.var("i")
x = ib.pointer("float... | third_party/incubator-tvm/python/tvm/ir_builder.py | scope_attr | tianjiashuo/akg | 286 | python | def scope_attr(self, node, attr_key, value):
'Create an AttrStmt at current scope.\n\n Parameters\n ----------\n attr_key : str\n The key of the attribute type.\n\n node : Node\n The attribute node to annottate on.\n\n value : Expr\n Attribute valu... | def scope_attr(self, node, attr_key, value):
'Create an AttrStmt at current scope.\n\n Parameters\n ----------\n attr_key : str\n The key of the attribute type.\n\n node : Node\n The attribute node to annottate on.\n\n value : Expr\n Attribute valu... |
0334f059e385c25fe23d6db110ca842cfb96afd3db91d66e2f319bf74ac578dc | def for_range(self, begin, end, name='i', dtype='int32', for_type='serial'):
'Create a for iteration scope.\n\n Parameters\n ----------\n begin : Expr\n The min iteration scope.\n\n end : Expr\n The end iteration scope\n\n name : str, optional\n Th... | Create a for iteration scope.
Parameters
----------
begin : Expr
The min iteration scope.
end : Expr
The end iteration scope
name : str, optional
The name of iteration variable, if no input names,
using typical index names i, j, k, then i_nidx
dtype : str, optional
The data type of iteration var... | third_party/incubator-tvm/python/tvm/ir_builder.py | for_range | tianjiashuo/akg | 286 | python | def for_range(self, begin, end, name='i', dtype='int32', for_type='serial'):
'Create a for iteration scope.\n\n Parameters\n ----------\n begin : Expr\n The min iteration scope.\n\n end : Expr\n The end iteration scope\n\n name : str, optional\n Th... | def for_range(self, begin, end, name='i', dtype='int32', for_type='serial'):
'Create a for iteration scope.\n\n Parameters\n ----------\n begin : Expr\n The min iteration scope.\n\n end : Expr\n The end iteration scope\n\n name : str, optional\n Th... |
9582bfd1487214f5c8d07e3746b399ac5fe5d156964896d16e61e17091f38e19 | def for_range_n(self, extents, prefix_name='i', dtype='int32', for_type='serial'):
' Create a multilayer for iteration scope\n\n Parameters\n ----------\n extents: list or tuple\n The end iteration scope of each layer.\n\n prefix_name: str, optional\n The prefix name ... | Create a multilayer for iteration scope
Parameters
----------
extents: list or tuple
The end iteration scope of each layer.
prefix_name: str, optional
The prefix name of iteration variable.
dtype : str, optional
The data type of iteration variable.
for_type : str, optional
The special tag on the for l... | third_party/incubator-tvm/python/tvm/ir_builder.py | for_range_n | tianjiashuo/akg | 286 | python | def for_range_n(self, extents, prefix_name='i', dtype='int32', for_type='serial'):
' Create a multilayer for iteration scope\n\n Parameters\n ----------\n extents: list or tuple\n The end iteration scope of each layer.\n\n prefix_name: str, optional\n The prefix name ... | def for_range_n(self, extents, prefix_name='i', dtype='int32', for_type='serial'):
' Create a multilayer for iteration scope\n\n Parameters\n ----------\n extents: list or tuple\n The end iteration scope of each layer.\n\n prefix_name: str, optional\n The prefix name ... |
e6031147a70a04e4f7c63b2a17c277f9d5677181e92a0cee7387ea0d27a04231 | def extern_call(self, *args, op_name='', dtype='float32'):
'Generate call node.\n\n Parameters\n ----------\n args : list of Expr\n The input arguments to the call.\n\n op_name: str\n The function name.\n\n dtype : str, optional\n The data type of ... | Generate call node.
Parameters
----------
args : list of Expr
The input arguments to the call.
op_name: str
The function name.
dtype : str, optional
The data type of output.
Returns
-------
expr: Expr
The result of random tensor. | third_party/incubator-tvm/python/tvm/ir_builder.py | extern_call | tianjiashuo/akg | 286 | python | def extern_call(self, *args, op_name=, dtype='float32'):
'Generate call node.\n\n Parameters\n ----------\n args : list of Expr\n The input arguments to the call.\n\n op_name: str\n The function name.\n\n dtype : str, optional\n The data type of ou... | def extern_call(self, *args, op_name=, dtype='float32'):
'Generate call node.\n\n Parameters\n ----------\n args : list of Expr\n The input arguments to the call.\n\n op_name: str\n The function name.\n\n dtype : str, optional\n The data type of ou... |
5ad9ca16875cad4b24e6a90d54ef9d3a7b2082dc7e631c627ca2a5ae107395b8 | def load(self, buf, index):
'Load element from tensor buffer.\n\n Parameters\n ----------\n buf: Buffer\n The buffer to load.\n\n index: Expr\n Element index to load\n\n Returns\n -------\n expr: Expr\n The result of load expr.\n ... | Load element from tensor buffer.
Parameters
----------
buf: Buffer
The buffer to load.
index: Expr
Element index to load
Returns
-------
expr: Expr
The result of load expr. | third_party/incubator-tvm/python/tvm/ir_builder.py | load | tianjiashuo/akg | 286 | python | def load(self, buf, index):
'Load element from tensor buffer.\n\n Parameters\n ----------\n buf: Buffer\n The buffer to load.\n\n index: Expr\n Element index to load\n\n Returns\n -------\n expr: Expr\n The result of load expr.\n ... | def load(self, buf, index):
'Load element from tensor buffer.\n\n Parameters\n ----------\n buf: Buffer\n The buffer to load.\n\n index: Expr\n Element index to load\n\n Returns\n -------\n expr: Expr\n The result of load expr.\n ... |
ff7be8a01b33252843c6396b93e9fac6bea8cd53ee804efacf23d888ae157a71 | def store(self, buf, index, value):
'Store value to tensor buffer.\n\n Parameters\n ----------\n buf: Buffer\n Tensor buffer.\n\n index: Expr\n Element index.\n\n value: Expr\n Value to store.\n\n Returns\n -------\n stmt: Stmt\n... | Store value to tensor buffer.
Parameters
----------
buf: Buffer
Tensor buffer.
index: Expr
Element index.
value: Expr
Value to store.
Returns
-------
stmt: Stmt
The result of emit stmt. | third_party/incubator-tvm/python/tvm/ir_builder.py | store | tianjiashuo/akg | 286 | python | def store(self, buf, index, value):
'Store value to tensor buffer.\n\n Parameters\n ----------\n buf: Buffer\n Tensor buffer.\n\n index: Expr\n Element index.\n\n value: Expr\n Value to store.\n\n Returns\n -------\n stmt: Stmt\n... | def store(self, buf, index, value):
'Store value to tensor buffer.\n\n Parameters\n ----------\n buf: Buffer\n Tensor buffer.\n\n index: Expr\n Element index.\n\n value: Expr\n Value to store.\n\n Returns\n -------\n stmt: Stmt\n... |
4cca2758784307d05bb18e7d6c67a6cf4bb68c929c3d0b5b3beda97e7a7ffd9b | def if_scope(self, cond):
'Create an if scope.\n\n Parameters\n ----------\n cond : Expr\n The condition.\n\n Returns\n -------\n if_scope : WithScope\n The result if scope.\n\n Examples\n --------\n .. code-block:: python\n\n ... | Create an if scope.
Parameters
----------
cond : Expr
The condition.
Returns
-------
if_scope : WithScope
The result if scope.
Examples
--------
.. code-block:: python
ib = tvm.ir_builder.create()
i = tvm.var("i")
x = ib.pointer("float32")
with ib.if_scope((i % 2) == 0):
x[i] = x[i - ... | third_party/incubator-tvm/python/tvm/ir_builder.py | if_scope | tianjiashuo/akg | 286 | python | def if_scope(self, cond):
'Create an if scope.\n\n Parameters\n ----------\n cond : Expr\n The condition.\n\n Returns\n -------\n if_scope : WithScope\n The result if scope.\n\n Examples\n --------\n .. code-block:: python\n\n ... | def if_scope(self, cond):
'Create an if scope.\n\n Parameters\n ----------\n cond : Expr\n The condition.\n\n Returns\n -------\n if_scope : WithScope\n The result if scope.\n\n Examples\n --------\n .. code-block:: python\n\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.