partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | TPOTBase.predict | Use the optimized pipeline to predict the target for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
Returns
----------
array-like: {n_samples}
Predicted target for the samples in the feature matri... | tpot/base.py | def predict(self, features):
"""Use the optimized pipeline to predict the target for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
Returns
----------
array-like: {n_samples}
Predicted tar... | def predict(self, features):
"""Use the optimized pipeline to predict the target for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
Returns
----------
array-like: {n_samples}
Predicted tar... | [
"Use",
"the",
"optimized",
"pipeline",
"to",
"predict",
"the",
"target",
"for",
"a",
"feature",
"set",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L897-L916 | [
"def",
"predict",
"(",
"self",
",",
"features",
")",
":",
"if",
"not",
"self",
".",
"fitted_pipeline_",
":",
"raise",
"RuntimeError",
"(",
"'A pipeline has not yet been optimized. Please call fit() first.'",
")",
"features",
"=",
"self",
".",
"_check_dataset",
"(",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase.fit_predict | Call fit and predict in sequence.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples}
List of class labels for prediction
sample_weight: array-like {n_samples}, optional
Per-sample w... | tpot/base.py | def fit_predict(self, features, target, sample_weight=None, groups=None):
"""Call fit and predict in sequence.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples}
List of class labels for predic... | def fit_predict(self, features, target, sample_weight=None, groups=None):
"""Call fit and predict in sequence.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples}
List of class labels for predic... | [
"Call",
"fit",
"and",
"predict",
"in",
"sequence",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L918-L942 | [
"def",
"fit_predict",
"(",
"self",
",",
"features",
",",
"target",
",",
"sample_weight",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"self",
".",
"fit",
"(",
"features",
",",
"target",
",",
"sample_weight",
"=",
"sample_weight",
",",
"groups",
"="... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase.score | Return the score on the given testing data using the user-specified scoring function.
Parameters
----------
testing_features: array-like {n_samples, n_features}
Feature matrix of the testing set
testing_target: array-like {n_samples}
List of class labels for pred... | tpot/base.py | def score(self, testing_features, testing_target):
"""Return the score on the given testing data using the user-specified scoring function.
Parameters
----------
testing_features: array-like {n_samples, n_features}
Feature matrix of the testing set
testing_target: ar... | def score(self, testing_features, testing_target):
"""Return the score on the given testing data using the user-specified scoring function.
Parameters
----------
testing_features: array-like {n_samples, n_features}
Feature matrix of the testing set
testing_target: ar... | [
"Return",
"the",
"score",
"on",
"the",
"given",
"testing",
"data",
"using",
"the",
"user",
"-",
"specified",
"scoring",
"function",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L944-L972 | [
"def",
"score",
"(",
"self",
",",
"testing_features",
",",
"testing_target",
")",
":",
"if",
"self",
".",
"fitted_pipeline_",
"is",
"None",
":",
"raise",
"RuntimeError",
"(",
"'A pipeline has not yet been optimized. Please call fit() first.'",
")",
"testing_features",
"... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase.predict_proba | Use the optimized pipeline to estimate the class probabilities for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix of the testing set
Returns
-------
array-like: {n_samples, n_target}
The class pro... | tpot/base.py | def predict_proba(self, features):
"""Use the optimized pipeline to estimate the class probabilities for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix of the testing set
Returns
-------
array-like: {... | def predict_proba(self, features):
"""Use the optimized pipeline to estimate the class probabilities for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix of the testing set
Returns
-------
array-like: {... | [
"Use",
"the",
"optimized",
"pipeline",
"to",
"estimate",
"the",
"class",
"probabilities",
"for",
"a",
"feature",
"set",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L974-L996 | [
"def",
"predict_proba",
"(",
"self",
",",
"features",
")",
":",
"if",
"not",
"self",
".",
"fitted_pipeline_",
":",
"raise",
"RuntimeError",
"(",
"'A pipeline has not yet been optimized. Please call fit() first.'",
")",
"else",
":",
"if",
"not",
"(",
"hasattr",
"(",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase.clean_pipeline_string | Provide a string of the individual without the parameter prefixes.
Parameters
----------
individual: individual
Individual which should be represented by a pretty string
Returns
-------
A string like str(individual), but with parameter prefixes removed. | tpot/base.py | def clean_pipeline_string(self, individual):
"""Provide a string of the individual without the parameter prefixes.
Parameters
----------
individual: individual
Individual which should be represented by a pretty string
Returns
-------
A string like st... | def clean_pipeline_string(self, individual):
"""Provide a string of the individual without the parameter prefixes.
Parameters
----------
individual: individual
Individual which should be represented by a pretty string
Returns
-------
A string like st... | [
"Provide",
"a",
"string",
"of",
"the",
"individual",
"without",
"the",
"parameter",
"prefixes",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L999-L1021 | [
"def",
"clean_pipeline_string",
"(",
"self",
",",
"individual",
")",
":",
"dirty_string",
"=",
"str",
"(",
"individual",
")",
"# There are many parameter prefixes in the pipeline strings, used solely for",
"# making the terminal name unique, eg. LinearSVC__.",
"parameter_prefixes",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._check_periodic_pipeline | If enough time has passed, save a new optimized pipeline. Currently used in the per generation hook in the optimization loop.
Parameters
----------
gen: int
Generation number
Returns
-------
None | tpot/base.py | def _check_periodic_pipeline(self, gen):
"""If enough time has passed, save a new optimized pipeline. Currently used in the per generation hook in the optimization loop.
Parameters
----------
gen: int
Generation number
Returns
-------
None
"""... | def _check_periodic_pipeline(self, gen):
"""If enough time has passed, save a new optimized pipeline. Currently used in the per generation hook in the optimization loop.
Parameters
----------
gen: int
Generation number
Returns
-------
None
"""... | [
"If",
"enough",
"time",
"has",
"passed",
"save",
"a",
"new",
"optimized",
"pipeline",
".",
"Currently",
"used",
"in",
"the",
"per",
"generation",
"hook",
"in",
"the",
"optimization",
"loop",
".",
"Parameters",
"----------",
"gen",
":",
"int",
"Generation",
"... | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1023-L1044 | [
"def",
"_check_periodic_pipeline",
"(",
"self",
",",
"gen",
")",
":",
"self",
".",
"_update_top_pipeline",
"(",
")",
"if",
"self",
".",
"periodic_checkpoint_folder",
"is",
"not",
"None",
":",
"total_since_last_pipeline_save",
"=",
"(",
"datetime",
".",
"now",
"(... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase.export | Export the optimized pipeline as Python code.
Parameters
----------
output_file_name: string
String containing the path and file name of the desired output file
data_file_path: string (default: '')
By default, the path of input dataset is 'PATH/TO/DATA/FILE' by d... | tpot/base.py | def export(self, output_file_name, data_file_path=''):
"""Export the optimized pipeline as Python code.
Parameters
----------
output_file_name: string
String containing the path and file name of the desired output file
data_file_path: string (default: '')
... | def export(self, output_file_name, data_file_path=''):
"""Export the optimized pipeline as Python code.
Parameters
----------
output_file_name: string
String containing the path and file name of the desired output file
data_file_path: string (default: '')
... | [
"Export",
"the",
"optimized",
"pipeline",
"as",
"Python",
"code",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1086-L1113 | [
"def",
"export",
"(",
"self",
",",
"output_file_name",
",",
"data_file_path",
"=",
"''",
")",
":",
"if",
"self",
".",
"_optimized_pipeline",
"is",
"None",
":",
"raise",
"RuntimeError",
"(",
"'A pipeline has not yet been optimized. Please call fit() first.'",
")",
"to_... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._impute_values | Impute missing values in a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
A feature matrix
Returns
-------
array-like {n_samples, n_features} | tpot/base.py | def _impute_values(self, features):
"""Impute missing values in a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
A feature matrix
Returns
-------
array-like {n_samples, n_features}
"""
if self.verbosit... | def _impute_values(self, features):
"""Impute missing values in a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
A feature matrix
Returns
-------
array-like {n_samples, n_features}
"""
if self.verbosit... | [
"Impute",
"missing",
"values",
"in",
"a",
"feature",
"set",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1116-L1135 | [
"def",
"_impute_values",
"(",
"self",
",",
"features",
")",
":",
"if",
"self",
".",
"verbosity",
">",
"1",
":",
"print",
"(",
"'Imputing missing values in feature set'",
")",
"if",
"self",
".",
"_fitted_imputer",
"is",
"None",
":",
"self",
".",
"_fitted_impute... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._check_dataset | Check if a dataset has a valid feature set and labels.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples} or None
List of class labels for prediction
sample_weight: array-like {n_samples} (opti... | tpot/base.py | def _check_dataset(self, features, target, sample_weight=None):
"""Check if a dataset has a valid feature set and labels.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples} or None
List of clas... | def _check_dataset(self, features, target, sample_weight=None):
"""Check if a dataset has a valid feature set and labels.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples} or None
List of clas... | [
"Check",
"if",
"a",
"dataset",
"has",
"a",
"valid",
"feature",
"set",
"and",
"labels",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1137-L1205 | [
"def",
"_check_dataset",
"(",
"self",
",",
"features",
",",
"target",
",",
"sample_weight",
"=",
"None",
")",
":",
"# Check sample_weight",
"if",
"sample_weight",
"is",
"not",
"None",
":",
"try",
":",
"sample_weight",
"=",
"np",
".",
"array",
"(",
"sample_we... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._compile_to_sklearn | Compile a DEAP pipeline into a sklearn pipeline.
Parameters
----------
expr: DEAP individual
The DEAP pipeline to be compiled
Returns
-------
sklearn_pipeline: sklearn.pipeline.Pipeline | tpot/base.py | def _compile_to_sklearn(self, expr):
"""Compile a DEAP pipeline into a sklearn pipeline.
Parameters
----------
expr: DEAP individual
The DEAP pipeline to be compiled
Returns
-------
sklearn_pipeline: sklearn.pipeline.Pipeline
"""
skle... | def _compile_to_sklearn(self, expr):
"""Compile a DEAP pipeline into a sklearn pipeline.
Parameters
----------
expr: DEAP individual
The DEAP pipeline to be compiled
Returns
-------
sklearn_pipeline: sklearn.pipeline.Pipeline
"""
skle... | [
"Compile",
"a",
"DEAP",
"pipeline",
"into",
"a",
"sklearn",
"pipeline",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1208-L1223 | [
"def",
"_compile_to_sklearn",
"(",
"self",
",",
"expr",
")",
":",
"sklearn_pipeline_str",
"=",
"generate_pipeline_code",
"(",
"expr_to_tree",
"(",
"expr",
",",
"self",
".",
"_pset",
")",
",",
"self",
".",
"operators",
")",
"sklearn_pipeline",
"=",
"eval",
"(",... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._set_param_recursive | Recursively iterate through all objects in the pipeline and set a given parameter.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
parameter: str
The parameter to assign a value for in each... | tpot/base.py | def _set_param_recursive(self, pipeline_steps, parameter, value):
"""Recursively iterate through all objects in the pipeline and set a given parameter.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
... | def _set_param_recursive(self, pipeline_steps, parameter, value):
"""Recursively iterate through all objects in the pipeline and set a given parameter.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
... | [
"Recursively",
"iterate",
"through",
"all",
"objects",
"in",
"the",
"pipeline",
"and",
"set",
"a",
"given",
"parameter",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1225-L1251 | [
"def",
"_set_param_recursive",
"(",
"self",
",",
"pipeline_steps",
",",
"parameter",
",",
"value",
")",
":",
"for",
"(",
"_",
",",
"obj",
")",
"in",
"pipeline_steps",
":",
"recursive_attrs",
"=",
"[",
"'steps'",
",",
"'transformer_list'",
",",
"'estimators'",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._stop_by_max_time_mins | Stop optimization process once maximum minutes have elapsed. | tpot/base.py | def _stop_by_max_time_mins(self):
"""Stop optimization process once maximum minutes have elapsed."""
if self.max_time_mins:
total_mins_elapsed = (datetime.now() - self._start_datetime).total_seconds() / 60.
if total_mins_elapsed >= self.max_time_mins:
raise Keyboa... | def _stop_by_max_time_mins(self):
"""Stop optimization process once maximum minutes have elapsed."""
if self.max_time_mins:
total_mins_elapsed = (datetime.now() - self._start_datetime).total_seconds() / 60.
if total_mins_elapsed >= self.max_time_mins:
raise Keyboa... | [
"Stop",
"optimization",
"process",
"once",
"maximum",
"minutes",
"have",
"elapsed",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1253-L1258 | [
"def",
"_stop_by_max_time_mins",
"(",
"self",
")",
":",
"if",
"self",
".",
"max_time_mins",
":",
"total_mins_elapsed",
"=",
"(",
"datetime",
".",
"now",
"(",
")",
"-",
"self",
".",
"_start_datetime",
")",
".",
"total_seconds",
"(",
")",
"/",
"60.",
"if",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._combine_individual_stats | Combine the stats with operator count and cv score and preprare to be written to _evaluated_individuals
Parameters
----------
operator_count: int
number of components in the pipeline
cv_score: float
internal cross validation score
individual_stats: dictio... | tpot/base.py | def _combine_individual_stats(self, operator_count, cv_score, individual_stats):
"""Combine the stats with operator count and cv score and preprare to be written to _evaluated_individuals
Parameters
----------
operator_count: int
number of components in the pipeline
... | def _combine_individual_stats(self, operator_count, cv_score, individual_stats):
"""Combine the stats with operator count and cv score and preprare to be written to _evaluated_individuals
Parameters
----------
operator_count: int
number of components in the pipeline
... | [
"Combine",
"the",
"stats",
"with",
"operator",
"count",
"and",
"cv",
"score",
"and",
"preprare",
"to",
"be",
"written",
"to",
"_evaluated_individuals"
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1260-L1287 | [
"def",
"_combine_individual_stats",
"(",
"self",
",",
"operator_count",
",",
"cv_score",
",",
"individual_stats",
")",
":",
"stats",
"=",
"deepcopy",
"(",
"individual_stats",
")",
"# Deepcopy, since the string reference to predecessor should be cloned",
"stats",
"[",
"'oper... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._evaluate_individuals | Determine the fit of the provided individuals.
Parameters
----------
population: a list of DEAP individual
One individual is a list of pipeline operators and model parameters that can be
compiled by DEAP into a callable function
features: numpy.ndarray {n_samples... | tpot/base.py | def _evaluate_individuals(self, population, features, target, sample_weight=None, groups=None):
"""Determine the fit of the provided individuals.
Parameters
----------
population: a list of DEAP individual
One individual is a list of pipeline operators and model parameters t... | def _evaluate_individuals(self, population, features, target, sample_weight=None, groups=None):
"""Determine the fit of the provided individuals.
Parameters
----------
population: a list of DEAP individual
One individual is a list of pipeline operators and model parameters t... | [
"Determine",
"the",
"fit",
"of",
"the",
"provided",
"individuals",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1289-L1407 | [
"def",
"_evaluate_individuals",
"(",
"self",
",",
"population",
",",
"features",
",",
"target",
",",
"sample_weight",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"# Evaluate the individuals with an invalid fitness",
"individuals",
"=",
"[",
"ind",
"for",
"i... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._preprocess_individuals | Preprocess DEAP individuals before pipeline evaluation.
Parameters
----------
individuals: a list of DEAP individual
One individual is a list of pipeline operators and model parameters that can be
compiled by DEAP into a callable function
Returns
-------... | tpot/base.py | def _preprocess_individuals(self, individuals):
"""Preprocess DEAP individuals before pipeline evaluation.
Parameters
----------
individuals: a list of DEAP individual
One individual is a list of pipeline operators and model parameters that can be
compiled by DEA... | def _preprocess_individuals(self, individuals):
"""Preprocess DEAP individuals before pipeline evaluation.
Parameters
----------
individuals: a list of DEAP individual
One individual is a list of pipeline operators and model parameters that can be
compiled by DEA... | [
"Preprocess",
"DEAP",
"individuals",
"before",
"pipeline",
"evaluation",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1409-L1492 | [
"def",
"_preprocess_individuals",
"(",
"self",
",",
"individuals",
")",
":",
"# update self._pbar.total",
"if",
"not",
"(",
"self",
".",
"max_time_mins",
"is",
"None",
")",
"and",
"not",
"self",
".",
"_pbar",
".",
"disable",
"and",
"self",
".",
"_pbar",
".",... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._update_evaluated_individuals_ | Update self.evaluated_individuals_ and error message during pipeline evaluation.
Parameters
----------
result_score_list: list
A list of CV scores for evaluated pipelines
eval_individuals_str: list
A list of strings for evaluated pipelines
operator_counts... | tpot/base.py | def _update_evaluated_individuals_(self, result_score_list, eval_individuals_str, operator_counts, stats_dicts):
"""Update self.evaluated_individuals_ and error message during pipeline evaluation.
Parameters
----------
result_score_list: list
A list of CV scores for evaluate... | def _update_evaluated_individuals_(self, result_score_list, eval_individuals_str, operator_counts, stats_dicts):
"""Update self.evaluated_individuals_ and error message during pipeline evaluation.
Parameters
----------
result_score_list: list
A list of CV scores for evaluate... | [
"Update",
"self",
".",
"evaluated_individuals_",
"and",
"error",
"message",
"during",
"pipeline",
"evaluation",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1494-L1519 | [
"def",
"_update_evaluated_individuals_",
"(",
"self",
",",
"result_score_list",
",",
"eval_individuals_str",
",",
"operator_counts",
",",
"stats_dicts",
")",
":",
"for",
"result_score",
",",
"individual_str",
"in",
"zip",
"(",
"result_score_list",
",",
"eval_individuals... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._update_pbar | Update self._pbar and error message during pipeline evaluation.
Parameters
----------
pbar_num: int
How many pipelines has been processed
pbar_msg: None or string
Error message
Returns
-------
None | tpot/base.py | def _update_pbar(self, pbar_num=1, pbar_msg=None):
"""Update self._pbar and error message during pipeline evaluation.
Parameters
----------
pbar_num: int
How many pipelines has been processed
pbar_msg: None or string
Error message
Returns
... | def _update_pbar(self, pbar_num=1, pbar_msg=None):
"""Update self._pbar and error message during pipeline evaluation.
Parameters
----------
pbar_num: int
How many pipelines has been processed
pbar_msg: None or string
Error message
Returns
... | [
"Update",
"self",
".",
"_pbar",
"and",
"error",
"message",
"during",
"pipeline",
"evaluation",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1521-L1539 | [
"def",
"_update_pbar",
"(",
"self",
",",
"pbar_num",
"=",
"1",
",",
"pbar_msg",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"_pbar",
",",
"type",
"(",
"None",
")",
")",
":",
"if",
"self",
".",
"verbosity",
">",
"2",
"and",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._random_mutation_operator | Perform a replacement, insertion, or shrink mutation on an individual.
Parameters
----------
individual: DEAP individual
A list of pipeline operators and model parameters that can be
compiled by DEAP into a callable function
allow_shrink: bool (True)
... | tpot/base.py | def _random_mutation_operator(self, individual, allow_shrink=True):
"""Perform a replacement, insertion, or shrink mutation on an individual.
Parameters
----------
individual: DEAP individual
A list of pipeline operators and model parameters that can be
compiled ... | def _random_mutation_operator(self, individual, allow_shrink=True):
"""Perform a replacement, insertion, or shrink mutation on an individual.
Parameters
----------
individual: DEAP individual
A list of pipeline operators and model parameters that can be
compiled ... | [
"Perform",
"a",
"replacement",
"insertion",
"or",
"shrink",
"mutation",
"on",
"an",
"individual",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1564-L1623 | [
"def",
"_random_mutation_operator",
"(",
"self",
",",
"individual",
",",
"allow_shrink",
"=",
"True",
")",
":",
"if",
"self",
".",
"tree_structure",
":",
"mutation_techniques",
"=",
"[",
"partial",
"(",
"gp",
".",
"mutInsert",
",",
"pset",
"=",
"self",
".",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._gen_grow_safe | Generate an expression where each leaf might have a different depth between min_ and max_.
Parameters
----------
pset: PrimitiveSetTyped
Primitive set from which primitives are selected.
min_: int
Minimum height of the produced trees.
max_: int
... | tpot/base.py | def _gen_grow_safe(self, pset, min_, max_, type_=None):
"""Generate an expression where each leaf might have a different depth between min_ and max_.
Parameters
----------
pset: PrimitiveSetTyped
Primitive set from which primitives are selected.
min_: int
... | def _gen_grow_safe(self, pset, min_, max_, type_=None):
"""Generate an expression where each leaf might have a different depth between min_ and max_.
Parameters
----------
pset: PrimitiveSetTyped
Primitive set from which primitives are selected.
min_: int
... | [
"Generate",
"an",
"expression",
"where",
"each",
"leaf",
"might",
"have",
"a",
"different",
"depth",
"between",
"min_",
"and",
"max_",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1625-L1650 | [
"def",
"_gen_grow_safe",
"(",
"self",
",",
"pset",
",",
"min_",
",",
"max_",
",",
"type_",
"=",
"None",
")",
":",
"def",
"condition",
"(",
"height",
",",
"depth",
",",
"type_",
")",
":",
"\"\"\"Stop when the depth is equal to height or when a node should be a term... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._operator_count | Count the number of pipeline operators as a measure of pipeline complexity.
Parameters
----------
individual: list
A grown tree with leaves at possibly different depths
dependending on the condition function.
Returns
-------
operator_count: int
... | tpot/base.py | def _operator_count(self, individual):
"""Count the number of pipeline operators as a measure of pipeline complexity.
Parameters
----------
individual: list
A grown tree with leaves at possibly different depths
dependending on the condition function.
Ret... | def _operator_count(self, individual):
"""Count the number of pipeline operators as a measure of pipeline complexity.
Parameters
----------
individual: list
A grown tree with leaves at possibly different depths
dependending on the condition function.
Ret... | [
"Count",
"the",
"number",
"of",
"pipeline",
"operators",
"as",
"a",
"measure",
"of",
"pipeline",
"complexity",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1653-L1672 | [
"def",
"_operator_count",
"(",
"self",
",",
"individual",
")",
":",
"operator_count",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"individual",
")",
")",
":",
"node",
"=",
"individual",
"[",
"i",
"]",
"if",
"type",
"(",
"node",
")",
"is",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._update_val | Update values in the list of result scores and self._pbar during pipeline evaluation.
Parameters
----------
val: float or "Timeout"
CV scores
result_score_list: list
A list of CV scores
Returns
-------
result_score_list: list
... | tpot/base.py | def _update_val(self, val, result_score_list):
"""Update values in the list of result scores and self._pbar during pipeline evaluation.
Parameters
----------
val: float or "Timeout"
CV scores
result_score_list: list
A list of CV scores
Returns
... | def _update_val(self, val, result_score_list):
"""Update values in the list of result scores and self._pbar during pipeline evaluation.
Parameters
----------
val: float or "Timeout"
CV scores
result_score_list: list
A list of CV scores
Returns
... | [
"Update",
"values",
"in",
"the",
"list",
"of",
"result",
"scores",
"and",
"self",
".",
"_pbar",
"during",
"pipeline",
"evaluation",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1674-L1696 | [
"def",
"_update_val",
"(",
"self",
",",
"val",
",",
"result_score_list",
")",
":",
"self",
".",
"_update_pbar",
"(",
")",
"if",
"val",
"==",
"'Timeout'",
":",
"self",
".",
"_update_pbar",
"(",
"pbar_msg",
"=",
"(",
"'Skipped pipeline #{0} due to time out. '",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTBase._generate | Generate a Tree as a list of lists.
The tree is build from the root to the leaves, and it stop growing when
the condition is fulfilled.
Parameters
----------
pset: PrimitiveSetTyped
Primitive set from which primitives are selected.
min_: int
Mini... | tpot/base.py | def _generate(self, pset, min_, max_, condition, type_=None):
"""Generate a Tree as a list of lists.
The tree is build from the root to the leaves, and it stop growing when
the condition is fulfilled.
Parameters
----------
pset: PrimitiveSetTyped
Primitive s... | def _generate(self, pset, min_, max_, condition, type_=None):
"""Generate a Tree as a list of lists.
The tree is build from the root to the leaves, and it stop growing when
the condition is fulfilled.
Parameters
----------
pset: PrimitiveSetTyped
Primitive s... | [
"Generate",
"a",
"Tree",
"as",
"a",
"list",
"of",
"lists",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1699-L1762 | [
"def",
"_generate",
"(",
"self",
",",
"pset",
",",
"min_",
",",
"max_",
",",
"condition",
",",
"type_",
"=",
"None",
")",
":",
"if",
"type_",
"is",
"None",
":",
"type_",
"=",
"pset",
".",
"ret",
"expr",
"=",
"[",
"]",
"height",
"=",
"np",
".",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | CategoricalSelector.transform | Select categorical features and transform them using OneHotEncoder.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
array-like,... | tpot/builtins/feature_transformers.py | def transform(self, X):
"""Select categorical features and transform them using OneHotEncoder.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
... | def transform(self, X):
"""Select categorical features and transform them using OneHotEncoder.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
... | [
"Select",
"categorical",
"features",
"and",
"transform",
"them",
"using",
"OneHotEncoder",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/feature_transformers.py#L63-L83 | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"selected",
"=",
"auto_select_categorical_features",
"(",
"X",
",",
"threshold",
"=",
"self",
".",
"threshold",
")",
"X_sel",
",",
"_",
",",
"n_selected",
",",
"_",
"=",
"_X_selected",
"(",
"X",
",",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | ContinuousSelector.transform | Select continuous features and transform them using PCA.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
array-like, {n_samples... | tpot/builtins/feature_transformers.py | def transform(self, X):
"""Select continuous features and transform them using PCA.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
---... | def transform(self, X):
"""Select continuous features and transform them using PCA.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
---... | [
"Select",
"continuous",
"features",
"and",
"transform",
"them",
"using",
"PCA",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/feature_transformers.py#L140-L160 | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"selected",
"=",
"auto_select_categorical_features",
"(",
"X",
",",
"threshold",
"=",
"self",
".",
"threshold",
")",
"_",
",",
"X_sel",
",",
"n_selected",
",",
"_",
"=",
"_X_selected",
"(",
"X",
",",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | StackingEstimator.fit | Fit the StackingEstimator meta-transformer.
Parameters
----------
X: array-like of shape (n_samples, n_features)
The training input samples.
y: array-like, shape (n_samples,)
The target values (integers that correspond to classes in classification, real numbers i... | tpot/builtins/stacking_estimator.py | def fit(self, X, y=None, **fit_params):
"""Fit the StackingEstimator meta-transformer.
Parameters
----------
X: array-like of shape (n_samples, n_features)
The training input samples.
y: array-like, shape (n_samples,)
The target values (integers that corr... | def fit(self, X, y=None, **fit_params):
"""Fit the StackingEstimator meta-transformer.
Parameters
----------
X: array-like of shape (n_samples, n_features)
The training input samples.
y: array-like, shape (n_samples,)
The target values (integers that corr... | [
"Fit",
"the",
"StackingEstimator",
"meta",
"-",
"transformer",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/stacking_estimator.py#L50-L68 | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
",",
"*",
"*",
"fit_params",
")",
":",
"self",
".",
"estimator",
".",
"fit",
"(",
"X",
",",
"y",
",",
"*",
"*",
"fit_params",
")",
"return",
"self"
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | StackingEstimator.transform | Transform data by adding two synthetic feature(s).
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
X_transformed: array-like, s... | tpot/builtins/stacking_estimator.py | def transform(self, X):
"""Transform data by adding two synthetic feature(s).
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
... | def transform(self, X):
"""Transform data by adding two synthetic feature(s).
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
... | [
"Transform",
"data",
"by",
"adding",
"two",
"synthetic",
"feature",
"(",
"s",
")",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/stacking_estimator.py#L70-L92 | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"X",
"=",
"check_array",
"(",
"X",
")",
"X_transformed",
"=",
"np",
".",
"copy",
"(",
"X",
")",
"# add class probabilities as a synthetic feature",
"if",
"issubclass",
"(",
"self",
".",
"estimator",
".",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | balanced_accuracy | Default scoring function: balanced accuracy.
Balanced accuracy computes each class' accuracy on a per-class basis using a
one-vs-rest encoding, then computes an unweighted average of the class accuracies.
Parameters
----------
y_true: numpy.ndarray {n_samples}
True class labels
y_pred:... | tpot/metrics.py | def balanced_accuracy(y_true, y_pred):
"""Default scoring function: balanced accuracy.
Balanced accuracy computes each class' accuracy on a per-class basis using a
one-vs-rest encoding, then computes an unweighted average of the class accuracies.
Parameters
----------
y_true: numpy.ndarray {n_... | def balanced_accuracy(y_true, y_pred):
"""Default scoring function: balanced accuracy.
Balanced accuracy computes each class' accuracy on a per-class basis using a
one-vs-rest encoding, then computes an unweighted average of the class accuracies.
Parameters
----------
y_true: numpy.ndarray {n_... | [
"Default",
"scoring",
"function",
":",
"balanced",
"accuracy",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/metrics.py#L30-L66 | [
"def",
"balanced_accuracy",
"(",
"y_true",
",",
"y_pred",
")",
":",
"all_classes",
"=",
"list",
"(",
"set",
"(",
"np",
".",
"append",
"(",
"y_true",
",",
"y_pred",
")",
")",
")",
"all_class_accuracies",
"=",
"[",
"]",
"for",
"this_class",
"in",
"all_clas... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | ZeroCount.transform | Transform data by adding two virtual features.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components
is the number of components.
y: None
Unused
Returns
-... | tpot/builtins/zero_count.py | def transform(self, X, y=None):
"""Transform data by adding two virtual features.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components
is the number of components.
y: None
... | def transform(self, X, y=None):
"""Transform data by adding two virtual features.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components
is the number of components.
y: None
... | [
"Transform",
"data",
"by",
"adding",
"two",
"virtual",
"features",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/zero_count.py#L38-L66 | [
"def",
"transform",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
")",
":",
"X",
"=",
"check_array",
"(",
"X",
")",
"n_features",
"=",
"X",
".",
"shape",
"[",
"1",
"]",
"X_transformed",
"=",
"np",
".",
"copy",
"(",
"X",
")",
"non_zero_vector",
"=... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | source_decode | Decode operator source and import operator class.
Parameters
----------
sourcecode: string
a string of operator source (e.g 'sklearn.feature_selection.RFE')
verbose: int, optional (default: 0)
How much information TPOT communicates while it's running.
0 = none, 1 = minimal, 2 = ... | tpot/operator_utils.py | def source_decode(sourcecode, verbose=0):
"""Decode operator source and import operator class.
Parameters
----------
sourcecode: string
a string of operator source (e.g 'sklearn.feature_selection.RFE')
verbose: int, optional (default: 0)
How much information TPOT communicates while ... | def source_decode(sourcecode, verbose=0):
"""Decode operator source and import operator class.
Parameters
----------
sourcecode: string
a string of operator source (e.g 'sklearn.feature_selection.RFE')
verbose: int, optional (default: 0)
How much information TPOT communicates while ... | [
"Decode",
"operator",
"source",
"and",
"import",
"operator",
"class",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/operator_utils.py#L47-L86 | [
"def",
"source_decode",
"(",
"sourcecode",
",",
"verbose",
"=",
"0",
")",
":",
"tmp_path",
"=",
"sourcecode",
".",
"split",
"(",
"'.'",
")",
"op_str",
"=",
"tmp_path",
".",
"pop",
"(",
")",
"import_str",
"=",
"'.'",
".",
"join",
"(",
"tmp_path",
")",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | set_sample_weight | Recursively iterates through all objects in the pipeline and sets sample weight.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
sample_weight: array-like
List of sample weight
Returns
-------
sample_w... | tpot/operator_utils.py | def set_sample_weight(pipeline_steps, sample_weight=None):
"""Recursively iterates through all objects in the pipeline and sets sample weight.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
sample_weight: array-like
... | def set_sample_weight(pipeline_steps, sample_weight=None):
"""Recursively iterates through all objects in the pipeline and sets sample weight.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
sample_weight: array-like
... | [
"Recursively",
"iterates",
"through",
"all",
"objects",
"in",
"the",
"pipeline",
"and",
"sets",
"sample",
"weight",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/operator_utils.py#L89-L114 | [
"def",
"set_sample_weight",
"(",
"pipeline_steps",
",",
"sample_weight",
"=",
"None",
")",
":",
"sample_weight_dict",
"=",
"{",
"}",
"if",
"not",
"isinstance",
"(",
"sample_weight",
",",
"type",
"(",
"None",
")",
")",
":",
"for",
"(",
"pname",
",",
"obj",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | TPOTOperatorClassFactory | Dynamically create operator class.
Parameters
----------
opsourse: string
operator source in config dictionary (key)
opdict: dictionary
operator params in config dictionary (value)
regression: bool
True if it can be used in TPOTRegressor
classification: bool
True... | tpot/operator_utils.py | def TPOTOperatorClassFactory(opsourse, opdict, BaseClass=Operator, ArgBaseClass=ARGType, verbose=0):
"""Dynamically create operator class.
Parameters
----------
opsourse: string
operator source in config dictionary (key)
opdict: dictionary
operator params in config dictionary (value... | def TPOTOperatorClassFactory(opsourse, opdict, BaseClass=Operator, ArgBaseClass=ARGType, verbose=0):
"""Dynamically create operator class.
Parameters
----------
opsourse: string
operator source in config dictionary (key)
opdict: dictionary
operator params in config dictionary (value... | [
"Dynamically",
"create",
"operator",
"class",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/operator_utils.py#L138-L303 | [
"def",
"TPOTOperatorClassFactory",
"(",
"opsourse",
",",
"opdict",
",",
"BaseClass",
"=",
"Operator",
",",
"ArgBaseClass",
"=",
"ARGType",
",",
"verbose",
"=",
"0",
")",
":",
"class_profile",
"=",
"{",
"}",
"dep_op_list",
"=",
"{",
"}",
"# list of nested estim... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | positive_integer | Ensure that the provided value is a positive integer.
Parameters
----------
value: int
The number to evaluate
Returns
-------
value: int
Returns a positive integer | tpot/driver.py | def positive_integer(value):
"""Ensure that the provided value is a positive integer.
Parameters
----------
value: int
The number to evaluate
Returns
-------
value: int
Returns a positive integer
"""
try:
value = int(value)
except Exception:
rais... | def positive_integer(value):
"""Ensure that the provided value is a positive integer.
Parameters
----------
value: int
The number to evaluate
Returns
-------
value: int
Returns a positive integer
"""
try:
value = int(value)
except Exception:
rais... | [
"Ensure",
"that",
"the",
"provided",
"value",
"is",
"a",
"positive",
"integer",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/driver.py#L40-L59 | [
"def",
"positive_integer",
"(",
"value",
")",
":",
"try",
":",
"value",
"=",
"int",
"(",
"value",
")",
"except",
"Exception",
":",
"raise",
"argparse",
".",
"ArgumentTypeError",
"(",
"'Invalid int value: \\'{}\\''",
".",
"format",
"(",
"value",
")",
")",
"if... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | float_range | Ensure that the provided value is a float integer in the range [0., 1.].
Parameters
----------
value: float
The number to evaluate
Returns
-------
value: float
Returns a float in the range (0., 1.) | tpot/driver.py | def float_range(value):
"""Ensure that the provided value is a float integer in the range [0., 1.].
Parameters
----------
value: float
The number to evaluate
Returns
-------
value: float
Returns a float in the range (0., 1.)
"""
try:
value = float(value)
... | def float_range(value):
"""Ensure that the provided value is a float integer in the range [0., 1.].
Parameters
----------
value: float
The number to evaluate
Returns
-------
value: float
Returns a float in the range (0., 1.)
"""
try:
value = float(value)
... | [
"Ensure",
"that",
"the",
"provided",
"value",
"is",
"a",
"float",
"integer",
"in",
"the",
"range",
"[",
"0",
".",
"1",
".",
"]",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/driver.py#L62-L81 | [
"def",
"float_range",
"(",
"value",
")",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"Exception",
":",
"raise",
"argparse",
".",
"ArgumentTypeError",
"(",
"'Invalid float value: \\'{}\\''",
".",
"format",
"(",
"value",
")",
")",
"if"... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | _get_arg_parser | Main function that is called when TPOT is run on the command line. | tpot/driver.py | def _get_arg_parser():
"""Main function that is called when TPOT is run on the command line."""
parser = argparse.ArgumentParser(
description=(
'A Python tool that automatically creates and optimizes machine '
'learning pipelines using genetic programming.'
),
add... | def _get_arg_parser():
"""Main function that is called when TPOT is run on the command line."""
parser = argparse.ArgumentParser(
description=(
'A Python tool that automatically creates and optimizes machine '
'learning pipelines using genetic programming.'
),
add... | [
"Main",
"function",
"that",
"is",
"called",
"when",
"TPOT",
"is",
"run",
"on",
"the",
"command",
"line",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/driver.py#L84-L451 | [
"def",
"_get_arg_parser",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"(",
"'A Python tool that automatically creates and optimizes machine '",
"'learning pipelines using genetic programming.'",
")",
",",
"add_help",
"=",
"False",... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | load_scoring_function | converts mymodule.myfunc in the myfunc
object itself so tpot receives a scoring function | tpot/driver.py | def load_scoring_function(scoring_func):
"""
converts mymodule.myfunc in the myfunc
object itself so tpot receives a scoring function
"""
if scoring_func and ("." in scoring_func):
try:
module_name, func_name = scoring_func.rsplit('.', 1)
module_path = os.getcwd()
... | def load_scoring_function(scoring_func):
"""
converts mymodule.myfunc in the myfunc
object itself so tpot receives a scoring function
"""
if scoring_func and ("." in scoring_func):
try:
module_name, func_name = scoring_func.rsplit('.', 1)
module_path = os.getcwd()
... | [
"converts",
"mymodule",
".",
"myfunc",
"in",
"the",
"myfunc",
"object",
"itself",
"so",
"tpot",
"receives",
"a",
"scoring",
"function"
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/driver.py#L493-L513 | [
"def",
"load_scoring_function",
"(",
"scoring_func",
")",
":",
"if",
"scoring_func",
"and",
"(",
"\".\"",
"in",
"scoring_func",
")",
":",
"try",
":",
"module_name",
",",
"func_name",
"=",
"scoring_func",
".",
"rsplit",
"(",
"'.'",
",",
"1",
")",
"module_path... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | tpot_driver | Perform a TPOT run. | tpot/driver.py | def tpot_driver(args):
"""Perform a TPOT run."""
if args.VERBOSITY >= 2:
_print_args(args)
input_data = _read_data_file(args)
features = input_data.drop(args.TARGET_NAME, axis=1)
training_features, testing_features, training_target, testing_target = \
train_test_split(features, inp... | def tpot_driver(args):
"""Perform a TPOT run."""
if args.VERBOSITY >= 2:
_print_args(args)
input_data = _read_data_file(args)
features = input_data.drop(args.TARGET_NAME, axis=1)
training_features, testing_features, training_target, testing_target = \
train_test_split(features, inp... | [
"Perform",
"a",
"TPOT",
"run",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/driver.py#L516-L574 | [
"def",
"tpot_driver",
"(",
"args",
")",
":",
"if",
"args",
".",
"VERBOSITY",
">=",
"2",
":",
"_print_args",
"(",
"args",
")",
"input_data",
"=",
"_read_data_file",
"(",
"args",
")",
"features",
"=",
"input_data",
".",
"drop",
"(",
"args",
".",
"TARGET_NA... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | FeatureSetSelector.fit | Fit FeatureSetSelector for feature selection
Parameters
----------
X: array-like of shape (n_samples, n_features)
The training input samples.
y: array-like, shape (n_samples,)
The target values (integers that correspond to classes in classification, real numbers ... | tpot/builtins/feature_set_selector.py | def fit(self, X, y=None):
"""Fit FeatureSetSelector for feature selection
Parameters
----------
X: array-like of shape (n_samples, n_features)
The training input samples.
y: array-like, shape (n_samples,)
The target values (integers that correspond to cla... | def fit(self, X, y=None):
"""Fit FeatureSetSelector for feature selection
Parameters
----------
X: array-like of shape (n_samples, n_features)
The training input samples.
y: array-like, shape (n_samples,)
The target values (integers that correspond to cla... | [
"Fit",
"FeatureSetSelector",
"for",
"feature",
"selection"
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/feature_set_selector.py#L66-L114 | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
")",
":",
"subset_df",
"=",
"pd",
".",
"read_csv",
"(",
"self",
".",
"subset_list",
",",
"header",
"=",
"0",
",",
"index_col",
"=",
"0",
")",
"if",
"isinstance",
"(",
"self",
".",
"sel_s... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | FeatureSetSelector.transform | Make subset after fit
Parameters
----------
X: numpy ndarray, {n_samples, n_features}
New data, where n_samples is the number of samples and n_features is the number of features.
Returns
-------
X_transformed: array-like, shape (n_samples, n_features + 1) or... | tpot/builtins/feature_set_selector.py | def transform(self, X):
"""Make subset after fit
Parameters
----------
X: numpy ndarray, {n_samples, n_features}
New data, where n_samples is the number of samples and n_features is the number of features.
Returns
-------
X_transformed: array-like, s... | def transform(self, X):
"""Make subset after fit
Parameters
----------
X: numpy ndarray, {n_samples, n_features}
New data, where n_samples is the number of samples and n_features is the number of features.
Returns
-------
X_transformed: array-like, s... | [
"Make",
"subset",
"after",
"fit"
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/feature_set_selector.py#L116-L134 | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"if",
"isinstance",
"(",
"X",
",",
"pd",
".",
"DataFrame",
")",
":",
"X_transformed",
"=",
"X",
"[",
"self",
".",
"feat_list",
"]",
".",
"values",
"elif",
"isinstance",
"(",
"X",
",",
"np",
".",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | FeatureSetSelector._get_support_mask | Get the boolean mask indicating which features are selected
Returns
-------
support : boolean array of shape [# input features]
An element is True iff its corresponding feature is selected for
retention. | tpot/builtins/feature_set_selector.py | def _get_support_mask(self):
"""
Get the boolean mask indicating which features are selected
Returns
-------
support : boolean array of shape [# input features]
An element is True iff its corresponding feature is selected for
retention.
"""
... | def _get_support_mask(self):
"""
Get the boolean mask indicating which features are selected
Returns
-------
support : boolean array of shape [# input features]
An element is True iff its corresponding feature is selected for
retention.
"""
... | [
"Get",
"the",
"boolean",
"mask",
"indicating",
"which",
"features",
"are",
"selected",
"Returns",
"-------",
"support",
":",
"boolean",
"array",
"of",
"shape",
"[",
"#",
"input",
"features",
"]",
"An",
"element",
"is",
"True",
"iff",
"its",
"corresponding",
... | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/feature_set_selector.py#L136-L150 | [
"def",
"_get_support_mask",
"(",
"self",
")",
":",
"check_is_fitted",
"(",
"self",
",",
"'feat_list_idx'",
")",
"n_features",
"=",
"len",
"(",
"self",
".",
"feature_names",
")",
"mask",
"=",
"np",
".",
"zeros",
"(",
"n_features",
",",
"dtype",
"=",
"bool",... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | pick_two_individuals_eligible_for_crossover | Pick two individuals from the population which can do crossover, that is, they share a primitive.
Parameters
----------
population: array of individuals
Returns
----------
tuple: (individual, individual)
Two individuals which are not the same, but share at least one primitive.
... | tpot/gp_deap.py | def pick_two_individuals_eligible_for_crossover(population):
"""Pick two individuals from the population which can do crossover, that is, they share a primitive.
Parameters
----------
population: array of individuals
Returns
----------
tuple: (individual, individual)
Two individual... | def pick_two_individuals_eligible_for_crossover(population):
"""Pick two individuals from the population which can do crossover, that is, they share a primitive.
Parameters
----------
population: array of individuals
Returns
----------
tuple: (individual, individual)
Two individual... | [
"Pick",
"two",
"individuals",
"from",
"the",
"population",
"which",
"can",
"do",
"crossover",
"that",
"is",
"they",
"share",
"a",
"primitive",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/gp_deap.py#L41-L73 | [
"def",
"pick_two_individuals_eligible_for_crossover",
"(",
"population",
")",
":",
"primitives_by_ind",
"=",
"[",
"set",
"(",
"[",
"node",
".",
"name",
"for",
"node",
"in",
"ind",
"if",
"isinstance",
"(",
"node",
",",
"gp",
".",
"Primitive",
")",
"]",
")",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | mutate_random_individual | Picks a random individual from the population, and performs mutation on a copy of it.
Parameters
----------
population: array of individuals
Returns
----------
individual: individual
An individual which is a mutated copy of one of the individuals in population,
the returned ind... | tpot/gp_deap.py | def mutate_random_individual(population, toolbox):
"""Picks a random individual from the population, and performs mutation on a copy of it.
Parameters
----------
population: array of individuals
Returns
----------
individual: individual
An individual which is a mutated copy of one ... | def mutate_random_individual(population, toolbox):
"""Picks a random individual from the population, and performs mutation on a copy of it.
Parameters
----------
population: array of individuals
Returns
----------
individual: individual
An individual which is a mutated copy of one ... | [
"Picks",
"a",
"random",
"individual",
"from",
"the",
"population",
"and",
"performs",
"mutation",
"on",
"a",
"copy",
"of",
"it",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/gp_deap.py#L76-L93 | [
"def",
"mutate_random_individual",
"(",
"population",
",",
"toolbox",
")",
":",
"idx",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"0",
",",
"len",
"(",
"population",
")",
")",
"ind",
"=",
"population",
"[",
"idx",
"]",
"ind",
",",
"=",
"toolbox",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | varOr | Part of an evolutionary algorithm applying only the variation part
(crossover, mutation **or** reproduction). The modified individuals have
their fitness invalidated. The individuals are cloned so returned
population is independent of the input population.
:param population: A list of individuals to var... | tpot/gp_deap.py | def varOr(population, toolbox, lambda_, cxpb, mutpb):
"""Part of an evolutionary algorithm applying only the variation part
(crossover, mutation **or** reproduction). The modified individuals have
their fitness invalidated. The individuals are cloned so returned
population is independent of the input po... | def varOr(population, toolbox, lambda_, cxpb, mutpb):
"""Part of an evolutionary algorithm applying only the variation part
(crossover, mutation **or** reproduction). The modified individuals have
their fitness invalidated. The individuals are cloned so returned
population is independent of the input po... | [
"Part",
"of",
"an",
"evolutionary",
"algorithm",
"applying",
"only",
"the",
"variation",
"part",
"(",
"crossover",
"mutation",
"**",
"or",
"**",
"reproduction",
")",
".",
"The",
"modified",
"individuals",
"have",
"their",
"fitness",
"invalidated",
".",
"The",
... | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/gp_deap.py#L96-L149 | [
"def",
"varOr",
"(",
"population",
",",
"toolbox",
",",
"lambda_",
",",
"cxpb",
",",
"mutpb",
")",
":",
"offspring",
"=",
"[",
"]",
"for",
"_",
"in",
"range",
"(",
"lambda_",
")",
":",
"op_choice",
"=",
"np",
".",
"random",
".",
"random",
"(",
")",... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | initialize_stats_dict | Initializes the stats dict for individual
The statistics initialized are:
'generation': generation in which the individual was evaluated. Initialized as: 0
'mutation_count': number of mutation operations applied to the individual and its predecessor cumulatively. Initialized as: 0
'crossover... | tpot/gp_deap.py | def initialize_stats_dict(individual):
'''
Initializes the stats dict for individual
The statistics initialized are:
'generation': generation in which the individual was evaluated. Initialized as: 0
'mutation_count': number of mutation operations applied to the individual and its predecessor... | def initialize_stats_dict(individual):
'''
Initializes the stats dict for individual
The statistics initialized are:
'generation': generation in which the individual was evaluated. Initialized as: 0
'mutation_count': number of mutation operations applied to the individual and its predecessor... | [
"Initializes",
"the",
"stats",
"dict",
"for",
"individual",
"The",
"statistics",
"initialized",
"are",
":",
"generation",
":",
"generation",
"in",
"which",
"the",
"individual",
"was",
"evaluated",
".",
"Initialized",
"as",
":",
"0",
"mutation_count",
":",
"numbe... | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/gp_deap.py#L151-L171 | [
"def",
"initialize_stats_dict",
"(",
"individual",
")",
":",
"individual",
".",
"statistics",
"[",
"'generation'",
"]",
"=",
"0",
"individual",
".",
"statistics",
"[",
"'mutation_count'",
"]",
"=",
"0",
"individual",
".",
"statistics",
"[",
"'crossover_count'",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | eaMuPlusLambda | This is the :math:`(\mu + \lambda)` evolutionary algorithm.
:param population: A list of individuals.
:param toolbox: A :class:`~deap.base.Toolbox` that contains the evolution
operators.
:param mu: The number of individuals to select for the next generation.
:param lambda\_: The numb... | tpot/gp_deap.py | def eaMuPlusLambda(population, toolbox, mu, lambda_, cxpb, mutpb, ngen, pbar,
stats=None, halloffame=None, verbose=0, per_generation_function=None):
"""This is the :math:`(\mu + \lambda)` evolutionary algorithm.
:param population: A list of individuals.
:param toolbox: A :class:`~deap.bas... | def eaMuPlusLambda(population, toolbox, mu, lambda_, cxpb, mutpb, ngen, pbar,
stats=None, halloffame=None, verbose=0, per_generation_function=None):
"""This is the :math:`(\mu + \lambda)` evolutionary algorithm.
:param population: A list of individuals.
:param toolbox: A :class:`~deap.bas... | [
"This",
"is",
"the",
":",
"math",
":",
"(",
"\\",
"mu",
"+",
"\\",
"lambda",
")",
"evolutionary",
"algorithm",
".",
":",
"param",
"population",
":",
"A",
"list",
"of",
"individuals",
".",
":",
"param",
"toolbox",
":",
"A",
":",
"class",
":",
"~deap",... | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/gp_deap.py#L174-L282 | [
"def",
"eaMuPlusLambda",
"(",
"population",
",",
"toolbox",
",",
"mu",
",",
"lambda_",
",",
"cxpb",
",",
"mutpb",
",",
"ngen",
",",
"pbar",
",",
"stats",
"=",
"None",
",",
"halloffame",
"=",
"None",
",",
"verbose",
"=",
"0",
",",
"per_generation_function... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | cxOnePoint | Randomly select in each individual and exchange each subtree with the
point as root between each individual.
:param ind1: First tree participating in the crossover.
:param ind2: Second tree participating in the crossover.
:returns: A tuple of two trees. | tpot/gp_deap.py | def cxOnePoint(ind1, ind2):
"""Randomly select in each individual and exchange each subtree with the
point as root between each individual.
:param ind1: First tree participating in the crossover.
:param ind2: Second tree participating in the crossover.
:returns: A tuple of two trees.
"""
# L... | def cxOnePoint(ind1, ind2):
"""Randomly select in each individual and exchange each subtree with the
point as root between each individual.
:param ind1: First tree participating in the crossover.
:param ind2: Second tree participating in the crossover.
:returns: A tuple of two trees.
"""
# L... | [
"Randomly",
"select",
"in",
"each",
"individual",
"and",
"exchange",
"each",
"subtree",
"with",
"the",
"point",
"as",
"root",
"between",
"each",
"individual",
".",
":",
"param",
"ind1",
":",
"First",
"tree",
"participating",
"in",
"the",
"crossover",
".",
":... | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/gp_deap.py#L285-L314 | [
"def",
"cxOnePoint",
"(",
"ind1",
",",
"ind2",
")",
":",
"# List all available primitive types in each individual",
"types1",
"=",
"defaultdict",
"(",
"list",
")",
"types2",
"=",
"defaultdict",
"(",
"list",
")",
"for",
"idx",
",",
"node",
"in",
"enumerate",
"(",... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | mutNodeReplacement | Replaces a randomly chosen primitive from *individual* by a randomly
chosen primitive no matter if it has the same number of arguments from the :attr:`pset`
attribute of the individual.
Parameters
----------
individual: DEAP individual
A list of pipeline operators and model parameters that c... | tpot/gp_deap.py | def mutNodeReplacement(individual, pset):
"""Replaces a randomly chosen primitive from *individual* by a randomly
chosen primitive no matter if it has the same number of arguments from the :attr:`pset`
attribute of the individual.
Parameters
----------
individual: DEAP individual
A list ... | def mutNodeReplacement(individual, pset):
"""Replaces a randomly chosen primitive from *individual* by a randomly
chosen primitive no matter if it has the same number of arguments from the :attr:`pset`
attribute of the individual.
Parameters
----------
individual: DEAP individual
A list ... | [
"Replaces",
"a",
"randomly",
"chosen",
"primitive",
"from",
"*",
"individual",
"*",
"by",
"a",
"randomly",
"chosen",
"primitive",
"no",
"matter",
"if",
"it",
"has",
"the",
"same",
"number",
"of",
"arguments",
"from",
"the",
":",
"attr",
":",
"pset",
"attri... | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/gp_deap.py#L318-L379 | [
"def",
"mutNodeReplacement",
"(",
"individual",
",",
"pset",
")",
":",
"index",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"0",
",",
"len",
"(",
"individual",
")",
")",
"node",
"=",
"individual",
"[",
"index",
"]",
"slice_",
"=",
"individual",
".",... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | _wrapped_cross_val_score | Fit estimator and compute scores for a given dataset split.
Parameters
----------
sklearn_pipeline : pipeline object implementing 'fit'
The object to use to fit the data.
features : array-like of shape at least 2D
The data to fit.
target : array-like, optional, default: None
... | tpot/gp_deap.py | def _wrapped_cross_val_score(sklearn_pipeline, features, target,
cv, scoring_function, sample_weight=None,
groups=None, use_dask=False):
"""Fit estimator and compute scores for a given dataset split.
Parameters
----------
sklearn_pipeline : pipe... | def _wrapped_cross_val_score(sklearn_pipeline, features, target,
cv, scoring_function, sample_weight=None,
groups=None, use_dask=False):
"""Fit estimator and compute scores for a given dataset split.
Parameters
----------
sklearn_pipeline : pipe... | [
"Fit",
"estimator",
"and",
"compute",
"scores",
"for",
"a",
"given",
"dataset",
"split",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/gp_deap.py#L383-L466 | [
"def",
"_wrapped_cross_val_score",
"(",
"sklearn_pipeline",
",",
"features",
",",
"target",
",",
"cv",
",",
"scoring_function",
",",
"sample_weight",
"=",
"None",
",",
"groups",
"=",
"None",
",",
"use_dask",
"=",
"False",
")",
":",
"sample_weight_dict",
"=",
"... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | get_by_name | Return operator class instance by name.
Parameters
----------
opname: str
Name of the sklearn class that belongs to a TPOT operator
operators: list
List of operator classes from operator library
Returns
-------
ret_op_class: class
An operator class | tpot/export_utils.py | def get_by_name(opname, operators):
"""Return operator class instance by name.
Parameters
----------
opname: str
Name of the sklearn class that belongs to a TPOT operator
operators: list
List of operator classes from operator library
Returns
-------
ret_op_class: class
... | def get_by_name(opname, operators):
"""Return operator class instance by name.
Parameters
----------
opname: str
Name of the sklearn class that belongs to a TPOT operator
operators: list
List of operator classes from operator library
Returns
-------
ret_op_class: class
... | [
"Return",
"operator",
"class",
"instance",
"by",
"name",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/export_utils.py#L25-L51 | [
"def",
"get_by_name",
"(",
"opname",
",",
"operators",
")",
":",
"ret_op_classes",
"=",
"[",
"op",
"for",
"op",
"in",
"operators",
"if",
"op",
".",
"__name__",
"==",
"opname",
"]",
"if",
"len",
"(",
"ret_op_classes",
")",
"==",
"0",
":",
"raise",
"Type... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | export_pipeline | Generate source code for a TPOT Pipeline.
Parameters
----------
exported_pipeline: deap.creator.Individual
The pipeline that is being exported
operators:
List of operator classes from operator library
pipeline_score:
Optional pipeline score to be saved to the exported file
... | tpot/export_utils.py | def export_pipeline(exported_pipeline,
operators, pset,
impute=False, pipeline_score=None,
random_state=None,
data_file_path=''):
"""Generate source code for a TPOT Pipeline.
Parameters
----------
exported_pipeline: deap.cr... | def export_pipeline(exported_pipeline,
operators, pset,
impute=False, pipeline_score=None,
random_state=None,
data_file_path=''):
"""Generate source code for a TPOT Pipeline.
Parameters
----------
exported_pipeline: deap.cr... | [
"Generate",
"source",
"code",
"for",
"a",
"TPOT",
"Pipeline",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/export_utils.py#L54-L122 | [
"def",
"export_pipeline",
"(",
"exported_pipeline",
",",
"operators",
",",
"pset",
",",
"impute",
"=",
"False",
",",
"pipeline_score",
"=",
"None",
",",
"random_state",
"=",
"None",
",",
"data_file_path",
"=",
"''",
")",
":",
"# Unroll the nested function calls in... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | expr_to_tree | Convert the unstructured DEAP pipeline into a tree data-structure.
Parameters
----------
ind: deap.creator.Individual
The pipeline that is being exported
Returns
-------
pipeline_tree: list
List of operators in the current optimized pipeline
EXAMPLE:
pipeline:
... | tpot/export_utils.py | def expr_to_tree(ind, pset):
"""Convert the unstructured DEAP pipeline into a tree data-structure.
Parameters
----------
ind: deap.creator.Individual
The pipeline that is being exported
Returns
-------
pipeline_tree: list
List of operators in the current optimized pipeline
... | def expr_to_tree(ind, pset):
"""Convert the unstructured DEAP pipeline into a tree data-structure.
Parameters
----------
ind: deap.creator.Individual
The pipeline that is being exported
Returns
-------
pipeline_tree: list
List of operators in the current optimized pipeline
... | [
"Convert",
"the",
"unstructured",
"DEAP",
"pipeline",
"into",
"a",
"tree",
"data",
"-",
"structure",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/export_utils.py#L125-L165 | [
"def",
"expr_to_tree",
"(",
"ind",
",",
"pset",
")",
":",
"def",
"prim_to_list",
"(",
"prim",
",",
"args",
")",
":",
"if",
"isinstance",
"(",
"prim",
",",
"deap",
".",
"gp",
".",
"Terminal",
")",
":",
"if",
"prim",
".",
"name",
"in",
"pset",
".",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | generate_import_code | Generate all library import calls for use in TPOT.export().
Parameters
----------
pipeline: List
List of operators in the current optimized pipeline
operators:
List of operator class from operator library
impute : bool
Whether to impute new values in the feature set.
Re... | tpot/export_utils.py | def generate_import_code(pipeline, operators, impute=False):
"""Generate all library import calls for use in TPOT.export().
Parameters
----------
pipeline: List
List of operators in the current optimized pipeline
operators:
List of operator class from operator library
impute : b... | def generate_import_code(pipeline, operators, impute=False):
"""Generate all library import calls for use in TPOT.export().
Parameters
----------
pipeline: List
List of operators in the current optimized pipeline
operators:
List of operator class from operator library
impute : b... | [
"Generate",
"all",
"library",
"import",
"calls",
"for",
"use",
"in",
"TPOT",
".",
"export",
"()",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/export_utils.py#L168-L220 | [
"def",
"generate_import_code",
"(",
"pipeline",
",",
"operators",
",",
"impute",
"=",
"False",
")",
":",
"def",
"merge_imports",
"(",
"old_dict",
",",
"new_dict",
")",
":",
"# Key is a module name",
"for",
"key",
"in",
"new_dict",
".",
"keys",
"(",
")",
":",... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | generate_pipeline_code | Generate code specific to the construction of the sklearn Pipeline.
Parameters
----------
pipeline_tree: list
List of operators in the current optimized pipeline
Returns
-------
Source code for the sklearn pipeline | tpot/export_utils.py | def generate_pipeline_code(pipeline_tree, operators):
"""Generate code specific to the construction of the sklearn Pipeline.
Parameters
----------
pipeline_tree: list
List of operators in the current optimized pipeline
Returns
-------
Source code for the sklearn pipeline
"""
... | def generate_pipeline_code(pipeline_tree, operators):
"""Generate code specific to the construction of the sklearn Pipeline.
Parameters
----------
pipeline_tree: list
List of operators in the current optimized pipeline
Returns
-------
Source code for the sklearn pipeline
"""
... | [
"Generate",
"code",
"specific",
"to",
"the",
"construction",
"of",
"the",
"sklearn",
"Pipeline",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/export_utils.py#L275-L290 | [
"def",
"generate_pipeline_code",
"(",
"pipeline_tree",
",",
"operators",
")",
":",
"steps",
"=",
"_process_operator",
"(",
"pipeline_tree",
",",
"operators",
")",
"pipeline_text",
"=",
"\"make_pipeline(\\n{STEPS}\\n)\"",
".",
"format",
"(",
"STEPS",
"=",
"_indent",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | generate_export_pipeline_code | Generate code specific to the construction of the sklearn Pipeline for export_pipeline.
Parameters
----------
pipeline_tree: list
List of operators in the current optimized pipeline
Returns
-------
Source code for the sklearn pipeline | tpot/export_utils.py | def generate_export_pipeline_code(pipeline_tree, operators):
"""Generate code specific to the construction of the sklearn Pipeline for export_pipeline.
Parameters
----------
pipeline_tree: list
List of operators in the current optimized pipeline
Returns
-------
Source code for the ... | def generate_export_pipeline_code(pipeline_tree, operators):
"""Generate code specific to the construction of the sklearn Pipeline for export_pipeline.
Parameters
----------
pipeline_tree: list
List of operators in the current optimized pipeline
Returns
-------
Source code for the ... | [
"Generate",
"code",
"specific",
"to",
"the",
"construction",
"of",
"the",
"sklearn",
"Pipeline",
"for",
"export_pipeline",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/export_utils.py#L293-L315 | [
"def",
"generate_export_pipeline_code",
"(",
"pipeline_tree",
",",
"operators",
")",
":",
"steps",
"=",
"_process_operator",
"(",
"pipeline_tree",
",",
"operators",
")",
"# number of steps in a pipeline",
"num_step",
"=",
"len",
"(",
"steps",
")",
"if",
"num_step",
... | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | _indent | Indent a multiline string by some number of spaces.
Parameters
----------
text: str
The text to be indented
amount: int
The number of spaces to indent the text
Returns
-------
indented_text | tpot/export_utils.py | def _indent(text, amount):
"""Indent a multiline string by some number of spaces.
Parameters
----------
text: str
The text to be indented
amount: int
The number of spaces to indent the text
Returns
-------
indented_text
"""
indentation = amount * ' '
return... | def _indent(text, amount):
"""Indent a multiline string by some number of spaces.
Parameters
----------
text: str
The text to be indented
amount: int
The number of spaces to indent the text
Returns
-------
indented_text
"""
indentation = amount * ' '
return... | [
"Indent",
"a",
"multiline",
"string",
"by",
"some",
"number",
"of",
"spaces",
"."
] | EpistasisLab/tpot | python | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/export_utils.py#L347-L363 | [
"def",
"_indent",
"(",
"text",
",",
"amount",
")",
":",
"indentation",
"=",
"amount",
"*",
"' '",
"return",
"indentation",
"+",
"(",
"'\\n'",
"+",
"indentation",
")",
".",
"join",
"(",
"text",
".",
"split",
"(",
"'\\n'",
")",
")"
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e |
train | Page.next | Get the next value in the page. | api_core/google/api_core/page_iterator.py | def next(self):
"""Get the next value in the page."""
item = six.next(self._item_iter)
result = self._item_to_value(self._parent, item)
# Since we've successfully got the next value from the
# iterator, we update the number of remaining.
self._remaining -= 1
retur... | def next(self):
"""Get the next value in the page."""
item = six.next(self._item_iter)
result = self._item_to_value(self._parent, item)
# Since we've successfully got the next value from the
# iterator, we update the number of remaining.
self._remaining -= 1
retur... | [
"Get",
"the",
"next",
"value",
"in",
"the",
"page",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/page_iterator.py#L122-L129 | [
"def",
"next",
"(",
"self",
")",
":",
"item",
"=",
"six",
".",
"next",
"(",
"self",
".",
"_item_iter",
")",
"result",
"=",
"self",
".",
"_item_to_value",
"(",
"self",
".",
"_parent",
",",
"item",
")",
"# Since we've successfully got the next value from the",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPIterator._verify_params | Verifies the parameters don't use any reserved parameter.
Raises:
ValueError: If a reserved parameter is used. | api_core/google/api_core/page_iterator.py | def _verify_params(self):
"""Verifies the parameters don't use any reserved parameter.
Raises:
ValueError: If a reserved parameter is used.
"""
reserved_in_use = self._RESERVED_PARAMS.intersection(self.extra_params)
if reserved_in_use:
raise ValueError("U... | def _verify_params(self):
"""Verifies the parameters don't use any reserved parameter.
Raises:
ValueError: If a reserved parameter is used.
"""
reserved_in_use = self._RESERVED_PARAMS.intersection(self.extra_params)
if reserved_in_use:
raise ValueError("U... | [
"Verifies",
"the",
"parameters",
"don",
"t",
"use",
"any",
"reserved",
"parameter",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/page_iterator.py#L343-L351 | [
"def",
"_verify_params",
"(",
"self",
")",
":",
"reserved_in_use",
"=",
"self",
".",
"_RESERVED_PARAMS",
".",
"intersection",
"(",
"self",
".",
"extra_params",
")",
"if",
"reserved_in_use",
":",
"raise",
"ValueError",
"(",
"\"Using a reserved parameter\"",
",",
"r... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPIterator._next_page | Get the next page in the iterator.
Returns:
Optional[Page]: The next page in the iterator or :data:`None` if
there are no pages left. | api_core/google/api_core/page_iterator.py | def _next_page(self):
"""Get the next page in the iterator.
Returns:
Optional[Page]: The next page in the iterator or :data:`None` if
there are no pages left.
"""
if self._has_next_page():
response = self._get_next_page_response()
item... | def _next_page(self):
"""Get the next page in the iterator.
Returns:
Optional[Page]: The next page in the iterator or :data:`None` if
there are no pages left.
"""
if self._has_next_page():
response = self._get_next_page_response()
item... | [
"Get",
"the",
"next",
"page",
"in",
"the",
"iterator",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/page_iterator.py#L353-L368 | [
"def",
"_next_page",
"(",
"self",
")",
":",
"if",
"self",
".",
"_has_next_page",
"(",
")",
":",
"response",
"=",
"self",
".",
"_get_next_page_response",
"(",
")",
"items",
"=",
"response",
".",
"get",
"(",
"self",
".",
"_items_key",
",",
"(",
")",
")",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPIterator._get_query_params | Getter for query parameters for the next request.
Returns:
dict: A dictionary of query parameters. | api_core/google/api_core/page_iterator.py | def _get_query_params(self):
"""Getter for query parameters for the next request.
Returns:
dict: A dictionary of query parameters.
"""
result = {}
if self.next_page_token is not None:
result[self._PAGE_TOKEN] = self.next_page_token
if self.max_res... | def _get_query_params(self):
"""Getter for query parameters for the next request.
Returns:
dict: A dictionary of query parameters.
"""
result = {}
if self.next_page_token is not None:
result[self._PAGE_TOKEN] = self.next_page_token
if self.max_res... | [
"Getter",
"for",
"query",
"parameters",
"for",
"the",
"next",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/page_iterator.py#L385-L397 | [
"def",
"_get_query_params",
"(",
"self",
")",
":",
"result",
"=",
"{",
"}",
"if",
"self",
".",
"next_page_token",
"is",
"not",
"None",
":",
"result",
"[",
"self",
".",
"_PAGE_TOKEN",
"]",
"=",
"self",
".",
"next_page_token",
"if",
"self",
".",
"max_resul... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPIterator._get_next_page_response | Requests the next page from the path provided.
Returns:
dict: The parsed JSON response of the next page's contents.
Raises:
ValueError: If the HTTP method is not ``GET`` or ``POST``. | api_core/google/api_core/page_iterator.py | def _get_next_page_response(self):
"""Requests the next page from the path provided.
Returns:
dict: The parsed JSON response of the next page's contents.
Raises:
ValueError: If the HTTP method is not ``GET`` or ``POST``.
"""
params = self._get_query_para... | def _get_next_page_response(self):
"""Requests the next page from the path provided.
Returns:
dict: The parsed JSON response of the next page's contents.
Raises:
ValueError: If the HTTP method is not ``GET`` or ``POST``.
"""
params = self._get_query_para... | [
"Requests",
"the",
"next",
"page",
"from",
"the",
"path",
"provided",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/page_iterator.py#L399-L418 | [
"def",
"_get_next_page_response",
"(",
"self",
")",
":",
"params",
"=",
"self",
".",
"_get_query_params",
"(",
")",
"if",
"self",
".",
"_HTTP_METHOD",
"==",
"\"GET\"",
":",
"return",
"self",
".",
"api_request",
"(",
"method",
"=",
"self",
".",
"_HTTP_METHOD"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _GAXIterator._next_page | Get the next page in the iterator.
Wraps the response from the :class:`~google.gax.PageIterator` in a
:class:`Page` instance and captures some state at each page.
Returns:
Optional[Page]: The next page in the iterator or :data:`None` if
there are no pages left. | api_core/google/api_core/page_iterator.py | def _next_page(self):
"""Get the next page in the iterator.
Wraps the response from the :class:`~google.gax.PageIterator` in a
:class:`Page` instance and captures some state at each page.
Returns:
Optional[Page]: The next page in the iterator or :data:`None` if
... | def _next_page(self):
"""Get the next page in the iterator.
Wraps the response from the :class:`~google.gax.PageIterator` in a
:class:`Page` instance and captures some state at each page.
Returns:
Optional[Page]: The next page in the iterator or :data:`None` if
... | [
"Get",
"the",
"next",
"page",
"in",
"the",
"iterator",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/page_iterator.py#L445-L461 | [
"def",
"_next_page",
"(",
"self",
")",
":",
"try",
":",
"items",
"=",
"six",
".",
"next",
"(",
"self",
".",
"_gax_page_iter",
")",
"page",
"=",
"Page",
"(",
"self",
",",
"items",
",",
"self",
".",
"item_to_value",
")",
"self",
".",
"next_page_token",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | GRPCIterator._next_page | Get the next page in the iterator.
Returns:
Page: The next page in the iterator or :data:`None` if
there are no pages left. | api_core/google/api_core/page_iterator.py | def _next_page(self):
"""Get the next page in the iterator.
Returns:
Page: The next page in the iterator or :data:`None` if
there are no pages left.
"""
if not self._has_next_page():
return None
if self.next_page_token is not None:
... | def _next_page(self):
"""Get the next page in the iterator.
Returns:
Page: The next page in the iterator or :data:`None` if
there are no pages left.
"""
if not self._has_next_page():
return None
if self.next_page_token is not None:
... | [
"Get",
"the",
"next",
"page",
"in",
"the",
"iterator",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/page_iterator.py#L513-L532 | [
"def",
"_next_page",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_has_next_page",
"(",
")",
":",
"return",
"None",
"if",
"self",
".",
"next_page_token",
"is",
"not",
"None",
":",
"setattr",
"(",
"self",
".",
"_request",
",",
"self",
".",
"_reques... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | GRPCIterator._has_next_page | Determines whether or not there are more pages with results.
Returns:
bool: Whether the iterator has more pages. | api_core/google/api_core/page_iterator.py | def _has_next_page(self):
"""Determines whether or not there are more pages with results.
Returns:
bool: Whether the iterator has more pages.
"""
if self.page_number == 0:
return True
if self.max_results is not None:
if self.num_results >= se... | def _has_next_page(self):
"""Determines whether or not there are more pages with results.
Returns:
bool: Whether the iterator has more pages.
"""
if self.page_number == 0:
return True
if self.max_results is not None:
if self.num_results >= se... | [
"Determines",
"whether",
"or",
"not",
"there",
"are",
"more",
"pages",
"with",
"results",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/page_iterator.py#L534-L549 | [
"def",
"_has_next_page",
"(",
"self",
")",
":",
"if",
"self",
".",
"page_number",
"==",
"0",
":",
"return",
"True",
"if",
"self",
".",
"max_results",
"is",
"not",
"None",
":",
"if",
"self",
".",
"num_results",
">=",
"self",
".",
"max_results",
":",
"re... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Order.compare | Main comparison function for all Firestore types.
@return -1 is left < right, 0 if left == right, otherwise 1 | firestore/google/cloud/firestore_v1beta1/order.py | def compare(cls, left, right):
"""
Main comparison function for all Firestore types.
@return -1 is left < right, 0 if left == right, otherwise 1
"""
# First compare the types.
leftType = TypeOrder.from_value(left).value
rightType = TypeOrder.from_value(right).valu... | def compare(cls, left, right):
"""
Main comparison function for all Firestore types.
@return -1 is left < right, 0 if left == right, otherwise 1
"""
# First compare the types.
leftType = TypeOrder.from_value(left).value
rightType = TypeOrder.from_value(right).valu... | [
"Main",
"comparison",
"function",
"for",
"all",
"Firestore",
"types",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/order.py#L62-L101 | [
"def",
"compare",
"(",
"cls",
",",
"left",
",",
"right",
")",
":",
"# First compare the types.",
"leftType",
"=",
"TypeOrder",
".",
"from_value",
"(",
"left",
")",
".",
"value",
"rightType",
"=",
"TypeOrder",
".",
"from_value",
"(",
"right",
")",
".",
"val... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ImageAnnotatorClient.batch_annotate_files | Service that performs image detection and annotation for a batch of files.
Now only "application/pdf", "image/tiff" and "image/gif" are supported.
This service will extract at most the first 10 frames (gif) or pages
(pdf or tiff) from each file provided and perform detection and annotation
... | vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py | def batch_annotate_files(
self,
requests,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Service that performs image detection and annotation for a batch of files.
Now only "applica... | def batch_annotate_files(
self,
requests,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Service that performs image detection and annotation for a batch of files.
Now only "applica... | [
"Service",
"that",
"performs",
"image",
"detection",
"and",
"annotation",
"for",
"a",
"batch",
"of",
"files",
".",
"Now",
"only",
"application",
"/",
"pdf",
"image",
"/",
"tiff",
"and",
"image",
"/",
"gif",
"are",
"supported",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py#L239-L303 | [
"def",
"batch_annotate_files",
"(",
"self",
",",
"requests",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ImageAnnotatorClient.async_batch_annotate_images | Run asynchronous image detection and annotation for a list of images.
Progress and results can be retrieved through the
``google.longrunning.Operations`` interface. ``Operation.metadata``
contains ``OperationMetadata`` (metadata). ``Operation.response``
contains ``AsyncBatchAnnotateImag... | vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py | def async_batch_annotate_images(
self,
requests,
output_config,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Run asynchronous image detection and annotation for a list of images.
... | def async_batch_annotate_images(
self,
requests,
output_config,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Run asynchronous image detection and annotation for a list of images.
... | [
"Run",
"asynchronous",
"image",
"detection",
"and",
"annotation",
"for",
"a",
"list",
"of",
"images",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py#L305-L399 | [
"def",
"async_batch_annotate_images",
"(",
"self",
",",
"requests",
",",
"output_config",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"met... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ImageAnnotatorClient.async_batch_annotate_files | Run asynchronous image detection and annotation for a list of generic
files, such as PDF files, which may contain multiple pages and multiple
images per page. Progress and results can be retrieved through the
``google.longrunning.Operations`` interface. ``Operation.metadata``
contains ``... | vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py | def async_batch_annotate_files(
self,
requests,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Run asynchronous image detection and annotation for a list of generic
files, such as P... | def async_batch_annotate_files(
self,
requests,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Run asynchronous image detection and annotation for a list of generic
files, such as P... | [
"Run",
"asynchronous",
"image",
"detection",
"and",
"annotation",
"for",
"a",
"list",
"of",
"generic",
"files",
"such",
"as",
"PDF",
"files",
"which",
"may",
"contain",
"multiple",
"pages",
"and",
"multiple",
"images",
"per",
"page",
".",
"Progress",
"and",
... | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py#L401-L479 | [
"def",
"async_batch_annotate_files",
"(",
"self",
",",
"requests",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | load_ipython_extension | Called by IPython when this module is loaded as an IPython extension. | bigquery/google/cloud/bigquery/__init__.py | def load_ipython_extension(ipython):
"""Called by IPython when this module is loaded as an IPython extension."""
from google.cloud.bigquery.magics import _cell_magic
ipython.register_magic_function(
_cell_magic, magic_kind="cell", magic_name="bigquery"
) | def load_ipython_extension(ipython):
"""Called by IPython when this module is loaded as an IPython extension."""
from google.cloud.bigquery.magics import _cell_magic
ipython.register_magic_function(
_cell_magic, magic_kind="cell", magic_name="bigquery"
) | [
"Called",
"by",
"IPython",
"when",
"this",
"module",
"is",
"loaded",
"as",
"an",
"IPython",
"extension",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/__init__.py#L131-L137 | [
"def",
"load_ipython_extension",
"(",
"ipython",
")",
":",
"from",
"google",
".",
"cloud",
".",
"bigquery",
".",
"magics",
"import",
"_cell_magic",
"ipython",
".",
"register_magic_function",
"(",
"_cell_magic",
",",
"magic_kind",
"=",
"\"cell\"",
",",
"magic_name"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | from_http_status | Create a :class:`GoogleAPICallError` from an HTTP status code.
Args:
status_code (int): The HTTP status code.
message (str): The exception message.
kwargs: Additional arguments passed to the :class:`GoogleAPICallError`
constructor.
Returns:
GoogleAPICallError: An in... | api_core/google/api_core/exceptions.py | def from_http_status(status_code, message, **kwargs):
"""Create a :class:`GoogleAPICallError` from an HTTP status code.
Args:
status_code (int): The HTTP status code.
message (str): The exception message.
kwargs: Additional arguments passed to the :class:`GoogleAPICallError`
... | def from_http_status(status_code, message, **kwargs):
"""Create a :class:`GoogleAPICallError` from an HTTP status code.
Args:
status_code (int): The HTTP status code.
message (str): The exception message.
kwargs: Additional arguments passed to the :class:`GoogleAPICallError`
... | [
"Create",
"a",
":",
"class",
":",
"GoogleAPICallError",
"from",
"an",
"HTTP",
"status",
"code",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/exceptions.py#L362-L381 | [
"def",
"from_http_status",
"(",
"status_code",
",",
"message",
",",
"*",
"*",
"kwargs",
")",
":",
"error_class",
"=",
"exception_class_for_http_status",
"(",
"status_code",
")",
"error",
"=",
"error_class",
"(",
"message",
",",
"*",
"*",
"kwargs",
")",
"if",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | from_http_response | Create a :class:`GoogleAPICallError` from a :class:`requests.Response`.
Args:
response (requests.Response): The HTTP response.
Returns:
GoogleAPICallError: An instance of the appropriate subclass of
:class:`GoogleAPICallError`, with the message and errors populated
from... | api_core/google/api_core/exceptions.py | def from_http_response(response):
"""Create a :class:`GoogleAPICallError` from a :class:`requests.Response`.
Args:
response (requests.Response): The HTTP response.
Returns:
GoogleAPICallError: An instance of the appropriate subclass of
:class:`GoogleAPICallError`, with the mess... | def from_http_response(response):
"""Create a :class:`GoogleAPICallError` from a :class:`requests.Response`.
Args:
response (requests.Response): The HTTP response.
Returns:
GoogleAPICallError: An instance of the appropriate subclass of
:class:`GoogleAPICallError`, with the mess... | [
"Create",
"a",
":",
"class",
":",
"GoogleAPICallError",
"from",
"a",
":",
"class",
":",
"requests",
".",
"Response",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/exceptions.py#L384-L410 | [
"def",
"from_http_response",
"(",
"response",
")",
":",
"try",
":",
"payload",
"=",
"response",
".",
"json",
"(",
")",
"except",
"ValueError",
":",
"payload",
"=",
"{",
"\"error\"",
":",
"{",
"\"message\"",
":",
"response",
".",
"text",
"or",
"\"unknown er... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | from_grpc_status | Create a :class:`GoogleAPICallError` from a :class:`grpc.StatusCode`.
Args:
status_code (grpc.StatusCode): The gRPC status code.
message (str): The exception message.
kwargs: Additional arguments passed to the :class:`GoogleAPICallError`
constructor.
Returns:
Google... | api_core/google/api_core/exceptions.py | def from_grpc_status(status_code, message, **kwargs):
"""Create a :class:`GoogleAPICallError` from a :class:`grpc.StatusCode`.
Args:
status_code (grpc.StatusCode): The gRPC status code.
message (str): The exception message.
kwargs: Additional arguments passed to the :class:`GoogleAPICal... | def from_grpc_status(status_code, message, **kwargs):
"""Create a :class:`GoogleAPICallError` from a :class:`grpc.StatusCode`.
Args:
status_code (grpc.StatusCode): The gRPC status code.
message (str): The exception message.
kwargs: Additional arguments passed to the :class:`GoogleAPICal... | [
"Create",
"a",
":",
"class",
":",
"GoogleAPICallError",
"from",
"a",
":",
"class",
":",
"grpc",
".",
"StatusCode",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/exceptions.py#L425-L444 | [
"def",
"from_grpc_status",
"(",
"status_code",
",",
"message",
",",
"*",
"*",
"kwargs",
")",
":",
"error_class",
"=",
"exception_class_for_grpc_status",
"(",
"status_code",
")",
"error",
"=",
"error_class",
"(",
"message",
",",
"*",
"*",
"kwargs",
")",
"if",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | from_grpc_error | Create a :class:`GoogleAPICallError` from a :class:`grpc.RpcError`.
Args:
rpc_exc (grpc.RpcError): The gRPC error.
Returns:
GoogleAPICallError: An instance of the appropriate subclass of
:class:`GoogleAPICallError`. | api_core/google/api_core/exceptions.py | def from_grpc_error(rpc_exc):
"""Create a :class:`GoogleAPICallError` from a :class:`grpc.RpcError`.
Args:
rpc_exc (grpc.RpcError): The gRPC error.
Returns:
GoogleAPICallError: An instance of the appropriate subclass of
:class:`GoogleAPICallError`.
"""
if isinstance(rpc... | def from_grpc_error(rpc_exc):
"""Create a :class:`GoogleAPICallError` from a :class:`grpc.RpcError`.
Args:
rpc_exc (grpc.RpcError): The gRPC error.
Returns:
GoogleAPICallError: An instance of the appropriate subclass of
:class:`GoogleAPICallError`.
"""
if isinstance(rpc... | [
"Create",
"a",
":",
"class",
":",
"GoogleAPICallError",
"from",
"a",
":",
"class",
":",
"grpc",
".",
"RpcError",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/exceptions.py#L447-L462 | [
"def",
"from_grpc_error",
"(",
"rpc_exc",
")",
":",
"if",
"isinstance",
"(",
"rpc_exc",
",",
"grpc",
".",
"Call",
")",
":",
"return",
"from_grpc_status",
"(",
"rpc_exc",
".",
"code",
"(",
")",
",",
"rpc_exc",
".",
"details",
"(",
")",
",",
"errors",
"=... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _request | Make a request over the Http transport to the Cloud Datastore API.
:type http: :class:`requests.Session`
:param http: HTTP object to make requests.
:type project: str
:param project: The project to make the request for.
:type method: str
:param method: The API call method name (ie, ``runQuery... | datastore/google/cloud/datastore/_http.py | def _request(http, project, method, data, base_url):
"""Make a request over the Http transport to the Cloud Datastore API.
:type http: :class:`requests.Session`
:param http: HTTP object to make requests.
:type project: str
:param project: The project to make the request for.
:type method: str... | def _request(http, project, method, data, base_url):
"""Make a request over the Http transport to the Cloud Datastore API.
:type http: :class:`requests.Session`
:param http: HTTP object to make requests.
:type project: str
:param project: The project to make the request for.
:type method: str... | [
"Make",
"a",
"request",
"over",
"the",
"Http",
"transport",
"to",
"the",
"Cloud",
"Datastore",
"API",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_http.py#L38-L78 | [
"def",
"_request",
"(",
"http",
",",
"project",
",",
"method",
",",
"data",
",",
"base_url",
")",
":",
"headers",
"=",
"{",
"\"Content-Type\"",
":",
"\"application/x-protobuf\"",
",",
"\"User-Agent\"",
":",
"connection_module",
".",
"DEFAULT_USER_AGENT",
",",
"c... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _rpc | Make a protobuf RPC request.
:type http: :class:`requests.Session`
:param http: HTTP object to make requests.
:type project: str
:param project: The project to connect to. This is
usually your project name in the cloud console.
:type method: str
:param method: The name of ... | datastore/google/cloud/datastore/_http.py | def _rpc(http, project, method, base_url, request_pb, response_pb_cls):
"""Make a protobuf RPC request.
:type http: :class:`requests.Session`
:param http: HTTP object to make requests.
:type project: str
:param project: The project to connect to. This is
usually your project na... | def _rpc(http, project, method, base_url, request_pb, response_pb_cls):
"""Make a protobuf RPC request.
:type http: :class:`requests.Session`
:param http: HTTP object to make requests.
:type project: str
:param project: The project to connect to. This is
usually your project na... | [
"Make",
"a",
"protobuf",
"RPC",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_http.py#L81-L110 | [
"def",
"_rpc",
"(",
"http",
",",
"project",
",",
"method",
",",
"base_url",
",",
"request_pb",
",",
"response_pb_cls",
")",
":",
"req_data",
"=",
"request_pb",
".",
"SerializeToString",
"(",
")",
"response",
"=",
"_request",
"(",
"http",
",",
"project",
",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | build_api_url | Construct the URL for a particular API call.
This method is used internally to come up with the URL to use when
making RPCs to the Cloud Datastore API.
:type project: str
:param project: The project to connect to. This is
usually your project name in the cloud console.
:type m... | datastore/google/cloud/datastore/_http.py | def build_api_url(project, method, base_url):
"""Construct the URL for a particular API call.
This method is used internally to come up with the URL to use when
making RPCs to the Cloud Datastore API.
:type project: str
:param project: The project to connect to. This is
usually... | def build_api_url(project, method, base_url):
"""Construct the URL for a particular API call.
This method is used internally to come up with the URL to use when
making RPCs to the Cloud Datastore API.
:type project: str
:param project: The project to connect to. This is
usually... | [
"Construct",
"the",
"URL",
"for",
"a",
"particular",
"API",
"call",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_http.py#L113-L134 | [
"def",
"build_api_url",
"(",
"project",
",",
"method",
",",
"base_url",
")",
":",
"return",
"API_URL_TEMPLATE",
".",
"format",
"(",
"api_base",
"=",
"base_url",
",",
"api_version",
"=",
"API_VERSION",
",",
"project",
"=",
"project",
",",
"method",
"=",
"meth... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPDatastoreAPI.lookup | Perform a ``lookup`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type keys: List[.entity_pb2.Key]
:param keys: The keys to retrieve from the datastore.
:type re... | datastore/google/cloud/datastore/_http.py | def lookup(self, project_id, keys, read_options=None):
"""Perform a ``lookup`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type keys: List[.entity_pb2.Key]
:para... | def lookup(self, project_id, keys, read_options=None):
"""Perform a ``lookup`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type keys: List[.entity_pb2.Key]
:para... | [
"Perform",
"a",
"lookup",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_http.py#L149-L177 | [
"def",
"lookup",
"(",
"self",
",",
"project_id",
",",
"keys",
",",
"read_options",
"=",
"None",
")",
":",
"request_pb",
"=",
"_datastore_pb2",
".",
"LookupRequest",
"(",
"project_id",
"=",
"project_id",
",",
"read_options",
"=",
"read_options",
",",
"keys",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPDatastoreAPI.run_query | Perform a ``runQuery`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type partition_id: :class:`.entity_pb2.PartitionId`
:param partition_id: Partition ID corresponding to... | datastore/google/cloud/datastore/_http.py | def run_query(
self, project_id, partition_id, read_options=None, query=None, gql_query=None
):
"""Perform a ``runQuery`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
... | def run_query(
self, project_id, partition_id, read_options=None, query=None, gql_query=None
):
"""Perform a ``runQuery`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
... | [
"Perform",
"a",
"runQuery",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_http.py#L179-L222 | [
"def",
"run_query",
"(",
"self",
",",
"project_id",
",",
"partition_id",
",",
"read_options",
"=",
"None",
",",
"query",
"=",
"None",
",",
"gql_query",
"=",
"None",
")",
":",
"request_pb",
"=",
"_datastore_pb2",
".",
"RunQueryRequest",
"(",
"project_id",
"="... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPDatastoreAPI.begin_transaction | Perform a ``beginTransaction`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type transaction_options: ~.datastore_v1.types.TransactionOptions
:param transaction_options: ... | datastore/google/cloud/datastore/_http.py | def begin_transaction(self, project_id, transaction_options=None):
"""Perform a ``beginTransaction`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type transaction_options... | def begin_transaction(self, project_id, transaction_options=None):
"""Perform a ``beginTransaction`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type transaction_options... | [
"Perform",
"a",
"beginTransaction",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_http.py#L224-L245 | [
"def",
"begin_transaction",
"(",
"self",
",",
"project_id",
",",
"transaction_options",
"=",
"None",
")",
":",
"request_pb",
"=",
"_datastore_pb2",
".",
"BeginTransactionRequest",
"(",
")",
"return",
"_rpc",
"(",
"self",
".",
"client",
".",
"_http",
",",
"proj... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPDatastoreAPI.commit | Perform a ``commit`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type mode: :class:`.gapic.datastore.v1.enums.CommitRequest.Mode`
:param mode: The type of commit to perf... | datastore/google/cloud/datastore/_http.py | def commit(self, project_id, mode, mutations, transaction=None):
"""Perform a ``commit`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type mode: :class:`.gapic.datastore.... | def commit(self, project_id, mode, mutations, transaction=None):
"""Perform a ``commit`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type mode: :class:`.gapic.datastore.... | [
"Perform",
"a",
"commit",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_http.py#L247-L283 | [
"def",
"commit",
"(",
"self",
",",
"project_id",
",",
"mode",
",",
"mutations",
",",
"transaction",
"=",
"None",
")",
":",
"request_pb",
"=",
"_datastore_pb2",
".",
"CommitRequest",
"(",
"project_id",
"=",
"project_id",
",",
"mode",
"=",
"mode",
",",
"tran... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPDatastoreAPI.rollback | Perform a ``rollback`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type transaction: bytes
:param transaction: The transaction ID to rollback.
:rtype: :class:`.... | datastore/google/cloud/datastore/_http.py | def rollback(self, project_id, transaction):
"""Perform a ``rollback`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type transaction: bytes
:param transaction: Th... | def rollback(self, project_id, transaction):
"""Perform a ``rollback`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type transaction: bytes
:param transaction: Th... | [
"Perform",
"a",
"rollback",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_http.py#L285-L309 | [
"def",
"rollback",
"(",
"self",
",",
"project_id",
",",
"transaction",
")",
":",
"request_pb",
"=",
"_datastore_pb2",
".",
"RollbackRequest",
"(",
"project_id",
"=",
"project_id",
",",
"transaction",
"=",
"transaction",
")",
"# Response is empty (i.e. no fields) but w... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | HTTPDatastoreAPI.allocate_ids | Perform an ``allocateIds`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type keys: List[.entity_pb2.Key]
:param keys: The keys for which the backend should allocate IDs.
... | datastore/google/cloud/datastore/_http.py | def allocate_ids(self, project_id, keys):
"""Perform an ``allocateIds`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type keys: List[.entity_pb2.Key]
:param keys:... | def allocate_ids(self, project_id, keys):
"""Perform an ``allocateIds`` request.
:type project_id: str
:param project_id: The project to connect to. This is
usually your project name in the cloud console.
:type keys: List[.entity_pb2.Key]
:param keys:... | [
"Perform",
"an",
"allocateIds",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_http.py#L311-L332 | [
"def",
"allocate_ids",
"(",
"self",
",",
"project_id",
",",
"keys",
")",
":",
"request_pb",
"=",
"_datastore_pb2",
".",
"AllocateIdsRequest",
"(",
"keys",
"=",
"keys",
")",
"return",
"_rpc",
"(",
"self",
".",
"client",
".",
"_http",
",",
"project_id",
",",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _create_row_request | Creates a request to read rows in a table.
:type table_name: str
:param table_name: The name of the table to read from.
:type start_key: bytes
:param start_key: (Optional) The beginning of a range of row keys to
read from. The range will include ``start_key``. If
... | bigtable/google/cloud/bigtable/table.py | def _create_row_request(
table_name,
start_key=None,
end_key=None,
filter_=None,
limit=None,
end_inclusive=False,
app_profile_id=None,
row_set=None,
):
"""Creates a request to read rows in a table.
:type table_name: str
:param table_name: The name of the table to read from.
... | def _create_row_request(
table_name,
start_key=None,
end_key=None,
filter_=None,
limit=None,
end_inclusive=False,
app_profile_id=None,
row_set=None,
):
"""Creates a request to read rows in a table.
:type table_name: str
:param table_name: The name of the table to read from.
... | [
"Creates",
"a",
"request",
"to",
"read",
"rows",
"in",
"a",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L862-L932 | [
"def",
"_create_row_request",
"(",
"table_name",
",",
"start_key",
"=",
"None",
",",
"end_key",
"=",
"None",
",",
"filter_",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"end_inclusive",
"=",
"False",
",",
"app_profile_id",
"=",
"None",
",",
"row_set",
"="... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _mutate_rows_request | Creates a request to mutate rows in a table.
:type table_name: str
:param table_name: The name of the table to write to.
:type rows: list
:param rows: List or other iterable of :class:`.DirectRow` instances.
:type: app_profile_id: str
:param app_profile_id: (Optional) The unique name of the A... | bigtable/google/cloud/bigtable/table.py | def _mutate_rows_request(table_name, rows, app_profile_id=None):
"""Creates a request to mutate rows in a table.
:type table_name: str
:param table_name: The name of the table to write to.
:type rows: list
:param rows: List or other iterable of :class:`.DirectRow` instances.
:type: app_profil... | def _mutate_rows_request(table_name, rows, app_profile_id=None):
"""Creates a request to mutate rows in a table.
:type table_name: str
:param table_name: The name of the table to write to.
:type rows: list
:param rows: List or other iterable of :class:`.DirectRow` instances.
:type: app_profil... | [
"Creates",
"a",
"request",
"to",
"mutate",
"rows",
"in",
"a",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L935-L966 | [
"def",
"_mutate_rows_request",
"(",
"table_name",
",",
"rows",
",",
"app_profile_id",
"=",
"None",
")",
":",
"request_pb",
"=",
"data_messages_v2_pb2",
".",
"MutateRowsRequest",
"(",
"table_name",
"=",
"table_name",
",",
"app_profile_id",
"=",
"app_profile_id",
")",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _check_row_table_name | Checks that a row belongs to a table.
:type table_name: str
:param table_name: The name of the table.
:type row: :class:`~google.cloud.bigtable.row.Row`
:param row: An instance of :class:`~google.cloud.bigtable.row.Row`
subclasses.
:raises: :exc:`~.table.TableMismatchError` if the... | bigtable/google/cloud/bigtable/table.py | def _check_row_table_name(table_name, row):
"""Checks that a row belongs to a table.
:type table_name: str
:param table_name: The name of the table.
:type row: :class:`~google.cloud.bigtable.row.Row`
:param row: An instance of :class:`~google.cloud.bigtable.row.Row`
subclasses.
... | def _check_row_table_name(table_name, row):
"""Checks that a row belongs to a table.
:type table_name: str
:param table_name: The name of the table.
:type row: :class:`~google.cloud.bigtable.row.Row`
:param row: An instance of :class:`~google.cloud.bigtable.row.Row`
subclasses.
... | [
"Checks",
"that",
"a",
"row",
"belongs",
"to",
"a",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L969-L986 | [
"def",
"_check_row_table_name",
"(",
"table_name",
",",
"row",
")",
":",
"if",
"row",
".",
"table",
"is",
"not",
"None",
"and",
"row",
".",
"table",
".",
"name",
"!=",
"table_name",
":",
"raise",
"TableMismatchError",
"(",
"\"Row %s is a part of %s table. Curren... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.name | Table name used in requests.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_table_name]
:end-before: [END bigtable_table_name]
.. note::
This property will not change if ``table_id`` does not, but the
return value ... | bigtable/google/cloud/bigtable/table.py | def name(self):
"""Table name used in requests.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_table_name]
:end-before: [END bigtable_table_name]
.. note::
This property will not change if ``table_id`` does not, but ... | def name(self):
"""Table name used in requests.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_table_name]
:end-before: [END bigtable_table_name]
.. note::
This property will not change if ``table_id`` does not, but ... | [
"Table",
"name",
"used",
"in",
"requests",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L113-L139 | [
"def",
"name",
"(",
"self",
")",
":",
"project",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"project",
"instance_id",
"=",
"self",
".",
"_instance",
".",
"instance_id",
"table_client",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"table_dat... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.row | Factory to create a row associated with this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_table_row]
:end-before: [END bigtable_table_row]
.. warning::
At most one of ``filter_`` and ``append`` can be used in a
... | bigtable/google/cloud/bigtable/table.py | def row(self, row_key, filter_=None, append=False):
"""Factory to create a row associated with this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_table_row]
:end-before: [END bigtable_table_row]
.. warning::
... | def row(self, row_key, filter_=None, append=False):
"""Factory to create a row associated with this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_table_row]
:end-before: [END bigtable_table_row]
.. warning::
... | [
"Factory",
"to",
"create",
"a",
"row",
"associated",
"with",
"this",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L163-L200 | [
"def",
"row",
"(",
"self",
",",
"row_key",
",",
"filter_",
"=",
"None",
",",
"append",
"=",
"False",
")",
":",
"if",
"append",
"and",
"filter_",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"At most one of filter_ and append can be set\"",
")",
"i... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.create | Creates this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_create_table]
:end-before: [END bigtable_create_table]
.. note::
A create request returns a
:class:`._generated.table_pb2.Table` but we don't u... | bigtable/google/cloud/bigtable/table.py | def create(self, initial_split_keys=[], column_families={}):
"""Creates this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_create_table]
:end-before: [END bigtable_create_table]
.. note::
A create request r... | def create(self, initial_split_keys=[], column_families={}):
"""Creates this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_create_table]
:end-before: [END bigtable_create_table]
.. note::
A create request r... | [
"Creates",
"this",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L210-L252 | [
"def",
"create",
"(",
"self",
",",
"initial_split_keys",
"=",
"[",
"]",
",",
"column_families",
"=",
"{",
"}",
")",
":",
"table_client",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"table_admin_client",
"instance_name",
"=",
"self",
".",
"_instance",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.exists | Check whether the table exists.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_check_table_exists]
:end-before: [END bigtable_check_table_exists]
:rtype: bool
:returns: True if the table exists, else False. | bigtable/google/cloud/bigtable/table.py | def exists(self):
"""Check whether the table exists.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_check_table_exists]
:end-before: [END bigtable_check_table_exists]
:rtype: bool
:returns: True if the table exists, els... | def exists(self):
"""Check whether the table exists.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_check_table_exists]
:end-before: [END bigtable_check_table_exists]
:rtype: bool
:returns: True if the table exists, els... | [
"Check",
"whether",
"the",
"table",
"exists",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L254-L271 | [
"def",
"exists",
"(",
"self",
")",
":",
"table_client",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"table_admin_client",
"try",
":",
"table_client",
".",
"get_table",
"(",
"name",
"=",
"self",
".",
"name",
",",
"view",
"=",
"VIEW_NAME_ONLY",
")",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.delete | Delete this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_delete_table]
:end-before: [END bigtable_delete_table] | bigtable/google/cloud/bigtable/table.py | def delete(self):
"""Delete this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_delete_table]
:end-before: [END bigtable_delete_table]
"""
table_client = self._instance._client.table_admin_client
table_cl... | def delete(self):
"""Delete this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_delete_table]
:end-before: [END bigtable_delete_table]
"""
table_client = self._instance._client.table_admin_client
table_cl... | [
"Delete",
"this",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L273-L284 | [
"def",
"delete",
"(",
"self",
")",
":",
"table_client",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"table_admin_client",
"table_client",
".",
"delete_table",
"(",
"name",
"=",
"self",
".",
"name",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.list_column_families | List the column families owned by this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_list_column_families]
:end-before: [END bigtable_list_column_families]
:rtype: dict
:returns: Dictionary of column families attached t... | bigtable/google/cloud/bigtable/table.py | def list_column_families(self):
"""List the column families owned by this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_list_column_families]
:end-before: [END bigtable_list_column_families]
:rtype: dict
:return... | def list_column_families(self):
"""List the column families owned by this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_list_column_families]
:end-before: [END bigtable_list_column_families]
:rtype: dict
:return... | [
"List",
"the",
"column",
"families",
"owned",
"by",
"this",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L286-L311 | [
"def",
"list_column_families",
"(",
"self",
")",
":",
"table_client",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"table_admin_client",
"table_pb",
"=",
"table_client",
".",
"get_table",
"(",
"self",
".",
"name",
")",
"result",
"=",
"{",
"}",
"for",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.get_cluster_states | List the cluster states owned by this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_get_cluster_states]
:end-before: [END bigtable_get_cluster_states]
:rtype: dict
:returns: Dictionary of cluster states for this table.
... | bigtable/google/cloud/bigtable/table.py | def get_cluster_states(self):
"""List the cluster states owned by this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_get_cluster_states]
:end-before: [END bigtable_get_cluster_states]
:rtype: dict
:returns: Dict... | def get_cluster_states(self):
"""List the cluster states owned by this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_get_cluster_states]
:end-before: [END bigtable_get_cluster_states]
:rtype: dict
:returns: Dict... | [
"List",
"the",
"cluster",
"states",
"owned",
"by",
"this",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L313-L335 | [
"def",
"get_cluster_states",
"(",
"self",
")",
":",
"REPLICATION_VIEW",
"=",
"enums",
".",
"Table",
".",
"View",
".",
"REPLICATION_VIEW",
"table_client",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"table_admin_client",
"table_pb",
"=",
"table_client",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.read_row | Read a single row from this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_read_row]
:end-before: [END bigtable_read_row]
:type row_key: bytes
:param row_key: The key of the row to read from.
:type filter_: :cla... | bigtable/google/cloud/bigtable/table.py | def read_row(self, row_key, filter_=None):
"""Read a single row from this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_read_row]
:end-before: [END bigtable_read_row]
:type row_key: bytes
:param row_key: The key... | def read_row(self, row_key, filter_=None):
"""Read a single row from this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_read_row]
:end-before: [END bigtable_read_row]
:type row_key: bytes
:param row_key: The key... | [
"Read",
"a",
"single",
"row",
"from",
"this",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L337-L365 | [
"def",
"read_row",
"(",
"self",
",",
"row_key",
",",
"filter_",
"=",
"None",
")",
":",
"row_set",
"=",
"RowSet",
"(",
")",
"row_set",
".",
"add_row_key",
"(",
"row_key",
")",
"result_iter",
"=",
"iter",
"(",
"self",
".",
"read_rows",
"(",
"filter_",
"=... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.read_rows | Read rows from this table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_read_rows]
:end-before: [END bigtable_read_rows]
:type start_key: bytes
:param start_key: (Optional) The beginning of a range of row keys to
... | bigtable/google/cloud/bigtable/table.py | def read_rows(
self,
start_key=None,
end_key=None,
limit=None,
filter_=None,
end_inclusive=False,
row_set=None,
retry=DEFAULT_RETRY_READ_ROWS,
):
"""Read rows from this table.
For example:
.. literalinclude:: snippets_table.py... | def read_rows(
self,
start_key=None,
end_key=None,
limit=None,
filter_=None,
end_inclusive=False,
row_set=None,
retry=DEFAULT_RETRY_READ_ROWS,
):
"""Read rows from this table.
For example:
.. literalinclude:: snippets_table.py... | [
"Read",
"rows",
"from",
"this",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L367-L436 | [
"def",
"read_rows",
"(",
"self",
",",
"start_key",
"=",
"None",
",",
"end_key",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"filter_",
"=",
"None",
",",
"end_inclusive",
"=",
"False",
",",
"row_set",
"=",
"None",
",",
"retry",
"=",
"DEFAULT_RETRY_READ_R... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.yield_rows | Read rows from this table.
.. warning::
This method will be removed in future releases. Please use
``read_rows`` instead.
:type start_key: bytes
:param start_key: (Optional) The beginning of a range of row keys to
read from. The range will inclu... | bigtable/google/cloud/bigtable/table.py | def yield_rows(self, **kwargs):
"""Read rows from this table.
.. warning::
This method will be removed in future releases. Please use
``read_rows`` instead.
:type start_key: bytes
:param start_key: (Optional) The beginning of a range of row keys to
... | def yield_rows(self, **kwargs):
"""Read rows from this table.
.. warning::
This method will be removed in future releases. Please use
``read_rows`` instead.
:type start_key: bytes
:param start_key: (Optional) The beginning of a range of row keys to
... | [
"Read",
"rows",
"from",
"this",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L438-L477 | [
"def",
"yield_rows",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"\"`yield_rows()` is depricated; use `red_rows()` instead\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
",",
")",
"return",
"self",
".",
"read_rows",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.mutate_rows | Mutates multiple rows in bulk.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_mutate_rows]
:end-before: [END bigtable_mutate_rows]
The method tries to update all specified rows.
If some of the rows weren't updated, it would not... | bigtable/google/cloud/bigtable/table.py | def mutate_rows(self, rows, retry=DEFAULT_RETRY):
"""Mutates multiple rows in bulk.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_mutate_rows]
:end-before: [END bigtable_mutate_rows]
The method tries to update all specified ro... | def mutate_rows(self, rows, retry=DEFAULT_RETRY):
"""Mutates multiple rows in bulk.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_mutate_rows]
:end-before: [END bigtable_mutate_rows]
The method tries to update all specified ro... | [
"Mutates",
"multiple",
"rows",
"in",
"bulk",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L479-L521 | [
"def",
"mutate_rows",
"(",
"self",
",",
"rows",
",",
"retry",
"=",
"DEFAULT_RETRY",
")",
":",
"retryable_mutate_rows",
"=",
"_RetryableMutateRowsWorker",
"(",
"self",
".",
"_instance",
".",
"_client",
",",
"self",
".",
"name",
",",
"rows",
",",
"app_profile_id... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.sample_row_keys | Read a sample of row keys in the table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_sample_row_keys]
:end-before: [END bigtable_sample_row_keys]
The returned row keys will delimit contiguous sections of the table of
approxim... | bigtable/google/cloud/bigtable/table.py | def sample_row_keys(self):
"""Read a sample of row keys in the table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_sample_row_keys]
:end-before: [END bigtable_sample_row_keys]
The returned row keys will delimit contiguous sec... | def sample_row_keys(self):
"""Read a sample of row keys in the table.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_sample_row_keys]
:end-before: [END bigtable_sample_row_keys]
The returned row keys will delimit contiguous sec... | [
"Read",
"a",
"sample",
"of",
"row",
"keys",
"in",
"the",
"table",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L523-L565 | [
"def",
"sample_row_keys",
"(",
"self",
")",
":",
"data_client",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"table_data_client",
"response_iterator",
"=",
"data_client",
".",
"sample_row_keys",
"(",
"self",
".",
"name",
",",
"app_profile_id",
"=",
"self"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.truncate | Truncate the table
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_truncate_table]
:end-before: [END bigtable_truncate_table]
:type timeout: float
:param timeout: (Optional) The amount of time, in seconds, to wait
... | bigtable/google/cloud/bigtable/table.py | def truncate(self, timeout=None):
"""Truncate the table
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_truncate_table]
:end-before: [END bigtable_truncate_table]
:type timeout: float
:param timeout: (Optional) The amoun... | def truncate(self, timeout=None):
"""Truncate the table
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_truncate_table]
:end-before: [END bigtable_truncate_table]
:type timeout: float
:param timeout: (Optional) The amoun... | [
"Truncate",
"the",
"table"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L567-L595 | [
"def",
"truncate",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"table_admin_client",
"=",
"client",
".",
"table_admin_client",
"if",
"timeout",
":",
"table_admin_client",
".",
"drop_row_range",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Table.mutations_batcher | Factory to create a mutation batcher associated with this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_mutations_batcher]
:end-before: [END bigtable_mutations_batcher]
:type table: class
:param table: class:`~google... | bigtable/google/cloud/bigtable/table.py | def mutations_batcher(self, flush_count=FLUSH_COUNT, max_row_bytes=MAX_ROW_BYTES):
"""Factory to create a mutation batcher associated with this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_mutations_batcher]
:end-before: [EN... | def mutations_batcher(self, flush_count=FLUSH_COUNT, max_row_bytes=MAX_ROW_BYTES):
"""Factory to create a mutation batcher associated with this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_mutations_batcher]
:end-before: [EN... | [
"Factory",
"to",
"create",
"a",
"mutation",
"batcher",
"associated",
"with",
"this",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L631-L655 | [
"def",
"mutations_batcher",
"(",
"self",
",",
"flush_count",
"=",
"FLUSH_COUNT",
",",
"max_row_bytes",
"=",
"MAX_ROW_BYTES",
")",
":",
"return",
"MutationsBatcher",
"(",
"self",
",",
"flush_count",
",",
"max_row_bytes",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _RetryableMutateRowsWorker._do_mutate_retryable_rows | Mutate all the rows that are eligible for retry.
A row is eligible for retry if it has not been tried or if it resulted
in a transient error in a previous call.
:rtype: list
:return: The responses statuses, which is a list of
:class:`~google.rpc.status_pb2.Status`.
... | bigtable/google/cloud/bigtable/table.py | def _do_mutate_retryable_rows(self):
"""Mutate all the rows that are eligible for retry.
A row is eligible for retry if it has not been tried or if it resulted
in a transient error in a previous call.
:rtype: list
:return: The responses statuses, which is a list of
... | def _do_mutate_retryable_rows(self):
"""Mutate all the rows that are eligible for retry.
A row is eligible for retry if it has not been tried or if it resulted
in a transient error in a previous call.
:rtype: list
:return: The responses statuses, which is a list of
... | [
"Mutate",
"all",
"the",
"rows",
"that",
"are",
"eligible",
"for",
"retry",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/table.py#L712-L784 | [
"def",
"_do_mutate_retryable_rows",
"(",
"self",
")",
":",
"retryable_rows",
"=",
"[",
"]",
"index_into_all_rows",
"=",
"[",
"]",
"for",
"index",
",",
"status",
"in",
"enumerate",
"(",
"self",
".",
"responses_statuses",
")",
":",
"if",
"self",
".",
"_is_retr... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Heartbeater.heartbeat | Periodically send heartbeats. | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/heartbeater.py | def heartbeat(self):
"""Periodically send heartbeats."""
while self._manager.is_active and not self._stop_event.is_set():
self._manager.heartbeat()
_LOGGER.debug("Sent heartbeat.")
self._stop_event.wait(timeout=self._period)
_LOGGER.info("%s exiting.", _HEART... | def heartbeat(self):
"""Periodically send heartbeats."""
while self._manager.is_active and not self._stop_event.is_set():
self._manager.heartbeat()
_LOGGER.debug("Sent heartbeat.")
self._stop_event.wait(timeout=self._period)
_LOGGER.info("%s exiting.", _HEART... | [
"Periodically",
"send",
"heartbeats",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/heartbeater.py#L37-L44 | [
"def",
"heartbeat",
"(",
"self",
")",
":",
"while",
"self",
".",
"_manager",
".",
"is_active",
"and",
"not",
"self",
".",
"_stop_event",
".",
"is_set",
"(",
")",
":",
"self",
".",
"_manager",
".",
"heartbeat",
"(",
")",
"_LOGGER",
".",
"debug",
"(",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ReportErrorsServiceClient.report_error_event | Report an individual error event.
Example:
>>> from google.cloud import errorreporting_v1beta1
>>>
>>> client = errorreporting_v1beta1.ReportErrorsServiceClient()
>>>
>>> project_name = client.project_path('[PROJECT]')
>>>
>>> ... | error_reporting/google/cloud/errorreporting_v1beta1/gapic/report_errors_service_client.py | def report_error_event(
self,
project_name,
event,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Report an individual error event.
Example:
>>> from google.clo... | def report_error_event(
self,
project_name,
event,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Report an individual error event.
Example:
>>> from google.clo... | [
"Report",
"an",
"individual",
"error",
"event",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/error_reporting/google/cloud/errorreporting_v1beta1/gapic/report_errors_service_client.py#L188-L268 | [
"def",
"report_error_event",
"(",
"self",
",",
"project_name",
",",
"event",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.