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
ConfigLedgerAuthStrategy.get_auth_constraint
Find rule_id for incoming action_id and return AuthConstraint instance
indy_common/authorize/auth_cons_strategies.py
def get_auth_constraint(self, action_id: str) -> AbstractAuthConstraint: """ Find rule_id for incoming action_id and return AuthConstraint instance """ if self.anyone_can_write_map: return self._find_auth_constraint(action_id, self.anyone_can_write_map, from_local=True) ...
def get_auth_constraint(self, action_id: str) -> AbstractAuthConstraint: """ Find rule_id for incoming action_id and return AuthConstraint instance """ if self.anyone_can_write_map: return self._find_auth_constraint(action_id, self.anyone_can_write_map, from_local=True) ...
[ "Find", "rule_id", "for", "incoming", "action_id", "and", "return", "AuthConstraint", "instance" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_common/authorize/auth_cons_strategies.py#L77-L84
[ "def", "get_auth_constraint", "(", "self", ",", "action_id", ":", "str", ")", "->", "AbstractAuthConstraint", ":", "if", "self", ".", "anyone_can_write_map", ":", "return", "self", ".", "_find_auth_constraint", "(", "action_id", ",", "self", ".", "anyone_can_write...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
ActionLog._append
Appends event to log Be careful it opens file every time!
indy_node/server/action_log.py
def _append(self, ev_type: Enum, data: ActionLogData) -> None: """ Appends event to log Be careful it opens file every time! """ event = ActionLogEvent(None, ev_type, data, types=self._event_types) with open(self._file_path, mode='a+', newline='') as f: f.writ...
def _append(self, ev_type: Enum, data: ActionLogData) -> None: """ Appends event to log Be careful it opens file every time! """ event = ActionLogEvent(None, ev_type, data, types=self._event_types) with open(self._file_path, mode='a+', newline='') as f: f.writ...
[ "Appends", "event", "to", "log", "Be", "careful", "it", "opens", "file", "every", "time!" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/action_log.py#L181-L189
[ "def", "_append", "(", "self", ",", "ev_type", ":", "Enum", ",", "data", ":", "ActionLogData", ")", "->", "None", ":", "event", "=", "ActionLogEvent", "(", "None", ",", "ev_type", ",", "data", ",", "types", "=", "self", ".", "_event_types", ")", "with"...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
AttributeHandler.update_state
The state trie stores the hash of the whole attribute data at: the did+attribute name if the data is plaintext (RAW) the did+hash(attribute) if the data is encrypted (ENC) If the attribute is HASH, then nothing is stored in attribute store, the trie stores a blank value for the k...
indy_node/server/request_handlers/domain_req_handlers/attribute_handler.py
def update_state(self, txn, prev_result, is_committed=True) -> None: """ The state trie stores the hash of the whole attribute data at: the did+attribute name if the data is plaintext (RAW) the did+hash(attribute) if the data is encrypted (ENC) If the attribute is HASH, t...
def update_state(self, txn, prev_result, is_committed=True) -> None: """ The state trie stores the hash of the whole attribute data at: the did+attribute name if the data is plaintext (RAW) the did+hash(attribute) if the data is encrypted (ENC) If the attribute is HASH, t...
[ "The", "state", "trie", "stores", "the", "hash", "of", "the", "whole", "attribute", "data", "at", ":", "the", "did", "+", "attribute", "name", "if", "the", "data", "is", "plaintext", "(", "RAW", ")", "the", "did", "+", "hash", "(", "attribute", ")", ...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/request_handlers/domain_req_handlers/attribute_handler.py#L54-L66
[ "def", "update_state", "(", "self", ",", "txn", ",", "prev_result", ",", "is_committed", "=", "True", ")", "->", "None", ":", "self", ".", "_validate_txn_type", "(", "txn", ")", "attr_type", ",", "path", ",", "value", ",", "hashed_value", ",", "value_bytes...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
WriteRequestValidator.create_auth_strategy
depends on config
indy_common/authorize/auth_request_validator.py
def create_auth_strategy(self): """depends on config""" if self.config.authPolicy == LOCAL_AUTH_POLICY: return LocalAuthStrategy(auth_map=self.auth_map, anyone_can_write_map=self.anyone_can_write_map if self.anyone_can_write else None) elif self.c...
def create_auth_strategy(self): """depends on config""" if self.config.authPolicy == LOCAL_AUTH_POLICY: return LocalAuthStrategy(auth_map=self.auth_map, anyone_can_write_map=self.anyone_can_write_map if self.anyone_can_write else None) elif self.c...
[ "depends", "on", "config" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_common/authorize/auth_request_validator.py#L75-L85
[ "def", "create_auth_strategy", "(", "self", ")", ":", "if", "self", ".", "config", ".", "authPolicy", "==", "LOCAL_AUTH_POLICY", ":", "return", "LocalAuthStrategy", "(", "auth_map", "=", "self", ".", "auth_map", ",", "anyone_can_write_map", "=", "self", ".", "...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
DomainReqHandler.gen_txn_path
Return path to state as 'str' type or None
indy_node/server/domain_req_handler.py
def gen_txn_path(self, txn): """Return path to state as 'str' type or None""" txn_type = get_type(txn) if txn_type not in self.state_update_handlers: logger.error('Cannot generate id for txn of type {}'.format(txn_type)) return None if txn_type == NYM: ...
def gen_txn_path(self, txn): """Return path to state as 'str' type or None""" txn_type = get_type(txn) if txn_type not in self.state_update_handlers: logger.error('Cannot generate id for txn of type {}'.format(txn_type)) return None if txn_type == NYM: ...
[ "Return", "path", "to", "state", "as", "str", "type", "or", "None" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/domain_req_handler.py#L86-L114
[ "def", "gen_txn_path", "(", "self", ",", "txn", ")", ":", "txn_type", "=", "get_type", "(", "txn", ")", "if", "txn_type", "not", "in", "self", ".", "state_update_handlers", ":", "logger", ".", "error", "(", "'Cannot generate id for txn of type {}'", ".", "form...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
DomainReqHandler.handleGetRevocRegDelta
For getting reply we need: 1. Get REVOC_REG_ENTRY by "TO" timestamp from state 2. If FROM is given in request, then Get REVOC_REG_ENTRY by "FROM" timestamp from state 3. Get ISSUANCE_TYPE for REVOC_REG_DEF (revoked/issued strategy) 4. Compute issued and revoked indices by corresponding s...
indy_node/server/domain_req_handler.py
def handleGetRevocRegDelta(self, request: Request): """ For getting reply we need: 1. Get REVOC_REG_ENTRY by "TO" timestamp from state 2. If FROM is given in request, then Get REVOC_REG_ENTRY by "FROM" timestamp from state 3. Get ISSUANCE_TYPE for REVOC_REG_DEF (revoked/issued st...
def handleGetRevocRegDelta(self, request: Request): """ For getting reply we need: 1. Get REVOC_REG_ENTRY by "TO" timestamp from state 2. If FROM is given in request, then Get REVOC_REG_ENTRY by "FROM" timestamp from state 3. Get ISSUANCE_TYPE for REVOC_REG_DEF (revoked/issued st...
[ "For", "getting", "reply", "we", "need", ":", "1", ".", "Get", "REVOC_REG_ENTRY", "by", "TO", "timestamp", "from", "state", "2", ".", "If", "FROM", "is", "given", "in", "request", "then", "Get", "REVOC_REG_ENTRY", "by", "FROM", "timestamp", "from", "state"...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/domain_req_handler.py#L639-L722
[ "def", "handleGetRevocRegDelta", "(", "self", ",", "request", ":", "Request", ")", ":", "req_ts_from", "=", "request", ".", "operation", ".", "get", "(", "FROM", ",", "None", ")", "req_ts_to", "=", "request", ".", "operation", ".", "get", "(", "TO", ")",...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
DomainReqHandler.lookup
Queries state for data on specified path :param path: path to data :param isCommitted: queries the committed state root if True else the uncommitted root :param with_proof: creates proof if True :return: data
indy_node/server/domain_req_handler.py
def lookup(self, path, isCommitted=True, with_proof=False) -> (str, int): """ Queries state for data on specified path :param path: path to data :param isCommitted: queries the committed state root if True else the uncommitted root :param with_proof: creates proof if True ...
def lookup(self, path, isCommitted=True, with_proof=False) -> (str, int): """ Queries state for data on specified path :param path: path to data :param isCommitted: queries the committed state root if True else the uncommitted root :param with_proof: creates proof if True ...
[ "Queries", "state", "for", "data", "on", "specified", "path" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/domain_req_handler.py#L753-L768
[ "def", "lookup", "(", "self", ",", "path", ",", "isCommitted", "=", "True", ",", "with_proof", "=", "False", ")", "->", "(", "str", ",", "int", ")", ":", "assert", "path", "is", "not", "None", "head_hash", "=", "self", ".", "state", ".", "committedHe...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
DomainReqHandler._addAttr
The state trie stores the hash of the whole attribute data at: the did+attribute name if the data is plaintext (RAW) the did+hash(attribute) if the data is encrypted (ENC) If the attribute is HASH, then nothing is stored in attribute store, the trie stores a blank value for the k...
indy_node/server/domain_req_handler.py
def _addAttr(self, txn, isCommitted=False) -> None: """ The state trie stores the hash of the whole attribute data at: the did+attribute name if the data is plaintext (RAW) the did+hash(attribute) if the data is encrypted (ENC) If the attribute is HASH, then nothing is st...
def _addAttr(self, txn, isCommitted=False) -> None: """ The state trie stores the hash of the whole attribute data at: the did+attribute name if the data is plaintext (RAW) the did+hash(attribute) if the data is encrypted (ENC) If the attribute is HASH, then nothing is st...
[ "The", "state", "trie", "stores", "the", "hash", "of", "the", "whole", "attribute", "data", "at", ":", "the", "did", "+", "attribute", "name", "if", "the", "data", "is", "plaintext", "(", "RAW", ")", "the", "did", "+", "hash", "(", "attribute", ")", ...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/domain_req_handler.py#L784-L796
[ "def", "_addAttr", "(", "self", ",", "txn", ",", "isCommitted", "=", "False", ")", "->", "None", ":", "assert", "get_type", "(", "txn", ")", "==", "ATTRIB", "attr_type", ",", "path", ",", "value", ",", "hashed_value", ",", "value_bytes", "=", "domain", ...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
DomainReqHandler.transform_txn_for_ledger
Some transactions need to be transformed before they can be stored in the ledger, eg. storing certain payload in another data store and only its hash in the ledger
indy_node/server/domain_req_handler.py
def transform_txn_for_ledger(txn): """ Some transactions need to be transformed before they can be stored in the ledger, eg. storing certain payload in another data store and only its hash in the ledger """ if get_type(txn) == ATTRIB: txn = DomainReqHandler.tr...
def transform_txn_for_ledger(txn): """ Some transactions need to be transformed before they can be stored in the ledger, eg. storing certain payload in another data store and only its hash in the ledger """ if get_type(txn) == ATTRIB: txn = DomainReqHandler.tr...
[ "Some", "transactions", "need", "to", "be", "transformed", "before", "they", "can", "be", "stored", "in", "the", "ledger", "eg", ".", "storing", "certain", "payload", "in", "another", "data", "store", "and", "only", "its", "hash", "in", "the", "ledger" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/domain_req_handler.py#L930-L938
[ "def", "transform_txn_for_ledger", "(", "txn", ")", ":", "if", "get_type", "(", "txn", ")", "==", "ATTRIB", ":", "txn", "=", "DomainReqHandler", ".", "transform_attrib_for_ledger", "(", "txn", ")", "return", "txn" ]
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
DomainReqHandler.transform_attrib_for_ledger
Creating copy of result so that `RAW`, `ENC` or `HASH` can be replaced by their hashes. We do not insert actual attribute data in the ledger but only the hash of it.
indy_node/server/domain_req_handler.py
def transform_attrib_for_ledger(txn): """ Creating copy of result so that `RAW`, `ENC` or `HASH` can be replaced by their hashes. We do not insert actual attribute data in the ledger but only the hash of it. """ txn = deepcopy(txn) txn_data = get_payload_data(txn)...
def transform_attrib_for_ledger(txn): """ Creating copy of result so that `RAW`, `ENC` or `HASH` can be replaced by their hashes. We do not insert actual attribute data in the ledger but only the hash of it. """ txn = deepcopy(txn) txn_data = get_payload_data(txn)...
[ "Creating", "copy", "of", "result", "so", "that", "RAW", "ENC", "or", "HASH", "can", "be", "replaced", "by", "their", "hashes", ".", "We", "do", "not", "insert", "actual", "attribute", "data", "in", "the", "ledger", "but", "only", "the", "hash", "of", ...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/domain_req_handler.py#L941-L953
[ "def", "transform_attrib_for_ledger", "(", "txn", ")", ":", "txn", "=", "deepcopy", "(", "txn", ")", "txn_data", "=", "get_payload_data", "(", "txn", ")", "attr_type", ",", "_", ",", "value", "=", "domain", ".", "parse_attr_txn", "(", "txn_data", ")", "if"...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
getSymmetricallyEncryptedVal
Encrypt the provided value with symmetric encryption :param val: the value to encrypt :param secretKey: Optional key, if provided should be either in hex or bytes :return: Tuple of the encrypted value and secret key encoded in hex
indy_common/util.py
def getSymmetricallyEncryptedVal(val, secretKey: Union[str, bytes] = None) -> \ Tuple[str, str]: """ Encrypt the provided value with symmetric encryption :param val: the value to encrypt :param secretKey: Optional key, if provided should be either in hex or bytes :return: Tuple of the encry...
def getSymmetricallyEncryptedVal(val, secretKey: Union[str, bytes] = None) -> \ Tuple[str, str]: """ Encrypt the provided value with symmetric encryption :param val: the value to encrypt :param secretKey: Optional key, if provided should be either in hex or bytes :return: Tuple of the encry...
[ "Encrypt", "the", "provided", "value", "with", "symmetric", "encryption" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_common/util.py#L33-L54
[ "def", "getSymmetricallyEncryptedVal", "(", "val", ",", "secretKey", ":", "Union", "[", "str", ",", "bytes", "]", "=", "None", ")", "->", "Tuple", "[", "str", ",", "str", "]", ":", "if", "isinstance", "(", "val", ",", "str", ")", ":", "val", "=", "...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
getIndex
Finds the index of an item in list, which satisfies predicate :param predicateFn: predicate function to run on items of list :param items: list of tuples :return: first index for which predicate function returns True
indy_common/util.py
def getIndex(predicateFn: Callable[[T], bool], items: List[T]) -> int: """ Finds the index of an item in list, which satisfies predicate :param predicateFn: predicate function to run on items of list :param items: list of tuples :return: first index for which predicate function returns True """ ...
def getIndex(predicateFn: Callable[[T], bool], items: List[T]) -> int: """ Finds the index of an item in list, which satisfies predicate :param predicateFn: predicate function to run on items of list :param items: list of tuples :return: first index for which predicate function returns True """ ...
[ "Finds", "the", "index", "of", "an", "item", "in", "list", "which", "satisfies", "predicate", ":", "param", "predicateFn", ":", "predicate", "function", "to", "run", "on", "items", "of", "list", ":", "param", "items", ":", "list", "of", "tuples", ":", "r...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_common/util.py#L130-L140
[ "def", "getIndex", "(", "predicateFn", ":", "Callable", "[", "[", "T", "]", ",", "bool", "]", ",", "items", ":", "List", "[", "T", "]", ")", "->", "int", ":", "try", ":", "return", "next", "(", "i", "for", "i", ",", "v", "in", "enumerate", "(",...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Setup.setupTxns
Create base transactions :param key: ledger :param force: replace existing transaction files
indy_common/setup_util.py
def setupTxns(self, key, force: bool = False): """ Create base transactions :param key: ledger :param force: replace existing transaction files """ import data dataDir = os.path.dirname(data.__file__) # TODO: Need to get "test" and "live" from ENVS prope...
def setupTxns(self, key, force: bool = False): """ Create base transactions :param key: ledger :param force: replace existing transaction files """ import data dataDir = os.path.dirname(data.__file__) # TODO: Need to get "test" and "live" from ENVS prope...
[ "Create", "base", "transactions" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_common/setup_util.py#L25-L58
[ "def", "setupTxns", "(", "self", ",", "key", ",", "force", ":", "bool", "=", "False", ")", ":", "import", "data", "dataDir", "=", "os", ".", "path", ".", "dirname", "(", "data", ".", "__file__", ")", "# TODO: Need to get \"test\" and \"live\" from ENVS propert...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
getImageByTag
Check if an image with a given tag exists. No side-effects. Idempotent. Handles ImageNotFound and APIError exceptions, but only reraises APIError.
environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py
def getImageByTag(tag): '''Check if an image with a given tag exists. No side-effects. Idempotent. Handles ImageNotFound and APIError exceptions, but only reraises APIError. ''' require_str("tag", tag) image = None try: image = client.images.get(tag) print("Found image", tag, "....
def getImageByTag(tag): '''Check if an image with a given tag exists. No side-effects. Idempotent. Handles ImageNotFound and APIError exceptions, but only reraises APIError. ''' require_str("tag", tag) image = None try: image = client.images.get(tag) print("Found image", tag, "....
[ "Check", "if", "an", "image", "with", "a", "given", "tag", "exists", ".", "No", "side", "-", "effects", ".", "Idempotent", ".", "Handles", "ImageNotFound", "and", "APIError", "exceptions", "but", "only", "reraises", "APIError", "." ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py#L20-L36
[ "def", "getImageByTag", "(", "tag", ")", ":", "require_str", "(", "\"tag\"", ",", "tag", ")", "image", "=", "None", "try", ":", "image", "=", "client", ".", "images", ".", "get", "(", "tag", ")", "print", "(", "\"Found image\"", ",", "tag", ",", "\"....
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
getImage
Check if an image with a given tag exists. If not, build an image from using a given dockerfile in a given path, tagging it with a given tag. No extra side effects. Handles and reraises BuildError, TypeError, and APIError exceptions.
environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py
def getImage(path, dockerfile, tag): '''Check if an image with a given tag exists. If not, build an image from using a given dockerfile in a given path, tagging it with a given tag. No extra side effects. Handles and reraises BuildError, TypeError, and APIError exceptions. ''' image = getImageBy...
def getImage(path, dockerfile, tag): '''Check if an image with a given tag exists. If not, build an image from using a given dockerfile in a given path, tagging it with a given tag. No extra side effects. Handles and reraises BuildError, TypeError, and APIError exceptions. ''' image = getImageBy...
[ "Check", "if", "an", "image", "with", "a", "given", "tag", "exists", ".", "If", "not", "build", "an", "image", "from", "using", "a", "given", "dockerfile", "in", "a", "given", "path", "tagging", "it", "with", "a", "given", "tag", ".", "No", "extra", ...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py#L38-L64
[ "def", "getImage", "(", "path", ",", "dockerfile", ",", "tag", ")", ":", "image", "=", "getImageByTag", "(", "tag", ")", "if", "not", "image", ":", "# Build an Image using the dockerfile in the path", "try", ":", "image", "=", "client", ".", "images", ".", "...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
runContainer
Run a docker container using a given image; passing keyword arguments documented to be accepted by docker's client.containers.run function No extra side effects. Handles and reraises ContainerError, ImageNotFound, and APIError exceptions.
environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py
def runContainer(image, **kwargs): '''Run a docker container using a given image; passing keyword arguments documented to be accepted by docker's client.containers.run function No extra side effects. Handles and reraises ContainerError, ImageNotFound, and APIError exceptions. ''' container = Non...
def runContainer(image, **kwargs): '''Run a docker container using a given image; passing keyword arguments documented to be accepted by docker's client.containers.run function No extra side effects. Handles and reraises ContainerError, ImageNotFound, and APIError exceptions. ''' container = Non...
[ "Run", "a", "docker", "container", "using", "a", "given", "image", ";", "passing", "keyword", "arguments", "documented", "to", "be", "accepted", "by", "docker", "s", "client", ".", "containers", ".", "run", "function", "No", "extra", "side", "effects", ".", ...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py#L66-L87
[ "def", "runContainer", "(", "image", ",", "*", "*", "kwargs", ")", ":", "container", "=", "None", "try", ":", "container", "=", "client", ".", "containers", ".", "run", "(", "image", ",", "*", "*", "kwargs", ")", "if", "\"name\"", "in", "kwargs", "."...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
getContainer
Get the container with the given name or ID (str). No side effects. Idempotent. Returns None if the container does not exist. Otherwise, the continer is returned
environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py
def getContainer(name_or_id): '''Get the container with the given name or ID (str). No side effects. Idempotent. Returns None if the container does not exist. Otherwise, the continer is returned''' require_str("name_or_id", name_or_id) container = None try: container = client.containers...
def getContainer(name_or_id): '''Get the container with the given name or ID (str). No side effects. Idempotent. Returns None if the container does not exist. Otherwise, the continer is returned''' require_str("name_or_id", name_or_id) container = None try: container = client.containers...
[ "Get", "the", "container", "with", "the", "given", "name", "or", "ID", "(", "str", ")", ".", "No", "side", "effects", ".", "Idempotent", ".", "Returns", "None", "if", "the", "container", "does", "not", "exist", ".", "Otherwise", "the", "continer", "is", ...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py#L89-L105
[ "def", "getContainer", "(", "name_or_id", ")", ":", "require_str", "(", "\"name_or_id\"", ",", "name_or_id", ")", "container", "=", "None", "try", ":", "container", "=", "client", ".", "containers", ".", "get", "(", "name_or_id", ")", "except", "NotFound", "...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
containerIsRunning
Check if container with the given name or ID (str) is running. No side effects. Idempotent. Returns True if running, False if not.
environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py
def containerIsRunning(name_or_id): '''Check if container with the given name or ID (str) is running. No side effects. Idempotent. Returns True if running, False if not.''' require_str("name_or_id", name_or_id) try: container = getContainer(name_or_id) # Refer to the latest status list ...
def containerIsRunning(name_or_id): '''Check if container with the given name or ID (str) is running. No side effects. Idempotent. Returns True if running, False if not.''' require_str("name_or_id", name_or_id) try: container = getContainer(name_or_id) # Refer to the latest status list ...
[ "Check", "if", "container", "with", "the", "given", "name", "or", "ID", "(", "str", ")", "is", "running", ".", "No", "side", "effects", ".", "Idempotent", ".", "Returns", "True", "if", "running", "False", "if", "not", "." ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py#L107-L136
[ "def", "containerIsRunning", "(", "name_or_id", ")", ":", "require_str", "(", "\"name_or_id\"", ",", "name_or_id", ")", "try", ":", "container", "=", "getContainer", "(", "name_or_id", ")", "# Refer to the latest status list here: https://docs.docker.com/engine/", "# api/...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
getContainerByTag
Check if a container with a given tag exists. No side-effects. Idempotent. Handles NotFound and APIError exceptions, but only reraises APIError. Returns None if the container is not found. Otherwise, returns the container.
environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py
def getContainerByTag(tag): '''Check if a container with a given tag exists. No side-effects. Idempotent. Handles NotFound and APIError exceptions, but only reraises APIError. Returns None if the container is not found. Otherwise, returns the container.''' require_str("tag", tag) container = No...
def getContainerByTag(tag): '''Check if a container with a given tag exists. No side-effects. Idempotent. Handles NotFound and APIError exceptions, but only reraises APIError. Returns None if the container is not found. Otherwise, returns the container.''' require_str("tag", tag) container = No...
[ "Check", "if", "a", "container", "with", "a", "given", "tag", "exists", ".", "No", "side", "-", "effects", ".", "Idempotent", ".", "Handles", "NotFound", "and", "APIError", "exceptions", "but", "only", "reraises", "APIError", ".", "Returns", "None", "if", ...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py#L138-L156
[ "def", "getContainerByTag", "(", "tag", ")", ":", "require_str", "(", "\"tag\"", ",", "tag", ")", "container", "=", "None", "try", ":", "container", "=", "client", ".", "containers", ".", "get", "(", "tag", ")", "print", "(", "\"Found container\"", ",", ...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
removeContainer
Check if a container with a given tag exists. Kill it if it exists. No extra side effects. Handles and reraises TypeError, and APIError exceptions.
environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py
def removeContainer(tag): '''Check if a container with a given tag exists. Kill it if it exists. No extra side effects. Handles and reraises TypeError, and APIError exceptions. ''' container = getContainerByTag(tag) if container: # Build an Image using the dockerfile in the path ...
def removeContainer(tag): '''Check if a container with a given tag exists. Kill it if it exists. No extra side effects. Handles and reraises TypeError, and APIError exceptions. ''' container = getContainerByTag(tag) if container: # Build an Image using the dockerfile in the path ...
[ "Check", "if", "a", "container", "with", "a", "given", "tag", "exists", ".", "Kill", "it", "if", "it", "exists", ".", "No", "extra", "side", "effects", ".", "Handles", "and", "reraises", "TypeError", "and", "APIError", "exceptions", "." ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py#L158-L172
[ "def", "removeContainer", "(", "tag", ")", ":", "container", "=", "getContainerByTag", "(", "tag", ")", "if", "container", ":", "# Build an Image using the dockerfile in the path", "try", ":", "container", ".", "remove", "(", "force", "=", "True", ")", "#print(\"R...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
startIndyPool
Start the indy_pool docker container iff it is not already running. See <indy-sdk>/ci/indy-pool.dockerfile for details. Idempotent. Simply ensures that the indy_pool container is up and running.
environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py
def startIndyPool(**kwargs): '''Start the indy_pool docker container iff it is not already running. See <indy-sdk>/ci/indy-pool.dockerfile for details. Idempotent. Simply ensures that the indy_pool container is up and running.''' # TODO: Decide if we need a separate docker container for testing and one...
def startIndyPool(**kwargs): '''Start the indy_pool docker container iff it is not already running. See <indy-sdk>/ci/indy-pool.dockerfile for details. Idempotent. Simply ensures that the indy_pool container is up and running.''' # TODO: Decide if we need a separate docker container for testing and one...
[ "Start", "the", "indy_pool", "docker", "container", "iff", "it", "is", "not", "already", "running", ".", "See", "<indy", "-", "sdk", ">", "/", "ci", "/", "indy", "-", "pool", ".", "dockerfile", "for", "details", ".", "Idempotent", ".", "Simply", "ensures...
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py#L174-L242
[ "def", "startIndyPool", "(", "*", "*", "kwargs", ")", ":", "# TODO: Decide if we need a separate docker container for testing and one for", "# development. The indy_sdk tests setup and teardown \"indy_pool\" on", "# ports 9701-9708. Perhaps we need an \"indy_dev_pool\" on 9709-9716? ...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
restartIndyPool
Restart the indy_pool docker container. Idempotent. Ensures that the indy_pool container is a new running instance.
environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py
def restartIndyPool(**kwargs): '''Restart the indy_pool docker container. Idempotent. Ensures that the indy_pool container is a new running instance.''' print("Restarting...") try: stopIndyPool() startIndyPool() print("...restarted") except Exception as exc: eprint("...failed...
def restartIndyPool(**kwargs): '''Restart the indy_pool docker container. Idempotent. Ensures that the indy_pool container is a new running instance.''' print("Restarting...") try: stopIndyPool() startIndyPool() print("...restarted") except Exception as exc: eprint("...failed...
[ "Restart", "the", "indy_pool", "docker", "container", ".", "Idempotent", ".", "Ensures", "that", "the", "indy_pool", "container", "is", "a", "new", "running", "instance", "." ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py#L263-L273
[ "def", "restartIndyPool", "(", "*", "*", "kwargs", ")", ":", "print", "(", "\"Restarting...\"", ")", "try", ":", "stopIndyPool", "(", ")", "startIndyPool", "(", ")", "print", "(", "\"...restarted\"", ")", "except", "Exception", "as", "exc", ":", "eprint", ...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Request.signingPayloadState
Special signing state where the the data for an attribute is hashed before signing :return: state to be used when signing
indy_common/types.py
def signingPayloadState(self, identifier=None): """ Special signing state where the the data for an attribute is hashed before signing :return: state to be used when signing """ if self.operation.get(TXN_TYPE) == ATTRIB: d = deepcopy(super().signingPayloadStat...
def signingPayloadState(self, identifier=None): """ Special signing state where the the data for an attribute is hashed before signing :return: state to be used when signing """ if self.operation.get(TXN_TYPE) == ATTRIB: d = deepcopy(super().signingPayloadStat...
[ "Special", "signing", "state", "where", "the", "the", "data", "for", "an", "attribute", "is", "hashed", "before", "signing", ":", "return", ":", "state", "to", "be", "used", "when", "signing" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_common/types.py#L45-L57
[ "def", "signingPayloadState", "(", "self", ",", "identifier", "=", "None", ")", ":", "if", "self", ".", "operation", ".", "get", "(", "TXN_TYPE", ")", "==", "ATTRIB", ":", "d", "=", "deepcopy", "(", "super", "(", ")", ".", "signingPayloadState", "(", "...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
_migrate_ledger
Test for the directory, open old and new ledger, migrate data, rename directories
data/migrations/deb/disabled_1_0_97_to_1_0_96.py
def _migrate_ledger(data_directory, old_ledger_file, new_ledger_file, serializer: MappingSerializer = None): """ Test for the directory, open old and new ledger, migrate data, rename directories """ # we should have ChunkedFileStorage implementation of the Ledger...
def _migrate_ledger(data_directory, old_ledger_file, new_ledger_file, serializer: MappingSerializer = None): """ Test for the directory, open old and new ledger, migrate data, rename directories """ # we should have ChunkedFileStorage implementation of the Ledger...
[ "Test", "for", "the", "directory", "open", "old", "and", "new", "ledger", "migrate", "data", "rename", "directories" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/data/migrations/deb/disabled_1_0_97_to_1_0_96.py#L23-L72
[ "def", "_migrate_ledger", "(", "data_directory", ",", "old_ledger_file", ",", "new_ledger_file", ",", "serializer", ":", "MappingSerializer", "=", "None", ")", ":", "# we should have ChunkedFileStorage implementation of the Ledger", "if", "not", "os", ".", "path", ".", ...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
RolesAuthorizer.get_role
None roles are stored as empty strings, so the role returned as None by this function means that corresponding DID is not stored in a ledger.
indy_common/authorize/authorizer.py
def get_role(self, request: Request): """ None roles are stored as empty strings, so the role returned as None by this function means that corresponding DID is not stored in a ledger. """ idr = request.identifier return self._get_role(idr)
def get_role(self, request: Request): """ None roles are stored as empty strings, so the role returned as None by this function means that corresponding DID is not stored in a ledger. """ idr = request.identifier return self._get_role(idr)
[ "None", "roles", "are", "stored", "as", "empty", "strings", "so", "the", "role", "returned", "as", "None", "by", "this", "function", "means", "that", "corresponding", "DID", "is", "not", "stored", "in", "a", "ledger", "." ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_common/authorize/authorizer.py#L41-L47
[ "def", "get_role", "(", "self", ",", "request", ":", "Request", ")", ":", "idr", "=", "request", ".", "identifier", "return", "self", ".", "_get_role", "(", "idr", ")" ]
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
PoolConfig.handleConfigTxn
Handles transaction of type POOL_CONFIG :param txn:
indy_node/server/pool_config.py
def handleConfigTxn(self, txn) -> None: """ Handles transaction of type POOL_CONFIG :param txn: """ if get_type(txn) == POOL_CONFIG: self.writes = get_payload_data(txn)[WRITES]
def handleConfigTxn(self, txn) -> None: """ Handles transaction of type POOL_CONFIG :param txn: """ if get_type(txn) == POOL_CONFIG: self.writes = get_payload_data(txn)[WRITES]
[ "Handles", "transaction", "of", "type", "POOL_CONFIG" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/pool_config.py#L17-L24
[ "def", "handleConfigTxn", "(", "self", ",", "txn", ")", "->", "None", ":", "if", "get_type", "(", "txn", ")", "==", "POOL_CONFIG", ":", "self", ".", "writes", "=", "get_payload_data", "(", "txn", ")", "[", "WRITES", "]" ]
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
PoolConfig.processLedger
Checks ledger config txns and perfomes recent one :return:
indy_node/server/pool_config.py
def processLedger(self) -> None: """ Checks ledger config txns and perfomes recent one :return: """ logger.debug('{} processing config ledger for any POOL_CONFIGs'.format( self), extra={"tags": ["pool-config"]}) for _, txn in self.ledger.getAllTxn(): ...
def processLedger(self) -> None: """ Checks ledger config txns and perfomes recent one :return: """ logger.debug('{} processing config ledger for any POOL_CONFIGs'.format( self), extra={"tags": ["pool-config"]}) for _, txn in self.ledger.getAllTxn(): ...
[ "Checks", "ledger", "config", "txns", "and", "perfomes", "recent", "one" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/pool_config.py#L28-L38
[ "def", "processLedger", "(", "self", ")", "->", "None", ":", "logger", ".", "debug", "(", "'{} processing config ledger for any POOL_CONFIGs'", ".", "format", "(", "self", ")", ",", "extra", "=", "{", "\"tags\"", ":", "[", "\"pool-config\"", "]", "}", ")", "...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Restarter.handleRestartRequest
Handles transaction of type POOL_RESTART Can schedule or cancel restart to a newer version at specified time :param req:
indy_node/server/restarter.py
def handleRestartRequest(self, req: Request) -> None: """ Handles transaction of type POOL_RESTART Can schedule or cancel restart to a newer version at specified time :param req: """ txn = req.operation if txn[TXN_TYPE] != POOL_RESTART: return...
def handleRestartRequest(self, req: Request) -> None: """ Handles transaction of type POOL_RESTART Can schedule or cancel restart to a newer version at specified time :param req: """ txn = req.operation if txn[TXN_TYPE] != POOL_RESTART: return...
[ "Handles", "transaction", "of", "type", "POOL_RESTART", "Can", "schedule", "or", "cancel", "restart", "to", "a", "newer", "version", "at", "specified", "time" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/restarter.py#L54-L84
[ "def", "handleRestartRequest", "(", "self", ",", "req", ":", "Request", ")", "->", "None", ":", "txn", "=", "req", ".", "operation", "if", "txn", "[", "TXN_TYPE", "]", "!=", "POOL_RESTART", ":", "return", "action", "=", "txn", "[", "ACTION", "]", "if",...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Restarter._scheduleRestart
Schedules node restart to a newer version :param version: version to restart to :param when: restart time
indy_node/server/restarter.py
def _scheduleRestart(self, when: Union[datetime, str], failTimeout) -> None: """ Schedules node restart to a newer version :param version: version to restart to :param when: restart time """ logger.info("{}'s restarter pr...
def _scheduleRestart(self, when: Union[datetime, str], failTimeout) -> None: """ Schedules node restart to a newer version :param version: version to restart to :param when: restart time """ logger.info("{}'s restarter pr...
[ "Schedules", "node", "restart", "to", "a", "newer", "version" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/restarter.py#L115-L143
[ "def", "_scheduleRestart", "(", "self", ",", "when", ":", "Union", "[", "datetime", ",", "str", "]", ",", "failTimeout", ")", "->", "None", ":", "logger", ".", "info", "(", "\"{}'s restarter processing restart\"", ".", "format", "(", "self", ")", ")", "if"...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Restarter._cancelScheduledRestart
Cancels scheduled restart :param when: time restart was scheduled to :param version: version restart scheduled for
indy_node/server/restarter.py
def _cancelScheduledRestart(self, justification=None) -> None: """ Cancels scheduled restart :param when: time restart was scheduled to :param version: version restart scheduled for """ if self.scheduledAction: why_prefix = ": " why = justificati...
def _cancelScheduledRestart(self, justification=None) -> None: """ Cancels scheduled restart :param when: time restart was scheduled to :param version: version restart scheduled for """ if self.scheduledAction: why_prefix = ": " why = justificati...
[ "Cancels", "scheduled", "restart" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/restarter.py#L145-L175
[ "def", "_cancelScheduledRestart", "(", "self", ",", "justification", "=", "None", ")", "->", "None", ":", "if", "self", ".", "scheduledAction", ":", "why_prefix", "=", "\": \"", "why", "=", "justification", "if", "justification", "is", "None", ":", "why_prefix...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Restarter._callRestartAgent
Callback which is called when restart time come. Writes restart record to restart log and asks node control service to perform restart :param ev_data: restart event data :param version: version to restart to
indy_node/server/restarter.py
def _callRestartAgent(self, ev_data: RestartLogData, failTimeout) -> None: """ Callback which is called when restart time come. Writes restart record to restart log and asks node control service to perform restart :param ev_data: restart event data :param version: versio...
def _callRestartAgent(self, ev_data: RestartLogData, failTimeout) -> None: """ Callback which is called when restart time come. Writes restart record to restart log and asks node control service to perform restart :param ev_data: restart event data :param version: versio...
[ "Callback", "which", "is", "called", "when", "restart", "time", "come", ".", "Writes", "restart", "record", "to", "restart", "log", "and", "asks", "node", "control", "service", "to", "perform", "restart" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/restarter.py#L177-L192
[ "def", "_callRestartAgent", "(", "self", ",", "ev_data", ":", "RestartLogData", ",", "failTimeout", ")", "->", "None", ":", "logger", ".", "info", "(", "\"{}'s restart calling agent for restart\"", ".", "format", "(", "self", ")", ")", "self", ".", "_actionLog",...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Restarter._declareTimeoutExceeded
This function is called when time for restart is up
indy_node/server/restarter.py
def _declareTimeoutExceeded(self, ev_data: RestartLogData): """ This function is called when time for restart is up """ logger.info("Timeout exceeded for {}".format(ev_data.when)) last = self._actionLog.last_event if (last and last.ev_type == RestartLog.Events.failed and ...
def _declareTimeoutExceeded(self, ev_data: RestartLogData): """ This function is called when time for restart is up """ logger.info("Timeout exceeded for {}".format(ev_data.when)) last = self._actionLog.last_event if (last and last.ev_type == RestartLog.Events.failed and ...
[ "This", "function", "is", "called", "when", "time", "for", "restart", "is", "up" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/restarter.py#L219-L233
[ "def", "_declareTimeoutExceeded", "(", "self", ",", "ev_data", ":", "RestartLogData", ")", ":", "logger", ".", "info", "(", "\"Timeout exceeded for {}\"", ".", "format", "(", "ev_data", ".", "when", ")", ")", "last", "=", "self", ".", "_actionLog", ".", "las...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Upgrader.processLedger
Checks ledger for planned but not yet performed upgrades and schedules upgrade for the most recent one Assumption: Only version is enough to identify a release, no hash checking is done :return:
indy_node/server/upgrader.py
def processLedger(self) -> None: """ Checks ledger for planned but not yet performed upgrades and schedules upgrade for the most recent one Assumption: Only version is enough to identify a release, no hash checking is done :return: """ logger.debug( ...
def processLedger(self) -> None: """ Checks ledger for planned but not yet performed upgrades and schedules upgrade for the most recent one Assumption: Only version is enough to identify a release, no hash checking is done :return: """ logger.debug( ...
[ "Checks", "ledger", "for", "planned", "but", "not", "yet", "performed", "upgrades", "and", "schedules", "upgrade", "for", "the", "most", "recent", "one" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/upgrader.py#L152-L181
[ "def", "processLedger", "(", "self", ")", "->", "None", ":", "logger", ".", "debug", "(", "'{} processing config ledger for any upgrades'", ".", "format", "(", "self", ")", ")", "last_pool_upgrade_txn_start", "=", "self", ".", "get_upgrade_txn", "(", "lambda", "tx...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Upgrader.didLastExecutedUpgradeSucceeded
Checks last record in upgrade log to find out whether it is about scheduling upgrade. If so - checks whether current version is equals to the one in that record :returns: upgrade execution result
indy_node/server/upgrader.py
def didLastExecutedUpgradeSucceeded(self) -> bool: """ Checks last record in upgrade log to find out whether it is about scheduling upgrade. If so - checks whether current version is equals to the one in that record :returns: upgrade execution result """ lastEven...
def didLastExecutedUpgradeSucceeded(self) -> bool: """ Checks last record in upgrade log to find out whether it is about scheduling upgrade. If so - checks whether current version is equals to the one in that record :returns: upgrade execution result """ lastEven...
[ "Checks", "last", "record", "in", "upgrade", "log", "to", "find", "out", "whether", "it", "is", "about", "scheduling", "upgrade", ".", "If", "so", "-", "checks", "whether", "current", "version", "is", "equals", "to", "the", "one", "in", "that", "record" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/upgrader.py#L185-L205
[ "def", "didLastExecutedUpgradeSucceeded", "(", "self", ")", "->", "bool", ":", "lastEventInfo", "=", "self", ".", "lastActionEventInfo", "if", "lastEventInfo", ":", "ev_data", "=", "lastEventInfo", ".", "data", "currentPkgVersion", "=", "NodeControlUtil", ".", "curr...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Upgrader.handleUpgradeTxn
Handles transaction of type POOL_UPGRADE Can schedule or cancel upgrade to a newer version at specified time :param txn:
indy_node/server/upgrader.py
def handleUpgradeTxn(self, txn) -> None: """ Handles transaction of type POOL_UPGRADE Can schedule or cancel upgrade to a newer version at specified time :param txn: """ FINALIZING_EVENT_TYPES = [UpgradeLog.Events.succeeded, UpgradeLog.Events.failed] if ...
def handleUpgradeTxn(self, txn) -> None: """ Handles transaction of type POOL_UPGRADE Can schedule or cancel upgrade to a newer version at specified time :param txn: """ FINALIZING_EVENT_TYPES = [UpgradeLog.Events.succeeded, UpgradeLog.Events.failed] if ...
[ "Handles", "transaction", "of", "type", "POOL_UPGRADE", "Can", "schedule", "or", "cancel", "upgrade", "to", "a", "newer", "version", "at", "specified", "time" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/upgrader.py#L251-L334
[ "def", "handleUpgradeTxn", "(", "self", ",", "txn", ")", "->", "None", ":", "FINALIZING_EVENT_TYPES", "=", "[", "UpgradeLog", ".", "Events", ".", "succeeded", ",", "UpgradeLog", ".", "Events", ".", "failed", "]", "if", "get_type", "(", "txn", ")", "!=", ...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Upgrader._scheduleUpgrade
Schedules node upgrade to a newer version :param ev_data: upgrade event parameters
indy_node/server/upgrader.py
def _scheduleUpgrade(self, ev_data: UpgradeLogData, failTimeout) -> None: """ Schedules node upgrade to a newer version :param ev_data: upgrade event parameters """ logger.info( "{}'s upgrader processing upgrade for v...
def _scheduleUpgrade(self, ev_data: UpgradeLogData, failTimeout) -> None: """ Schedules node upgrade to a newer version :param ev_data: upgrade event parameters """ logger.info( "{}'s upgrader processing upgrade for v...
[ "Schedules", "node", "upgrade", "to", "a", "newer", "version" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/upgrader.py#L336-L361
[ "def", "_scheduleUpgrade", "(", "self", ",", "ev_data", ":", "UpgradeLogData", ",", "failTimeout", ")", "->", "None", ":", "logger", ".", "info", "(", "\"{}'s upgrader processing upgrade for version {}={}\"", ".", "format", "(", "self", ",", "ev_data", ".", "pkg_n...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Upgrader._cancelScheduledUpgrade
Cancels scheduled upgrade :param when: time upgrade was scheduled to :param version: version upgrade scheduled for
indy_node/server/upgrader.py
def _cancelScheduledUpgrade(self, justification=None) -> None: """ Cancels scheduled upgrade :param when: time upgrade was scheduled to :param version: version upgrade scheduled for """ if self.scheduledAction: why_prefix = ": " why = justificati...
def _cancelScheduledUpgrade(self, justification=None) -> None: """ Cancels scheduled upgrade :param when: time upgrade was scheduled to :param version: version upgrade scheduled for """ if self.scheduledAction: why_prefix = ": " why = justificati...
[ "Cancels", "scheduled", "upgrade" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/upgrader.py#L363-L399
[ "def", "_cancelScheduledUpgrade", "(", "self", ",", "justification", "=", "None", ")", "->", "None", ":", "if", "self", ".", "scheduledAction", ":", "why_prefix", "=", "\": \"", "why", "=", "justification", "if", "justification", "is", "None", ":", "why_prefix...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Upgrader._callUpgradeAgent
Callback which is called when upgrade time come. Writes upgrade record to upgrade log and asks node control service to perform upgrade :param when: upgrade time :param version: version to upgrade to
indy_node/server/upgrader.py
def _callUpgradeAgent(self, ev_data, failTimeout) -> None: """ Callback which is called when upgrade time come. Writes upgrade record to upgrade log and asks node control service to perform upgrade :param when: upgrade time :param version: version to upgrade to "...
def _callUpgradeAgent(self, ev_data, failTimeout) -> None: """ Callback which is called when upgrade time come. Writes upgrade record to upgrade log and asks node control service to perform upgrade :param when: upgrade time :param version: version to upgrade to "...
[ "Callback", "which", "is", "called", "when", "upgrade", "time", "come", ".", "Writes", "upgrade", "record", "to", "upgrade", "log", "and", "asks", "node", "control", "service", "to", "perform", "upgrade" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/upgrader.py#L401-L416
[ "def", "_callUpgradeAgent", "(", "self", ",", "ev_data", ",", "failTimeout", ")", "->", "None", ":", "logger", ".", "info", "(", "\"{}'s upgrader calling agent for upgrade\"", ".", "format", "(", "self", ")", ")", "self", ".", "_actionLog", ".", "append_started"...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Upgrader._declareTimeoutExceeded
This function is called when time for upgrade is up
indy_node/server/upgrader.py
def _declareTimeoutExceeded(self, ev_data: UpgradeLogData): """ This function is called when time for upgrade is up """ logger.info("Timeout exceeded for {}:{}" .format(ev_data.when, ev_data.version)) last = self._actionLog.last_event # TODO test this ...
def _declareTimeoutExceeded(self, ev_data: UpgradeLogData): """ This function is called when time for upgrade is up """ logger.info("Timeout exceeded for {}:{}" .format(ev_data.when, ev_data.version)) last = self._actionLog.last_event # TODO test this ...
[ "This", "function", "is", "called", "when", "time", "for", "upgrade", "is", "up" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/upgrader.py#L443-L458
[ "def", "_declareTimeoutExceeded", "(", "self", ",", "ev_data", ":", "UpgradeLogData", ")", ":", "logger", ".", "info", "(", "\"Timeout exceeded for {}:{}\"", ".", "format", "(", "ev_data", ".", "when", ",", "ev_data", ".", "version", ")", ")", "last", "=", "...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
Upgrader.isScheduleValid
Validates schedule of planned node upgrades :param schedule: dictionary of node ids and upgrade times :param node_srvs: dictionary of node ids and services :return: a 2-tuple of whether schedule valid or not and the reason
indy_node/server/upgrader.py
def isScheduleValid(self, schedule, node_srvs, force) -> (bool, str): """ Validates schedule of planned node upgrades :param schedule: dictionary of node ids and upgrade times :param node_srvs: dictionary of node ids and services :return: a 2-tuple of whether schedule valid or n...
def isScheduleValid(self, schedule, node_srvs, force) -> (bool, str): """ Validates schedule of planned node upgrades :param schedule: dictionary of node ids and upgrade times :param node_srvs: dictionary of node ids and services :return: a 2-tuple of whether schedule valid or n...
[ "Validates", "schedule", "of", "planned", "node", "upgrades" ]
hyperledger/indy-node
python
https://github.com/hyperledger/indy-node/blob/8fabd364eaf7d940a56df2911d9215b1e512a2de/indy_node/server/upgrader.py#L483-L516
[ "def", "isScheduleValid", "(", "self", ",", "schedule", ",", "node_srvs", ",", "force", ")", "->", "(", "bool", ",", "str", ")", ":", "# flag \"force=True\" ignore basic checks! only datetime format is", "# checked", "times", "=", "[", "]", "non_demoted_nodes", "=",...
8fabd364eaf7d940a56df2911d9215b1e512a2de
train
AuthorizationV1.get_token
Retrieves a temporary access token
ibm_watson/authorization_v1.py
def get_token(self, url): """ Retrieves a temporary access token """ # A hack to avoid url-encoding the url, since the authorization service # doesn't work with correctly encoded urls parsed_url = urlparse.urlsplit(url) parsed_url = parsed_url._replace(path='/aut...
def get_token(self, url): """ Retrieves a temporary access token """ # A hack to avoid url-encoding the url, since the authorization service # doesn't work with correctly encoded urls parsed_url = urlparse.urlsplit(url) parsed_url = parsed_url._replace(path='/aut...
[ "Retrieves", "a", "temporary", "access", "token" ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/authorization_v1.py#L51-L63
[ "def", "get_token", "(", "self", ",", "url", ")", ":", "# A hack to avoid url-encoding the url, since the authorization service", "# doesn't work with correctly encoded urls", "parsed_url", "=", "urlparse", ".", "urlsplit", "(", "url", ")", "parsed_url", "=", "parsed_url", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
TextToSpeechV1Adapter.synthesize_using_websocket
Synthesizes text to spoken audio using web sockets. It supports the use of the SSML <mark> element to identify the location of user-specified markers in the audio. It can also return timing information for all strings of the input text. Note:The service processes one request per connection. ...
ibm_watson/text_to_speech_adapter_v1.py
def synthesize_using_websocket(self, text, synthesize_callback, accept=None, voice=None, timings=None, customi...
def synthesize_using_websocket(self, text, synthesize_callback, accept=None, voice=None, timings=None, customi...
[ "Synthesizes", "text", "to", "spoken", "audio", "using", "web", "sockets", ".", "It", "supports", "the", "use", "of", "the", "SSML", "<mark", ">", "element", "to", "identify", "the", "location", "of", "user", "-", "specified", "markers", "in", "the", "audi...
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/text_to_speech_adapter_v1.py#L29-L115
[ "def", "synthesize_using_websocket", "(", "self", ",", "text", ",", "synthesize_callback", ",", "accept", "=", "None", ",", "voice", "=", "None", ",", "timings", "=", "None", ",", "customization_id", "=", "None", ",", "http_proxy_host", "=", "None", ",", "ht...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
VisualRecognitionV3.classify
Classify images. Classify images with built-in or custom classifiers. :param file images_file: An image file (.gif, .jpg, .png, .tif) or .zip file with images. Maximum image size is 10 MB. Include no more than 20 images and limit the .zip file to 100 MB. Encode the image and .zip file ...
ibm_watson/visual_recognition_v3.py
def classify(self, images_file=None, images_filename=None, images_file_content_type=None, url=None, threshold=None, owners=None, classifier_ids=None, accept_language=None, ...
def classify(self, images_file=None, images_filename=None, images_file_content_type=None, url=None, threshold=None, owners=None, classifier_ids=None, accept_language=None, ...
[ "Classify", "images", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/visual_recognition_v3.py#L94-L186
[ "def", "classify", "(", "self", ",", "images_file", "=", "None", ",", "images_filename", "=", "None", ",", "images_file_content_type", "=", "None", ",", "url", "=", "None", ",", "threshold", "=", "None", ",", "owners", "=", "None", ",", "classifier_ids", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
VisualRecognitionV3.create_classifier
Create a classifier. Train a new multi-faceted classifier on the uploaded image data. Create your custom classifier with positive or negative examples. Include at least two sets of examples, either two positive example files or one positive and one negative file. You can upload a maximu...
ibm_watson/visual_recognition_v3.py
def create_classifier(self, name, positive_examples, negative_examples=None, negative_examples_filename=None, **kwargs): """ Create a classifier. Train a new multi-f...
def create_classifier(self, name, positive_examples, negative_examples=None, negative_examples_filename=None, **kwargs): """ Create a classifier. Train a new multi-f...
[ "Create", "a", "classifier", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/visual_recognition_v3.py#L271-L351
[ "def", "create_classifier", "(", "self", ",", "name", ",", "positive_examples", ",", "negative_examples", "=", "None", ",", "negative_examples_filename", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "name", "is", "None", ":", "raise", "ValueError", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
VisualRecognitionV3.delete_classifier
Delete a classifier. :param str classifier_id: The ID of the classifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
ibm_watson/visual_recognition_v3.py
def delete_classifier(self, classifier_id, **kwargs): """ Delete a classifier. :param str classifier_id: The ID of the classifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. ...
def delete_classifier(self, classifier_id, **kwargs): """ Delete a classifier. :param str classifier_id: The ID of the classifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. ...
[ "Delete", "a", "classifier", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/visual_recognition_v3.py#L353-L383
[ "def", "delete_classifier", "(", "self", ",", "classifier_id", ",", "*", "*", "kwargs", ")", ":", "if", "classifier_id", "is", "None", ":", "raise", "ValueError", "(", "'classifier_id must be provided'", ")", "headers", "=", "{", "}", "if", "'headers'", "in", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
Class._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'class_name') and self.class_name is not None: _dict['class'] = self.class_name return _dict
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'class_name') and self.class_name is not None: _dict['class'] = self.class_name 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/visual_recognition_v3.py#L644-L649
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'class_name'", ")", "and", "self", ".", "class_name", "is", "not", "None", ":", "_dict", "[", "'class'", "]", "=", "self", ".", "class_name", "retur...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
ClassResult._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'class_name') and self.class_name is not None: _dict['class'] = self.class_name if hasattr(self, 'score') and self.score is not None: _dict['score'] = self.scor...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'class_name') and self.class_name is not None: _dict['class'] = self.class_name if hasattr(self, 'score') and self.score is not None: _dict['score'] = self.scor...
[ "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/visual_recognition_v3.py#L722-L731
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'class_name'", ")", "and", "self", ".", "class_name", "is", "not", "None", ":", "_dict", "[", "'class'", "]", "=", "self", ".", "class_name", "if", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
ClassifiedImage._from_dict
Initialize a ClassifiedImage object from a json dictionary.
ibm_watson/visual_recognition_v3.py
def _from_dict(cls, _dict): """Initialize a ClassifiedImage object from a json dictionary.""" args = {} if 'source_url' in _dict: args['source_url'] = _dict.get('source_url') if 'resolved_url' in _dict: args['resolved_url'] = _dict.get('resolved_url') if '...
def _from_dict(cls, _dict): """Initialize a ClassifiedImage object from a json dictionary.""" args = {} if 'source_url' in _dict: args['source_url'] = _dict.get('source_url') if 'resolved_url' in _dict: args['resolved_url'] = _dict.get('resolved_url') if '...
[ "Initialize", "a", "ClassifiedImage", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/visual_recognition_v3.py#L789-L809
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'source_url'", "in", "_dict", ":", "args", "[", "'source_url'", "]", "=", "_dict", ".", "get", "(", "'source_url'", ")", "if", "'resolved_url'", "in", "_dict", ":", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
ClassifiedImage._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'source_url') and self.source_url is not None: _dict['source_url'] = self.source_url if hasattr(self, 'resolved_url') and self.resolved_url is not None: _dict['...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'source_url') and self.source_url is not None: _dict['source_url'] = self.source_url if hasattr(self, 'resolved_url') and self.resolved_url 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/visual_recognition_v3.py#L811-L824
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'source_url'", ")", "and", "self", ".", "source_url", "is", "not", "None", ":", "_dict", "[", "'source_url'", "]", "=", "self", ".", "source_url", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
Classifier._from_dict
Initialize a Classifier object from a json dictionary.
ibm_watson/visual_recognition_v3.py
def _from_dict(cls, _dict): """Initialize a Classifier object from a json dictionary.""" args = {} if 'classifier_id' in _dict: args['classifier_id'] = _dict.get('classifier_id') else: raise ValueError( 'Required property \'classifier_id\' not pres...
def _from_dict(cls, _dict): """Initialize a Classifier object from a json dictionary.""" args = {} if 'classifier_id' in _dict: args['classifier_id'] = _dict.get('classifier_id') else: raise ValueError( 'Required property \'classifier_id\' not pres...
[ "Initialize", "a", "Classifier", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/visual_recognition_v3.py#L998-L1030
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'classifier_id'", "in", "_dict", ":", "args", "[", "'classifier_id'", "]", "=", "_dict", ".", "get", "(", "'classifier_id'", ")", "else", ":", "raise", "ValueError", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
Classifier._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'classifier_id') and self.classifier_id is not None: _dict['classifier_id'] = self.classifier_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, 'classifier_id') and self.classifier_id is not None: _dict['classifier_id'] = self.classifier_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/visual_recognition_v3.py#L1032-L1056
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'classifier_id'", ")", "and", "self", ".", "classifier_id", "is", "not", "None", ":", "_dict", "[", "'classifier_id'", "]", "=", "self", ".", "classif...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
ClassifierResult._from_dict
Initialize a ClassifierResult object from a json dictionary.
ibm_watson/visual_recognition_v3.py
def _from_dict(cls, _dict): """Initialize a ClassifierResult object from a json dictionary.""" args = {} if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( 'Required property \'name\' not present in ClassifierResult JSON' ...
def _from_dict(cls, _dict): """Initialize a ClassifierResult object from a json dictionary.""" args = {} if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( 'Required property \'name\' not present in ClassifierResult JSON' ...
[ "Initialize", "a", "ClassifierResult", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/visual_recognition_v3.py#L1095-L1118
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'name'", "in", "_dict", ":", "args", "[", "'name'", "]", "=", "_dict", ".", "get", "(", "'name'", ")", "else", ":", "raise", "ValueError", "(", "'Required property...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
ClassifierResult._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.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, 'classifier_id') and self.classifier_id is not None: _dict['classifier_id'] = self...
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, 'classifier_id') and self.classifier_id is not None: _dict['classifier_id'] = 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/visual_recognition_v3.py#L1120-L1129
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'name'", ")", "and", "self", ".", "name", "is", "not", "None", ":", "_dict", "[", "'name'", "]", "=", "self", ".", "name", "if", "hasattr", "(",...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
Classifiers._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'classifiers') and self.classifiers is not None: _dict['classifiers'] = [x._to_dict() for x in self.classifiers] return _dict
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'classifiers') and self.classifiers is not None: _dict['classifiers'] = [x._to_dict() for x in self.classifiers] 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/visual_recognition_v3.py#L1175-L1180
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'classifiers'", ")", "and", "self", ".", "classifiers", "is", "not", "None", ":", "_dict", "[", "'classifiers'", "]", "=", "[", "x", ".", "_to_dict"...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
DetectedFaces._from_dict
Initialize a DetectedFaces object from a json dictionary.
ibm_watson/visual_recognition_v3.py
def _from_dict(cls, _dict): """Initialize a DetectedFaces object from a json dictionary.""" args = {} if 'images_processed' in _dict: args['images_processed'] = _dict.get('images_processed') else: raise ValueError( 'Required property \'images_proce...
def _from_dict(cls, _dict): """Initialize a DetectedFaces object from a json dictionary.""" args = {} if 'images_processed' in _dict: args['images_processed'] = _dict.get('images_processed') else: raise ValueError( 'Required property \'images_proce...
[ "Initialize", "a", "DetectedFaces", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/visual_recognition_v3.py#L1225-L1246
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'images_processed'", "in", "_dict", ":", "args", "[", "'images_processed'", "]", "=", "_dict", ".", "get", "(", "'images_processed'", ")", "else", ":", "raise", "Value...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
DetectedFaces._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'images_processed') and self.images_processed is not None: _dict['images_processed'] = self.images_processed if hasattr(self, 'images') and self.images i...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'images_processed') and self.images_processed is not None: _dict['images_processed'] = self.images_processed if hasattr(self, 'images') and self.images 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/visual_recognition_v3.py#L1248-L1258
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'images_processed'", ")", "and", "self", ".", "images_processed", "is", "not", "None", ":", "_dict", "[", "'images_processed'", "]", "=", "self", ".", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
ErrorInfo._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'code') and self.code is not None: _dict['code'] = self.code if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.descr...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'code') and self.code is not None: _dict['code'] = self.code if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.descr...
[ "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/visual_recognition_v3.py#L1321-L1330
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'code'", ")", "and", "self", ".", "code", "is", "not", "None", ":", "_dict", "[", "'code'", "]", "=", "self", ".", "code", "if", "hasattr", "(",...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
Face._from_dict
Initialize a Face object from a json dictionary.
ibm_watson/visual_recognition_v3.py
def _from_dict(cls, _dict): """Initialize a Face object from a json dictionary.""" args = {} if 'age' in _dict: args['age'] = FaceAge._from_dict(_dict.get('age')) if 'gender' in _dict: args['gender'] = FaceGender._from_dict(_dict.get('gender')) if 'face_lo...
def _from_dict(cls, _dict): """Initialize a Face object from a json dictionary.""" args = {} if 'age' in _dict: args['age'] = FaceAge._from_dict(_dict.get('age')) if 'gender' in _dict: args['gender'] = FaceGender._from_dict(_dict.get('gender')) if 'face_lo...
[ "Initialize", "a", "Face", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/visual_recognition_v3.py#L1371-L1381
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'age'", "in", "_dict", ":", "args", "[", "'age'", "]", "=", "FaceAge", ".", "_from_dict", "(", "_dict", ".", "get", "(", "'age'", ")", ")", "if", "'gender'", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
Face._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'age') and self.age is not None: _dict['age'] = self.age._to_dict() if hasattr(self, 'gender') and self.gender is not None: _dict['gender'] = self.gender._to_di...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'age') and self.age is not None: _dict['age'] = self.age._to_dict() if hasattr(self, 'gender') and self.gender is not None: _dict['gender'] = self.gender._to_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/visual_recognition_v3.py#L1383-L1392
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'age'", ")", "and", "self", ".", "age", "is", "not", "None", ":", "_dict", "[", "'age'", "]", "=", "self", ".", "age", ".", "_to_dict", "(", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
FaceAge._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'min') and self.min is not None: _dict['min'] = self.min if hasattr(self, 'max') and self.max is not None: _dict['max'] = self.max if hasattr(self, 'sco...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'min') and self.min is not None: _dict['min'] = self.min if hasattr(self, 'max') and self.max is not None: _dict['max'] = self.max if hasattr(self, 'sco...
[ "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/visual_recognition_v3.py#L1447-L1456
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'min'", ")", "and", "self", ".", "min", "is", "not", "None", ":", "_dict", "[", "'min'", "]", "=", "self", ".", "min", "if", "hasattr", "(", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
FaceGender._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'gender') and self.gender is not None: _dict['gender'] = self.gender if hasattr(self, 'gender_label') and self.gender_label is not None: _dict['gender_label'] =...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'gender') and self.gender is not None: _dict['gender'] = self.gender if hasattr(self, 'gender_label') and self.gender_label is not None: _dict['gender_label'] =...
[ "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/visual_recognition_v3.py#L1520-L1529
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'gender'", ")", "and", "self", ".", "gender", "is", "not", "None", ":", "_dict", "[", "'gender'", "]", "=", "self", ".", "gender", "if", "hasattr"...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
FaceLocation._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'width') and self.width is not None: _dict['width'] = self.width if hasattr(self, 'height') and self.height is not None: _dict['height'] = self.height i...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'width') and self.width is not None: _dict['width'] = self.width if hasattr(self, 'height') and self.height is not None: _dict['height'] = self.height 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/visual_recognition_v3.py#L1596-L1607
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'width'", ")", "and", "self", ".", "width", "is", "not", "None", ":", "_dict", "[", "'width'", "]", "=", "self", ".", "width", "if", "hasattr", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
WarningInfo._to_dict
Return a json dictionary representing this model.
ibm_watson/visual_recognition_v3.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'warning_id') and self.warning_id is not None: _dict['warning_id'] = self.warning_id if hasattr(self, 'description') and self.description is not None: _dict['de...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'warning_id') and self.warning_id is not None: _dict['warning_id'] = self.warning_id if hasattr(self, 'description') and self.description is not None: _dict['de...
[ "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/visual_recognition_v3.py#L1750-L1757
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'warning_id'", ")", "and", "self", ".", "warning_id", "is", "not", "None", ":", "_dict", "[", "'warning_id'", "]", "=", "self", ".", "warning_id", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
AssistantV2.message
Send user input to assistant. Send user input to an assistant and receive a response. There is no rate limit for this operation. :param str assistant_id: Unique identifier of the assistant. You can find the assistant ID of an assistant on the **Assistants** tab of the Watson Assistant ...
ibm_watson/assistant_v2.py
def message(self, assistant_id, session_id, input=None, context=None, **kwargs): """ Send user input to assistant. Send user input to an assistant and receive a response. There is no rate limit for this oper...
def message(self, assistant_id, session_id, input=None, context=None, **kwargs): """ Send user input to assistant. Send user input to an assistant and receive a response. There is no rate limit for this oper...
[ "Send", "user", "input", "to", "assistant", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/assistant_v2.py#L190-L245
[ "def", "message", "(", "self", ",", "assistant_id", ",", "session_id", ",", "input", "=", "None", ",", "context", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "assistant_id", "is", "None", ":", "raise", "ValueError", "(", "'assistant_id must be pr...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
CaptureGroup._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'group') and self.group is not None: _dict['group'] = self.group if hasattr(self, 'location') and self.location is not None: _dict['location'] = self.location ...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'group') and self.group is not None: _dict['group'] = self.group if hasattr(self, 'location') and self.location is not None: _dict['location'] = self.location ...
[ "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/assistant_v2.py#L286-L293
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'group'", ")", "and", "self", ".", "group", "is", "not", "None", ":", "_dict", "[", "'group'", "]", "=", "self", ".", "group", "if", "hasattr", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
DialogLogMessage._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.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, 'message') and self.message is not None: _dict['message'] = self.message ...
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, 'message') and self.message is not None: _dict['message'] = self.message ...
[ "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/assistant_v2.py#L346-L353
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'level'", ")", "and", "self", ".", "level", "is", "not", "None", ":", "_dict", "[", "'level'", "]", "=", "self", ".", "level", "if", "hasattr", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
DialogNodeAction._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.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, 'action_type') and self.action_type is not None: _dict['type'] = self.action_type ...
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, 'action_type') and self.action_type is not None: _dict['type'] = self.action_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/assistant_v2.py#L432-L446
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'name'", ")", "and", "self", ".", "name", "is", "not", "None", ":", "_dict", "[", "'name'", "]", "=", "self", ".", "name", "if", "hasattr", "(",...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
DialogNodeOutputOptionsElementValue._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'input') and self.input is not None: _dict['input'] = self.input._to_dict() return _dict
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'input') and self.input is not None: _dict['input'] = self.input._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/assistant_v2.py#L551-L556
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'input'", ")", "and", "self", ".", "input", "is", "not", "None", ":", "_dict", "[", "'input'", "]", "=", "self", ".", "input", ".", "_to_dict", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
DialogNodesVisited._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'dialog_node') and self.dialog_node is not None: _dict['dialog_node'] = self.dialog_node if hasattr(self, 'title') and self.title is not None: _dict['title'] = ...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'dialog_node') and self.dialog_node is not None: _dict['dialog_node'] = self.dialog_node if hasattr(self, 'title') and self.title is not None: _dict['title'] = ...
[ "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/assistant_v2.py#L608-L617
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'dialog_node'", ")", "and", "self", ".", "dialog_node", "is", "not", "None", ":", "_dict", "[", "'dialog_node'", "]", "=", "self", ".", "dialog_node",...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
DialogSuggestion._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'label') and self.label is not None: _dict['label'] = self.label if hasattr(self, 'value') and self.value is not None: _dict['value'] = self.value._to_dict() ...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'label') and self.label is not None: _dict['label'] = self.label if hasattr(self, 'value') and self.value is not None: _dict['value'] = self.value._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/assistant_v2.py#L848-L857
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'label'", ")", "and", "self", ".", "label", "is", "not", "None", ":", "_dict", "[", "'label'", "]", "=", "self", ".", "label", "if", "hasattr", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageContext._from_dict
Initialize a MessageContext object from a json dictionary.
ibm_watson/assistant_v2.py
def _from_dict(cls, _dict): """Initialize a MessageContext object from a json dictionary.""" args = {} if 'global' in _dict: args['global_'] = MessageContextGlobal._from_dict( _dict.get('global')) if 'skills' in _dict: args['skills'] = MessageConte...
def _from_dict(cls, _dict): """Initialize a MessageContext object from a json dictionary.""" args = {} if 'global' in _dict: args['global_'] = MessageContextGlobal._from_dict( _dict.get('global')) if 'skills' in _dict: args['skills'] = MessageConte...
[ "Initialize", "a", "MessageContext", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/assistant_v2.py#L948-L957
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'global'", "in", "_dict", ":", "args", "[", "'global_'", "]", "=", "MessageContextGlobal", ".", "_from_dict", "(", "_dict", ".", "get", "(", "'global'", ")", ")", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageContext._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'global_') and self.global_ is not None: _dict['global'] = self.global_._to_dict() if hasattr(self, 'skills') and self.skills is not None: _dict['skills'] = sel...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'global_') and self.global_ is not None: _dict['global'] = self.global_._to_dict() if hasattr(self, 'skills') and self.skills is not None: _dict['skills'] = sel...
[ "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/assistant_v2.py#L959-L966
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'global_'", ")", "and", "self", ".", "global_", "is", "not", "None", ":", "_dict", "[", "'global'", "]", "=", "self", ".", "global_", ".", "_to_di...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageContextGlobal._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'system') and self.system is not None: _dict['system'] = self.system._to_dict() return _dict
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'system') and self.system is not None: _dict['system'] = self.system._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/assistant_v2.py#L1009-L1014
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'system'", ")", "and", "self", ".", "system", "is", "not", "None", ":", "_dict", "[", "'system'", "]", "=", "self", ".", "system", ".", "_to_dict"...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageContextGlobalSystem._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'timezone') and self.timezone is not None: _dict['timezone'] = self.timezone if hasattr(self, 'user_id') and self.user_id is not None: _dict['user_id'] = self.u...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'timezone') and self.timezone is not None: _dict['timezone'] = self.timezone if hasattr(self, 'user_id') and self.user_id is not None: _dict['user_id'] = self.u...
[ "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/assistant_v2.py#L1080-L1089
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'timezone'", ")", "and", "self", ".", "timezone", "is", "not", "None", ":", "_dict", "[", "'timezone'", "]", "=", "self", ".", "timezone", "if", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageInput._from_dict
Initialize a MessageInput object from a json dictionary.
ibm_watson/assistant_v2.py
def _from_dict(cls, _dict): """Initialize a MessageInput object from a json dictionary.""" args = {} if 'message_type' in _dict: args['message_type'] = _dict.get('message_type') if 'text' in _dict: args['text'] = _dict.get('text') if 'options' in _dict: ...
def _from_dict(cls, _dict): """Initialize a MessageInput object from a json dictionary.""" args = {} if 'message_type' in _dict: args['message_type'] = _dict.get('message_type') if 'text' in _dict: args['text'] = _dict.get('text') if 'options' in _dict: ...
[ "Initialize", "a", "MessageInput", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/assistant_v2.py#L1218-L1238
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'message_type'", "in", "_dict", ":", "args", "[", "'message_type'", "]", "=", "_dict", ".", "get", "(", "'message_type'", ")", "if", "'text'", "in", "_dict", ":", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageInput._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'message_type') and self.message_type is not None: _dict['message_type'] = self.message_type if hasattr(self, 'text') and self.text is not None: _dict['text'] =...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'message_type') and self.message_type is not None: _dict['message_type'] = self.message_type if hasattr(self, 'text') and self.text is not None: _dict['text'] =...
[ "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/assistant_v2.py#L1240-L1255
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'message_type'", ")", "and", "self", ".", "message_type", "is", "not", "None", ":", "_dict", "[", "'message_type'", "]", "=", "self", ".", "message_ty...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageInputOptions._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'debug') and self.debug is not None: _dict['debug'] = self.debug if hasattr(self, 'restart') and self.restart is not None: _dict['restart'] = self.restart ...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'debug') and self.debug is not None: _dict['debug'] = self.debug if hasattr(self, 'restart') and self.restart is not None: _dict['restart'] = self.restart ...
[ "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/assistant_v2.py#L1324-L1336
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'debug'", ")", "and", "self", ".", "debug", "is", "not", "None", ":", "_dict", "[", "'debug'", "]", "=", "self", ".", "debug", "if", "hasattr", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageOutput._from_dict
Initialize a MessageOutput object from a json dictionary.
ibm_watson/assistant_v2.py
def _from_dict(cls, _dict): """Initialize a MessageOutput object from a json dictionary.""" args = {} if 'generic' in _dict: args['generic'] = [ DialogRuntimeResponseGeneric._from_dict(x) for x in (_dict.get('generic')) ] if 'intent...
def _from_dict(cls, _dict): """Initialize a MessageOutput object from a json dictionary.""" args = {} if 'generic' in _dict: args['generic'] = [ DialogRuntimeResponseGeneric._from_dict(x) for x in (_dict.get('generic')) ] if 'intent...
[ "Initialize", "a", "MessageOutput", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/assistant_v2.py#L1406-L1430
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'generic'", "in", "_dict", ":", "args", "[", "'generic'", "]", "=", "[", "DialogRuntimeResponseGeneric", ".", "_from_dict", "(", "x", ")", "for", "x", "in", "(", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageOutput._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'generic') and self.generic is not None: _dict['generic'] = [x._to_dict() for x in self.generic] if hasattr(self, 'intents') and self.intents is not None: _dict...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'generic') and self.generic is not None: _dict['generic'] = [x._to_dict() for x in self.generic] if hasattr(self, 'intents') and self.intents 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/assistant_v2.py#L1432-L1447
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'generic'", ")", "and", "self", ".", "generic", "is", "not", "None", ":", "_dict", "[", "'generic'", "]", "=", "[", "x", ".", "_to_dict", "(", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageOutputDebug._from_dict
Initialize a MessageOutputDebug object from a json dictionary.
ibm_watson/assistant_v2.py
def _from_dict(cls, _dict): """Initialize a MessageOutputDebug object from a json dictionary.""" args = {} if 'nodes_visited' in _dict: args['nodes_visited'] = [ DialogNodesVisited._from_dict(x) for x in (_dict.get('nodes_visited')) ] ...
def _from_dict(cls, _dict): """Initialize a MessageOutputDebug object from a json dictionary.""" args = {} if 'nodes_visited' in _dict: args['nodes_visited'] = [ DialogNodesVisited._from_dict(x) for x in (_dict.get('nodes_visited')) ] ...
[ "Initialize", "a", "MessageOutputDebug", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/assistant_v2.py#L1505-L1522
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'nodes_visited'", "in", "_dict", ":", "args", "[", "'nodes_visited'", "]", "=", "[", "DialogNodesVisited", ".", "_from_dict", "(", "x", ")", "for", "x", "in", "(", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageOutputDebug._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'nodes_visited') and self.nodes_visited is not None: _dict['nodes_visited'] = [x._to_dict() for x in self.nodes_visited] if hasattr(self, 'log_messages') and self.log_messa...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'nodes_visited') and self.nodes_visited is not None: _dict['nodes_visited'] = [x._to_dict() for x in self.nodes_visited] if hasattr(self, 'log_messages') and self.log_messa...
[ "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/assistant_v2.py#L1524-L1536
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'nodes_visited'", ")", "and", "self", ".", "nodes_visited", "is", "not", "None", ":", "_dict", "[", "'nodes_visited'", "]", "=", "[", "x", ".", "_to...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageResponse._from_dict
Initialize a MessageResponse object from a json dictionary.
ibm_watson/assistant_v2.py
def _from_dict(cls, _dict): """Initialize a MessageResponse object from a json dictionary.""" args = {} if 'output' in _dict: args['output'] = MessageOutput._from_dict(_dict.get('output')) else: raise ValueError( 'Required property \'output\' not p...
def _from_dict(cls, _dict): """Initialize a MessageResponse object from a json dictionary.""" args = {} if 'output' in _dict: args['output'] = MessageOutput._from_dict(_dict.get('output')) else: raise ValueError( 'Required property \'output\' not p...
[ "Initialize", "a", "MessageResponse", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/assistant_v2.py#L1582-L1593
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'output'", "in", "_dict", ":", "args", "[", "'output'", "]", "=", "MessageOutput", ".", "_from_dict", "(", "_dict", ".", "get", "(", "'output'", ")", ")", "else", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
MessageResponse._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'output') and self.output is not None: _dict['output'] = self.output._to_dict() if hasattr(self, 'context') and self.context is not None: _dict['context'] = sel...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'output') and self.output is not None: _dict['output'] = self.output._to_dict() if hasattr(self, 'context') and self.context is not None: _dict['context'] = sel...
[ "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/assistant_v2.py#L1595-L1602
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'output'", ")", "and", "self", ".", "output", "is", "not", "None", ":", "_dict", "[", "'output'", "]", "=", "self", ".", "output", ".", "_to_dict"...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
RuntimeEntity._from_dict
Initialize a RuntimeEntity object from a json dictionary.
ibm_watson/assistant_v2.py
def _from_dict(cls, _dict): """Initialize a RuntimeEntity object from a json dictionary.""" args = {} if 'entity' in _dict: args['entity'] = _dict.get('entity') else: raise ValueError( 'Required property \'entity\' not present in RuntimeEntity JSON...
def _from_dict(cls, _dict): """Initialize a RuntimeEntity object from a json dictionary.""" args = {} if 'entity' in _dict: args['entity'] = _dict.get('entity') else: raise ValueError( 'Required property \'entity\' not present in RuntimeEntity JSON...
[ "Initialize", "a", "RuntimeEntity", "object", "from", "a", "json", "dictionary", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/assistant_v2.py#L1663-L1691
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'entity'", "in", "_dict", ":", "args", "[", "'entity'", "]", "=", "_dict", ".", "get", "(", "'entity'", ")", "else", ":", "raise", "ValueError", "(", "'Required pr...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
RuntimeEntity._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'entity') and self.entity is not None: _dict['entity'] = self.entity if hasattr(self, 'location') and self.location is not None: _dict['location'] = self.locati...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'entity') and self.entity is not None: _dict['entity'] = self.entity if hasattr(self, 'location') and self.location is not None: _dict['location'] = self.locati...
[ "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/assistant_v2.py#L1693-L1708
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'entity'", ")", "and", "self", ".", "entity", "is", "not", "None", ":", "_dict", "[", "'entity'", "]", "=", "self", ".", "entity", "if", "hasattr"...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
RuntimeIntent._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'intent') and self.intent is not None: _dict['intent'] = self.intent if hasattr(self, 'confidence') and self.confidence is not None: _dict['confidence'] = self....
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'intent') and self.intent is not None: _dict['intent'] = self.intent if hasattr(self, 'confidence') and self.confidence is not None: _dict['confidence'] = 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/assistant_v2.py#L1763-L1770
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'intent'", ")", "and", "self", ".", "intent", "is", "not", "None", ":", "_dict", "[", "'intent'", "]", "=", "self", ".", "intent", "if", "hasattr"...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
SessionResponse._to_dict
Return a json dictionary representing this model.
ibm_watson/assistant_v2.py
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'session_id') and self.session_id is not None: _dict['session_id'] = self.session_id return _dict
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'session_id') and self.session_id is not None: _dict['session_id'] = self.session_id 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/assistant_v2.py#L1814-L1819
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'session_id'", ")", "and", "self", ".", "session_id", "is", "not", "None", ":", "_dict", "[", "'session_id'", "]", "=", "self", ".", "session_id", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
NaturalLanguageUnderstandingV1.analyze
Analyze text. Analyzes text, HTML, or a public webpage for the following features: - Categories - Concepts - Emotion - Entities - Keywords - Metadata - Relations - Semantic roles - Sentiment - Syntax (Experimental). :param...
ibm_watson/natural_language_understanding_v1.py
def analyze(self, features, text=None, html=None, url=None, clean=None, xpath=None, fallback_to_raw=None, return_analyzed_text=None, language=None, limit_text_c...
def analyze(self, features, text=None, html=None, url=None, clean=None, xpath=None, fallback_to_raw=None, return_analyzed_text=None, language=None, limit_text_c...
[ "Analyze", "text", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L114-L206
[ "def", "analyze", "(", "self", ",", "features", ",", "text", "=", "None", ",", "html", "=", "None", ",", "url", "=", "None", ",", "clean", "=", "None", ",", "xpath", "=", "None", ",", "fallback_to_raw", "=", "None", ",", "return_analyzed_text", "=", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
NaturalLanguageUnderstandingV1.list_models
List models. Lists Watson Knowledge Studio [custom models](https://cloud.ibm.com/docs/services/natural-language-understanding/customizing.html) that are deployed to your Natural Language Understanding service. :param dict headers: A `dict` containing the request headers :return...
ibm_watson/natural_language_understanding_v1.py
def list_models(self, **kwargs): """ List models. Lists Watson Knowledge Studio [custom models](https://cloud.ibm.com/docs/services/natural-language-understanding/customizing.html) that are deployed to your Natural Language Understanding service. :param dict headers: A ...
def list_models(self, **kwargs): """ List models. Lists Watson Knowledge Studio [custom models](https://cloud.ibm.com/docs/services/natural-language-understanding/customizing.html) that are deployed to your Natural Language Understanding service. :param dict headers: A ...
[ "List", "models", "." ]
watson-developer-cloud/python-sdk
python
https://github.com/watson-developer-cloud/python-sdk/blob/4c2c9df4466fcde88975da9ecd834e6ba95eb353/ibm_watson/natural_language_understanding_v1.py#L245-L274
[ "def", "list_models", "(", "self", ",", "*", "*", "kwargs", ")", ":", "headers", "=", "{", "}", "if", "'headers'", "in", "kwargs", ":", "headers", ".", "update", "(", "kwargs", ".", "get", "(", "'headers'", ")", ")", "sdk_headers", "=", "get_sdk_header...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
AnalysisResults._from_dict
Initialize a AnalysisResults object from a json dictionary.
ibm_watson/natural_language_understanding_v1.py
def _from_dict(cls, _dict): """Initialize a AnalysisResults object from a json dictionary.""" args = {} if 'language' in _dict: args['language'] = _dict.get('language') if 'analyzed_text' in _dict: args['analyzed_text'] = _dict.get('analyzed_text') if 'ret...
def _from_dict(cls, _dict): """Initialize a AnalysisResults object from a json dictionary.""" args = {} if 'language' in _dict: args['language'] = _dict.get('language') if 'analyzed_text' in _dict: args['analyzed_text'] = _dict.get('analyzed_text') if 'ret...
[ "Initialize", "a", "AnalysisResults", "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#L369-L416
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'language'", "in", "_dict", ":", "args", "[", "'language'", "]", "=", "_dict", ".", "get", "(", "'language'", ")", "if", "'analyzed_text'", "in", "_dict", ":", "ar...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
AnalysisResults._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, 'language') and self.language is not None: _dict['language'] = self.language if hasattr(self, 'analyzed_text') and self.analyzed_text is not None: _dict['analyz...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'language') and self.language is not None: _dict['language'] = self.language if hasattr(self, 'analyzed_text') and self.analyzed_text is not None: _dict['analyz...
[ "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#L418-L451
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'language'", ")", "and", "self", ".", "language", "is", "not", "None", ":", "_dict", "[", "'language'", "]", "=", "self", ".", "language", "if", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
AnalysisResultsMetadata._from_dict
Initialize a AnalysisResultsMetadata object from a json dictionary.
ibm_watson/natural_language_understanding_v1.py
def _from_dict(cls, _dict): """Initialize a AnalysisResultsMetadata object from a json dictionary.""" args = {} if 'authors' in _dict: args['authors'] = [ Author._from_dict(x) for x in (_dict.get('authors')) ] if 'publication_date' in _dict: ...
def _from_dict(cls, _dict): """Initialize a AnalysisResultsMetadata object from a json dictionary.""" args = {} if 'authors' in _dict: args['authors'] = [ Author._from_dict(x) for x in (_dict.get('authors')) ] if 'publication_date' in _dict: ...
[ "Initialize", "a", "AnalysisResultsMetadata", "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#L502-L517
[ "def", "_from_dict", "(", "cls", ",", "_dict", ")", ":", "args", "=", "{", "}", "if", "'authors'", "in", "_dict", ":", "args", "[", "'authors'", "]", "=", "[", "Author", ".", "_from_dict", "(", "x", ")", "for", "x", "in", "(", "_dict", ".", "get"...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
AnalysisResultsMetadata._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, 'authors') and self.authors is not None: _dict['authors'] = [x._to_dict() for x in self.authors] if hasattr(self, 'publication_date') and self.publicatio...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'authors') and self.authors is not None: _dict['authors'] = [x._to_dict() for x in self.authors] if hasattr(self, 'publication_date') and self.publicatio...
[ "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#L519-L533
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'authors'", ")", "and", "self", ".", "authors", "is", "not", "None", ":", "_dict", "[", "'authors'", "]", "=", "[", "x", ".", "_to_dict", "(", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
AnalysisResultsUsage._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, 'features') and self.features is not None: _dict['features'] = self.features if hasattr(self, 'text_characters') and self.text_characters is not None: ...
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 if hasattr(self, 'text_characters') and self.text_characters 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#L583-L593
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'features'", ")", "and", "self", ".", "features", "is", "not", "None", ":", "_dict", "[", "'features'", "]", "=", "self", ".", "features", "if", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
Author._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 return _dict
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 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#L633-L638
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'name'", ")", "and", "self", ".", "name", "is", "not", "None", ":", "_dict", "[", "'name'", "]", "=", "self", ".", "name", "return", "_dict" ]
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
CategoriesOptions._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, 'model') and self.model is not None: _dict['model'] = self.model retur...
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, 'model') and self.model is not None: _dict['model'] = self.model 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/natural_language_understanding_v1.py#L689-L696
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'limit'", ")", "and", "self", ".", "limit", "is", "not", "None", ":", "_dict", "[", "'limit'", "]", "=", "self", ".", "limit", "if", "hasattr", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
CategoriesResult._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, 'label') and self.label is not None: _dict['label'] = self.label if hasattr(self, 'score') and self.score is not None: _dict['score'] = self.score retur...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'label') and self.label is not None: _dict['label'] = self.label if hasattr(self, 'score') and self.score is not None: _dict['score'] = self.score 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/natural_language_understanding_v1.py#L749-L756
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'label'", ")", "and", "self", ".", "label", "is", "not", "None", ":", "_dict", "[", "'label'", "]", "=", "self", ".", "label", "if", "hasattr", ...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
ConceptsOptions._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 return _dict
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 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#L800-L805
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'limit'", ")", "and", "self", ".", "limit", "is", "not", "None", ":", "_dict", "[", "'limit'", "]", "=", "self", ".", "limit", "return", "_dict" ]
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
ConceptsResult._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, 'relevance') and self.relevance is not None: _dict['relevance'] = self.relevance ...
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, 'relevance') and self.relevance is not None: _dict['relevance'] = self.relevance ...
[ "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#L858-L868
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'text'", ")", "and", "self", ".", "text", "is", "not", "None", ":", "_dict", "[", "'text'", "]", "=", "self", ".", "text", "if", "hasattr", "(",...
4c2c9df4466fcde88975da9ecd834e6ba95eb353
train
DeleteModelResults._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, 'deleted') and self.deleted is not None: _dict['deleted'] = self.deleted return _dict
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: _dict['deleted'] = self.deleted 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#L908-L913
[ "def", "_to_dict", "(", "self", ")", ":", "_dict", "=", "{", "}", "if", "hasattr", "(", "self", ",", "'deleted'", ")", "and", "self", ".", "deleted", "is", "not", "None", ":", "_dict", "[", "'deleted'", "]", "=", "self", ".", "deleted", "return", "...
4c2c9df4466fcde88975da9ecd834e6ba95eb353