body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def _url_normalize(self, text: str, repl: str, regex=re.compile('(https?|ftp|www)\\S+')) -> str:
"Return the string obtained by replacing all urls in 'text' by the replacement 'repl'.\n Args:\n text (str): text to be replaced\n repl (str): replace all urls in text with 'repl'\n "... | 2,643,941,785,526,158,000 | Return the string obtained by replacing all urls in 'text' by the replacement 'repl'.
Args:
text (str): text to be replaced
repl (str): replace all urls in text with 'repl' | prenlp/data/normalizer.py | _url_normalize | awesome-archive/prenlp | python | def _url_normalize(self, text: str, repl: str, regex=re.compile('(https?|ftp|www)\\S+')) -> str:
"Return the string obtained by replacing all urls in 'text' by the replacement 'repl'.\n Args:\n text (str): text to be replaced\n repl (str): replace all urls in text with 'repl'\n "... |
def _tag_normalize(self, text: str, repl: str, regex=re.compile('<[^>]*>')) -> str:
"Return the string obtained by replacing all HTML tags in 'text' by the replacement 'repl'.\n Args:\n text (str): text to be replaced\n repl (str): replace all HTML tags in text with 'repl'\n "
... | -9,178,201,264,139,550,000 | Return the string obtained by replacing all HTML tags in 'text' by the replacement 'repl'.
Args:
text (str): text to be replaced
repl (str): replace all HTML tags in text with 'repl' | prenlp/data/normalizer.py | _tag_normalize | awesome-archive/prenlp | python | def _tag_normalize(self, text: str, repl: str, regex=re.compile('<[^>]*>')) -> str:
"Return the string obtained by replacing all HTML tags in 'text' by the replacement 'repl'.\n Args:\n text (str): text to be replaced\n repl (str): replace all HTML tags in text with 'repl'\n "
... |
def _emoji_normalize(self, text: str, repl: str, regex=re.compile('\\U0001f469\\u200d\\u2764\\ufe0f\\u200d\\U0001f48b\\u200d\\U0001f468|\\U0001f468\\u200d\\u2764\\ufe0f\\u200d\\U0001f48b\\u200d\\U0001f468|\\U0001f469\\u200d\\u2764\\ufe0f\\u200d\\U0001f48b\\u200d\\U0001f469|\\U0001f9d1\\U0001f3fb\\u200d\\U0001f91d\\u200... | 399,084,624,044,253,250 | Return the string obtained by replacing all emojis in 'text' by the replacement 'repl'.
Args:
text (str): text to be replaced
repl (str): replace all emojis in text with 'repl'
Reference:
akkez/emoji.py: Python emoji regexp / python emoji detection
https://gist.github.com/akkez/99ceeae2f... | prenlp/data/normalizer.py | _emoji_normalize | awesome-archive/prenlp | python | def _emoji_normalize(self, text: str, repl: str, regex=re.compile('\\U0001f469\\u200d\\u2764\\ufe0f\\u200d\\U0001f48b\\u200d\\U0001f468|\\U0001f468\\u200d\\u2764\\ufe0f\\u200d\\U0001f48b\\u200d\\U0001f468|\\U0001f469\\u200d\\u2764\\ufe0f\\u200d\\U0001f48b\\u200d\\U0001f469|\\U0001f9d1\\U0001f3fb\\u200d\\U0001f91d\\u200... |
def _email_normalize(self, text: str, repl: str, regex=re.compile("[a-zA-Z0-9.!#$%&\\'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9.]+")) -> str:
"Return the string obtained by replacing all email addresses in 'text' by the replacement 'repl'.\n Args:\n text (str): text to be replaced\n re... | -7,109,481,101,408,435,000 | Return the string obtained by replacing all email addresses in 'text' by the replacement 'repl'.
Args:
text (str): text to be replaced
repl (str): replace all email addresses in text with 'repl' | prenlp/data/normalizer.py | _email_normalize | awesome-archive/prenlp | python | def _email_normalize(self, text: str, repl: str, regex=re.compile("[a-zA-Z0-9.!#$%&\\'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9.]+")) -> str:
"Return the string obtained by replacing all email addresses in 'text' by the replacement 'repl'.\n Args:\n text (str): text to be replaced\n re... |
def _tel_normalize(self, text: str, repl: str, regex=re.compile('[()+\\d.\\-]*[ ]?\\d{2,4}[-. ]+\\d{3,4}[-. ]+\\d{3,4}')) -> str:
"Return the string obtained by replacing all phone numbers in 'text' by the replacement 'repl'.\n Args:\n text (str): text to be replaced\n repl (str): repla... | 5,178,421,445,740,574,000 | Return the string obtained by replacing all phone numbers in 'text' by the replacement 'repl'.
Args:
text (str): text to be replaced
repl (str): replace all phone numbers in text with 'repl' | prenlp/data/normalizer.py | _tel_normalize | awesome-archive/prenlp | python | def _tel_normalize(self, text: str, repl: str, regex=re.compile('[()+\\d.\\-]*[ ]?\\d{2,4}[-. ]+\\d{3,4}[-. ]+\\d{3,4}')) -> str:
"Return the string obtained by replacing all phone numbers in 'text' by the replacement 'repl'.\n Args:\n text (str): text to be replaced\n repl (str): repla... |
def train_step(*, flax_model: nn.Module, train_state: train_utils.TrainState, batch: bert_base_model.Batch, learning_rate_fn: Callable[([int], float)], loss_fn: bert_base_model.LossFn, metrics_fn: bert_base_model.MetricFn, config: ml_collections.ConfigDict, debug: Optional[bool]=False) -> Tuple[(train_utils.TrainState,... | -8,175,806,276,474,680,000 | Runs a single step of training.
Given the state of the training and a batch of data, computes
the loss and updates the parameters of the model.
Note that in this code, the buffers of the first (train_state) and second
(batch) arguments are donated to the computation.
Args:
flax_model: A Flax model.
train_state: ... | scenic/projects/baselines/bert/trainer.py | train_step | YYCOCO/scenic | python | def train_step(*, flax_model: nn.Module, train_state: train_utils.TrainState, batch: bert_base_model.Batch, learning_rate_fn: Callable[([int], float)], loss_fn: bert_base_model.LossFn, metrics_fn: bert_base_model.MetricFn, config: ml_collections.ConfigDict, debug: Optional[bool]=False) -> Tuple[(train_utils.TrainState,... |
def eval_step(*, flax_model: nn.Module, train_state: train_utils.TrainState, batch: bert_base_model.Batch, metrics_fn: bert_base_model.MetricFn, all_gather: bool=False, debug: Optional[bool]=False) -> Tuple[(Dict[(str, Tuple[(float, int)])], Optional[jnp.ndarray], Optional[jnp.ndarray])]:
'Runs a single step of tra... | 7,768,984,873,474,436,000 | Runs a single step of training.
Note that in this code, the buffer of the second argument (batch) is donated
to the computation.
Assumed API of metrics_fn is:
```metrics = metrics_fn(logits, batch)
where batch is yielded by the batch iterator, and metrics is a dictionary
mapping metric name to a vector of per example... | scenic/projects/baselines/bert/trainer.py | eval_step | YYCOCO/scenic | python | def eval_step(*, flax_model: nn.Module, train_state: train_utils.TrainState, batch: bert_base_model.Batch, metrics_fn: bert_base_model.MetricFn, all_gather: bool=False, debug: Optional[bool]=False) -> Tuple[(Dict[(str, Tuple[(float, int)])], Optional[jnp.ndarray], Optional[jnp.ndarray])]:
'Runs a single step of tra... |
def representation_fn(*, flax_model: nn.Module, train_state: train_utils.TrainState, batch: bert_base_model.Batch, representation_layer: str, gather_to_host: bool=True) -> Tuple[(jnp.ndarray, jnp.ndarray, jnp.ndarray)]:
'Feeds the inputs to the model and returns their representations.\n\n Args:\n flax_model: A ... | -1,253,500,954,270,226,400 | Feeds the inputs to the model and returns their representations.
Args:
flax_model: A Flax model.
train_state: TrainState, the state of training including the current
global_step, model_state, rng, and optimizer. The buffer of this argument
can be donated to the computation.
batch: A single batch of data ... | scenic/projects/baselines/bert/trainer.py | representation_fn | YYCOCO/scenic | python | def representation_fn(*, flax_model: nn.Module, train_state: train_utils.TrainState, batch: bert_base_model.Batch, representation_layer: str, gather_to_host: bool=True) -> Tuple[(jnp.ndarray, jnp.ndarray, jnp.ndarray)]:
'Feeds the inputs to the model and returns their representations.\n\n Args:\n flax_model: A ... |
def train(*, rng: jnp.ndarray, config: ml_collections.ConfigDict, model_cls: Type[bert_base_model.BERTBaseModel], dataset: dataset_utils.Dataset, workdir: str, writer: metric_writers.MetricWriter) -> Tuple[(train_utils.TrainState, Dict[(str, Any)], Dict[(str, Any)])]:
'Main training loop lives in this function.\n\n... | -5,546,512,633,221,539,000 | Main training loop lives in this function.
Given the model class and dataset, it prepares the items needed to run the
training, including the TrainState.
Args:
rng: Jax rng key.
config: Configurations of the experiment.
model_cls: Model class; A model has a flax_module, a loss_fn, and a
metrics_fn associate... | scenic/projects/baselines/bert/trainer.py | train | YYCOCO/scenic | python | def train(*, rng: jnp.ndarray, config: ml_collections.ConfigDict, model_cls: Type[bert_base_model.BERTBaseModel], dataset: dataset_utils.Dataset, workdir: str, writer: metric_writers.MetricWriter) -> Tuple[(train_utils.TrainState, Dict[(str, Any)], Dict[(str, Any)])]:
'Main training loop lives in this function.\n\n... |
def make_app():
"Create and return the main Tornado web application.\n \n It will listen on the port assigned via `app.listen(port)`,\n and will run on Tornado's main ioloop,\n which can be started with `tornado.ioloop.IOLoop.current().start()`.\n "
return tornado.web.Application([('/connect', Cl... | 5,578,636,170,637,167,000 | Create and return the main Tornado web application.
It will listen on the port assigned via `app.listen(port)`,
and will run on Tornado's main ioloop,
which can be started with `tornado.ioloop.IOLoop.current().start()`. | 6/server.py | make_app | mesilliac/multitude | python | def make_app():
"Create and return the main Tornado web application.\n \n It will listen on the port assigned via `app.listen(port)`,\n and will run on Tornado's main ioloop,\n which can be started with `tornado.ioloop.IOLoop.current().start()`.\n "
return tornado.web.Application([('/connect', Cl... |
def open(self):
'Called when a websocket connection is initiated.'
print('WebSocket opened', 'from user at {}'.format(self.request.remote_ip)) | 8,339,893,375,875,062,000 | Called when a websocket connection is initiated. | 6/server.py | open | mesilliac/multitude | python | def open(self):
print('WebSocket opened', 'from user at {}'.format(self.request.remote_ip)) |
def on_message(self, message):
'Called when a websocket client sends a message.'
print('client sent: {!r}'.format(message))
try:
parsed_message = json.loads(message)
except ValueError:
print('Failed to parse message: {!r}'.format(message))
return
if ('message' in parsed_messa... | 2,825,529,043,714,230,000 | Called when a websocket client sends a message. | 6/server.py | on_message | mesilliac/multitude | python | def on_message(self, message):
print('client sent: {!r}'.format(message))
try:
parsed_message = json.loads(message)
except ValueError:
print('Failed to parse message: {!r}'.format(message))
return
if ('message' in parsed_message):
response = {'client': str(self.reque... |
def on_close(self):
'Called when a client connection is closed for any reason.'
print('WebSocket closed', 'by user at {}'.format(self.request.remote_ip))
print('close code: {}'.format(self.close_code))
print('close reason: {!r}'.format(self.close_reason)) | -5,035,516,040,567,961,000 | Called when a client connection is closed for any reason. | 6/server.py | on_close | mesilliac/multitude | python | def on_close(self):
print('WebSocket closed', 'by user at {}'.format(self.request.remote_ip))
print('close code: {}'.format(self.close_code))
print('close reason: {!r}'.format(self.close_reason)) |
def upsert(self, fileobj, as_string_obj=False):
'Expects a file *object*, not a file path. This is important because this has to work for both\n the management command and the web uploader; the web uploader will pass in in-memory file\n with no path!\n\n Header row is:\n Title, Group, Ta... | -1,511,334,185,700,706,800 | Expects a file *object*, not a file path. This is important because this has to work for both
the management command and the web uploader; the web uploader will pass in in-memory file
with no path!
Header row is:
Title, Group, Task List, Created Date, Due Date, Completed, Created By, Assigned To, Note, Priority | todo/operations/csv_importer.py | upsert | paiuolo/django-todo | python | def upsert(self, fileobj, as_string_obj=False):
'Expects a file *object*, not a file path. This is important because this has to work for both\n the management command and the web uploader; the web uploader will pass in in-memory file\n with no path!\n\n Header row is:\n Title, Group, Ta... |
def validate_row(self, row):
'Perform data integrity checks and set default values. Returns a valid object for insertion, or False.\n Errors are stored for later display. Intentionally not broken up into separate validator functions because\n there are interdpendencies, such as checking for existing `... | 7,638,953,346,214,888,000 | Perform data integrity checks and set default values. Returns a valid object for insertion, or False.
Errors are stored for later display. Intentionally not broken up into separate validator functions because
there are interdpendencies, such as checking for existing `creator` in one place and then using
that creator fo... | todo/operations/csv_importer.py | validate_row | paiuolo/django-todo | python | def validate_row(self, row):
'Perform data integrity checks and set default values. Returns a valid object for insertion, or False.\n Errors are stored for later display. Intentionally not broken up into separate validator functions because\n there are interdpendencies, such as checking for existing `... |
def validate_date(self, datestring):
'Inbound date string from CSV translates to a valid python date.'
try:
date_obj = datetime.datetime.strptime(datestring, '%Y-%m-%d')
return date_obj
except ValueError:
return False | 99,234,609,655,635,260 | Inbound date string from CSV translates to a valid python date. | todo/operations/csv_importer.py | validate_date | paiuolo/django-todo | python | def validate_date(self, datestring):
try:
date_obj = datetime.datetime.strptime(datestring, '%Y-%m-%d')
return date_obj
except ValueError:
return False |
def queue_handler(event, context):
'\n Handler for the event queue lambda trigger\n '
ec2_client = boto3.client('ec2')
dynamodb_resource = boto3.resource('dynamodb')
route53_client = boto3.client('route53')
handler = QueueHandler(ec2_client=ec2_client, dynamodb_resource=dynamodb_resource, rout... | 2,444,088,784,356,499,000 | Handler for the event queue lambda trigger | packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/index.py | queue_handler | 14kw/aws-cdk | python | def queue_handler(event, context):
'\n \n '
ec2_client = boto3.client('ec2')
dynamodb_resource = boto3.resource('dynamodb')
route53_client = boto3.client('route53')
handler = QueueHandler(ec2_client=ec2_client, dynamodb_resource=dynamodb_resource, route53_client=route53_client, environ=os.envi... |
def cleanup_resource_handler(event, context):
'\n Event handler for the custom resource.\n '
route53_client = boto3.client('route53')
handler = CleanupResourceHandler(route53_client=route53_client)
handler.handle_event(event, context) | 6,568,129,744,530,817,000 | Event handler for the custom resource. | packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/index.py | cleanup_resource_handler | 14kw/aws-cdk | python | def cleanup_resource_handler(event, context):
'\n \n '
route53_client = boto3.client('route53')
handler = CleanupResourceHandler(route53_client=route53_client)
handler.handle_event(event, context) |
def __init__(__self__, *, object_type: str, access_token_string: Optional[str]=None, b_ms_active_region: Optional[str]=None, backup_management_type: Optional[str]=None, container_id: Optional[str]=None, container_name: Optional[str]=None, container_type: Optional[str]=None, coordinator_service_stamp_id: Optional[str]=N... | 5,268,489,130,695,467,000 | :param str object_type: Type of the specific object - used for deserializing
Expected value is 'WorkloadCrrAccessToken'.
:param str access_token_string: Access token used for authentication
:param str b_ms_active_region: Active region name of BMS Stamp
:param str backup_management_type: Backup Management Type
:p... | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | __init__ | polivbr/pulumi-azure-native | python | def __init__(__self__, *, object_type: str, access_token_string: Optional[str]=None, b_ms_active_region: Optional[str]=None, backup_management_type: Optional[str]=None, container_id: Optional[str]=None, container_name: Optional[str]=None, container_type: Optional[str]=None, coordinator_service_stamp_id: Optional[str]=N... |
@property
@pulumi.getter(name='objectType')
def object_type(self) -> str:
"\n Type of the specific object - used for deserializing\n Expected value is 'WorkloadCrrAccessToken'.\n "
return pulumi.get(self, 'object_type') | -3,998,653,038,819,862,000 | Type of the specific object - used for deserializing
Expected value is 'WorkloadCrrAccessToken'. | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | object_type | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='objectType')
def object_type(self) -> str:
"\n Type of the specific object - used for deserializing\n Expected value is 'WorkloadCrrAccessToken'.\n "
return pulumi.get(self, 'object_type') |
@property
@pulumi.getter(name='accessTokenString')
def access_token_string(self) -> Optional[str]:
'\n Access token used for authentication\n '
return pulumi.get(self, 'access_token_string') | -7,203,913,160,809,380,000 | Access token used for authentication | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | access_token_string | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='accessTokenString')
def access_token_string(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'access_token_string') |
@property
@pulumi.getter(name='bMSActiveRegion')
def b_ms_active_region(self) -> Optional[str]:
'\n Active region name of BMS Stamp\n '
return pulumi.get(self, 'b_ms_active_region') | 3,531,671,361,282,815,500 | Active region name of BMS Stamp | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | b_ms_active_region | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='bMSActiveRegion')
def b_ms_active_region(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'b_ms_active_region') |
@property
@pulumi.getter(name='backupManagementType')
def backup_management_type(self) -> Optional[str]:
'\n Backup Management Type\n '
return pulumi.get(self, 'backup_management_type') | -3,607,554,820,754,466,300 | Backup Management Type | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | backup_management_type | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='backupManagementType')
def backup_management_type(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'backup_management_type') |
@property
@pulumi.getter(name='containerId')
def container_id(self) -> Optional[str]:
'\n Container Id\n '
return pulumi.get(self, 'container_id') | -3,906,827,088,908,365,000 | Container Id | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | container_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='containerId')
def container_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'container_id') |
@property
@pulumi.getter(name='containerName')
def container_name(self) -> Optional[str]:
'\n Container Unique name\n '
return pulumi.get(self, 'container_name') | 2,173,014,166,487,229,000 | Container Unique name | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | container_name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='containerName')
def container_name(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'container_name') |
@property
@pulumi.getter(name='containerType')
def container_type(self) -> Optional[str]:
'\n Container Type\n '
return pulumi.get(self, 'container_type') | -7,253,977,290,139,890,000 | Container Type | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | container_type | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='containerType')
def container_type(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'container_type') |
@property
@pulumi.getter(name='coordinatorServiceStampId')
def coordinator_service_stamp_id(self) -> Optional[str]:
'\n CoordinatorServiceStampId to be used by BCM in restore call\n '
return pulumi.get(self, 'coordinator_service_stamp_id') | 7,953,596,843,091,469,000 | CoordinatorServiceStampId to be used by BCM in restore call | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | coordinator_service_stamp_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='coordinatorServiceStampId')
def coordinator_service_stamp_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'coordinator_service_stamp_id') |
@property
@pulumi.getter(name='coordinatorServiceStampUri')
def coordinator_service_stamp_uri(self) -> Optional[str]:
'\n CoordinatorServiceStampUri to be used by BCM in restore call\n '
return pulumi.get(self, 'coordinator_service_stamp_uri') | 8,869,795,110,830,805,000 | CoordinatorServiceStampUri to be used by BCM in restore call | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | coordinator_service_stamp_uri | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='coordinatorServiceStampUri')
def coordinator_service_stamp_uri(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'coordinator_service_stamp_uri') |
@property
@pulumi.getter(name='datasourceContainerName')
def datasource_container_name(self) -> Optional[str]:
'\n Datasource Container Unique Name\n '
return pulumi.get(self, 'datasource_container_name') | 1,468,694,404,234,115,000 | Datasource Container Unique Name | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | datasource_container_name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='datasourceContainerName')
def datasource_container_name(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'datasource_container_name') |
@property
@pulumi.getter(name='datasourceId')
def datasource_id(self) -> Optional[str]:
'\n Datasource Id\n '
return pulumi.get(self, 'datasource_id') | -3,802,653,218,932,743,000 | Datasource Id | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | datasource_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='datasourceId')
def datasource_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'datasource_id') |
@property
@pulumi.getter(name='datasourceName')
def datasource_name(self) -> Optional[str]:
'\n Datasource Friendly Name\n '
return pulumi.get(self, 'datasource_name') | -1,316,121,001,417,822,200 | Datasource Friendly Name | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | datasource_name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='datasourceName')
def datasource_name(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'datasource_name') |
@property
@pulumi.getter(name='datasourceType')
def datasource_type(self) -> Optional[str]:
'\n Datasource Type\n '
return pulumi.get(self, 'datasource_type') | 1,662,289,899,096,395,800 | Datasource Type | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | datasource_type | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='datasourceType')
def datasource_type(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'datasource_type') |
@property
@pulumi.getter(name='policyId')
def policy_id(self) -> Optional[str]:
'\n Policy Id\n '
return pulumi.get(self, 'policy_id') | -8,343,960,743,785,246,000 | Policy Id | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | policy_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='policyId')
def policy_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'policy_id') |
@property
@pulumi.getter(name='policyName')
def policy_name(self) -> Optional[str]:
'\n Policy Name\n '
return pulumi.get(self, 'policy_name') | -7,372,258,329,662,324,000 | Policy Name | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | policy_name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='policyName')
def policy_name(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'policy_name') |
@property
@pulumi.getter(name='protectionContainerId')
def protection_container_id(self) -> Optional[float]:
'\n Protected item container id\n '
return pulumi.get(self, 'protection_container_id') | 887,728,920,284,130,000 | Protected item container id | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | protection_container_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='protectionContainerId')
def protection_container_id(self) -> Optional[float]:
'\n \n '
return pulumi.get(self, 'protection_container_id') |
@property
@pulumi.getter(name='protectionServiceStampId')
def protection_service_stamp_id(self) -> Optional[str]:
'\n ProtectionServiceStampId to be used by BCM in restore call\n '
return pulumi.get(self, 'protection_service_stamp_id') | -2,449,994,920,010,010,000 | ProtectionServiceStampId to be used by BCM in restore call | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | protection_service_stamp_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='protectionServiceStampId')
def protection_service_stamp_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'protection_service_stamp_id') |
@property
@pulumi.getter(name='protectionServiceStampUri')
def protection_service_stamp_uri(self) -> Optional[str]:
'\n ProtectionServiceStampUri to be used by BCM in restore call\n '
return pulumi.get(self, 'protection_service_stamp_uri') | -324,317,571,534,111,500 | ProtectionServiceStampUri to be used by BCM in restore call | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | protection_service_stamp_uri | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='protectionServiceStampUri')
def protection_service_stamp_uri(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'protection_service_stamp_uri') |
@property
@pulumi.getter(name='recoveryPointId')
def recovery_point_id(self) -> Optional[str]:
'\n Recovery Point Id\n '
return pulumi.get(self, 'recovery_point_id') | 2,502,510,055,000,705,000 | Recovery Point Id | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | recovery_point_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='recoveryPointId')
def recovery_point_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'recovery_point_id') |
@property
@pulumi.getter(name='recoveryPointTime')
def recovery_point_time(self) -> Optional[str]:
'\n Recovery Point Time\n '
return pulumi.get(self, 'recovery_point_time') | -6,703,879,278,270,103,000 | Recovery Point Time | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | recovery_point_time | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='recoveryPointTime')
def recovery_point_time(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'recovery_point_time') |
@property
@pulumi.getter(name='resourceGroupName')
def resource_group_name(self) -> Optional[str]:
'\n Resource Group name of the source vault\n '
return pulumi.get(self, 'resource_group_name') | 6,503,071,801,719,718,000 | Resource Group name of the source vault | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | resource_group_name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='resourceGroupName')
def resource_group_name(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'resource_group_name') |
@property
@pulumi.getter(name='resourceId')
def resource_id(self) -> Optional[str]:
'\n Resource Id of the source vault\n '
return pulumi.get(self, 'resource_id') | 9,163,903,248,834,838,000 | Resource Id of the source vault | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | resource_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='resourceId')
def resource_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'resource_id') |
@property
@pulumi.getter(name='resourceName')
def resource_name(self) -> Optional[str]:
'\n Resource Name of the source vault\n '
return pulumi.get(self, 'resource_name') | 2,069,044,696,477,255,400 | Resource Name of the source vault | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | resource_name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='resourceName')
def resource_name(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'resource_name') |
@property
@pulumi.getter(name='rpIsManagedVirtualMachine')
def rp_is_managed_virtual_machine(self) -> Optional[bool]:
'\n Recovery point information: Managed virtual machine\n '
return pulumi.get(self, 'rp_is_managed_virtual_machine') | 4,476,595,934,361,092,000 | Recovery point information: Managed virtual machine | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | rp_is_managed_virtual_machine | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='rpIsManagedVirtualMachine')
def rp_is_managed_virtual_machine(self) -> Optional[bool]:
'\n \n '
return pulumi.get(self, 'rp_is_managed_virtual_machine') |
@property
@pulumi.getter(name='rpOriginalSAOption')
def rp_original_sa_option(self) -> Optional[bool]:
'\n Recovery point information: Original SA option\n '
return pulumi.get(self, 'rp_original_sa_option') | 419,153,740,887,226,500 | Recovery point information: Original SA option | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | rp_original_sa_option | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='rpOriginalSAOption')
def rp_original_sa_option(self) -> Optional[bool]:
'\n \n '
return pulumi.get(self, 'rp_original_sa_option') |
@property
@pulumi.getter(name='rpTierInformation')
def rp_tier_information(self) -> Optional[Mapping[(str, str)]]:
'\n Recovery point Tier Information\n '
return pulumi.get(self, 'rp_tier_information') | -7,363,072,588,888,681,000 | Recovery point Tier Information | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | rp_tier_information | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='rpTierInformation')
def rp_tier_information(self) -> Optional[Mapping[(str, str)]]:
'\n \n '
return pulumi.get(self, 'rp_tier_information') |
@property
@pulumi.getter(name='rpVMSizeDescription')
def rp_vm_size_description(self) -> Optional[str]:
'\n Recovery point information: VM size description\n '
return pulumi.get(self, 'rp_vm_size_description') | 2,607,098,948,369,403,400 | Recovery point information: VM size description | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | rp_vm_size_description | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='rpVMSizeDescription')
def rp_vm_size_description(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'rp_vm_size_description') |
@property
@pulumi.getter(name='subscriptionId')
def subscription_id(self) -> Optional[str]:
'\n Subscription Id of the source vault\n '
return pulumi.get(self, 'subscription_id') | -2,701,085,146,683,017,700 | Subscription Id of the source vault | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | subscription_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='subscriptionId')
def subscription_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'subscription_id') |
@property
@pulumi.getter(name='tokenExtendedInformation')
def token_extended_information(self) -> Optional[str]:
'\n Extended Information about the token like FileSpec etc.\n '
return pulumi.get(self, 'token_extended_information') | -2,600,174,342,710,283,300 | Extended Information about the token like FileSpec etc. | sdk/python/pulumi_azure_native/recoveryservices/v20181220/outputs.py | token_extended_information | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='tokenExtendedInformation')
def token_extended_information(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'token_extended_information') |
def test_annotations_from_different_days_in_same_month(self):
'\n Test bucketing multiple annotations from different days of same month.\n\n Annotations from different days of the same month should go into one\n bucket.\n\n '
one_month_ago = (UTCNOW - datetime.timedelta(days=30))
... | -8,370,902,393,722,710,000 | Test bucketing multiple annotations from different days of same month.
Annotations from different days of the same month should go into one
bucket. | tests/h/activity/bucketing_test.py | test_annotations_from_different_days_in_same_month | y3g0r/h | python | def test_annotations_from_different_days_in_same_month(self):
'\n Test bucketing multiple annotations from different days of same month.\n\n Annotations from different days of the same month should go into one\n bucket.\n\n '
one_month_ago = (UTCNOW - datetime.timedelta(days=30))
... |
def _vectorize_fs_surf(file_path):
'\n Read surface information from a file and turn it into a vector.\n\n Parameters\n ----------\n file_path : str\n The path to a file with surface data.\n\n Returns\n -------\n vectorized_data : numpy.ndarray\n Extracted data.\n\n '
img =... | 4,618,926,693,309,100,000 | Read surface information from a file and turn it into a vector.
Parameters
----------
file_path : str
The path to a file with surface data.
Returns
-------
vectorized_data : numpy.ndarray
Extracted data. | camcan/utils/file_parsing.py | _vectorize_fs_surf | McIntosh-Lab-RRI/meg-mri-surrogate-biomarkers-aging-2020 | python | def _vectorize_fs_surf(file_path):
'\n Read surface information from a file and turn it into a vector.\n\n Parameters\n ----------\n file_path : str\n The path to a file with surface data.\n\n Returns\n -------\n vectorized_data : numpy.ndarray\n Extracted data.\n\n '
img =... |
def get_area(subject_dir, n_points):
'\n Read area information for the given subject and turn it into a vector.\n\n Data for left and right hemispheres are concatenated.\n\n Parameters\n ----------\n subject_dir : str\n The directory to files with surface data.\n n_points : int\n Def... | 875,535,619,154,462,000 | Read area information for the given subject and turn it into a vector.
Data for left and right hemispheres are concatenated.
Parameters
----------
subject_dir : str
The directory to files with surface data.
n_points : int
Defines how many points to take from cortex surface.
Returns
-------
: numpy.ndarray
... | camcan/utils/file_parsing.py | get_area | McIntosh-Lab-RRI/meg-mri-surrogate-biomarkers-aging-2020 | python | def get_area(subject_dir, n_points):
'\n Read area information for the given subject and turn it into a vector.\n\n Data for left and right hemispheres are concatenated.\n\n Parameters\n ----------\n subject_dir : str\n The directory to files with surface data.\n n_points : int\n Def... |
def get_thickness(subject_dir, n_points):
'\n Read thickness information for the given subject and turn it into a vector.\n\n Data for left and right hemispheres are concatenated.\n\n Parameters\n ----------\n subject_dir : str\n The directory to files with surface data.\n n_points : int\n ... | 3,697,208,708,536,857,600 | Read thickness information for the given subject and turn it into a vector.
Data for left and right hemispheres are concatenated.
Parameters
----------
subject_dir : str
The directory to files with surface data.
n_points : int
Defines how many points to take from cortex surface.
Returns
-------
: numpy.ndarr... | camcan/utils/file_parsing.py | get_thickness | McIntosh-Lab-RRI/meg-mri-surrogate-biomarkers-aging-2020 | python | def get_thickness(subject_dir, n_points):
'\n Read thickness information for the given subject and turn it into a vector.\n\n Data for left and right hemispheres are concatenated.\n\n Parameters\n ----------\n subject_dir : str\n The directory to files with surface data.\n n_points : int\n ... |
def install(console: 'Console'=None, overflow: 'OverflowMethod'='ignore', crop: bool=False, indent_guides: bool=False, max_length: int=None, max_string: int=None, expand_all: bool=False) -> None:
'Install automatic pretty printing in the Python REPL.\n\n Args:\n console (Console, optional): Console instan... | 1,714,336,521,467,081,200 | Install automatic pretty printing in the Python REPL.
Args:
console (Console, optional): Console instance or ``None`` to use global console. Defaults to None.
overflow (Optional[OverflowMethod], optional): Overflow method. Defaults to "ignore".
crop (Optional[bool], optional): Enable cropping of long lines... | rich/pretty.py | install | AwesomeGitHubRepos/rich | python | def install(console: 'Console'=None, overflow: 'OverflowMethod'='ignore', crop: bool=False, indent_guides: bool=False, max_length: int=None, max_string: int=None, expand_all: bool=False) -> None:
'Install automatic pretty printing in the Python REPL.\n\n Args:\n console (Console, optional): Console instan... |
def is_expandable(obj: Any) -> bool:
'Check if an object may be expanded by pretty print.'
return (isinstance(obj, _CONTAINERS) or (is_dataclass(obj) and (not isinstance(obj, type))) or hasattr(obj, '__rich_repr__')) | -4,525,373,465,941,685,000 | Check if an object may be expanded by pretty print. | rich/pretty.py | is_expandable | AwesomeGitHubRepos/rich | python | def is_expandable(obj: Any) -> bool:
return (isinstance(obj, _CONTAINERS) or (is_dataclass(obj) and (not isinstance(obj, type))) or hasattr(obj, '__rich_repr__')) |
def traverse(_object: Any, max_length: int=None, max_string: int=None) -> Node:
'Traverse object and generate a tree.\n\n Args:\n _object (Any): Object to be traversed.\n max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.\n Defaults... | 409,868,795,889,491,140 | Traverse object and generate a tree.
Args:
_object (Any): Object to be traversed.
max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
Defaults to None.
max_string (int, optional): Maximum length of string before truncating, or None to disable t... | rich/pretty.py | traverse | AwesomeGitHubRepos/rich | python | def traverse(_object: Any, max_length: int=None, max_string: int=None) -> Node:
'Traverse object and generate a tree.\n\n Args:\n _object (Any): Object to be traversed.\n max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.\n Defaults... |
def pretty_repr(_object: Any, *, max_width: int=80, indent_size: int=4, max_length: int=None, max_string: int=None, expand_all: bool=False) -> str:
'Prettify repr string by expanding on to new lines to fit within a given width.\n\n Args:\n _object (Any): Object to repr.\n max_width (int, optional):... | 2,721,995,392,291,146,000 | Prettify repr string by expanding on to new lines to fit within a given width.
Args:
_object (Any): Object to repr.
max_width (int, optional): Desired maximum width of repr string. Defaults to 80.
indent_size (int, optional): Number of spaces to indent. Defaults to 4.
max_length (int, optional): Maximu... | rich/pretty.py | pretty_repr | AwesomeGitHubRepos/rich | python | def pretty_repr(_object: Any, *, max_width: int=80, indent_size: int=4, max_length: int=None, max_string: int=None, expand_all: bool=False) -> str:
'Prettify repr string by expanding on to new lines to fit within a given width.\n\n Args:\n _object (Any): Object to repr.\n max_width (int, optional):... |
def pprint(_object: Any, *, console: 'Console'=None, indent_guides: bool=True, max_length: int=None, max_string: int=None, expand_all: bool=False):
'A convenience function for pretty printing.\n\n Args:\n _object (Any): Object to pretty print.\n console (Console, optional): Console instance, or Non... | -3,204,970,073,228,227,000 | A convenience function for pretty printing.
Args:
_object (Any): Object to pretty print.
console (Console, optional): Console instance, or None to use default. Defaults to None.
max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
Defaults to No... | rich/pretty.py | pprint | AwesomeGitHubRepos/rich | python | def pprint(_object: Any, *, console: 'Console'=None, indent_guides: bool=True, max_length: int=None, max_string: int=None, expand_all: bool=False):
'A convenience function for pretty printing.\n\n Args:\n _object (Any): Object to pretty print.\n console (Console, optional): Console instance, or Non... |
def display_hook(value: Any) -> None:
'Replacement sys.displayhook which prettifies objects with Rich.'
if (value is not None):
assert (console is not None)
builtins._ = None
console.print((value if isinstance(value, RichRenderable) else Pretty(value, overflow=overflow, indent_guides=ind... | 5,662,142,656,217,169,000 | Replacement sys.displayhook which prettifies objects with Rich. | rich/pretty.py | display_hook | AwesomeGitHubRepos/rich | python | def display_hook(value: Any) -> None:
if (value is not None):
assert (console is not None)
builtins._ = None
console.print((value if isinstance(value, RichRenderable) else Pretty(value, overflow=overflow, indent_guides=indent_guides, max_length=max_length, max_string=max_string, expand_... |
@property
def separator(self) -> str:
'Get separator between items.'
return ('' if self.last else ',') | -510,098,352,722,682,800 | Get separator between items. | rich/pretty.py | separator | AwesomeGitHubRepos/rich | python | @property
def separator(self) -> str:
return ( if self.last else ',') |
def iter_tokens(self) -> Iterable[str]:
'Generate tokens for this node.'
if self.key_repr:
(yield self.key_repr)
(yield self.key_separator)
if self.value_repr:
(yield self.value_repr)
elif (self.children is not None):
if self.children:
(yield self.open_brace)
... | -4,841,608,500,637,028,000 | Generate tokens for this node. | rich/pretty.py | iter_tokens | AwesomeGitHubRepos/rich | python | def iter_tokens(self) -> Iterable[str]:
if self.key_repr:
(yield self.key_repr)
(yield self.key_separator)
if self.value_repr:
(yield self.value_repr)
elif (self.children is not None):
if self.children:
(yield self.open_brace)
if (self.is_tuple an... |
def check_length(self, start_length: int, max_length: int) -> bool:
'Check the length fits within a limit.\n\n Args:\n start_length (int): Starting length of the line (indent, prefix, suffix).\n max_length (int): Maximum length.\n\n Returns:\n bool: True if the node ca... | 483,627,482,119,508,100 | Check the length fits within a limit.
Args:
start_length (int): Starting length of the line (indent, prefix, suffix).
max_length (int): Maximum length.
Returns:
bool: True if the node can be rendered within max length, otherwise False. | rich/pretty.py | check_length | AwesomeGitHubRepos/rich | python | def check_length(self, start_length: int, max_length: int) -> bool:
'Check the length fits within a limit.\n\n Args:\n start_length (int): Starting length of the line (indent, prefix, suffix).\n max_length (int): Maximum length.\n\n Returns:\n bool: True if the node ca... |
def render(self, max_width: int=80, indent_size: int=4, expand_all: bool=False) -> str:
'Render the node to a pretty repr.\n\n Args:\n max_width (int, optional): Maximum width of the repr. Defaults to 80.\n indent_size (int, optional): Size of indents. Defaults to 4.\n expand... | 8,836,848,078,502,881,000 | Render the node to a pretty repr.
Args:
max_width (int, optional): Maximum width of the repr. Defaults to 80.
indent_size (int, optional): Size of indents. Defaults to 4.
expand_all (bool, optional): Expand all levels. Defaults to False.
Returns:
str: A repr string of the original object. | rich/pretty.py | render | AwesomeGitHubRepos/rich | python | def render(self, max_width: int=80, indent_size: int=4, expand_all: bool=False) -> str:
'Render the node to a pretty repr.\n\n Args:\n max_width (int, optional): Maximum width of the repr. Defaults to 80.\n indent_size (int, optional): Size of indents. Defaults to 4.\n expand... |
@property
def expandable(self) -> bool:
'Check if the line may be expanded.'
return bool(((self.node is not None) and self.node.children)) | 2,772,350,312,093,809,700 | Check if the line may be expanded. | rich/pretty.py | expandable | AwesomeGitHubRepos/rich | python | @property
def expandable(self) -> bool:
return bool(((self.node is not None) and self.node.children)) |
def check_length(self, max_length: int) -> bool:
'Check this line fits within a given number of cells.'
start_length = ((len(self.whitespace) + cell_len(self.text)) + cell_len(self.suffix))
assert (self.node is not None)
return self.node.check_length(start_length, max_length) | -7,080,534,599,622,596,000 | Check this line fits within a given number of cells. | rich/pretty.py | check_length | AwesomeGitHubRepos/rich | python | def check_length(self, max_length: int) -> bool:
start_length = ((len(self.whitespace) + cell_len(self.text)) + cell_len(self.suffix))
assert (self.node is not None)
return self.node.check_length(start_length, max_length) |
def expand(self, indent_size: int) -> Iterable['_Line']:
'Expand this line by adding children on their own line.'
node = self.node
assert (node is not None)
whitespace = self.whitespace
assert node.children
if node.key_repr:
(yield _Line(text=f'{node.key_repr}{node.key_separator}{node.op... | 1,438,312,576,603,205,600 | Expand this line by adding children on their own line. | rich/pretty.py | expand | AwesomeGitHubRepos/rich | python | def expand(self, indent_size: int) -> Iterable['_Line']:
node = self.node
assert (node is not None)
whitespace = self.whitespace
assert node.children
if node.key_repr:
(yield _Line(text=f'{node.key_repr}{node.key_separator}{node.open_brace}', whitespace=whitespace))
else:
(y... |
def to_repr(obj: Any) -> str:
'Get repr string for an object, but catch errors.'
if ((max_string is not None) and isinstance(obj, (bytes, str)) and (len(obj) > max_string)):
truncated = (len(obj) - max_string)
obj_repr = f'{obj[:max_string]!r}+{truncated}'
else:
try:
obj_... | 3,696,886,800,623,560,000 | Get repr string for an object, but catch errors. | rich/pretty.py | to_repr | AwesomeGitHubRepos/rich | python | def to_repr(obj: Any) -> str:
if ((max_string is not None) and isinstance(obj, (bytes, str)) and (len(obj) > max_string)):
truncated = (len(obj) - max_string)
obj_repr = f'{obj[:max_string]!r}+{truncated}'
else:
try:
obj_repr = repr(obj)
except Exception as error... |
def _traverse(obj: Any, root: bool=False) -> Node:
'Walk the object depth first.'
obj_type = type(obj)
py_version = (sys.version_info.major, sys.version_info.minor)
children: List[Node]
def iter_rich_args(rich_args) -> Iterable[Union[(Any, Tuple[(str, Any)])]]:
for arg in rich_args:
... | -790,671,804,754,902,500 | Walk the object depth first. | rich/pretty.py | _traverse | AwesomeGitHubRepos/rich | python | def _traverse(obj: Any, root: bool=False) -> Node:
obj_type = type(obj)
py_version = (sys.version_info.major, sys.version_info.minor)
children: List[Node]
def iter_rich_args(rich_args) -> Iterable[Union[(Any, Tuple[(str, Any)])]]:
for arg in rich_args:
if isinstance(arg, tuple)... |
def acc_callback(data):
'Handle a (epoch, (x,y,z)) accelerometer tuple.'
print('Epoch time: [{0}] - X: {1}, Y: {2}, Z: {3}'.format(data[0], *data[1])) | 5,087,660,137,753,062,000 | Handle a (epoch, (x,y,z)) accelerometer tuple. | examples/accelerometer.py | acc_callback | somacoder/pymetawear | python | def acc_callback(data):
print('Epoch time: [{0}] - X: {1}, Y: {2}, Z: {3}'.format(data[0], *data[1])) |
def __init__(self, id=None, entities=None, relationships=None):
'Creates EntitySet\n\n Args:\n id (str) : Unique identifier to associate with this instance\n\n entities (dict[str -> tuple(pd.DataFrame, str, str, dict[str -> Variable])]): dictionary of\n en... | -1,368,691,380,719,782,100 | Creates EntitySet
Args:
id (str) : Unique identifier to associate with this instance
entities (dict[str -> tuple(pd.DataFrame, str, str, dict[str -> Variable])]): dictionary of
entities. Entries take the format
{entity id -> (dataframe, id column, (time_index), (variable_types), (make_index))}... | featuretools/entityset/entityset.py | __init__ | esyyes/featuretools | python | def __init__(self, id=None, entities=None, relationships=None):
'Creates EntitySet\n\n Args:\n id (str) : Unique identifier to associate with this instance\n\n entities (dict[str -> tuple(pd.DataFrame, str, str, dict[str -> Variable])]): dictionary of\n en... |
def __getitem__(self, entity_id):
"Get entity instance from entityset\n\n Args:\n entity_id (str): Id of entity.\n\n Returns:\n :class:`.Entity` : Instance of entity. None if entity doesn't\n exist.\n "
if (entity_id in self.entity_dict):
return ... | -8,613,951,347,133,830,000 | Get entity instance from entityset
Args:
entity_id (str): Id of entity.
Returns:
:class:`.Entity` : Instance of entity. None if entity doesn't
exist. | featuretools/entityset/entityset.py | __getitem__ | esyyes/featuretools | python | def __getitem__(self, entity_id):
"Get entity instance from entityset\n\n Args:\n entity_id (str): Id of entity.\n\n Returns:\n :class:`.Entity` : Instance of entity. None if entity doesn't\n exist.\n "
if (entity_id in self.entity_dict):
return ... |
@property
def metadata(self):
'Returns the metadata for this EntitySet. The metadata will be recomputed if it does not exist.'
if (self._data_description is None):
description = serialize.entityset_to_description(self)
self._data_description = deserialize.description_to_entityset(description)
... | 2,329,052,244,132,161,000 | Returns the metadata for this EntitySet. The metadata will be recomputed if it does not exist. | featuretools/entityset/entityset.py | metadata | esyyes/featuretools | python | @property
def metadata(self):
if (self._data_description is None):
description = serialize.entityset_to_description(self)
self._data_description = deserialize.description_to_entityset(description)
return self._data_description |
def to_pickle(self, path, compression=None, profile_name=None):
"Write entityset in the pickle format, location specified by `path`.\n Path could be a local path or a S3 path.\n If writing to S3 a tar archive of files will be written.\n\n Args:\n path (str): location ... | -4,309,487,455,700,205,000 | Write entityset in the pickle format, location specified by `path`.
Path could be a local path or a S3 path.
If writing to S3 a tar archive of files will be written.
Args:
path (str): location on disk to write to (will be created as a directory)
compression (str) : Name of the compression to use. Possible valu... | featuretools/entityset/entityset.py | to_pickle | esyyes/featuretools | python | def to_pickle(self, path, compression=None, profile_name=None):
"Write entityset in the pickle format, location specified by `path`.\n Path could be a local path or a S3 path.\n If writing to S3 a tar archive of files will be written.\n\n Args:\n path (str): location ... |
def to_parquet(self, path, engine='auto', compression=None, profile_name=None):
"Write entityset to disk in the parquet format, location specified by `path`.\n Path could be a local path or a S3 path.\n If writing to S3 a tar archive of files will be written.\n\n Args:\n ... | 3,628,453,575,138,724,400 | Write entityset to disk in the parquet format, location specified by `path`.
Path could be a local path or a S3 path.
If writing to S3 a tar archive of files will be written.
Args:
path (str): location on disk to write to (will be created as a directory)
engine (str) : Name of the engine to use. Possible value... | featuretools/entityset/entityset.py | to_parquet | esyyes/featuretools | python | def to_parquet(self, path, engine='auto', compression=None, profile_name=None):
"Write entityset to disk in the parquet format, location specified by `path`.\n Path could be a local path or a S3 path.\n If writing to S3 a tar archive of files will be written.\n\n Args:\n ... |
def to_csv(self, path, sep=',', encoding='utf-8', engine='python', compression=None, profile_name=None):
"Write entityset to disk in the csv format, location specified by `path`.\n Path could be a local path or a S3 path.\n If writing to S3 a tar archive of files will be written.\n\n ... | -8,410,592,308,300,280,000 | Write entityset to disk in the csv format, location specified by `path`.
Path could be a local path or a S3 path.
If writing to S3 a tar archive of files will be written.
Args:
path (str) : Location on disk to write to (will be created as a directory)
sep (str) : String of length 1. Field delimiter for the out... | featuretools/entityset/entityset.py | to_csv | esyyes/featuretools | python | def to_csv(self, path, sep=',', encoding='utf-8', engine='python', compression=None, profile_name=None):
"Write entityset to disk in the csv format, location specified by `path`.\n Path could be a local path or a S3 path.\n If writing to S3 a tar archive of files will be written.\n\n ... |
def add_relationships(self, relationships):
'Add multiple new relationships to a entityset\n\n Args:\n relationships (list[Relationship]) : List of new\n relationships.\n '
return [self.add_relationship(r) for r in relationships][(- 1)] | 4,356,438,905,869,493,000 | Add multiple new relationships to a entityset
Args:
relationships (list[Relationship]) : List of new
relationships. | featuretools/entityset/entityset.py | add_relationships | esyyes/featuretools | python | def add_relationships(self, relationships):
'Add multiple new relationships to a entityset\n\n Args:\n relationships (list[Relationship]) : List of new\n relationships.\n '
return [self.add_relationship(r) for r in relationships][(- 1)] |
def add_relationship(self, relationship):
'Add a new relationship between entities in the entityset\n\n Args:\n relationship (Relationship) : Instance of new\n relationship to be added.\n '
if (relationship in self.relationships):
logger.warning('Not adding duplic... | -3,799,316,593,027,928,600 | Add a new relationship between entities in the entityset
Args:
relationship (Relationship) : Instance of new
relationship to be added. | featuretools/entityset/entityset.py | add_relationship | esyyes/featuretools | python | def add_relationship(self, relationship):
'Add a new relationship between entities in the entityset\n\n Args:\n relationship (Relationship) : Instance of new\n relationship to be added.\n '
if (relationship in self.relationships):
logger.warning('Not adding duplic... |
def find_forward_paths(self, start_entity_id, goal_entity_id):
'\n Generator which yields all forward paths between a start and goal\n entity. Does not include paths which contain cycles.\n\n Args:\n start_entity_id (str) : id of entity to start the search from\n goal_enti... | -9,188,505,344,688,811,000 | Generator which yields all forward paths between a start and goal
entity. Does not include paths which contain cycles.
Args:
start_entity_id (str) : id of entity to start the search from
goal_entity_id (str) : if of entity to find forward path to
See Also:
:func:`BaseEntitySet.find_backward_paths` | featuretools/entityset/entityset.py | find_forward_paths | esyyes/featuretools | python | def find_forward_paths(self, start_entity_id, goal_entity_id):
'\n Generator which yields all forward paths between a start and goal\n entity. Does not include paths which contain cycles.\n\n Args:\n start_entity_id (str) : id of entity to start the search from\n goal_enti... |
def find_backward_paths(self, start_entity_id, goal_entity_id):
'\n Generator which yields all backward paths between a start and goal\n entity. Does not include paths which contain cycles.\n\n Args:\n start_entity_id (str) : Id of entity to start the search from.\n goal_e... | -314,726,679,646,812,200 | Generator which yields all backward paths between a start and goal
entity. Does not include paths which contain cycles.
Args:
start_entity_id (str) : Id of entity to start the search from.
goal_entity_id (str) : Id of entity to find backward path to.
See Also:
:func:`BaseEntitySet.find_forward_paths` | featuretools/entityset/entityset.py | find_backward_paths | esyyes/featuretools | python | def find_backward_paths(self, start_entity_id, goal_entity_id):
'\n Generator which yields all backward paths between a start and goal\n entity. Does not include paths which contain cycles.\n\n Args:\n start_entity_id (str) : Id of entity to start the search from.\n goal_e... |
def _forward_entity_paths(self, start_entity_id, seen_entities=None):
'\n Generator which yields the ids of all entities connected through forward\n relationships, and the path taken to each. An entity will be yielded\n multiple times if there are multiple paths to it.\n\n Implemented us... | 5,306,262,630,658,995,000 | Generator which yields the ids of all entities connected through forward
relationships, and the path taken to each. An entity will be yielded
multiple times if there are multiple paths to it.
Implemented using depth first search. | featuretools/entityset/entityset.py | _forward_entity_paths | esyyes/featuretools | python | def _forward_entity_paths(self, start_entity_id, seen_entities=None):
'\n Generator which yields the ids of all entities connected through forward\n relationships, and the path taken to each. An entity will be yielded\n multiple times if there are multiple paths to it.\n\n Implemented us... |
def get_forward_entities(self, entity_id, deep=False):
'\n Get entities that are in a forward relationship with entity\n\n Args:\n entity_id (str): Id entity of entity to search from.\n deep (bool): if True, recursively find forward entities.\n\n Yields a tuple of (descend... | -881,607,600,788,329,200 | Get entities that are in a forward relationship with entity
Args:
entity_id (str): Id entity of entity to search from.
deep (bool): if True, recursively find forward entities.
Yields a tuple of (descendent_id, path from entity_id to descendant). | featuretools/entityset/entityset.py | get_forward_entities | esyyes/featuretools | python | def get_forward_entities(self, entity_id, deep=False):
'\n Get entities that are in a forward relationship with entity\n\n Args:\n entity_id (str): Id entity of entity to search from.\n deep (bool): if True, recursively find forward entities.\n\n Yields a tuple of (descend... |
def get_backward_entities(self, entity_id, deep=False):
'\n Get entities that are in a backward relationship with entity\n\n Args:\n entity_id (str): Id entity of entity to search from.\n deep (bool): if True, recursively find backward entities.\n\n Yields a tuple of (desc... | 5,684,187,746,167,879,000 | Get entities that are in a backward relationship with entity
Args:
entity_id (str): Id entity of entity to search from.
deep (bool): if True, recursively find backward entities.
Yields a tuple of (descendent_id, path from entity_id to descendant). | featuretools/entityset/entityset.py | get_backward_entities | esyyes/featuretools | python | def get_backward_entities(self, entity_id, deep=False):
'\n Get entities that are in a backward relationship with entity\n\n Args:\n entity_id (str): Id entity of entity to search from.\n deep (bool): if True, recursively find backward entities.\n\n Yields a tuple of (desc... |
def get_forward_relationships(self, entity_id):
'Get relationships where entity "entity_id" is the child\n\n Args:\n entity_id (str): Id of entity to get relationships for.\n\n Returns:\n list[:class:`.Relationship`]: List of forward relationships.\n '
return [r for r ... | 2,507,399,250,776,865,300 | Get relationships where entity "entity_id" is the child
Args:
entity_id (str): Id of entity to get relationships for.
Returns:
list[:class:`.Relationship`]: List of forward relationships. | featuretools/entityset/entityset.py | get_forward_relationships | esyyes/featuretools | python | def get_forward_relationships(self, entity_id):
'Get relationships where entity "entity_id" is the child\n\n Args:\n entity_id (str): Id of entity to get relationships for.\n\n Returns:\n list[:class:`.Relationship`]: List of forward relationships.\n '
return [r for r ... |
def get_backward_relationships(self, entity_id):
'\n get relationships where entity "entity_id" is the parent.\n\n Args:\n entity_id (str): Id of entity to get relationships for.\n\n Returns:\n list[:class:`.Relationship`]: list of backward relationships\n '
ret... | 8,382,441,608,153,034,000 | get relationships where entity "entity_id" is the parent.
Args:
entity_id (str): Id of entity to get relationships for.
Returns:
list[:class:`.Relationship`]: list of backward relationships | featuretools/entityset/entityset.py | get_backward_relationships | esyyes/featuretools | python | def get_backward_relationships(self, entity_id):
'\n get relationships where entity "entity_id" is the parent.\n\n Args:\n entity_id (str): Id of entity to get relationships for.\n\n Returns:\n list[:class:`.Relationship`]: list of backward relationships\n '
ret... |
def has_unique_forward_path(self, start_entity_id, end_entity_id):
'\n Is the forward path from start to end unique?\n\n This will raise if there is no such path.\n '
paths = self.find_forward_paths(start_entity_id, end_entity_id)
next(paths)
second_path = next(paths, None)
retu... | -7,897,458,644,928,172,000 | Is the forward path from start to end unique?
This will raise if there is no such path. | featuretools/entityset/entityset.py | has_unique_forward_path | esyyes/featuretools | python | def has_unique_forward_path(self, start_entity_id, end_entity_id):
'\n Is the forward path from start to end unique?\n\n This will raise if there is no such path.\n '
paths = self.find_forward_paths(start_entity_id, end_entity_id)
next(paths)
second_path = next(paths, None)
retu... |
def entity_from_dataframe(self, entity_id, dataframe, index=None, variable_types=None, make_index=False, time_index=None, secondary_time_index=None, already_sorted=False):
'\n Load the data for a specified entity from a Pandas DataFrame.\n\n Args:\n entity_id (str) : Unique id to associate ... | -5,908,476,662,970,882,000 | Load the data for a specified entity from a Pandas DataFrame.
Args:
entity_id (str) : Unique id to associate with this entity.
dataframe (pandas.DataFrame) : Dataframe containing the data.
index (str, optional): Name of the variable used to index the entity.
If None, take the first column.
v... | featuretools/entityset/entityset.py | entity_from_dataframe | esyyes/featuretools | python | def entity_from_dataframe(self, entity_id, dataframe, index=None, variable_types=None, make_index=False, time_index=None, secondary_time_index=None, already_sorted=False):
'\n Load the data for a specified entity from a Pandas DataFrame.\n\n Args:\n entity_id (str) : Unique id to associate ... |
def normalize_entity(self, base_entity_id, new_entity_id, index, additional_variables=None, copy_variables=None, make_time_index=None, make_secondary_time_index=None, new_entity_time_index=None, new_entity_secondary_time_index=None):
'Create a new entity and relationship from unique values of an existing variable.\... | -7,134,861,186,894,984,000 | Create a new entity and relationship from unique values of an existing variable.
Args:
base_entity_id (str) : Entity id from which to split.
new_entity_id (str): Id of the new entity.
index (str): Variable in old entity
that will become index of new entity. Relationship
will be created ac... | featuretools/entityset/entityset.py | normalize_entity | esyyes/featuretools | python | def normalize_entity(self, base_entity_id, new_entity_id, index, additional_variables=None, copy_variables=None, make_time_index=None, make_secondary_time_index=None, new_entity_time_index=None, new_entity_secondary_time_index=None):
'Create a new entity and relationship from unique values of an existing variable.\... |
def concat(self, other, inplace=False):
'Combine entityset with another to create a new entityset with the\n combined data of both entitysets.\n '
assert_string = 'Entitysets must have the same entities, relationships, and variable_ids'
assert (self.__eq__(other) and (self.relationships == oth... | 3,209,734,081,182,896,000 | Combine entityset with another to create a new entityset with the
combined data of both entitysets. | featuretools/entityset/entityset.py | concat | esyyes/featuretools | python | def concat(self, other, inplace=False):
'Combine entityset with another to create a new entityset with the\n combined data of both entitysets.\n '
assert_string = 'Entitysets must have the same entities, relationships, and variable_ids'
assert (self.__eq__(other) and (self.relationships == oth... |
def add_last_time_indexes(self, updated_entities=None):
'\n Calculates the last time index values for each entity (the last time\n an instance or children of that instance were observed). Used when\n calculating features using training windows\n Args:\n updated_entities (list... | 5,950,411,667,083,106,000 | Calculates the last time index values for each entity (the last time
an instance or children of that instance were observed). Used when
calculating features using training windows
Args:
updated_entities (list[str]): List of entity ids to update last_time_index for
(will update all parents of those entities... | featuretools/entityset/entityset.py | add_last_time_indexes | esyyes/featuretools | python | def add_last_time_indexes(self, updated_entities=None):
'\n Calculates the last time index values for each entity (the last time\n an instance or children of that instance were observed). Used when\n calculating features using training windows\n Args:\n updated_entities (list... |
def add_interesting_values(self, max_values=5, verbose=False):
'Find interesting values for categorical variables, to be used to generate "where" clauses\n\n Args:\n max_values (int) : Maximum number of values per variable to add.\n verbose (bool) : If True, print summary of interesting... | 7,888,551,999,182,275,000 | Find interesting values for categorical variables, to be used to generate "where" clauses
Args:
max_values (int) : Maximum number of values per variable to add.
verbose (bool) : If True, print summary of interesting values found.
Returns:
None | featuretools/entityset/entityset.py | add_interesting_values | esyyes/featuretools | python | def add_interesting_values(self, max_values=5, verbose=False):
'Find interesting values for categorical variables, to be used to generate "where" clauses\n\n Args:\n max_values (int) : Maximum number of values per variable to add.\n verbose (bool) : If True, print summary of interesting... |
def plot(self, to_file=None):
'\n Create a UML diagram-ish graph of the EntitySet.\n\n Args:\n to_file (str, optional) : Path to where the plot should be saved.\n If set to None (as by default), the plot will not be saved.\n\n Returns:\n graphviz.Digraph : G... | -2,253,033,458,387,402,000 | Create a UML diagram-ish graph of the EntitySet.
Args:
to_file (str, optional) : Path to where the plot should be saved.
If set to None (as by default), the plot will not be saved.
Returns:
graphviz.Digraph : Graph object that can directly be displayed in
Jupyter notebooks. | featuretools/entityset/entityset.py | plot | esyyes/featuretools | python | def plot(self, to_file=None):
'\n Create a UML diagram-ish graph of the EntitySet.\n\n Args:\n to_file (str, optional) : Path to where the plot should be saved.\n If set to None (as by default), the plot will not be saved.\n\n Returns:\n graphviz.Digraph : G... |
def search_fields_to_dict(fields):
'\n In ``SearchableQuerySet`` and ``SearchableManager``, search fields\n can either be a sequence, or a dict of fields mapped to weights.\n This function converts sequences to a dict mapped to even weights,\n so that we\'re consistently dealing with a dict of fields ma... | -4,831,613,302,405,333,000 | In ``SearchableQuerySet`` and ``SearchableManager``, search fields
can either be a sequence, or a dict of fields mapped to weights.
This function converts sequences to a dict mapped to even weights,
so that we're consistently dealing with a dict of fields mapped to
weights, eg: ("title", "content") -> {"title": 1, "con... | mezzanine/core/managers.py | search_fields_to_dict | abendig/mezzanine | python | def search_fields_to_dict(fields):
'\n In ``SearchableQuerySet`` and ``SearchableManager``, search fields\n can either be a sequence, or a dict of fields mapped to weights.\n This function converts sequences to a dict mapped to even weights,\n so that we\'re consistently dealing with a dict of fields ma... |
def published(self, for_user=None):
'\n For non-staff users, return items with a published status and\n whose publish and expiry dates fall before and after the\n current date when specified.\n '
from mezzanine.core.models import CONTENT_STATUS_PUBLISHED
if ((for_user is not None... | -8,919,548,836,438,179,000 | For non-staff users, return items with a published status and
whose publish and expiry dates fall before and after the
current date when specified. | mezzanine/core/managers.py | published | abendig/mezzanine | python | def published(self, for_user=None):
'\n For non-staff users, return items with a published status and\n whose publish and expiry dates fall before and after the\n current date when specified.\n '
from mezzanine.core.models import CONTENT_STATUS_PUBLISHED
if ((for_user is not None... |
def search(self, query, search_fields=None):
'\n Build a queryset matching words in the given search query,\n treating quoted terms as exact phrases and taking into\n account + and - symbols as modifiers controlling which terms\n to require and exclude.\n '
if search_fields:
... | 7,935,469,320,271,729,000 | Build a queryset matching words in the given search query,
treating quoted terms as exact phrases and taking into
account + and - symbols as modifiers controlling which terms
to require and exclude. | mezzanine/core/managers.py | search | abendig/mezzanine | python | def search(self, query, search_fields=None):
'\n Build a queryset matching words in the given search query,\n treating quoted terms as exact phrases and taking into\n account + and - symbols as modifiers controlling which terms\n to require and exclude.\n '
if search_fields:
... |
def _clone(self, *args, **kwargs):
'\n Ensure attributes are copied to subsequent queries.\n '
for attr in ('_search_terms', '_search_fields', '_search_ordered'):
kwargs[attr] = getattr(self, attr)
return super(SearchableQuerySet, self)._clone(*args, **kwargs) | 202,594,186,732,412,800 | Ensure attributes are copied to subsequent queries. | mezzanine/core/managers.py | _clone | abendig/mezzanine | python | def _clone(self, *args, **kwargs):
'\n \n '
for attr in ('_search_terms', '_search_fields', '_search_ordered'):
kwargs[attr] = getattr(self, attr)
return super(SearchableQuerySet, self)._clone(*args, **kwargs) |
def order_by(self, *field_names):
'\n Mark the filter as being ordered if search has occurred.\n '
if (not self._search_ordered):
self._search_ordered = (len(self._search_terms) > 0)
return super(SearchableQuerySet, self).order_by(*field_names) | 6,709,779,607,729,200,000 | Mark the filter as being ordered if search has occurred. | mezzanine/core/managers.py | order_by | abendig/mezzanine | python | def order_by(self, *field_names):
'\n \n '
if (not self._search_ordered):
self._search_ordered = (len(self._search_terms) > 0)
return super(SearchableQuerySet, self).order_by(*field_names) |
def iterator(self):
"\n If search has occurred and no ordering has occurred, decorate\n each result with the number of search terms so that it can be\n sorted by the number of occurrence of terms.\n\n In the case of search fields that span model relationships, we\n cannot accurate... | 3,831,567,514,092,261,000 | If search has occurred and no ordering has occurred, decorate
each result with the number of search terms so that it can be
sorted by the number of occurrence of terms.
In the case of search fields that span model relationships, we
cannot accurately match occurrences without some very
complicated traversal code, which... | mezzanine/core/managers.py | iterator | abendig/mezzanine | python | def iterator(self):
"\n If search has occurred and no ordering has occurred, decorate\n each result with the number of search terms so that it can be\n sorted by the number of occurrence of terms.\n\n In the case of search fields that span model relationships, we\n cannot accurate... |
def get_search_fields(self):
"\n Returns the search field names mapped to weights as a dict.\n Used in ``get_queryset`` below to tell ``SearchableQuerySet``\n which search fields to use. Also used by ``DisplayableAdmin``\n to populate Django admin's ``search_fields`` attribute.\n\n ... | -7,761,695,402,458,119,000 | Returns the search field names mapped to weights as a dict.
Used in ``get_queryset`` below to tell ``SearchableQuerySet``
which search fields to use. Also used by ``DisplayableAdmin``
to populate Django admin's ``search_fields`` attribute.
Search fields can be populated via
``SearchableManager.__init__``, which then g... | mezzanine/core/managers.py | get_search_fields | abendig/mezzanine | python | def get_search_fields(self):
"\n Returns the search field names mapped to weights as a dict.\n Used in ``get_queryset`` below to tell ``SearchableQuerySet``\n which search fields to use. Also used by ``DisplayableAdmin``\n to populate Django admin's ``search_fields`` attribute.\n\n ... |
def contribute_to_class(self, model, name):
'\n Django 1.5 explicitly prevents managers being accessed from\n abstract classes, which is behaviour the search API has relied\n on for years. Here we reinstate it.\n '
super(SearchableManager, self).contribute_to_class(model, name)
s... | -6,567,657,989,180,425,000 | Django 1.5 explicitly prevents managers being accessed from
abstract classes, which is behaviour the search API has relied
on for years. Here we reinstate it. | mezzanine/core/managers.py | contribute_to_class | abendig/mezzanine | python | def contribute_to_class(self, model, name):
'\n Django 1.5 explicitly prevents managers being accessed from\n abstract classes, which is behaviour the search API has relied\n on for years. Here we reinstate it.\n '
super(SearchableManager, self).contribute_to_class(model, name)
s... |
def search(self, *args, **kwargs):
"\n Proxy to queryset's search method for the manager's model and\n any models that subclass from this manager's model if the\n model is abstract.\n "
if (not settings.SEARCH_MODEL_CHOICES):
models = [m for m in get_models() if issubclass(m,... | 7,856,990,047,335,888,000 | Proxy to queryset's search method for the manager's model and
any models that subclass from this manager's model if the
model is abstract. | mezzanine/core/managers.py | search | abendig/mezzanine | python | def search(self, *args, **kwargs):
"\n Proxy to queryset's search method for the manager's model and\n any models that subclass from this manager's model if the\n model is abstract.\n "
if (not settings.SEARCH_MODEL_CHOICES):
models = [m for m in get_models() if issubclass(m,... |
def url_map(self, for_user=None, **kwargs):
'\n Returns a dictionary of urls mapped to Displayable subclass\n instances, including a fake homepage instance if none exists.\n Used in ``mezzanine.core.sitemaps``.\n '
home = self.model(title=_('Home'))
setattr(home, 'get_absolute_ur... | -2,532,128,902,053,320,700 | Returns a dictionary of urls mapped to Displayable subclass
instances, including a fake homepage instance if none exists.
Used in ``mezzanine.core.sitemaps``. | mezzanine/core/managers.py | url_map | abendig/mezzanine | python | def url_map(self, for_user=None, **kwargs):
'\n Returns a dictionary of urls mapped to Displayable subclass\n instances, including a fake homepage instance if none exists.\n Used in ``mezzanine.core.sitemaps``.\n '
home = self.model(title=_('Home'))
setattr(home, 'get_absolute_ur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.