partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | DisambiguationResult._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
if hasattr(self,
'dbpedia_resource') and self.dbpedia_resource is not None:
_dic... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
if hasattr(self,
'dbpedia_resource') and self.dbpedia_resource is not None:
_dic... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L964-L974 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'name'",
")",
"and",
"self",
".",
"name",
"is",
"not",
"None",
":",
"_dict",
"[",
"'name'",
"]",
"=",
"self",
".",
"name",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DocumentEmotionResults._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'emotion') and self.emotion is not None:
_dict['emotion'] = self.emotion._to_dict()
return _dict | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'emotion') and self.emotion is not None:
_dict['emotion'] = self.emotion._to_dict()
return _dict | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1015-L1020 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'emotion'",
")",
"and",
"self",
".",
"emotion",
"is",
"not",
"None",
":",
"_dict",
"[",
"'emotion'",
"]",
"=",
"self",
".",
"emotion",
".",
"_to_d... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | EmotionOptions._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'document') and self.document is not None:
_dict['document'] = self.document
if hasattr(self, 'targets') and self.targets is not None:
_dict['targets'] = self.t... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'document') and self.document is not None:
_dict['document'] = self.document
if hasattr(self, 'targets') and self.targets is not None:
_dict['targets'] = self.t... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1127-L1134 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'document'",
")",
"and",
"self",
".",
"document",
"is",
"not",
"None",
":",
"_dict",
"[",
"'document'",
"]",
"=",
"self",
".",
"document",
"if",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | EmotionResult._from_dict | Initialize a EmotionResult object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a EmotionResult object from a json dictionary."""
args = {}
if 'document' in _dict:
args['document'] = DocumentEmotionResults._from_dict(
_dict.get('document'))
if 'targets' in _dict:
args['targets'] = [
... | def _from_dict(cls, _dict):
"""Initialize a EmotionResult object from a json dictionary."""
args = {}
if 'document' in _dict:
args['document'] = DocumentEmotionResults._from_dict(
_dict.get('document'))
if 'targets' in _dict:
args['targets'] = [
... | [
"Initialize",
"a",
"EmotionResult",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1176-L1187 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'document'",
"in",
"_dict",
":",
"args",
"[",
"'document'",
"]",
"=",
"DocumentEmotionResults",
".",
"_from_dict",
"(",
"_dict",
".",
"get",
"(",
"'document'",
")",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | EmotionScores._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'anger') and self.anger is not None:
_dict['anger'] = self.anger
if hasattr(self, 'disgust') and self.disgust is not None:
_dict['disgust'] = self.disgust
... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'anger') and self.anger is not None:
_dict['anger'] = self.anger
if hasattr(self, 'disgust') and self.disgust is not None:
_dict['disgust'] = self.disgust
... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1271-L1284 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'anger'",
")",
"and",
"self",
".",
"anger",
"is",
"not",
"None",
":",
"_dict",
"[",
"'anger'",
"]",
"=",
"self",
".",
"anger",
"if",
"hasattr",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | EntitiesOptions._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'mentions') and self.mentions is not None:
_dict['mentions'] = self.mentions
... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'mentions') and self.mentions is not None:
_dict['mentions'] = self.mentions
... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1364-L1377 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'limit'",
")",
"and",
"self",
".",
"limit",
"is",
"not",
"None",
":",
"_dict",
"[",
"'limit'",
"]",
"=",
"self",
".",
"limit",
"if",
"hasattr",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | EntitiesResult._from_dict | Initialize a EntitiesResult object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a EntitiesResult object from a json dictionary."""
args = {}
if 'type' in _dict:
args['type'] = _dict.get('type')
if 'text' in _dict:
args['text'] = _dict.get('text')
if 'relevance' in _dict:
args['rele... | def _from_dict(cls, _dict):
"""Initialize a EntitiesResult object from a json dictionary."""
args = {}
if 'type' in _dict:
args['type'] = _dict.get('type')
if 'text' in _dict:
args['text'] = _dict.get('text')
if 'relevance' in _dict:
args['rele... | [
"Initialize",
"a",
"EntitiesResult",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1448-L1471 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'type'",
"in",
"_dict",
":",
"args",
"[",
"'type'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'type'",
")",
"if",
"'text'",
"in",
"_dict",
":",
"args",
"[",
"'text'... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | EntitiesResult._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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, 'text') and self.text is not None:
_dict['text'] = self.text
if hasattr(se... | 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, 'text') and self.text is not None:
_dict['text'] = self.text
if hasattr(se... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1473-L1492 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'type'",
")",
"and",
"self",
".",
"type",
"is",
"not",
"None",
":",
"_dict",
"[",
"'type'",
"]",
"=",
"self",
".",
"type",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | FeatureSentimentResults._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'score') and self.score is not None:
_dict['score'] = self.score
return _dict | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'score') and self.score is not None:
_dict['score'] = self.score
return _dict | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1586-L1591 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'score'",
")",
"and",
"self",
".",
"score",
"is",
"not",
"None",
":",
"_dict",
"[",
"'score'",
"]",
"=",
"self",
".",
"score",
"return",
"_dict"
] | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Features._from_dict | Initialize a Features object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a Features object from a json dictionary."""
args = {}
if 'concepts' in _dict:
args['concepts'] = ConceptsOptions._from_dict(_dict.get('concepts'))
if 'emotion' in _dict:
args['emotion'] = EmotionOptions._from_dict(_dict.g... | def _from_dict(cls, _dict):
"""Initialize a Features object from a json dictionary."""
args = {}
if 'concepts' in _dict:
args['concepts'] = ConceptsOptions._from_dict(_dict.get('concepts'))
if 'emotion' in _dict:
args['emotion'] = EmotionOptions._from_dict(_dict.g... | [
"Initialize",
"a",
"Features",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1728-L1755 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'concepts'",
"in",
"_dict",
":",
"args",
"[",
"'concepts'",
"]",
"=",
"ConceptsOptions",
".",
"_from_dict",
"(",
"_dict",
".",
"get",
"(",
"'concepts'",
")",
")",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Features._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'concepts') and self.concepts is not None:
_dict['concepts'] = self.concepts._to_dict()
if hasattr(self, 'emotion') and self.emotion is not None:
_dict['emotion... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'concepts') and self.concepts is not None:
_dict['concepts'] = self.concepts._to_dict()
if hasattr(self, 'emotion') and self.emotion is not None:
_dict['emotion... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1757-L1780 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'concepts'",
")",
"and",
"self",
".",
"concepts",
"is",
"not",
"None",
":",
"_dict",
"[",
"'concepts'",
"]",
"=",
"self",
".",
"concepts",
".",
"_... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Feed._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'link') and self.link is not None:
_dict['link'] = self.link
return _dict | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'link') and self.link is not None:
_dict['link'] = self.link
return _dict | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1820-L1825 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'link'",
")",
"and",
"self",
".",
"link",
"is",
"not",
"None",
":",
"_dict",
"[",
"'link'",
"]",
"=",
"self",
".",
"link",
"return",
"_dict"
] | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | KeywordsResult._from_dict | Initialize a KeywordsResult object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a KeywordsResult object from a json dictionary."""
args = {}
if 'count' in _dict:
args['count'] = _dict.get('count')
if 'relevance' in _dict:
args['relevance'] = _dict.get('relevance')
if 'text' in _dict:
... | def _from_dict(cls, _dict):
"""Initialize a KeywordsResult object from a json dictionary."""
args = {}
if 'count' in _dict:
args['count'] = _dict.get('count')
if 'relevance' in _dict:
args['relevance'] = _dict.get('relevance')
if 'text' in _dict:
... | [
"Initialize",
"a",
"KeywordsResult",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1947-L1961 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'count'",
"in",
"_dict",
":",
"args",
"[",
"'count'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'count'",
")",
"if",
"'relevance'",
"in",
"_dict",
":",
"args",
"[",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | KeywordsResult._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'count') and self.count is not None:
_dict['count'] = self.count
if hasattr(self, 'relevance') and self.relevance is not None:
_dict['relevance'] = self.relevan... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'count') and self.count is not None:
_dict['count'] = self.count
if hasattr(self, 'relevance') and self.relevance is not None:
_dict['relevance'] = self.relevan... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L1963-L1976 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'count'",
")",
"and",
"self",
".",
"count",
"is",
"not",
"None",
":",
"_dict",
"[",
"'count'",
"]",
"=",
"self",
".",
"count",
"if",
"hasattr",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | ListModelsResults._from_dict | Initialize a ListModelsResults object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a ListModelsResults object from a json dictionary."""
args = {}
if 'models' in _dict:
args['models'] = [
Model._from_dict(x) for x in (_dict.get('models'))
]
return cls(**args) | def _from_dict(cls, _dict):
"""Initialize a ListModelsResults object from a json dictionary."""
args = {}
if 'models' in _dict:
args['models'] = [
Model._from_dict(x) for x in (_dict.get('models'))
]
return cls(**args) | [
"Initialize",
"a",
"ListModelsResults",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2009-L2016 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'models'",
"in",
"_dict",
":",
"args",
"[",
"'models'",
"]",
"=",
"[",
"Model",
".",
"_from_dict",
"(",
"x",
")",
"for",
"x",
"in",
"(",
"_dict",
".",
"get",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | ListModelsResults._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'models') and self.models is not None:
_dict['models'] = [x._to_dict() for x in self.models]
return _dict | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'models') and self.models is not None:
_dict['models'] = [x._to_dict() for x in self.models]
return _dict | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2018-L2023 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'models'",
")",
"and",
"self",
".",
"models",
"is",
"not",
"None",
":",
"_dict",
"[",
"'models'",
"]",
"=",
"[",
"x",
".",
"_to_dict",
"(",
")",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Model._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'status') and self.status is not None:
_dict['status'] = self.status
if hasattr(self, 'model_id') and self.model_id is not None:
_dict['model_id'] = self.model_... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'status') and self.status is not None:
_dict['status'] = self.status
if hasattr(self, 'model_id') and self.model_id is not None:
_dict['model_id'] = self.model_... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2155-L2176 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'status'",
")",
"and",
"self",
".",
"status",
"is",
"not",
"None",
":",
"_dict",
"[",
"'status'",
"]",
"=",
"self",
".",
"status",
"if",
"hasattr"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | RelationArgument._from_dict | Initialize a RelationArgument object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a RelationArgument object from a json dictionary."""
args = {}
if 'entities' in _dict:
args['entities'] = [
RelationEntity._from_dict(x) for x in (_dict.get('entities'))
]
if 'location' in _dict:
... | def _from_dict(cls, _dict):
"""Initialize a RelationArgument object from a json dictionary."""
args = {}
if 'entities' in _dict:
args['entities'] = [
RelationEntity._from_dict(x) for x in (_dict.get('entities'))
]
if 'location' in _dict:
... | [
"Initialize",
"a",
"RelationArgument",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2217-L2228 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'entities'",
"in",
"_dict",
":",
"args",
"[",
"'entities'",
"]",
"=",
"[",
"RelationEntity",
".",
"_from_dict",
"(",
"x",
")",
"for",
"x",
"in",
"(",
"_dict",
".... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | RelationArgument._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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]
if hasattr(self, 'location') and self.location is not None:
... | 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]
if hasattr(self, 'location') and self.location is not None:
... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2230-L2239 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'entities'",
")",
"and",
"self",
".",
"entities",
"is",
"not",
"None",
":",
"_dict",
"[",
"'entities'",
"]",
"=",
"[",
"x",
".",
"_to_dict",
"(",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | RelationsOptions._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'model') and self.model is not None:
_dict['model'] = self.model
return _dict | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'model') and self.model is not None:
_dict['model'] = self.model
return _dict | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2340-L2345 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'model'",
")",
"and",
"self",
".",
"model",
"is",
"not",
"None",
":",
"_dict",
"[",
"'model'",
"]",
"=",
"self",
".",
"model",
"return",
"_dict"
] | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | RelationsResult._from_dict | Initialize a RelationsResult object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a RelationsResult object from a json dictionary."""
args = {}
if 'score' in _dict:
args['score'] = _dict.get('score')
if 'sentence' in _dict:
args['sentence'] = _dict.get('sentence')
if 'type' in _dict:
... | def _from_dict(cls, _dict):
"""Initialize a RelationsResult object from a json dictionary."""
args = {}
if 'score' in _dict:
args['score'] = _dict.get('score')
if 'sentence' in _dict:
args['sentence'] = _dict.get('sentence')
if 'type' in _dict:
... | [
"Initialize",
"a",
"RelationsResult",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2391-L2404 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'score'",
"in",
"_dict",
":",
"args",
"[",
"'score'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'score'",
")",
"if",
"'sentence'",
"in",
"_dict",
":",
"args",
"[",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | RelationsResult._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'score') and self.score is not None:
_dict['score'] = self.score
if hasattr(self, 'sentence') and self.sentence is not None:
_dict['sentence'] = self.sentence
... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'score') and self.score is not None:
_dict['score'] = self.score
if hasattr(self, 'sentence') and self.sentence is not None:
_dict['sentence'] = self.sentence
... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2406-L2417 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'score'",
")",
"and",
"self",
".",
"score",
"is",
"not",
"None",
":",
"_dict",
"[",
"'score'",
"]",
"=",
"self",
".",
"score",
"if",
"hasattr",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesEntity._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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, 'text') and self.text is not None:
_dict['text'] = self.text
return _dict | 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, 'text') and self.text is not None:
_dict['text'] = self.text
return _dict | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2462-L2469 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'type'",
")",
"and",
"self",
".",
"type",
"is",
"not",
"None",
":",
"_dict",
"[",
"'type'",
"]",
"=",
"self",
".",
"type",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesKeyword._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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
return _dict | 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
return _dict | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2509-L2514 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'text'",
")",
"and",
"self",
".",
"text",
"is",
"not",
"None",
":",
"_dict",
"[",
"'text'",
"]",
"=",
"self",
".",
"text",
"return",
"_dict"
] | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesOptions._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'keywords') and self.keywords is not None:
_dict['keywords'] = self.keywords
... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'keywords') and self.keywords is not None:
_dict['keywords'] = self.keywords
... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2569-L2578 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'limit'",
")",
"and",
"self",
".",
"limit",
"is",
"not",
"None",
":",
"_dict",
"[",
"'limit'",
"]",
"=",
"self",
".",
"limit",
"if",
"hasattr",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesResult._from_dict | Initialize a SemanticRolesResult object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a SemanticRolesResult object from a json dictionary."""
args = {}
if 'sentence' in _dict:
args['sentence'] = _dict.get('sentence')
if 'subject' in _dict:
args['subject'] = SemanticRolesResultSubject._from_dict(
... | def _from_dict(cls, _dict):
"""Initialize a SemanticRolesResult object from a json dictionary."""
args = {}
if 'sentence' in _dict:
args['sentence'] = _dict.get('sentence')
if 'subject' in _dict:
args['subject'] = SemanticRolesResultSubject._from_dict(
... | [
"Initialize",
"a",
"SemanticRolesResult",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2628-L2642 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'sentence'",
"in",
"_dict",
":",
"args",
"[",
"'sentence'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'sentence'",
")",
"if",
"'subject'",
"in",
"_dict",
":",
"args",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesResult._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'sentence') and self.sentence is not None:
_dict['sentence'] = self.sentence
if hasattr(self, 'subject') and self.subject is not None:
_dict['subject'] = self.s... | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'sentence') and self.sentence is not None:
_dict['sentence'] = self.sentence
if hasattr(self, 'subject') and self.subject is not None:
_dict['subject'] = self.s... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2644-L2655 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'sentence'",
")",
"and",
"self",
".",
"sentence",
"is",
"not",
"None",
":",
"_dict",
"[",
"'sentence'",
"]",
"=",
"self",
".",
"sentence",
"if",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesResultAction._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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, 'normalized') and self.normalized is not None:
_dict['normalized'] = self.normaliz... | 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, 'normalized') and self.normalized is not None:
_dict['normalized'] = self.normaliz... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2705-L2714 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'text'",
")",
"and",
"self",
".",
"text",
"is",
"not",
"None",
":",
"_dict",
"[",
"'text'",
"]",
"=",
"self",
".",
"text",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesResultObject._from_dict | Initialize a SemanticRolesResultObject object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a SemanticRolesResultObject object from a json dictionary."""
args = {}
if 'text' in _dict:
args['text'] = _dict.get('text')
if 'keywords' in _dict:
args['keywords'] = [
SemanticRolesKeyword._from_dict(x)
... | def _from_dict(cls, _dict):
"""Initialize a SemanticRolesResultObject object from a json dictionary."""
args = {}
if 'text' in _dict:
args['text'] = _dict.get('text')
if 'keywords' in _dict:
args['keywords'] = [
SemanticRolesKeyword._from_dict(x)
... | [
"Initialize",
"a",
"SemanticRolesResultObject",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2751-L2761 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'text'",
"in",
"_dict",
":",
"args",
"[",
"'text'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'text'",
")",
"if",
"'keywords'",
"in",
"_dict",
":",
"args",
"[",
"'k... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesResultObject._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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, 'keywords') and self.keywords is not None:
_dict['keywords'] = [x._to_dict() for x... | 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, 'keywords') and self.keywords is not None:
_dict['keywords'] = [x._to_dict() for x... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2763-L2770 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'text'",
")",
"and",
"self",
".",
"text",
"is",
"not",
"None",
":",
"_dict",
"[",
"'text'",
"]",
"=",
"self",
".",
"text",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesResultSubject._from_dict | Initialize a SemanticRolesResultSubject object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | def _from_dict(cls, _dict):
"""Initialize a SemanticRolesResultSubject object from a json dictionary."""
args = {}
if 'text' in _dict:
args['text'] = _dict.get('text')
if 'entities' in _dict:
args['entities'] = [
SemanticRolesEntity._from_dict(x)
... | def _from_dict(cls, _dict):
"""Initialize a SemanticRolesResultSubject object from a json dictionary."""
args = {}
if 'text' in _dict:
args['text'] = _dict.get('text')
if 'entities' in _dict:
args['entities'] = [
SemanticRolesEntity._from_dict(x)
... | [
"Initialize",
"a",
"SemanticRolesResultSubject",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2811-L2826 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'text'",
"in",
"_dict",
":",
"args",
"[",
"'text'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'text'",
")",
"if",
"'entities'",
"in",
"_dict",
":",
"args",
"[",
"'e... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesResultSubject._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2828-L2837 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'text'",
")",
"and",
"self",
".",
"text",
"is",
"not",
"None",
":",
"_dict",
"[",
"'text'",
"]",
"=",
"self",
".",
"text",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SemanticRolesVerb._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L2882-L2889 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'text'",
")",
"and",
"self",
".",
"text",
"is",
"not",
"None",
":",
"_dict",
"[",
"'text'",
"]",
"=",
"self",
".",
"text",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SentimentResult._from_dict | Initialize a SentimentResult object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | 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'] = ... | 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'] = ... | [
"Initialize",
"a",
"SentimentResult",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L3041-L3052 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'document'",
"in",
"_dict",
":",
"args",
"[",
"'document'",
"]",
"=",
"DocumentSentimentResults",
".",
"_from_dict",
"(",
"_dict",
".",
"get",
"(",
"'document'",
")",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SyntaxOptions._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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']... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L3107-L3114 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'tokens'",
")",
"and",
"self",
".",
"tokens",
"is",
"not",
"None",
":",
"_dict",
"[",
"'tokens'",
"]",
"=",
"self",
".",
"tokens",
".",
"_to_dict"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SyntaxOptionsTokens._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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']... | 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']... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L3162-L3169 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'lemma'",
")",
"and",
"self",
".",
"lemma",
"is",
"not",
"None",
":",
"_dict",
"[",
"'lemma'",
"]",
"=",
"self",
".",
"lemma",
"if",
"hasattr",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | SyntaxResult._from_dict | Initialize a SyntaxResult object from a json dictionary. | ibm_watson/natural_language_understanding_v1.py | 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... | 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... | [
"Initialize",
"a",
"SyntaxResult",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L3205-L3216 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'tokens'",
"in",
"_dict",
":",
"args",
"[",
"'tokens'",
"]",
"=",
"[",
"TokenResult",
".",
"_from_dict",
"(",
"x",
")",
"for",
"x",
"in",
"(",
"_dict",
".",
"g... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | TargetedEmotionResults._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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(... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L3270-L3277 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'text'",
")",
"and",
"self",
".",
"text",
"is",
"not",
"None",
":",
"_dict",
"[",
"'text'",
"]",
"=",
"self",
".",
"text",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | TargetedSentimentResults._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L3322-L3329 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'text'",
")",
"and",
"self",
".",
"text",
"is",
"not",
"None",
":",
"_dict",
"[",
"'text'",
"]",
"=",
"self",
".",
"text",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | TokenResult._to_dict | Return a json dictionary representing this model. | ibm_watson/natural_language_understanding_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L3396-L3407 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'text'",
")",
"and",
"self",
".",
"text",
"is",
"not",
"None",
":",
"_dict",
"[",
"'text'",
"]",
"=",
"self",
".",
"text",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.update_configuration | 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... | ibm_watson/discovery_v1.py | def update_configuration(self,
environment_id,
configuration_id,
name,
description=None,
conversions=None,
enrichments=None,
... | def update_configuration(self,
environment_id,
configuration_id,
name,
description=None,
conversions=None,
enrichments=None,
... | [
"Update",
"a",
"configuration",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L529-L614 | [
"def",
"update_configuration",
"(",
"self",
",",
"environment_id",
",",
"configuration_id",
",",
"name",
",",
"description",
"=",
"None",
",",
"conversions",
"=",
"None",
",",
"enrichments",
"=",
"None",
",",
"normalizations",
"=",
"None",
",",
"source",
"=",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.create_expansions | 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... | ibm_watson/discovery_v1.py | 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... | 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",
"or",
"update",
"expansion",
"list",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L961-L1017 | [
"def",
"create_expansions",
"(",
"self",
",",
"environment_id",
",",
"collection_id",
",",
"expansions",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"environment_id",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'environment_id must be provided'",
")",
"if",
"co... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.create_stopword_list | 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 ... | ibm_watson/discovery_v1.py | def create_stopword_list(self,
environment_id,
collection_id,
stopword_file,
stopword_filename=None,
**kwargs):
"""
Create stopword list.
Upload a cus... | def create_stopword_list(self,
environment_id,
collection_id,
stopword_file,
stopword_filename=None,
**kwargs):
"""
Create stopword list.
Upload a cus... | [
"Create",
"stopword",
"list",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L1019-L1071 | [
"def",
"create_stopword_list",
"(",
"self",
",",
"environment_id",
",",
"collection_id",
",",
"stopword_file",
",",
"stopword_filename",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"environment_id",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'en... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.federated_query | 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... | ibm_watson/discovery_v1.py | def federated_query(self,
environment_id,
filter=None,
query=None,
natural_language_query=None,
passages=None,
aggregation=None,
count=None,
... | def federated_query(self,
environment_id,
filter=None,
query=None,
natural_language_query=None,
passages=None,
aggregation=None,
count=None,
... | [
"Long",
"environment",
"queries",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L1607-L1756 | [
"def",
"federated_query",
"(",
"self",
",",
"environment_id",
",",
"filter",
"=",
"None",
",",
"query",
"=",
"None",
",",
"natural_language_query",
"=",
"None",
",",
"passages",
"=",
"None",
",",
"aggregation",
"=",
"None",
",",
"count",
"=",
"None",
",",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.query_entities | 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 ... | ibm_watson/discovery_v1.py | def query_entities(self,
environment_id,
collection_id,
feature=None,
entity=None,
context=None,
count=None,
evidence_count=None,
**kwar... | def query_entities(self,
environment_id,
collection_id,
feature=None,
entity=None,
context=None,
count=None,
evidence_count=None,
**kwar... | [
"Knowledge",
"Graph",
"entity",
"query",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L2031-L2100 | [
"def",
"query_entities",
"(",
"self",
",",
"environment_id",
",",
"collection_id",
",",
"feature",
"=",
"None",
",",
"entity",
"=",
"None",
",",
"context",
"=",
"None",
",",
"count",
"=",
"None",
",",
"evidence_count",
"=",
"None",
",",
"*",
"*",
"kwargs... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.query_relations | 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.
:... | ibm_watson/discovery_v1.py | def query_relations(self,
environment_id,
collection_id,
entities=None,
context=None,
sort=None,
filter=None,
count=None,
eviden... | def query_relations(self,
environment_id,
collection_id,
entities=None,
context=None,
sort=None,
filter=None,
count=None,
eviden... | [
"Knowledge",
"Graph",
"relationship",
"query",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L2234-L2312 | [
"def",
"query_relations",
"(",
"self",
",",
"environment_id",
",",
"collection_id",
",",
"entities",
"=",
"None",
",",
"context",
"=",
"None",
",",
"sort",
"=",
"None",
",",
"filter",
"=",
"None",
",",
"count",
"=",
"None",
",",
"evidence_count",
"=",
"N... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.add_training_data | 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... | ibm_watson/discovery_v1.py | def add_training_data(self,
environment_id,
collection_id,
natural_language_query=None,
filter=None,
examples=None,
**kwargs):
"""
Add query to trai... | def add_training_data(self,
environment_id,
collection_id,
natural_language_query=None,
filter=None,
examples=None,
**kwargs):
"""
Add query to trai... | [
"Add",
"query",
"to",
"training",
"data",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L2318-L2375 | [
"def",
"add_training_data",
"(",
"self",
",",
"environment_id",
",",
"collection_id",
",",
"natural_language_query",
"=",
"None",
",",
"filter",
"=",
"None",
",",
"examples",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"environment_id",
"is",
"None... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.create_training_example | 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... | ibm_watson/discovery_v1.py | def create_training_example(self,
environment_id,
collection_id,
query_id,
document_id=None,
cross_reference=None,
relevance=Non... | def create_training_example(self,
environment_id,
collection_id,
query_id,
document_id=None,
cross_reference=None,
relevance=Non... | [
"Add",
"example",
"to",
"training",
"data",
"query",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L2377-L2433 | [
"def",
"create_training_example",
"(",
"self",
",",
"environment_id",
",",
"collection_id",
",",
"query_id",
",",
"document_id",
"=",
"None",
",",
"cross_reference",
"=",
"None",
",",
"relevance",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"enviro... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.create_event | Create event.
The **Events** API can be used to create log entries that are associated with
specific queries. For example, you can record which documents in the results set
were \"clicked\" by a user and when that click occured.
:param str type: The event type to be created.
:p... | ibm_watson/discovery_v1.py | def create_event(self, type, data, **kwargs):
"""
Create event.
The **Events** API can be used to create log entries that are associated with
specific queries. For example, you can record which documents in the results set
were \"clicked\" by a user and when that click occured.
... | def create_event(self, type, data, **kwargs):
"""
Create event.
The **Events** API can be used to create log entries that are associated with
specific queries. For example, you can record which documents in the results set
were \"clicked\" by a user and when that click occured.
... | [
"Create",
"event",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L2821-L2860 | [
"def",
"create_event",
"(",
"self",
",",
"type",
",",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"type",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'type must be provided'",
")",
"if",
"data",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.get_metrics_event_rate | 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**
... | ibm_watson/discovery_v1.py | 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... | 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... | [
"Percentage",
"of",
"queries",
"with",
"an",
"associated",
"event",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L2862-L2907 | [
"def",
"get_metrics_event_rate",
"(",
"self",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"result_type",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"headers",
"=",
"{",
"}",
"if",
"'headers'",
"in",
"kwargs",
":",
"headers",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.query_log | 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 ... | ibm_watson/discovery_v1.py | 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... | 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... | [
"Search",
"the",
"query",
"and",
"event",
"log",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3078-L3136 | [
"def",
"query_log",
"(",
"self",
",",
"filter",
"=",
"None",
",",
"query",
"=",
"None",
",",
"count",
"=",
"None",
",",
"offset",
"=",
"None",
",",
"sort",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"headers",
"=",
"{",
"}",
"if",
"'headers'... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiscoveryV1.create_credentials | Create credentials.
Creates a set of credentials to connect to a remote source. Created credentials
are used in a configuration to associate a collection with the remote source.
**Note:** All credentials are sent over an encrypted connection and encrypted at
rest.
:param str en... | ibm_watson/discovery_v1.py | def create_credentials(self,
environment_id,
source_type=None,
credential_details=None,
**kwargs):
"""
Create credentials.
Creates a set of credentials to connect to a remote source. Crea... | def create_credentials(self,
environment_id,
source_type=None,
credential_details=None,
**kwargs):
"""
Create credentials.
Creates a set of credentials to connect to a remote source. Crea... | [
"Create",
"credentials",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3142-L3201 | [
"def",
"create_credentials",
"(",
"self",
",",
"environment_id",
",",
"source_type",
"=",
"None",
",",
"credential_details",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"environment_id",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'environment_id... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | AggregationResult._from_dict | Initialize a AggregationResult object from a json dictionary. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Initialize",
"a",
"AggregationResult",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3552-L3564 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'key'",
"in",
"_dict",
":",
"args",
"[",
"'key'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'key'",
")",
"if",
"'matching_results'",
"in",
"_dict",
":",
"args",
"[",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | AggregationResult._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3566-L3576 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'key'",
")",
"and",
"self",
".",
"key",
"is",
"not",
"None",
":",
"_dict",
"[",
"'key'",
"]",
"=",
"self",
".",
"key",
"if",
"hasattr",
"(",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Calculation._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3635-L3642 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'field'",
")",
"and",
"self",
".",
"field",
"is",
"not",
"None",
":",
"_dict",
"[",
"'field'",
"]",
"=",
"self",
".",
"field",
"if",
"hasattr",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Collection._from_dict | Initialize a Collection object from a json dictionary. | ibm_watson/discovery_v1.py | 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... | 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",
"Collection",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3733-L3764 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'collection_id'",
"in",
"_dict",
":",
"args",
"[",
"'collection_id'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'collection_id'",
")",
"if",
"'name'",
"in",
"_dict",
":",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Collection._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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, 'name') and self.name is not None:
_dict['name... | 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, 'name') and self.name is not None:
_dict['name... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3766-L3796 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'collection_id'",
")",
"and",
"self",
".",
"collection_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'collection_id'",
"]",
"=",
"self",
".",
"collect... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | CollectionDiskUsage._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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 | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3836-L3841 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'used_bytes'",
")",
"and",
"self",
".",
"used_bytes",
"is",
"not",
"None",
":",
"_dict",
"[",
"'used_bytes'",
"]",
"=",
"self",
".",
"used_bytes",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | CollectionUsage._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3888-L3896 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'available'",
")",
"and",
"self",
".",
"available",
"is",
"not",
"None",
":",
"_dict",
"[",
"'available'",
"]",
"=",
"self",
".",
"available",
"if",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Configuration._from_dict | Initialize a Configuration object from a json dictionary. | ibm_watson/discovery_v1.py | 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:
... | 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:
... | [
"Initialize",
"a",
"Configuration",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L3976-L4006 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'configuration_id'",
"in",
"_dict",
":",
"args",
"[",
"'configuration_id'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'configuration_id'",
")",
"if",
"'name'",
"in",
"_dict... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Configuration._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4008-L4032 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'configuration_id'",
")",
"and",
"self",
".",
"configuration_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'configuration_id'",
"]",
"=",
"self",
".",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Conversions._from_dict | Initialize a Conversions object from a json dictionary. | ibm_watson/discovery_v1.py | 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 '... | 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 '... | [
"Initialize",
"a",
"Conversions",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4087-L4103 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'pdf'",
"in",
"_dict",
":",
"args",
"[",
"'pdf'",
"]",
"=",
"PdfSettings",
".",
"_from_dict",
"(",
"_dict",
".",
"get",
"(",
"'pdf'",
")",
")",
"if",
"'word'",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Conversions._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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()
... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4105-L4122 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'pdf'",
")",
"and",
"self",
".",
"pdf",
"is",
"not",
"None",
":",
"_dict",
"[",
"'pdf'",
"]",
"=",
"self",
".",
"pdf",
".",
"_to_dict",
"(",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | CreateEventResponse._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4167-L4174 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'type'",
")",
"and",
"self",
".",
"type",
"is",
"not",
"None",
":",
"_dict",
"[",
"'type'",
"]",
"=",
"self",
".",
"type",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | CredentialDetails._from_dict | Initialize a CredentialDetails object from a json dictionary. | ibm_watson/discovery_v1.py | 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')
... | 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')
... | [
"Initialize",
"a",
"CredentialDetails",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4384-L4425 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'credential_type'",
"in",
"_dict",
":",
"args",
"[",
"'credential_type'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'credential_type'",
")",
"if",
"'client_id'",
"in",
"_di... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | CredentialDetails._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4427-L4474 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'credential_type'",
")",
"and",
"self",
".",
"credential_type",
"is",
"not",
"None",
":",
"_dict",
"[",
"'credential_type'",
"]",
"=",
"self",
".",
"c... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Credentials._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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:
... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4549-L4560 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'credential_id'",
")",
"and",
"self",
".",
"credential_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'credential_id'",
"]",
"=",
"self",
".",
"credent... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | CredentialsList._from_dict | Initialize a CredentialsList object from a json dictionary. | ibm_watson/discovery_v1.py | 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) | 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) | [
"Initialize",
"a",
"CredentialsList",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4595-L4602 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'credentials'",
"in",
"_dict",
":",
"args",
"[",
"'credentials'",
"]",
"=",
"[",
"Credentials",
".",
"_from_dict",
"(",
"x",
")",
"for",
"x",
"in",
"(",
"_dict",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | CredentialsList._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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 | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4604-L4609 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'credentials'",
")",
"and",
"self",
".",
"credentials",
"is",
"not",
"None",
":",
"_dict",
"[",
"'credentials'",
"]",
"=",
"[",
"x",
".",
"_to_dict"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DeleteCollectionResponse._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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['... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4666-L4673 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'collection_id'",
")",
"and",
"self",
".",
"collection_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'collection_id'",
"]",
"=",
"self",
".",
"collect... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DeleteConfigurationResponse._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4735-L4745 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'configuration_id'",
")",
"and",
"self",
".",
"configuration_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'configuration_id'",
"]",
"=",
"self",
".",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DeleteCredentials._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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['... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4792-L4799 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'credential_id'",
")",
"and",
"self",
".",
"credential_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'credential_id'",
"]",
"=",
"self",
".",
"credent... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DeleteDocumentResponse._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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']... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4846-L4853 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'document_id'",
")",
"and",
"self",
".",
"document_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'document_id'",
"]",
"=",
"self",
".",
"document_id",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DeleteEnvironmentResponse._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4906-L4913 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'environment_id'",
")",
"and",
"self",
".",
"environment_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'environment_id'",
"]",
"=",
"self",
".",
"envi... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DiskUsage._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L4962-L4970 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'used_bytes'",
")",
"and",
"self",
".",
"used_bytes",
"is",
"not",
"None",
":",
"_dict",
"[",
"'used_bytes'",
"]",
"=",
"self",
".",
"used_bytes",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DocumentAccepted._from_dict | Initialize a DocumentAccepted object from a json dictionary. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Initialize",
"a",
"DocumentAccepted",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5016-L5027 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'document_id'",
"in",
"_dict",
":",
"args",
"[",
"'document_id'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'document_id'",
")",
"if",
"'status'",
"in",
"_dict",
":",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DocumentAccepted._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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']... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5029-L5038 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'document_id'",
")",
"and",
"self",
".",
"document_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'document_id'",
"]",
"=",
"self",
".",
"document_id",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DocumentCounts._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5105-L5116 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'available'",
")",
"and",
"self",
".",
"available",
"is",
"not",
"None",
":",
"_dict",
"[",
"'available'",
"]",
"=",
"self",
".",
"available",
"if",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DocumentSnapshot._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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
... | 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
... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5163-L5170 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'step'",
")",
"and",
"self",
".",
"step",
"is",
"not",
"None",
":",
"_dict",
"[",
"'step'",
"]",
"=",
"self",
".",
"step",
"if",
"hasattr",
"(",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DocumentStatus._from_dict | Initialize a DocumentStatus object from a json dictionary. | ibm_watson/discovery_v1.py | 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 ... | 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 ... | [
"Initialize",
"a",
"DocumentStatus",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5237-L5274 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'document_id'",
"in",
"_dict",
":",
"args",
"[",
"'document_id'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'document_id'",
")",
"else",
":",
"raise",
"ValueError",
"(",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | DocumentStatus._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5276-L5298 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'document_id'",
")",
"and",
"self",
".",
"document_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'document_id'",
"]",
"=",
"self",
".",
"document_id",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Enrichment._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5421-L5441 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'description'",
")",
"and",
"self",
".",
"description",
"is",
"not",
"None",
":",
"_dict",
"[",
"'description'",
"]",
"=",
"self",
".",
"description",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | EnrichmentOptions._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5503-L5512 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'features'",
")",
"and",
"self",
".",
"features",
"is",
"not",
"None",
":",
"_dict",
"[",
"'features'",
"]",
"=",
"self",
".",
"features",
".",
"_... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Environment._from_dict | Initialize a Environment object from a json dictionary. | ibm_watson/discovery_v1.py | 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 ... | 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 ... | [
"Initialize",
"a",
"Environment",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5604-L5631 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'environment_id'",
"in",
"_dict",
":",
"args",
"[",
"'environment_id'",
"]",
"=",
"_dict",
".",
"get",
"(",
"'environment_id'",
")",
"if",
"'name'",
"in",
"_dict",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Environment._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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['... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5633-L5658 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'environment_id'",
")",
"and",
"self",
".",
"environment_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'environment_id'",
"]",
"=",
"self",
".",
"envi... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | EnvironmentDocuments._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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:
... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5705-L5713 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'indexed'",
")",
"and",
"self",
".",
"indexed",
"is",
"not",
"None",
":",
"_dict",
"[",
"'indexed'",
"]",
"=",
"self",
".",
"indexed",
"if",
"hasa... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | EventData._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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:
... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5822-L5841 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'environment_id'",
")",
"and",
"self",
".",
"environment_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'environment_id'",
"]",
"=",
"self",
".",
"envi... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Expansion._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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:
... | 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:
... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5897-L5904 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'input_terms'",
")",
"and",
"self",
".",
"input_terms",
"is",
"not",
"None",
":",
"_dict",
"[",
"'input_terms'",
"]",
"=",
"self",
".",
"input_terms",... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Expansions._from_dict | Initialize a Expansions object from a json dictionary. | ibm_watson/discovery_v1.py | 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(
... | 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(
... | [
"Initialize",
"a",
"Expansions",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5960-L5971 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'expansions'",
"in",
"_dict",
":",
"args",
"[",
"'expansions'",
"]",
"=",
"[",
"Expansion",
".",
"_from_dict",
"(",
"x",
")",
"for",
"x",
"in",
"(",
"_dict",
"."... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Expansions._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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 | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L5973-L5978 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'expansions'",
")",
"and",
"self",
".",
"expansions",
"is",
"not",
"None",
":",
"_dict",
"[",
"'expansions'",
"]",
"=",
"[",
"x",
".",
"_to_dict",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Field._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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'] = ... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6023-L6030 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'field_name'",
")",
"and",
"self",
".",
"field_name",
"is",
"not",
"None",
":",
"_dict",
"[",
"'field'",
"]",
"=",
"self",
".",
"field_name",
"if",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Filter._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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 | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6081-L6086 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'match'",
")",
"and",
"self",
".",
"match",
"is",
"not",
"None",
":",
"_dict",
"[",
"'match'",
"]",
"=",
"self",
".",
"match",
"return",
"_dict"
] | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | FontSetting._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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
... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6159-L6174 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'level'",
")",
"and",
"self",
".",
"level",
"is",
"not",
"None",
":",
"_dict",
"[",
"'level'",
"]",
"=",
"self",
".",
"level",
"if",
"hasattr",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | Gateway._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6247-L6260 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'gateway_id'",
")",
"and",
"self",
".",
"gateway_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'gateway_id'",
"]",
"=",
"self",
".",
"gateway_id",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | GatewayDelete._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6305-L6312 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'gateway_id'",
")",
"and",
"self",
".",
"gateway_id",
"is",
"not",
"None",
":",
"_dict",
"[",
"'gateway_id'",
"]",
"=",
"self",
".",
"gateway_id",
"... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | GatewayList._from_dict | Initialize a GatewayList object from a json dictionary. | ibm_watson/discovery_v1.py | 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) | 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) | [
"Initialize",
"a",
"GatewayList",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6345-L6352 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'gateways'",
"in",
"_dict",
":",
"args",
"[",
"'gateways'",
"]",
"=",
"[",
"Gateway",
".",
"_from_dict",
"(",
"x",
")",
"for",
"x",
"in",
"(",
"_dict",
".",
"g... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | GatewayList._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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 | 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",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6354-L6359 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'gateways'",
")",
"and",
"self",
".",
"gateways",
"is",
"not",
"None",
":",
"_dict",
"[",
"'gateways'",
"]",
"=",
"[",
"x",
".",
"_to_dict",
"(",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | HtmlSettings._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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,... | 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,... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6509-L6530 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'exclude_tags_completely'",
")",
"and",
"self",
".",
"exclude_tags_completely",
"is",
"not",
"None",
":",
"_dict",
"[",
"'exclude_tags_completely'",
"]",
"=... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | IndexCapacity._from_dict | Initialize a IndexCapacity object from a json dictionary. | ibm_watson/discovery_v1.py | 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']... | 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']... | [
"Initialize",
"a",
"IndexCapacity",
"object",
"from",
"a",
"json",
"dictionary",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6575-L6586 | [
"def",
"_from_dict",
"(",
"cls",
",",
"_dict",
")",
":",
"args",
"=",
"{",
"}",
"if",
"'documents'",
"in",
"_dict",
":",
"args",
"[",
"'documents'",
"]",
"=",
"EnvironmentDocuments",
".",
"_from_dict",
"(",
"_dict",
".",
"get",
"(",
"'documents'",
")",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
train | IndexCapacity._to_dict | Return a json dictionary representing this model. | ibm_watson/discovery_v1.py | 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... | 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... | [
"Return",
"a",
"json",
"dictionary",
"representing",
"this",
"model",
"."
] | watson-developer-cloud/python-sdk | python | https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/discovery_v1.py#L6588-L6597 | [
"def",
"_to_dict",
"(",
"self",
")",
":",
"_dict",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"self",
",",
"'documents'",
")",
"and",
"self",
".",
"documents",
"is",
"not",
"None",
":",
"_dict",
"[",
"'documents'",
"]",
"=",
"self",
".",
"documents",
".",
... | 4c2c9df4466fcde88975da9ecd834e6ba95eb353 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.