Search is not available for this dataset
identifier
stringlengths
1
155
parameters
stringlengths
2
6.09k
docstring
stringlengths
11
63.4k
docstring_summary
stringlengths
0
63.4k
function
stringlengths
29
99.8k
function_tokens
list
start_point
list
end_point
list
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
test_snapshot_BasicSuiteBuilderProfiler_on_titanic_in_demo_mode
()
A snapshot regression test for BasicSuiteBuilderProfiler. We are running the profiler on the Titanic dataset and comparing the EVRs to ones retrieved from a previously stored file.
A snapshot regression test for BasicSuiteBuilderProfiler. We are running the profiler on the Titanic dataset and comparing the EVRs to ones retrieved from a previously stored file.
def test_snapshot_BasicSuiteBuilderProfiler_on_titanic_in_demo_mode(): """ A snapshot regression test for BasicSuiteBuilderProfiler. We are running the profiler on the Titanic dataset and comparing the EVRs to ones retrieved from a previously stored file. """ df = ge.read_csv(file_relative_p...
[ "def", "test_snapshot_BasicSuiteBuilderProfiler_on_titanic_in_demo_mode", "(", ")", ":", "df", "=", "ge", ".", "read_csv", "(", "file_relative_path", "(", "__file__", ",", "\"../test_sets/Titanic.csv\"", ")", ")", "suite", ",", "evrs", "=", "df", ".", "profile", "("...
[ 442, 0 ]
[ 500, 32 ]
python
en
['en', 'error', 'th']
False
test_snapshot_BasicSuiteBuilderProfiler_on_titanic_with_builder_configuration
()
A snapshot regression test for BasicSuiteBuilderProfiler. We are running the profiler on the Titanic dataset and comparing the EVRs to ones retrieved from a previously stored file.
A snapshot regression test for BasicSuiteBuilderProfiler.
def test_snapshot_BasicSuiteBuilderProfiler_on_titanic_with_builder_configuration(): """ A snapshot regression test for BasicSuiteBuilderProfiler. We are running the profiler on the Titanic dataset and comparing the EVRs to ones retrieved from a previously stored file. """ batch = ge.read_csv(f...
[ "def", "test_snapshot_BasicSuiteBuilderProfiler_on_titanic_with_builder_configuration", "(", ")", ":", "batch", "=", "ge", ".", "read_csv", "(", "file_relative_path", "(", "__file__", ",", "\"../test_sets/Titanic.csv\"", ")", ")", "suite", ",", "evrs", "=", "BasicSuiteBui...
[ 1297, 0 ]
[ 1346, 32 ]
python
en
['en', 'error', 'th']
False
test_render_checkpoint_new_notebook_with_available_data_asset
( deterministic_asset_dataconnector_context, titanic_expectation_suite, checkpoint_new_notebook_assets, )
What does this test and why? The CheckpointNewNotebookRenderer should generate a notebook with an example SimpleCheckpoint yaml config based on the first available data asset.
What does this test and why? The CheckpointNewNotebookRenderer should generate a notebook with an example SimpleCheckpoint yaml config based on the first available data asset.
def test_render_checkpoint_new_notebook_with_available_data_asset( deterministic_asset_dataconnector_context, titanic_expectation_suite, checkpoint_new_notebook_assets, ): """ What does this test and why? The CheckpointNewNotebookRenderer should generate a notebook with an example SimpleCheckpoi...
[ "def", "test_render_checkpoint_new_notebook_with_available_data_asset", "(", "deterministic_asset_dataconnector_context", ",", "titanic_expectation_suite", ",", "checkpoint_new_notebook_assets", ",", ")", ":", "context", ":", "DataContext", "=", "deterministic_asset_dataconnector_conte...
[ 256, 0 ]
[ 306, 26 ]
python
en
['en', 'error', 'th']
False
aclose_forcefully
(resource)
Close an async resource or async generator immediately, without blocking to do any graceful cleanup. :class:`~trio.abc.AsyncResource` objects guarantee that if their :meth:`~trio.abc.AsyncResource.aclose` method is cancelled, then they will still close the resource (albeit in a potentially ungraceful ...
Close an async resource or async generator immediately, without blocking to do any graceful cleanup.
async def aclose_forcefully(resource): """Close an async resource or async generator immediately, without blocking to do any graceful cleanup. :class:`~trio.abc.AsyncResource` objects guarantee that if their :meth:`~trio.abc.AsyncResource.aclose` method is cancelled, then they will still close the ...
[ "async", "def", "aclose_forcefully", "(", "resource", ")", ":", "with", "trio", ".", "CancelScope", "(", ")", "as", "cs", ":", "cs", ".", "cancel", "(", ")", "await", "resource", ".", "aclose", "(", ")" ]
[ 8, 0 ]
[ 35, 31 ]
python
en
['en', 'en', 'en']
True
start_datarun
(orex, experiment, pipeline)
Start executing a Datarun and store the results on DB. Args: orex (OrionExplorer): OrionExplorer instance to use to store the results inside the Database. experiment (Experiment or ObjectId or str): The Experiment to which the created Datarun will bel...
Start executing a Datarun and store the results on DB.
def start_datarun(orex, experiment, pipeline): """Start executing a Datarun and store the results on DB. Args: orex (OrionExplorer): OrionExplorer instance to use to store the results inside the Database. experiment (Experiment or ObjectId or str): The Experi...
[ "def", "start_datarun", "(", "orex", ",", "experiment", ",", "pipeline", ")", ":", "datarun", "=", "orex", ".", "add_datarun", "(", "experiment", ",", "pipeline", ")", "datarun", ".", "start", "(", ")", "LOGGER", ".", "info", "(", "'Datarun %s started'", "...
[ 75, 0 ]
[ 102, 23 ]
python
en
['en', 'en', 'en']
True
ValidationOperator.validation_operator_config
(self)
This method builds the config dict of a particular validation operator. The "kwargs" key is what really distinguishes different validation operators. e.g.: { "class_name": "ActionListValidationOperator", "module_name": "great_expectations.validation_operators", ...
This method builds the config dict of a particular validation operator. The "kwargs" key is what really distinguishes different validation operators.
def validation_operator_config(self): """ This method builds the config dict of a particular validation operator. The "kwargs" key is what really distinguishes different validation operators. e.g.: { "class_name": "ActionListValidationOperator", "module_n...
[ "def", "validation_operator_config", "(", "self", ")", ":", "raise", "NotImplementedError" ]
[ 37, 4 ]
[ 67, 33 ]
python
en
['en', 'error', 'th']
False
ActionListValidationOperator._build_batch_from_item
(self, item)
Internal helper method to take an asset to validate, which can be either: (1) a DataAsset; or (2) a tuple of data_asset_name, expectation_suite_name, and batch_kwargs (suitable for passing to get_batch) Args: item: The item to convert to a batch (see above) Returns: ...
Internal helper method to take an asset to validate, which can be either: (1) a DataAsset; or (2) a tuple of data_asset_name, expectation_suite_name, and batch_kwargs (suitable for passing to get_batch)
def _build_batch_from_item(self, item): """Internal helper method to take an asset to validate, which can be either: (1) a DataAsset; or (2) a tuple of data_asset_name, expectation_suite_name, and batch_kwargs (suitable for passing to get_batch) Args: item: The item to c...
[ "def", "_build_batch_from_item", "(", "self", ",", "item", ")", ":", "# if not isinstance(item, (DataAsset, Validator)):", "if", "isinstance", "(", "item", ",", "tuple", ")", ":", "if", "not", "(", "len", "(", "item", ")", "==", "2", "and", "isinstance", "(", ...
[ 247, 4 ]
[ 273, 20 ]
python
en
['en', 'en', 'en']
True
ActionListValidationOperator._run_actions
( self, batch, expectation_suite_identifier, expectation_suite, batch_validation_result, run_id, )
Runs all actions configured for this operator on the result of validating one batch against one expectation suite. If an action fails with an exception, the method does not continue. :param batch: :param expectation_suite: :param batch_validation_result: :param...
Runs all actions configured for this operator on the result of validating one batch against one expectation suite.
def _run_actions( self, batch, expectation_suite_identifier, expectation_suite, batch_validation_result, run_id, ): """ Runs all actions configured for this operator on the result of validating one batch against one expectation suite. ...
[ "def", "_run_actions", "(", "self", ",", "batch", ",", "expectation_suite_identifier", ",", "expectation_suite", ",", "batch_validation_result", ",", "run_id", ",", ")", ":", "batch_actions_results", "=", "{", "}", "for", "action", "in", "self", ".", "action_list"...
[ 349, 4 ]
[ 408, 36 ]
python
en
['en', 'error', 'th']
False
SuiteEditNotebookRenderer.render
( self, suite: ExpectationSuite, batch_kwargs=None )
Render a notebook dict from an expectation suite.
Render a notebook dict from an expectation suite.
def render( self, suite: ExpectationSuite, batch_kwargs=None ) -> nbformat.NotebookNode: """ Render a notebook dict from an expectation suite. """ if not isinstance(suite, ExpectationSuite): raise RuntimeWarning("render must be given an ExpectationSuite.") ...
[ "def", "render", "(", "self", ",", "suite", ":", "ExpectationSuite", ",", "batch_kwargs", "=", "None", ")", "->", "nbformat", ".", "NotebookNode", ":", "if", "not", "isinstance", "(", "suite", ",", "ExpectationSuite", ")", ":", "raise", "RuntimeWarning", "("...
[ 270, 4 ]
[ 289, 29 ]
python
en
['en', 'error', 'th']
False
SuiteEditNotebookRenderer.render_to_disk
( self, suite: ExpectationSuite, notebook_file_path: str, batch_kwargs=None )
Render a notebook to disk from an expectation suite. If batch_kwargs are passed they will override any found in suite citations.
Render a notebook to disk from an expectation suite.
def render_to_disk( self, suite: ExpectationSuite, notebook_file_path: str, batch_kwargs=None ) -> None: """ Render a notebook to disk from an expectation suite. If batch_kwargs are passed they will override any found in suite citations. """ self.render(suite...
[ "def", "render_to_disk", "(", "self", ",", "suite", ":", "ExpectationSuite", ",", "notebook_file_path", ":", "str", ",", "batch_kwargs", "=", "None", ")", "->", "None", ":", "self", ".", "render", "(", "suite", ",", "batch_kwargs", ")", "self", ".", "write...
[ 291, 4 ]
[ 301, 71 ]
python
en
['en', 'error', 'th']
False
Mark.cli_as_experimental
(func: Callable)
Apply as a decorator to CLI commands that are Experimental.
Apply as a decorator to CLI commands that are Experimental.
def cli_as_experimental(func: Callable) -> Callable: """Apply as a decorator to CLI commands that are Experimental.""" @wraps(func) def wrapper(*args, **kwargs): cli_message( "<yellow>Heads up! This feature is Experimental. It may change. " "Please gi...
[ "def", "cli_as_experimental", "(", "func", ":", "Callable", ")", "->", "Callable", ":", "@", "wraps", "(", "func", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "cli_message", "(", "\"<yellow>Heads up! This feature is Experimental...
[ 18, 4 ]
[ 29, 22 ]
python
en
['en', 'en', 'en']
True
Mark.cli_as_beta
(func: Callable)
Apply as a decorator to CLI commands that are beta.
Apply as a decorator to CLI commands that are beta.
def cli_as_beta(func: Callable) -> Callable: """Apply as a decorator to CLI commands that are beta.""" @wraps(func) def wrapper(*args, **kwargs): cli_message( "<yellow>Heads up! This feature is in Beta. Please give us " "your feedback!</yellow>" ...
[ "def", "cli_as_beta", "(", "func", ":", "Callable", ")", "->", "Callable", ":", "@", "wraps", "(", "func", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "cli_message", "(", "\"<yellow>Heads up! This feature is in Beta. Please give...
[ 32, 4 ]
[ 43, 22 ]
python
en
['en', 'en', 'en']
True
Mark.cli_as_deprecation
( message: str = "<yellow>Heads up! This feature will be deprecated in the next major release</yellow>", )
Apply as a decorator to CLI commands that will be deprecated.
Apply as a decorator to CLI commands that will be deprecated.
def cli_as_deprecation( message: str = "<yellow>Heads up! This feature will be deprecated in the next major release</yellow>", ) -> Callable: """Apply as a decorator to CLI commands that will be deprecated.""" def inner_decorator(func): @wraps(func) def wrapped(*args...
[ "def", "cli_as_deprecation", "(", "message", ":", "str", "=", "\"<yellow>Heads up! This feature will be deprecated in the next major release</yellow>\"", ",", ")", "->", "Callable", ":", "def", "inner_decorator", "(", "func", ")", ":", "@", "wraps", "(", "func", ")", ...
[ 46, 4 ]
[ 59, 30 ]
python
en
['en', 'en', 'en']
True
has_public_binary_operator
(type_, operator_symbol)
returns True, if `type_` has public binary operator, otherwise False
returns True, if `type_` has public binary operator, otherwise False
def has_public_binary_operator(type_, operator_symbol): """returns True, if `type_` has public binary operator, otherwise False""" type_ = type_traits.remove_alias(type_) type_ = type_traits.remove_cv(type_) type_ = type_traits.remove_declarated(type_) assert isinstance(type_, class_declaration.clas...
[ "def", "has_public_binary_operator", "(", "type_", ",", "operator_symbol", ")", ":", "type_", "=", "type_traits", ".", "remove_alias", "(", "type_", ")", "type_", "=", "type_traits", ".", "remove_cv", "(", "type_", ")", "type_", "=", "type_traits", ".", "remov...
[ 6, 0 ]
[ 48, 16 ]
python
en
['en', 'en', 'en']
True
has_public_equal
(decl_type)
returns True, if class has public operator==, otherwise False
returns True, if class has public operator==, otherwise False
def has_public_equal(decl_type): """returns True, if class has public operator==, otherwise False""" return has_public_binary_operator(decl_type, '==')
[ "def", "has_public_equal", "(", "decl_type", ")", ":", "return", "has_public_binary_operator", "(", "decl_type", ",", "'=='", ")" ]
[ 51, 0 ]
[ 53, 54 ]
python
en
['en', 'en', 'en']
True
has_public_less
(decl_type)
returns True, if class has public operator<, otherwise False
returns True, if class has public operator<, otherwise False
def has_public_less(decl_type): """returns True, if class has public operator<, otherwise False""" return has_public_binary_operator(decl_type, '<')
[ "def", "has_public_less", "(", "decl_type", ")", ":", "return", "has_public_binary_operator", "(", "decl_type", ",", "'<'", ")" ]
[ 56, 0 ]
[ 58, 53 ]
python
en
['en', 'en', 'en']
True
elaborated_info.elaborated_type_specifier
(self)
Elaborated specifier (can be: struct, union, class or enum). Returns: str: elaborated specifier
Elaborated specifier (can be: struct, union, class or enum).
def elaborated_type_specifier(self): """ Elaborated specifier (can be: struct, union, class or enum). Returns: str: elaborated specifier """ return self._elaborated_type_specifier
[ "def", "elaborated_type_specifier", "(", "self", ")", ":", "return", "self", ".", "_elaborated_type_specifier" ]
[ 16, 4 ]
[ 23, 46 ]
python
en
['en', 'error', 'th']
False
get_set_of_columns_and_expectations_from_suite
( suite: ExpectationSuite, )
Args: suite: An expectation suite Returns: A tuple containing a set of columns and a set of expectations found in a suite
Args: suite: An expectation suite
def get_set_of_columns_and_expectations_from_suite( suite: ExpectationSuite, ) -> Tuple[Set[str], Set[str]]: """ Args: suite: An expectation suite Returns: A tuple containing a set of columns and a set of expectations found in a suite """ columns: Set[str] = { i.kwargs.g...
[ "def", "get_set_of_columns_and_expectations_from_suite", "(", "suite", ":", "ExpectationSuite", ",", ")", "->", "Tuple", "[", "Set", "[", "str", "]", ",", "Set", "[", "str", "]", "]", ":", "columns", ":", "Set", "[", "str", "]", "=", "{", "i", ".", "kw...
[ 55, 0 ]
[ 70, 32 ]
python
en
['en', 'error', 'th']
False
ape
(y, p)
Absolute Percentage Error (APE). Args: y (float): target p (float): prediction Returns: e (float): APE
Absolute Percentage Error (APE). Args: y (float): target p (float): prediction
def ape(y, p): """Absolute Percentage Error (APE). Args: y (float): target p (float): prediction Returns: e (float): APE """ assert np.abs(y) > EPS return np.abs(1 - p / y)
[ "def", "ape", "(", "y", ",", "p", ")", ":", "assert", "np", ".", "abs", "(", "y", ")", ">", "EPS", "return", "np", ".", "abs", "(", "1", "-", "p", "/", "y", ")" ]
[ 12, 0 ]
[ 23, 28 ]
python
en
['en', 'et', 'it']
False
mape
(y, p)
Mean Absolute Percentage Error (MAPE). Args: y (numpy.array): target p (numpy.array): prediction Returns: e (numpy.float64): MAPE
Mean Absolute Percentage Error (MAPE). Args: y (numpy.array): target p (numpy.array): prediction
def mape(y, p): """Mean Absolute Percentage Error (MAPE). Args: y (numpy.array): target p (numpy.array): prediction Returns: e (numpy.float64): MAPE """ filt = np.abs(y) > EPS return np.mean(np.abs(1 - p[filt] / y[filt]))
[ "def", "mape", "(", "y", ",", "p", ")", ":", "filt", "=", "np", ".", "abs", "(", "y", ")", ">", "EPS", "return", "np", ".", "mean", "(", "np", ".", "abs", "(", "1", "-", "p", "[", "filt", "]", "/", "y", "[", "filt", "]", ")", ")" ]
[ 26, 0 ]
[ 37, 49 ]
python
en
['en', 'ro', 'it']
False
smape
(y, p)
Symmetric Mean Absolute Percentage Error (sMAPE). Args: y (numpy.array): target p (numpy.array): prediction Returns: e (numpy.float64): sMAPE
Symmetric Mean Absolute Percentage Error (sMAPE). Args: y (numpy.array): target p (numpy.array): prediction
def smape(y, p): """Symmetric Mean Absolute Percentage Error (sMAPE). Args: y (numpy.array): target p (numpy.array): prediction Returns: e (numpy.float64): sMAPE """ return 2. * np.mean(np.abs(y - p) / (np.abs(y) + np.abs(p)))
[ "def", "smape", "(", "y", ",", "p", ")", ":", "return", "2.", "*", "np", ".", "mean", "(", "np", ".", "abs", "(", "y", "-", "p", ")", "/", "(", "np", ".", "abs", "(", "y", ")", "+", "np", ".", "abs", "(", "p", ")", ")", ")" ]
[ 40, 0 ]
[ 49, 64 ]
python
en
['en', 'ro', 'it']
False
rmse
(y, p)
Root Mean Squared Error (RMSE). Args: y (numpy.array): target p (numpy.array): prediction Returns: e (numpy.float64): RMSE
Root Mean Squared Error (RMSE). Args: y (numpy.array): target p (numpy.array): prediction
def rmse(y, p): """Root Mean Squared Error (RMSE). Args: y (numpy.array): target p (numpy.array): prediction Returns: e (numpy.float64): RMSE """ # check and get number of samples assert y.shape == p.shape return np.sqrt(mse(y, p))
[ "def", "rmse", "(", "y", ",", "p", ")", ":", "# check and get number of samples", "assert", "y", ".", "shape", "==", "p", ".", "shape", "return", "np", ".", "sqrt", "(", "mse", "(", "y", ",", "p", ")", ")" ]
[ 52, 0 ]
[ 65, 29 ]
python
en
['en', 'en', 'en']
True
gini
(y, p)
Normalized Gini Coefficient. Args: y (numpy.array): target p (numpy.array): prediction Returns: e (numpy.float64): normalized Gini coefficient
Normalized Gini Coefficient.
def gini(y, p): """Normalized Gini Coefficient. Args: y (numpy.array): target p (numpy.array): prediction Returns: e (numpy.float64): normalized Gini coefficient """ # check and get number of samples assert y.shape == p.shape n_samples = y.shape[0] # sort row...
[ "def", "gini", "(", "y", ",", "p", ")", ":", "# check and get number of samples", "assert", "y", ".", "shape", "==", "p", ".", "shape", "n_samples", "=", "y", ".", "shape", "[", "0", "]", "# sort rows on prediction column", "# (from largest to smallest)", "arr",...
[ 68, 0 ]
[ 100, 26 ]
python
en
['it', 'en', 'en']
True
regression_metrics
(y, p, w=None, metrics={'RMSE': rmse, 'sMAPE': smape, 'Gini': gini})
Log metrics for regressors. Args: y (numpy.array): target p (numpy.array): prediction w (numpy.array, optional): a treatment vector (1 or True: treatment, 0 or False: control). If given, log metrics for the treatment and control group separately metrics (dict, optional):...
Log metrics for regressors.
def regression_metrics(y, p, w=None, metrics={'RMSE': rmse, 'sMAPE': smape, 'Gini': gini}): """Log metrics for regressors. Args: y (numpy.array): target p (numpy.array): prediction w (numpy.array, optional): a treatment vector (1 or True: treatment, 0 or False: control). If given, log ...
[ "def", "regression_metrics", "(", "y", ",", "p", ",", "w", "=", "None", ",", "metrics", "=", "{", "'RMSE'", ":", "rmse", ",", "'sMAPE'", ":", "smape", ",", "'Gini'", ":", "gini", "}", ")", ":", "assert", "metrics", "assert", "y", ".", "shape", "[",...
[ 103, 0 ]
[ 124, 68 ]
python
da
['da', 'id', 'en']
False
mask_comments
(input)
Mask the quoted strings so we skip braces inside quoted strings.
Mask the quoted strings so we skip braces inside quoted strings.
def mask_comments(input): """Mask the quoted strings so we skip braces inside quoted strings.""" search_re = re.compile(r'(.*?)(#)(.*)') return [search_re.sub(comment_replace, line) for line in input]
[ "def", "mask_comments", "(", "input", ")", ":", "search_re", "=", "re", ".", "compile", "(", "r'(.*?)(#)(.*)'", ")", "return", "[", "search_re", ".", "sub", "(", "comment_replace", ",", "line", ")", "for", "line", "in", "input", "]" ]
[ 27, 0 ]
[ 30, 65 ]
python
en
['en', 'en', 'en']
True
mask_quotes
(input)
Mask the quoted strings so we skip braces inside quoted strings.
Mask the quoted strings so we skip braces inside quoted strings.
def mask_quotes(input): """Mask the quoted strings so we skip braces inside quoted strings.""" search_re = re.compile(r'(.*?)' + QUOTE_RE_STR) return [search_re.sub(quote_replace, line) for line in input]
[ "def", "mask_quotes", "(", "input", ")", ":", "search_re", "=", "re", ".", "compile", "(", "r'(.*?)'", "+", "QUOTE_RE_STR", ")", "return", "[", "search_re", ".", "sub", "(", "quote_replace", ",", "line", ")", "for", "line", "in", "input", "]" ]
[ 40, 0 ]
[ 43, 63 ]
python
en
['en', 'en', 'en']
True
split_double_braces
(input)
Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below. These are used to split lines which have multiple braces on them, so that the indentation looks prettier when all laid out (e.g. closing braces make a nice diago...
Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below.
def split_double_braces(input): """Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below. These are used to split lines which have multiple braces on them, so that the indentation looks prettier when all laid out (e....
[ "def", "split_double_braces", "(", "input", ")", ":", "double_open_brace_re", "=", "re", ".", "compile", "(", "r'(.*?[\\[\\{\\(,])(\\s*)([\\[\\{\\(])'", ")", "double_close_brace_re", "=", "re", ".", "compile", "(", "r'(.*?[\\]\\}\\)],?)(\\s*)([\\]\\}\\)])'", ")", "masked_...
[ 61, 0 ]
[ 79, 15 ]
python
en
['en', 'en', 'en']
True
count_braces
(line)
keeps track of the number of braces on a given line and returns the result. It starts at zero and subtracts for closed braces, and adds for open braces.
keeps track of the number of braces on a given line and returns the result.
def count_braces(line): """keeps track of the number of braces on a given line and returns the result. It starts at zero and subtracts for closed braces, and adds for open braces. """ open_braces = ['[', '(', '{'] close_braces = [']', ')', '}'] closing_prefix_re = re.compile(r'(.*?[^\s\]\}\)]+.*?)([\]\}\)]...
[ "def", "count_braces", "(", "line", ")", ":", "open_braces", "=", "[", "'['", ",", "'('", ",", "'{'", "]", "close_braces", "=", "[", "']'", ",", "')'", ",", "'}'", "]", "closing_prefix_re", "=", "re", ".", "compile", "(", "r'(.*?[^\\s\\]\\}\\)]+.*?)([\\]\\...
[ 82, 0 ]
[ 111, 21 ]
python
en
['en', 'en', 'en']
True
prettyprint_input
(lines)
Does the main work of indenting the input based on the brace counts.
Does the main work of indenting the input based on the brace counts.
def prettyprint_input(lines): """Does the main work of indenting the input based on the brace counts.""" indent = 0 basic_offset = 2 last_line = "" for line in lines: if COMMENT_RE.match(line): print line else: line = line.strip('\r\n\t ') # Otherwise doesn't strip \r on Unix. if le...
[ "def", "prettyprint_input", "(", "lines", ")", ":", "indent", "=", "0", "basic_offset", "=", "2", "last_line", "=", "\"\"", "for", "line", "in", "lines", ":", "if", "COMMENT_RE", ".", "match", "(", "line", ")", ":", "print", "line", "else", ":", "line"...
[ 114, 0 ]
[ 137, 22 ]
python
en
['en', 'en', 'en']
True
_calc_validation_statistics
(validation_results)
Calculate summary statistics for the validation results and return ``ExpectationStatistics``.
Calculate summary statistics for the validation results and return ``ExpectationStatistics``.
def _calc_validation_statistics(validation_results): """ Calculate summary statistics for the validation results and return ``ExpectationStatistics``. """ # calc stats successful_expectations = sum(exp.success for exp in validation_results) evaluated_expectations = len(validation_results) ...
[ "def", "_calc_validation_statistics", "(", "validation_results", ")", ":", "# calc stats", "successful_expectations", "=", "sum", "(", "exp", ".", "success", "for", "exp", "in", "validation_results", ")", "evaluated_expectations", "=", "len", "(", "validation_results", ...
[ 1416, 0 ]
[ 1438, 5 ]
python
en
['en', 'error', 'th']
False
Validator.__init__
( self, execution_engine, interactive_evaluation=True, expectation_suite=None, expectation_suite_name=None, data_context=None, batches=None, **kwargs, )
Initialize the DataAsset. :param profiler (profiler class) = None: The profiler that should be run on the data_asset to build a baseline expectation suite. Note: DataAsset is designed to support multiple inheritance (e.g. PandasDataset inherits from both a Pandas DataFrame...
Initialize the DataAsset.
def __init__( self, execution_engine, interactive_evaluation=True, expectation_suite=None, expectation_suite_name=None, data_context=None, batches=None, **kwargs, ): """ Initialize the DataAsset. :param profiler (profiler class...
[ "def", "__init__", "(", "self", ",", "execution_engine", ",", "interactive_evaluation", "=", "True", ",", "expectation_suite", "=", "None", ",", "expectation_suite_name", "=", "None", ",", "data_context", "=", "None", ",", "batches", "=", "None", ",", "*", "*"...
[ 61, 4 ]
[ 127, 73 ]
python
en
['en', 'error', 'th']
False
Validator.__dir__
(self)
This custom magic method is used to enable expectation tab completion on Validator objects. It also allows users to call Pandas.DataFrame methods on Validator objects
This custom magic method is used to enable expectation tab completion on Validator objects. It also allows users to call Pandas.DataFrame methods on Validator objects
def __dir__(self): """ This custom magic method is used to enable expectation tab completion on Validator objects. It also allows users to call Pandas.DataFrame methods on Validator objects """ validator_attrs = set(super().__dir__()) class_expectation_impls = set(list_re...
[ "def", "__dir__", "(", "self", ")", ":", "validator_attrs", "=", "set", "(", "super", "(", ")", ".", "__dir__", "(", ")", ")", "class_expectation_impls", "=", "set", "(", "list_registered_expectation_implementations", "(", ")", ")", "# execution_engine_expectation...
[ 129, 4 ]
[ 155, 33 ]
python
en
['en', 'error', 'th']
False
Validator.validate_expectation
(self, name)
Given the name of an Expectation, obtains the Class-first Expectation implementation and utilizes the expectation's validate method to obtain a validation result. Also adds in the runtime configuration Args: name (str): The name of the Expect...
Given the name of an Expectation, obtains the Class-first Expectation implementation and utilizes the expectation's validate method to obtain a validation result. Also adds in the runtime configuration
def validate_expectation(self, name): """ Given the name of an Expectation, obtains the Class-first Expectation implementation and utilizes the expectation's validate method to obtain a validation result. Also adds in the runtime configuration Args: ...
[ "def", "validate_expectation", "(", "self", ",", "name", ")", ":", "def", "inst_expectation", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "try", ":", "expectation_impl", "=", "get_expectation_impl", "(", "name", ")", "allowed_config_keys", "=", "exp...
[ 179, 4 ]
[ 283, 31 ]
python
en
['en', 'error', 'th']
False
Validator.execution_engine
(self)
Returns the execution engine being used by the validator at the given time
Returns the execution engine being used by the validator at the given time
def execution_engine(self): """Returns the execution engine being used by the validator at the given time""" return self._execution_engine
[ "def", "execution_engine", "(", "self", ")", ":", "return", "self", ".", "_execution_engine" ]
[ 286, 4 ]
[ 288, 37 ]
python
en
['en', 'en', 'en']
True
Validator.list_available_expectation_types
(self)
Returns a list of all expectations available to the validator
Returns a list of all expectations available to the validator
def list_available_expectation_types(self): """Returns a list of all expectations available to the validator""" keys = dir(self) return [ expectation for expectation in keys if expectation.startswith("expect_") ]
[ "def", "list_available_expectation_types", "(", "self", ")", ":", "keys", "=", "dir", "(", "self", ")", "return", "[", "expectation", "for", "expectation", "in", "keys", "if", "expectation", ".", "startswith", "(", "\"expect_\"", ")", "]" ]
[ 290, 4 ]
[ 295, 9 ]
python
en
['en', 'en', 'en']
True
Validator.get_metrics
(self, metrics: Dict[str, MetricConfiguration])
Return a dictionary with the requested metrics
Return a dictionary with the requested metrics
def get_metrics(self, metrics: Dict[str, MetricConfiguration]) -> Dict[str, Any]: """Return a dictionary with the requested metrics""" graph = ValidationGraph() resolved_metrics = {} for metric_name, metric_configuration in metrics.items(): provider_cls, _ = get_metric_provid...
[ "def", "get_metrics", "(", "self", ",", "metrics", ":", "Dict", "[", "str", ",", "MetricConfiguration", "]", ")", "->", "Dict", "[", "str", ",", "Any", "]", ":", "graph", "=", "ValidationGraph", "(", ")", "resolved_metrics", "=", "{", "}", "for", "metr...
[ 297, 4 ]
[ 332, 9 ]
python
en
['en', 'en', 'en']
True
Validator.get_metric
(self, metric: MetricConfiguration)
return the value of the requested metric.
return the value of the requested metric.
def get_metric(self, metric: MetricConfiguration) -> Any: """return the value of the requested metric.""" return self.get_metrics({"_": metric})["_"]
[ "def", "get_metric", "(", "self", ",", "metric", ":", "MetricConfiguration", ")", "->", "Any", ":", "return", "self", ".", "get_metrics", "(", "{", "\"_\"", ":", "metric", "}", ")", "[", "\"_\"", "]" ]
[ 334, 4 ]
[ 336, 51 ]
python
en
['en', 'en', 'en']
True
Validator.build_metric_dependency_graph
( self, graph: ValidationGraph, child_node: MetricConfiguration, configuration: Optional[ExpectationConfiguration], execution_engine: "ExecutionEngine", parent_node: Optional[MetricConfiguration] = None, runtime_configuration: Optional[dict] = None, )
Obtain domain and value keys for metrics and proceeds to add these metrics to the validation graph until all metrics have been added.
Obtain domain and value keys for metrics and proceeds to add these metrics to the validation graph until all metrics have been added.
def build_metric_dependency_graph( self, graph: ValidationGraph, child_node: MetricConfiguration, configuration: Optional[ExpectationConfiguration], execution_engine: "ExecutionEngine", parent_node: Optional[MetricConfiguration] = None, runtime_configuration: Opti...
[ "def", "build_metric_dependency_graph", "(", "self", ",", "graph", ":", "ValidationGraph", ",", "child_node", ":", "MetricConfiguration", ",", "configuration", ":", "Optional", "[", "ExpectationConfiguration", "]", ",", "execution_engine", ":", "\"ExecutionEngine\"", ",...
[ 338, 4 ]
[ 392, 17 ]
python
en
['en', 'en', 'en']
True
Validator.graph_validate
( self, configurations: List[ExpectationConfiguration], metrics: dict = None, runtime_configuration: dict = None, )
Obtains validation dependencies for each metric using the implementation of their associated expectation, then proceeds to add these dependencies to the validation graph, supply readily available metric implementations to fulfill current metric requirements, and validate these metrics. ...
Obtains validation dependencies for each metric using the implementation of their associated expectation, then proceeds to add these dependencies to the validation graph, supply readily available metric implementations to fulfill current metric requirements, and validate these metrics.
def graph_validate( self, configurations: List[ExpectationConfiguration], metrics: dict = None, runtime_configuration: dict = None, ) -> List[ExpectationValidationResult]: """Obtains validation dependencies for each metric using the implementation of their associated expectat...
[ "def", "graph_validate", "(", "self", ",", "configurations", ":", "List", "[", "ExpectationConfiguration", "]", ",", "metrics", ":", "dict", "=", "None", ",", "runtime_configuration", ":", "dict", "=", "None", ",", ")", "->", "List", "[", "ExpectationValidatio...
[ 394, 4 ]
[ 499, 19 ]
python
en
['en', 'en', 'en']
True
Validator._parse_validation_graph
(self, validation_graph, metrics)
Given validation graph, returns the ready and needed metrics necessary for validation using a traversal of validation graph (a graph structure of metric ids) edges
Given validation graph, returns the ready and needed metrics necessary for validation using a traversal of validation graph (a graph structure of metric ids) edges
def _parse_validation_graph(self, validation_graph, metrics): """Given validation graph, returns the ready and needed metrics necessary for validation using a traversal of validation graph (a graph structure of metric ids) edges""" unmet_dependency_ids = set() unmet_dependency = set() ...
[ "def", "_parse_validation_graph", "(", "self", ",", "validation_graph", ",", "metrics", ")", ":", "unmet_dependency_ids", "=", "set", "(", ")", "unmet_dependency", "=", "set", "(", ")", "maybe_ready_ids", "=", "set", "(", ")", "maybe_ready", "=", "set", "(", ...
[ 528, 4 ]
[ 547, 63 ]
python
en
['en', 'en', 'en']
True
Validator._resolve_metrics
( self, execution_engine: "ExecutionEngine", metrics_to_resolve: Iterable[MetricConfiguration], metrics: Dict, runtime_configuration: dict = None, )
A means of accessing the Execution Engine's resolve_metrics method, where missing metric configurations are resolved
A means of accessing the Execution Engine's resolve_metrics method, where missing metric configurations are resolved
def _resolve_metrics( self, execution_engine: "ExecutionEngine", metrics_to_resolve: Iterable[MetricConfiguration], metrics: Dict, runtime_configuration: dict = None, ): """A means of accessing the Execution Engine's resolve_metrics method, where missing metric config...
[ "def", "_resolve_metrics", "(", "self", ",", "execution_engine", ":", "\"ExecutionEngine\"", ",", "metrics_to_resolve", ":", "Iterable", "[", "MetricConfiguration", "]", ",", "metrics", ":", "Dict", ",", "runtime_configuration", ":", "dict", "=", "None", ",", ")",...
[ 549, 4 ]
[ 560, 9 ]
python
en
['en', 'en', 'en']
True
Validator._initialize_expectations
( self, expectation_suite: ExpectationSuite = None, expectation_suite_name: str = None, )
Instantiates `_expectation_suite` as empty by default or with a specified expectation `config`. In addition, this always sets the `default_expectation_args` to: `include_config`: False, `catch_exceptions`: False, `output_format`: 'BASIC' By default, initializes data_...
Instantiates `_expectation_suite` as empty by default or with a specified expectation `config`. In addition, this always sets the `default_expectation_args` to: `include_config`: False, `catch_exceptions`: False, `output_format`: 'BASIC'
def _initialize_expectations( self, expectation_suite: ExpectationSuite = None, expectation_suite_name: str = None, ): """Instantiates `_expectation_suite` as empty by default or with a specified expectation `config`. In addition, this always sets the `default_expectation_arg...
[ "def", "_initialize_expectations", "(", "self", ",", "expectation_suite", ":", "ExpectationSuite", "=", "None", ",", "expectation_suite_name", ":", "str", "=", "None", ",", ")", ":", "# Checking type of expectation_suite.", "# Check for expectation_suite_name is already done ...
[ 562, 4 ]
[ 626, 18 ]
python
en
['en', 'en', 'en']
True
Validator.append_expectation
(self, expectation_config)
This method is a thin wrapper for ExpectationSuite.append_expectation
This method is a thin wrapper for ExpectationSuite.append_expectation
def append_expectation(self, expectation_config): """This method is a thin wrapper for ExpectationSuite.append_expectation""" warnings.warn( "append_expectation is deprecated, and will be removed in a future release. " + "Please use ExpectationSuite.add_expectation instead.", ...
[ "def", "append_expectation", "(", "self", ",", "expectation_config", ")", ":", "warnings", ".", "warn", "(", "\"append_expectation is deprecated, and will be removed in a future release. \"", "+", "\"Please use ExpectationSuite.add_expectation instead.\"", ",", "DeprecationWarning", ...
[ 628, 4 ]
[ 635, 70 ]
python
en
['en', 'en', 'en']
True
Validator.find_expectation_indexes
( self, expectation_configuration: ExpectationConfiguration, match_type: str = "domain", )
This method is a thin wrapper for ExpectationSuite.find_expectation_indexes
This method is a thin wrapper for ExpectationSuite.find_expectation_indexes
def find_expectation_indexes( self, expectation_configuration: ExpectationConfiguration, match_type: str = "domain", ) -> List[int]: """This method is a thin wrapper for ExpectationSuite.find_expectation_indexes""" warnings.warn( "find_expectation_indexes is depre...
[ "def", "find_expectation_indexes", "(", "self", ",", "expectation_configuration", ":", "ExpectationConfiguration", ",", "match_type", ":", "str", "=", "\"domain\"", ",", ")", "->", "List", "[", "int", "]", ":", "warnings", ".", "warn", "(", "\"find_expectation_ind...
[ 637, 4 ]
[ 650, 9 ]
python
en
['en', 'en', 'en']
True
Validator.find_expectations
( self, expectation_configuration: ExpectationConfiguration, match_type: str = "domain", )
This method is a thin wrapper for ExpectationSuite.find_expectations()
This method is a thin wrapper for ExpectationSuite.find_expectations()
def find_expectations( self, expectation_configuration: ExpectationConfiguration, match_type: str = "domain", ) -> List[ExpectationConfiguration]: """This method is a thin wrapper for ExpectationSuite.find_expectations()""" warnings.warn( "find_expectations is dep...
[ "def", "find_expectations", "(", "self", ",", "expectation_configuration", ":", "ExpectationConfiguration", ",", "match_type", ":", "str", "=", "\"domain\"", ",", ")", "->", "List", "[", "ExpectationConfiguration", "]", ":", "warnings", ".", "warn", "(", "\"find_e...
[ 652, 4 ]
[ 665, 9 ]
python
en
['en', 'en', 'en']
True
Validator.remove_expectation
( self, expectation_configuration: ExpectationConfiguration, match_type: str = "domain", remove_multiple_matches: bool = False, )
This method is a thin wrapper for ExpectationSuite.remove()
This method is a thin wrapper for ExpectationSuite.remove()
def remove_expectation( self, expectation_configuration: ExpectationConfiguration, match_type: str = "domain", remove_multiple_matches: bool = False, ) -> List[ExpectationConfiguration]: """This method is a thin wrapper for ExpectationSuite.remove()""" warnings.warn( ...
[ "def", "remove_expectation", "(", "self", ",", "expectation_configuration", ":", "ExpectationConfiguration", ",", "match_type", ":", "str", "=", "\"domain\"", ",", "remove_multiple_matches", ":", "bool", "=", "False", ",", ")", "->", "List", "[", "ExpectationConfigu...
[ 667, 4 ]
[ 683, 9 ]
python
en
['en', 'en', 'en']
True
Validator.set_config_value
(self, key, value)
Setter for config value
Setter for config value
def set_config_value(self, key, value): """Setter for config value""" self._validator_config[key] = value
[ "def", "set_config_value", "(", "self", ",", "key", ",", "value", ")", ":", "self", ".", "_validator_config", "[", "key", "]", "=", "value" ]
[ 685, 4 ]
[ 687, 43 ]
python
da
['da', 'da', 'en']
True
Validator.get_config_value
(self, key)
Getter for config value
Getter for config value
def get_config_value(self, key): """Getter for config value""" return self._validator_config.get(key)
[ "def", "get_config_value", "(", "self", ",", "key", ")", ":", "return", "self", ".", "_validator_config", ".", "get", "(", "key", ")" ]
[ 689, 4 ]
[ 691, 46 ]
python
da
['da', 'da', 'en']
True
Validator.batches
(self)
Getter for batches
Getter for batches
def batches(self) -> Dict[str, Batch]: """Getter for batches""" return self._batches
[ "def", "batches", "(", "self", ")", "->", "Dict", "[", "str", ",", "Batch", "]", ":", "return", "self", ".", "_batches" ]
[ 704, 4 ]
[ 706, 28 ]
python
en
['en', 'en', 'en']
True
Validator.active_batch
(self)
Getter for active batch
Getter for active batch
def active_batch(self) -> Batch: """Getter for active batch""" active_batch_id: str = self.execution_engine.active_batch_data_id batch: Batch = self.batches.get(active_batch_id) if active_batch_id else None return batch
[ "def", "active_batch", "(", "self", ")", "->", "Batch", ":", "active_batch_id", ":", "str", "=", "self", ".", "execution_engine", ".", "active_batch_data_id", "batch", ":", "Batch", "=", "self", ".", "batches", ".", "get", "(", "active_batch_id", ")", "if", ...
[ 713, 4 ]
[ 717, 20 ]
python
en
['en', 'en', 'en']
True
Validator.active_batch_spec
(self)
Getter for active batch's batch_spec
Getter for active batch's batch_spec
def active_batch_spec(self) -> Optional[BatchSpec]: """Getter for active batch's batch_spec""" if not self.active_batch: return None else: return self.active_batch.batch_spec
[ "def", "active_batch_spec", "(", "self", ")", "->", "Optional", "[", "BatchSpec", "]", ":", "if", "not", "self", ".", "active_batch", ":", "return", "None", "else", ":", "return", "self", ".", "active_batch", ".", "batch_spec" ]
[ 720, 4 ]
[ 725, 47 ]
python
en
['en', 'en', 'en']
True
Validator.active_batch_id
(self)
Getter for active batch id
Getter for active batch id
def active_batch_id(self) -> str: """Getter for active batch id""" return self.execution_engine.active_batch_data_id
[ "def", "active_batch_id", "(", "self", ")", "->", "str", ":", "return", "self", ".", "execution_engine", ".", "active_batch_data_id" ]
[ 728, 4 ]
[ 730, 57 ]
python
en
['en', 'en', 'en']
True
Validator.active_batch_markers
(self)
Getter for active batch's batch markers
Getter for active batch's batch markers
def active_batch_markers(self): """Getter for active batch's batch markers""" if not self.active_batch: return None else: return self.active_batch.batch_markers
[ "def", "active_batch_markers", "(", "self", ")", ":", "if", "not", "self", ".", "active_batch", ":", "return", "None", "else", ":", "return", "self", ".", "active_batch", ".", "batch_markers" ]
[ 748, 4 ]
[ 753, 50 ]
python
en
['en', 'en', 'en']
True
Validator.active_batch_definition
(self)
Getter for the active batch's batch definition
Getter for the active batch's batch definition
def active_batch_definition(self): """Getter for the active batch's batch definition""" if not self.active_batch: return None else: return self.active_batch.batch_definition
[ "def", "active_batch_definition", "(", "self", ")", ":", "if", "not", "self", ".", "active_batch", ":", "return", "None", "else", ":", "return", "self", ".", "active_batch", ".", "batch_definition" ]
[ 756, 4 ]
[ 761, 53 ]
python
en
['en', 'en', 'en']
True
Validator.discard_failing_expectations
(self)
Removes any expectations from the validator where the validation has failed
Removes any expectations from the validator where the validation has failed
def discard_failing_expectations(self): """Removes any expectations from the validator where the validation has failed""" res = self.validate(only_return_failures=True).results if any(res): for item in res: self.remove_expectation( expectation_conf...
[ "def", "discard_failing_expectations", "(", "self", ")", ":", "res", "=", "self", ".", "validate", "(", "only_return_failures", "=", "True", ")", ".", "results", "if", "any", "(", "res", ")", ":", "for", "item", "in", "res", ":", "self", ".", "remove_exp...
[ 763, 4 ]
[ 772, 81 ]
python
en
['en', 'en', 'en']
True
Validator.get_default_expectation_arguments
(self)
Fetch default expectation arguments for this data_asset Returns: A dictionary containing all the current default expectation arguments for a data_asset Ex:: { "include_config" : True, "catch_exceptions" : False, ...
Fetch default expectation arguments for this data_asset
def get_default_expectation_arguments(self): """Fetch default expectation arguments for this data_asset Returns: A dictionary containing all the current default expectation arguments for a data_asset Ex:: { "include_config" : True, ...
[ "def", "get_default_expectation_arguments", "(", "self", ")", ":", "return", "self", ".", "_default_expectation_args" ]
[ 774, 4 ]
[ 791, 45 ]
python
en
['en', 'fr', 'en']
True
Validator.default_expectation_args
(self)
A getter for default Expectation arguments
A getter for default Expectation arguments
def default_expectation_args(self): """A getter for default Expectation arguments""" return self._default_expectation_args
[ "def", "default_expectation_args", "(", "self", ")", ":", "return", "self", ".", "_default_expectation_args" ]
[ 794, 4 ]
[ 796, 45 ]
python
da
['da', 'fr', 'en']
False
Validator.set_default_expectation_argument
(self, argument, value)
Set a default expectation argument for this data_asset Args: argument (string): The argument to be replaced value : The New argument to use for replacement Returns: None See also: get_default_expectation_arguments
Set a default expectation argument for this data_asset
def set_default_expectation_argument(self, argument, value): """ Set a default expectation argument for this data_asset Args: argument (string): The argument to be replaced value : The New argument to use for replacement Returns: None See al...
[ "def", "set_default_expectation_argument", "(", "self", ",", "argument", ",", "value", ")", ":", "self", ".", "_default_expectation_args", "[", "argument", "]", "=", "value" ]
[ 798, 4 ]
[ 813, 56 ]
python
en
['en', 'error', 'th']
False
Validator.get_expectations_config
( self, discard_failed_expectations=True, discard_result_format_kwargs=True, discard_include_config_kwargs=True, discard_catch_exceptions_kwargs=True, suppress_warnings=False, )
Returns an expectation configuration, providing an option to discard failed expectation and discard/ include' different result aspects, such as exceptions and result format.
Returns an expectation configuration, providing an option to discard failed expectation and discard/ include' different result aspects, such as exceptions and result format.
def get_expectations_config( self, discard_failed_expectations=True, discard_result_format_kwargs=True, discard_include_config_kwargs=True, discard_catch_exceptions_kwargs=True, suppress_warnings=False, ): """ Returns an expectation configuration, prov...
[ "def", "get_expectations_config", "(", "self", ",", "discard_failed_expectations", "=", "True", ",", "discard_result_format_kwargs", "=", "True", ",", "discard_include_config_kwargs", "=", "True", ",", "discard_catch_exceptions_kwargs", "=", "True", ",", "suppress_warnings"...
[ 815, 4 ]
[ 838, 9 ]
python
en
['en', 'error', 'th']
False
Validator.get_expectation_suite
( self, discard_failed_expectations=True, discard_result_format_kwargs=True, discard_include_config_kwargs=True, discard_catch_exceptions_kwargs=True, suppress_warnings=False, suppress_logging=False, )
Returns _expectation_config as a JSON object, and perform some cleaning along the way. Args: discard_failed_expectations (boolean): \ Only include expectations with success_on_last_run=True in the exported config. Defaults to `True`. discard_result_format_kwargs (boolea...
Returns _expectation_config as a JSON object, and perform some cleaning along the way.
def get_expectation_suite( self, discard_failed_expectations=True, discard_result_format_kwargs=True, discard_include_config_kwargs=True, discard_catch_exceptions_kwargs=True, suppress_warnings=False, suppress_logging=False, ): """Returns _expectation_...
[ "def", "get_expectation_suite", "(", "self", ",", "discard_failed_expectations", "=", "True", ",", "discard_result_format_kwargs", "=", "True", ",", "discard_include_config_kwargs", "=", "True", ",", "discard_catch_exceptions_kwargs", "=", "True", ",", "suppress_warnings", ...
[ 840, 4 ]
[ 943, 32 ]
python
en
['en', 'en', 'en']
True
Validator.save_expectation_suite
( self, filepath=None, discard_failed_expectations=True, discard_result_format_kwargs=True, discard_include_config_kwargs=True, discard_catch_exceptions_kwargs=True, suppress_warnings=False, )
Writes ``_expectation_config`` to a JSON file. Writes the DataAsset's expectation config to the specified JSON ``filepath``. Failing expectations \ can be excluded from the JSON expectations config with ``discard_failed_expectations``. The kwarg key-value \ pairs :ref:`result_format`, ...
Writes ``_expectation_config`` to a JSON file.
def save_expectation_suite( self, filepath=None, discard_failed_expectations=True, discard_result_format_kwargs=True, discard_include_config_kwargs=True, discard_catch_exceptions_kwargs=True, suppress_warnings=False, ): """Writes ``_expectation_config`...
[ "def", "save_expectation_suite", "(", "self", ",", "filepath", "=", "None", ",", "discard_failed_expectations", "=", "True", ",", "discard_result_format_kwargs", "=", "True", ",", "discard_include_config_kwargs", "=", "True", ",", "discard_catch_exceptions_kwargs", "=", ...
[ 945, 4 ]
[ 1001, 13 ]
python
en
['en', 'en', 'en']
True
Validator.validate
( self, expectation_suite=None, run_id=None, data_context=None, evaluation_parameters=None, catch_exceptions=True, result_format=None, only_return_failures=False, run_name=None, run_time=None, )
Generates a JSON-formatted report describing the outcome of all expectations. Use the default expectation_suite=None to validate the expectations config associated with the DataAsset. Args: expectation_suite (json or None): \ If None, uses the expectations config generated ...
Generates a JSON-formatted report describing the outcome of all expectations.
def validate( self, expectation_suite=None, run_id=None, data_context=None, evaluation_parameters=None, catch_exceptions=True, result_format=None, only_return_failures=False, run_name=None, run_time=None, ): """Generates a JSON-...
[ "def", "validate", "(", "self", ",", "expectation_suite", "=", "None", ",", "run_id", "=", "None", ",", "data_context", "=", "None", ",", "evaluation_parameters", "=", "None", ",", "catch_exceptions", "=", "True", ",", "result_format", "=", "None", ",", "onl...
[ 1003, 4 ]
[ 1263, 21 ]
python
en
['en', 'en', 'en']
True
Validator.get_evaluation_parameter
(self, parameter_name, default_value=None)
Get an evaluation parameter value that has been stored in meta. Args: parameter_name (string): The name of the parameter to store. default_value (any): The default value to be returned if the parameter is not found. Returns: The current value of the evaluat...
Get an evaluation parameter value that has been stored in meta.
def get_evaluation_parameter(self, parameter_name, default_value=None): """ Get an evaluation parameter value that has been stored in meta. Args: parameter_name (string): The name of the parameter to store. default_value (any): The default value to be returned if the par...
[ "def", "get_evaluation_parameter", "(", "self", ",", "parameter_name", ",", "default_value", "=", "None", ")", ":", "if", "parameter_name", "in", "self", ".", "_expectation_suite", ".", "evaluation_parameters", ":", "return", "self", ".", "_expectation_suite", ".", ...
[ 1265, 4 ]
[ 1279, 32 ]
python
en
['en', 'error', 'th']
False
Validator.set_evaluation_parameter
(self, parameter_name, parameter_value)
Provide a value to be stored in the data_asset evaluation_parameters object and used to evaluate parameterized expectations. Args: parameter_name (string): The name of the kwarg to be replaced at evaluation time parameter_value (any): The value to be used
Provide a value to be stored in the data_asset evaluation_parameters object and used to evaluate parameterized expectations.
def set_evaluation_parameter(self, parameter_name, parameter_value): """ Provide a value to be stored in the data_asset evaluation_parameters object and used to evaluate parameterized expectations. Args: parameter_name (string): The name of the kwarg to be replaced at evalua...
[ "def", "set_evaluation_parameter", "(", "self", ",", "parameter_name", ",", "parameter_value", ")", ":", "self", ".", "_expectation_suite", ".", "evaluation_parameters", ".", "update", "(", "{", "parameter_name", ":", "parameter_value", "}", ")" ]
[ 1281, 4 ]
[ 1292, 9 ]
python
en
['en', 'error', 'th']
False
Validator.add_citation
( self, comment, batch_spec=None, batch_markers=None, batch_definition=None, citation_date=None, )
Adds a citation to an existing Expectation Suite within the validator
Adds a citation to an existing Expectation Suite within the validator
def add_citation( self, comment, batch_spec=None, batch_markers=None, batch_definition=None, citation_date=None, ): """Adds a citation to an existing Expectation Suite within the validator""" if batch_spec is None: batch_spec = self.batch_s...
[ "def", "add_citation", "(", "self", ",", "comment", ",", "batch_spec", "=", "None", ",", "batch_markers", "=", "None", ",", "batch_definition", "=", "None", ",", "citation_date", "=", "None", ",", ")", ":", "if", "batch_spec", "is", "None", ":", "batch_spe...
[ 1294, 4 ]
[ 1315, 9 ]
python
en
['en', 'en', 'en']
True
Validator.expectation_suite_name
(self)
Gets the current expectation_suite name of this data_asset as stored in the expectations configuration.
Gets the current expectation_suite name of this data_asset as stored in the expectations configuration.
def expectation_suite_name(self): """Gets the current expectation_suite name of this data_asset as stored in the expectations configuration.""" return self._expectation_suite.expectation_suite_name
[ "def", "expectation_suite_name", "(", "self", ")", ":", "return", "self", ".", "_expectation_suite", ".", "expectation_suite_name" ]
[ 1318, 4 ]
[ 1320, 61 ]
python
en
['en', 'en', 'en']
True
Validator.expectation_suite_name
(self, expectation_suite_name)
Sets the expectation_suite name of this data_asset as stored in the expectations configuration.
Sets the expectation_suite name of this data_asset as stored in the expectations configuration.
def expectation_suite_name(self, expectation_suite_name): """Sets the expectation_suite name of this data_asset as stored in the expectations configuration.""" self._expectation_suite.expectation_suite_name = expectation_suite_name
[ "def", "expectation_suite_name", "(", "self", ",", "expectation_suite_name", ")", ":", "self", ".", "_expectation_suite", ".", "expectation_suite_name", "=", "expectation_suite_name" ]
[ 1323, 4 ]
[ 1325, 79 ]
python
en
['en', 'en', 'en']
True
Validator.test_expectation_function
(self, function, *args, **kwargs)
Test a generic expectation function Args: function (func): The function to be tested. (Must be a valid expectation function.) *args : Positional arguments to be passed the the function **kwargs : Keyword arguments to be passed the the function Returns...
Test a generic expectation function
def test_expectation_function(self, function, *args, **kwargs): """Test a generic expectation function Args: function (func): The function to be tested. (Must be a valid expectation function.) *args : Positional arguments to be passed the the function **kwar...
[ "def", "test_expectation_function", "(", "self", ",", "function", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "argspec", "=", "inspect", ".", "getfullargspec", "(", "function", ")", "[", "0", "]", "[", "1", ":", "]", "new_function", "=", "self...
[ 1327, 4 ]
[ 1349, 50 ]
python
en
['ro', 'en', 'en']
True
BridgeValidator.__init__
(self, batch, expectation_suite, expectation_engine=None, **kwargs)
Builds an expectation_engine object using an expectation suite and a batch, with the expectation engine being determined either by the user or by the type of batch data (pandas dataframe, SqlAlchemy table, etc.) Args: batch (Batch): A Batch in Pandas, Spark, or SQL format expect...
Builds an expectation_engine object using an expectation suite and a batch, with the expectation engine being determined either by the user or by the type of batch data (pandas dataframe, SqlAlchemy table, etc.)
def __init__(self, batch, expectation_suite, expectation_engine=None, **kwargs): """Builds an expectation_engine object using an expectation suite and a batch, with the expectation engine being determined either by the user or by the type of batch data (pandas dataframe, SqlAlchemy table, etc.) ...
[ "def", "__init__", "(", "self", ",", "batch", ",", "expectation_suite", ",", "expectation_engine", "=", "None", ",", "*", "*", "kwargs", ")", ":", "self", ".", "batch", "=", "batch", "self", ".", "expectation_suite", "=", "expectation_suite", "if", "isinstan...
[ 1444, 4 ]
[ 1496, 33 ]
python
en
['en', 'en', 'en']
True
BridgeValidator.get_dataset
(self)
Bridges between Execution Engines in providing access to the batch data. Validates that Dataset classes contain proper type of data (i.e. a Pandas Dataset does not contain SqlAlchemy data)
Bridges between Execution Engines in providing access to the batch data. Validates that Dataset classes contain proper type of data (i.e. a Pandas Dataset does not contain SqlAlchemy data)
def get_dataset(self): """ Bridges between Execution Engines in providing access to the batch data. Validates that Dataset classes contain proper type of data (i.e. a Pandas Dataset does not contain SqlAlchemy data) """ if issubclass(self.expectation_engine, PandasDataset): ...
[ "def", "get_dataset", "(", "self", ")", ":", "if", "issubclass", "(", "self", ".", "expectation_engine", ",", "PandasDataset", ")", ":", "import", "pandas", "as", "pd", "if", "not", "isinstance", "(", "self", ".", "batch", "[", "\"data\"", "]", ",", "pd"...
[ 1498, 4 ]
[ 1557, 13 ]
python
en
['en', 'error', 'th']
False
project_optional_config_comment
()
Default value for PROJECT_OPTIONAL_CONFIG_COMMENT
Default value for PROJECT_OPTIONAL_CONFIG_COMMENT
def project_optional_config_comment(): """ Default value for PROJECT_OPTIONAL_CONFIG_COMMENT """ PROJECT_OPTIONAL_CONFIG_COMMENT = ( templates.CONFIG_VARIABLES_INTRO + """ config_variables_file_path: uncommitted/config_variables.yml # The plugins_directory will be added to your python p...
[ "def", "project_optional_config_comment", "(", ")", ":", "PROJECT_OPTIONAL_CONFIG_COMMENT", "=", "(", "templates", ".", "CONFIG_VARIABLES_INTRO", "+", "\"\"\"\nconfig_variables_file_path: uncommitted/config_variables.yml\n\n# The plugins_directory will be added to your python path for custom...
[ 6, 0 ]
[ 72, 42 ]
python
en
['en', 'error', 'th']
False
test_project_optional_config_comment_matches_default
( project_optional_config_comment, )
What does this test and why? Make sure that the templates built on data_context.types.base.DataContextConfigDefaults match the desired default.
What does this test and why? Make sure that the templates built on data_context.types.base.DataContextConfigDefaults match the desired default.
def test_project_optional_config_comment_matches_default( project_optional_config_comment, ): """ What does this test and why? Make sure that the templates built on data_context.types.base.DataContextConfigDefaults match the desired default. """ assert templates.PROJECT_OPTIONAL_CONFIG_COMMENT ...
[ "def", "test_project_optional_config_comment_matches_default", "(", "project_optional_config_comment", ",", ")", ":", "assert", "templates", ".", "PROJECT_OPTIONAL_CONFIG_COMMENT", "==", "project_optional_config_comment" ]
[ 98, 0 ]
[ 106, 87 ]
python
en
['en', 'error', 'th']
False
test_project_help_comment_matches_default
(project_help_comment)
What does this test and why? Make sure that the templates built on data_context.types.base.DataContextConfigDefaults match the desired default.
What does this test and why? Make sure that the templates built on data_context.types.base.DataContextConfigDefaults match the desired default.
def test_project_help_comment_matches_default(project_help_comment): """ What does this test and why? Make sure that the templates built on data_context.types.base.DataContextConfigDefaults match the desired default. """ assert templates.PROJECT_HELP_COMMENT == project_help_comment
[ "def", "test_project_help_comment_matches_default", "(", "project_help_comment", ")", ":", "assert", "templates", ".", "PROJECT_HELP_COMMENT", "==", "project_help_comment" ]
[ 109, 0 ]
[ 115, 65 ]
python
en
['en', 'error', 'th']
False
lex
(code, lexer)
Lex ``code`` with ``lexer`` and return an iterable of tokens.
Lex ``code`` with ``lexer`` and return an iterable of tokens.
def lex(code, lexer): """ Lex ``code`` with ``lexer`` and return an iterable of tokens. """ try: return lexer.get_tokens(code) except TypeError as err: if isinstance(err.args[0], str) and \ ('unbound method get_tokens' in err.args[0] or 'missing 1 required posi...
[ "def", "lex", "(", "code", ",", "lexer", ")", ":", "try", ":", "return", "lexer", ".", "get_tokens", "(", "code", ")", "except", "TypeError", "as", "err", ":", "if", "isinstance", "(", "err", ".", "args", "[", "0", "]", ",", "str", ")", "and", "(...
[ 39, 0 ]
[ 51, 13 ]
python
en
['en', 'error', 'th']
False
format
(tokens, formatter, outfile=None)
Format a tokenlist ``tokens`` with the formatter ``formatter``. If ``outfile`` is given and a valid file object (an object with a ``write`` method), the result will be written to it, otherwise it is returned as a string.
Format a tokenlist ``tokens`` with the formatter ``formatter``.
def format(tokens, formatter, outfile=None): # pylint: disable=redefined-builtin """ Format a tokenlist ``tokens`` with the formatter ``formatter``. If ``outfile`` is given and a valid file object (an object with a ``write`` method), the result will be written to it, otherwise it is returned as a ...
[ "def", "format", "(", "tokens", ",", "formatter", ",", "outfile", "=", "None", ")", ":", "# pylint: disable=redefined-builtin", "try", ":", "if", "not", "outfile", ":", "realoutfile", "=", "getattr", "(", "formatter", ",", "'encoding'", ",", "None", ")", "an...
[ 54, 0 ]
[ 75, 13 ]
python
en
['en', 'error', 'th']
False
highlight
(code, lexer, formatter, outfile=None)
Lex ``code`` with ``lexer`` and format it with the formatter ``formatter``. If ``outfile`` is given and a valid file object (an object with a ``write`` method), the result will be written to it, otherwise it is returned as a string.
Lex ``code`` with ``lexer`` and format it with the formatter ``formatter``.
def highlight(code, lexer, formatter, outfile=None): """ Lex ``code`` with ``lexer`` and format it with the formatter ``formatter``. If ``outfile`` is given and a valid file object (an object with a ``write`` method), the result will be written to it, otherwise it is returned as a string. """ ...
[ "def", "highlight", "(", "code", ",", "lexer", ",", "formatter", ",", "outfile", "=", "None", ")", ":", "return", "format", "(", "lex", "(", "code", ",", "lexer", ")", ",", "formatter", ",", "outfile", ")" ]
[ 78, 0 ]
[ 86, 55 ]
python
en
['en', 'error', 'th']
False
location
(mod_name)
Return the file and directory that the code for *mod_name* is in.
Return the file and directory that the code for *mod_name* is in.
def location(mod_name): """ Return the file and directory that the code for *mod_name* is in. """ source = mod_name.endswith("pyc") and mod_name[:-1] or mod_name source = os.path.abspath(source) return source, os.path.dirname(source)
[ "def", "location", "(", "mod_name", ")", ":", "source", "=", "mod_name", ".", "endswith", "(", "\"pyc\"", ")", "and", "mod_name", "[", ":", "-", "1", "]", "or", "mod_name", "source", "=", "os", ".", "path", ".", "abspath", "(", "source", ")", "return...
[ 10, 0 ]
[ 16, 42 ]
python
en
['en', 'error', 'th']
False
load_mpi_test
(file_path, seq, baseline_normalize)
Usage: Load a section once :param dataset_root: root path :param section: There are six sequences in this (seq=0,1,2,3,4,5). And 2935 poses in a unique set(seq==7). If you want to evaluate by scene setting, you can use the sequencewise evaluation to convert to these numbers by doing #1:Studio w...
Usage: Load a section once :param dataset_root: root path :param section: There are six sequences in this (seq=0,1,2,3,4,5). And 2935 poses in a unique set(seq==7). If you want to evaluate by scene setting, you can use the sequencewise evaluation to convert to these numbers by doing #1:Studio w...
def load_mpi_test(file_path, seq, baseline_normalize): """ Usage: Load a section once :param dataset_root: root path :param section: There are six sequences in this (seq=0,1,2,3,4,5). And 2935 poses in a unique set(seq==7). If you want to evaluate by scene setting, you can use the sequencewise evalu...
[ "def", "load_mpi_test", "(", "file_path", ",", "seq", ",", "baseline_normalize", ")", ":", "info", "=", "np", ".", "load", "(", "file_path", ",", "allow_pickle", "=", "True", ")", "if", "seq", "in", "range", "(", "0", ",", "6", ")", ":", "pose_3d", "...
[ 3, 0 ]
[ 43, 49 ]
python
en
['en', 'error', 'th']
False
ApplicationManager.generate_application_string
(cls, test)
Generate an application string based on some of the given information that can be pulled from the test object: app_env, start_time.
Generate an application string based on some of the given information that can be pulled from the test object: app_env, start_time.
def generate_application_string(cls, test): """ Generate an application string based on some of the given information that can be pulled from the test object: app_env, start_time. """ app_env = 'test' if hasattr(test, 'env'): app_env = test.env elif hasattr(test,...
[ "def", "generate_application_string", "(", "cls", ",", "test", ")", ":", "app_env", "=", "'test'", "if", "hasattr", "(", "test", ",", "'env'", ")", ":", "app_env", "=", "test", ".", "env", "elif", "hasattr", "(", "test", ",", "'environment'", ")", ":", ...
[ 13, 4 ]
[ 25, 46 ]
python
en
['en', 'en', 'en']
True
xarray_concat_and_merge
(*args, concat_dim='time', sort_dim='time')
Given parameters that are each a list of `xarray.Dataset` objects, merge each list into an `xarray.Dataset` object and return all such objects in the same order. Parameters ---------- *args: list of lists of `xarray.Dataset`. A list of lists of `xarray.Dataset` objects to merge. conca...
Given parameters that are each a list of `xarray.Dataset` objects, merge each list into an `xarray.Dataset` object and return all such objects in the same order.
def xarray_concat_and_merge(*args, concat_dim='time', sort_dim='time'): """ Given parameters that are each a list of `xarray.Dataset` objects, merge each list into an `xarray.Dataset` object and return all such objects in the same order. Parameters ---------- *args: list of lists of `xarray.Da...
[ "def", "xarray_concat_and_merge", "(", "*", "args", ",", "concat_dim", "=", "'time'", ",", "sort_dim", "=", "'time'", ")", ":", "merged", "=", "[", "]", "for", "i", ",", "arg", "in", "enumerate", "(", "args", ")", ":", "current_concat_dim", "=", "concat_...
[ 14, 0 ]
[ 39, 17 ]
python
en
['en', 'error', 'th']
False
merge_datasets
(datasets_temp, clean_masks_temp, masks_per_platform=None, x_coord='longitude', y_coord='latitude')
Merges dictionaries of platforms mapping to datasets, dataset clean masks, and lists of other masks into one dataset, one dataset clean mask, and one of each type of other mask, ordering all by time. Parameters ---------- datasets_temp, clean_masks_temp, masks_per_platform: dict Dictio...
Merges dictionaries of platforms mapping to datasets, dataset clean masks, and lists of other masks into one dataset, one dataset clean mask, and one of each type of other mask, ordering all by time.
def merge_datasets(datasets_temp, clean_masks_temp, masks_per_platform=None, x_coord='longitude', y_coord='latitude'): """ Merges dictionaries of platforms mapping to datasets, dataset clean masks, and lists of other masks into one dataset, one dataset clean mask, and one of each type...
[ "def", "merge_datasets", "(", "datasets_temp", ",", "clean_masks_temp", ",", "masks_per_platform", "=", "None", ",", "x_coord", "=", "'longitude'", ",", "y_coord", "=", "'latitude'", ")", ":", "def", "xr_set_same_coords", "(", "datasets", ")", ":", "first_ds", "...
[ 41, 0 ]
[ 112, 37 ]
python
en
['en', 'error', 'th']
False
load_simple
(dc, platform, product, frac_res=None, abs_res=None, load_params={}, masking_params={}, indiv_masks=None)
Simplifies loading from the Data Cube by retrieving a dataset along with its mask. Parameters ---------- dc: datacube.api.core.Datacube The Datacube instance to load data with. platform, product: str Strings denoting the platform and product to retrieve data for. frac_res: ...
Simplifies loading from the Data Cube by retrieving a dataset along with its mask.
def load_simple(dc, platform, product, frac_res=None, abs_res=None, load_params={}, masking_params={}, indiv_masks=None): """ Simplifies loading from the Data Cube by retrieving a dataset along with its mask. Parameters ---------- dc: datacube.api.core.Datacube The Datac...
[ "def", "load_simple", "(", "dc", ",", "platform", ",", "product", ",", "frac_res", "=", "None", ",", "abs_res", "=", "None", ",", "load_params", "=", "{", "}", ",", "masking_params", "=", "{", "}", ",", "indiv_masks", "=", "None", ")", ":", "current_lo...
[ 114, 0 ]
[ 185, 37 ]
python
en
['en', 'error', 'th']
False
load_multiplatform
(dc, platforms, products, frac_res=None, abs_res=None, load_params={}, masking_params={}, indiv_masks=None)
Load and merge data as well as clean masks given a list of platforms and products. Currently only tested on Landsat data. Parameters ---------- dc: datacube.api.core.Datacube The Datacube instance to load data with. platforms, products: list-like A list-like of platforms an...
Load and merge data as well as clean masks given a list of platforms and products. Currently only tested on Landsat data. Parameters ---------- dc: datacube.api.core.Datacube The Datacube instance to load data with. platforms, products: list-like A list-like of platforms an...
def load_multiplatform(dc, platforms, products, frac_res=None, abs_res=None, load_params={}, masking_params={}, indiv_masks=None): """ Load and merge data as well as clean masks given a list of platforms and products. Currently only tested on Landsat data. Parameters ----...
[ "def", "load_multiplatform", "(", "dc", ",", "platforms", ",", "products", ",", "frac_res", "=", "None", ",", "abs_res", "=", "None", ",", "load_params", "=", "{", "}", ",", "masking_params", "=", "{", "}", ",", "indiv_masks", "=", "None", ")", ":", "#...
[ 187, 0 ]
[ 326, 78 ]
python
en
['en', 'error', 'th']
False
get_product_extents
(api, platform, product)
Returns the minimum and maximum latitude, longitude, and date range of a product. Parameters ---------- api: DataAccessApi An instance of `DataAccessApi` to get query metadata from. platform, product: str Names of the platform and product to query extent information for. Retur...
Returns the minimum and maximum latitude, longitude, and date range of a product.
def get_product_extents(api, platform, product): """ Returns the minimum and maximum latitude, longitude, and date range of a product. Parameters ---------- api: DataAccessApi An instance of `DataAccessApi` to get query metadata from. platform, product: str Names of the platform...
[ "def", "get_product_extents", "(", "api", ",", "platform", ",", "product", ")", ":", "# Get the extents of the cube", "descriptor", "=", "api", ".", "get_query_metadata", "(", "platform", "=", "platform", ",", "product", "=", "product", ",", "measurements", "=", ...
[ 328, 0 ]
[ 351, 50 ]
python
en
['en', 'error', 'th']
False
get_overlapping_area
(api, platforms, products)
Returns the minimum and maximum latitude, longitude, and date range of the overlapping area for a set of products. Parameters ---------- api: DataAccessApi An instance of `DataAccessApi` to get query metadata from. platforms, products: list-like of str A list-like of names ...
Returns the minimum and maximum latitude, longitude, and date range of the overlapping area for a set of products. Parameters ---------- api: DataAccessApi An instance of `DataAccessApi` to get query metadata from. platforms, products: list-like of str A list-like of names ...
def get_overlapping_area(api, platforms, products): """ Returns the minimum and maximum latitude, longitude, and date range of the overlapping area for a set of products. Parameters ---------- api: DataAccessApi An instance of `DataAccessApi` to get query metadata from. platform...
[ "def", "get_overlapping_area", "(", "api", ",", "platforms", ",", "products", ")", ":", "min_max_dates", "=", "np", ".", "empty", "(", "(", "len", "(", "platforms", ")", ",", "2", ")", ",", "dtype", "=", "object", ")", "min_max_lat", "=", "np", ".", ...
[ 353, 0 ]
[ 386, 44 ]
python
en
['en', 'error', 'th']
False
xml_generators.__init__
(self, logger, gccxml_cvs_revision=None, castxml_format=None)
Create a new xml_generators object. Args: logger (logging.Logger) : a logger for debugging output gccxml_cvs_revision (str|None): the xml output version castxml_format (str|None): the xml output version
Create a new xml_generators object.
def __init__(self, logger, gccxml_cvs_revision=None, castxml_format=None): """ Create a new xml_generators object. Args: logger (logging.Logger) : a logger for debugging output gccxml_cvs_revision (str|None): the xml output version castxml_format (str|None): ...
[ "def", "__init__", "(", "self", ",", "logger", ",", "gccxml_cvs_revision", "=", "None", ",", "castxml_format", "=", "None", ")", ":", "if", "castxml_format", "is", "not", "None", "and", "gccxml_cvs_revision", "is", "not", "None", ":", "raise", "RuntimeError", ...
[ 18, 4 ]
[ 48, 53 ]
python
en
['en', 'error', 'th']
False
xml_generators.get_string_repr
(self)
Get a string identifier for the current type of xml generator Returns: str: identifier
Get a string identifier for the current type of xml generator
def get_string_repr(self): """ Get a string identifier for the current type of xml generator Returns: str: identifier """ return \ self._xml_generator_version + \ self.__separator + \ str(self._xml_output_version)
[ "def", "get_string_repr", "(", "self", ")", ":", "return", "self", ".", "_xml_generator_version", "+", "self", ".", "__separator", "+", "str", "(", "self", ".", "_xml_output_version", ")" ]
[ 79, 4 ]
[ 89, 41 ]
python
en
['en', 'error', 'th']
False
xml_generators.is_gccxml
(self)
Is the current xml generator gccxml? Returns: bool: is gccxml being used?
Is the current xml generator gccxml?
def is_gccxml(self): """ Is the current xml generator gccxml? Returns: bool: is gccxml being used? """ return self._is_gccxml
[ "def", "is_gccxml", "(", "self", ")", ":", "return", "self", ".", "_is_gccxml" ]
[ 92, 4 ]
[ 99, 30 ]
python
en
['en', 'error', 'th']
False
xml_generators.is_castxml
(self)
Is the current xml generator castxml? Returns: bool: is castxml being used?
Is the current xml generator castxml?
def is_castxml(self): """ Is the current xml generator castxml? Returns: bool: is castxml being used? """ return self._is_castxml
[ "def", "is_castxml", "(", "self", ")", ":", "return", "self", ".", "_is_castxml" ]
[ 102, 4 ]
[ 109, 31 ]
python
en
['en', 'error', 'th']
False
xml_generators.is_castxml1
(self)
Is the current xml generator castxml (with output format version 1)? Returns: bool: is castxml (with output format version 1) being used?
Is the current xml generator castxml (with output format version 1)?
def is_castxml1(self): """ Is the current xml generator castxml (with output format version 1)? Returns: bool: is castxml (with output format version 1) being used? """ return self._is_castxml1
[ "def", "is_castxml1", "(", "self", ")", ":", "return", "self", ".", "_is_castxml1" ]
[ 112, 4 ]
[ 119, 32 ]
python
en
['en', 'error', 'th']
False
xml_generators.is_gccxml_06
(self)
Is the current xml generator gccxml (version 0.6)? Returns: bool: is gccxml 0.6 being used?
Is the current xml generator gccxml (version 0.6)?
def is_gccxml_06(self): """ Is the current xml generator gccxml (version 0.6)? Returns: bool: is gccxml 0.6 being used? """ return self._xml_generator_version == self.__gccxml_06
[ "def", "is_gccxml_06", "(", "self", ")", ":", "return", "self", ".", "_xml_generator_version", "==", "self", ".", "__gccxml_06" ]
[ 122, 4 ]
[ 129, 62 ]
python
en
['en', 'error', 'th']
False
xml_generators.is_gccxml_07
(self)
Is the current xml generator gccxml (version 0.7)? Returns: bool: is gccxml 0.7 being used?
Is the current xml generator gccxml (version 0.7)?
def is_gccxml_07(self): """ Is the current xml generator gccxml (version 0.7)? Returns: bool: is gccxml 0.7 being used? """ return self._xml_generator_version == self.__gccxml_07
[ "def", "is_gccxml_07", "(", "self", ")", ":", "return", "self", ".", "_xml_generator_version", "==", "self", ".", "__gccxml_07" ]
[ 132, 4 ]
[ 139, 62 ]
python
en
['en', 'error', 'th']
False
xml_generators.is_gccxml_09
(self)
Is the current xml generator gccxml (version 0.9)? Returns: bool: is gccxml 0.9 being used?
Is the current xml generator gccxml (version 0.9)?
def is_gccxml_09(self): """ Is the current xml generator gccxml (version 0.9)? Returns: bool: is gccxml 0.9 being used? """ return self._xml_generator_version == self.__gccxml_09
[ "def", "is_gccxml_09", "(", "self", ")", ":", "return", "self", ".", "_xml_generator_version", "==", "self", ".", "__gccxml_09" ]
[ 142, 4 ]
[ 149, 62 ]
python
en
['en', 'error', 'th']
False
xml_generators.is_gccxml_09_buggy
(self)
Is the current xml generator gccxml (version 0.9 - buggy)? Returns: bool: is gccxml 0.9 (buggy) being used?
Is the current xml generator gccxml (version 0.9 - buggy)?
def is_gccxml_09_buggy(self): """ Is the current xml generator gccxml (version 0.9 - buggy)? Returns: bool: is gccxml 0.9 (buggy) being used? """ return self._xml_generator_version == self.__gccxml_09_buggy
[ "def", "is_gccxml_09_buggy", "(", "self", ")", ":", "return", "self", ".", "_xml_generator_version", "==", "self", ".", "__gccxml_09_buggy" ]
[ 152, 4 ]
[ 159, 68 ]
python
en
['en', 'error', 'th']
False
xml_generators.xml_output_version
(self)
The current xml output version for the parsed file. Returns: str: the xml output version
The current xml output version for the parsed file.
def xml_output_version(self): """ The current xml output version for the parsed file. Returns: str: the xml output version """ return self._xml_output_version
[ "def", "xml_output_version", "(", "self", ")", ":", "return", "self", ".", "_xml_output_version" ]
[ 162, 4 ]
[ 169, 39 ]
python
en
['en', 'error', 'th']
False
apply_filters
(stream, filters, lexer=None)
Use this method to apply an iterable of filters to a stream. If lexer is given it's forwarded to the filter, otherwise the filter receives `None`.
Use this method to apply an iterable of filters to a stream. If lexer is given it's forwarded to the filter, otherwise the filter receives `None`.
def apply_filters(stream, filters, lexer=None): """ Use this method to apply an iterable of filters to a stream. If lexer is given it's forwarded to the filter, otherwise the filter receives `None`. """ def _apply(filter_, stream): for token in filter_.filter(lexer, stream): ...
[ "def", "apply_filters", "(", "stream", ",", "filters", ",", "lexer", "=", "None", ")", ":", "def", "_apply", "(", "filter_", ",", "stream", ")", ":", "for", "token", "in", "filter_", ".", "filter", "(", "lexer", ",", "stream", ")", ":", "yield", "tok...
[ 12, 0 ]
[ 23, 17 ]
python
en
['en', 'error', 'th']
False
simplefilter
(f)
Decorator that converts a function into a filter:: @simplefilter def lowercase(self, lexer, stream, options): for ttype, value in stream: yield ttype, value.lower()
Decorator that converts a function into a filter::
def simplefilter(f): """ Decorator that converts a function into a filter:: @simplefilter def lowercase(self, lexer, stream, options): for ttype, value in stream: yield ttype, value.lower() """ return type(f.__name__, (FunctionFilter,), { 'fun...
[ "def", "simplefilter", "(", "f", ")", ":", "return", "type", "(", "f", ".", "__name__", ",", "(", "FunctionFilter", ",", ")", ",", "{", "'function'", ":", "f", ",", "'__module__'", ":", "getattr", "(", "f", ",", "'__module__'", ")", ",", "'__doc__'", ...
[ 26, 0 ]
[ 39, 14 ]
python
en
['en', 'error', 'th']
False
non_numeric_low_card_dataset
(test_backend)
Provide dataset fixtures that have special values and/or are otherwise useful outside the standard json testing framework
Provide dataset fixtures that have special values and/or are otherwise useful outside the standard json testing framework
def non_numeric_low_card_dataset(test_backend): """Provide dataset fixtures that have special values and/or are otherwise useful outside the standard json testing framework""" data = { "lowcardnonnum": [ "a", "b", "b", "b", "b", ...
[ "def", "non_numeric_low_card_dataset", "(", "test_backend", ")", ":", "data", "=", "{", "\"lowcardnonnum\"", ":", "[", "\"a\"", ",", "\"b\"", ",", "\"b\"", ",", "\"b\"", ",", "\"b\"", ",", "\"b\"", ",", "\"b\"", ",", "\"b\"", ",", "\"b\"", ",", "\"b\"", ...
[ 1367, 0 ]
[ 1500, 59 ]
python
en
['en', 'en', 'en']
True
non_numeric_high_card_dataset
(test_backend)
Provide dataset fixtures that have special values and/or are otherwise useful outside the standard json testing framework
Provide dataset fixtures that have special values and/or are otherwise useful outside the standard json testing framework
def non_numeric_high_card_dataset(test_backend): """Provide dataset fixtures that have special values and/or are otherwise useful outside the standard json testing framework""" data = { "highcardnonnum": [ "CZVYSnQhHhoti8mQ66XbDuIjE5FMeIHb", "cPWAg2MJjh8fkRRU1B9aD8vWq3P8KTxJ...
[ "def", "non_numeric_high_card_dataset", "(", "test_backend", ")", ":", "data", "=", "{", "\"highcardnonnum\"", ":", "[", "\"CZVYSnQhHhoti8mQ66XbDuIjE5FMeIHb\"", ",", "\"cPWAg2MJjh8fkRRU1B9aD8vWq3P8KTxJ\"", ",", "\"4tehKwWiCDpuOmTPRYYqTqM7TvEa8Zi7\"", ",", "\"ZvlAnCGiGfkKgQoNrhnny...
[ 1504, 0 ]
[ 1946, 59 ]
python
en
['en', 'en', 'en']
True
dataset
(test_backend)
Provide dataset fixtures that have special values and/or are otherwise useful outside the standard json testing framework
Provide dataset fixtures that have special values and/or are otherwise useful outside the standard json testing framework
def dataset(test_backend): """Provide dataset fixtures that have special values and/or are otherwise useful outside the standard json testing framework""" data, schemas = dataset_sample_data(test_backend) return get_dataset(test_backend, data, schemas=schemas)
[ "def", "dataset", "(", "test_backend", ")", ":", "data", ",", "schemas", "=", "dataset_sample_data", "(", "test_backend", ")", "return", "get_dataset", "(", "test_backend", ",", "data", ",", "schemas", "=", "schemas", ")" ]
[ 2108, 0 ]
[ 2112, 59 ]
python
en
['en', 'en', 'en']
True