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 | explain_prediction_dfs | Explain prediction and export explanation
to a dict with ``pandas.DataFrame`` values
(as :func:`eli5.formatters.as_dataframe.format_as_dataframes` does).
All keyword arguments are passed to :func:`eli5.explain_prediction`.
Weights of all features are exported by default. | eli5/formatters/as_dataframe.py | def explain_prediction_dfs(estimator, doc, **kwargs):
# type: (...) -> Dict[str, pd.DataFrame]
""" Explain prediction and export explanation
to a dict with ``pandas.DataFrame`` values
(as :func:`eli5.formatters.as_dataframe.format_as_dataframes` does).
All keyword arguments are passed to :func:`eli5... | def explain_prediction_dfs(estimator, doc, **kwargs):
# type: (...) -> Dict[str, pd.DataFrame]
""" Explain prediction and export explanation
to a dict with ``pandas.DataFrame`` values
(as :func:`eli5.formatters.as_dataframe.format_as_dataframes` does).
All keyword arguments are passed to :func:`eli5... | [
"Explain",
"prediction",
"and",
"export",
"explanation",
"to",
"a",
"dict",
"with",
"pandas",
".",
"DataFrame",
"values",
"(",
"as",
":",
"func",
":",
"eli5",
".",
"formatters",
".",
"as_dataframe",
".",
"format_as_dataframes",
"does",
")",
".",
"All",
"keyw... | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/formatters/as_dataframe.py#L49-L59 | [
"def",
"explain_prediction_dfs",
"(",
"estimator",
",",
"doc",
",",
"*",
"*",
"kwargs",
")",
":",
"# type: (...) -> Dict[str, pd.DataFrame]",
"kwargs",
"=",
"_set_defaults",
"(",
"kwargs",
")",
"return",
"format_as_dataframes",
"(",
"eli5",
".",
"explain_prediction",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | format_as_dataframes | Export an explanation to a dictionary with ``pandas.DataFrame`` values
and string keys that correspond to explanation attributes.
Use this method if several dataframes can be exported from a single
explanation (e.g. for CRF explanation with has both feature weights
and transition matrix).
Note that ... | eli5/formatters/as_dataframe.py | def format_as_dataframes(explanation):
# type: (Explanation) -> Dict[str, pd.DataFrame]
""" Export an explanation to a dictionary with ``pandas.DataFrame`` values
and string keys that correspond to explanation attributes.
Use this method if several dataframes can be exported from a single
explanatio... | def format_as_dataframes(explanation):
# type: (Explanation) -> Dict[str, pd.DataFrame]
""" Export an explanation to a dictionary with ``pandas.DataFrame`` values
and string keys that correspond to explanation attributes.
Use this method if several dataframes can be exported from a single
explanatio... | [
"Export",
"an",
"explanation",
"to",
"a",
"dictionary",
"with",
"pandas",
".",
"DataFrame",
"values",
"and",
"string",
"keys",
"that",
"correspond",
"to",
"explanation",
"attributes",
".",
"Use",
"this",
"method",
"if",
"several",
"dataframes",
"can",
"be",
"e... | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/formatters/as_dataframe.py#L72-L89 | [
"def",
"format_as_dataframes",
"(",
"explanation",
")",
":",
"# type: (Explanation) -> Dict[str, pd.DataFrame]",
"result",
"=",
"{",
"}",
"for",
"attr",
"in",
"_EXPORTED_ATTRIBUTES",
":",
"value",
"=",
"getattr",
"(",
"explanation",
",",
"attr",
")",
"if",
"value",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | format_as_dataframe | Export an explanation to a single ``pandas.DataFrame``.
In case several dataframes could be exported by
:func:`eli5.formatters.as_dataframe.format_as_dataframes`,
a warning is raised. If no dataframe can be exported, ``None`` is returned.
This function also accepts some components of the explanation as ... | eli5/formatters/as_dataframe.py | def format_as_dataframe(explanation):
# type: (Explanation) -> Optional[pd.DataFrame]
""" Export an explanation to a single ``pandas.DataFrame``.
In case several dataframes could be exported by
:func:`eli5.formatters.as_dataframe.format_as_dataframes`,
a warning is raised. If no dataframe can be exp... | def format_as_dataframe(explanation):
# type: (Explanation) -> Optional[pd.DataFrame]
""" Export an explanation to a single ``pandas.DataFrame``.
In case several dataframes could be exported by
:func:`eli5.formatters.as_dataframe.format_as_dataframes`,
a warning is raised. If no dataframe can be exp... | [
"Export",
"an",
"explanation",
"to",
"a",
"single",
"pandas",
".",
"DataFrame",
".",
"In",
"case",
"several",
"dataframes",
"could",
"be",
"exported",
"by",
":",
"func",
":",
"eli5",
".",
"formatters",
".",
"as_dataframe",
".",
"format_as_dataframes",
"a",
"... | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/formatters/as_dataframe.py#L93-L116 | [
"def",
"format_as_dataframe",
"(",
"explanation",
")",
":",
"# type: (Explanation) -> Optional[pd.DataFrame]",
"for",
"attr",
"in",
"_EXPORTED_ATTRIBUTES",
":",
"value",
"=",
"getattr",
"(",
"explanation",
",",
"attr",
")",
"if",
"value",
":",
"other_attrs",
"=",
"[... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | iter_shuffled | Return an iterator of X matrices which have one or more columns shuffled.
After each iteration yielded matrix is mutated inplace, so
if you want to use multiple of them at the same time, make copies.
``columns_to_shuffle`` is a sequence of column numbers to shuffle.
By default, all columns are shuffled... | eli5/permutation_importance.py | def iter_shuffled(X, columns_to_shuffle=None, pre_shuffle=False,
random_state=None):
"""
Return an iterator of X matrices which have one or more columns shuffled.
After each iteration yielded matrix is mutated inplace, so
if you want to use multiple of them at the same time, make copie... | def iter_shuffled(X, columns_to_shuffle=None, pre_shuffle=False,
random_state=None):
"""
Return an iterator of X matrices which have one or more columns shuffled.
After each iteration yielded matrix is mutated inplace, so
if you want to use multiple of them at the same time, make copie... | [
"Return",
"an",
"iterator",
"of",
"X",
"matrices",
"which",
"have",
"one",
"or",
"more",
"columns",
"shuffled",
".",
"After",
"each",
"iteration",
"yielded",
"matrix",
"is",
"mutated",
"inplace",
"so",
"if",
"you",
"want",
"to",
"use",
"multiple",
"of",
"t... | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/permutation_importance.py#L20-L52 | [
"def",
"iter_shuffled",
"(",
"X",
",",
"columns_to_shuffle",
"=",
"None",
",",
"pre_shuffle",
"=",
"False",
",",
"random_state",
"=",
"None",
")",
":",
"rng",
"=",
"check_random_state",
"(",
"random_state",
")",
"if",
"columns_to_shuffle",
"is",
"None",
":",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | get_score_importances | Return ``(base_score, score_decreases)`` tuple with the base score and
score decreases when a feature is not available.
``base_score`` is ``score_func(X, y)``; ``score_decreases``
is a list of length ``n_iter`` with feature importance arrays
(each array is of shape ``n_features``); feature importances ... | eli5/permutation_importance.py | def get_score_importances(
score_func, # type: Callable[[Any, Any], float]
X,
y,
n_iter=5, # type: int
columns_to_shuffle=None,
random_state=None
):
# type: (...) -> Tuple[float, List[np.ndarray]]
"""
Return ``(base_score, score_decreases)`` tuple with t... | def get_score_importances(
score_func, # type: Callable[[Any, Any], float]
X,
y,
n_iter=5, # type: int
columns_to_shuffle=None,
random_state=None
):
# type: (...) -> Tuple[float, List[np.ndarray]]
"""
Return ``(base_score, score_decreases)`` tuple with t... | [
"Return",
"(",
"base_score",
"score_decreases",
")",
"tuple",
"with",
"the",
"base",
"score",
"and",
"score",
"decreases",
"when",
"a",
"feature",
"is",
"not",
"available",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/permutation_importance.py#L55-L94 | [
"def",
"get_score_importances",
"(",
"score_func",
",",
"# type: Callable[[Any, Any], float]",
"X",
",",
"y",
",",
"n_iter",
"=",
"5",
",",
"# type: int",
"columns_to_shuffle",
"=",
"None",
",",
"random_state",
"=",
"None",
")",
":",
"# type: (...) -> Tuple[float, Lis... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | show_weights | Return an explanation of estimator parameters (weights)
as an IPython.display.HTML object. Use this function
to show classifier weights in IPython.
:func:`show_weights` accepts all
:func:`eli5.explain_weights` arguments and all
:func:`eli5.formatters.html.format_as_html`
keyword arguments, so i... | eli5/ipython.py | def show_weights(estimator, **kwargs):
""" Return an explanation of estimator parameters (weights)
as an IPython.display.HTML object. Use this function
to show classifier weights in IPython.
:func:`show_weights` accepts all
:func:`eli5.explain_weights` arguments and all
:func:`eli5.formatters.h... | def show_weights(estimator, **kwargs):
""" Return an explanation of estimator parameters (weights)
as an IPython.display.HTML object. Use this function
to show classifier weights in IPython.
:func:`show_weights` accepts all
:func:`eli5.explain_weights` arguments and all
:func:`eli5.formatters.h... | [
"Return",
"an",
"explanation",
"of",
"estimator",
"parameters",
"(",
"weights",
")",
"as",
"an",
"IPython",
".",
"display",
".",
"HTML",
"object",
".",
"Use",
"this",
"function",
"to",
"show",
"classifier",
"weights",
"in",
"IPython",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/ipython.py#L17-L121 | [
"def",
"show_weights",
"(",
"estimator",
",",
"*",
"*",
"kwargs",
")",
":",
"format_kwargs",
",",
"explain_kwargs",
"=",
"_split_kwargs",
"(",
"kwargs",
")",
"expl",
"=",
"explain_weights",
"(",
"estimator",
",",
"*",
"*",
"explain_kwargs",
")",
"html",
"=",... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | show_prediction | Return an explanation of estimator prediction
as an IPython.display.HTML object. Use this function
to show information about classifier prediction in IPython.
:func:`show_prediction` accepts all
:func:`eli5.explain_prediction` arguments and all
:func:`eli5.formatters.html.format_as_html`
keywor... | eli5/ipython.py | def show_prediction(estimator, doc, **kwargs):
""" Return an explanation of estimator prediction
as an IPython.display.HTML object. Use this function
to show information about classifier prediction in IPython.
:func:`show_prediction` accepts all
:func:`eli5.explain_prediction` arguments and all
... | def show_prediction(estimator, doc, **kwargs):
""" Return an explanation of estimator prediction
as an IPython.display.HTML object. Use this function
to show information about classifier prediction in IPython.
:func:`show_prediction` accepts all
:func:`eli5.explain_prediction` arguments and all
... | [
"Return",
"an",
"explanation",
"of",
"estimator",
"prediction",
"as",
"an",
"IPython",
".",
"display",
".",
"HTML",
"object",
".",
"Use",
"this",
"function",
"to",
"show",
"information",
"about",
"classifier",
"prediction",
"in",
"IPython",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/ipython.py#L124-L272 | [
"def",
"show_prediction",
"(",
"estimator",
",",
"doc",
",",
"*",
"*",
"kwargs",
")",
":",
"format_kwargs",
",",
"explain_kwargs",
"=",
"_split_kwargs",
"(",
"kwargs",
")",
"expl",
"=",
"explain_prediction",
"(",
"estimator",
",",
"doc",
",",
"*",
"*",
"ex... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | get_tree_info | Convert DecisionTreeClassifier or DecisionTreeRegressor
to an inspectable object. | eli5/sklearn/treeinspect.py | def get_tree_info(decision_tree,
feature_names=None,
**export_graphviz_kwargs):
# type: (...) -> TreeInfo
"""
Convert DecisionTreeClassifier or DecisionTreeRegressor
to an inspectable object.
"""
return TreeInfo(
criterion=decision_tree.criterion,
... | def get_tree_info(decision_tree,
feature_names=None,
**export_graphviz_kwargs):
# type: (...) -> TreeInfo
"""
Convert DecisionTreeClassifier or DecisionTreeRegressor
to an inspectable object.
"""
return TreeInfo(
criterion=decision_tree.criterion,
... | [
"Convert",
"DecisionTreeClassifier",
"or",
"DecisionTreeRegressor",
"to",
"an",
"inspectable",
"object",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/sklearn/treeinspect.py#L16-L31 | [
"def",
"get_tree_info",
"(",
"decision_tree",
",",
"feature_names",
"=",
"None",
",",
"*",
"*",
"export_graphviz_kwargs",
")",
":",
"# type: (...) -> TreeInfo",
"return",
"TreeInfo",
"(",
"criterion",
"=",
"decision_tree",
".",
"criterion",
",",
"tree",
"=",
"_get... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | generate_samples | Return ``n_samples`` changed versions of text (with some words removed),
along with distances between the original text and a generated
examples. If ``bow=False``, all tokens are considered unique
(i.e. token position matters). | eli5/lime/textutils.py | def generate_samples(text, # type: TokenizedText
n_samples=500, # type: int
bow=True, # type: bool
random_state=None,
replacement='', # type: str
min_replace=1, # type: Uni... | def generate_samples(text, # type: TokenizedText
n_samples=500, # type: int
bow=True, # type: bool
random_state=None,
replacement='', # type: str
min_replace=1, # type: Uni... | [
"Return",
"n_samples",
"changed",
"versions",
"of",
"text",
"(",
"with",
"some",
"words",
"removed",
")",
"along",
"with",
"distances",
"between",
"the",
"original",
"text",
"and",
"a",
"generated",
"examples",
".",
"If",
"bow",
"=",
"False",
"all",
"tokens"... | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/textutils.py#L23-L55 | [
"def",
"generate_samples",
"(",
"text",
",",
"# type: TokenizedText",
"n_samples",
"=",
"500",
",",
"# type: int",
"bow",
"=",
"True",
",",
"# type: bool",
"random_state",
"=",
"None",
",",
"replacement",
"=",
"''",
",",
"# type: str",
"min_replace",
"=",
"1",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | cosine_similarity_vec | Return cosine similarity between a binary vector with all ones
of length ``num_tokens`` and vectors of the same length with
``num_removed_vec`` elements set to zero. | eli5/lime/textutils.py | def cosine_similarity_vec(num_tokens, num_removed_vec):
"""
Return cosine similarity between a binary vector with all ones
of length ``num_tokens`` and vectors of the same length with
``num_removed_vec`` elements set to zero.
"""
remaining = -np.array(num_removed_vec) + num_tokens
return rem... | def cosine_similarity_vec(num_tokens, num_removed_vec):
"""
Return cosine similarity between a binary vector with all ones
of length ``num_tokens`` and vectors of the same length with
``num_removed_vec`` elements set to zero.
"""
remaining = -np.array(num_removed_vec) + num_tokens
return rem... | [
"Return",
"cosine",
"similarity",
"between",
"a",
"binary",
"vector",
"with",
"all",
"ones",
"of",
"length",
"num_tokens",
"and",
"vectors",
"of",
"the",
"same",
"length",
"with",
"num_removed_vec",
"elements",
"set",
"to",
"zero",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/textutils.py#L58-L65 | [
"def",
"cosine_similarity_vec",
"(",
"num_tokens",
",",
"num_removed_vec",
")",
":",
"remaining",
"=",
"-",
"np",
".",
"array",
"(",
"num_removed_vec",
")",
"+",
"num_tokens",
"return",
"remaining",
"/",
"(",
"np",
".",
"sqrt",
"(",
"num_tokens",
"+",
"1e-6"... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | TokenizedText.replace_random_tokens | Return a list of ``(text, replaced_count, mask)``
tuples with n_samples versions of text with some words replaced.
By default words are replaced with '', i.e. removed. | eli5/lime/textutils.py | def replace_random_tokens(self,
n_samples, # type: int
replacement='', # type: str
random_state=None,
min_replace=1, # type: Union[int, float]
max_replace=1.0, # type... | def replace_random_tokens(self,
n_samples, # type: int
replacement='', # type: str
random_state=None,
min_replace=1, # type: Union[int, float]
max_replace=1.0, # type... | [
"Return",
"a",
"list",
"of",
"(",
"text",
"replaced_count",
"mask",
")",
"tuples",
"with",
"n_samples",
"versions",
"of",
"text",
"with",
"some",
"words",
"replaced",
".",
"By",
"default",
"words",
"are",
"replaced",
"with",
"i",
".",
"e",
".",
"removed",
... | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/textutils.py#L75-L110 | [
"def",
"replace_random_tokens",
"(",
"self",
",",
"n_samples",
",",
"# type: int",
"replacement",
"=",
"''",
",",
"# type: str",
"random_state",
"=",
"None",
",",
"min_replace",
"=",
"1",
",",
"# type: Union[int, float]",
"max_replace",
"=",
"1.0",
",",
"# type: U... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | TokenizedText.replace_random_tokens_bow | Return a list of ``(text, replaced_words_count, mask)`` tuples with
n_samples versions of text with some words replaced.
If a word is replaced, all duplicate words are also replaced
from the text. By default words are replaced with '', i.e. removed. | eli5/lime/textutils.py | def replace_random_tokens_bow(self,
n_samples, # type: int
replacement='', # type: str
random_state=None,
min_replace=1, # type: Union[int, float]
... | def replace_random_tokens_bow(self,
n_samples, # type: int
replacement='', # type: str
random_state=None,
min_replace=1, # type: Union[int, float]
... | [
"Return",
"a",
"list",
"of",
"(",
"text",
"replaced_words_count",
"mask",
")",
"tuples",
"with",
"n_samples",
"versions",
"of",
"text",
"with",
"some",
"words",
"replaced",
".",
"If",
"a",
"word",
"is",
"replaced",
"all",
"duplicate",
"words",
"are",
"also",... | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/textutils.py#L112-L144 | [
"def",
"replace_random_tokens_bow",
"(",
"self",
",",
"n_samples",
",",
"# type: int",
"replacement",
"=",
"''",
",",
"# type: str",
"random_state",
"=",
"None",
",",
"min_replace",
"=",
"1",
",",
"# type: Union[int, float]",
"max_replace",
"=",
"1.0",
",",
"# typ... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | TextExplainer.fit | Explain ``predict_proba`` probabilistic classification function
for the ``doc`` example. This method fits a local classification
pipeline following LIME approach.
To get the explanation use :meth:`show_prediction`,
:meth:`show_weights`, :meth:`explain_prediction` or
:meth:`expla... | eli5/lime/lime.py | def fit(self,
doc, # type: str
predict_proba, # type: Callable[[Any], Any]
):
# type: (...) -> TextExplainer
"""
Explain ``predict_proba`` probabilistic classification function
for the ``doc`` example. This method fits a local classificat... | def fit(self,
doc, # type: str
predict_proba, # type: Callable[[Any], Any]
):
# type: (...) -> TextExplainer
"""
Explain ``predict_proba`` probabilistic classification function
for the ``doc`` example. This method fits a local classificat... | [
"Explain",
"predict_proba",
"probabilistic",
"classification",
"function",
"for",
"the",
"doc",
"example",
".",
"This",
"method",
"fits",
"a",
"local",
"classification",
"pipeline",
"following",
"LIME",
"approach",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/lime.py#L206-L267 | [
"def",
"fit",
"(",
"self",
",",
"doc",
",",
"# type: str",
"predict_proba",
",",
"# type: Callable[[Any], Any]",
")",
":",
"# type: (...) -> TextExplainer",
"self",
".",
"doc_",
"=",
"doc",
"if",
"self",
".",
"position_dependent",
":",
"samples",
",",
"sims",
",... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | TextExplainer.show_prediction | Call :func:`eli5.show_prediction` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_prediction`.
:func:`fit` must be called before using this method. | eli5/lime/lime.py | def show_prediction(self, **kwargs):
"""
Call :func:`eli5.show_prediction` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_prediction`.
:func:`fit` must be called before using this method.
"""
self._fix_target_names(k... | def show_prediction(self, **kwargs):
"""
Call :func:`eli5.show_prediction` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_prediction`.
:func:`fit` must be called before using this method.
"""
self._fix_target_names(k... | [
"Call",
":",
"func",
":",
"eli5",
".",
"show_prediction",
"for",
"the",
"locally",
"-",
"fit",
"classification",
"pipeline",
".",
"Keyword",
"arguments",
"are",
"passed",
"to",
":",
"func",
":",
"eli5",
".",
"show_prediction",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/lime.py#L269-L279 | [
"def",
"show_prediction",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_fix_target_names",
"(",
"kwargs",
")",
"return",
"eli5",
".",
"show_prediction",
"(",
"self",
".",
"clf_",
",",
"self",
".",
"doc_",
",",
"vec",
"=",
"self",
".",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | TextExplainer.show_weights | Call :func:`eli5.show_weights` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_weights`.
:func:`fit` must be called before using this method. | eli5/lime/lime.py | def show_weights(self, **kwargs):
"""
Call :func:`eli5.show_weights` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_weights`.
:func:`fit` must be called before using this method.
"""
self._fix_target_names(kwargs)
... | def show_weights(self, **kwargs):
"""
Call :func:`eli5.show_weights` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_weights`.
:func:`fit` must be called before using this method.
"""
self._fix_target_names(kwargs)
... | [
"Call",
":",
"func",
":",
"eli5",
".",
"show_weights",
"for",
"the",
"locally",
"-",
"fit",
"classification",
"pipeline",
".",
"Keyword",
"arguments",
"are",
"passed",
"to",
":",
"func",
":",
"eli5",
".",
"show_weights",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/lime.py#L293-L302 | [
"def",
"show_weights",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_fix_target_names",
"(",
"kwargs",
")",
"return",
"eli5",
".",
"show_weights",
"(",
"self",
".",
"clf_",
",",
"vec",
"=",
"self",
".",
"vec_",
",",
"*",
"*",
"kwargs... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | TextExplainer.explain_weights | Call :func:`eli5.show_weights` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_weights`.
:func:`fit` must be called before using this method. | eli5/lime/lime.py | def explain_weights(self, **kwargs):
"""
Call :func:`eli5.show_weights` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_weights`.
:func:`fit` must be called before using this method.
"""
self._fix_target_names(kwargs)... | def explain_weights(self, **kwargs):
"""
Call :func:`eli5.show_weights` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_weights`.
:func:`fit` must be called before using this method.
"""
self._fix_target_names(kwargs)... | [
"Call",
":",
"func",
":",
"eli5",
".",
"show_weights",
"for",
"the",
"locally",
"-",
"fit",
"classification",
"pipeline",
".",
"Keyword",
"arguments",
"are",
"passed",
"to",
":",
"func",
":",
"eli5",
".",
"show_weights",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/lime.py#L304-L313 | [
"def",
"explain_weights",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_fix_target_names",
"(",
"kwargs",
")",
"return",
"eli5",
".",
"explain_weights",
"(",
"self",
".",
"clf_",
",",
"vec",
"=",
"self",
".",
"vec_",
",",
"*",
"*",
"... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | fit_proba | Fit classifier ``clf`` to return probabilities close to ``y_proba``.
scikit-learn can't optimize cross-entropy directly if target
probability values are not indicator vectors. As a workaround this function
expands the dataset according to target probabilities.
Use expand_factor=None to turn it off
... | eli5/lime/utils.py | def fit_proba(clf, X, y_proba, expand_factor=10, sample_weight=None,
shuffle=True, random_state=None,
**fit_params):
"""
Fit classifier ``clf`` to return probabilities close to ``y_proba``.
scikit-learn can't optimize cross-entropy directly if target
probability values are n... | def fit_proba(clf, X, y_proba, expand_factor=10, sample_weight=None,
shuffle=True, random_state=None,
**fit_params):
"""
Fit classifier ``clf`` to return probabilities close to ``y_proba``.
scikit-learn can't optimize cross-entropy directly if target
probability values are n... | [
"Fit",
"classifier",
"clf",
"to",
"return",
"probabilities",
"close",
"to",
"y_proba",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/utils.py#L16-L36 | [
"def",
"fit_proba",
"(",
"clf",
",",
"X",
",",
"y_proba",
",",
"expand_factor",
"=",
"10",
",",
"sample_weight",
"=",
"None",
",",
"shuffle",
"=",
"True",
",",
"random_state",
"=",
"None",
",",
"*",
"*",
"fit_params",
")",
":",
"X",
",",
"y",
",",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | with_sample_weight | Return fit_params with added "sample_weight" argument.
Unlike `fit_params['sample_weight'] = sample_weight` it
handles a case where ``clf`` is a pipeline. | eli5/lime/utils.py | def with_sample_weight(clf, sample_weight, fit_params):
"""
Return fit_params with added "sample_weight" argument.
Unlike `fit_params['sample_weight'] = sample_weight` it
handles a case where ``clf`` is a pipeline.
"""
param_name = _get_classifier_prefix(clf) + "sample_weight"
params = {para... | def with_sample_weight(clf, sample_weight, fit_params):
"""
Return fit_params with added "sample_weight" argument.
Unlike `fit_params['sample_weight'] = sample_weight` it
handles a case where ``clf`` is a pipeline.
"""
param_name = _get_classifier_prefix(clf) + "sample_weight"
params = {para... | [
"Return",
"fit_params",
"with",
"added",
"sample_weight",
"argument",
".",
"Unlike",
"fit_params",
"[",
"sample_weight",
"]",
"=",
"sample_weight",
"it",
"handles",
"a",
"case",
"where",
"clf",
"is",
"a",
"pipeline",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/utils.py#L39-L48 | [
"def",
"with_sample_weight",
"(",
"clf",
",",
"sample_weight",
",",
"fit_params",
")",
":",
"param_name",
"=",
"_get_classifier_prefix",
"(",
"clf",
")",
"+",
"\"sample_weight\"",
"params",
"=",
"{",
"param_name",
":",
"sample_weight",
"}",
"params",
".",
"updat... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | fix_multiclass_predict_proba | Add missing columns to predict_proba result.
When a multiclass classifier is fit on a dataset which only contains
a subset of possible classes its predict_proba result only has columns
corresponding to seen classes. This function adds missing columns. | eli5/lime/utils.py | def fix_multiclass_predict_proba(y_proba, # type: np.ndarray
seen_classes,
complete_classes
):
# type: (...) -> np.ndarray
"""
Add missing columns to predict_proba result.
When a multiclass class... | def fix_multiclass_predict_proba(y_proba, # type: np.ndarray
seen_classes,
complete_classes
):
# type: (...) -> np.ndarray
"""
Add missing columns to predict_proba result.
When a multiclass class... | [
"Add",
"missing",
"columns",
"to",
"predict_proba",
"result",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/utils.py#L51-L70 | [
"def",
"fix_multiclass_predict_proba",
"(",
"y_proba",
",",
"# type: np.ndarray",
"seen_classes",
",",
"complete_classes",
")",
":",
"# type: (...) -> np.ndarray",
"assert",
"set",
"(",
"complete_classes",
")",
">=",
"set",
"(",
"seen_classes",
")",
"y_proba_fixed",
"="... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | expanded_X_y_sample_weights | scikit-learn can't optimize cross-entropy directly if target
probability values are not indicator vectors.
As a workaround this function expands the dataset according to
target probabilities. ``expand_factor=None`` means no dataset
expansion. | eli5/lime/utils.py | def expanded_X_y_sample_weights(X, y_proba, expand_factor=10,
sample_weight=None, shuffle=True,
random_state=None):
"""
scikit-learn can't optimize cross-entropy directly if target
probability values are not indicator vectors.
As a workarou... | def expanded_X_y_sample_weights(X, y_proba, expand_factor=10,
sample_weight=None, shuffle=True,
random_state=None):
"""
scikit-learn can't optimize cross-entropy directly if target
probability values are not indicator vectors.
As a workarou... | [
"scikit",
"-",
"learn",
"can",
"t",
"optimize",
"cross",
"-",
"entropy",
"directly",
"if",
"target",
"probability",
"values",
"are",
"not",
"indicator",
"vectors",
".",
"As",
"a",
"workaround",
"this",
"function",
"expands",
"the",
"dataset",
"according",
"to"... | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/utils.py#L94-L129 | [
"def",
"expanded_X_y_sample_weights",
"(",
"X",
",",
"y_proba",
",",
"expand_factor",
"=",
"10",
",",
"sample_weight",
"=",
"None",
",",
"shuffle",
"=",
"True",
",",
"random_state",
"=",
"None",
")",
":",
"rng",
"=",
"check_random_state",
"(",
"random_state",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | expand_dataset | Convert a dataset with float multiclass probabilities to a dataset
with indicator probabilities by duplicating X rows and sampling
true labels. | eli5/lime/utils.py | def expand_dataset(X, y_proba, factor=10, random_state=None, extra_arrays=None):
"""
Convert a dataset with float multiclass probabilities to a dataset
with indicator probabilities by duplicating X rows and sampling
true labels.
"""
rng = check_random_state(random_state)
extra_arrays = extra... | def expand_dataset(X, y_proba, factor=10, random_state=None, extra_arrays=None):
"""
Convert a dataset with float multiclass probabilities to a dataset
with indicator probabilities by duplicating X rows and sampling
true labels.
"""
rng = check_random_state(random_state)
extra_arrays = extra... | [
"Convert",
"a",
"dataset",
"with",
"float",
"multiclass",
"probabilities",
"to",
"a",
"dataset",
"with",
"indicator",
"probabilities",
"by",
"duplicating",
"X",
"rows",
"and",
"sampling",
"true",
"labels",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/lime/utils.py#L132-L146 | [
"def",
"expand_dataset",
"(",
"X",
",",
"y_proba",
",",
"factor",
"=",
"10",
",",
"random_state",
"=",
"None",
",",
"extra_arrays",
"=",
"None",
")",
":",
"rng",
"=",
"check_random_state",
"(",
"random_state",
")",
"extra_arrays",
"=",
"extra_arrays",
"or",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | transform_feature_names | Get feature names for transformer output as a function of input names.
Used by :func:`explain_weights` when applied to a scikit-learn Pipeline,
this ``singledispatch`` should be registered with custom name
transformations for each class of transformer.
If there is no ``singledispatch`` handler reg... | eli5/transform.py | def transform_feature_names(transformer, in_names=None):
"""Get feature names for transformer output as a function of input names.
Used by :func:`explain_weights` when applied to a scikit-learn Pipeline,
this ``singledispatch`` should be registered with custom name
transformations for each class of tra... | def transform_feature_names(transformer, in_names=None):
"""Get feature names for transformer output as a function of input names.
Used by :func:`explain_weights` when applied to a scikit-learn Pipeline,
this ``singledispatch`` should be registered with custom name
transformations for each class of tra... | [
"Get",
"feature",
"names",
"for",
"transformer",
"output",
"as",
"a",
"function",
"of",
"input",
"names",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/transform.py#L7-L34 | [
"def",
"transform_feature_names",
"(",
"transformer",
",",
"in_names",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"transformer",
",",
"'get_feature_names'",
")",
":",
"return",
"transformer",
".",
"get_feature_names",
"(",
")",
"raise",
"NotImplementedError",
"(... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | get_weighted_spans | If possible, return a dict with preprocessed document and a list
of spans with weights, corresponding to features in the document. | eli5/sklearn/text.py | def get_weighted_spans(doc, vec, feature_weights):
# type: (Any, Any, FeatureWeights) -> Optional[WeightedSpans]
""" If possible, return a dict with preprocessed document and a list
of spans with weights, corresponding to features in the document.
"""
if isinstance(vec, FeatureUnion):
return... | def get_weighted_spans(doc, vec, feature_weights):
# type: (Any, Any, FeatureWeights) -> Optional[WeightedSpans]
""" If possible, return a dict with preprocessed document and a list
of spans with weights, corresponding to features in the document.
"""
if isinstance(vec, FeatureUnion):
return... | [
"If",
"possible",
"return",
"a",
"dict",
"with",
"preprocessed",
"document",
"and",
"a",
"list",
"of",
"spans",
"with",
"weights",
"corresponding",
"to",
"features",
"in",
"the",
"document",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/sklearn/text.py#L15-L30 | [
"def",
"get_weighted_spans",
"(",
"doc",
",",
"vec",
",",
"feature_weights",
")",
":",
"# type: (Any, Any, FeatureWeights) -> Optional[WeightedSpans]",
"if",
"isinstance",
"(",
"vec",
",",
"FeatureUnion",
")",
":",
"return",
"_get_weighted_spans_from_union",
"(",
"doc",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | add_weighted_spans | Compute and set ``target_expl.weighted_spans`` attribute, when possible. | eli5/sklearn/text.py | def add_weighted_spans(doc, vec, vectorized, target_expl):
# type: (Any, Any, bool, TargetExplanation) -> None
"""
Compute and set ``target_expl.weighted_spans`` attribute, when possible.
"""
if vec is None or vectorized:
return
weighted_spans = get_weighted_spans(doc, vec, target_expl.... | def add_weighted_spans(doc, vec, vectorized, target_expl):
# type: (Any, Any, bool, TargetExplanation) -> None
"""
Compute and set ``target_expl.weighted_spans`` attribute, when possible.
"""
if vec is None or vectorized:
return
weighted_spans = get_weighted_spans(doc, vec, target_expl.... | [
"Compute",
"and",
"set",
"target_expl",
".",
"weighted_spans",
"attribute",
"when",
"possible",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/sklearn/text.py#L33-L43 | [
"def",
"add_weighted_spans",
"(",
"doc",
",",
"vec",
",",
"vectorized",
",",
"target_expl",
")",
":",
"# type: (Any, Any, bool, TargetExplanation) -> None",
"if",
"vec",
"is",
"None",
"or",
"vectorized",
":",
"return",
"weighted_spans",
"=",
"get_weighted_spans",
"(",... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | _get_feature_weights_dict | Return {feat_name: (weight, (group, idx))} mapping. | eli5/sklearn/text.py | def _get_feature_weights_dict(feature_weights, # type: FeatureWeights
feature_fn # type: Optional[Callable[[str], str]]
):
# type: (...) -> Dict[str, Tuple[float, Tuple[str, int]]]
""" Return {feat_name: (weight, (group, idx))} mapping. """
... | def _get_feature_weights_dict(feature_weights, # type: FeatureWeights
feature_fn # type: Optional[Callable[[str], str]]
):
# type: (...) -> Dict[str, Tuple[float, Tuple[str, int]]]
""" Return {feat_name: (weight, (group, idx))} mapping. """
... | [
"Return",
"{",
"feat_name",
":",
"(",
"weight",
"(",
"group",
"idx",
"))",
"}",
"mapping",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/sklearn/text.py#L87-L98 | [
"def",
"_get_feature_weights_dict",
"(",
"feature_weights",
",",
"# type: FeatureWeights",
"feature_fn",
"# type: Optional[Callable[[str], str]]",
")",
":",
"# type: (...) -> Dict[str, Tuple[float, Tuple[str, int]]]",
"return",
"{",
"# (group, idx) is an unique feature identifier, e.g. ('p... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | PermutationImportance.fit | Compute ``feature_importances_`` attribute and optionally
fit the base estimator.
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 corres... | eli5/sklearn/permutation_importance.py | def fit(self, X, y, groups=None, **fit_params):
# type: (...) -> PermutationImportance
"""Compute ``feature_importances_`` attribute and optionally
fit the base estimator.
Parameters
----------
X : array-like of shape (n_samples, n_features)
The training inpu... | def fit(self, X, y, groups=None, **fit_params):
# type: (...) -> PermutationImportance
"""Compute ``feature_importances_`` attribute and optionally
fit the base estimator.
Parameters
----------
X : array-like of shape (n_samples, n_features)
The training inpu... | [
"Compute",
"feature_importances_",
"attribute",
"and",
"optionally",
"fit",
"the",
"base",
"estimator",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/sklearn/permutation_importance.py#L163-L208 | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
",",
"groups",
"=",
"None",
",",
"*",
"*",
"fit_params",
")",
":",
"# type: (...) -> PermutationImportance",
"self",
".",
"scorer_",
"=",
"check_scoring",
"(",
"self",
".",
"estimator",
",",
"scoring",
"=",
... | 371b402a0676295c05e582a2dd591f7af476b86b |
train | explain_prediction | Return an explanation of an estimator prediction.
:func:`explain_prediction` is not doing any work itself, it dispatches
to a concrete implementation based on estimator type.
Parameters
----------
estimator : object
Estimator instance. This argument must be positional.
doc : object
... | eli5/explain.py | def explain_prediction(estimator, doc, **kwargs):
"""
Return an explanation of an estimator prediction.
:func:`explain_prediction` is not doing any work itself, it dispatches
to a concrete implementation based on estimator type.
Parameters
----------
estimator : object
Estimator in... | def explain_prediction(estimator, doc, **kwargs):
"""
Return an explanation of an estimator prediction.
:func:`explain_prediction` is not doing any work itself, it dispatches
to a concrete implementation based on estimator type.
Parameters
----------
estimator : object
Estimator in... | [
"Return",
"an",
"explanation",
"of",
"an",
"estimator",
"prediction",
"."
] | TeamHG-Memex/eli5 | python | https://github.com/TeamHG-Memex/eli5/blob/371b402a0676295c05e582a2dd591f7af476b86b/eli5/explain.py#L83-L177 | [
"def",
"explain_prediction",
"(",
"estimator",
",",
"doc",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"Explanation",
"(",
"estimator",
"=",
"repr",
"(",
"estimator",
")",
",",
"error",
"=",
"\"estimator %r is not supported\"",
"%",
"estimator",
",",
")"
] | 371b402a0676295c05e582a2dd591f7af476b86b |
train | directions | Get directions between an origin point and a destination point.
:param origin: The address or latitude/longitude value from which you wish
to calculate directions.
:type origin: string, dict, list, or tuple
:param destination: The address or latitude/longitude value from which
you wish to ... | googlemaps/directions.py | def directions(client, origin, destination,
mode=None, waypoints=None, alternatives=False, avoid=None,
language=None, units=None, region=None, departure_time=None,
arrival_time=None, optimize_waypoints=False, transit_mode=None,
transit_routing_preference=None,... | def directions(client, origin, destination,
mode=None, waypoints=None, alternatives=False, avoid=None,
language=None, units=None, region=None, departure_time=None,
arrival_time=None, optimize_waypoints=False, transit_mode=None,
transit_routing_preference=None,... | [
"Get",
"directions",
"between",
"an",
"origin",
"point",
"and",
"a",
"destination",
"point",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/directions.py#L23-L151 | [
"def",
"directions",
"(",
"client",
",",
"origin",
",",
"destination",
",",
"mode",
"=",
"None",
",",
"waypoints",
"=",
"None",
",",
"alternatives",
"=",
"False",
",",
"avoid",
"=",
"None",
",",
"language",
"=",
"None",
",",
"units",
"=",
"None",
",",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | geocode | Geocoding is the process of converting addresses
(like ``"1600 Amphitheatre Parkway, Mountain View, CA"``) into geographic
coordinates (like latitude 37.423021 and longitude -122.083739), which you
can use to place markers or position the map.
:param address: The address to geocode.
:type address: ... | googlemaps/geocoding.py | def geocode(client, address=None, components=None, bounds=None, region=None,
language=None):
"""
Geocoding is the process of converting addresses
(like ``"1600 Amphitheatre Parkway, Mountain View, CA"``) into geographic
coordinates (like latitude 37.423021 and longitude -122.083739), which y... | def geocode(client, address=None, components=None, bounds=None, region=None,
language=None):
"""
Geocoding is the process of converting addresses
(like ``"1600 Amphitheatre Parkway, Mountain View, CA"``) into geographic
coordinates (like latitude 37.423021 and longitude -122.083739), which y... | [
"Geocoding",
"is",
"the",
"process",
"of",
"converting",
"addresses",
"(",
"like",
"1600",
"Amphitheatre",
"Parkway",
"Mountain",
"View",
"CA",
")",
"into",
"geographic",
"coordinates",
"(",
"like",
"latitude",
"37",
".",
"423021",
"and",
"longitude",
"-",
"12... | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/geocoding.py#L22-L68 | [
"def",
"geocode",
"(",
"client",
",",
"address",
"=",
"None",
",",
"components",
"=",
"None",
",",
"bounds",
"=",
"None",
",",
"region",
"=",
"None",
",",
"language",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"address",
":",
"params",
"... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | reverse_geocode | Reverse geocoding is the process of converting geographic coordinates into a
human-readable address.
:param latlng: The latitude/longitude value or place_id for which you wish
to obtain the closest, human-readable address.
:type latlng: string, dict, list, or tuple
:param result_type: One or m... | googlemaps/geocoding.py | def reverse_geocode(client, latlng, result_type=None, location_type=None,
language=None):
"""
Reverse geocoding is the process of converting geographic coordinates into a
human-readable address.
:param latlng: The latitude/longitude value or place_id for which you wish
to ob... | def reverse_geocode(client, latlng, result_type=None, location_type=None,
language=None):
"""
Reverse geocoding is the process of converting geographic coordinates into a
human-readable address.
:param latlng: The latitude/longitude value or place_id for which you wish
to ob... | [
"Reverse",
"geocoding",
"is",
"the",
"process",
"of",
"converting",
"geographic",
"coordinates",
"into",
"a",
"human",
"-",
"readable",
"address",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/geocoding.py#L71-L109 | [
"def",
"reverse_geocode",
"(",
"client",
",",
"latlng",
",",
"result_type",
"=",
"None",
",",
"location_type",
"=",
"None",
",",
"language",
"=",
"None",
")",
":",
"# Check if latlng param is a place_id string.",
"# place_id strings do not contain commas; latlng strings do... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | elevation | Provides elevation data for locations provided on the surface of the
earth, including depth locations on the ocean floor (which return negative
values)
:param locations: List of latitude/longitude values from which you wish
to calculate elevation data.
:type locations: a single location, or a l... | googlemaps/elevation.py | def elevation(client, locations):
"""
Provides elevation data for locations provided on the surface of the
earth, including depth locations on the ocean floor (which return negative
values)
:param locations: List of latitude/longitude values from which you wish
to calculate elevation data.
... | def elevation(client, locations):
"""
Provides elevation data for locations provided on the surface of the
earth, including depth locations on the ocean floor (which return negative
values)
:param locations: List of latitude/longitude values from which you wish
to calculate elevation data.
... | [
"Provides",
"elevation",
"data",
"for",
"locations",
"provided",
"on",
"the",
"surface",
"of",
"the",
"earth",
"including",
"depth",
"locations",
"on",
"the",
"ocean",
"floor",
"(",
"which",
"return",
"negative",
"values",
")"
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/elevation.py#L23-L37 | [
"def",
"elevation",
"(",
"client",
",",
"locations",
")",
":",
"params",
"=",
"{",
"\"locations\"",
":",
"convert",
".",
"shortest_path",
"(",
"locations",
")",
"}",
"return",
"client",
".",
"_request",
"(",
"\"/maps/api/elevation/json\"",
",",
"params",
")",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | elevation_along_path | Provides elevation data sampled along a path on the surface of the earth.
:param path: An encoded polyline string, or a list of latitude/longitude
values from which you wish to calculate elevation data.
:type path: string, dict, list, or tuple
:param samples: The number of sample points along a pa... | googlemaps/elevation.py | def elevation_along_path(client, path, samples):
"""
Provides elevation data sampled along a path on the surface of the earth.
:param path: An encoded polyline string, or a list of latitude/longitude
values from which you wish to calculate elevation data.
:type path: string, dict, list, or tupl... | def elevation_along_path(client, path, samples):
"""
Provides elevation data sampled along a path on the surface of the earth.
:param path: An encoded polyline string, or a list of latitude/longitude
values from which you wish to calculate elevation data.
:type path: string, dict, list, or tupl... | [
"Provides",
"elevation",
"data",
"sampled",
"along",
"a",
"path",
"on",
"the",
"surface",
"of",
"the",
"earth",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/elevation.py#L40-L65 | [
"def",
"elevation_along_path",
"(",
"client",
",",
"path",
",",
"samples",
")",
":",
"if",
"type",
"(",
"path",
")",
"is",
"str",
":",
"path",
"=",
"\"enc:%s\"",
"%",
"path",
"else",
":",
"path",
"=",
"convert",
".",
"shortest_path",
"(",
"path",
")",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | latlng | Converts a lat/lon pair to a comma-separated string.
For example:
sydney = {
"lat" : -33.8674869,
"lng" : 151.2069902
}
convert.latlng(sydney)
# '-33.8674869,151.2069902'
For convenience, also accepts lat/lon pair as a string, in
which case it's returned unchanged.
:... | googlemaps/convert.py | def latlng(arg):
"""Converts a lat/lon pair to a comma-separated string.
For example:
sydney = {
"lat" : -33.8674869,
"lng" : 151.2069902
}
convert.latlng(sydney)
# '-33.8674869,151.2069902'
For convenience, also accepts lat/lon pair as a string, in
which case it's re... | def latlng(arg):
"""Converts a lat/lon pair to a comma-separated string.
For example:
sydney = {
"lat" : -33.8674869,
"lng" : 151.2069902
}
convert.latlng(sydney)
# '-33.8674869,151.2069902'
For convenience, also accepts lat/lon pair as a string, in
which case it's re... | [
"Converts",
"a",
"lat",
"/",
"lon",
"pair",
"to",
"a",
"comma",
"-",
"separated",
"string",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L57-L80 | [
"def",
"latlng",
"(",
"arg",
")",
":",
"if",
"is_string",
"(",
"arg",
")",
":",
"return",
"arg",
"normalized",
"=",
"normalize_lat_lng",
"(",
"arg",
")",
"return",
"\"%s,%s\"",
"%",
"(",
"format_float",
"(",
"normalized",
"[",
"0",
"]",
")",
",",
"form... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | normalize_lat_lng | Take the various lat/lng representations and return a tuple.
Accepts various representations:
1) dict with two entries - "lat" and "lng"
2) list or tuple - e.g. (-33, 151) or [-33, 151]
:param arg: The lat/lng pair.
:type arg: dict or list or tuple
:rtype: tuple (lat, lng) | googlemaps/convert.py | def normalize_lat_lng(arg):
"""Take the various lat/lng representations and return a tuple.
Accepts various representations:
1) dict with two entries - "lat" and "lng"
2) list or tuple - e.g. (-33, 151) or [-33, 151]
:param arg: The lat/lng pair.
:type arg: dict or list or tuple
:rtype: t... | def normalize_lat_lng(arg):
"""Take the various lat/lng representations and return a tuple.
Accepts various representations:
1) dict with two entries - "lat" and "lng"
2) list or tuple - e.g. (-33, 151) or [-33, 151]
:param arg: The lat/lng pair.
:type arg: dict or list or tuple
:rtype: t... | [
"Take",
"the",
"various",
"lat",
"/",
"lng",
"representations",
"and",
"return",
"a",
"tuple",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L83-L107 | [
"def",
"normalize_lat_lng",
"(",
"arg",
")",
":",
"if",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"if",
"\"lat\"",
"in",
"arg",
"and",
"\"lng\"",
"in",
"arg",
":",
"return",
"arg",
"[",
"\"lat\"",
"]",
",",
"arg",
"[",
"\"lng\"",
"]",
"if",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | location_list | Joins a list of locations into a pipe separated string, handling
the various formats supported for lat/lng values.
For example:
p = [{"lat" : -33.867486, "lng" : 151.206990}, "Sydney"]
convert.waypoint(p)
# '-33.867486,151.206990|Sydney'
:param arg: The lat/lng list.
:type arg: list
:... | googlemaps/convert.py | def location_list(arg):
"""Joins a list of locations into a pipe separated string, handling
the various formats supported for lat/lng values.
For example:
p = [{"lat" : -33.867486, "lng" : 151.206990}, "Sydney"]
convert.waypoint(p)
# '-33.867486,151.206990|Sydney'
:param arg: The lat/lng l... | def location_list(arg):
"""Joins a list of locations into a pipe separated string, handling
the various formats supported for lat/lng values.
For example:
p = [{"lat" : -33.867486, "lng" : 151.206990}, "Sydney"]
convert.waypoint(p)
# '-33.867486,151.206990|Sydney'
:param arg: The lat/lng l... | [
"Joins",
"a",
"list",
"of",
"locations",
"into",
"a",
"pipe",
"separated",
"string",
"handling",
"the",
"various",
"formats",
"supported",
"for",
"lat",
"/",
"lng",
"values",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L110-L128 | [
"def",
"location_list",
"(",
"arg",
")",
":",
"if",
"isinstance",
"(",
"arg",
",",
"tuple",
")",
":",
"# Handle the single-tuple lat/lng case.",
"return",
"latlng",
"(",
"arg",
")",
"else",
":",
"return",
"\"|\"",
".",
"join",
"(",
"[",
"latlng",
"(",
"loc... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | _is_list | Checks if arg is list-like. This excludes strings and dicts. | googlemaps/convert.py | def _is_list(arg):
"""Checks if arg is list-like. This excludes strings and dicts."""
if isinstance(arg, dict):
return False
if isinstance(arg, str): # Python 3-only, as str has __iter__
return False
return (not _has_method(arg, "strip")
and _has_method(arg, "__getitem__")
... | def _is_list(arg):
"""Checks if arg is list-like. This excludes strings and dicts."""
if isinstance(arg, dict):
return False
if isinstance(arg, str): # Python 3-only, as str has __iter__
return False
return (not _has_method(arg, "strip")
and _has_method(arg, "__getitem__")
... | [
"Checks",
"if",
"arg",
"is",
"list",
"-",
"like",
".",
"This",
"excludes",
"strings",
"and",
"dicts",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L156-L164 | [
"def",
"_is_list",
"(",
"arg",
")",
":",
"if",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"return",
"False",
"if",
"isinstance",
"(",
"arg",
",",
"str",
")",
":",
"# Python 3-only, as str has __iter__",
"return",
"False",
"return",
"(",
"not",
"_has_... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | is_string | Determines whether the passed value is a string, safe for 2/3. | googlemaps/convert.py | def is_string(val):
"""Determines whether the passed value is a string, safe for 2/3."""
try:
basestring
except NameError:
return isinstance(val, str)
return isinstance(val, basestring) | def is_string(val):
"""Determines whether the passed value is a string, safe for 2/3."""
try:
basestring
except NameError:
return isinstance(val, str)
return isinstance(val, basestring) | [
"Determines",
"whether",
"the",
"passed",
"value",
"is",
"a",
"string",
"safe",
"for",
"2",
"/",
"3",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L167-L173 | [
"def",
"is_string",
"(",
"val",
")",
":",
"try",
":",
"basestring",
"except",
"NameError",
":",
"return",
"isinstance",
"(",
"val",
",",
"str",
")",
"return",
"isinstance",
"(",
"val",
",",
"basestring",
")"
] | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | time | Converts the value into a unix time (seconds since unix epoch).
For example:
convert.time(datetime.now())
# '1409810596'
:param arg: The time.
:type arg: datetime.datetime or int | googlemaps/convert.py | def time(arg):
"""Converts the value into a unix time (seconds since unix epoch).
For example:
convert.time(datetime.now())
# '1409810596'
:param arg: The time.
:type arg: datetime.datetime or int
"""
# handle datetime instances.
if _has_method(arg, "timetuple"):
ar... | def time(arg):
"""Converts the value into a unix time (seconds since unix epoch).
For example:
convert.time(datetime.now())
# '1409810596'
:param arg: The time.
:type arg: datetime.datetime or int
"""
# handle datetime instances.
if _has_method(arg, "timetuple"):
ar... | [
"Converts",
"the",
"value",
"into",
"a",
"unix",
"time",
"(",
"seconds",
"since",
"unix",
"epoch",
")",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L176-L193 | [
"def",
"time",
"(",
"arg",
")",
":",
"# handle datetime instances.",
"if",
"_has_method",
"(",
"arg",
",",
"\"timetuple\"",
")",
":",
"arg",
"=",
"_time",
".",
"mktime",
"(",
"arg",
".",
"timetuple",
"(",
")",
")",
"if",
"isinstance",
"(",
"arg",
",",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | _has_method | Returns true if the given object has a method with the given name.
:param arg: the object
:param method: the method name
:type method: string
:rtype: bool | googlemaps/convert.py | def _has_method(arg, method):
"""Returns true if the given object has a method with the given name.
:param arg: the object
:param method: the method name
:type method: string
:rtype: bool
"""
return hasattr(arg, method) and callable(getattr(arg, method)) | def _has_method(arg, method):
"""Returns true if the given object has a method with the given name.
:param arg: the object
:param method: the method name
:type method: string
:rtype: bool
"""
return hasattr(arg, method) and callable(getattr(arg, method)) | [
"Returns",
"true",
"if",
"the",
"given",
"object",
"has",
"a",
"method",
"with",
"the",
"given",
"name",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L196-L206 | [
"def",
"_has_method",
"(",
"arg",
",",
"method",
")",
":",
"return",
"hasattr",
"(",
"arg",
",",
"method",
")",
"and",
"callable",
"(",
"getattr",
"(",
"arg",
",",
"method",
")",
")"
] | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | components | Converts a dict of components to the format expected by the Google Maps
server.
For example:
c = {"country": "US", "postal_code": "94043"}
convert.components(c)
# 'country:US|postal_code:94043'
:param arg: The component filter.
:type arg: dict
:rtype: basestring | googlemaps/convert.py | def components(arg):
"""Converts a dict of components to the format expected by the Google Maps
server.
For example:
c = {"country": "US", "postal_code": "94043"}
convert.components(c)
# 'country:US|postal_code:94043'
:param arg: The component filter.
:type arg: dict
:rtype: bases... | def components(arg):
"""Converts a dict of components to the format expected by the Google Maps
server.
For example:
c = {"country": "US", "postal_code": "94043"}
convert.components(c)
# 'country:US|postal_code:94043'
:param arg: The component filter.
:type arg: dict
:rtype: bases... | [
"Converts",
"a",
"dict",
"of",
"components",
"to",
"the",
"format",
"expected",
"by",
"the",
"Google",
"Maps",
"server",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L209-L237 | [
"def",
"components",
"(",
"arg",
")",
":",
"# Components may have multiple values per type, here we",
"# expand them into individual key/value items, eg:",
"# {\"country\": [\"US\", \"AU\"], \"foo\": 1} -> \"country:AU\", \"country:US\", \"foo:1\"",
"def",
"expand",
"(",
"arg",
")",
":",... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | bounds | Converts a lat/lon bounds to a comma- and pipe-separated string.
Accepts two representations:
1) string: pipe-separated pair of comma-separated lat/lon pairs.
2) dict with two entries - "southwest" and "northeast". See convert.latlng
for information on how these can be represented.
For example:
... | googlemaps/convert.py | def bounds(arg):
"""Converts a lat/lon bounds to a comma- and pipe-separated string.
Accepts two representations:
1) string: pipe-separated pair of comma-separated lat/lon pairs.
2) dict with two entries - "southwest" and "northeast". See convert.latlng
for information on how these can be represent... | def bounds(arg):
"""Converts a lat/lon bounds to a comma- and pipe-separated string.
Accepts two representations:
1) string: pipe-separated pair of comma-separated lat/lon pairs.
2) dict with two entries - "southwest" and "northeast". See convert.latlng
for information on how these can be represent... | [
"Converts",
"a",
"lat",
"/",
"lon",
"bounds",
"to",
"a",
"comma",
"-",
"and",
"pipe",
"-",
"separated",
"string",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L240-L277 | [
"def",
"bounds",
"(",
"arg",
")",
":",
"if",
"is_string",
"(",
"arg",
")",
"and",
"arg",
".",
"count",
"(",
"\"|\"",
")",
"==",
"1",
"and",
"arg",
".",
"count",
"(",
"\",\"",
")",
"==",
"2",
":",
"return",
"arg",
"elif",
"isinstance",
"(",
"arg",... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | decode_polyline | Decodes a Polyline string into a list of lat/lng dicts.
See the developer docs for a detailed description of this encoding:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm
:param polyline: An encoded polyline
:type polyline: string
:rtype: list of dicts with lat/lng k... | googlemaps/convert.py | def decode_polyline(polyline):
"""Decodes a Polyline string into a list of lat/lng dicts.
See the developer docs for a detailed description of this encoding:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm
:param polyline: An encoded polyline
:type polyline: string
... | def decode_polyline(polyline):
"""Decodes a Polyline string into a list of lat/lng dicts.
See the developer docs for a detailed description of this encoding:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm
:param polyline: An encoded polyline
:type polyline: string
... | [
"Decodes",
"a",
"Polyline",
"string",
"into",
"a",
"list",
"of",
"lat",
"/",
"lng",
"dicts",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L280-L319 | [
"def",
"decode_polyline",
"(",
"polyline",
")",
":",
"points",
"=",
"[",
"]",
"index",
"=",
"lat",
"=",
"lng",
"=",
"0",
"while",
"index",
"<",
"len",
"(",
"polyline",
")",
":",
"result",
"=",
"1",
"shift",
"=",
"0",
"while",
"True",
":",
"b",
"=... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | encode_polyline | Encodes a list of points into a polyline string.
See the developer docs for a detailed description of this encoding:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm
:param points: a list of lat/lng pairs
:type points: list of dicts or tuples
:rtype: string | googlemaps/convert.py | def encode_polyline(points):
"""Encodes a list of points into a polyline string.
See the developer docs for a detailed description of this encoding:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm
:param points: a list of lat/lng pairs
:type points: list of dicts or tu... | def encode_polyline(points):
"""Encodes a list of points into a polyline string.
See the developer docs for a detailed description of this encoding:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm
:param points: a list of lat/lng pairs
:type points: list of dicts or tu... | [
"Encodes",
"a",
"list",
"of",
"points",
"into",
"a",
"polyline",
"string",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/convert.py#L322-L353 | [
"def",
"encode_polyline",
"(",
"points",
")",
":",
"last_lat",
"=",
"last_lng",
"=",
"0",
"result",
"=",
"\"\"",
"for",
"point",
"in",
"points",
":",
"ll",
"=",
"normalize_lat_lng",
"(",
"point",
")",
"lat",
"=",
"int",
"(",
"round",
"(",
"ll",
"[",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | timezone | Get time zone for a location on the earth, as well as that location's
time offset from UTC.
:param location: The latitude/longitude value representing the location to
look up.
:type location: string, dict, list, or tuple
:param timestamp: Timestamp specifies the desired time as seconds since
... | googlemaps/timezone.py | def timezone(client, location, timestamp=None, language=None):
"""Get time zone for a location on the earth, as well as that location's
time offset from UTC.
:param location: The latitude/longitude value representing the location to
look up.
:type location: string, dict, list, or tuple
:pa... | def timezone(client, location, timestamp=None, language=None):
"""Get time zone for a location on the earth, as well as that location's
time offset from UTC.
:param location: The latitude/longitude value representing the location to
look up.
:type location: string, dict, list, or tuple
:pa... | [
"Get",
"time",
"zone",
"for",
"a",
"location",
"on",
"the",
"earth",
"as",
"well",
"as",
"that",
"location",
"s",
"time",
"offset",
"from",
"UTC",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/timezone.py#L25-L54 | [
"def",
"timezone",
"(",
"client",
",",
"location",
",",
"timestamp",
"=",
"None",
",",
"language",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"location\"",
":",
"convert",
".",
"latlng",
"(",
"location",
")",
",",
"\"timestamp\"",
":",
"convert",
".",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | snap_to_roads | Snaps a path to the most likely roads travelled.
Takes up to 100 GPS points collected along a route, and returns a similar
set of data with the points snapped to the most likely roads the vehicle
was traveling along.
:param path: The path to be snapped.
:type path: a single location, or a list of ... | googlemaps/roads.py | def snap_to_roads(client, path, interpolate=False):
"""Snaps a path to the most likely roads travelled.
Takes up to 100 GPS points collected along a route, and returns a similar
set of data with the points snapped to the most likely roads the vehicle
was traveling along.
:param path: The path to b... | def snap_to_roads(client, path, interpolate=False):
"""Snaps a path to the most likely roads travelled.
Takes up to 100 GPS points collected along a route, and returns a similar
set of data with the points snapped to the most likely roads the vehicle
was traveling along.
:param path: The path to b... | [
"Snaps",
"a",
"path",
"to",
"the",
"most",
"likely",
"roads",
"travelled",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/roads.py#L27-L56 | [
"def",
"snap_to_roads",
"(",
"client",
",",
"path",
",",
"interpolate",
"=",
"False",
")",
":",
"params",
"=",
"{",
"\"path\"",
":",
"convert",
".",
"location_list",
"(",
"path",
")",
"}",
"if",
"interpolate",
":",
"params",
"[",
"\"interpolate\"",
"]",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | nearest_roads | Find the closest road segments for each point
Takes up to 100 independent coordinates, and returns the closest road
segment for each point. The points passed do not need to be part of a
continuous path.
:param points: The points for which the nearest road segments are to be
located.
:type ... | googlemaps/roads.py | def nearest_roads(client, points):
"""Find the closest road segments for each point
Takes up to 100 independent coordinates, and returns the closest road
segment for each point. The points passed do not need to be part of a
continuous path.
:param points: The points for which the nearest road segm... | def nearest_roads(client, points):
"""Find the closest road segments for each point
Takes up to 100 independent coordinates, and returns the closest road
segment for each point. The points passed do not need to be part of a
continuous path.
:param points: The points for which the nearest road segm... | [
"Find",
"the",
"closest",
"road",
"segments",
"for",
"each",
"point"
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/roads.py#L58-L78 | [
"def",
"nearest_roads",
"(",
"client",
",",
"points",
")",
":",
"params",
"=",
"{",
"\"points\"",
":",
"convert",
".",
"location_list",
"(",
"points",
")",
"}",
"return",
"client",
".",
"_request",
"(",
"\"/v1/nearestRoads\"",
",",
"params",
",",
"base_url",... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | speed_limits | Returns the posted speed limit (in km/h) for given road segments.
:param place_ids: The Place ID of the road segment. Place IDs are returned
by the snap_to_roads function. You can pass up to 100 Place IDs.
:type place_ids: str or list
:rtype: list of speed limits. | googlemaps/roads.py | def speed_limits(client, place_ids):
"""Returns the posted speed limit (in km/h) for given road segments.
:param place_ids: The Place ID of the road segment. Place IDs are returned
by the snap_to_roads function. You can pass up to 100 Place IDs.
:type place_ids: str or list
:rtype: list of spe... | def speed_limits(client, place_ids):
"""Returns the posted speed limit (in km/h) for given road segments.
:param place_ids: The Place ID of the road segment. Place IDs are returned
by the snap_to_roads function. You can pass up to 100 Place IDs.
:type place_ids: str or list
:rtype: list of spe... | [
"Returns",
"the",
"posted",
"speed",
"limit",
"(",
"in",
"km",
"/",
"h",
")",
"for",
"given",
"road",
"segments",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/roads.py#L80-L95 | [
"def",
"speed_limits",
"(",
"client",
",",
"place_ids",
")",
":",
"params",
"=",
"[",
"(",
"\"placeId\"",
",",
"place_id",
")",
"for",
"place_id",
"in",
"convert",
".",
"as_list",
"(",
"place_ids",
")",
"]",
"return",
"client",
".",
"_request",
"(",
"\"/... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | snapped_speed_limits | Returns the posted speed limit (in km/h) for given road segments.
The provided points will first be snapped to the most likely roads the
vehicle was traveling along.
:param path: The path of points to be snapped.
:type path: a single location, or a list of locations, where a
location is a stri... | googlemaps/roads.py | def snapped_speed_limits(client, path):
"""Returns the posted speed limit (in km/h) for given road segments.
The provided points will first be snapped to the most likely roads the
vehicle was traveling along.
:param path: The path of points to be snapped.
:type path: a single location, or a list o... | def snapped_speed_limits(client, path):
"""Returns the posted speed limit (in km/h) for given road segments.
The provided points will first be snapped to the most likely roads the
vehicle was traveling along.
:param path: The path of points to be snapped.
:type path: a single location, or a list o... | [
"Returns",
"the",
"posted",
"speed",
"limit",
"(",
"in",
"km",
"/",
"h",
")",
"for",
"given",
"road",
"segments",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/roads.py#L98-L116 | [
"def",
"snapped_speed_limits",
"(",
"client",
",",
"path",
")",
":",
"params",
"=",
"{",
"\"path\"",
":",
"convert",
".",
"location_list",
"(",
"path",
")",
"}",
"return",
"client",
".",
"_request",
"(",
"\"/v1/speedLimits\"",
",",
"params",
",",
"base_url",... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | _roads_extract | Extracts a result from a Roads API HTTP response. | googlemaps/roads.py | def _roads_extract(resp):
"""Extracts a result from a Roads API HTTP response."""
try:
j = resp.json()
except:
if resp.status_code != 200:
raise googlemaps.exceptions.HTTPError(resp.status_code)
raise googlemaps.exceptions.ApiError("UNKNOWN_ERROR",
... | def _roads_extract(resp):
"""Extracts a result from a Roads API HTTP response."""
try:
j = resp.json()
except:
if resp.status_code != 200:
raise googlemaps.exceptions.HTTPError(resp.status_code)
raise googlemaps.exceptions.ApiError("UNKNOWN_ERROR",
... | [
"Extracts",
"a",
"result",
"from",
"a",
"Roads",
"API",
"HTTP",
"response",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/roads.py#L119-L144 | [
"def",
"_roads_extract",
"(",
"resp",
")",
":",
"try",
":",
"j",
"=",
"resp",
".",
"json",
"(",
")",
"except",
":",
"if",
"resp",
".",
"status_code",
"!=",
"200",
":",
"raise",
"googlemaps",
".",
"exceptions",
".",
"HTTPError",
"(",
"resp",
".",
"sta... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | find_place | A Find Place request takes a text input, and returns a place.
The text input can be any kind of Places data, for example,
a name, address, or phone number.
:param input: The text input specifying which place to search for (for
example, a name, address, or phone number).
:type input: s... | googlemaps/places.py | def find_place(client, input, input_type, fields=None, location_bias=None,
language=None):
"""
A Find Place request takes a text input, and returns a place.
The text input can be any kind of Places data, for example,
a name, address, or phone number.
:param input: The text input spe... | def find_place(client, input, input_type, fields=None, location_bias=None,
language=None):
"""
A Find Place request takes a text input, and returns a place.
The text input can be any kind of Places data, for example,
a name, address, or phone number.
:param input: The text input spe... | [
"A",
"Find",
"Place",
"request",
"takes",
"a",
"text",
"input",
"and",
"returns",
"a",
"place",
".",
"The",
"text",
"input",
"can",
"be",
"any",
"kind",
"of",
"Places",
"data",
"for",
"example",
"a",
"name",
"address",
"or",
"phone",
"number",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L56-L115 | [
"def",
"find_place",
"(",
"client",
",",
"input",
",",
"input_type",
",",
"fields",
"=",
"None",
",",
"location_bias",
"=",
"None",
",",
"language",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"input\"",
":",
"input",
",",
"\"inputtype\"",
":",
"input_t... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | places | Places search.
:param query: The text string on which to search, for example: "restaurant".
:type query: string
:param location: The latitude/longitude value for which you wish to obtain the
closest, human-readable address.
:type location: string, dict, list, or tuple
:param radius: Dista... | googlemaps/places.py | def places(client, query, location=None, radius=None, language=None,
min_price=None, max_price=None, open_now=False, type=None, region=None,
page_token=None):
"""
Places search.
:param query: The text string on which to search, for example: "restaurant".
:type query: string
:... | def places(client, query, location=None, radius=None, language=None,
min_price=None, max_price=None, open_now=False, type=None, region=None,
page_token=None):
"""
Places search.
:param query: The text string on which to search, for example: "restaurant".
:type query: string
:... | [
"Places",
"search",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L118-L172 | [
"def",
"places",
"(",
"client",
",",
"query",
",",
"location",
"=",
"None",
",",
"radius",
"=",
"None",
",",
"language",
"=",
"None",
",",
"min_price",
"=",
"None",
",",
"max_price",
"=",
"None",
",",
"open_now",
"=",
"False",
",",
"type",
"=",
"None... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | places_nearby | Performs nearby search for places.
:param location: The latitude/longitude value for which you wish to obtain the
closest, human-readable address.
:type location: string, dict, list, or tuple
:param radius: Distance in meters within which to bias results.
:type radius: int
:p... | googlemaps/places.py | def places_nearby(client, location=None, radius=None, keyword=None,
language=None, min_price=None, max_price=None, name=None,
open_now=False, rank_by=None, type=None, page_token=None):
"""
Performs nearby search for places.
:param location: The latitude/longitude value f... | def places_nearby(client, location=None, radius=None, keyword=None,
language=None, min_price=None, max_price=None, name=None,
open_now=False, rank_by=None, type=None, page_token=None):
"""
Performs nearby search for places.
:param location: The latitude/longitude value f... | [
"Performs",
"nearby",
"search",
"for",
"places",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L175-L249 | [
"def",
"places_nearby",
"(",
"client",
",",
"location",
"=",
"None",
",",
"radius",
"=",
"None",
",",
"keyword",
"=",
"None",
",",
"language",
"=",
"None",
",",
"min_price",
"=",
"None",
",",
"max_price",
"=",
"None",
",",
"name",
"=",
"None",
",",
"... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | places_radar | Performs radar search for places.
:param location: The latitude/longitude value for which you wish to obtain the
closest, human-readable address.
:type location: string, dict, list, or tuple
:param radius: Distance in meters within which to bias results.
:type radius: int
:pa... | googlemaps/places.py | def places_radar(client, location, radius, keyword=None, min_price=None,
max_price=None, name=None, open_now=False, type=None):
"""
Performs radar search for places.
:param location: The latitude/longitude value for which you wish to obtain the
closest, human-readable ... | def places_radar(client, location, radius, keyword=None, min_price=None,
max_price=None, name=None, open_now=False, type=None):
"""
Performs radar search for places.
:param location: The latitude/longitude value for which you wish to obtain the
closest, human-readable ... | [
"Performs",
"radar",
"search",
"for",
"places",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L252-L305 | [
"def",
"places_radar",
"(",
"client",
",",
"location",
",",
"radius",
",",
"keyword",
"=",
"None",
",",
"min_price",
"=",
"None",
",",
"max_price",
"=",
"None",
",",
"name",
"=",
"None",
",",
"open_now",
"=",
"False",
",",
"type",
"=",
"None",
")",
"... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | _places | Internal handler for ``places``, ``places_nearby``, and ``places_radar``.
See each method's docs for arg details. | googlemaps/places.py | def _places(client, url_part, query=None, location=None, radius=None,
keyword=None, language=None, min_price=0, max_price=4, name=None,
open_now=False, rank_by=None, type=None, region=None, page_token=None):
"""
Internal handler for ``places``, ``places_nearby``, and ``places_radar``.
... | def _places(client, url_part, query=None, location=None, radius=None,
keyword=None, language=None, min_price=0, max_price=4, name=None,
open_now=False, rank_by=None, type=None, region=None, page_token=None):
"""
Internal handler for ``places``, ``places_nearby``, and ``places_radar``.
... | [
"Internal",
"handler",
"for",
"places",
"places_nearby",
"and",
"places_radar",
".",
"See",
"each",
"method",
"s",
"docs",
"for",
"arg",
"details",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L308-L342 | [
"def",
"_places",
"(",
"client",
",",
"url_part",
",",
"query",
"=",
"None",
",",
"location",
"=",
"None",
",",
"radius",
"=",
"None",
",",
"keyword",
"=",
"None",
",",
"language",
"=",
"None",
",",
"min_price",
"=",
"0",
",",
"max_price",
"=",
"4",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | place | Comprehensive details for an individual place.
:param place_id: A textual identifier that uniquely identifies a place,
returned from a Places search.
:type place_id: string
:param session_token: A random string which identifies an autocomplete
session for billing purposes... | googlemaps/places.py | def place(client, place_id, session_token=None, fields=None, language=None):
"""
Comprehensive details for an individual place.
:param place_id: A textual identifier that uniquely identifies a place,
returned from a Places search.
:type place_id: string
:param session_token: A random strin... | def place(client, place_id, session_token=None, fields=None, language=None):
"""
Comprehensive details for an individual place.
:param place_id: A textual identifier that uniquely identifies a place,
returned from a Places search.
:type place_id: string
:param session_token: A random strin... | [
"Comprehensive",
"details",
"for",
"an",
"individual",
"place",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L345-L386 | [
"def",
"place",
"(",
"client",
",",
"place_id",
",",
"session_token",
"=",
"None",
",",
"fields",
"=",
"None",
",",
"language",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"placeid\"",
":",
"place_id",
"}",
"if",
"fields",
":",
"invalid_fields",
"=",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | places_photo | Downloads a photo from the Places API.
:param photo_reference: A string identifier that uniquely identifies a
photo, as provided by either a Places search or Places detail request.
:type photo_reference: string
:param max_width: Specifies the maximum desired width, in pixels.
:type max_width: ... | googlemaps/places.py | def places_photo(client, photo_reference, max_width=None, max_height=None):
"""
Downloads a photo from the Places API.
:param photo_reference: A string identifier that uniquely identifies a
photo, as provided by either a Places search or Places detail request.
:type photo_reference: string
... | def places_photo(client, photo_reference, max_width=None, max_height=None):
"""
Downloads a photo from the Places API.
:param photo_reference: A string identifier that uniquely identifies a
photo, as provided by either a Places search or Places detail request.
:type photo_reference: string
... | [
"Downloads",
"a",
"photo",
"from",
"the",
"Places",
"API",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L389-L431 | [
"def",
"places_photo",
"(",
"client",
",",
"photo_reference",
",",
"max_width",
"=",
"None",
",",
"max_height",
"=",
"None",
")",
":",
"if",
"not",
"(",
"max_width",
"or",
"max_height",
")",
":",
"raise",
"ValueError",
"(",
"\"a max_width or max_height arg is re... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | places_autocomplete | Returns Place predictions given a textual search string and optional
geographic bounds.
:param input_text: The text string on which to search.
:type input_text: string
:param session_token: A random string which identifies an autocomplete
session for billing purposes.
:ty... | googlemaps/places.py | def places_autocomplete(client, input_text, session_token, offset=None,
location=None, radius=None, language=None, types=None,
components=None, strict_bounds=False):
"""
Returns Place predictions given a textual search string and optional
geographic bounds.
... | def places_autocomplete(client, input_text, session_token, offset=None,
location=None, radius=None, language=None, types=None,
components=None, strict_bounds=False):
"""
Returns Place predictions given a textual search string and optional
geographic bounds.
... | [
"Returns",
"Place",
"predictions",
"given",
"a",
"textual",
"search",
"string",
"and",
"optional",
"geographic",
"bounds",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L434-L484 | [
"def",
"places_autocomplete",
"(",
"client",
",",
"input_text",
",",
"session_token",
",",
"offset",
"=",
"None",
",",
"location",
"=",
"None",
",",
"radius",
"=",
"None",
",",
"language",
"=",
"None",
",",
"types",
"=",
"None",
",",
"components",
"=",
"... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | places_autocomplete_query | Returns Place predictions given a textual search query, such as
"pizza near New York", and optional geographic bounds.
:param input_text: The text query on which to search.
:type input_text: string
:param offset: The position, in the input term, of the last character
that the service uses to m... | googlemaps/places.py | def places_autocomplete_query(client, input_text, offset=None, location=None,
radius=None, language=None):
"""
Returns Place predictions given a textual search query, such as
"pizza near New York", and optional geographic bounds.
:param input_text: The text query on which ... | def places_autocomplete_query(client, input_text, offset=None, location=None,
radius=None, language=None):
"""
Returns Place predictions given a textual search query, such as
"pizza near New York", and optional geographic bounds.
:param input_text: The text query on which ... | [
"Returns",
"Place",
"predictions",
"given",
"a",
"textual",
"search",
"query",
"such",
"as",
"pizza",
"near",
"New",
"York",
"and",
"optional",
"geographic",
"bounds",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L487-L514 | [
"def",
"places_autocomplete_query",
"(",
"client",
",",
"input_text",
",",
"offset",
"=",
"None",
",",
"location",
"=",
"None",
",",
"radius",
"=",
"None",
",",
"language",
"=",
"None",
")",
":",
"return",
"_autocomplete",
"(",
"client",
",",
"\"query\"",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | _autocomplete | Internal handler for ``autocomplete`` and ``autocomplete_query``.
See each method's docs for arg details. | googlemaps/places.py | def _autocomplete(client, url_part, input_text, session_token=None,
offset=None, location=None, radius=None, language=None,
types=None, components=None, strict_bounds=False):
"""
Internal handler for ``autocomplete`` and ``autocomplete_query``.
See each method's docs for ... | def _autocomplete(client, url_part, input_text, session_token=None,
offset=None, location=None, radius=None, language=None,
types=None, components=None, strict_bounds=False):
"""
Internal handler for ``autocomplete`` and ``autocomplete_query``.
See each method's docs for ... | [
"Internal",
"handler",
"for",
"autocomplete",
"and",
"autocomplete_query",
".",
"See",
"each",
"method",
"s",
"docs",
"for",
"arg",
"details",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/places.py#L517-L547 | [
"def",
"_autocomplete",
"(",
"client",
",",
"url_part",
",",
"input_text",
",",
"session_token",
"=",
"None",
",",
"offset",
"=",
"None",
",",
"location",
"=",
"None",
",",
"radius",
"=",
"None",
",",
"language",
"=",
"None",
",",
"types",
"=",
"None",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | _geolocation_extract | Mimics the exception handling logic in ``client._get_body``, but
for geolocation which uses a different response format. | googlemaps/geolocation.py | def _geolocation_extract(response):
"""
Mimics the exception handling logic in ``client._get_body``, but
for geolocation which uses a different response format.
"""
body = response.json()
if response.status_code in (200, 404):
return body
try:
error = body["error"]["errors"]... | def _geolocation_extract(response):
"""
Mimics the exception handling logic in ``client._get_body``, but
for geolocation which uses a different response format.
"""
body = response.json()
if response.status_code in (200, 404):
return body
try:
error = body["error"]["errors"]... | [
"Mimics",
"the",
"exception",
"handling",
"logic",
"in",
"client",
".",
"_get_body",
"but",
"for",
"geolocation",
"which",
"uses",
"a",
"different",
"response",
"format",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/geolocation.py#L25-L42 | [
"def",
"_geolocation_extract",
"(",
"response",
")",
":",
"body",
"=",
"response",
".",
"json",
"(",
")",
"if",
"response",
".",
"status_code",
"in",
"(",
"200",
",",
"404",
")",
":",
"return",
"body",
"try",
":",
"error",
"=",
"body",
"[",
"\"error\""... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | geolocate | The Google Maps Geolocation API returns a location and accuracy
radius based on information about cell towers and WiFi nodes given.
See https://developers.google.com/maps/documentation/geolocation/intro
for more info, including more detail for each parameter below.
:param home_mobile_country_code: The... | googlemaps/geolocation.py | def geolocate(client, home_mobile_country_code=None,
home_mobile_network_code=None, radio_type=None, carrier=None,
consider_ip=None, cell_towers=None, wifi_access_points=None):
"""
The Google Maps Geolocation API returns a location and accuracy
radius based on information about c... | def geolocate(client, home_mobile_country_code=None,
home_mobile_network_code=None, radio_type=None, carrier=None,
consider_ip=None, cell_towers=None, wifi_access_points=None):
"""
The Google Maps Geolocation API returns a location and accuracy
radius based on information about c... | [
"The",
"Google",
"Maps",
"Geolocation",
"API",
"returns",
"a",
"location",
"and",
"accuracy",
"radius",
"based",
"on",
"information",
"about",
"cell",
"towers",
"and",
"WiFi",
"nodes",
"given",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/geolocation.py#L45-L107 | [
"def",
"geolocate",
"(",
"client",
",",
"home_mobile_country_code",
"=",
"None",
",",
"home_mobile_network_code",
"=",
"None",
",",
"radio_type",
"=",
"None",
",",
"carrier",
"=",
"None",
",",
"consider_ip",
"=",
"None",
",",
"cell_towers",
"=",
"None",
",",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | distance_matrix | Gets travel distance and time for a matrix of origins and destinations.
:param origins: One or more locations and/or latitude/longitude values,
from which to calculate distance and time. If you pass an address as
a string, the service will geocode the string and convert it to a
latitude/lon... | googlemaps/distance_matrix.py | def distance_matrix(client, origins, destinations,
mode=None, language=None, avoid=None, units=None,
departure_time=None, arrival_time=None, transit_mode=None,
transit_routing_preference=None, traffic_model=None, region=None):
""" Gets travel distance and ... | def distance_matrix(client, origins, destinations,
mode=None, language=None, avoid=None, units=None,
departure_time=None, arrival_time=None, transit_mode=None,
transit_routing_preference=None, traffic_model=None, region=None):
""" Gets travel distance and ... | [
"Gets",
"travel",
"distance",
"and",
"time",
"for",
"a",
"matrix",
"of",
"origins",
"and",
"destinations",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/distance_matrix.py#L24-L138 | [
"def",
"distance_matrix",
"(",
"client",
",",
"origins",
",",
"destinations",
",",
"mode",
"=",
"None",
",",
"language",
"=",
"None",
",",
"avoid",
"=",
"None",
",",
"units",
"=",
"None",
",",
"departure_time",
"=",
"None",
",",
"arrival_time",
"=",
"Non... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | make_api_method | Provides a single entry point for modifying all API methods.
For now this is limited to allowing the client object to be modified
with an `extra_params` keyword arg to each method, that is then used
as the params for each web service request.
Please note that this is an unsupported feature for advanced... | googlemaps/client.py | def make_api_method(func):
"""
Provides a single entry point for modifying all API methods.
For now this is limited to allowing the client object to be modified
with an `extra_params` keyword arg to each method, that is then used
as the params for each web service request.
Please note that this... | def make_api_method(func):
"""
Provides a single entry point for modifying all API methods.
For now this is limited to allowing the client object to be modified
with an `extra_params` keyword arg to each method, that is then used
as the params for each web service request.
Please note that this... | [
"Provides",
"a",
"single",
"entry",
"point",
"for",
"modifying",
"all",
"API",
"methods",
".",
"For",
"now",
"this",
"is",
"limited",
"to",
"allowing",
"the",
"client",
"object",
"to",
"be",
"modified",
"with",
"an",
"extra_params",
"keyword",
"arg",
"to",
... | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/client.py#L354-L373 | [
"def",
"make_api_method",
"(",
"func",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"args",
"[",
"0",
"]",
".",
"_extra_params",
"=",
"kwargs",
".",
"pop",
"(",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | sign_hmac | Returns a base64-encoded HMAC-SHA1 signature of a given string.
:param secret: The key used for the signature, base64 encoded.
:type secret: string
:param payload: The payload to sign.
:type payload: string
:rtype: string | googlemaps/client.py | def sign_hmac(secret, payload):
"""Returns a base64-encoded HMAC-SHA1 signature of a given string.
:param secret: The key used for the signature, base64 encoded.
:type secret: string
:param payload: The payload to sign.
:type payload: string
:rtype: string
"""
payload = payload.encode... | def sign_hmac(secret, payload):
"""Returns a base64-encoded HMAC-SHA1 signature of a given string.
:param secret: The key used for the signature, base64 encoded.
:type secret: string
:param payload: The payload to sign.
:type payload: string
:rtype: string
"""
payload = payload.encode... | [
"Returns",
"a",
"base64",
"-",
"encoded",
"HMAC",
"-",
"SHA1",
"signature",
"of",
"a",
"given",
"string",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/client.py#L398-L413 | [
"def",
"sign_hmac",
"(",
"secret",
",",
"payload",
")",
":",
"payload",
"=",
"payload",
".",
"encode",
"(",
"'ascii'",
",",
"'strict'",
")",
"secret",
"=",
"secret",
".",
"encode",
"(",
"'ascii'",
",",
"'strict'",
")",
"sig",
"=",
"hmac",
".",
"new",
... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | urlencode_params | URL encodes the parameters.
:param params: The parameters
:type params: list of key/value tuples.
:rtype: string | googlemaps/client.py | def urlencode_params(params):
"""URL encodes the parameters.
:param params: The parameters
:type params: list of key/value tuples.
:rtype: string
"""
# urlencode does not handle unicode strings in Python 2.
# Firstly, normalize the values so they get encoded correctly.
params = [(key, ... | def urlencode_params(params):
"""URL encodes the parameters.
:param params: The parameters
:type params: list of key/value tuples.
:rtype: string
"""
# urlencode does not handle unicode strings in Python 2.
# Firstly, normalize the values so they get encoded correctly.
params = [(key, ... | [
"URL",
"encodes",
"the",
"parameters",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/client.py#L416-L430 | [
"def",
"urlencode_params",
"(",
"params",
")",
":",
"# urlencode does not handle unicode strings in Python 2.",
"# Firstly, normalize the values so they get encoded correctly.",
"params",
"=",
"[",
"(",
"key",
",",
"normalize_for_urlencode",
"(",
"val",
")",
")",
"for",
"key"... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | Client._request | Performs HTTP GET/POST with credentials, returning the body as
JSON.
:param url: URL path for the request. Should begin with a slash.
:type url: string
:param params: HTTP GET parameters.
:type params: dict or list of key/value tuples
:param first_request_time: The tim... | googlemaps/client.py | def _request(self, url, params, first_request_time=None, retry_counter=0,
base_url=_DEFAULT_BASE_URL, accepts_clientid=True,
extract_body=None, requests_kwargs=None, post_json=None):
"""Performs HTTP GET/POST with credentials, returning the body as
JSON.
:param url: UR... | def _request(self, url, params, first_request_time=None, retry_counter=0,
base_url=_DEFAULT_BASE_URL, accepts_clientid=True,
extract_body=None, requests_kwargs=None, post_json=None):
"""Performs HTTP GET/POST with credentials, returning the body as
JSON.
:param url: UR... | [
"Performs",
"HTTP",
"GET",
"/",
"POST",
"with",
"credentials",
"returning",
"the",
"body",
"as",
"JSON",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/client.py#L164-L272 | [
"def",
"_request",
"(",
"self",
",",
"url",
",",
"params",
",",
"first_request_time",
"=",
"None",
",",
"retry_counter",
"=",
"0",
",",
"base_url",
"=",
"_DEFAULT_BASE_URL",
",",
"accepts_clientid",
"=",
"True",
",",
"extract_body",
"=",
"None",
",",
"reques... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | Client._generate_auth_url | Returns the path and query string portion of the request URL, first
adding any necessary parameters.
:param path: The path portion of the URL.
:type path: string
:param params: URL parameters.
:type params: dict or list of key/value tuples
:rtype: string | googlemaps/client.py | def _generate_auth_url(self, path, params, accepts_clientid):
"""Returns the path and query string portion of the request URL, first
adding any necessary parameters.
:param path: The path portion of the URL.
:type path: string
:param params: URL parameters.
:type params... | def _generate_auth_url(self, path, params, accepts_clientid):
"""Returns the path and query string portion of the request URL, first
adding any necessary parameters.
:param path: The path portion of the URL.
:type path: string
:param params: URL parameters.
:type params... | [
"Returns",
"the",
"path",
"and",
"query",
"string",
"portion",
"of",
"the",
"request",
"URL",
"first",
"adding",
"any",
"necessary",
"parameters",
"."
] | googlemaps/google-maps-services-python | python | https://github.com/googlemaps/google-maps-services-python/blob/7ed40b4d8df63479794c46ce29d03ed6083071d7/googlemaps/client.py#L294-L329 | [
"def",
"_generate_auth_url",
"(",
"self",
",",
"path",
",",
"params",
",",
"accepts_clientid",
")",
":",
"# Deterministic ordering through sorting by key.",
"# Useful for tests, and in the future, any caching.",
"extra_params",
"=",
"getattr",
"(",
"self",
",",
"\"_extra_para... | 7ed40b4d8df63479794c46ce29d03ed6083071d7 |
train | Scheduler.run_pending | Run all jobs that are scheduled to run.
Please note that it is *intended behavior that run_pending()
does not run missed jobs*. For example, if you've registered a job
that should run every minute and you only call run_pending()
in one hour increments then your job won't be run 60 times... | schedule/__init__.py | def run_pending(self):
"""
Run all jobs that are scheduled to run.
Please note that it is *intended behavior that run_pending()
does not run missed jobs*. For example, if you've registered a job
that should run every minute and you only call run_pending()
in one hour inc... | def run_pending(self):
"""
Run all jobs that are scheduled to run.
Please note that it is *intended behavior that run_pending()
does not run missed jobs*. For example, if you've registered a job
that should run every minute and you only call run_pending()
in one hour inc... | [
"Run",
"all",
"jobs",
"that",
"are",
"scheduled",
"to",
"run",
"."
] | dbader/schedule | python | https://github.com/dbader/schedule/blob/5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea/schedule/__init__.py#L82-L94 | [
"def",
"run_pending",
"(",
"self",
")",
":",
"runnable_jobs",
"=",
"(",
"job",
"for",
"job",
"in",
"self",
".",
"jobs",
"if",
"job",
".",
"should_run",
")",
"for",
"job",
"in",
"sorted",
"(",
"runnable_jobs",
")",
":",
"self",
".",
"_run_job",
"(",
"... | 5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea |
train | Scheduler.run_all | Run all jobs regardless if they are scheduled to run or not.
A delay of `delay` seconds is added between each job. This helps
distribute system load generated by the jobs more evenly
over time.
:param delay_seconds: A delay added between every executed job | schedule/__init__.py | def run_all(self, delay_seconds=0):
"""
Run all jobs regardless if they are scheduled to run or not.
A delay of `delay` seconds is added between each job. This helps
distribute system load generated by the jobs more evenly
over time.
:param delay_seconds: A delay added ... | def run_all(self, delay_seconds=0):
"""
Run all jobs regardless if they are scheduled to run or not.
A delay of `delay` seconds is added between each job. This helps
distribute system load generated by the jobs more evenly
over time.
:param delay_seconds: A delay added ... | [
"Run",
"all",
"jobs",
"regardless",
"if",
"they",
"are",
"scheduled",
"to",
"run",
"or",
"not",
"."
] | dbader/schedule | python | https://github.com/dbader/schedule/blob/5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea/schedule/__init__.py#L96-L110 | [
"def",
"run_all",
"(",
"self",
",",
"delay_seconds",
"=",
"0",
")",
":",
"logger",
".",
"info",
"(",
"'Running *all* %i jobs with %is delay inbetween'",
",",
"len",
"(",
"self",
".",
"jobs",
")",
",",
"delay_seconds",
")",
"for",
"job",
"in",
"self",
".",
... | 5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea |
train | Scheduler.clear | Deletes scheduled jobs marked with the given tag, or all jobs
if tag is omitted.
:param tag: An identifier used to identify a subset of
jobs to delete | schedule/__init__.py | def clear(self, tag=None):
"""
Deletes scheduled jobs marked with the given tag, or all jobs
if tag is omitted.
:param tag: An identifier used to identify a subset of
jobs to delete
"""
if tag is None:
del self.jobs[:]
else:
... | def clear(self, tag=None):
"""
Deletes scheduled jobs marked with the given tag, or all jobs
if tag is omitted.
:param tag: An identifier used to identify a subset of
jobs to delete
"""
if tag is None:
del self.jobs[:]
else:
... | [
"Deletes",
"scheduled",
"jobs",
"marked",
"with",
"the",
"given",
"tag",
"or",
"all",
"jobs",
"if",
"tag",
"is",
"omitted",
"."
] | dbader/schedule | python | https://github.com/dbader/schedule/blob/5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea/schedule/__init__.py#L112-L123 | [
"def",
"clear",
"(",
"self",
",",
"tag",
"=",
"None",
")",
":",
"if",
"tag",
"is",
"None",
":",
"del",
"self",
".",
"jobs",
"[",
":",
"]",
"else",
":",
"self",
".",
"jobs",
"[",
":",
"]",
"=",
"(",
"job",
"for",
"job",
"in",
"self",
".",
"j... | 5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea |
train | Job.tag | Tags the job with one or more unique indentifiers.
Tags must be hashable. Duplicate tags are discarded.
:param tags: A unique list of ``Hashable`` tags.
:return: The invoked job instance | schedule/__init__.py | def tag(self, *tags):
"""
Tags the job with one or more unique indentifiers.
Tags must be hashable. Duplicate tags are discarded.
:param tags: A unique list of ``Hashable`` tags.
:return: The invoked job instance
"""
if not all(isinstance(tag, collections.Hashab... | def tag(self, *tags):
"""
Tags the job with one or more unique indentifiers.
Tags must be hashable. Duplicate tags are discarded.
:param tags: A unique list of ``Hashable`` tags.
:return: The invoked job instance
"""
if not all(isinstance(tag, collections.Hashab... | [
"Tags",
"the",
"job",
"with",
"one",
"or",
"more",
"unique",
"indentifiers",
"."
] | dbader/schedule | python | https://github.com/dbader/schedule/blob/5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea/schedule/__init__.py#L364-L376 | [
"def",
"tag",
"(",
"self",
",",
"*",
"tags",
")",
":",
"if",
"not",
"all",
"(",
"isinstance",
"(",
"tag",
",",
"collections",
".",
"Hashable",
")",
"for",
"tag",
"in",
"tags",
")",
":",
"raise",
"TypeError",
"(",
"'Tags must be hashable'",
")",
"self",... | 5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea |
train | Job.at | Specify a particular time that the job should be run at.
:param time_str: A string in one of the following formats: `HH:MM:SS`,
`HH:MM`,`:MM`, `:SS`. The format must make sense given how often
the job is repeating; for example, a job that repeats every minute
should not be g... | schedule/__init__.py | def at(self, time_str):
"""
Specify a particular time that the job should be run at.
:param time_str: A string in one of the following formats: `HH:MM:SS`,
`HH:MM`,`:MM`, `:SS`. The format must make sense given how often
the job is repeating; for example, a job that repe... | def at(self, time_str):
"""
Specify a particular time that the job should be run at.
:param time_str: A string in one of the following formats: `HH:MM:SS`,
`HH:MM`,`:MM`, `:SS`. The format must make sense given how often
the job is repeating; for example, a job that repe... | [
"Specify",
"a",
"particular",
"time",
"that",
"the",
"job",
"should",
"be",
"run",
"at",
"."
] | dbader/schedule | python | https://github.com/dbader/schedule/blob/5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea/schedule/__init__.py#L378-L428 | [
"def",
"at",
"(",
"self",
",",
"time_str",
")",
":",
"if",
"(",
"self",
".",
"unit",
"not",
"in",
"(",
"'days'",
",",
"'hours'",
",",
"'minutes'",
")",
"and",
"not",
"self",
".",
"start_day",
")",
":",
"raise",
"ScheduleValueError",
"(",
"'Invalid unit... | 5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea |
train | Job.do | Specifies the job_func that should be called every time the
job runs.
Any additional arguments are passed on to job_func when
the job runs.
:param job_func: The function to be scheduled
:return: The invoked job instance | schedule/__init__.py | def do(self, job_func, *args, **kwargs):
"""
Specifies the job_func that should be called every time the
job runs.
Any additional arguments are passed on to job_func when
the job runs.
:param job_func: The function to be scheduled
:return: The invoked job instan... | def do(self, job_func, *args, **kwargs):
"""
Specifies the job_func that should be called every time the
job runs.
Any additional arguments are passed on to job_func when
the job runs.
:param job_func: The function to be scheduled
:return: The invoked job instan... | [
"Specifies",
"the",
"job_func",
"that",
"should",
"be",
"called",
"every",
"time",
"the",
"job",
"runs",
"."
] | dbader/schedule | python | https://github.com/dbader/schedule/blob/5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea/schedule/__init__.py#L445-L466 | [
"def",
"do",
"(",
"self",
",",
"job_func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"job_func",
"=",
"functools",
".",
"partial",
"(",
"job_func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"functools",
"... | 5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea |
train | Job.run | Run the job and immediately reschedule it.
:return: The return value returned by the `job_func` | schedule/__init__.py | def run(self):
"""
Run the job and immediately reschedule it.
:return: The return value returned by the `job_func`
"""
logger.info('Running job %s', self)
ret = self.job_func()
self.last_run = datetime.datetime.now()
self._schedule_next_run()
retu... | def run(self):
"""
Run the job and immediately reschedule it.
:return: The return value returned by the `job_func`
"""
logger.info('Running job %s', self)
ret = self.job_func()
self.last_run = datetime.datetime.now()
self._schedule_next_run()
retu... | [
"Run",
"the",
"job",
"and",
"immediately",
"reschedule",
"it",
"."
] | dbader/schedule | python | https://github.com/dbader/schedule/blob/5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea/schedule/__init__.py#L475-L485 | [
"def",
"run",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"'Running job %s'",
",",
"self",
")",
"ret",
"=",
"self",
".",
"job_func",
"(",
")",
"self",
".",
"last_run",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"self",
".",
"_sc... | 5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea |
train | Job._schedule_next_run | Compute the instant when this job should run next. | schedule/__init__.py | def _schedule_next_run(self):
"""
Compute the instant when this job should run next.
"""
if self.unit not in ('seconds', 'minutes', 'hours', 'days', 'weeks'):
raise ScheduleValueError('Invalid unit')
if self.latest is not None:
if not (self.latest >= self... | def _schedule_next_run(self):
"""
Compute the instant when this job should run next.
"""
if self.unit not in ('seconds', 'minutes', 'hours', 'days', 'weeks'):
raise ScheduleValueError('Invalid unit')
if self.latest is not None:
if not (self.latest >= self... | [
"Compute",
"the",
"instant",
"when",
"this",
"job",
"should",
"run",
"next",
"."
] | dbader/schedule | python | https://github.com/dbader/schedule/blob/5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea/schedule/__init__.py#L487-L555 | [
"def",
"_schedule_next_run",
"(",
"self",
")",
":",
"if",
"self",
".",
"unit",
"not",
"in",
"(",
"'seconds'",
",",
"'minutes'",
",",
"'hours'",
",",
"'days'",
",",
"'weeks'",
")",
":",
"raise",
"ScheduleValueError",
"(",
"'Invalid unit'",
")",
"if",
"self"... | 5d2653c28b1029f1e9ddc85cd9ef26c29a79fcea |
train | IssuerCredential.create | Creates a Class representing an Issuer Credential
:param source_id: Tag associated by user of sdk
:param attrs: attributes that will form the credential
:param cred_def_handle: Handle from previously created credential def object
:param name: Name given to the Credential
... | vcx/wrappers/python3/vcx/api/issuer_credential.py | async def create(source_id: str, attrs: dict, cred_def_handle: int, name: str, price: str):
"""
Creates a Class representing an Issuer Credential
:param source_id: Tag associated by user of sdk
:param attrs: attributes that will form the credential
:param cred_def... | async def create(source_id: str, attrs: dict, cred_def_handle: int, name: str, price: str):
"""
Creates a Class representing an Issuer Credential
:param source_id: Tag associated by user of sdk
:param attrs: attributes that will form the credential
:param cred_def... | [
"Creates",
"a",
"Class",
"representing",
"an",
"Issuer",
"Credential",
":",
"param",
"source_id",
":",
"Tag",
"associated",
"by",
"user",
"of",
"sdk",
":",
"param",
"attrs",
":",
"attributes",
"that",
"will",
"form",
"the",
"credential",
":",
"param",
"cred_... | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/vcx/wrappers/python3/vcx/api/issuer_credential.py#L25-L57 | [
"async",
"def",
"create",
"(",
"source_id",
":",
"str",
",",
"attrs",
":",
"dict",
",",
"cred_def_handle",
":",
"int",
",",
"name",
":",
"str",
",",
"price",
":",
"str",
")",
":",
"constructor_params",
"=",
"(",
"source_id",
",",
"attrs",
",",
"cred_de... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | IssuerCredential.deserialize | Creates IssuerCredential object from a dict.
:param data: dict representing a serialized IssuerCredential Object
:return: IssuerCredential object
Example:
source_id = '1'
cred_def_id = 'cred_def_id1'
attrs = {'key': 'value', 'key2': 'value2', 'key... | vcx/wrappers/python3/vcx/api/issuer_credential.py | async def deserialize(data: dict):
"""
Creates IssuerCredential object from a dict.
:param data: dict representing a serialized IssuerCredential Object
:return: IssuerCredential object
Example:
source_id = '1'
cred_def_id = 'cred_def_id1'
... | async def deserialize(data: dict):
"""
Creates IssuerCredential object from a dict.
:param data: dict representing a serialized IssuerCredential Object
:return: IssuerCredential object
Example:
source_id = '1'
cred_def_id = 'cred_def_id1'
... | [
"Creates",
"IssuerCredential",
"object",
"from",
"a",
"dict",
".",
":",
"param",
"data",
":",
"dict",
"representing",
"a",
"serialized",
"IssuerCredential",
"Object",
":",
"return",
":",
"IssuerCredential",
"object"
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/vcx/wrappers/python3/vcx/api/issuer_credential.py#L60-L85 | [
"async",
"def",
"deserialize",
"(",
"data",
":",
"dict",
")",
":",
"issuer_credential",
"=",
"await",
"IssuerCredential",
".",
"_deserialize",
"(",
"\"vcx_issuer_credential_deserialize\"",
",",
"json",
".",
"dumps",
"(",
"data",
")",
",",
"data",
".",
"get",
"... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | IssuerCredential.send_offer | Sends an offer to a prover. Once accepted, a request will be recieved.
:param connection: vcx.api.connection.Connection
:return: None
Example:
source_id = '1'
cred_def_id = 'cred_def_id1'
attrs = {'key': 'value', 'key2': 'value2', 'key3': 'value3'}
name = 'Crede... | vcx/wrappers/python3/vcx/api/issuer_credential.py | async def send_offer(self, connection: Connection):
"""
Sends an offer to a prover. Once accepted, a request will be recieved.
:param connection: vcx.api.connection.Connection
:return: None
Example:
source_id = '1'
cred_def_id = 'cred_def_id1'
attrs = {'... | async def send_offer(self, connection: Connection):
"""
Sends an offer to a prover. Once accepted, a request will be recieved.
:param connection: vcx.api.connection.Connection
:return: None
Example:
source_id = '1'
cred_def_id = 'cred_def_id1'
attrs = {'... | [
"Sends",
"an",
"offer",
"to",
"a",
"prover",
".",
"Once",
"accepted",
"a",
"request",
"will",
"be",
"recieved",
".",
":",
"param",
"connection",
":",
"vcx",
".",
"api",
".",
"connection",
".",
"Connection",
":",
"return",
":",
"None"
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/vcx/wrappers/python3/vcx/api/issuer_credential.py#L132-L160 | [
"async",
"def",
"send_offer",
"(",
"self",
",",
"connection",
":",
"Connection",
")",
":",
"if",
"not",
"hasattr",
"(",
"IssuerCredential",
".",
"send_offer",
",",
"\"cb\"",
")",
":",
"self",
".",
"logger",
".",
"debug",
"(",
"\"vcx_issuer_send_credential_offe... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | IssuerCredential.revoke_credential | Revokes a credential.
:return: None
Example:
credential.revoke_credential() | vcx/wrappers/python3/vcx/api/issuer_credential.py | async def revoke_credential(self):
"""
Revokes a credential.
:return: None
Example:
credential.revoke_credential()
"""
if not hasattr(IssuerCredential.revoke_credential, "cb"):
self.logger.debug("vcx_issuer_revoke_credential: Creating callback"... | async def revoke_credential(self):
"""
Revokes a credential.
:return: None
Example:
credential.revoke_credential()
"""
if not hasattr(IssuerCredential.revoke_credential, "cb"):
self.logger.debug("vcx_issuer_revoke_credential: Creating callback"... | [
"Revokes",
"a",
"credential",
".",
":",
"return",
":",
"None",
"Example",
":",
"credential",
".",
"revoke_credential",
"()"
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/vcx/wrappers/python3/vcx/api/issuer_credential.py#L182-L197 | [
"async",
"def",
"revoke_credential",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"IssuerCredential",
".",
"revoke_credential",
",",
"\"cb\"",
")",
":",
"self",
".",
"logger",
".",
"debug",
"(",
"\"vcx_issuer_revoke_credential: Creating callback\"",
")",
"I... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | create_wallet | Creates a new secure wallet with the given unique name.
:param config: Wallet configuration json.
{
"id": string, Identifier of the wallet.
Configured storage uses this identifier to lookup exact wallet data placement.
"storage_type": optional<string>, Type of the wallet storage. De... | wrappers/python/indy/wallet.py | async def create_wallet(config: str,
credentials: str) -> None:
"""
Creates a new secure wallet with the given unique name.
:param config: Wallet configuration json.
{
"id": string, Identifier of the wallet.
Configured storage uses this identifier to lookup ... | async def create_wallet(config: str,
credentials: str) -> None:
"""
Creates a new secure wallet with the given unique name.
:param config: Wallet configuration json.
{
"id": string, Identifier of the wallet.
Configured storage uses this identifier to lookup ... | [
"Creates",
"a",
"new",
"secure",
"wallet",
"with",
"the",
"given",
"unique",
"name",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/wallet.py#L9-L63 | [
"async",
"def",
"create_wallet",
"(",
"config",
":",
"str",
",",
"credentials",
":",
"str",
")",
"->",
"None",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"create_wallet: >>> config: %r, credentials: %r\"... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | close_wallet | Closes opened wallet and frees allocated resources.
:param handle: wallet handle returned by indy_open_wallet.
:return: Error code | wrappers/python/indy/wallet.py | async def close_wallet(handle: int) -> None:
"""
Closes opened wallet and frees allocated resources.
:param handle: wallet handle returned by indy_open_wallet.
:return: Error code
"""
logger = logging.getLogger(__name__)
logger.debug("close_wallet: >>> handle: %i", handle)
if not hasa... | async def close_wallet(handle: int) -> None:
"""
Closes opened wallet and frees allocated resources.
:param handle: wallet handle returned by indy_open_wallet.
:return: Error code
"""
logger = logging.getLogger(__name__)
logger.debug("close_wallet: >>> handle: %i", handle)
if not hasa... | [
"Closes",
"opened",
"wallet",
"and",
"frees",
"allocated",
"resources",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/wallet.py#L133-L154 | [
"async",
"def",
"close_wallet",
"(",
"handle",
":",
"int",
")",
"->",
"None",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"close_wallet: >>> handle: %i\"",
",",
"handle",
")",
"if",
"not",
"hasattr",
... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | export_wallet | Exports opened wallet to the file.
:param handle: wallet handle returned by indy_open_wallet.
:param export_config_json: JSON containing settings for input operation.
{
"path": path of the file that contains exported wallet content
"key": string, Key or passphrase used for wallet exp... | wrappers/python/indy/wallet.py | async def export_wallet(handle: int,
export_config_json: str) -> None:
"""
Exports opened wallet to the file.
:param handle: wallet handle returned by indy_open_wallet.
:param export_config_json: JSON containing settings for input operation.
{
"path": path of th... | async def export_wallet(handle: int,
export_config_json: str) -> None:
"""
Exports opened wallet to the file.
:param handle: wallet handle returned by indy_open_wallet.
:param export_config_json: JSON containing settings for input operation.
{
"path": path of th... | [
"Exports",
"opened",
"wallet",
"to",
"the",
"file",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/wallet.py#L214-L250 | [
"async",
"def",
"export_wallet",
"(",
"handle",
":",
"int",
",",
"export_config_json",
":",
"str",
")",
"->",
"None",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"export_wallet: >>> handle: %r, export_con... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | import_wallet | Creates a new secure wallet with the given unique name and then imports its content
according to fields provided in import_config
This can be seen as an indy_create_wallet call with additional content import
:param config: Wallet configuration json.
{
"id": string, Identifier of the wallet.
... | wrappers/python/indy/wallet.py | async def import_wallet(config: str,
credentials: str,
import_config_json: str) -> None:
"""
Creates a new secure wallet with the given unique name and then imports its content
according to fields provided in import_config
This can be seen as an indy_creat... | async def import_wallet(config: str,
credentials: str,
import_config_json: str) -> None:
"""
Creates a new secure wallet with the given unique name and then imports its content
according to fields provided in import_config
This can be seen as an indy_creat... | [
"Creates",
"a",
"new",
"secure",
"wallet",
"with",
"the",
"given",
"unique",
"name",
"and",
"then",
"imports",
"its",
"content",
"according",
"to",
"fields",
"provided",
"in",
"import_config",
"This",
"can",
"be",
"seen",
"as",
"an",
"indy_create_wallet",
"cal... | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/wallet.py#L253-L317 | [
"async",
"def",
"import_wallet",
"(",
"config",
":",
"str",
",",
"credentials",
":",
"str",
",",
"import_config_json",
":",
"str",
")",
"->",
"None",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"i... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | generate_wallet_key | Generate wallet master key.
Returned key is compatible with "RAW" key derivation method.
It allows to avoid expensive key derivation for use cases when wallet keys can be stored in a secure enclave.
:param config: (optional) key configuration json.
{
"seed": string, (optional) Seed that allows... | wrappers/python/indy/wallet.py | async def generate_wallet_key(config: Optional[str]) -> str:
"""
Generate wallet master key.
Returned key is compatible with "RAW" key derivation method.
It allows to avoid expensive key derivation for use cases when wallet keys can be stored in a secure enclave.
:param config: (optional) key confi... | async def generate_wallet_key(config: Optional[str]) -> str:
"""
Generate wallet master key.
Returned key is compatible with "RAW" key derivation method.
It allows to avoid expensive key derivation for use cases when wallet keys can be stored in a secure enclave.
:param config: (optional) key confi... | [
"Generate",
"wallet",
"master",
"key",
".",
"Returned",
"key",
"is",
"compatible",
"with",
"RAW",
"key",
"derivation",
"method",
".",
"It",
"allows",
"to",
"avoid",
"expensive",
"key",
"derivation",
"for",
"use",
"cases",
"when",
"wallet",
"keys",
"can",
"be... | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/wallet.py#L320-L351 | [
"async",
"def",
"generate_wallet_key",
"(",
"config",
":",
"Optional",
"[",
"str",
"]",
")",
"->",
"str",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"generate_wallet_key: >>> config: %r\"",
",",
"confi... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | issuer_create_schema | Create credential schema entity that describes credential attributes list and allows credentials
interoperability.
Schema is public and intended to be shared with all anoncreds workflow actors usually by publishing SCHEMA transaction
to Indy distributed ledger.
It is IMPORTANT for current version POST... | wrappers/python/indy/anoncreds.py | async def issuer_create_schema(issuer_did: str,
name: str,
version: str,
attrs: str) -> (str, str):
"""
Create credential schema entity that describes credential attributes list and allows credentials
interoperabili... | async def issuer_create_schema(issuer_did: str,
name: str,
version: str,
attrs: str) -> (str, str):
"""
Create credential schema entity that describes credential attributes list and allows credentials
interoperabili... | [
"Create",
"credential",
"schema",
"entity",
"that",
"describes",
"credential",
"attributes",
"list",
"and",
"allows",
"credentials",
"interoperability",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L9-L58 | [
"async",
"def",
"issuer_create_schema",
"(",
"issuer_did",
":",
"str",
",",
"name",
":",
"str",
",",
"version",
":",
"str",
",",
"attrs",
":",
"str",
")",
"->",
"(",
"str",
",",
"str",
")",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__nam... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | issuer_create_and_store_credential_def | Create credential definition entity that encapsulates credentials issuer DID, credential schema, secrets used for
signing credentials and secrets used for credentials revocation.
Credential definition entity contains private and public parts. Private part will be stored in the wallet.
Public part will be r... | wrappers/python/indy/anoncreds.py | async def issuer_create_and_store_credential_def(wallet_handle: int,
issuer_did: str,
schema_json: str,
tag: str,
signature_... | async def issuer_create_and_store_credential_def(wallet_handle: int,
issuer_did: str,
schema_json: str,
tag: str,
signature_... | [
"Create",
"credential",
"definition",
"entity",
"that",
"encapsulates",
"credentials",
"issuer",
"DID",
"credential",
"schema",
"secrets",
"used",
"for",
"signing",
"credentials",
"and",
"secrets",
"used",
"for",
"credentials",
"revocation",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L61-L124 | [
"async",
"def",
"issuer_create_and_store_credential_def",
"(",
"wallet_handle",
":",
"int",
",",
"issuer_did",
":",
"str",
",",
"schema_json",
":",
"str",
",",
"tag",
":",
"str",
",",
"signature_type",
":",
"Optional",
"[",
"str",
"]",
",",
"config_json",
":",... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | issuer_create_and_store_revoc_reg | Create a new revocation registry for the given credential definition as tuple of entities:
- Revocation registry definition that encapsulates credentials definition reference, revocation type specific configuration and
secrets used for credentials revocation
- Revocation registry state that stores the inf... | wrappers/python/indy/anoncreds.py | async def issuer_create_and_store_revoc_reg(wallet_handle: int,
issuer_did: str,
revoc_def_type: Optional[str],
tag: str,
cred_def_id: str,
... | async def issuer_create_and_store_revoc_reg(wallet_handle: int,
issuer_did: str,
revoc_def_type: Optional[str],
tag: str,
cred_def_id: str,
... | [
"Create",
"a",
"new",
"revocation",
"registry",
"for",
"the",
"given",
"credential",
"definition",
"as",
"tuple",
"of",
"entities",
":",
"-",
"Revocation",
"registry",
"definition",
"that",
"encapsulates",
"credentials",
"definition",
"reference",
"revocation",
"typ... | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L127-L208 | [
"async",
"def",
"issuer_create_and_store_revoc_reg",
"(",
"wallet_handle",
":",
"int",
",",
"issuer_did",
":",
"str",
",",
"revoc_def_type",
":",
"Optional",
"[",
"str",
"]",
",",
"tag",
":",
"str",
",",
"cred_def_id",
":",
"str",
",",
"config_json",
":",
"s... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | issuer_create_credential_offer | Create credential offer that will be used by Prover for
credential request creation. Offer includes nonce and key correctness proof
for authentication between protocol steps and integrity checking.
:param wallet_handle: wallet handler (created by open_wallet).
:param cred_def_id: id of credential defin... | wrappers/python/indy/anoncreds.py | async def issuer_create_credential_offer(wallet_handle: int,
cred_def_id: str) -> str:
"""
Create credential offer that will be used by Prover for
credential request creation. Offer includes nonce and key correctness proof
for authentication between protocol step... | async def issuer_create_credential_offer(wallet_handle: int,
cred_def_id: str) -> str:
"""
Create credential offer that will be used by Prover for
credential request creation. Offer includes nonce and key correctness proof
for authentication between protocol step... | [
"Create",
"credential",
"offer",
"that",
"will",
"be",
"used",
"by",
"Prover",
"for",
"credential",
"request",
"creation",
".",
"Offer",
"includes",
"nonce",
"and",
"key",
"correctness",
"proof",
"for",
"authentication",
"between",
"protocol",
"steps",
"and",
"i... | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L211-L249 | [
"async",
"def",
"issuer_create_credential_offer",
"(",
"wallet_handle",
":",
"int",
",",
"cred_def_id",
":",
"str",
")",
"->",
"str",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"issuer_create_credential_... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | issuer_create_credential | Check Cred Request for the given Cred Offer and issue Credential for the given Cred Request.
Cred Request must match Cred Offer. The credential definition and revocation registry definition
referenced in Cred Offer and Cred Request must be already created and stored into the wallet.
Information for this c... | wrappers/python/indy/anoncreds.py | async def issuer_create_credential(wallet_handle: int,
cred_offer_json: str,
cred_req_json: str,
cred_values_json: str,
rev_reg_id: Optional[str],
... | async def issuer_create_credential(wallet_handle: int,
cred_offer_json: str,
cred_req_json: str,
cred_values_json: str,
rev_reg_id: Optional[str],
... | [
"Check",
"Cred",
"Request",
"for",
"the",
"given",
"Cred",
"Offer",
"and",
"issue",
"Credential",
"for",
"the",
"given",
"Cred",
"Request",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L252-L332 | [
"async",
"def",
"issuer_create_credential",
"(",
"wallet_handle",
":",
"int",
",",
"cred_offer_json",
":",
"str",
",",
"cred_req_json",
":",
"str",
",",
"cred_values_json",
":",
"str",
",",
"rev_reg_id",
":",
"Optional",
"[",
"str",
"]",
",",
"blob_storage_reade... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | issuer_revoke_credential | Revoke a credential identified by a cred_revoc_id (returned by issuer_create_credential).
The corresponding credential definition and revocation registry must be already
created an stored into the wallet.
This call returns revoc registry delta as json file intended to be shared as REVOC_REG_ENTRY transact... | wrappers/python/indy/anoncreds.py | async def issuer_revoke_credential(wallet_handle: int,
blob_storage_reader_handle: int,
rev_reg_id: str,
cred_revoc_id: str) -> str:
"""
Revoke a credential identified by a cred_revoc_id (returned by issuer_... | async def issuer_revoke_credential(wallet_handle: int,
blob_storage_reader_handle: int,
rev_reg_id: str,
cred_revoc_id: str) -> str:
"""
Revoke a credential identified by a cred_revoc_id (returned by issuer_... | [
"Revoke",
"a",
"credential",
"identified",
"by",
"a",
"cred_revoc_id",
"(",
"returned",
"by",
"issuer_create_credential",
")",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L335-L382 | [
"async",
"def",
"issuer_revoke_credential",
"(",
"wallet_handle",
":",
"int",
",",
"blob_storage_reader_handle",
":",
"int",
",",
"rev_reg_id",
":",
"str",
",",
"cred_revoc_id",
":",
"str",
")",
"->",
"str",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"("... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | issuer_merge_revocation_registry_deltas | Merge two revocation registry deltas (returned by issuer_create_credential or issuer_revoke_credential) to accumulate common delta.
Send common delta to ledger to reduce the load.
:param rev_reg_delta_json: revocation registry delta json
:param other_rev_reg_delta_json: revocation registry delta for which ... | wrappers/python/indy/anoncreds.py | async def issuer_merge_revocation_registry_deltas(rev_reg_delta_json: str,
other_rev_reg_delta_json: str) -> str:
"""
Merge two revocation registry deltas (returned by issuer_create_credential or issuer_revoke_credential) to accumulate common delta.
Send com... | async def issuer_merge_revocation_registry_deltas(rev_reg_delta_json: str,
other_rev_reg_delta_json: str) -> str:
"""
Merge two revocation registry deltas (returned by issuer_create_credential or issuer_revoke_credential) to accumulate common delta.
Send com... | [
"Merge",
"two",
"revocation",
"registry",
"deltas",
"(",
"returned",
"by",
"issuer_create_credential",
"or",
"issuer_revoke_credential",
")",
"to",
"accumulate",
"common",
"delta",
".",
"Send",
"common",
"delta",
"to",
"ledger",
"to",
"reduce",
"the",
"load",
"."
... | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L435-L465 | [
"async",
"def",
"issuer_merge_revocation_registry_deltas",
"(",
"rev_reg_delta_json",
":",
"str",
",",
"other_rev_reg_delta_json",
":",
"str",
")",
"->",
"str",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | prover_create_master_secret | Creates a master secret with a given name and stores it in the wallet.
The name must be unique.
:param wallet_handle: wallet handler (created by open_wallet).
:param master_secret_name: (optional, if not present random one will be generated) new master id
:return: id of generated master secret. | wrappers/python/indy/anoncreds.py | async def prover_create_master_secret(wallet_handle: int,
master_secret_name: Optional[str]) -> str:
"""
Creates a master secret with a given name and stores it in the wallet.
The name must be unique.
:param wallet_handle: wallet handler (created by open_wallet).
... | async def prover_create_master_secret(wallet_handle: int,
master_secret_name: Optional[str]) -> str:
"""
Creates a master secret with a given name and stores it in the wallet.
The name must be unique.
:param wallet_handle: wallet handler (created by open_wallet).
... | [
"Creates",
"a",
"master",
"secret",
"with",
"a",
"given",
"name",
"and",
"stores",
"it",
"in",
"the",
"wallet",
".",
"The",
"name",
"must",
"be",
"unique",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L468-L498 | [
"async",
"def",
"prover_create_master_secret",
"(",
"wallet_handle",
":",
"int",
",",
"master_secret_name",
":",
"Optional",
"[",
"str",
"]",
")",
"->",
"str",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"("... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | prover_create_credential_req | Creates a clam request for the given credential offer.
The method creates a blinded master secret for a master secret identified by a provided name.
The master secret identified by the name must be already stored in the secure wallet (see prover_create_master_secret)
The blinded master secret is a part of ... | wrappers/python/indy/anoncreds.py | async def prover_create_credential_req(wallet_handle: int,
prover_did: str,
cred_offer_json: str,
cred_def_json: str,
master_secret_id: str) -> (str, str):
"""
... | async def prover_create_credential_req(wallet_handle: int,
prover_did: str,
cred_offer_json: str,
cred_def_json: str,
master_secret_id: str) -> (str, str):
"""
... | [
"Creates",
"a",
"clam",
"request",
"for",
"the",
"given",
"credential",
"offer",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L501-L564 | [
"async",
"def",
"prover_create_credential_req",
"(",
"wallet_handle",
":",
"int",
",",
"prover_did",
":",
"str",
",",
"cred_offer_json",
":",
"str",
",",
"cred_def_json",
":",
"str",
",",
"master_secret_id",
":",
"str",
")",
"->",
"(",
"str",
",",
"str",
")"... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | prover_store_credential | Check credential provided by Issuer for the given credential request,
updates the credential by a master secret and stores in a secure wallet.
To support efficient search the following tags will be created for stored credential:
{
"schema_id": <credential schema id>,
"schema... | wrappers/python/indy/anoncreds.py | async def prover_store_credential(wallet_handle: int,
cred_id: Optional[str],
cred_req_metadata_json: str,
cred_json: str,
cred_def_json: str,
rev_reg... | async def prover_store_credential(wallet_handle: int,
cred_id: Optional[str],
cred_req_metadata_json: str,
cred_json: str,
cred_def_json: str,
rev_reg... | [
"Check",
"credential",
"provided",
"by",
"Issuer",
"for",
"the",
"given",
"credential",
"request",
"updates",
"the",
"credential",
"by",
"a",
"master",
"secret",
"and",
"stores",
"in",
"a",
"secure",
"wallet",
".",
"To",
"support",
"efficient",
"search",
"the"... | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L567-L632 | [
"async",
"def",
"prover_store_credential",
"(",
"wallet_handle",
":",
"int",
",",
"cred_id",
":",
"Optional",
"[",
"str",
"]",
",",
"cred_req_metadata_json",
":",
"str",
",",
"cred_json",
":",
"str",
",",
"cred_def_json",
":",
"str",
",",
"rev_reg_def_json",
"... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | prover_get_credential | Gets human readable credential by the given id.
:param wallet_handle: wallet handler (created by open_wallet).
:param cred_id: Identifier by which requested credential is stored in the wallet
:return: credential json
{
"referent": string, // cred_id in the wallet
"attrs": {"key1":"r... | wrappers/python/indy/anoncreds.py | async def prover_get_credential(wallet_handle: int,
cred_id: str) -> str:
"""
Gets human readable credential by the given id.
:param wallet_handle: wallet handler (created by open_wallet).
:param cred_id: Identifier by which requested credential is stored in the wallet
... | async def prover_get_credential(wallet_handle: int,
cred_id: str) -> str:
"""
Gets human readable credential by the given id.
:param wallet_handle: wallet handler (created by open_wallet).
:param cred_id: Identifier by which requested credential is stored in the wallet
... | [
"Gets",
"human",
"readable",
"credential",
"by",
"the",
"given",
"id",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L635-L672 | [
"async",
"def",
"prover_get_credential",
"(",
"wallet_handle",
":",
"int",
",",
"cred_id",
":",
"str",
")",
"->",
"str",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"prover_get_credential: >>> wallet_hand... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | prover_get_credentials | Gets human readable credentials according to the filter.
If filter is NULL, then all credentials are returned.
Credentials can be filtered by tags created during saving of credential.
NOTE: This method is deprecated because immediately returns all fetched credentials.
Use <prover_search_credentials> to... | wrappers/python/indy/anoncreds.py | async def prover_get_credentials(wallet_handle: int,
filter_json: str) -> str:
"""
Gets human readable credentials according to the filter.
If filter is NULL, then all credentials are returned.
Credentials can be filtered by tags created during saving of credential.
... | async def prover_get_credentials(wallet_handle: int,
filter_json: str) -> str:
"""
Gets human readable credentials according to the filter.
If filter is NULL, then all credentials are returned.
Credentials can be filtered by tags created during saving of credential.
... | [
"Gets",
"human",
"readable",
"credentials",
"according",
"to",
"the",
"filter",
".",
"If",
"filter",
"is",
"NULL",
"then",
"all",
"credentials",
"are",
"returned",
".",
"Credentials",
"can",
"be",
"filtered",
"by",
"tags",
"created",
"during",
"saving",
"of",
... | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L675-L725 | [
"async",
"def",
"prover_get_credentials",
"(",
"wallet_handle",
":",
"int",
",",
"filter_json",
":",
"str",
")",
"->",
"str",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"prover_get_credentials: >>> walle... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | prover_search_credentials | Search for credentials stored in wallet.
Credentials can be filtered by tags created during saving of credential.
Instead of immediately returning of fetched credentials this call returns search_handle that can be used later
to fetch records by small batches (with prover_credentials_search_fetch_records).
... | wrappers/python/indy/anoncreds.py | async def prover_search_credentials(wallet_handle: int,
query_json: str) -> (int, int):
"""
Search for credentials stored in wallet.
Credentials can be filtered by tags created during saving of credential.
Instead of immediately returning of fetched credentials this ... | async def prover_search_credentials(wallet_handle: int,
query_json: str) -> (int, int):
"""
Search for credentials stored in wallet.
Credentials can be filtered by tags created during saving of credential.
Instead of immediately returning of fetched credentials this ... | [
"Search",
"for",
"credentials",
"stored",
"in",
"wallet",
".",
"Credentials",
"can",
"be",
"filtered",
"by",
"tags",
"created",
"during",
"saving",
"of",
"credential",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L728-L764 | [
"async",
"def",
"prover_search_credentials",
"(",
"wallet_handle",
":",
"int",
",",
"query_json",
":",
"str",
")",
"->",
"(",
"int",
",",
"int",
")",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"p... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | prover_fetch_credentials | Fetch next credentials for search.
:param search_handle: Search handle (created by prover_open_credentials_search)
:param count: Count of records to fetch
:return: credentials_json: List of credentials:
[{
"referent": string, // cred_id in the wallet
"attrs": {"key1":"raw_value1", "key2... | wrappers/python/indy/anoncreds.py | async def prover_fetch_credentials(search_handle: int,
count: int) -> str:
"""
Fetch next credentials for search.
:param search_handle: Search handle (created by prover_open_credentials_search)
:param count: Count of records to fetch
:return: credentials_json: Lis... | async def prover_fetch_credentials(search_handle: int,
count: int) -> str:
"""
Fetch next credentials for search.
:param search_handle: Search handle (created by prover_open_credentials_search)
:param count: Count of records to fetch
:return: credentials_json: Lis... | [
"Fetch",
"next",
"credentials",
"for",
"search",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L767-L805 | [
"async",
"def",
"prover_fetch_credentials",
"(",
"search_handle",
":",
"int",
",",
"count",
":",
"int",
")",
"->",
"str",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"prover_fetch_credentials: >>> search_... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | prover_close_credentials_search | Close credentials search (make search handle invalid)
:param search_handle: Search handle (created by prover_open_credentials_search)
:return: None | wrappers/python/indy/anoncreds.py | async def prover_close_credentials_search(search_handle: int) -> None:
"""
Close credentials search (make search handle invalid)
:param search_handle: Search handle (created by prover_open_credentials_search)
:return: None
"""
logger = logging.getLogger(__name__)
logger.debug("prover_close... | async def prover_close_credentials_search(search_handle: int) -> None:
"""
Close credentials search (make search handle invalid)
:param search_handle: Search handle (created by prover_open_credentials_search)
:return: None
"""
logger = logging.getLogger(__name__)
logger.debug("prover_close... | [
"Close",
"credentials",
"search",
"(",
"make",
"search",
"handle",
"invalid",
")"
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L808-L831 | [
"async",
"def",
"prover_close_credentials_search",
"(",
"search_handle",
":",
"int",
")",
"->",
"None",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"prover_close_credentials_search: >>> search_handle: %r\"",
",... | 55240dc170308d7883c48f03f308130a6d077be6 |
train | prover_get_credentials_for_proof_req | Gets human readable credentials matching the given proof request.
NOTE: This method is deprecated because immediately returns all fetched credentials.
Use <prover_search_credentials_for_proof_req> to fetch records by small batches.
:param wallet_handle: wallet handler (created by open_wallet).
:param ... | wrappers/python/indy/anoncreds.py | async def prover_get_credentials_for_proof_req(wallet_handle: int,
proof_request_json: str) -> str:
"""
Gets human readable credentials matching the given proof request.
NOTE: This method is deprecated because immediately returns all fetched credentials.
U... | async def prover_get_credentials_for_proof_req(wallet_handle: int,
proof_request_json: str) -> str:
"""
Gets human readable credentials matching the given proof request.
NOTE: This method is deprecated because immediately returns all fetched credentials.
U... | [
"Gets",
"human",
"readable",
"credentials",
"matching",
"the",
"given",
"proof",
"request",
"."
] | hyperledger/indy-sdk | python | https://github.com/hyperledger/indy-sdk/blob/55240dc170308d7883c48f03f308130a6d077be6/wrappers/python/indy/anoncreds.py#L834-L931 | [
"async",
"def",
"prover_get_credentials_for_proof_req",
"(",
"wallet_handle",
":",
"int",
",",
"proof_request_json",
":",
"str",
")",
"->",
"str",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"\"prover_get_c... | 55240dc170308d7883c48f03f308130a6d077be6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.