INSTRUCTION stringlengths 1 46.3k | RESPONSE stringlengths 75 80.2k |
|---|---|
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'text') and self.text is not None:
_dict['text'] = self.text
if hasattr(self, 'entities') and self.entities is not None:
_dict['entities'] = [x._to_dict() for x... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'text') and self.text is not None:
_dict['text'] = self.text
if hasattr(self, 'tense') and self.tense is not None:
_dict['tense'] = self.tense
return _d... |
Initialize a SentimentResult object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a SentimentResult object from a json dictionary."""
args = {}
if 'document' in _dict:
args['document'] = DocumentSentimentResults._from_dict(
_dict.get('document'))
if 'targets' in _dict:
args['targets'] = ... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'tokens') and self.tokens is not None:
_dict['tokens'] = self.tokens._to_dict()
if hasattr(self, 'sentences') and self.sentences is not None:
_dict['sentences']... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'lemma') and self.lemma is not None:
_dict['lemma'] = self.lemma
if hasattr(self, 'part_of_speech') and self.part_of_speech is not None:
_dict['part_of_speech']... |
Initialize a SyntaxResult object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a SyntaxResult object from a json dictionary."""
args = {}
if 'tokens' in _dict:
args['tokens'] = [
TokenResult._from_dict(x) for x in (_dict.get('tokens'))
]
if 'sentences' in _dict:
args['sent... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'text') and self.text is not None:
_dict['text'] = self.text
if hasattr(self, 'emotion') and self.emotion is not None:
_dict['emotion'] = self.emotion._to_dict(... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'text') and self.text is not None:
_dict['text'] = self.text
if hasattr(self, 'score') and self.score is not None:
_dict['score'] = self.score
return _d... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'text') and self.text is not None:
_dict['text'] = self.text
if hasattr(self, 'part_of_speech') and self.part_of_speech is not None:
_dict['part_of_speech'] = s... |
Update a configuration.
Replaces an existing configuration.
* Completely replaces the original configuration.
* The **configuration_id**, **updated**, and **created** fields are accepted in
the request, but they are ignored, and an error is not generated. It is also
acceptab... | def update_configuration(self,
environment_id,
configuration_id,
name,
description=None,
conversions=None,
enrichments=None,
... |
Create or update expansion list.
Create or replace the Expansion list for this collection. The maximum number of
expanded terms per collection is `500`.
The current expansion list is replaced with the uploaded content.
:param str environment_id: The ID of the environment.
:para... | def create_expansions(self, environment_id, collection_id, expansions,
**kwargs):
"""
Create or update expansion list.
Create or replace the Expansion list for this collection. The maximum number of
expanded terms per collection is `500`.
The current ex... |
Create stopword list.
Upload a custom stopword list to use with the specified collection.
:param str environment_id: The ID of the environment.
:param str collection_id: The ID of the collection.
:param file stopword_file: The content of the stopword list to ingest.
:param str ... | def create_stopword_list(self,
environment_id,
collection_id,
stopword_file,
stopword_filename=None,
**kwargs):
"""
Create stopword list.
Upload a cus... |
Long environment queries.
Complex queries might be too long for a standard method query. By using this
method, you can construct longer queries. However, these queries may take longer
to complete than the standard method. For details, see the [Discovery service
documentation](https://cl... | def federated_query(self,
environment_id,
filter=None,
query=None,
natural_language_query=None,
passages=None,
aggregation=None,
count=None,
... |
Knowledge Graph entity query.
See the [Knowledge Graph
documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-kg#kg)
for more details.
:param str environment_id: The ID of the environment.
:param str collection_id: The ID of the collection.
:param ... | def query_entities(self,
environment_id,
collection_id,
feature=None,
entity=None,
context=None,
count=None,
evidence_count=None,
**kwar... |
Add query to training data.
Adds a query to the training data for this collection. The query can contain a
filter and natural language query.
:param str environment_id: The ID of the environment.
:param str collection_id: The ID of the collection.
:param str natural_language_qu... | def add_training_data(self,
environment_id,
collection_id,
natural_language_query=None,
filter=None,
examples=None,
**kwargs):
"""
Add query to trai... |
Knowledge Graph relationship query.
See the [Knowledge Graph
documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-kg#kg)
for more details.
:param str environment_id: The ID of the environment.
:param str collection_id: The ID of the collection.
:... | def query_relations(self,
environment_id,
collection_id,
entities=None,
context=None,
sort=None,
filter=None,
count=None,
eviden... |
Add example to training data query.
Adds a example to this training data query.
:param str environment_id: The ID of the environment.
:param str collection_id: The ID of the collection.
:param str query_id: The ID of the query used for training.
:param str document_id: The docu... | def create_training_example(self,
environment_id,
collection_id,
query_id,
document_id=None,
cross_reference=None,
relevance=Non... |
Percentage of queries with an associated event.
The percentage of queries using the **natural_language_query** parameter that have
a corresponding \"click\" event over a specified time window. This metric
requires having integrated event tracking in your application using the **Events**
... | def get_metrics_event_rate(self,
start_time=None,
end_time=None,
result_type=None,
**kwargs):
"""
Percentage of queries with an associated event.
The percentage of queries... |
Search the query and event log.
Searches the query and event log to find query sessions that match the specified
criteria. Searching the **logs** endpoint uses the standard Discovery query syntax
for the parameters that are supported.
:param str filter: A cacheable query that excludes ... | def query_log(self,
filter=None,
query=None,
count=None,
offset=None,
sort=None,
**kwargs):
"""
Search the query and event log.
Searches the query and event log to find query sessions tha... |
Initialize a Collection object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a Collection object from a json dictionary."""
args = {}
if 'collection_id' in _dict:
args['collection_id'] = _dict.get('collection_id')
if 'name' in _dict:
args['name'] = _dict.get('name')
if 'description' in _dic... |
Initialize a AggregationResult object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a AggregationResult object from a json dictionary."""
args = {}
if 'key' in _dict:
args['key'] = _dict.get('key')
if 'matching_results' in _dict:
args['matching_results'] = _dict.get('matching_results')
if 'aggrega... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'key') and self.key is not None:
_dict['key'] = self.key
if hasattr(self,
'matching_results') and self.matching_results is not None:
_dict['m... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'used_bytes') and self.used_bytes is not None:
_dict['used_bytes'] = self.used_bytes
return _dict |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'field') and self.field is not None:
_dict['field'] = self.field
if hasattr(self, 'value') and self.value is not None:
_dict['value'] = self.value
retur... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'available') and self.available is not None:
_dict['available'] = self.available
if hasattr(self,
'maximum_allowed') and self.maximum_allowed is not None... |
Initialize a Configuration object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a Configuration object from a json dictionary."""
args = {}
if 'configuration_id' in _dict:
args['configuration_id'] = _dict.get('configuration_id')
if 'name' in _dict:
args['name'] = _dict.get('name')
else:
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self,
'configuration_id') and self.configuration_id is not None:
_dict['configuration_id'] = self.configuration_id
if hasattr(self, 'name') and self.name is no... |
Initialize a Conversions object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a Conversions object from a json dictionary."""
args = {}
if 'pdf' in _dict:
args['pdf'] = PdfSettings._from_dict(_dict.get('pdf'))
if 'word' in _dict:
args['word'] = WordSettings._from_dict(_dict.get('word'))
if '... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'pdf') and self.pdf is not None:
_dict['pdf'] = self.pdf._to_dict()
if hasattr(self, 'word') and self.word is not None:
_dict['word'] = self.word._to_dict()
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
if hasattr(self, 'data') and self.data is not None:
_dict['data'] = self.data._to_dict()
re... |
Initialize a CredentialDetails object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a CredentialDetails object from a json dictionary."""
args = {}
if 'credential_type' in _dict:
args['credential_type'] = _dict.get('credential_type')
if 'client_id' in _dict:
args['client_id'] = _dict.get('client_id')
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self,
'credential_type') and self.credential_type is not None:
_dict['credential_type'] = self.credential_type
if hasattr(self, 'client_id') and self.client_id... |
Initialize a CredentialsList object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a CredentialsList object from a json dictionary."""
args = {}
if 'credentials' in _dict:
args['credentials'] = [
Credentials._from_dict(x) for x in (_dict.get('credentials'))
]
return cls(**args) |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'credential_id') and self.credential_id is not None:
_dict['credential_id'] = self.credential_id
if hasattr(self, 'source_type') and self.source_type is not None:
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'credentials') and self.credentials is not None:
_dict['credentials'] = [x._to_dict() for x in self.credentials]
return _dict |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'collection_id') and self.collection_id is not None:
_dict['collection_id'] = self.collection_id
if hasattr(self, 'status') and self.status is not None:
_dict['... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self,
'configuration_id') and self.configuration_id is not None:
_dict['configuration_id'] = self.configuration_id
if hasattr(self, 'status') and self.status i... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'credential_id') and self.credential_id is not None:
_dict['credential_id'] = self.credential_id
if hasattr(self, 'status') and self.status is not None:
_dict['... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'document_id') and self.document_id is not None:
_dict['document_id'] = self.document_id
if hasattr(self, 'status') and self.status is not None:
_dict['status']... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'environment_id') and self.environment_id is not None:
_dict['environment_id'] = self.environment_id
if hasattr(self, 'status') and self.status is not None:
_di... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'used_bytes') and self.used_bytes is not None:
_dict['used_bytes'] = self.used_bytes
if hasattr(self, 'maximum_allowed_bytes'
) and self.maximum_allowed_b... |
Initialize a DocumentAccepted object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a DocumentAccepted object from a json dictionary."""
args = {}
if 'document_id' in _dict:
args['document_id'] = _dict.get('document_id')
if 'status' in _dict:
args['status'] = _dict.get('status')
if 'notices' in _d... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'document_id') and self.document_id is not None:
_dict['document_id'] = self.document_id
if hasattr(self, 'status') and self.status is not None:
_dict['status']... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'available') and self.available is not None:
_dict['available'] = self.available
if hasattr(self, 'processing') and self.processing is not None:
_dict['processi... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'step') and self.step is not None:
_dict['step'] = self.step
if hasattr(self, 'snapshot') and self.snapshot is not None:
_dict['snapshot'] = self.snapshot
... |
Initialize a DocumentStatus object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a DocumentStatus object from a json dictionary."""
args = {}
if 'document_id' in _dict:
args['document_id'] = _dict.get('document_id')
else:
raise ValueError(
'Required property \'document_id\' not present ... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'document_id') and self.document_id is not None:
_dict['document_id'] = self.document_id
if hasattr(self,
'configuration_id') and self.configuration_id i... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'description') and self.description is not None:
_dict['description'] = self.description
if hasattr(self,
'destination_field') and self.destination_field... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'features') and self.features is not None:
_dict['features'] = self.features._to_dict()
if hasattr(self, 'language') and self.language is not None:
_dict['langu... |
Initialize a Environment object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a Environment object from a json dictionary."""
args = {}
if 'environment_id' in _dict:
args['environment_id'] = _dict.get('environment_id')
if 'name' in _dict:
args['name'] = _dict.get('name')
if 'description' in ... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'environment_id') and self.environment_id is not None:
_dict['environment_id'] = self.environment_id
if hasattr(self, 'name') and self.name is not None:
_dict['... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'indexed') and self.indexed is not None:
_dict['indexed'] = self.indexed
if hasattr(self,
'maximum_allowed') and self.maximum_allowed is not None:
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'environment_id') and self.environment_id is not None:
_dict['environment_id'] = self.environment_id
if hasattr(self, 'session_token') and self.session_token is not None:
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'input_terms') and self.input_terms is not None:
_dict['input_terms'] = self.input_terms
if hasattr(self, 'expanded_terms') and self.expanded_terms is not None:
... |
Initialize a Expansions object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a Expansions object from a json dictionary."""
args = {}
if 'expansions' in _dict:
args['expansions'] = [
Expansion._from_dict(x) for x in (_dict.get('expansions'))
]
else:
raise ValueError(
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'expansions') and self.expansions is not None:
_dict['expansions'] = [x._to_dict() for x in self.expansions]
return _dict |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'field_name') and self.field_name is not None:
_dict['field'] = self.field_name
if hasattr(self, 'field_type') and self.field_type is not None:
_dict['type'] = ... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'match') and self.match is not None:
_dict['match'] = self.match
return _dict |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'level') and self.level is not None:
_dict['level'] = self.level
if hasattr(self, 'min_size') and self.min_size is not None:
_dict['min_size'] = self.min_size
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'gateway_id') and self.gateway_id is not None:
_dict['gateway_id'] = self.gateway_id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.na... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'gateway_id') and self.gateway_id is not None:
_dict['gateway_id'] = self.gateway_id
if hasattr(self, 'status') and self.status is not None:
_dict['status'] = s... |
Initialize a GatewayList object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a GatewayList object from a json dictionary."""
args = {}
if 'gateways' in _dict:
args['gateways'] = [
Gateway._from_dict(x) for x in (_dict.get('gateways'))
]
return cls(**args) |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'gateways') and self.gateways is not None:
_dict['gateways'] = [x._to_dict() for x in self.gateways]
return _dict |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'exclude_tags_completely'
) and self.exclude_tags_completely is not None:
_dict['exclude_tags_completely'] = self.exclude_tags_completely
if hasattr(self,... |
Initialize a IndexCapacity object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a IndexCapacity object from a json dictionary."""
args = {}
if 'documents' in _dict:
args['documents'] = EnvironmentDocuments._from_dict(
_dict.get('documents'))
if 'disk_usage' in _dict:
args['disk_usage']... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'documents') and self.documents is not None:
_dict['documents'] = self.documents._to_dict()
if hasattr(self, 'disk_usage') and self.disk_usage is not None:
_dic... |
Initialize a ListCollectionFieldsResponse object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a ListCollectionFieldsResponse object from a json dictionary."""
args = {}
if 'fields' in _dict:
args['fields'] = [
Field._from_dict(x) for x in (_dict.get('fields'))
]
return cls(**args) |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'fields') and self.fields is not None:
_dict['fields'] = [x._to_dict() for x in self.fields]
return _dict |
Initialize a ListCollectionsResponse object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a ListCollectionsResponse object from a json dictionary."""
args = {}
if 'collections' in _dict:
args['collections'] = [
Collection._from_dict(x) for x in (_dict.get('collections'))
]
return cls(**args) |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'collections') and self.collections is not None:
_dict['collections'] = [x._to_dict() for x in self.collections]
return _dict |
Initialize a ListConfigurationsResponse object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a ListConfigurationsResponse object from a json dictionary."""
args = {}
if 'configurations' in _dict:
args['configurations'] = [
Configuration._from_dict(x)
for x in (_dict.get('configurations'))
]... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'configurations') and self.configurations is not None:
_dict['configurations'] = [
x._to_dict() for x in self.configurations
]
return _dict |
Initialize a ListEnvironmentsResponse object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a ListEnvironmentsResponse object from a json dictionary."""
args = {}
if 'environments' in _dict:
args['environments'] = [
Environment._from_dict(x) for x in (_dict.get('environments'))
]
return cls(**args... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'environments') and self.environments is not None:
_dict['environments'] = [x._to_dict() for x in self.environments]
return _dict |
Initialize a LogQueryResponse object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a LogQueryResponse object from a json dictionary."""
args = {}
if 'matching_results' in _dict:
args['matching_results'] = _dict.get('matching_results')
if 'results' in _dict:
args['results'] = [
LogQueryRes... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self,
'matching_results') and self.matching_results is not None:
_dict['matching_results'] = self.matching_results
if hasattr(self, 'results') and self.results... |
Initialize a LogQueryResponseResult object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a LogQueryResponseResult object from a json dictionary."""
args = {}
if 'environment_id' in _dict:
args['environment_id'] = _dict.get('environment_id')
if 'customer_id' in _dict:
args['customer_id'] = _dict.get('customer_i... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'environment_id') and self.environment_id is not None:
_dict['environment_id'] = self.environment_id
if hasattr(self, 'customer_id') and self.customer_id is not None:
... |
Initialize a LogQueryResponseResultDocuments object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a LogQueryResponseResultDocuments object from a json dictionary."""
args = {}
if 'results' in _dict:
args['results'] = [
LogQueryResponseResultDocumentsResult._from_dict(x)
for x in (_dict.get('results'))
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'results') and self.results is not None:
_dict['results'] = [x._to_dict() for x in self.results]
if hasattr(self, 'count') and self.count is not None:
_dict['co... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'position') and self.position is not None:
_dict['position'] = self.position
if hasattr(self, 'document_id') and self.document_id is not None:
_dict['document_i... |
Initialize a MetricAggregation object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a MetricAggregation object from a json dictionary."""
args = {}
if 'interval' in _dict:
args['interval'] = _dict.get('interval')
if 'event_type' in _dict:
args['event_type'] = _dict.get('event_type')
if 'results' i... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'interval') and self.interval is not None:
_dict['interval'] = self.interval
if hasattr(self, 'event_type') and self.event_type is not None:
_dict['event_type']... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'key_as_string') and self.key_as_string is not None:
_dict['key_as_string'] = datetime_to_string(self.key_as_string)
if hasattr(self, 'key') and self.key is not None:
... |
Initialize a MetricResponse object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a MetricResponse object from a json dictionary."""
args = {}
if 'aggregations' in _dict:
args['aggregations'] = [
MetricAggregation._from_dict(x)
for x in (_dict.get('aggregations'))
]
retur... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'aggregations') and self.aggregations is not None:
_dict['aggregations'] = [x._to_dict() for x in self.aggregations]
return _dict |
Initialize a MetricTokenAggregation object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a MetricTokenAggregation object from a json dictionary."""
args = {}
if 'event_type' in _dict:
args['event_type'] = _dict.get('event_type')
if 'results' in _dict:
args['results'] = [
MetricTokenAggregationR... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'key') and self.key is not None:
_dict['key'] = self.key
if hasattr(self,
'matching_results') and self.matching_results is not None:
_dict['m... |
Initialize a MetricTokenResponse object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a MetricTokenResponse object from a json dictionary."""
args = {}
if 'aggregations' in _dict:
args['aggregations'] = [
MetricTokenAggregation._from_dict(x)
for x in (_dict.get('aggregations'))
]
... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'path') and self.path is not None:
_dict['path'] = self.path
return _dict |
Initialize a NluEnrichmentFeatures object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a NluEnrichmentFeatures object from a json dictionary."""
args = {}
if 'keywords' in _dict:
args['keywords'] = NluEnrichmentKeywords._from_dict(
_dict.get('keywords'))
if 'entities' in _dict:
args['entities... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'sentiment') and self.sentiment is not None:
_dict['sentiment'] = self.sentiment
if hasattr(self, 'emotion') and self.emotion is not None:
_dict['emotion'] = se... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'operation') and self.operation is not None:
_dict['operation'] = self.operation
if hasattr(self, 'source_field') and self.source_field is not None:
_dict['sour... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'notice_id') and self.notice_id is not None:
_dict['notice_id'] = self.notice_id
if hasattr(self, 'created') and self.created is not None:
_dict['created'] = da... |
Initialize a PdfHeadingDetection object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a PdfHeadingDetection object from a json dictionary."""
args = {}
if 'fonts' in _dict:
args['fonts'] = [
FontSetting._from_dict(x) for x in (_dict.get('fonts'))
]
return cls(**args) |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'fonts') and self.fonts is not None:
_dict['fonts'] = [x._to_dict() for x in self.fonts]
return _dict |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'heading') and self.heading is not None:
_dict['heading'] = self.heading._to_dict()
return _dict |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
if hasattr(self, 'results') and self.results is not None:
_dict['results'] = [x._to_dict() for x in... |
Initialize a QueryEntitiesResponse object from a json dictionary. | def _from_dict(cls, _dict):
"""Initialize a QueryEntitiesResponse object from a json dictionary."""
args = {}
if 'entities' in _dict:
args['entities'] = [
QueryEntitiesResponseItem._from_dict(x)
for x in (_dict.get('entities'))
]
re... |
Return a json dictionary representing this model. | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'entities') and self.entities is not None:
_dict['entities'] = [x._to_dict() for x in self.entities]
return _dict |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.