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
test
Button.json
Returns json compatible state of the Button instance. Returns: control_json: Json representation of Button state.
deeppavlov/agents/rich_content/default_rich_content.py
def json(self) -> dict: """Returns json compatible state of the Button instance. Returns: control_json: Json representation of Button state. """ content = {} content['name'] = self.name content['callback'] = self.callback self.control_json['content'] ...
def json(self) -> dict: """Returns json compatible state of the Button instance. Returns: control_json: Json representation of Button state. """ content = {} content['name'] = self.name content['callback'] = self.callback self.control_json['content'] ...
[ "Returns", "json", "compatible", "state", "of", "the", "Button", "instance", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/agents/rich_content/default_rich_content.py#L99-L109
[ "def", "json", "(", "self", ")", "->", "dict", ":", "content", "=", "{", "}", "content", "[", "'name'", "]", "=", "self", ".", "name", "content", "[", "'callback'", "]", "=", "self", ".", "callback", "self", ".", "control_json", "[", "'content'", "]"...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
Button.ms_bot_framework
Returns MS Bot Framework compatible state of the Button instance. Creates MS Bot Framework CardAction (button) with postBack value return. Returns: control_json: MS Bot Framework representation of Button state.
deeppavlov/agents/rich_content/default_rich_content.py
def ms_bot_framework(self) -> dict: """Returns MS Bot Framework compatible state of the Button instance. Creates MS Bot Framework CardAction (button) with postBack value return. Returns: control_json: MS Bot Framework representation of Button state. """ card_action ...
def ms_bot_framework(self) -> dict: """Returns MS Bot Framework compatible state of the Button instance. Creates MS Bot Framework CardAction (button) with postBack value return. Returns: control_json: MS Bot Framework representation of Button state. """ card_action ...
[ "Returns", "MS", "Bot", "Framework", "compatible", "state", "of", "the", "Button", "instance", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/agents/rich_content/default_rich_content.py#L111-L123
[ "def", "ms_bot_framework", "(", "self", ")", "->", "dict", ":", "card_action", "=", "{", "}", "card_action", "[", "'type'", "]", "=", "'postBack'", "card_action", "[", "'title'", "]", "=", "self", ".", "name", "card_action", "[", "'value'", "]", "=", "se...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
ButtonsFrame.json
Returns json compatible state of the ButtonsFrame instance. Returns json compatible state of the ButtonsFrame instance including all nested buttons. Returns: control_json: Json representation of ButtonsFrame state.
deeppavlov/agents/rich_content/default_rich_content.py
def json(self) -> dict: """Returns json compatible state of the ButtonsFrame instance. Returns json compatible state of the ButtonsFrame instance including all nested buttons. Returns: control_json: Json representation of ButtonsFrame state. """ content = {}...
def json(self) -> dict: """Returns json compatible state of the ButtonsFrame instance. Returns json compatible state of the ButtonsFrame instance including all nested buttons. Returns: control_json: Json representation of ButtonsFrame state. """ content = {}...
[ "Returns", "json", "compatible", "state", "of", "the", "ButtonsFrame", "instance", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/agents/rich_content/default_rich_content.py#L152-L170
[ "def", "json", "(", "self", ")", "->", "dict", ":", "content", "=", "{", "}", "if", "self", ".", "text", ":", "content", "[", "'text'", "]", "=", "self", ".", "text", "content", "[", "'controls'", "]", "=", "[", "control", ".", "json", "(", ")", ...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
ButtonsFrame.ms_bot_framework
Returns MS Bot Framework compatible state of the ButtonsFrame instance. Creating MS Bot Framework activity blank with RichCard in "attachments". RichCard is populated with CardActions corresponding buttons embedded in ButtonsFrame. Returns: control_json: MS Bot Framework representa...
deeppavlov/agents/rich_content/default_rich_content.py
def ms_bot_framework(self) -> dict: """Returns MS Bot Framework compatible state of the ButtonsFrame instance. Creating MS Bot Framework activity blank with RichCard in "attachments". RichCard is populated with CardActions corresponding buttons embedded in ButtonsFrame. Returns: ...
def ms_bot_framework(self) -> dict: """Returns MS Bot Framework compatible state of the ButtonsFrame instance. Creating MS Bot Framework activity blank with RichCard in "attachments". RichCard is populated with CardActions corresponding buttons embedded in ButtonsFrame. Returns: ...
[ "Returns", "MS", "Bot", "Framework", "compatible", "state", "of", "the", "ButtonsFrame", "instance", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/agents/rich_content/default_rich_content.py#L172-L200
[ "def", "ms_bot_framework", "(", "self", ")", "->", "dict", ":", "rich_card", "=", "{", "}", "buttons", "=", "[", "button", ".", "ms_bot_framework", "(", ")", "for", "button", "in", "self", ".", "content", "]", "rich_card", "[", "'buttons'", "]", "=", "...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
squad_v2_exact_match
Calculates Exact Match score between y_true and y_predicted EM score uses the best matching y_true answer: if y_pred equal at least to one answer in y_true then EM = 1, else EM = 0 The same as in SQuAD-v2.0 Args: y_true: list of correct answers (correct answers are represented by l...
deeppavlov/metrics/squad_metrics.py
def squad_v2_exact_match(y_true: List[List[str]], y_predicted: List[str]) -> float: """ Calculates Exact Match score between y_true and y_predicted EM score uses the best matching y_true answer: if y_pred equal at least to one answer in y_true then EM = 1, else EM = 0 The same as in SQuAD-v...
def squad_v2_exact_match(y_true: List[List[str]], y_predicted: List[str]) -> float: """ Calculates Exact Match score between y_true and y_predicted EM score uses the best matching y_true answer: if y_pred equal at least to one answer in y_true then EM = 1, else EM = 0 The same as in SQuAD-v...
[ "Calculates", "Exact", "Match", "score", "between", "y_true", "and", "y_predicted", "EM", "score", "uses", "the", "best", "matching", "y_true", "answer", ":", "if", "y_pred", "equal", "at", "least", "to", "one", "answer", "in", "y_true", "then", "EM", "=", ...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/metrics/squad_metrics.py#L24-L40
[ "def", "squad_v2_exact_match", "(", "y_true", ":", "List", "[", "List", "[", "str", "]", "]", ",", "y_predicted", ":", "List", "[", "str", "]", ")", "->", "float", ":", "EM_total", "=", "sum", "(", "normalize_answer", "(", "prediction", ")", "in", "map...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
squad_v1_exact_match
Calculates Exact Match score between y_true and y_predicted EM score uses the best matching y_true answer: if y_pred equal at least to one answer in y_true then EM = 1, else EM = 0 Skips examples without an answer. Args: y_true: list of correct answers (correct answers are repres...
deeppavlov/metrics/squad_metrics.py
def squad_v1_exact_match(y_true: List[List[str]], y_predicted: List[str]) -> float: """ Calculates Exact Match score between y_true and y_predicted EM score uses the best matching y_true answer: if y_pred equal at least to one answer in y_true then EM = 1, else EM = 0 Skips examples with...
def squad_v1_exact_match(y_true: List[List[str]], y_predicted: List[str]) -> float: """ Calculates Exact Match score between y_true and y_predicted EM score uses the best matching y_true answer: if y_pred equal at least to one answer in y_true then EM = 1, else EM = 0 Skips examples with...
[ "Calculates", "Exact", "Match", "score", "between", "y_true", "and", "y_predicted", "EM", "score", "uses", "the", "best", "matching", "y_true", "answer", ":", "if", "y_pred", "equal", "at", "least", "to", "one", "answer", "in", "y_true", "then", "EM", "=", ...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/metrics/squad_metrics.py#L44-L64
[ "def", "squad_v1_exact_match", "(", "y_true", ":", "List", "[", "List", "[", "str", "]", "]", ",", "y_predicted", ":", "List", "[", "str", "]", ")", "->", "float", ":", "EM_total", "=", "0", "count", "=", "0", "for", "ground_truth", ",", "prediction", ...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
squad_v2_f1
Calculates F-1 score between y_true and y_predicted F-1 score uses the best matching y_true answer The same as in SQuAD-v2.0 Args: y_true: list of correct answers (correct answers are represented by list of strings) y_predicted: list of predicted answers Returns: F-1 score...
deeppavlov/metrics/squad_metrics.py
def squad_v2_f1(y_true: List[List[str]], y_predicted: List[str]) -> float: """ Calculates F-1 score between y_true and y_predicted F-1 score uses the best matching y_true answer The same as in SQuAD-v2.0 Args: y_true: list of correct answers (correct answers are represented by list of stri...
def squad_v2_f1(y_true: List[List[str]], y_predicted: List[str]) -> float: """ Calculates F-1 score between y_true and y_predicted F-1 score uses the best matching y_true answer The same as in SQuAD-v2.0 Args: y_true: list of correct answers (correct answers are represented by list of stri...
[ "Calculates", "F", "-", "1", "score", "between", "y_true", "and", "y_predicted", "F", "-", "1", "score", "uses", "the", "best", "matching", "y_true", "answer" ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/metrics/squad_metrics.py#L68-L100
[ "def", "squad_v2_f1", "(", "y_true", ":", "List", "[", "List", "[", "str", "]", "]", ",", "y_predicted", ":", "List", "[", "str", "]", ")", "->", "float", ":", "f1_total", "=", "0.0", "for", "ground_truth", ",", "prediction", "in", "zip", "(", "y_tru...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
recall_at_k
Calculates recall at k ranking metric. Args: y_true: Labels. Not used in the calculation of the metric. y_predicted: Predictions. Each prediction contains ranking score of all ranking candidates for the particular data sample. It is supposed that the ranking score for the tr...
deeppavlov/metrics/recall_at_k.py
def recall_at_k(y_true: List[int], y_pred: List[List[np.ndarray]], k: int): """ Calculates recall at k ranking metric. Args: y_true: Labels. Not used in the calculation of the metric. y_predicted: Predictions. Each prediction contains ranking score of all ranking candidates for ...
def recall_at_k(y_true: List[int], y_pred: List[List[np.ndarray]], k: int): """ Calculates recall at k ranking metric. Args: y_true: Labels. Not used in the calculation of the metric. y_predicted: Predictions. Each prediction contains ranking score of all ranking candidates for ...
[ "Calculates", "recall", "at", "k", "ranking", "metric", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/metrics/recall_at_k.py#L23-L43
[ "def", "recall_at_k", "(", "y_true", ":", "List", "[", "int", "]", ",", "y_pred", ":", "List", "[", "List", "[", "np", ".", "ndarray", "]", "]", ",", "k", ":", "int", ")", ":", "num_examples", "=", "float", "(", "len", "(", "y_pred", ")", ")", ...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
check_gpu_existence
r"""Return True if at least one GPU is available
deeppavlov/core/common/check_gpu.py
def check_gpu_existence(): r"""Return True if at least one GPU is available""" global _gpu_available if _gpu_available is None: sess_config = tf.ConfigProto() sess_config.gpu_options.allow_growth = True try: with tf.Session(config=sess_config): device_list...
def check_gpu_existence(): r"""Return True if at least one GPU is available""" global _gpu_available if _gpu_available is None: sess_config = tf.ConfigProto() sess_config.gpu_options.allow_growth = True try: with tf.Session(config=sess_config): device_list...
[ "r", "Return", "True", "if", "at", "least", "one", "GPU", "is", "available" ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/common/check_gpu.py#L26-L39
[ "def", "check_gpu_existence", "(", ")", ":", "global", "_gpu_available", "if", "_gpu_available", "is", "None", ":", "sess_config", "=", "tf", ".", "ConfigProto", "(", ")", "sess_config", ".", "gpu_options", ".", "allow_growth", "=", "True", "try", ":", "with",...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
_parse_config_property
Recursively apply config's variables values to its property
deeppavlov/core/commands/utils.py
def _parse_config_property(item: _T, variables: Dict[str, Union[str, Path, float, bool, None]]) -> _T: """Recursively apply config's variables values to its property""" if isinstance(item, str): return item.format(**variables) elif isinstance(item, list): return [_parse_config_property(item,...
def _parse_config_property(item: _T, variables: Dict[str, Union[str, Path, float, bool, None]]) -> _T: """Recursively apply config's variables values to its property""" if isinstance(item, str): return item.format(**variables) elif isinstance(item, list): return [_parse_config_property(item,...
[ "Recursively", "apply", "config", "s", "variables", "values", "to", "its", "property" ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/commands/utils.py#L24-L33
[ "def", "_parse_config_property", "(", "item", ":", "_T", ",", "variables", ":", "Dict", "[", "str", ",", "Union", "[", "str", ",", "Path", ",", "float", ",", "bool", ",", "None", "]", "]", ")", "->", "_T", ":", "if", "isinstance", "(", "item", ",",...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
parse_config
Read config's variables and apply their values to all its properties
deeppavlov/core/commands/utils.py
def parse_config(config: Union[str, Path, dict]) -> dict: """Read config's variables and apply their values to all its properties""" if isinstance(config, (str, Path)): config = read_json(find_config(config)) variables = { 'DEEPPAVLOV_PATH': os.getenv(f'DP_DEEPPAVLOV_PATH', Path(__file__).p...
def parse_config(config: Union[str, Path, dict]) -> dict: """Read config's variables and apply their values to all its properties""" if isinstance(config, (str, Path)): config = read_json(find_config(config)) variables = { 'DEEPPAVLOV_PATH': os.getenv(f'DP_DEEPPAVLOV_PATH', Path(__file__).p...
[ "Read", "config", "s", "variables", "and", "apply", "their", "values", "to", "all", "its", "properties" ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/commands/utils.py#L36-L50
[ "def", "parse_config", "(", "config", ":", "Union", "[", "str", ",", "Path", ",", "dict", "]", ")", "->", "dict", ":", "if", "isinstance", "(", "config", ",", "(", "str", ",", "Path", ")", ")", ":", "config", "=", "read_json", "(", "find_config", "...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
expand_path
Convert relative paths to absolute with resolving user directory.
deeppavlov/core/commands/utils.py
def expand_path(path: Union[str, Path]) -> Path: """Convert relative paths to absolute with resolving user directory.""" return Path(path).expanduser().resolve()
def expand_path(path: Union[str, Path]) -> Path: """Convert relative paths to absolute with resolving user directory.""" return Path(path).expanduser().resolve()
[ "Convert", "relative", "paths", "to", "absolute", "with", "resolving", "user", "directory", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/commands/utils.py#L53-L55
[ "def", "expand_path", "(", "path", ":", "Union", "[", "str", ",", "Path", "]", ")", "->", "Path", ":", "return", "Path", "(", "path", ")", ".", "expanduser", "(", ")", ".", "resolve", "(", ")" ]
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
from_params
Builds and returns the Component from corresponding dictionary of parameters.
deeppavlov/core/common/params.py
def from_params(params: Dict, mode: str = 'infer', serialized: Any = None, **kwargs) -> Component: """Builds and returns the Component from corresponding dictionary of parameters.""" # what is passed in json: config_params = {k: _resolve(v) for k, v in params.items()} # get component by reference (if a...
def from_params(params: Dict, mode: str = 'infer', serialized: Any = None, **kwargs) -> Component: """Builds and returns the Component from corresponding dictionary of parameters.""" # what is passed in json: config_params = {k: _resolve(v) for k, v in params.items()} # get component by reference (if a...
[ "Builds", "and", "returns", "the", "Component", "from", "corresponding", "dictionary", "of", "parameters", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/common/params.py#L57-L115
[ "def", "from_params", "(", "params", ":", "Dict", ",", "mode", ":", "str", "=", "'infer'", ",", "serialized", ":", "Any", "=", "None", ",", "*", "*", "kwargs", ")", "->", "Component", ":", "# what is passed in json:", "config_params", "=", "{", "k", ":",...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
Bot.run
Thread run method implementation.
deeppavlov/utils/alexa/bot.py
def run(self) -> None: """Thread run method implementation.""" while True: request = self.input_queue.get() response = self._handle_request(request) self.output_queue.put(response)
def run(self) -> None: """Thread run method implementation.""" while True: request = self.input_queue.get() response = self._handle_request(request) self.output_queue.put(response)
[ "Thread", "run", "method", "implementation", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/utils/alexa/bot.py#L74-L79
[ "def", "run", "(", "self", ")", "->", "None", ":", "while", "True", ":", "request", "=", "self", ".", "input_queue", ".", "get", "(", ")", "response", "=", "self", ".", "_handle_request", "(", "request", ")", "self", ".", "output_queue", ".", "put", ...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
Bot._del_conversation
Deletes Conversation instance. Args: conversation_key: Conversation key.
deeppavlov/utils/alexa/bot.py
def _del_conversation(self, conversation_key: str) -> None: """Deletes Conversation instance. Args: conversation_key: Conversation key. """ if conversation_key in self.conversations.keys(): del self.conversations[conversation_key] log.info(f'Deleted c...
def _del_conversation(self, conversation_key: str) -> None: """Deletes Conversation instance. Args: conversation_key: Conversation key. """ if conversation_key in self.conversations.keys(): del self.conversations[conversation_key] log.info(f'Deleted c...
[ "Deletes", "Conversation", "instance", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/utils/alexa/bot.py#L81-L89
[ "def", "_del_conversation", "(", "self", ",", "conversation_key", ":", "str", ")", "->", "None", ":", "if", "conversation_key", "in", "self", ".", "conversations", ".", "keys", "(", ")", ":", "del", "self", ".", "conversations", "[", "conversation_key", "]",...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
Bot._refresh_valid_certs
Conducts cleanup of periodical certificates with expired validation.
deeppavlov/utils/alexa/bot.py
def _refresh_valid_certs(self) -> None: """Conducts cleanup of periodical certificates with expired validation.""" self.timer = Timer(REFRESH_VALID_CERTS_PERIOD_SECS, self._refresh_valid_certs) self.timer.start() expired_certificates = [] for valid_cert_url, valid_cert in self....
def _refresh_valid_certs(self) -> None: """Conducts cleanup of periodical certificates with expired validation.""" self.timer = Timer(REFRESH_VALID_CERTS_PERIOD_SECS, self._refresh_valid_certs) self.timer.start() expired_certificates = [] for valid_cert_url, valid_cert in self....
[ "Conducts", "cleanup", "of", "periodical", "certificates", "with", "expired", "validation", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/utils/alexa/bot.py#L98-L113
[ "def", "_refresh_valid_certs", "(", "self", ")", "->", "None", ":", "self", ".", "timer", "=", "Timer", "(", "REFRESH_VALID_CERTS_PERIOD_SECS", ",", "self", ".", "_refresh_valid_certs", ")", "self", ".", "timer", ".", "start", "(", ")", "expired_certificates", ...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
Bot._verify_request
Conducts series of Alexa request verifications against Amazon Alexa requirements. Args: signature_chain_url: Signature certificate URL from SignatureCertChainUrl HTTP header. signature: Base64 decoded Alexa request signature from Signature HTTP header. request_body: full HTT...
deeppavlov/utils/alexa/bot.py
def _verify_request(self, signature_chain_url: str, signature: str, request_body: bytes) -> bool: """Conducts series of Alexa request verifications against Amazon Alexa requirements. Args: signature_chain_url: Signature certificate URL from SignatureCertChainUrl HTTP header. sig...
def _verify_request(self, signature_chain_url: str, signature: str, request_body: bytes) -> bool: """Conducts series of Alexa request verifications against Amazon Alexa requirements. Args: signature_chain_url: Signature certificate URL from SignatureCertChainUrl HTTP header. sig...
[ "Conducts", "series", "of", "Alexa", "request", "verifications", "against", "Amazon", "Alexa", "requirements", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/utils/alexa/bot.py#L115-L146
[ "def", "_verify_request", "(", "self", ",", "signature_chain_url", ":", "str", ",", "signature", ":", "str", ",", "request_body", ":", "bytes", ")", "->", "bool", ":", "if", "signature_chain_url", "not", "in", "self", ".", "valid_certificates", ".", "keys", ...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
Bot._handle_request
Processes Alexa requests from skill server and returns responses to Alexa. Args: request: Dict with Alexa request payload and metadata. Returns: result: Alexa formatted or error response.
deeppavlov/utils/alexa/bot.py
def _handle_request(self, request: dict) -> dict: """Processes Alexa requests from skill server and returns responses to Alexa. Args: request: Dict with Alexa request payload and metadata. Returns: result: Alexa formatted or error response. """ request_bo...
def _handle_request(self, request: dict) -> dict: """Processes Alexa requests from skill server and returns responses to Alexa. Args: request: Dict with Alexa request payload and metadata. Returns: result: Alexa formatted or error response. """ request_bo...
[ "Processes", "Alexa", "requests", "from", "skill", "server", "and", "returns", "responses", "to", "Alexa", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/utils/alexa/bot.py#L148-L194
[ "def", "_handle_request", "(", "self", ",", "request", ":", "dict", ")", "->", "dict", ":", "request_body", ":", "bytes", "=", "request", "[", "'request_body'", "]", "signature_chain_url", ":", "str", "=", "request", "[", "'signature_chain_url'", "]", "signatu...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
csoftmax_for_slice
It is a implementation of the constrained softmax (csoftmax) for slice. Based on the paper: https://andre-martins.github.io/docs/emnlp2017_final.pdf "Learning What's Easy: Fully Differentiable Neural Easy-First Taggers" (page 4) Args: input: A list of [input tensor, cumulative attention]. ...
deeppavlov/core/layers/tf_csoftmax_attention.py
def csoftmax_for_slice(input): """ It is a implementation of the constrained softmax (csoftmax) for slice. Based on the paper: https://andre-martins.github.io/docs/emnlp2017_final.pdf "Learning What's Easy: Fully Differentiable Neural Easy-First Taggers" (page 4) Args: input: A list of [...
def csoftmax_for_slice(input): """ It is a implementation of the constrained softmax (csoftmax) for slice. Based on the paper: https://andre-martins.github.io/docs/emnlp2017_final.pdf "Learning What's Easy: Fully Differentiable Neural Easy-First Taggers" (page 4) Args: input: A list of [...
[ "It", "is", "a", "implementation", "of", "the", "constrained", "softmax", "(", "csoftmax", ")", "for", "slice", ".", "Based", "on", "the", "paper", ":", "https", ":", "//", "andre", "-", "martins", ".", "github", ".", "io", "/", "docs", "/", "emnlp2017...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/layers/tf_csoftmax_attention.py#L18-L72
[ "def", "csoftmax_for_slice", "(", "input", ")", ":", "[", "ten", ",", "u", "]", "=", "input", "shape_t", "=", "ten", ".", "shape", "shape_u", "=", "u", ".", "shape", "ten", "-=", "tf", ".", "reduce_mean", "(", "ten", ")", "q", "=", "tf", ".", "ex...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
csoftmax
It is a implementation of the constrained softmax (csoftmax). Based on the paper: https://andre-martins.github.io/docs/emnlp2017_final.pdf "Learning What's Easy: Fully Differentiable Neural Easy-First Taggers" Args: tensor: A tensorflow tensor is score. This tensor have dimensionality [None,...
deeppavlov/core/layers/tf_csoftmax_attention.py
def csoftmax(tensor, inv_cumulative_att): """ It is a implementation of the constrained softmax (csoftmax). Based on the paper: https://andre-martins.github.io/docs/emnlp2017_final.pdf "Learning What's Easy: Fully Differentiable Neural Easy-First Taggers" Args: tensor: A tensorflow tenso...
def csoftmax(tensor, inv_cumulative_att): """ It is a implementation of the constrained softmax (csoftmax). Based on the paper: https://andre-martins.github.io/docs/emnlp2017_final.pdf "Learning What's Easy: Fully Differentiable Neural Easy-First Taggers" Args: tensor: A tensorflow tenso...
[ "It", "is", "a", "implementation", "of", "the", "constrained", "softmax", "(", "csoftmax", ")", ".", "Based", "on", "the", "paper", ":", "https", ":", "//", "andre", "-", "martins", ".", "github", ".", "io", "/", "docs", "/", "emnlp2017_final", ".", "p...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/layers/tf_csoftmax_attention.py#L75-L90
[ "def", "csoftmax", "(", "tensor", ",", "inv_cumulative_att", ")", ":", "shape_ten", "=", "tensor", ".", "shape", "shape_cum", "=", "inv_cumulative_att", ".", "shape", "merge_tensor", "=", "[", "tensor", ",", "inv_cumulative_att", "]", "cs", ",", "_", "=", "t...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
attention_gen_step
It is a implementation one step of block of the Luong et al. attention mechanism with general score and the constrained softmax (csoftmax). Based on the papers: https://arxiv.org/abs/1508.04025 "Effective Approaches to Attention-based Neural Machine Translation" https://andre-martins.github.io/d...
deeppavlov/core/layers/tf_csoftmax_attention.py
def attention_gen_step(hidden_for_sketch, hidden_for_attn_alignment, sketch, key, cum_att): """ It is a implementation one step of block of the Luong et al. attention mechanism with general score and the constrained softmax (csoftmax). Based on the papers: https://arxiv.org/abs/1508.04025 "Effective...
def attention_gen_step(hidden_for_sketch, hidden_for_attn_alignment, sketch, key, cum_att): """ It is a implementation one step of block of the Luong et al. attention mechanism with general score and the constrained softmax (csoftmax). Based on the papers: https://arxiv.org/abs/1508.04025 "Effective...
[ "It", "is", "a", "implementation", "one", "step", "of", "block", "of", "the", "Luong", "et", "al", ".", "attention", "mechanism", "with", "general", "score", "and", "the", "constrained", "softmax", "(", "csoftmax", ")", ".", "Based", "on", "the", "papers",...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/layers/tf_csoftmax_attention.py#L93-L139
[ "def", "attention_gen_step", "(", "hidden_for_sketch", ",", "hidden_for_attn_alignment", ",", "sketch", ",", "key", ",", "cum_att", ")", ":", "with", "tf", ".", "name_scope", "(", "'attention_step'", ")", ":", "sketch_dims", "=", "hidden_for_sketch", ".", "get_sha...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
attention_gen_block
It is a implementation of the Luong et al. attention mechanism with general score and the constrained softmax (csoftmax). Based on the papers: https://arxiv.org/abs/1508.04025 "Effective Approaches to Attention-based Neural Machine Translation" https://andre-martins.github.io/docs/emnlp2017_fina...
deeppavlov/core/layers/tf_csoftmax_attention.py
def attention_gen_block(hidden_for_sketch, hidden_for_attn_alignment, key, attention_depth): """ It is a implementation of the Luong et al. attention mechanism with general score and the constrained softmax (csoftmax). Based on the papers: https://arxiv.org/abs/1508.04025 "Effective Approaches to At...
def attention_gen_block(hidden_for_sketch, hidden_for_attn_alignment, key, attention_depth): """ It is a implementation of the Luong et al. attention mechanism with general score and the constrained softmax (csoftmax). Based on the papers: https://arxiv.org/abs/1508.04025 "Effective Approaches to At...
[ "It", "is", "a", "implementation", "of", "the", "Luong", "et", "al", ".", "attention", "mechanism", "with", "general", "score", "and", "the", "constrained", "softmax", "(", "csoftmax", ")", ".", "Based", "on", "the", "papers", ":", "https", ":", "//", "a...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/layers/tf_csoftmax_attention.py#L142-L173
[ "def", "attention_gen_block", "(", "hidden_for_sketch", ",", "hidden_for_attn_alignment", ",", "key", ",", "attention_depth", ")", ":", "with", "tf", ".", "name_scope", "(", "'attention_block'", ")", ":", "sketch_dims", "=", "tf", ".", "shape", "(", "hidden_for_sk...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
cls_from_str
Returns a class object with the name given as a string.
deeppavlov/core/common/registry.py
def cls_from_str(name: str) -> type: """Returns a class object with the name given as a string.""" try: module_name, cls_name = name.split(':') except ValueError: raise ConfigError('Expected class description in a `module.submodules:ClassName` form, but got `{}`' .f...
def cls_from_str(name: str) -> type: """Returns a class object with the name given as a string.""" try: module_name, cls_name = name.split(':') except ValueError: raise ConfigError('Expected class description in a `module.submodules:ClassName` form, but got `{}`' .f...
[ "Returns", "a", "class", "object", "with", "the", "name", "given", "as", "a", "string", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/common/registry.py#L32-L40
[ "def", "cls_from_str", "(", "name", ":", "str", ")", "->", "type", ":", "try", ":", "module_name", ",", "cls_name", "=", "name", ".", "split", "(", "':'", ")", "except", "ValueError", ":", "raise", "ConfigError", "(", "'Expected class description in a `module....
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
register
Register classes that could be initialized from JSON configuration file. If name is not passed, the class name is converted to snake-case.
deeppavlov/core/common/registry.py
def register(name: str = None) -> type: """ Register classes that could be initialized from JSON configuration file. If name is not passed, the class name is converted to snake-case. """ def decorate(model_cls: type, reg_name: str = None) -> type: model_name = reg_name or short_name(model_cl...
def register(name: str = None) -> type: """ Register classes that could be initialized from JSON configuration file. If name is not passed, the class name is converted to snake-case. """ def decorate(model_cls: type, reg_name: str = None) -> type: model_name = reg_name or short_name(model_cl...
[ "Register", "classes", "that", "could", "be", "initialized", "from", "JSON", "configuration", "file", ".", "If", "name", "is", "not", "passed", "the", "class", "name", "is", "converted", "to", "snake", "-", "case", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/common/registry.py#L43-L57
[ "def", "register", "(", "name", ":", "str", "=", "None", ")", "->", "type", ":", "def", "decorate", "(", "model_cls", ":", "type", ",", "reg_name", ":", "str", "=", "None", ")", "->", "type", ":", "model_name", "=", "reg_name", "or", "short_name", "(...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
get_model
Returns a registered class object with the name given in the string.
deeppavlov/core/common/registry.py
def get_model(name: str) -> type: """Returns a registered class object with the name given in the string.""" if name not in _REGISTRY: if ':' not in name: raise ConfigError("Model {} is not registered.".format(name)) return cls_from_str(name) return cls_from_str(_REGISTRY[name])
def get_model(name: str) -> type: """Returns a registered class object with the name given in the string.""" if name not in _REGISTRY: if ':' not in name: raise ConfigError("Model {} is not registered.".format(name)) return cls_from_str(name) return cls_from_str(_REGISTRY[name])
[ "Returns", "a", "registered", "class", "object", "with", "the", "name", "given", "in", "the", "string", "." ]
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/common/registry.py#L65-L71
[ "def", "get_model", "(", "name", ":", "str", ")", "->", "type", ":", "if", "name", "not", "in", "_REGISTRY", ":", "if", "':'", "not", "in", "name", ":", "raise", "ConfigError", "(", "\"Model {} is not registered.\"", ".", "format", "(", "name", ")", ")",...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
general_attention
It is a implementation of the Luong et al. attention mechanism with general score. Based on the paper: https://arxiv.org/abs/1508.04025 "Effective Approaches to Attention-based Neural Machine Translation" Args: key: A tensorflow tensor with dimensionality [None, None, key_size] context: A te...
deeppavlov/core/layers/tf_attention_mechanisms.py
def general_attention(key, context, hidden_size, projected_align=False): """ It is a implementation of the Luong et al. attention mechanism with general score. Based on the paper: https://arxiv.org/abs/1508.04025 "Effective Approaches to Attention-based Neural Machine Translation" Args: key: A t...
def general_attention(key, context, hidden_size, projected_align=False): """ It is a implementation of the Luong et al. attention mechanism with general score. Based on the paper: https://arxiv.org/abs/1508.04025 "Effective Approaches to Attention-based Neural Machine Translation" Args: key: A t...
[ "It", "is", "a", "implementation", "of", "the", "Luong", "et", "al", ".", "attention", "mechanism", "with", "general", "score", ".", "Based", "on", "the", "paper", ":", "https", ":", "//", "arxiv", ".", "org", "/", "abs", "/", "1508", ".", "04025", "...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/layers/tf_attention_mechanisms.py#L25-L72
[ "def", "general_attention", "(", "key", ",", "context", ",", "hidden_size", ",", "projected_align", "=", "False", ")", ":", "if", "hidden_size", "%", "2", "!=", "0", ":", "raise", "ValueError", "(", "\"hidden size must be dividable by two\"", ")", "batch_size", ...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
light_general_attention
It is a implementation of the Luong et al. attention mechanism with general score. Based on the paper: https://arxiv.org/abs/1508.04025 "Effective Approaches to Attention-based Neural Machine Translation" Args: key: A tensorflow tensor with dimensionality [None, None, key_size] context: A te...
deeppavlov/core/layers/tf_attention_mechanisms.py
def light_general_attention(key, context, hidden_size, projected_align=False): """ It is a implementation of the Luong et al. attention mechanism with general score. Based on the paper: https://arxiv.org/abs/1508.04025 "Effective Approaches to Attention-based Neural Machine Translation" Args: ke...
def light_general_attention(key, context, hidden_size, projected_align=False): """ It is a implementation of the Luong et al. attention mechanism with general score. Based on the paper: https://arxiv.org/abs/1508.04025 "Effective Approaches to Attention-based Neural Machine Translation" Args: ke...
[ "It", "is", "a", "implementation", "of", "the", "Luong", "et", "al", ".", "attention", "mechanism", "with", "general", "score", ".", "Based", "on", "the", "paper", ":", "https", ":", "//", "arxiv", ".", "org", "/", "abs", "/", "1508", ".", "04025", "...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/layers/tf_attention_mechanisms.py#L75-L112
[ "def", "light_general_attention", "(", "key", ",", "context", ",", "hidden_size", ",", "projected_align", "=", "False", ")", ":", "batch_size", "=", "tf", ".", "shape", "(", "context", ")", "[", "0", "]", "max_num_tokens", ",", "token_size", "=", "context", ...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
light_bahdanau_attention
It is a implementation of the Bahdanau et al. attention mechanism. Based on the paper: https://arxiv.org/abs/1409.0473 "Neural Machine Translation by Jointly Learning to Align and Translate" Args: key: A tensorflow tensor with dimensionality [None, None, key_size] context: A tensorflow tenso...
deeppavlov/core/layers/tf_attention_mechanisms.py
def light_bahdanau_attention(key, context, hidden_size, projected_align=False): """ It is a implementation of the Bahdanau et al. attention mechanism. Based on the paper: https://arxiv.org/abs/1409.0473 "Neural Machine Translation by Jointly Learning to Align and Translate" Args: key: A tensorfl...
def light_bahdanau_attention(key, context, hidden_size, projected_align=False): """ It is a implementation of the Bahdanau et al. attention mechanism. Based on the paper: https://arxiv.org/abs/1409.0473 "Neural Machine Translation by Jointly Learning to Align and Translate" Args: key: A tensorfl...
[ "It", "is", "a", "implementation", "of", "the", "Bahdanau", "et", "al", ".", "attention", "mechanism", ".", "Based", "on", "the", "paper", ":", "https", ":", "//", "arxiv", ".", "org", "/", "abs", "/", "1409", ".", "0473", "Neural", "Machine", "Transla...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/layers/tf_attention_mechanisms.py#L228-L275
[ "def", "light_bahdanau_attention", "(", "key", ",", "context", ",", "hidden_size", ",", "projected_align", "=", "False", ")", ":", "batch_size", "=", "tf", ".", "shape", "(", "context", ")", "[", "0", "]", "max_num_tokens", ",", "token_size", "=", "context",...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
cs_bahdanau_attention
It is a implementation of the Bahdanau et al. attention mechanism. Based on the papers: https://arxiv.org/abs/1409.0473 "Neural Machine Translation by Jointly Learning to Align and Translate" https://andre-martins.github.io/docs/emnlp2017_final.pdf "Learning What's Easy: Fully Differentiable Neural Easy...
deeppavlov/core/layers/tf_attention_mechanisms.py
def cs_bahdanau_attention(key, context, hidden_size, depth, projected_align=False): """ It is a implementation of the Bahdanau et al. attention mechanism. Based on the papers: https://arxiv.org/abs/1409.0473 "Neural Machine Translation by Jointly Learning to Align and Translate" https://andre-martin...
def cs_bahdanau_attention(key, context, hidden_size, depth, projected_align=False): """ It is a implementation of the Bahdanau et al. attention mechanism. Based on the papers: https://arxiv.org/abs/1409.0473 "Neural Machine Translation by Jointly Learning to Align and Translate" https://andre-martin...
[ "It", "is", "a", "implementation", "of", "the", "Bahdanau", "et", "al", ".", "attention", "mechanism", ".", "Based", "on", "the", "papers", ":", "https", ":", "//", "arxiv", ".", "org", "/", "abs", "/", "1409", ".", "0473", "Neural", "Machine", "Transl...
deepmipt/DeepPavlov
python
https://github.com/deepmipt/DeepPavlov/blob/f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c/deeppavlov/core/layers/tf_attention_mechanisms.py#L278-L337
[ "def", "cs_bahdanau_attention", "(", "key", ",", "context", ",", "hidden_size", ",", "depth", ",", "projected_align", "=", "False", ")", ":", "if", "hidden_size", "%", "2", "!=", "0", ":", "raise", "ValueError", "(", "\"hidden size must be dividable by two\"", "...
f3e4a69a3764d25d2f5bad4f1f1aebc872b00f9c
test
H2OGenericEstimator.from_file
Creates new Generic model by loading existing embedded model into library, e.g. from H2O MOJO. The imported model must be supported by H2O. :param file: A string containing path to the file to create the model from :return: H2OGenericEstimator instance representing the generic model
h2o-py/h2o/estimators/generic.py
def from_file(file=str): """ Creates new Generic model by loading existing embedded model into library, e.g. from H2O MOJO. The imported model must be supported by H2O. :param file: A string containing path to the file to create the model from :return: H2OGenericEstimator instanc...
def from_file(file=str): """ Creates new Generic model by loading existing embedded model into library, e.g. from H2O MOJO. The imported model must be supported by H2O. :param file: A string containing path to the file to create the model from :return: H2OGenericEstimator instanc...
[ "Creates", "new", "Generic", "model", "by", "loading", "existing", "embedded", "model", "into", "library", "e", ".", "g", ".", "from", "H2O", "MOJO", ".", "The", "imported", "model", "must", "be", "supported", "by", "H2O", ".", ":", "param", "file", ":",...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/generic.py#L62-L75
[ "def", "from_file", "(", "file", "=", "str", ")", ":", "from", "h2o", "import", "lazy_import", ",", "get_frame", "model_key", "=", "lazy_import", "(", "file", ")", "model_bytes_frame", "=", "get_frame", "(", "model_key", "[", "0", "]", ")", "model", "=", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OGeneralizedLinearEstimator.getGLMRegularizationPath
Extract full regularization path explored during lambda search from glm model. :param model: source lambda search model
h2o-py/h2o/estimators/glm.py
def getGLMRegularizationPath(model): """ Extract full regularization path explored during lambda search from glm model. :param model: source lambda search model """ x = h2o.api("GET /3/GetGLMRegPath", data={"model": model._model_json["model_id"]["name"]}) ns = x.pop("coe...
def getGLMRegularizationPath(model): """ Extract full regularization path explored during lambda search from glm model. :param model: source lambda search model """ x = h2o.api("GET /3/GetGLMRegPath", data={"model": model._model_json["model_id"]["name"]}) ns = x.pop("coe...
[ "Extract", "full", "regularization", "path", "explored", "during", "lambda", "search", "from", "glm", "model", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/glm.py#L860-L876
[ "def", "getGLMRegularizationPath", "(", "model", ")", ":", "x", "=", "h2o", ".", "api", "(", "\"GET /3/GetGLMRegPath\"", ",", "data", "=", "{", "\"model\"", ":", "model", ".", "_model_json", "[", "\"model_id\"", "]", "[", "\"name\"", "]", "}", ")", "ns", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OGeneralizedLinearEstimator.makeGLMModel
Create a custom GLM model using the given coefficients. Needs to be passed source model trained on the dataset to extract the dataset information from. :param model: source model, used for extracting dataset information :param coefs: dictionary containing model coefficients :param thre...
h2o-py/h2o/estimators/glm.py
def makeGLMModel(model, coefs, threshold=.5): """ Create a custom GLM model using the given coefficients. Needs to be passed source model trained on the dataset to extract the dataset information from. :param model: source model, used for extracting dataset information :param c...
def makeGLMModel(model, coefs, threshold=.5): """ Create a custom GLM model using the given coefficients. Needs to be passed source model trained on the dataset to extract the dataset information from. :param model: source model, used for extracting dataset information :param c...
[ "Create", "a", "custom", "GLM", "model", "using", "the", "given", "coefficients", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/glm.py#L879-L898
[ "def", "makeGLMModel", "(", "model", ",", "coefs", ",", "threshold", "=", ".5", ")", ":", "model_json", "=", "h2o", ".", "api", "(", "\"POST /3/MakeGLMModel\"", ",", "data", "=", "{", "\"model\"", ":", "model", ".", "_model_json", "[", "\"model_id\"", "]",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCluster.from_kvs
Create H2OCluster object from a list of key-value pairs. TODO: This method should be moved into the base H2OResponse class.
h2o-py/h2o/backend/cluster.py
def from_kvs(keyvals): """ Create H2OCluster object from a list of key-value pairs. TODO: This method should be moved into the base H2OResponse class. """ obj = H2OCluster() obj._retrieved_at = time.time() for k, v in keyvals: if k in {"__meta", "_exc...
def from_kvs(keyvals): """ Create H2OCluster object from a list of key-value pairs. TODO: This method should be moved into the base H2OResponse class. """ obj = H2OCluster() obj._retrieved_at = time.time() for k, v in keyvals: if k in {"__meta", "_exc...
[ "Create", "H2OCluster", "object", "from", "a", "list", "of", "key", "-", "value", "pairs", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/cluster.py#L34-L48
[ "def", "from_kvs", "(", "keyvals", ")", ":", "obj", "=", "H2OCluster", "(", ")", "obj", ".", "_retrieved_at", "=", "time", ".", "time", "(", ")", "for", "k", ",", "v", "in", "keyvals", ":", "if", "k", "in", "{", "\"__meta\"", ",", "\"_exclude_fields\...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCluster.shutdown
Shut down the server. This method checks if the H2O cluster is still running, and if it does shuts it down (via a REST API call). :param prompt: A logical value indicating whether to prompt the user before shutting down the H2O server.
h2o-py/h2o/backend/cluster.py
def shutdown(self, prompt=False): """ Shut down the server. This method checks if the H2O cluster is still running, and if it does shuts it down (via a REST API call). :param prompt: A logical value indicating whether to prompt the user before shutting down the H2O server. """ ...
def shutdown(self, prompt=False): """ Shut down the server. This method checks if the H2O cluster is still running, and if it does shuts it down (via a REST API call). :param prompt: A logical value indicating whether to prompt the user before shutting down the H2O server. """ ...
[ "Shut", "down", "the", "server", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/cluster.py#L176-L194
[ "def", "shutdown", "(", "self", ",", "prompt", "=", "False", ")", ":", "if", "not", "self", ".", "is_running", "(", ")", ":", "return", "assert_is_type", "(", "prompt", ",", "bool", ")", "if", "prompt", ":", "question", "=", "\"Are you sure you want to shu...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCluster.is_running
Determine if the H2O cluster is running or not. :returns: True if the cluster is up; False otherwise
h2o-py/h2o/backend/cluster.py
def is_running(self): """ Determine if the H2O cluster is running or not. :returns: True if the cluster is up; False otherwise """ try: if h2o.connection().local_server and not h2o.connection().local_server.is_running(): return False h2o.api("GET /") ...
def is_running(self): """ Determine if the H2O cluster is running or not. :returns: True if the cluster is up; False otherwise """ try: if h2o.connection().local_server and not h2o.connection().local_server.is_running(): return False h2o.api("GET /") ...
[ "Determine", "if", "the", "H2O", "cluster", "is", "running", "or", "not", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/cluster.py#L197-L208
[ "def", "is_running", "(", "self", ")", ":", "try", ":", "if", "h2o", ".", "connection", "(", ")", ".", "local_server", "and", "not", "h2o", ".", "connection", "(", ")", ".", "local_server", ".", "is_running", "(", ")", ":", "return", "False", "h2o", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCluster.show_status
Print current cluster status information. :param detailed: if True, then also print detailed information about each node.
h2o-py/h2o/backend/cluster.py
def show_status(self, detailed=False): """ Print current cluster status information. :param detailed: if True, then also print detailed information about each node. """ if self._retrieved_at + self.REFRESH_INTERVAL < time.time(): # Info is stale, need to refresh ...
def show_status(self, detailed=False): """ Print current cluster status information. :param detailed: if True, then also print detailed information about each node. """ if self._retrieved_at + self.REFRESH_INTERVAL < time.time(): # Info is stale, need to refresh ...
[ "Print", "current", "cluster", "status", "information", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/cluster.py#L211-L258
[ "def", "show_status", "(", "self", ",", "detailed", "=", "False", ")", ":", "if", "self", ".", "_retrieved_at", "+", "self", ".", "REFRESH_INTERVAL", "<", "time", ".", "time", "(", ")", ":", "# Info is stale, need to refresh", "new_info", "=", "h2o", ".", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCluster.list_jobs
List all jobs performed by the cluster.
h2o-py/h2o/backend/cluster.py
def list_jobs(self): """List all jobs performed by the cluster.""" res = h2o.api("GET /3/Jobs") table = [["type"], ["dest"], ["description"], ["status"]] for job in res["jobs"]: job_dest = job["dest"] table[0].append(self._translate_job_type(job_dest["type"])) ...
def list_jobs(self): """List all jobs performed by the cluster.""" res = h2o.api("GET /3/Jobs") table = [["type"], ["dest"], ["description"], ["status"]] for job in res["jobs"]: job_dest = job["dest"] table[0].append(self._translate_job_type(job_dest["type"])) ...
[ "List", "all", "jobs", "performed", "by", "the", "cluster", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/cluster.py#L266-L276
[ "def", "list_jobs", "(", "self", ")", ":", "res", "=", "h2o", ".", "api", "(", "\"GET /3/Jobs\"", ")", "table", "=", "[", "[", "\"type\"", "]", ",", "[", "\"dest\"", "]", ",", "[", "\"description\"", "]", ",", "[", "\"status\"", "]", "]", "for", "j...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCluster.list_timezones
Return the list of all known timezones.
h2o-py/h2o/backend/cluster.py
def list_timezones(self): """Return the list of all known timezones.""" from h2o.expr import ExprNode return h2o.H2OFrame._expr(expr=ExprNode("listTimeZones"))._frame()
def list_timezones(self): """Return the list of all known timezones.""" from h2o.expr import ExprNode return h2o.H2OFrame._expr(expr=ExprNode("listTimeZones"))._frame()
[ "Return", "the", "list", "of", "all", "known", "timezones", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/cluster.py#L303-L306
[ "def", "list_timezones", "(", "self", ")", ":", "from", "h2o", ".", "expr", "import", "ExprNode", "return", "h2o", ".", "H2OFrame", ".", "_expr", "(", "expr", "=", "ExprNode", "(", "\"listTimeZones\"", ")", ")", ".", "_frame", "(", ")" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCluster._fill_from_h2ocluster
Update information in this object from another H2OCluster instance. :param H2OCluster other: source of the new information for this object.
h2o-py/h2o/backend/cluster.py
def _fill_from_h2ocluster(self, other): """ Update information in this object from another H2OCluster instance. :param H2OCluster other: source of the new information for this object. """ self._props = other._props self._retrieved_at = other._retrieved_at other._...
def _fill_from_h2ocluster(self, other): """ Update information in this object from another H2OCluster instance. :param H2OCluster other: source of the new information for this object. """ self._props = other._props self._retrieved_at = other._retrieved_at other._...
[ "Update", "information", "in", "this", "object", "from", "another", "H2OCluster", "instance", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/cluster.py#L313-L322
[ "def", "_fill_from_h2ocluster", "(", "self", ",", "other", ")", ":", "self", ".", "_props", "=", "other", ".", "_props", "self", ".", "_retrieved_at", "=", "other", ".", "_retrieved_at", "other", ".", "_props", "=", "{", "}", "other", ".", "_retrieved_at",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OStackedEnsembleEstimator.metalearner_params
Parameters for metalearner algorithm Type: ``dict`` (default: ``None``). Example: metalearner_gbm_params = {'max_depth': 2, 'col_sample_rate': 0.3}
h2o-py/h2o/estimators/stackedensemble.py
def metalearner_params(self): """ Parameters for metalearner algorithm Type: ``dict`` (default: ``None``). Example: metalearner_gbm_params = {'max_depth': 2, 'col_sample_rate': 0.3} """ if self._parms.get("metalearner_params") != None: metalearner_params_dic...
def metalearner_params(self): """ Parameters for metalearner algorithm Type: ``dict`` (default: ``None``). Example: metalearner_gbm_params = {'max_depth': 2, 'col_sample_rate': 0.3} """ if self._parms.get("metalearner_params") != None: metalearner_params_dic...
[ "Parameters", "for", "metalearner", "algorithm" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/stackedensemble.py#L216-L230
[ "def", "metalearner_params", "(", "self", ")", ":", "if", "self", ".", "_parms", ".", "get", "(", "\"metalearner_params\"", ")", "!=", "None", ":", "metalearner_params_dict", "=", "ast", ".", "literal_eval", "(", "self", ".", "_parms", ".", "get", "(", "\"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
check_obj_has_good_numbers
Represent instance of a class as JSON. Arguments: obj -- any object Return: String that represent JSON-encoded object.
py2/h2o_glm.py
def check_obj_has_good_numbers(obj, hierarchy="", curr_depth=0, max_depth=4, allowNaN=False): """Represent instance of a class as JSON. Arguments: obj -- any object Return: String that represent JSON-encoded object. """ def serialize(obj, hierarchy="", curr_depth=0): """Recursively w...
def check_obj_has_good_numbers(obj, hierarchy="", curr_depth=0, max_depth=4, allowNaN=False): """Represent instance of a class as JSON. Arguments: obj -- any object Return: String that represent JSON-encoded object. """ def serialize(obj, hierarchy="", curr_depth=0): """Recursively w...
[ "Represent", "instance", "of", "a", "class", "as", "JSON", ".", "Arguments", ":", "obj", "--", "any", "object", "Return", ":", "String", "that", "represent", "JSON", "-", "encoded", "object", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_glm.py#L9-L55
[ "def", "check_obj_has_good_numbers", "(", "obj", ",", "hierarchy", "=", "\"\"", ",", "curr_depth", "=", "0", ",", "max_depth", "=", "4", ",", "allowNaN", "=", "False", ")", ":", "def", "serialize", "(", "obj", ",", "hierarchy", "=", "\"\"", ",", "curr_de...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2O.stabilize
Repeatedly test a function waiting for it to return True. Arguments: test_func -- A function that will be run repeatedly error -- A function that will be run to produce an error message it will be called with (node, timeTakenSecs, numberOfRetries) ...
py2/h2o_objects.py
def stabilize(self, test_func, error, timeoutSecs=10, retryDelaySecs=0.5): '''Repeatedly test a function waiting for it to return True. Arguments: test_func -- A function that will be run repeatedly error -- A function that will be run to produce an error message ...
def stabilize(self, test_func, error, timeoutSecs=10, retryDelaySecs=0.5): '''Repeatedly test a function waiting for it to return True. Arguments: test_func -- A function that will be run repeatedly error -- A function that will be run to produce an error message ...
[ "Repeatedly", "test", "a", "function", "waiting", "for", "it", "to", "return", "True", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_objects.py#L293-L325
[ "def", "stabilize", "(", "self", ",", "test_func", ",", "error", ",", "timeoutSecs", "=", "10", ",", "retryDelaySecs", "=", "0.5", ")", ":", "start", "=", "time", ".", "time", "(", ")", "numberOfRetries", "=", "0", "while", "h2o_args", ".", "no_timeout",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
_call_func_bc
Implements transformation of CALL_FUNCTION bc inst to Rapids expression. The implementation follows definition of behavior defined in https://docs.python.org/3/library/dis.html :param nargs: number of arguments including keyword and positional arguments :param idx: index of current instruction on t...
h2o-py/h2o/astfun.py
def _call_func_bc(nargs, idx, ops, keys): """ Implements transformation of CALL_FUNCTION bc inst to Rapids expression. The implementation follows definition of behavior defined in https://docs.python.org/3/library/dis.html :param nargs: number of arguments including keyword and positional argum...
def _call_func_bc(nargs, idx, ops, keys): """ Implements transformation of CALL_FUNCTION bc inst to Rapids expression. The implementation follows definition of behavior defined in https://docs.python.org/3/library/dis.html :param nargs: number of arguments including keyword and positional argum...
[ "Implements", "transformation", "of", "CALL_FUNCTION", "bc", "inst", "to", "Rapids", "expression", ".", "The", "implementation", "follows", "definition", "of", "behavior", "defined", "in", "https", ":", "//", "docs", ".", "python", ".", "org", "/", "3", "/", ...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/astfun.py#L196-L235
[ "def", "_call_func_bc", "(", "nargs", ",", "idx", ",", "ops", ",", "keys", ")", ":", "named_args", "=", "{", "}", "unnamed_args", "=", "[", "]", "args", "=", "[", "]", "# Extract arguments based on calling convention for CALL_FUNCTION_KW", "while", "nargs", ">",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
jobs
Fetch all the jobs or a single job from the /Jobs endpoint.
py2/h2o_ray.py
def jobs(self, job_key=None, timeoutSecs=10, **kwargs): ''' Fetch all the jobs or a single job from the /Jobs endpoint. ''' params_dict = { # 'job_key': job_key } h2o_methods.check_params_update_kwargs(params_dict, kwargs, 'jobs', True) result = self.do_json_request('3/Jobs.json', ti...
def jobs(self, job_key=None, timeoutSecs=10, **kwargs): ''' Fetch all the jobs or a single job from the /Jobs endpoint. ''' params_dict = { # 'job_key': job_key } h2o_methods.check_params_update_kwargs(params_dict, kwargs, 'jobs', True) result = self.do_json_request('3/Jobs.json', ti...
[ "Fetch", "all", "the", "jobs", "or", "a", "single", "job", "from", "the", "/", "Jobs", "endpoint", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L11-L20
[ "def", "jobs", "(", "self", ",", "job_key", "=", "None", ",", "timeoutSecs", "=", "10", ",", "*", "*", "kwargs", ")", ":", "params_dict", "=", "{", "# 'job_key': job_key", "}", "h2o_methods", ".", "check_params_update_kwargs", "(", "params_dict", ",", "kwarg...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
poll_job
Poll a single job from the /Jobs endpoint until it is "status": "DONE" or "CANCELLED" or "FAILED" or we time out.
py2/h2o_ray.py
def poll_job(self, job_key, timeoutSecs=10, retryDelaySecs=0.5, key=None, **kwargs): ''' Poll a single job from the /Jobs endpoint until it is "status": "DONE" or "CANCELLED" or "FAILED" or we time out. ''' params_dict = {} # merge kwargs into params_dict h2o_methods.check_params_update_kwargs(p...
def poll_job(self, job_key, timeoutSecs=10, retryDelaySecs=0.5, key=None, **kwargs): ''' Poll a single job from the /Jobs endpoint until it is "status": "DONE" or "CANCELLED" or "FAILED" or we time out. ''' params_dict = {} # merge kwargs into params_dict h2o_methods.check_params_update_kwargs(p...
[ "Poll", "a", "single", "job", "from", "the", "/", "Jobs", "endpoint", "until", "it", "is", "status", ":", "DONE", "or", "CANCELLED", "or", "FAILED", "or", "we", "time", "out", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L25-L79
[ "def", "poll_job", "(", "self", ",", "job_key", ",", "timeoutSecs", "=", "10", ",", "retryDelaySecs", "=", "0.5", ",", "key", "=", "None", ",", "*", "*", "kwargs", ")", ":", "params_dict", "=", "{", "}", "# merge kwargs into params_dict", "h2o_methods", "....
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
import_files
Import a file or files into h2o. The 'file' parameter accepts a directory or a single file. 192.168.0.37:54323/ImportFiles.html?file=%2Fhome%2F0xdiag%2Fdatasets
py2/h2o_ray.py
def import_files(self, path, timeoutSecs=180): ''' Import a file or files into h2o. The 'file' parameter accepts a directory or a single file. 192.168.0.37:54323/ImportFiles.html?file=%2Fhome%2F0xdiag%2Fdatasets ''' a = self.do_json_request('3/ImportFiles.json', timeout=timeoutSecs, ...
def import_files(self, path, timeoutSecs=180): ''' Import a file or files into h2o. The 'file' parameter accepts a directory or a single file. 192.168.0.37:54323/ImportFiles.html?file=%2Fhome%2F0xdiag%2Fdatasets ''' a = self.do_json_request('3/ImportFiles.json', timeout=timeoutSecs, ...
[ "Import", "a", "file", "or", "files", "into", "h2o", ".", "The", "file", "parameter", "accepts", "a", "directory", "or", "a", "single", "file", ".", "192", ".", "168", ".", "0", ".", "37", ":", "54323", "/", "ImportFiles", ".", "html?file", "=", "%2F...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L82-L93
[ "def", "import_files", "(", "self", ",", "path", ",", "timeoutSecs", "=", "180", ")", ":", "a", "=", "self", ".", "do_json_request", "(", "'3/ImportFiles.json'", ",", "timeout", "=", "timeoutSecs", ",", "params", "=", "{", "\"path\"", ":", "path", "}", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
parse
Parse an imported raw file or files into a Frame.
py2/h2o_ray.py
def parse(self, key, hex_key=None, columnTypeDict=None, timeoutSecs=300, retryDelaySecs=0.2, initialDelaySecs=None, pollTimeoutSecs=180, noise=None, benchmarkLogging=None, noPoll=False, intermediateResults=False, **kwargs): ''' Parse an imported raw file or files into a Frame. ''' # ...
def parse(self, key, hex_key=None, columnTypeDict=None, timeoutSecs=300, retryDelaySecs=0.2, initialDelaySecs=None, pollTimeoutSecs=180, noise=None, benchmarkLogging=None, noPoll=False, intermediateResults=False, **kwargs): ''' Parse an imported raw file or files into a Frame. ''' # ...
[ "Parse", "an", "imported", "raw", "file", "or", "files", "into", "a", "Frame", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L99-L279
[ "def", "parse", "(", "self", ",", "key", ",", "hex_key", "=", "None", ",", "columnTypeDict", "=", "None", ",", "timeoutSecs", "=", "300", ",", "retryDelaySecs", "=", "0.2", ",", "initialDelaySecs", "=", "None", ",", "pollTimeoutSecs", "=", "180", ",", "n...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
frames
Return a single Frame or all of the Frames in the h2o cluster. The frames are contained in a list called "frames" at the top level of the result. Currently the list is unordered. TODO: When find_compatible_models is implemented then the top level dict will also contain a "models" list.
py2/h2o_ray.py
def frames(self, key=None, timeoutSecs=60, **kwargs): if not (key is None or isinstance(key, (basestring, Key))): raise Exception("frames: key should be string or Key type %s %s" % (type(key), key)) params_dict = { 'find_compatible_models': 0, 'row_offset': 0, # is offset working yet? ...
def frames(self, key=None, timeoutSecs=60, **kwargs): if not (key is None or isinstance(key, (basestring, Key))): raise Exception("frames: key should be string or Key type %s %s" % (type(key), key)) params_dict = { 'find_compatible_models': 0, 'row_offset': 0, # is offset working yet? ...
[ "Return", "a", "single", "Frame", "or", "all", "of", "the", "Frames", "in", "the", "h2o", "cluster", ".", "The", "frames", "are", "contained", "in", "a", "list", "called", "frames", "at", "the", "top", "level", "of", "the", "result", ".", "Currently", ...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L285-L313
[ "def", "frames", "(", "self", ",", "key", "=", "None", ",", "timeoutSecs", "=", "60", ",", "*", "*", "kwargs", ")", ":", "if", "not", "(", "key", "is", "None", "or", "isinstance", "(", "key", ",", "(", "basestring", ",", "Key", ")", ")", ")", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
summary
Return the summary for a single column for a single Frame in the h2o cluster.
py2/h2o_ray.py
def summary(self, key, column="C1", timeoutSecs=10, **kwargs): ''' Return the summary for a single column for a single Frame in the h2o cluster. ''' params_dict = { # 'offset': 0, # 'len': 100 } h2o_methods.check_params_update_kwargs(params_dict, kwargs, 'summary', True) ...
def summary(self, key, column="C1", timeoutSecs=10, **kwargs): ''' Return the summary for a single column for a single Frame in the h2o cluster. ''' params_dict = { # 'offset': 0, # 'len': 100 } h2o_methods.check_params_update_kwargs(params_dict, kwargs, 'summary', True) ...
[ "Return", "the", "summary", "for", "a", "single", "column", "for", "a", "single", "Frame", "in", "the", "h2o", "cluster", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L347-L359
[ "def", "summary", "(", "self", ",", "key", ",", "column", "=", "\"C1\"", ",", "timeoutSecs", "=", "10", ",", "*", "*", "kwargs", ")", ":", "params_dict", "=", "{", "# 'offset': 0,", "# 'len': 100", "}", "h2o_methods", ".", "check_params_update_kwargs", "(", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
delete_frame
Delete a frame on the h2o cluster, given its key.
py2/h2o_ray.py
def delete_frame(self, key, ignoreMissingKey=True, timeoutSecs=60, **kwargs): ''' Delete a frame on the h2o cluster, given its key. ''' assert key is not None, '"key" parameter is null' result = self.do_json_request('/3/Frames.json/' + key, cmd='delete', timeout=timeoutSecs) # TODO: look for w...
def delete_frame(self, key, ignoreMissingKey=True, timeoutSecs=60, **kwargs): ''' Delete a frame on the h2o cluster, given its key. ''' assert key is not None, '"key" parameter is null' result = self.do_json_request('/3/Frames.json/' + key, cmd='delete', timeout=timeoutSecs) # TODO: look for w...
[ "Delete", "a", "frame", "on", "the", "h2o", "cluster", "given", "its", "key", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L362-L373
[ "def", "delete_frame", "(", "self", ",", "key", ",", "ignoreMissingKey", "=", "True", ",", "timeoutSecs", "=", "60", ",", "*", "*", "kwargs", ")", ":", "assert", "key", "is", "not", "None", ",", "'\"key\" parameter is null'", "result", "=", "self", ".", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
model_builders
Return a model builder or all of the model builders known to the h2o cluster. The model builders are contained in a dictionary called "model_builders" at the top level of the result. The dictionary maps algorithm names to parameters lists. Each of the parameters contains all the metdata required by a...
py2/h2o_ray.py
def model_builders(self, algo=None, timeoutSecs=10, **kwargs): ''' Return a model builder or all of the model builders known to the h2o cluster. The model builders are contained in a dictionary called "model_builders" at the top level of the result. The dictionary maps algorithm names to parameter...
def model_builders(self, algo=None, timeoutSecs=10, **kwargs): ''' Return a model builder or all of the model builders known to the h2o cluster. The model builders are contained in a dictionary called "model_builders" at the top level of the result. The dictionary maps algorithm names to parameter...
[ "Return", "a", "model", "builder", "or", "all", "of", "the", "model", "builders", "known", "to", "the", "h2o", "cluster", ".", "The", "model", "builders", "are", "contained", "in", "a", "dictionary", "called", "model_builders", "at", "the", "top", "level", ...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L386-L407
[ "def", "model_builders", "(", "self", ",", "algo", "=", "None", ",", "timeoutSecs", "=", "10", ",", "*", "*", "kwargs", ")", ":", "params_dict", "=", "{", "}", "h2o_methods", ".", "check_params_update_kwargs", "(", "params_dict", ",", "kwargs", ",", "'mode...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
validate_model_parameters
Check a dictionary of model builder parameters on the h2o cluster using the given algorithm and model parameters.
py2/h2o_ray.py
def validate_model_parameters(self, algo, training_frame, parameters, timeoutSecs=60, **kwargs): ''' Check a dictionary of model builder parameters on the h2o cluster using the given algorithm and model parameters. ''' assert algo is not None, '"algo" parameter is null' # Allow this now: assert...
def validate_model_parameters(self, algo, training_frame, parameters, timeoutSecs=60, **kwargs): ''' Check a dictionary of model builder parameters on the h2o cluster using the given algorithm and model parameters. ''' assert algo is not None, '"algo" parameter is null' # Allow this now: assert...
[ "Check", "a", "dictionary", "of", "model", "builder", "parameters", "on", "the", "h2o", "cluster", "using", "the", "given", "algorithm", "and", "model", "parameters", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L410-L443
[ "def", "validate_model_parameters", "(", "self", ",", "algo", ",", "training_frame", ",", "parameters", ",", "timeoutSecs", "=", "60", ",", "*", "*", "kwargs", ")", ":", "assert", "algo", "is", "not", "None", ",", "'\"algo\" parameter is null'", "# Allow this no...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
build_model
Build a model on the h2o cluster using the given algorithm, training Frame and model parameters.
py2/h2o_ray.py
def build_model(self, algo, training_frame, parameters, destination_frame=None, model_id=None, timeoutSecs=60, noPoll=False, **kwargs): if 'destination_key' in kwargs: raise Exception('Change destination_key in build_model() to model_id') ''' Build a model on the h2o cluster using the given al...
def build_model(self, algo, training_frame, parameters, destination_frame=None, model_id=None, timeoutSecs=60, noPoll=False, **kwargs): if 'destination_key' in kwargs: raise Exception('Change destination_key in build_model() to model_id') ''' Build a model on the h2o cluster using the given al...
[ "Build", "a", "model", "on", "the", "h2o", "cluster", "using", "the", "given", "algorithm", "training", "Frame", "and", "model", "parameters", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L449-L539
[ "def", "build_model", "(", "self", ",", "algo", ",", "training_frame", ",", "parameters", ",", "destination_frame", "=", "None", ",", "model_id", "=", "None", ",", "timeoutSecs", "=", "60", ",", "noPoll", "=", "False", ",", "*", "*", "kwargs", ")", ":", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
compute_model_metrics
Score a model on the h2o cluster on the given Frame and return only the model metrics.
py2/h2o_ray.py
def compute_model_metrics(self, model, frame, timeoutSecs=60, **kwargs): ''' Score a model on the h2o cluster on the given Frame and return only the model metrics. ''' assert model is not None, '"model" parameter is null' assert frame is not None, '"frame" parameter is null' models = self.mode...
def compute_model_metrics(self, model, frame, timeoutSecs=60, **kwargs): ''' Score a model on the h2o cluster on the given Frame and return only the model metrics. ''' assert model is not None, '"model" parameter is null' assert frame is not None, '"frame" parameter is null' models = self.mode...
[ "Score", "a", "model", "on", "the", "h2o", "cluster", "on", "the", "given", "Frame", "and", "return", "only", "the", "model", "metrics", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L542-L566
[ "def", "compute_model_metrics", "(", "self", ",", "model", ",", "frame", ",", "timeoutSecs", "=", "60", ",", "*", "*", "kwargs", ")", ":", "assert", "model", "is", "not", "None", ",", "'\"model\" parameter is null'", "assert", "frame", "is", "not", "None", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
model_metrics
ModelMetrics list.
py2/h2o_ray.py
def model_metrics(self, timeoutSecs=60, **kwargs): ''' ModelMetrics list. ''' result = self.do_json_request('/3/ModelMetrics.json', cmd='get', timeout=timeoutSecs) h2o_sandbox.check_sandbox_for_errors() return result
def model_metrics(self, timeoutSecs=60, **kwargs): ''' ModelMetrics list. ''' result = self.do_json_request('/3/ModelMetrics.json', cmd='get', timeout=timeoutSecs) h2o_sandbox.check_sandbox_for_errors() return result
[ "ModelMetrics", "list", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L592-L598
[ "def", "model_metrics", "(", "self", ",", "timeoutSecs", "=", "60", ",", "*", "*", "kwargs", ")", ":", "result", "=", "self", ".", "do_json_request", "(", "'/3/ModelMetrics.json'", ",", "cmd", "=", "'get'", ",", "timeout", "=", "timeoutSecs", ")", "h2o_san...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
models
Return all of the models in the h2o cluster, or a single model given its key. The models are contained in a list called "models" at the top level of the result. Currently the list is unordered. TODO: When find_compatible_frames is implemented then the top level dict will also contain a "frames" ...
py2/h2o_ray.py
def models(self, key=None, timeoutSecs=10, **kwargs): ''' Return all of the models in the h2o cluster, or a single model given its key. The models are contained in a list called "models" at the top level of the result. Currently the list is unordered. TODO: When find_compatible_frames is impl...
def models(self, key=None, timeoutSecs=10, **kwargs): ''' Return all of the models in the h2o cluster, or a single model given its key. The models are contained in a list called "models" at the top level of the result. Currently the list is unordered. TODO: When find_compatible_frames is impl...
[ "Return", "all", "of", "the", "models", "in", "the", "h2o", "cluster", "or", "a", "single", "model", "given", "its", "key", ".", "The", "models", "are", "contained", "in", "a", "list", "called", "models", "at", "the", "top", "level", "of", "the", "resu...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L602-L625
[ "def", "models", "(", "self", ",", "key", "=", "None", ",", "timeoutSecs", "=", "10", ",", "*", "*", "kwargs", ")", ":", "params_dict", "=", "{", "'find_compatible_frames'", ":", "False", "}", "h2o_methods", ".", "check_params_update_kwargs", "(", "params_di...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
delete_model
Delete a model on the h2o cluster, given its key.
py2/h2o_ray.py
def delete_model(self, key, ignoreMissingKey=True, timeoutSecs=60, **kwargs): ''' Delete a model on the h2o cluster, given its key. ''' assert key is not None, '"key" parameter is null' result = self.do_json_request('/3/Models.json/' + key, cmd='delete', timeout=timeoutSecs) # TODO: look for w...
def delete_model(self, key, ignoreMissingKey=True, timeoutSecs=60, **kwargs): ''' Delete a model on the h2o cluster, given its key. ''' assert key is not None, '"key" parameter is null' result = self.do_json_request('/3/Models.json/' + key, cmd='delete', timeout=timeoutSecs) # TODO: look for w...
[ "Delete", "a", "model", "on", "the", "h2o", "cluster", "given", "its", "key", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_ray.py#L628-L641
[ "def", "delete_model", "(", "self", ",", "key", ",", "ignoreMissingKey", "=", "True", ",", "timeoutSecs", "=", "60", ",", "*", "*", "kwargs", ")", ":", "assert", "key", "is", "not", "None", ",", "'\"key\" parameter is null'", "result", "=", "self", ".", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCache._tabulate
Pretty tabulated string of all the cached data, and column names
h2o-py/h2o/expr.py
def _tabulate(self, tablefmt="simple", rollups=False, rows=10): """Pretty tabulated string of all the cached data, and column names""" if not self.is_valid(): self.fill(rows=rows) # Pretty print cached data d = collections.OrderedDict() # If also printing the rollup stats, build ...
def _tabulate(self, tablefmt="simple", rollups=False, rows=10): """Pretty tabulated string of all the cached data, and column names""" if not self.is_valid(): self.fill(rows=rows) # Pretty print cached data d = collections.OrderedDict() # If also printing the rollup stats, build ...
[ "Pretty", "tabulated", "string", "of", "all", "the", "cached", "data", "and", "column", "names" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/expr.py#L382-L409
[ "def", "_tabulate", "(", "self", ",", "tablefmt", "=", "\"simple\"", ",", "rollups", "=", "False", ",", "rows", "=", "10", ")", ":", "if", "not", "self", ".", "is_valid", "(", ")", ":", "self", ".", "fill", "(", "rows", "=", "rows", ")", "# Pretty ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
run_instances
Create a new reservation for count instances
py2/ec2_cmd.py
def run_instances(count, ec2_config, region, waitForSSH=True, tags=None): '''Create a new reservation for count instances''' ec2params = inheritparams(ec2_config, EC2_API_RUN_INSTANCE) ec2params.setdefault('min_count', count) ec2params.setdefault('max_count', count) reservation = None conn = e...
def run_instances(count, ec2_config, region, waitForSSH=True, tags=None): '''Create a new reservation for count instances''' ec2params = inheritparams(ec2_config, EC2_API_RUN_INSTANCE) ec2params.setdefault('min_count', count) ec2params.setdefault('max_count', count) reservation = None conn = e...
[ "Create", "a", "new", "reservation", "for", "count", "instances" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/ec2_cmd.py#L144-L190
[ "def", "run_instances", "(", "count", ",", "ec2_config", ",", "region", ",", "waitForSSH", "=", "True", ",", "tags", "=", "None", ")", ":", "ec2params", "=", "inheritparams", "(", "ec2_config", ",", "EC2_API_RUN_INSTANCE", ")", "ec2params", ".", "setdefault", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
terminate_instances
terminate all the instances given by its ids
py2/ec2_cmd.py
def terminate_instances(instances, region): '''terminate all the instances given by its ids''' if not instances: return conn = ec2_connect(region) log("Terminating instances {0}.".format(instances)) conn.terminate_instances(instances) log("Done")
def terminate_instances(instances, region): '''terminate all the instances given by its ids''' if not instances: return conn = ec2_connect(region) log("Terminating instances {0}.".format(instances)) conn.terminate_instances(instances) log("Done")
[ "terminate", "all", "the", "instances", "given", "by", "its", "ids" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/ec2_cmd.py#L200-L206
[ "def", "terminate_instances", "(", "instances", ",", "region", ")", ":", "if", "not", "instances", ":", "return", "conn", "=", "ec2_connect", "(", "region", ")", "log", "(", "\"Terminating instances {0}.\"", ".", "format", "(", "instances", ")", ")", "conn", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
stop_instances
stop all the instances given by its ids
py2/ec2_cmd.py
def stop_instances(instances, region): '''stop all the instances given by its ids''' if not instances: return conn = ec2_connect(region) log("Stopping instances {0}.".format(instances)) conn.stop_instances(instances) log("Done")
def stop_instances(instances, region): '''stop all the instances given by its ids''' if not instances: return conn = ec2_connect(region) log("Stopping instances {0}.".format(instances)) conn.stop_instances(instances) log("Done")
[ "stop", "all", "the", "instances", "given", "by", "its", "ids" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/ec2_cmd.py#L208-L214
[ "def", "stop_instances", "(", "instances", ",", "region", ")", ":", "if", "not", "instances", ":", "return", "conn", "=", "ec2_connect", "(", "region", ")", "log", "(", "\"Stopping instances {0}.\"", ".", "format", "(", "instances", ")", ")", "conn", ".", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
start_instances
Start all the instances given by its ids
py2/ec2_cmd.py
def start_instances(instances, region): '''Start all the instances given by its ids''' if not instances: return conn = ec2_connect(region) log("Starting instances {0}.".format(instances)) conn.start_instances(instances) log("Done")
def start_instances(instances, region): '''Start all the instances given by its ids''' if not instances: return conn = ec2_connect(region) log("Starting instances {0}.".format(instances)) conn.start_instances(instances) log("Done")
[ "Start", "all", "the", "instances", "given", "by", "its", "ids" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/ec2_cmd.py#L216-L222
[ "def", "start_instances", "(", "instances", ",", "region", ")", ":", "if", "not", "instances", ":", "return", "conn", "=", "ec2_connect", "(", "region", ")", "log", "(", "\"Starting instances {0}.\"", ".", "format", "(", "instances", ")", ")", "conn", ".", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
reboot_instances
Reboot all the instances given by its ids
py2/ec2_cmd.py
def reboot_instances(instances, region): '''Reboot all the instances given by its ids''' if not instances: return conn = ec2_connect(region) log("Rebooting instances {0}.".format(instances)) conn.reboot_instances(instances) log("Done")
def reboot_instances(instances, region): '''Reboot all the instances given by its ids''' if not instances: return conn = ec2_connect(region) log("Rebooting instances {0}.".format(instances)) conn.reboot_instances(instances) log("Done")
[ "Reboot", "all", "the", "instances", "given", "by", "its", "ids" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/ec2_cmd.py#L224-L230
[ "def", "reboot_instances", "(", "instances", ",", "region", ")", ":", "if", "not", "instances", ":", "return", "conn", "=", "ec2_connect", "(", "region", ")", "log", "(", "\"Rebooting instances {0}.\"", ".", "format", "(", "instances", ")", ")", "conn", ".",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
wait_for_ssh
Wait for ssh service to appear on given hosts
py2/ec2_cmd.py
def wait_for_ssh(ips, port=22, skipAlive=True, requiredsuccess=3): ''' Wait for ssh service to appear on given hosts''' log('Waiting for SSH on following hosts: {0}'.format(ips)) for ip in ips: if not skipAlive or not ssh_live(ip, port): log('Waiting for SSH on instance {0}...'.format(i...
def wait_for_ssh(ips, port=22, skipAlive=True, requiredsuccess=3): ''' Wait for ssh service to appear on given hosts''' log('Waiting for SSH on following hosts: {0}'.format(ips)) for ip in ips: if not skipAlive or not ssh_live(ip, port): log('Waiting for SSH on instance {0}...'.format(i...
[ "Wait", "for", "ssh", "service", "to", "appear", "on", "given", "hosts" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/ec2_cmd.py#L232-L245
[ "def", "wait_for_ssh", "(", "ips", ",", "port", "=", "22", ",", "skipAlive", "=", "True", ",", "requiredsuccess", "=", "3", ")", ":", "log", "(", "'Waiting for SSH on following hosts: {0}'", ".", "format", "(", "ips", ")", ")", "for", "ip", "in", "ips", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
_except_hook
This is an advanced exception-handling hook function, that is designed to supercede the standard Python's exception handler. It offers several enhancements: * Clearer and more readable format for the exception message and the traceback. * Decorators are filtered out from the traceback (if they decla...
h2o-py/h2o/utils/debugging.py
def _except_hook(exc_type, exc_value, exc_tb): """ This is an advanced exception-handling hook function, that is designed to supercede the standard Python's exception handler. It offers several enhancements: * Clearer and more readable format for the exception message and the traceback. * De...
def _except_hook(exc_type, exc_value, exc_tb): """ This is an advanced exception-handling hook function, that is designed to supercede the standard Python's exception handler. It offers several enhancements: * Clearer and more readable format for the exception message and the traceback. * De...
[ "This", "is", "an", "advanced", "exception", "-", "handling", "hook", "function", "that", "is", "designed", "to", "supercede", "the", "standard", "Python", "s", "exception", "handler", ".", "It", "offers", "several", "enhancements", ":", "*", "Clearer", "and",...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/debugging.py#L35-L198
[ "def", "_except_hook", "(", "exc_type", ",", "exc_value", ",", "exc_tb", ")", ":", "if", "isinstance", "(", "exc_value", ",", "H2OJobCancelled", ")", ":", "return", "if", "isinstance", "(", "exc_value", ",", "H2OSoftError", ")", ":", "_handle_soft_error", "(",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
_get_method_full_name
Return fully qualified function name. This method will attempt to find "full name" of the given function object. This full name is either of the form "<class name>.<method name>" if the function is a class method, or "<module name>.<func name>" if it's a regular function. Thus, this is an attempt to back-p...
h2o-py/h2o/utils/debugging.py
def _get_method_full_name(func): """ Return fully qualified function name. This method will attempt to find "full name" of the given function object. This full name is either of the form "<class name>.<method name>" if the function is a class method, or "<module name>.<func name>" if it's a regular...
def _get_method_full_name(func): """ Return fully qualified function name. This method will attempt to find "full name" of the given function object. This full name is either of the form "<class name>.<method name>" if the function is a class method, or "<module name>.<func name>" if it's a regular...
[ "Return", "fully", "qualified", "function", "name", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/debugging.py#L238-L265
[ "def", "_get_method_full_name", "(", "func", ")", ":", "# Python 3.3 already has this information available...", "if", "hasattr", "(", "func", ",", "\"__qualname__\"", ")", ":", "return", "func", ".", "__qualname__", "module", "=", "inspect", ".", "getmodule", "(", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
_find_function_from_code
Given a frame and a compiled function code, find the corresponding function object within the frame. This function addresses the following problem: when handling a stacktrace, we receive information about which piece of code was being executed in the form of a CodeType object. That objects contains function na...
h2o-py/h2o/utils/debugging.py
def _find_function_from_code(frame, code): """ Given a frame and a compiled function code, find the corresponding function object within the frame. This function addresses the following problem: when handling a stacktrace, we receive information about which piece of code was being executed in the form ...
def _find_function_from_code(frame, code): """ Given a frame and a compiled function code, find the corresponding function object within the frame. This function addresses the following problem: when handling a stacktrace, we receive information about which piece of code was being executed in the form ...
[ "Given", "a", "frame", "and", "a", "compiled", "function", "code", "find", "the", "corresponding", "function", "object", "within", "the", "frame", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/debugging.py#L268-L304
[ "def", "_find_function_from_code", "(", "frame", ",", "code", ")", ":", "def", "find_code", "(", "iterable", ",", "depth", "=", "0", ")", ":", "if", "depth", ">", "3", ":", "return", "# Avoid potential infinite loops, or generally objects that are too deep.", "for",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
_get_args_str
Return function's declared arguments as a string. For example for this function it returns "func, highlight=None"; for the ``_wrap`` function it returns "text, wrap_at=120, indent=4". This should usually coincide with the function's declaration (the part which is inside the parentheses).
h2o-py/h2o/utils/debugging.py
def _get_args_str(func, highlight=None): """ Return function's declared arguments as a string. For example for this function it returns "func, highlight=None"; for the ``_wrap`` function it returns "text, wrap_at=120, indent=4". This should usually coincide with the function's declaration (the part ...
def _get_args_str(func, highlight=None): """ Return function's declared arguments as a string. For example for this function it returns "func, highlight=None"; for the ``_wrap`` function it returns "text, wrap_at=120, indent=4". This should usually coincide with the function's declaration (the part ...
[ "Return", "function", "s", "declared", "arguments", "as", "a", "string", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/debugging.py#L307-L319
[ "def", "_get_args_str", "(", "func", ",", "highlight", "=", "None", ")", ":", "if", "not", "func", ":", "return", "\"\"", "s", "=", "str", "(", "inspect", ".", "signature", "(", "func", ")", ")", "[", "1", ":", "-", "1", "]", "if", "highlight", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
_wrap
Return piece of text, wrapped around if needed. :param text: text that may be too long and then needs to be wrapped. :param wrap_at: the maximum line length. :param indent: number of spaces to prepend to all subsequent lines after the first.
h2o-py/h2o/utils/debugging.py
def _wrap(text, wrap_at=120, indent=4): """ Return piece of text, wrapped around if needed. :param text: text that may be too long and then needs to be wrapped. :param wrap_at: the maximum line length. :param indent: number of spaces to prepend to all subsequent lines after the first. """ o...
def _wrap(text, wrap_at=120, indent=4): """ Return piece of text, wrapped around if needed. :param text: text that may be too long and then needs to be wrapped. :param wrap_at: the maximum line length. :param indent: number of spaces to prepend to all subsequent lines after the first. """ o...
[ "Return", "piece", "of", "text", "wrapped", "around", "if", "needed", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/debugging.py#L322-L344
[ "def", "_wrap", "(", "text", ",", "wrap_at", "=", "120", ",", "indent", "=", "4", ")", ":", "out", "=", "\"\"", "curr_line_length", "=", "indent", "space_needed", "=", "False", "for", "word", "in", "text", ".", "split", "(", ")", ":", "if", "curr_lin...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
jenkins_h2o_port_allocate
input: jenkins environment variable EXECUTOR_NUMBER output: creates ./BASE_PORT.sh, that you should 'source ./PORT.sh' (can't see the env. variables directly from python?) which will create os environment variables H2O_PORT and H2O_PORT_OFFSET (legacy) internal state for this script that can b...
py2/jenkins_h2o_port_allocate.py
def jenkins_h2o_port_allocate(): """ input: jenkins environment variable EXECUTOR_NUMBER output: creates ./BASE_PORT.sh, that you should 'source ./PORT.sh' (can't see the env. variables directly from python?) which will create os environment variables H2O_PORT and H2O_PORT_OFFSET (legacy) ...
def jenkins_h2o_port_allocate(): """ input: jenkins environment variable EXECUTOR_NUMBER output: creates ./BASE_PORT.sh, that you should 'source ./PORT.sh' (can't see the env. variables directly from python?) which will create os environment variables H2O_PORT and H2O_PORT_OFFSET (legacy) ...
[ "input", ":", "jenkins", "environment", "variable", "EXECUTOR_NUMBER", "output", ":", "creates", ".", "/", "BASE_PORT", ".", "sh", "that", "you", "should", "source", ".", "/", "PORT", ".", "sh", "(", "can", "t", "see", "the", "env", ".", "variables", "di...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/jenkins_h2o_port_allocate.py#L38-L88
[ "def", "jenkins_h2o_port_allocate", "(", ")", ":", "if", "os", ".", "environ", ".", "has_key", "(", "\"EXECUTOR_NUMBER\"", ")", ":", "# this will fail if it's not an integer", "executor", "=", "int", "(", "os", ".", "environ", "[", "\"EXECUTOR_NUMBER\"", "]", ")",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OEstimator.start
Train the model asynchronously (to block for results call :meth:`join`). :param x: A list of column names or indices indicating the predictor columns. :param y: An index or a column name indicating the response column. :param H2OFrame training_frame: The H2OFrame having the columns indicated by...
h2o-py/h2o/estimators/estimator_base.py
def start(self, x, y=None, training_frame=None, offset_column=None, fold_column=None, weights_column=None, validation_frame=None, **params): """ Train the model asynchronously (to block for results call :meth:`join`). :param x: A list of column names or indices indicating the pred...
def start(self, x, y=None, training_frame=None, offset_column=None, fold_column=None, weights_column=None, validation_frame=None, **params): """ Train the model asynchronously (to block for results call :meth:`join`). :param x: A list of column names or indices indicating the pred...
[ "Train", "the", "model", "asynchronously", "(", "to", "block", "for", "results", "call", ":", "meth", ":", "join", ")", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/estimator_base.py#L53-L76
[ "def", "start", "(", "self", ",", "x", ",", "y", "=", "None", ",", "training_frame", "=", "None", ",", "offset_column", "=", "None", ",", "fold_column", "=", "None", ",", "weights_column", "=", "None", ",", "validation_frame", "=", "None", ",", "*", "*...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OEstimator.join
Wait until job's completion.
h2o-py/h2o/estimators/estimator_base.py
def join(self): """Wait until job's completion.""" self._future = False self._job.poll() model_key = self._job.dest_key self._job = None model_json = h2o.api("GET /%d/Models/%s" % (self._rest_version, model_key))["models"][0] self._resolve_model(model_key, model_j...
def join(self): """Wait until job's completion.""" self._future = False self._job.poll() model_key = self._job.dest_key self._job = None model_json = h2o.api("GET /%d/Models/%s" % (self._rest_version, model_key))["models"][0] self._resolve_model(model_key, model_j...
[ "Wait", "until", "job", "s", "completion", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/estimator_base.py#L79-L86
[ "def", "join", "(", "self", ")", ":", "self", ".", "_future", "=", "False", "self", ".", "_job", ".", "poll", "(", ")", "model_key", "=", "self", ".", "_job", ".", "dest_key", "self", ".", "_job", "=", "None", "model_json", "=", "h2o", ".", "api", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OEstimator.train
Train the H2O model. :param x: A list of column names or indices indicating the predictor columns. :param y: An index or a column name indicating the response column. :param H2OFrame training_frame: The H2OFrame having the columns indicated by x and y (as well as any additional colu...
h2o-py/h2o/estimators/estimator_base.py
def train(self, x=None, y=None, training_frame=None, offset_column=None, fold_column=None, weights_column=None, validation_frame=None, max_runtime_secs=None, ignored_columns=None, model_id=None, verbose=False): """ Train the H2O model. :param x: A list of column name...
def train(self, x=None, y=None, training_frame=None, offset_column=None, fold_column=None, weights_column=None, validation_frame=None, max_runtime_secs=None, ignored_columns=None, model_id=None, verbose=False): """ Train the H2O model. :param x: A list of column name...
[ "Train", "the", "H2O", "model", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/estimator_base.py#L89-L109
[ "def", "train", "(", "self", ",", "x", "=", "None", ",", "y", "=", "None", ",", "training_frame", "=", "None", ",", "offset_column", "=", "None", ",", "fold_column", "=", "None", ",", "weights_column", "=", "None", ",", "validation_frame", "=", "None", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OEstimator.fit
Fit an H2O model as part of a scikit-learn pipeline or grid search. A warning will be issued if a caller other than sklearn attempts to use this method. :param H2OFrame X: An H2OFrame consisting of the predictor variables. :param H2OFrame y: An H2OFrame consisting of the response variable. ...
h2o-py/h2o/estimators/estimator_base.py
def fit(self, X, y=None, **params): """ Fit an H2O model as part of a scikit-learn pipeline or grid search. A warning will be issued if a caller other than sklearn attempts to use this method. :param H2OFrame X: An H2OFrame consisting of the predictor variables. :param H2OFrame...
def fit(self, X, y=None, **params): """ Fit an H2O model as part of a scikit-learn pipeline or grid search. A warning will be issued if a caller other than sklearn attempts to use this method. :param H2OFrame X: An H2OFrame consisting of the predictor variables. :param H2OFrame...
[ "Fit", "an", "H2O", "model", "as", "part", "of", "a", "scikit", "-", "learn", "pipeline", "or", "grid", "search", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/estimator_base.py#L325-L350
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "params", ")", ":", "stk", "=", "inspect", ".", "stack", "(", ")", "[", "1", ":", "]", "warn", "=", "True", "for", "s", "in", "stk", ":", "mod", "=", "inspect", ".",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OEstimator.get_params
Obtain parameters for this estimator. Used primarily for sklearn Pipelines and sklearn grid search. :param deep: If True, return parameters of all sub-objects that are estimators. :returns: A dict of parameters
h2o-py/h2o/estimators/estimator_base.py
def get_params(self, deep=True): """ Obtain parameters for this estimator. Used primarily for sklearn Pipelines and sklearn grid search. :param deep: If True, return parameters of all sub-objects that are estimators. :returns: A dict of parameters """ out = dic...
def get_params(self, deep=True): """ Obtain parameters for this estimator. Used primarily for sklearn Pipelines and sklearn grid search. :param deep: If True, return parameters of all sub-objects that are estimators. :returns: A dict of parameters """ out = dic...
[ "Obtain", "parameters", "for", "this", "estimator", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/estimator_base.py#L353-L369
[ "def", "get_params", "(", "self", ",", "deep", "=", "True", ")", ":", "out", "=", "dict", "(", ")", "for", "key", ",", "value", "in", "self", ".", "parms", ".", "items", "(", ")", ":", "if", "deep", "and", "isinstance", "(", "value", ",", "H2OEst...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OEstimator.convert_H2OXGBoostParams_2_XGBoostParams
In order to use convert_H2OXGBoostParams_2_XGBoostParams and convert_H2OFrame_2_DMatrix, you must import the following toolboxes: xgboost, pandas, numpy and scipy.sparse. Given an H2OXGBoost model, this method will generate the corresponding parameters that should be used by native XGBoost in o...
h2o-py/h2o/estimators/estimator_base.py
def convert_H2OXGBoostParams_2_XGBoostParams(self): ''' In order to use convert_H2OXGBoostParams_2_XGBoostParams and convert_H2OFrame_2_DMatrix, you must import the following toolboxes: xgboost, pandas, numpy and scipy.sparse. Given an H2OXGBoost model, this method will generate the cor...
def convert_H2OXGBoostParams_2_XGBoostParams(self): ''' In order to use convert_H2OXGBoostParams_2_XGBoostParams and convert_H2OFrame_2_DMatrix, you must import the following toolboxes: xgboost, pandas, numpy and scipy.sparse. Given an H2OXGBoost model, this method will generate the cor...
[ "In", "order", "to", "use", "convert_H2OXGBoostParams_2_XGBoostParams", "and", "convert_H2OFrame_2_DMatrix", "you", "must", "import", "the", "following", "toolboxes", ":", "xgboost", "pandas", "numpy", "and", "scipy", ".", "sparse", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/estimator_base.py#L429-L468
[ "def", "convert_H2OXGBoostParams_2_XGBoostParams", "(", "self", ")", ":", "import", "xgboost", "as", "xgb", "nativeParams", "=", "self", ".", "_model_json", "[", "\"output\"", "]", "[", "\"native_parameters\"", "]", "nativeXGBoostParams", "=", "dict", "(", ")", "f...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OEstimator._check_and_save_parm
If a parameter is not stored in parms dict save it there (even though the value is None). Else check if the parameter has been already set during initialization of estimator. If yes, check the new value is the same or not. If the values are different, set the last passed value to params dict and throw UserWarni...
h2o-py/h2o/estimators/estimator_base.py
def _check_and_save_parm(self, parms, parameter_name, parameter_value): """ If a parameter is not stored in parms dict save it there (even though the value is None). Else check if the parameter has been already set during initialization of estimator. If yes, check the new value is the same or no...
def _check_and_save_parm(self, parms, parameter_name, parameter_value): """ If a parameter is not stored in parms dict save it there (even though the value is None). Else check if the parameter has been already set during initialization of estimator. If yes, check the new value is the same or no...
[ "If", "a", "parameter", "is", "not", "stored", "in", "parms", "dict", "save", "it", "there", "(", "even", "though", "the", "value", "is", "None", ")", ".", "Else", "check", "if", "the", "parameter", "has", "been", "already", "set", "during", "initializat...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/estimator_base.py#L470-L479
[ "def", "_check_and_save_parm", "(", "self", ",", "parms", ",", "parameter_name", ",", "parameter_value", ")", ":", "if", "parameter_name", "not", "in", "parms", ":", "parms", "[", "parameter_name", "]", "=", "parameter_value", "elif", "parameter_value", "is", "n...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
is_rdemo
Return True if file_name matches a regexp for an R demo. False otherwise. :param file_name: file to test
scripts/run.py
def is_rdemo(file_name): """ Return True if file_name matches a regexp for an R demo. False otherwise. :param file_name: file to test """ packaged_demos = ["h2o.anomaly.R", "h2o.deeplearning.R", "h2o.gbm.R", "h2o.glm.R", "h2o.glrm.R", "h2o.kmeans.R", "h2o.naiveBayes.R", "h2o.p...
def is_rdemo(file_name): """ Return True if file_name matches a regexp for an R demo. False otherwise. :param file_name: file to test """ packaged_demos = ["h2o.anomaly.R", "h2o.deeplearning.R", "h2o.gbm.R", "h2o.glm.R", "h2o.glrm.R", "h2o.kmeans.R", "h2o.naiveBayes.R", "h2o.p...
[ "Return", "True", "if", "file_name", "matches", "a", "regexp", "for", "an", "R", "demo", ".", "False", "otherwise", ".", ":", "param", "file_name", ":", "file", "to", "test" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L31-L40
[ "def", "is_rdemo", "(", "file_name", ")", ":", "packaged_demos", "=", "[", "\"h2o.anomaly.R\"", ",", "\"h2o.deeplearning.R\"", ",", "\"h2o.gbm.R\"", ",", "\"h2o.glm.R\"", ",", "\"h2o.glrm.R\"", ",", "\"h2o.kmeans.R\"", ",", "\"h2o.naiveBayes.R\"", ",", "\"h2o.prcomp.R\"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
is_ipython_notebook
Return True if file_name matches a regexp for an ipython notebook. False otherwise. :param file_name: file to test
scripts/run.py
def is_ipython_notebook(file_name): """ Return True if file_name matches a regexp for an ipython notebook. False otherwise. :param file_name: file to test """ if (not re.match("^.*checkpoint\.ipynb$", file_name)) and re.match("^.*\.ipynb$", file_name): return True return False
def is_ipython_notebook(file_name): """ Return True if file_name matches a regexp for an ipython notebook. False otherwise. :param file_name: file to test """ if (not re.match("^.*checkpoint\.ipynb$", file_name)) and re.match("^.*\.ipynb$", file_name): return True return False
[ "Return", "True", "if", "file_name", "matches", "a", "regexp", "for", "an", "ipython", "notebook", ".", "False", "otherwise", ".", ":", "param", "file_name", ":", "file", "to", "test" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L71-L77
[ "def", "is_ipython_notebook", "(", "file_name", ")", ":", "if", "(", "not", "re", ".", "match", "(", "\"^.*checkpoint\\.ipynb$\"", ",", "file_name", ")", ")", "and", "re", ".", "match", "(", "\"^.*\\.ipynb$\"", ",", "file_name", ")", ":", "return", "True", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
grab_java_message
scan through the java output text and extract the java messages related to running test specified in curr_testname. Parameters ---------- :param node_list: list of H2O nodes List of H2o nodes associated with an H2OCloud (cluster) that are performing the test specified in curr_testname. :param...
scripts/run.py
def grab_java_message(node_list, curr_testname): """scan through the java output text and extract the java messages related to running test specified in curr_testname. Parameters ---------- :param node_list: list of H2O nodes List of H2o nodes associated with an H2OCloud (cluster) that are pe...
def grab_java_message(node_list, curr_testname): """scan through the java output text and extract the java messages related to running test specified in curr_testname. Parameters ---------- :param node_list: list of H2O nodes List of H2o nodes associated with an H2OCloud (cluster) that are pe...
[ "scan", "through", "the", "java", "output", "text", "and", "extract", "the", "java", "messages", "related", "to", "running", "test", "specified", "in", "curr_testname", ".", "Parameters", "----------", ":", "param", "node_list", ":", "list", "of", "H2O", "node...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L121-L178
[ "def", "grab_java_message", "(", "node_list", ",", "curr_testname", ")", ":", "global", "g_java_start_text", "# contains text that describe the start of a unit test.", "java_messages", "=", "\"\"", "start_test", "=", "False", "# denote when the current test was found in the java_*_...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
signal_handler
Helper function to handle caught signals.
scripts/run.py
def signal_handler(signum, stackframe): """Helper function to handle caught signals.""" global g_runner global g_handling_signal if g_handling_signal: # Don't do this recursively. return g_handling_signal = True print("") print("---------------------------------------------...
def signal_handler(signum, stackframe): """Helper function to handle caught signals.""" global g_runner global g_handling_signal if g_handling_signal: # Don't do this recursively. return g_handling_signal = True print("") print("---------------------------------------------...
[ "Helper", "function", "to", "handle", "caught", "signals", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L2073-L2089
[ "def", "signal_handler", "(", "signum", ",", "stackframe", ")", ":", "global", "g_runner", "global", "g_handling_signal", "if", "g_handling_signal", ":", "# Don't do this recursively.", "return", "g_handling_signal", "=", "True", "print", "(", "\"\"", ")", "print", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
usage
Print USAGE help.
scripts/run.py
def usage(): """ Print USAGE help. """ print("") print("Usage: " + g_script_name + " [...options...]") print("") print(" (Output dir is: " + str(g_output_dir) + ")") print(" (Default number of clouds is: " + str(g_num_clouds) + ")") print("") print(" --wipeall Re...
def usage(): """ Print USAGE help. """ print("") print("Usage: " + g_script_name + " [...options...]") print("") print(" (Output dir is: " + str(g_output_dir) + ")") print(" (Default number of clouds is: " + str(g_num_clouds) + ")") print("") print(" --wipeall Re...
[ "Print", "USAGE", "help", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L2092-L2227
[ "def", "usage", "(", ")", ":", "print", "(", "\"\"", ")", "print", "(", "\"Usage: \"", "+", "g_script_name", "+", "\" [...options...]\"", ")", "print", "(", "\"\"", ")", "print", "(", "\" (Output dir is: \"", "+", "str", "(", "g_output_dir", ")", "+", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
parse_args
Parse the arguments into globals (ain't this an ugly duckling?). TODO: replace this machinery with argparse module.
scripts/run.py
def parse_args(argv): """ Parse the arguments into globals (ain't this an ugly duckling?). TODO: replace this machinery with argparse module. """ global g_base_port global g_num_clouds global g_nodes_per_cloud global g_wipe_test_state global g_wipe_output_dir global g_test_to_ru...
def parse_args(argv): """ Parse the arguments into globals (ain't this an ugly duckling?). TODO: replace this machinery with argparse module. """ global g_base_port global g_num_clouds global g_nodes_per_cloud global g_wipe_test_state global g_wipe_output_dir global g_test_to_ru...
[ "Parse", "the", "arguments", "into", "globals", "(", "ain", "t", "this", "an", "ugly", "duckling?", ")", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L2254-L2527
[ "def", "parse_args", "(", "argv", ")", ":", "global", "g_base_port", "global", "g_num_clouds", "global", "g_nodes_per_cloud", "global", "g_wipe_test_state", "global", "g_wipe_output_dir", "global", "g_test_to_run", "global", "g_test_list_file", "global", "g_exclude_list_fil...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
wipe_output_dir
Clear the output directory.
scripts/run.py
def wipe_output_dir(): """Clear the output directory.""" print("Wiping output directory.") try: if os.path.exists(g_output_dir): shutil.rmtree(str(g_output_dir)) except OSError as e: print("ERROR: Removing output directory %s failed: " % g_output_dir) print(" (e...
def wipe_output_dir(): """Clear the output directory.""" print("Wiping output directory.") try: if os.path.exists(g_output_dir): shutil.rmtree(str(g_output_dir)) except OSError as e: print("ERROR: Removing output directory %s failed: " % g_output_dir) print(" (e...
[ "Clear", "the", "output", "directory", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L2530-L2540
[ "def", "wipe_output_dir", "(", ")", ":", "print", "(", "\"Wiping output directory.\"", ")", "try", ":", "if", "os", ".", "path", ".", "exists", "(", "g_output_dir", ")", ":", "shutil", ".", "rmtree", "(", "str", "(", "g_output_dir", ")", ")", "except", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
remove_sandbox
This function is written to remove sandbox directories if they exist under the parent_dir. :param parent_dir: string denoting full parent directory path :param dir_name: string denoting directory path which could be a sandbox :return: None
scripts/run.py
def remove_sandbox(parent_dir, dir_name): """ This function is written to remove sandbox directories if they exist under the parent_dir. :param parent_dir: string denoting full parent directory path :param dir_name: string denoting directory path which could be a sandbox :return: None """ ...
def remove_sandbox(parent_dir, dir_name): """ This function is written to remove sandbox directories if they exist under the parent_dir. :param parent_dir: string denoting full parent directory path :param dir_name: string denoting directory path which could be a sandbox :return: None """ ...
[ "This", "function", "is", "written", "to", "remove", "sandbox", "directories", "if", "they", "exist", "under", "the", "parent_dir", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L2590-L2611
[ "def", "remove_sandbox", "(", "parent_dir", ",", "dir_name", ")", ":", "if", "\"Rsandbox\"", "in", "dir_name", ":", "rsandbox_dir", "=", "os", ".", "path", ".", "join", "(", "parent_dir", ",", "dir_name", ")", "try", ":", "if", "sys", ".", "platform", "=...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
main
Main program. :param argv Command-line arguments :return none
scripts/run.py
def main(argv): """ Main program. :param argv Command-line arguments :return none """ global g_script_name global g_num_clouds global g_nodes_per_cloud global g_output_dir global g_test_to_run global g_test_list_file global g_exclude_list_file global g_test_group ...
def main(argv): """ Main program. :param argv Command-line arguments :return none """ global g_script_name global g_num_clouds global g_nodes_per_cloud global g_output_dir global g_test_to_run global g_test_list_file global g_exclude_list_file global g_test_group ...
[ "Main", "program", ".", ":", "param", "argv", "Command", "-", "line", "arguments", ":", "return", "none" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L2614-L2733
[ "def", "main", "(", "argv", ")", ":", "global", "g_script_name", "global", "g_num_clouds", "global", "g_nodes_per_cloud", "global", "g_output_dir", "global", "g_test_to_run", "global", "g_test_list_file", "global", "g_exclude_list_file", "global", "g_test_group", "global"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCloudNode.start
Start one node of H2O. (Stash away the self.child and self.pid internally here.) :return none
scripts/run.py
def start(self): """ Start one node of H2O. (Stash away the self.child and self.pid internally here.) :return none """ # there is no hdfs currently in ec2, except s3n/hdfs # the core-site.xml provides s3n info # it's possible that we can just always hard...
def start(self): """ Start one node of H2O. (Stash away the self.child and self.pid internally here.) :return none """ # there is no hdfs currently in ec2, except s3n/hdfs # the core-site.xml provides s3n info # it's possible that we can just always hard...
[ "Start", "one", "node", "of", "H2O", ".", "(", "Stash", "away", "the", "self", ".", "child", "and", "self", ".", "pid", "internally", "here", ".", ")" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L314-L415
[ "def", "start", "(", "self", ")", ":", "# there is no hdfs currently in ec2, except s3n/hdfs", "# the core-site.xml provides s3n info", "# it's possible that we can just always hardware the hdfs version", "# to match the cdh3 cluster we're hard-wiring tests to", "# i.e. it won't make s3n/s3 brea...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCloudNode.scrape_port_from_stdout
Look at the stdout log and figure out which port the JVM chose. If successful, port number is stored in self.port; otherwise the program is terminated. This call is blocking, and will wait for up to 30s for the server to start up.
scripts/run.py
def scrape_port_from_stdout(self): """ Look at the stdout log and figure out which port the JVM chose. If successful, port number is stored in self.port; otherwise the program is terminated. This call is blocking, and will wait for up to 30s for the server to start up. "...
def scrape_port_from_stdout(self): """ Look at the stdout log and figure out which port the JVM chose. If successful, port number is stored in self.port; otherwise the program is terminated. This call is blocking, and will wait for up to 30s for the server to start up. "...
[ "Look", "at", "the", "stdout", "log", "and", "figure", "out", "which", "port", "the", "JVM", "chose", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L418-L444
[ "def", "scrape_port_from_stdout", "(", "self", ")", ":", "regex", "=", "re", ".", "compile", "(", "r\"Open H2O Flow in your web browser: https?://([^:]+):(\\d+)\"", ")", "retries_left", "=", "30", "while", "retries_left", "and", "not", "self", ".", "terminated", ":", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCloudNode.scrape_cloudsize_from_stdout
Look at the stdout log and wait until the cluster of proper size is formed. This call is blocking. Exit if this fails. :param nodes_per_cloud: :return none
scripts/run.py
def scrape_cloudsize_from_stdout(self, nodes_per_cloud): """ Look at the stdout log and wait until the cluster of proper size is formed. This call is blocking. Exit if this fails. :param nodes_per_cloud: :return none """ retries = 60 while retries...
def scrape_cloudsize_from_stdout(self, nodes_per_cloud): """ Look at the stdout log and wait until the cluster of proper size is formed. This call is blocking. Exit if this fails. :param nodes_per_cloud: :return none """ retries = 60 while retries...
[ "Look", "at", "the", "stdout", "log", "and", "wait", "until", "the", "cluster", "of", "proper", "size", "is", "formed", ".", "This", "call", "is", "blocking", ".", "Exit", "if", "this", "fails", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L447-L482
[ "def", "scrape_cloudsize_from_stdout", "(", "self", ",", "nodes_per_cloud", ")", ":", "retries", "=", "60", "while", "retries", ">", "0", ":", "if", "self", ".", "terminated", ":", "return", "f", "=", "open", "(", "self", ".", "output_file_name", ",", "\"r...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCloudNode.stop
Normal node shutdown. Ignore failures for now. :return none
scripts/run.py
def stop(self): """ Normal node shutdown. Ignore failures for now. :return none """ if self.pid > 0: print("Killing JVM with PID {}".format(self.pid)) try: self.child.terminate() self.child.wait() except...
def stop(self): """ Normal node shutdown. Ignore failures for now. :return none """ if self.pid > 0: print("Killing JVM with PID {}".format(self.pid)) try: self.child.terminate() self.child.wait() except...
[ "Normal", "node", "shutdown", ".", "Ignore", "failures", "for", "now", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L484-L498
[ "def", "stop", "(", "self", ")", ":", "if", "self", ".", "pid", ">", "0", ":", "print", "(", "\"Killing JVM with PID {}\"", ".", "format", "(", "self", ".", "pid", ")", ")", "try", ":", "self", ".", "child", ".", "terminate", "(", ")", "self", ".",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCloud.start
Start H2O cluster. The cluster is not up until wait_for_cloud_to_be_up() is called and returns. :return none
scripts/run.py
def start(self): """ Start H2O cluster. The cluster is not up until wait_for_cloud_to_be_up() is called and returns. :return none """ for node in self.nodes: node.start() for node in self.client_nodes: node.start()
def start(self): """ Start H2O cluster. The cluster is not up until wait_for_cloud_to_be_up() is called and returns. :return none """ for node in self.nodes: node.start() for node in self.client_nodes: node.start()
[ "Start", "H2O", "cluster", ".", "The", "cluster", "is", "not", "up", "until", "wait_for_cloud_to_be_up", "()", "is", "called", "and", "returns", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L591-L602
[ "def", "start", "(", "self", ")", ":", "for", "node", "in", "self", ".", "nodes", ":", "node", ".", "start", "(", ")", "for", "node", "in", "self", ".", "client_nodes", ":", "node", ".", "start", "(", ")" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCloud.stop
Normal cluster shutdown. :return none
scripts/run.py
def stop(self): """ Normal cluster shutdown. :return none """ for node in self.nodes: node.stop() for node in self.client_nodes: node.stop()
def stop(self): """ Normal cluster shutdown. :return none """ for node in self.nodes: node.stop() for node in self.client_nodes: node.stop()
[ "Normal", "cluster", "shutdown", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L613-L623
[ "def", "stop", "(", "self", ")", ":", "for", "node", "in", "self", ".", "nodes", ":", "node", ".", "stop", "(", ")", "for", "node", "in", "self", ".", "client_nodes", ":", "node", ".", "stop", "(", ")" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCloud.terminate
Terminate a running cluster. (Due to a signal.) :return none
scripts/run.py
def terminate(self): """ Terminate a running cluster. (Due to a signal.) :return none """ for node in self.client_nodes: node.terminate() for node in self.nodes: node.terminate()
def terminate(self): """ Terminate a running cluster. (Due to a signal.) :return none """ for node in self.client_nodes: node.terminate() for node in self.nodes: node.terminate()
[ "Terminate", "a", "running", "cluster", ".", "(", "Due", "to", "a", "signal", ".", ")" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L625-L635
[ "def", "terminate", "(", "self", ")", ":", "for", "node", "in", "self", ".", "client_nodes", ":", "node", ".", "terminate", "(", ")", "for", "node", "in", "self", ".", "nodes", ":", "node", ".", "terminate", "(", ")" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCloud.get_ip
Return an ip to use to talk to this cluster.
scripts/run.py
def get_ip(self): """ Return an ip to use to talk to this cluster. """ if len(self.client_nodes) > 0: node = self.client_nodes[0] else: node = self.nodes[0] return node.get_ip()
def get_ip(self): """ Return an ip to use to talk to this cluster. """ if len(self.client_nodes) > 0: node = self.client_nodes[0] else: node = self.nodes[0] return node.get_ip()
[ "Return", "an", "ip", "to", "use", "to", "talk", "to", "this", "cluster", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L637-L643
[ "def", "get_ip", "(", "self", ")", ":", "if", "len", "(", "self", ".", "client_nodes", ")", ">", "0", ":", "node", "=", "self", ".", "client_nodes", "[", "0", "]", "else", ":", "node", "=", "self", ".", "nodes", "[", "0", "]", "return", "node", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OCloud.get_port
Return a port to use to talk to this cluster.
scripts/run.py
def get_port(self): """ Return a port to use to talk to this cluster. """ if len(self.client_nodes) > 0: node = self.client_nodes[0] else: node = self.nodes[0] return node.get_port()
def get_port(self): """ Return a port to use to talk to this cluster. """ if len(self.client_nodes) > 0: node = self.client_nodes[0] else: node = self.nodes[0] return node.get_port()
[ "Return", "a", "port", "to", "use", "to", "talk", "to", "this", "cluster", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/run.py#L645-L651
[ "def", "get_port", "(", "self", ")", ":", "if", "len", "(", "self", ".", "client_nodes", ")", ">", "0", ":", "node", "=", "self", ".", "client_nodes", "[", "0", "]", "else", ":", "node", "=", "self", ".", "nodes", "[", "0", "]", "return", "node",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
get_file_out
This function will grab one log file from Jenkins and save it to local user directory :param g_jenkins_url: :param build_index: :param airline_java: :param airline_java_tail: :return:
scripts/grabGLRMrunLogs.py
def get_file_out(build_index, python_name, jenkin_name): """ This function will grab one log file from Jenkins and save it to local user directory :param g_jenkins_url: :param build_index: :param airline_java: :param airline_java_tail: :return: """ global g_log_base_dir global g_...
def get_file_out(build_index, python_name, jenkin_name): """ This function will grab one log file from Jenkins and save it to local user directory :param g_jenkins_url: :param build_index: :param airline_java: :param airline_java_tail: :return: """ global g_log_base_dir global g_...
[ "This", "function", "will", "grab", "one", "log", "file", "from", "Jenkins", "and", "save", "it", "to", "local", "user", "directory", ":", "param", "g_jenkins_url", ":", ":", "param", "build_index", ":", ":", "param", "airline_java", ":", ":", "param", "ai...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/grabGLRMrunLogs.py#L48-L70
[ "def", "get_file_out", "(", "build_index", ",", "python_name", ",", "jenkin_name", ")", ":", "global", "g_log_base_dir", "global", "g_jenkins_url", "global", "g_log_base_dir", "directoryB", "=", "g_log_base_dir", "+", "'/Build'", "+", "str", "(", "build_index", ")",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
main
Main program. @return: none
scripts/grabGLRMrunLogs.py
def main(argv): """ Main program. @return: none """ global g_log_base_dir global g_airline_java global g_milsongs_java global g_airline_python global g_milsongs_python global g_jenkins_url global g_airline_py_tail global g_milsongs_py_tail global g_airline_java_tail ...
def main(argv): """ Main program. @return: none """ global g_log_base_dir global g_airline_java global g_milsongs_java global g_airline_python global g_milsongs_python global g_jenkins_url global g_airline_py_tail global g_milsongs_py_tail global g_airline_java_tail ...
[ "Main", "program", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/grabGLRMrunLogs.py#L73-L117
[ "def", "main", "(", "argv", ")", ":", "global", "g_log_base_dir", "global", "g_airline_java", "global", "g_milsongs_java", "global", "g_airline_python", "global", "g_milsongs_python", "global", "g_jenkins_url", "global", "g_airline_py_tail", "global", "g_milsongs_py_tail", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OBinomialModel.plot
Plot training set (and validation set if available) scoring history for an H2OBinomialModel. The timestep and metric arguments are restricted to what is available in its scoring history. :param str timestep: A unit of measurement for the x-axis. :param str metric: A unit of measurement for the...
h2o-py/h2o/model/binomial.py
def plot(self, timestep="AUTO", metric="AUTO", server=False, **kwargs): """ Plot training set (and validation set if available) scoring history for an H2OBinomialModel. The timestep and metric arguments are restricted to what is available in its scoring history. :param str timestep: A ...
def plot(self, timestep="AUTO", metric="AUTO", server=False, **kwargs): """ Plot training set (and validation set if available) scoring history for an H2OBinomialModel. The timestep and metric arguments are restricted to what is available in its scoring history. :param str timestep: A ...
[ "Plot", "training", "set", "(", "and", "validation", "set", "if", "available", ")", "scoring", "history", "for", "an", "H2OBinomialModel", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/binomial.py#L445-L459
[ "def", "plot", "(", "self", ",", "timestep", "=", "\"AUTO\"", ",", "metric", "=", "\"AUTO\"", ",", "server", "=", "False", ",", "*", "*", "kwargs", ")", ":", "assert_is_type", "(", "metric", ",", "\"AUTO\"", ",", "\"logloss\"", ",", "\"auc\"", ",", "\"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OBinomialModel.roc
Return the coordinates of the ROC curve for a given set of data. The coordinates are two-tuples containing the false positive rates as a list and true positive rates as a list. If all are False (default), then return is the training data. If more than one ROC curve is requested, the data is ret...
h2o-py/h2o/model/binomial.py
def roc(self, train=False, valid=False, xval=False): """ Return the coordinates of the ROC curve for a given set of data. The coordinates are two-tuples containing the false positive rates as a list and true positive rates as a list. If all are False (default), then return is the traini...
def roc(self, train=False, valid=False, xval=False): """ Return the coordinates of the ROC curve for a given set of data. The coordinates are two-tuples containing the false positive rates as a list and true positive rates as a list. If all are False (default), then return is the traini...
[ "Return", "the", "coordinates", "of", "the", "ROC", "curve", "for", "a", "given", "set", "of", "data", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/binomial.py#L462-L482
[ "def", "roc", "(", "self", ",", "train", "=", "False", ",", "valid", "=", "False", ",", "xval", "=", "False", ")", ":", "tm", "=", "ModelBase", ".", "_get_metrics", "(", "self", ",", "train", ",", "valid", ",", "xval", ")", "m", "=", "{", "}", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OBinomialModel.find_idx_by_threshold
Retrieve the index in this metric's threshold list at which the given threshold is located. If all are False (default), then return the training metric value. If more than one options is set to True, then return a dictionary of metrics where the keys are "train", "valid", and "xval". :...
h2o-py/h2o/model/binomial.py
def find_idx_by_threshold(self, threshold, train=False, valid=False, xval=False): """ Retrieve the index in this metric's threshold list at which the given threshold is located. If all are False (default), then return the training metric value. If more than one options is set to True, t...
def find_idx_by_threshold(self, threshold, train=False, valid=False, xval=False): """ Retrieve the index in this metric's threshold list at which the given threshold is located. If all are False (default), then return the training metric value. If more than one options is set to True, t...
[ "Retrieve", "the", "index", "in", "this", "metric", "s", "threshold", "list", "at", "which", "the", "given", "threshold", "is", "located", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/binomial.py#L551-L570
[ "def", "find_idx_by_threshold", "(", "self", ",", "threshold", ",", "train", "=", "False", ",", "valid", "=", "False", ",", "xval", "=", "False", ")", ":", "tm", "=", "ModelBase", ".", "_get_metrics", "(", "self", ",", "train", ",", "valid", ",", "xval...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8