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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
select_datasource | (
context: DataContext, datasource_name: str = None
) | Select a datasource interactively. | Select a datasource interactively. | def select_datasource(
context: DataContext, datasource_name: str = None
) -> BaseDatasource:
"""Select a datasource interactively."""
# TODO consolidate all the myriad CLI tests into this
data_source: Optional[BaseDatasource] = None
if datasource_name is None:
data_sources: List[BaseDataso... | [
"def",
"select_datasource",
"(",
"context",
":",
"DataContext",
",",
"datasource_name",
":",
"str",
"=",
"None",
")",
"->",
"BaseDatasource",
":",
"# TODO consolidate all the myriad CLI tests into this",
"data_source",
":",
"Optional",
"[",
"BaseDatasource",
"]",
"=",
... | [
365,
0
] | [
404,
22
] | python | en | ['en', 'en', 'en'] | True |
load_data_context_with_error_handling | (
directory: str, from_cli_upgrade_command: bool = False
) | Return a DataContext with good error handling and exit codes. | Return a DataContext with good error handling and exit codes. | def load_data_context_with_error_handling(
directory: str, from_cli_upgrade_command: bool = False
) -> DataContext:
"""Return a DataContext with good error handling and exit codes."""
try:
context: DataContext = DataContext(context_root_dir=directory)
if from_cli_upgrade_command:
... | [
"def",
"load_data_context_with_error_handling",
"(",
"directory",
":",
"str",
",",
"from_cli_upgrade_command",
":",
"bool",
"=",
"False",
")",
"->",
"DataContext",
":",
"try",
":",
"context",
":",
"DataContext",
"=",
"DataContext",
"(",
"context_root_dir",
"=",
"d... | [
407,
0
] | [
480,
19
] | python | en | ['en', 'en', 'en'] | True |
confirm_proceed_or_exit | (
confirm_prompt: str = "Would you like to proceed?",
continuation_message: str = "Ok, exiting now. You can always read more at https://docs.greatexpectations.io/ !",
exit_on_no: bool = True,
exit_code: int = 0,
data_context: Optional[DataContext] = None,
usage_stats_event: Optional[str] = None,... |
Every CLI command that starts a potentially lengthy (>1 sec) computation
or modifies some resources (e.g., edits the config file, adds objects
to the stores) must follow this pattern:
1. Explain which resources will be created/modified/deleted
2. Use this method to ask for user's confirmation
... |
Every CLI command that starts a potentially lengthy (>1 sec) computation
or modifies some resources (e.g., edits the config file, adds objects
to the stores) must follow this pattern:
1. Explain which resources will be created/modified/deleted
2. Use this method to ask for user's confirmation | def confirm_proceed_or_exit(
confirm_prompt: str = "Would you like to proceed?",
continuation_message: str = "Ok, exiting now. You can always read more at https://docs.greatexpectations.io/ !",
exit_on_no: bool = True,
exit_code: int = 0,
data_context: Optional[DataContext] = None,
usage_stats_e... | [
"def",
"confirm_proceed_or_exit",
"(",
"confirm_prompt",
":",
"str",
"=",
"\"Would you like to proceed?\"",
",",
"continuation_message",
":",
"str",
"=",
"\"Ok, exiting now. You can always read more at https://docs.greatexpectations.io/ !\"",
",",
"exit_on_no",
":",
"bool",
"=",
... | [
633,
0
] | [
675,
15
] | python | en | ['en', 'error', 'th'] | False |
parse_cli_config_file_location | (config_file_location: str) |
Parse CLI yaml config file or directory location into directory and filename.
Uses pathlib to handle windows paths.
Args:
config_file_location: string of config_file_location
Returns:
{
"directory": "directory/where/config/file/is/located",
"filename": "great_ex... |
Parse CLI yaml config file or directory location into directory and filename.
Uses pathlib to handle windows paths.
Args:
config_file_location: string of config_file_location | def parse_cli_config_file_location(config_file_location: str) -> dict:
"""
Parse CLI yaml config file or directory location into directory and filename.
Uses pathlib to handle windows paths.
Args:
config_file_location: string of config_file_location
Returns:
{
"directory... | [
"def",
"parse_cli_config_file_location",
"(",
"config_file_location",
":",
"str",
")",
"->",
"dict",
":",
"if",
"config_file_location",
"is",
"not",
"None",
"and",
"config_file_location",
"!=",
"\"\"",
":",
"config_file_location_path",
"=",
"Path",
"(",
"config_file_l... | [
678,
0
] | [
713,
57
] | python | en | ['en', 'error', 'th'] | False |
is_cloud_file_url | (file_path: str) | Check for commonly used cloud urls. | Check for commonly used cloud urls. | def is_cloud_file_url(file_path: str) -> bool:
"""Check for commonly used cloud urls."""
sanitized = file_path.strip()
if sanitized[0:7] == "file://":
return False
if (
sanitized[0:5] in ["s3://", "gs://"]
or sanitized[0:6] == "ftp://"
or sanitized[0:7] in ["http://", "wa... | [
"def",
"is_cloud_file_url",
"(",
"file_path",
":",
"str",
")",
"->",
"bool",
":",
"sanitized",
"=",
"file_path",
".",
"strip",
"(",
")",
"if",
"sanitized",
"[",
"0",
":",
"7",
"]",
"==",
"\"file://\"",
":",
"return",
"False",
"if",
"(",
"sanitized",
"[... | [
734,
0
] | [
746,
16
] | python | en | ['en', 'en', 'en'] | True |
get_relative_path_from_config_file_to_base_path | (
context_root_directory: str, data_path: str
) |
This function determines the relative path from a given data path relative
to the great_expectations.yml file independent of the current working
directory.
This allows a user to use the CLI from any directory, type a relative path
from their current working directory and have the correct relative ... |
This function determines the relative path from a given data path relative
to the great_expectations.yml file independent of the current working
directory. | def get_relative_path_from_config_file_to_base_path(
context_root_directory: str, data_path: str
) -> str:
"""
This function determines the relative path from a given data path relative
to the great_expectations.yml file independent of the current working
directory.
This allows a user to use th... | [
"def",
"get_relative_path_from_config_file_to_base_path",
"(",
"context_root_directory",
":",
"str",
",",
"data_path",
":",
"str",
")",
"->",
"str",
":",
"data_from_working_dir",
"=",
"os",
".",
"path",
".",
"relpath",
"(",
"data_path",
")",
"context_dir_from_working_... | [
749,
0
] | [
763,
79
] | python | en | ['en', 'error', 'th'] | False |
ValidationAction.run | (
self,
validation_result_suite,
validation_result_suite_identifier,
data_asset,
**kwargs,
) |
:param validation_result_suite:
:param validation_result_suite_identifier:
:param data_asset:
:param: kwargs - any additional arguments the child might use
:return:
| def run(
self,
validation_result_suite,
validation_result_suite_identifier,
data_asset,
**kwargs,
):
"""
:param validation_result_suite:
:param validation_result_suite_identifier:
:param data_asset:
:param: kwargs - any additional argu... | [
"def",
"run",
"(",
"self",
",",
"validation_result_suite",
",",
"validation_result_suite_identifier",
",",
"data_asset",
",",
"*",
"*",
"kwargs",
",",
")",
":",
"return",
"self",
".",
"_run",
"(",
"validation_result_suite",
",",
"validation_result_suite_identifier",
... | [
42,
4
] | [
62,
9
] | python | en | ['en', 'error', 'th'] | False | |
SlackNotificationAction.__init__ | (
self,
data_context,
renderer,
slack_webhook,
notify_on="all",
notify_with=None,
) | Construct a SlackNotificationAction
Args:
data_context:
renderer: dictionary specifying the renderer used to generate a query consumable by Slack API, for example:
{
"module_name": "great_expectations.render.renderer.slack_renderer",
... | Construct a SlackNotificationAction | def __init__(
self,
data_context,
renderer,
slack_webhook,
notify_on="all",
notify_with=None,
):
"""Construct a SlackNotificationAction
Args:
data_context:
renderer: dictionary specifying the renderer used to generate a query c... | [
"def",
"__init__",
"(",
"self",
",",
"data_context",
",",
"renderer",
",",
"slack_webhook",
",",
"notify_on",
"=",
"\"all\"",
",",
"notify_with",
"=",
"None",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"data_context",
")",
"self",
".",
"rend... | [
108,
4
] | [
145,
38
] | python | en | ['en', 'ca', 'en'] | True |
PagerdutyAlertAction.__init__ | (
self,
data_context,
api_key,
routing_key,
notify_on="failure",
) | Construct a PagerdutyAlertAction
Args:
data_context:
api_key: Events API v2 key for pagerduty.
routing_key: The 32 character Integration Key for an integration on a service or on a global ruleset.
notify_on: "all", "failure", "success" - specifies validation stat... | Construct a PagerdutyAlertAction | def __init__(
self,
data_context,
api_key,
routing_key,
notify_on="failure",
):
"""Construct a PagerdutyAlertAction
Args:
data_context:
api_key: Events API v2 key for pagerduty.
routing_key: The 32 character Integration Key... | [
"def",
"__init__",
"(",
"self",
",",
"data_context",
",",
"api_key",
",",
"routing_key",
",",
"notify_on",
"=",
"\"failure\"",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"data_context",
")",
"if",
"not",
"pypd",
":",
"raise",
"DataContextError... | [
215,
4
] | [
237,
34
] | python | en | ['en', 'lb', 'it'] | False |
MicrosoftTeamsNotificationAction.__init__ | (
self,
data_context,
renderer,
microsoft_teams_webhook,
notify_on="all",
) | Construct a MicrosoftTeamsNotificationAction
Args:
data_context:
renderer: dictionary specifying the renderer used to generate a query consumable by teams API, for example:
{
"module_name": "great_expectations.render.renderer.microsoft_teams_renderer",... | Construct a MicrosoftTeamsNotificationAction | def __init__(
self,
data_context,
renderer,
microsoft_teams_webhook,
notify_on="all",
):
"""Construct a MicrosoftTeamsNotificationAction
Args:
data_context:
renderer: dictionary specifying the renderer used to generate a query consumab... | [
"def",
"__init__",
"(",
"self",
",",
"data_context",
",",
"renderer",
",",
"microsoft_teams_webhook",
",",
"notify_on",
"=",
"\"all\"",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"data_context",
")",
"self",
".",
"renderer",
"=",
"instantiate_cl... | [
314,
4
] | [
351,
34
] | python | en | ['en', 'en', 'en'] | True |
OpsgenieAlertAction.__init__ | (
self,
data_context,
renderer,
api_key,
region=None,
priority="P3",
notify_on="failure",
) | Construct a OpsgenieAlertAction
Args:
data_context:
api_key: Opsgenie API key
region: specifies the Opsgenie region. Populate 'EU' for Europe otherwise do not set
priority: specify the priority of the alert (P1 - P5) defaults to P3
notify_on: "all", "... | Construct a OpsgenieAlertAction | def __init__(
self,
data_context,
renderer,
api_key,
region=None,
priority="P3",
notify_on="failure",
):
"""Construct a OpsgenieAlertAction
Args:
data_context:
api_key: Opsgenie API key
region: specifies the... | [
"def",
"__init__",
"(",
"self",
",",
"data_context",
",",
"renderer",
",",
"api_key",
",",
"region",
"=",
"None",
",",
"priority",
"=",
"\"P3\"",
",",
"notify_on",
"=",
"\"failure\"",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"data_context"... | [
423,
4
] | [
459,
34
] | python | en | ['en', 'lb', 'it'] | False |
EmailAction.__init__ | (
self,
data_context,
renderer,
smtp_address,
smtp_port,
sender_login,
sender_password,
receiver_emails,
sender_alias=None,
use_tls=None,
use_ssl=None,
notify_on="all",
notify_with=None,
) | Construct an EmailAction
Args:
data_context:
renderer: dictionary specifying the renderer used to generate an email, for example:
{
"module_name": "great_expectations.render.renderer.email_renderer",
"class_name": "EmailRenderer",
... | Construct an EmailAction
Args:
data_context:
renderer: dictionary specifying the renderer used to generate an email, for example:
{
"module_name": "great_expectations.render.renderer.email_renderer",
"class_name": "EmailRenderer",
... | def __init__(
self,
data_context,
renderer,
smtp_address,
smtp_port,
sender_login,
sender_password,
receiver_emails,
sender_alias=None,
use_tls=None,
use_ssl=None,
notify_on="all",
notify_with=None,
):
""... | [
"def",
"__init__",
"(",
"self",
",",
"data_context",
",",
"renderer",
",",
"smtp_address",
",",
"smtp_port",
",",
"sender_login",
",",
"sender_password",
",",
"receiver_emails",
",",
"sender_alias",
"=",
"None",
",",
"use_tls",
"=",
"None",
",",
"use_ssl",
"="... | [
540,
4
] | [
610,
38
] | python | en | ['en', 'en', 'en'] | True |
StoreValidationResultAction.__init__ | (
self,
data_context,
target_store_name=None,
) |
:param data_context: Data Context
:param target_store_name: the name of the param_store in the Data Context which
should be used to param_store the validation result
| def __init__(
self,
data_context,
target_store_name=None,
):
"""
:param data_context: Data Context
:param target_store_name: the name of the param_store in the Data Context which
should be used to param_store the validation result
"""
... | [
"def",
"__init__",
"(",
"self",
",",
"data_context",
",",
"target_store_name",
"=",
"None",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"data_context",
")",
"if",
"target_store_name",
"is",
"None",
":",
"self",
".",
"target_store",
"=",
"data_c... | [
687,
4
] | [
703,
70
] | python | en | ['en', 'error', 'th'] | False | |
StoreEvaluationParametersAction.__init__ | (self, data_context, target_store_name=None) |
Args:
data_context: Data Context
target_store_name: the name of the store in the Data Context which
should be used to store the evaluation parameters
| def __init__(self, data_context, target_store_name=None):
"""
Args:
data_context: Data Context
target_store_name: the name of the store in the Data Context which
should be used to store the evaluation parameters
"""
super().__init__(data_context)
... | [
"def",
"__init__",
"(",
"self",
",",
"data_context",
",",
"target_store_name",
"=",
"None",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"data_context",
")",
"if",
"target_store_name",
"is",
"None",
":",
"self",
".",
"target_store",
"=",
"data_context"... | [
752,
4
] | [
765,
70
] | python | en | ['en', 'error', 'th'] | False | |
StoreMetricsAction.__init__ | (
self, data_context, requested_metrics, target_store_name="metrics_store"
) |
Args:
data_context: Data Context
requested_metrics: dictionary of metrics to store. Dictionary should have the following structure:
expectation_suite_name:
metric_name:
- metric_kwargs_id
You may use "*" to d... | def __init__(
self, data_context, requested_metrics, target_store_name="metrics_store"
):
"""
Args:
data_context: Data Context
requested_metrics: dictionary of metrics to store. Dictionary should have the following structure:
expectation_suite_name:
... | [
"def",
"__init__",
"(",
"self",
",",
"data_context",
",",
"requested_metrics",
",",
"target_store_name",
"=",
"\"metrics_store\"",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"data_context",
")",
"self",
".",
"_requested_metrics",
"=",
"requested_metrics",
... | [
809,
4
] | [
840,
13
] | python | en | ['en', 'error', 'th'] | False | |
UpdateDataDocsAction.__init__ | (self, data_context, site_names=None, target_site_names=None) |
:param data_context: Data Context
:param site_names: *optional* List of site names for building data docs
|
:param data_context: Data Context
:param site_names: *optional* List of site names for building data docs
| def __init__(self, data_context, site_names=None, target_site_names=None):
"""
:param data_context: Data Context
:param site_names: *optional* List of site names for building data docs
"""
super().__init__(data_context)
if target_site_names:
warnings.warn(
... | [
"def",
"__init__",
"(",
"self",
",",
"data_context",
",",
"site_names",
"=",
"None",
",",
"target_site_names",
"=",
"None",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"data_context",
")",
"if",
"target_site_names",
":",
"warnings",
".",
"warn",
"("... | [
893,
4
] | [
910,
37
] | python | en | ['en', 'error', 'th'] | False |
test_parse_cli_config_file_location_posix_paths | (tmp_path_factory) |
What does this test and why?
We want to parse posix paths into their directory and filename parts
so that we can pass the directory to our data context constructor.
We need to be able to do that with all versions of path that can be input.
This tests for posix paths for files/dirs that don't exist ... |
What does this test and why?
We want to parse posix paths into their directory and filename parts
so that we can pass the directory to our data context constructor.
We need to be able to do that with all versions of path that can be input.
This tests for posix paths for files/dirs that don't exist ... | def test_parse_cli_config_file_location_posix_paths(tmp_path_factory):
"""
What does this test and why?
We want to parse posix paths into their directory and filename parts
so that we can pass the directory to our data context constructor.
We need to be able to do that with all versions of path that... | [
"def",
"test_parse_cli_config_file_location_posix_paths",
"(",
"tmp_path_factory",
")",
":",
"filename_fixtures",
"=",
"[",
"{",
"\"input_path\"",
":",
"\"just_a_file.yml\"",
",",
"\"expected\"",
":",
"{",
"\"directory\"",
":",
"\"\"",
",",
"\"filename\"",
":",
"\"just_... | [
46,
0
] | [
142,
17
] | python | en | ['en', 'error', 'th'] | False |
test_parse_cli_config_file_location_windows_paths | (tmp_path_factory) |
What does this test and why?
Since we are unable to test windows paths on our unix CI, this just
tests that if a file doesn't exist we raise an error.
Args:
tmp_path_factory:
Returns:
|
What does this test and why?
Since we are unable to test windows paths on our unix CI, this just
tests that if a file doesn't exist we raise an error.
Args:
tmp_path_factory:
Returns:
| def test_parse_cli_config_file_location_windows_paths(tmp_path_factory):
"""
What does this test and why?
Since we are unable to test windows paths on our unix CI, this just
tests that if a file doesn't exist we raise an error.
Args:
tmp_path_factory:
Returns:
"""
filename_fixtu... | [
"def",
"test_parse_cli_config_file_location_windows_paths",
"(",
"tmp_path_factory",
")",
":",
"filename_fixtures",
"=",
"[",
"{",
"\"input_path\"",
":",
"\"just_a_file.yml\"",
",",
"\"expected\"",
":",
"{",
"\"directory\"",
":",
"\"\"",
",",
"\"filename\"",
":",
"\"jus... | [
233,
0
] | [
303,
73
] | python | en | ['en', 'error', 'th'] | False |
simulated_project_directories | (tmp_path_factory) |
Using a wacky simulated directory structure allows testing of permutations
of relative, absolute, and current working directories.
/random/pytest/dir/projects/pipeline1/great_expectations
/random/pytest/dir/projects/data/pipeline1
|
Using a wacky simulated directory structure allows testing of permutations
of relative, absolute, and current working directories. | def simulated_project_directories(tmp_path_factory):
"""
Using a wacky simulated directory structure allows testing of permutations
of relative, absolute, and current working directories.
/random/pytest/dir/projects/pipeline1/great_expectations
/random/pytest/dir/projects/data/pipeline1
"""
... | [
"def",
"simulated_project_directories",
"(",
"tmp_path_factory",
")",
":",
"test_dir",
"=",
"tmp_path_factory",
".",
"mktemp",
"(",
"\"projects\"",
",",
"numbered",
"=",
"False",
")",
"assert",
"os",
".",
"path",
".",
"isabs",
"(",
"test_dir",
")",
"ge_dir",
"... | [
351,
0
] | [
371,
27
] | python | en | ['en', 'error', 'th'] | False |
test_get_relative_path_from_config_file_to_data_base_file_path_from_within_ge_directory_and_relative_data_path | (
monkeypatch, simulated_project_directories
) |
This test simulates using the CLI from within the great_expectations
directory.
/projects/pipeline1/great_expectations
/projects/data/pipeline1
cwd: /projects/pipeline1/great_expectations
data: ../../data/pipeline1
expected results in yaml: ../../data/pipeline1
|
This test simulates using the CLI from within the great_expectations
directory. | def test_get_relative_path_from_config_file_to_data_base_file_path_from_within_ge_directory_and_relative_data_path(
monkeypatch, simulated_project_directories
):
"""
This test simulates using the CLI from within the great_expectations
directory.
/projects/pipeline1/great_expectations
/projects/... | [
"def",
"test_get_relative_path_from_config_file_to_data_base_file_path_from_within_ge_directory_and_relative_data_path",
"(",
"monkeypatch",
",",
"simulated_project_directories",
")",
":",
"ge_dir",
",",
"data_dir",
"=",
"simulated_project_directories",
"monkeypatch",
".",
"chdir",
"... | [
374,
0
] | [
395,
63
] | python | en | ['en', 'error', 'th'] | False |
test_get_relative_path_from_config_file_to_data_base_file_path_from_within_ge_directory_and_absolute_data_path | (
monkeypatch, simulated_project_directories
) |
This test simulates using the CLI from within the great_expectations
directory and using an absolute path.
/projects/pipeline1/great_expectations
/projects/data/pipeline1
cwd: /projects/pipeline1/great_expectations
data: /projects/data/pipeline1
expected results in yaml: ../../data/pipeli... |
This test simulates using the CLI from within the great_expectations
directory and using an absolute path. | def test_get_relative_path_from_config_file_to_data_base_file_path_from_within_ge_directory_and_absolute_data_path(
monkeypatch, simulated_project_directories
):
"""
This test simulates using the CLI from within the great_expectations
directory and using an absolute path.
/projects/pipeline1/great_... | [
"def",
"test_get_relative_path_from_config_file_to_data_base_file_path_from_within_ge_directory_and_absolute_data_path",
"(",
"monkeypatch",
",",
"simulated_project_directories",
")",
":",
"ge_dir",
",",
"data_dir",
"=",
"simulated_project_directories",
"monkeypatch",
".",
"chdir",
"... | [
398,
0
] | [
418,
63
] | python | en | ['en', 'error', 'th'] | False |
test_get_relative_path_from_config_file_to_data_base_file_path_from_adjacent_directory_and_relative_data_path | (
monkeypatch, simulated_project_directories
) |
This test simulates using the CLI from a directory containing the
great_expectations directory.
/projects/pipeline1/great_expectations
/projects/data/pipeline1
cwd: /projects/pipeline1
data: ../data/pipeline1
expected results in yaml: ../../data/pipeline1
|
This test simulates using the CLI from a directory containing the
great_expectations directory. | def test_get_relative_path_from_config_file_to_data_base_file_path_from_adjacent_directory_and_relative_data_path(
monkeypatch, simulated_project_directories
):
"""
This test simulates using the CLI from a directory containing the
great_expectations directory.
/projects/pipeline1/great_expectations... | [
"def",
"test_get_relative_path_from_config_file_to_data_base_file_path_from_adjacent_directory_and_relative_data_path",
"(",
"monkeypatch",
",",
"simulated_project_directories",
")",
":",
"ge_dir",
",",
"data_dir",
"=",
"simulated_project_directories",
"adjacent_dir",
"=",
"os",
".",... | [
421,
0
] | [
443,
63
] | python | en | ['en', 'error', 'th'] | False |
test_get_relative_path_from_config_file_to_data_base_file_path_from_adjacent_directory_and_absolute_data_path | (
monkeypatch, simulated_project_directories
) |
This test simulates using the CLI from a directory containing the
great_expectations directory and using an absolute path.
/projects/pipeline1/great_expectations
/projects/data/pipeline1
cwd: /projects/pipeline1
data: /projects/data/pipeline1
expected results in yaml: ../../data/pipeline1... |
This test simulates using the CLI from a directory containing the
great_expectations directory and using an absolute path. | def test_get_relative_path_from_config_file_to_data_base_file_path_from_adjacent_directory_and_absolute_data_path(
monkeypatch, simulated_project_directories
):
"""
This test simulates using the CLI from a directory containing the
great_expectations directory and using an absolute path.
/projects/p... | [
"def",
"test_get_relative_path_from_config_file_to_data_base_file_path_from_adjacent_directory_and_absolute_data_path",
"(",
"monkeypatch",
",",
"simulated_project_directories",
")",
":",
"ge_dir",
",",
"data_dir",
"=",
"simulated_project_directories",
"adjacent_dir",
"=",
"os",
".",... | [
446,
0
] | [
467,
63
] | python | en | ['en', 'error', 'th'] | False |
test_get_relative_path_from_config_file_to_data_base_file_path_from_misc_directory_and_relative_data_path | (
monkeypatch, misc_directory, simulated_project_directories
) |
This test simulates using the CLI with the --config flag operating from a
random directory
/projects/pipeline1/great_expectations
/projects/data/pipeline1
/tmp_path/misc
cwd: /tmp_path/random
data: ../../projects/data/pipeline1
expected results in yaml: ../../data/pipeline1
|
This test simulates using the CLI with the --config flag operating from a
random directory | def test_get_relative_path_from_config_file_to_data_base_file_path_from_misc_directory_and_relative_data_path(
monkeypatch, misc_directory, simulated_project_directories
):
"""
This test simulates using the CLI with the --config flag operating from a
random directory
/projects/pipeline1/great_expec... | [
"def",
"test_get_relative_path_from_config_file_to_data_base_file_path_from_misc_directory_and_relative_data_path",
"(",
"monkeypatch",
",",
"misc_directory",
",",
"simulated_project_directories",
")",
":",
"ge_dir",
",",
"data_dir",
"=",
"simulated_project_directories",
"monkeypatch",... | [
470,
0
] | [
492,
63
] | python | en | ['en', 'error', 'th'] | False |
test_get_relative_path_from_config_file_to_data_base_file_path_from_misc_directory_and_absolute_data_path | (
monkeypatch, misc_directory, simulated_project_directories
) |
This test simulates using the CLI with the --config flag operating from a
random directory and using an absolute path.
/projects/pipeline1/great_expectations
/projects/data/pipeline1
/tmp_path/misc
cwd: /tmp_path/misc
data: /projects/data/pipeline1
expected results in yaml: ../../data... |
This test simulates using the CLI with the --config flag operating from a
random directory and using an absolute path. | def test_get_relative_path_from_config_file_to_data_base_file_path_from_misc_directory_and_absolute_data_path(
monkeypatch, misc_directory, simulated_project_directories
):
"""
This test simulates using the CLI with the --config flag operating from a
random directory and using an absolute path.
/pr... | [
"def",
"test_get_relative_path_from_config_file_to_data_base_file_path_from_misc_directory_and_absolute_data_path",
"(",
"monkeypatch",
",",
"misc_directory",
",",
"simulated_project_directories",
")",
":",
"ge_dir",
",",
"data_dir",
"=",
"simulated_project_directories",
"monkeypatch",... | [
495,
0
] | [
518,
63
] | python | en | ['en', 'error', 'th'] | False |
NDWI | (data, normalize=False, band_pair=0) |
Computes various versions of the Normalized Difference Water Index for an `xarray.Dataset`.
Values should be in the range [-1,1] for valid LANDSAT data (the bands are positive).
Parameters
----------
data: xarray.Dataset or numpy.ndarray
An `xarray.Dataset` containing the bands specifi... |
Computes various versions of the Normalized Difference Water Index for an `xarray.Dataset`.
Values should be in the range [-1,1] for valid LANDSAT data (the bands are positive).
Parameters
----------
data: xarray.Dataset or numpy.ndarray
An `xarray.Dataset` containing the bands specifi... | def NDWI(data, normalize=False, band_pair=0):
"""
Computes various versions of the Normalized Difference Water Index for an `xarray.Dataset`.
Values should be in the range [-1,1] for valid LANDSAT data (the bands are positive).
Parameters
----------
data: xarray.Dataset or numpy.ndarray
... | [
"def",
"NDWI",
"(",
"data",
",",
"normalize",
"=",
"False",
",",
"band_pair",
"=",
"0",
")",
":",
"bands",
"=",
"[",
"None",
"]",
"*",
"2",
"if",
"band_pair",
"==",
"0",
":",
"bands",
"=",
"[",
"'nir'",
",",
"'swir1'",
"]",
"elif",
"band_pair",
"... | [
43,
0
] | [
82,
15
] | python | en | ['en', 'error', 'th'] | False |
wofs_classify | (dataset_in, clean_mask=None, x_coord='longitude', y_coord='latitude',
time_coord='time', no_data=-9999, mosaic=False, enforce_float64=False) |
Description:
Performs WOfS algorithm on given dataset.
Assumption:
- The WOfS algorithm is defined for Landsat 5/Landsat 7
References:
- Mueller, et al. (2015) "Water observations from space: Mapping surface water from
25 years of Landsat imagery across Australia." Remote Sensing ... |
Description:
Performs WOfS algorithm on given dataset.
Assumption:
- The WOfS algorithm is defined for Landsat 5/Landsat 7
References:
- Mueller, et al. (2015) "Water observations from space: Mapping surface water from
25 years of Landsat imagery across Australia." Remote Sensing ... | def wofs_classify(dataset_in, clean_mask=None, x_coord='longitude', y_coord='latitude',
time_coord='time', no_data=-9999, mosaic=False, enforce_float64=False):
"""
Description:
Performs WOfS algorithm on given dataset.
Assumption:
- The WOfS algorithm is defined for Landsat 5/L... | [
"def",
"wofs_classify",
"(",
"dataset_in",
",",
"clean_mask",
"=",
"None",
",",
"x_coord",
"=",
"'longitude'",
",",
"y_coord",
"=",
"'latitude'",
",",
"time_coord",
"=",
"'time'",
",",
"no_data",
"=",
"-",
"9999",
",",
"mosaic",
"=",
"False",
",",
"enforce... | [
84,
0
] | [
318,
22
] | python | en | ['en', 'error', 'th'] | False |
main | (classifier, platform, product_type, min_lon, max_lon, min_lat, max_lat, start_date, end_date, dc_config) |
Description:
Command-line water detection tool - creates a time-series from
water analysis performed on data retrieved by the Data Cube,
shows plots of the normalized water observations (total water
observations / total clear observations), total water observations,
and total ... |
Description:
Command-line water detection tool - creates a time-series from
water analysis performed on data retrieved by the Data Cube,
shows plots of the normalized water observations (total water
observations / total clear observations), total water observations,
and total ... | def main(classifier, platform, product_type, min_lon, max_lon, min_lat, max_lat, start_date, end_date, dc_config):
"""
Description:
Command-line water detection tool - creates a time-series from
water analysis performed on data retrieved by the Data Cube,
shows plots of the normalized wate... | [
"def",
"main",
"(",
"classifier",
",",
"platform",
",",
"product_type",
",",
"min_lon",
",",
"max_lon",
",",
"min_lat",
",",
"max_lat",
",",
"start_date",
",",
"end_date",
",",
"dc_config",
")",
":",
"# Initialize data cube object",
"dc",
"=",
"datacube",
".",... | [
367,
0
] | [
483,
97
] | python | en | ['en', 'error', 'th'] | False |
test_validation_operator_run_interactive_golden_path | (
caplog, data_context_simple_expectation_suite, filesystem_csv_2
) |
Interactive mode golden path - pass an existing suite name and an existing validation
operator name, select an existing file.
|
Interactive mode golden path - pass an existing suite name and an existing validation
operator name, select an existing file.
| def test_validation_operator_run_interactive_golden_path(
caplog, data_context_simple_expectation_suite, filesystem_csv_2
):
"""
Interactive mode golden path - pass an existing suite name and an existing validation
operator name, select an existing file.
"""
not_so_empty_data_context = data_cont... | [
"def",
"test_validation_operator_run_interactive_golden_path",
"(",
"caplog",
",",
"data_context_simple_expectation_suite",
",",
"filesystem_csv_2",
")",
":",
"not_so_empty_data_context",
"=",
"data_context_simple_expectation_suite",
"root_dir",
"=",
"not_so_empty_data_context",
".",... | [
13,
0
] | [
44,
60
] | python | en | ['en', 'error', 'th'] | False |
test_validation_operator_run_interactive_pass_non_existing_expectation_suite | (
caplog,
data_context_parameterized_expectation_suite_no_checkpoint_store,
filesystem_csv_2,
) |
Interactive mode: pass an non-existing suite name and an existing validation
operator name, select an existing file.
|
Interactive mode: pass an non-existing suite name and an existing validation
operator name, select an existing file.
| def test_validation_operator_run_interactive_pass_non_existing_expectation_suite(
caplog,
data_context_parameterized_expectation_suite_no_checkpoint_store,
filesystem_csv_2,
):
"""
Interactive mode: pass an non-existing suite name and an existing validation
operator name, select an existing file... | [
"def",
"test_validation_operator_run_interactive_pass_non_existing_expectation_suite",
"(",
"caplog",
",",
"data_context_parameterized_expectation_suite_no_checkpoint_store",
",",
"filesystem_csv_2",
",",
")",
":",
"not_so_empty_data_context",
"=",
"(",
"data_context_parameterized_expect... | [
47,
0
] | [
82,
60
] | python | en | ['en', 'error', 'th'] | False |
test_validation_operator_run_interactive_pass_non_existing_operator_name | (
caplog,
data_context_parameterized_expectation_suite_no_checkpoint_store,
filesystem_csv_2,
) |
Interactive mode: pass an non-existing suite name and an existing validation
operator name, select an existing file.
|
Interactive mode: pass an non-existing suite name and an existing validation
operator name, select an existing file.
| def test_validation_operator_run_interactive_pass_non_existing_operator_name(
caplog,
data_context_parameterized_expectation_suite_no_checkpoint_store,
filesystem_csv_2,
):
"""
Interactive mode: pass an non-existing suite name and an existing validation
operator name, select an existing file.
... | [
"def",
"test_validation_operator_run_interactive_pass_non_existing_operator_name",
"(",
"caplog",
",",
"data_context_parameterized_expectation_suite_no_checkpoint_store",
",",
"filesystem_csv_2",
",",
")",
":",
"not_so_empty_data_context",
"=",
"(",
"data_context_parameterized_expectatio... | [
85,
0
] | [
120,
60
] | python | en | ['en', 'error', 'th'] | False |
test_validation_operator_run_noninteractive_golden_path | (
caplog, data_context_simple_expectation_suite, filesystem_csv_2
) |
Non-nteractive mode golden path - use the --validation_config_file argument to pass the path
to a valid validation config file
|
Non-nteractive mode golden path - use the --validation_config_file argument to pass the path
to a valid validation config file
| def test_validation_operator_run_noninteractive_golden_path(
caplog, data_context_simple_expectation_suite, filesystem_csv_2
):
"""
Non-nteractive mode golden path - use the --validation_config_file argument to pass the path
to a valid validation config file
"""
not_so_empty_data_context = data_... | [
"def",
"test_validation_operator_run_noninteractive_golden_path",
"(",
"caplog",
",",
"data_context_simple_expectation_suite",
",",
"filesystem_csv_2",
")",
":",
"not_so_empty_data_context",
"=",
"data_context_simple_expectation_suite",
"root_dir",
"=",
"not_so_empty_data_context",
"... | [
123,
0
] | [
171,
60
] | python | en | ['en', 'error', 'th'] | False |
test_validation_operator_run_noninteractive_validation_config_file_does_not_exist | (
caplog,
data_context_parameterized_expectation_suite_no_checkpoint_store,
filesystem_csv_2,
) |
Non-nteractive mode. Use the --validation_config_file argument to pass the path
to a validation config file that does not exist.
|
Non-nteractive mode. Use the --validation_config_file argument to pass the path
to a validation config file that does not exist.
| def test_validation_operator_run_noninteractive_validation_config_file_does_not_exist(
caplog,
data_context_parameterized_expectation_suite_no_checkpoint_store,
filesystem_csv_2,
):
"""
Non-nteractive mode. Use the --validation_config_file argument to pass the path
to a validation config file th... | [
"def",
"test_validation_operator_run_noninteractive_validation_config_file_does_not_exist",
"(",
"caplog",
",",
"data_context_parameterized_expectation_suite_no_checkpoint_store",
",",
"filesystem_csv_2",
",",
")",
":",
"not_so_empty_data_context",
"=",
"(",
"data_context_parameterized_e... | [
174,
0
] | [
209,
60
] | python | en | ['en', 'error', 'th'] | False |
test_validation_operator_run_noninteractive_validation_config_file_does_is_misconfigured | (
caplog,
data_context_parameterized_expectation_suite_no_checkpoint_store,
filesystem_csv_2,
) |
Non-nteractive mode. Use the --validation_config_file argument to pass the path
to a validation config file that is misconfigured - one of the batches does not
have expectation_suite_names attribute
|
Non-nteractive mode. Use the --validation_config_file argument to pass the path
to a validation config file that is misconfigured - one of the batches does not
have expectation_suite_names attribute
| def test_validation_operator_run_noninteractive_validation_config_file_does_is_misconfigured(
caplog,
data_context_parameterized_expectation_suite_no_checkpoint_store,
filesystem_csv_2,
):
"""
Non-nteractive mode. Use the --validation_config_file argument to pass the path
to a validation config ... | [
"def",
"test_validation_operator_run_noninteractive_validation_config_file_does_is_misconfigured",
"(",
"caplog",
",",
"data_context_parameterized_expectation_suite_no_checkpoint_store",
",",
"filesystem_csv_2",
",",
")",
":",
"not_so_empty_data_context",
"=",
"(",
"data_context_paramete... | [
212,
0
] | [
268,
60
] | python | en | ['en', 'error', 'th'] | False |
_capture_ansi_codes_to_file | (result) |
Use this to capture the ANSI color codes when updating snapshots.
NOT DEAD CODE.
|
Use this to capture the ANSI color codes when updating snapshots.
NOT DEAD CODE.
| def _capture_ansi_codes_to_file(result):
"""
Use this to capture the ANSI color codes when updating snapshots.
NOT DEAD CODE.
"""
with open("ansi.txt", "w") as f:
f.write(result.output.strip()) | [
"def",
"_capture_ansi_codes_to_file",
"(",
"result",
")",
":",
"with",
"open",
"(",
"\"ansi.txt\"",
",",
"\"w\"",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"result",
".",
"output",
".",
"strip",
"(",
")",
")"
] | [
388,
0
] | [
394,
38
] | python | en | ['en', 'error', 'th'] | False |
BaseYamlConfig.to_yaml | (self, outfile) |
:returns None (but writes a YAML file containing the project configuration)
|
:returns None (but writes a YAML file containing the project configuration)
| def to_yaml(self, outfile):
"""
:returns None (but writes a YAML file containing the project configuration)
"""
yaml.dump(self.commented_map, outfile) | [
"def",
"to_yaml",
"(",
"self",
",",
"outfile",
")",
":",
"yaml",
".",
"dump",
"(",
"self",
".",
"commented_map",
",",
"outfile",
")"
] | [
98,
4
] | [
102,
46
] | python | en | ['en', 'error', 'th'] | False |
BaseYamlConfig.to_yaml_str | (self) |
:returns a YAML string containing the project configuration
|
:returns a YAML string containing the project configuration
| def to_yaml_str(self) -> str:
"""
:returns a YAML string containing the project configuration
"""
return object_to_yaml_str(self.commented_map) | [
"def",
"to_yaml_str",
"(",
"self",
")",
"->",
"str",
":",
"return",
"object_to_yaml_str",
"(",
"self",
".",
"commented_map",
")"
] | [
104,
4
] | [
108,
53
] | python | en | ['en', 'error', 'th'] | False |
BaseYamlConfig.to_json_dict | (self) |
:returns a JSON-serialiable dict containing the project configuration
|
:returns a JSON-serialiable dict containing the project configuration
| def to_json_dict(self) -> dict:
"""
:returns a JSON-serialiable dict containing the project configuration
"""
commented_map: CommentedMap = self.commented_map
return convert_to_json_serializable(data=commented_map) | [
"def",
"to_json_dict",
"(",
"self",
")",
"->",
"dict",
":",
"commented_map",
":",
"CommentedMap",
"=",
"self",
".",
"commented_map",
"return",
"convert_to_json_serializable",
"(",
"data",
"=",
"commented_map",
")"
] | [
110,
4
] | [
115,
63
] | python | en | ['en', 'error', 'th'] | False |
DataContextConfigSchema.handle_error | (self, exc, data, **kwargs) | Log and raise our custom exception when (de)serialization fails. | Log and raise our custom exception when (de)serialization fails. | def handle_error(self, exc, data, **kwargs):
"""Log and raise our custom exception when (de)serialization fails."""
if (
exc
and exc.messages
and isinstance(exc.messages, dict)
and all([key is None for key in exc.messages.keys()])
):
ex... | [
"def",
"handle_error",
"(",
"self",
",",
"exc",
",",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"(",
"exc",
"and",
"exc",
".",
"messages",
"and",
"isinstance",
"(",
"exc",
".",
"messages",
",",
"dict",
")",
"and",
"all",
"(",
"[",
"key",
"i... | [
930,
4
] | [
946,
9
] | python | en | ['en', 'en', 'en'] | True |
docker_pull | (tag: str) | `docker pull` and then return the image ID | `docker pull` and then return the image ID | def docker_pull(tag: str) -> str:
"""`docker pull` and then return the image ID"""
run(['docker', 'pull', tag])
return run_txtcapture(['docker', 'image', 'inspect', tag, '--format={{.Id}}']) | [
"def",
"docker_pull",
"(",
"tag",
":",
"str",
")",
"->",
"str",
":",
"run",
"(",
"[",
"'docker'",
",",
"'pull'",
",",
"tag",
"]",
")",
"return",
"run_txtcapture",
"(",
"[",
"'docker'",
",",
"'image'",
",",
"'inspect'",
",",
"tag",
",",
"'--format={{.Id... | [
17,
0
] | [
20,
82
] | python | en | ['en', 'en', 'en'] | True |
xr_scale | (data, data_vars=None, min_max=None, scaling='norm', copy=False) |
Scales an xarray Dataset or DataArray with standard scaling or norm scaling.
Parameters
----------
data: xarray.Dataset or xarray.DataArray
The NumPy array to scale.
data_vars: list
The names of the data variables to scale.
min_max: tuple
A 2-tuple which specifies t... |
Scales an xarray Dataset or DataArray with standard scaling or norm scaling.
Parameters
----------
data: xarray.Dataset or xarray.DataArray
The NumPy array to scale.
data_vars: list
The names of the data variables to scale.
min_max: tuple
A 2-tuple which specifies t... | def xr_scale(data, data_vars=None, min_max=None, scaling='norm', copy=False):
"""
Scales an xarray Dataset or DataArray with standard scaling or norm scaling.
Parameters
----------
data: xarray.Dataset or xarray.DataArray
The NumPy array to scale.
data_vars: list
The names o... | [
"def",
"xr_scale",
"(",
"data",
",",
"data_vars",
"=",
"None",
",",
"min_max",
"=",
"None",
",",
"scaling",
"=",
"'norm'",
",",
"copy",
"=",
"False",
")",
":",
"data",
"=",
"data",
".",
"copy",
"(",
")",
"if",
"copy",
"else",
"data",
"if",
"isinsta... | [
3,
0
] | [
30,
15
] | python | en | ['en', 'error', 'th'] | False |
np_scale | (arr, pop_arr=None, pop_min_max=None, pop_mean_std=None, min_max=None, scaling='norm') |
Scales a NumPy array with standard scaling or norm scaling, default to norm scaling.
Parameters
----------
arr: numpy.ndarray
The NumPy array to scale.
pop_arr: numpy.ndarray, optional
The NumPy array to treat as the population.
If specified, all members of `arr` must b... |
Scales a NumPy array with standard scaling or norm scaling, default to norm scaling.
Parameters
----------
arr: numpy.ndarray
The NumPy array to scale.
pop_arr: numpy.ndarray, optional
The NumPy array to treat as the population.
If specified, all members of `arr` must b... | def np_scale(arr, pop_arr=None, pop_min_max=None, pop_mean_std=None, min_max=None, scaling='norm'):
"""
Scales a NumPy array with standard scaling or norm scaling, default to norm scaling.
Parameters
----------
arr: numpy.ndarray
The NumPy array to scale.
pop_arr: numpy.ndarray, opt... | [
"def",
"np_scale",
"(",
"arr",
",",
"pop_arr",
"=",
"None",
",",
"pop_min_max",
"=",
"None",
",",
"pop_mean_std",
"=",
"None",
",",
"min_max",
"=",
"None",
",",
"scaling",
"=",
"'norm'",
")",
":",
"pop_arr",
"=",
"arr",
"if",
"pop_arr",
"is",
"None",
... | [
32,
0
] | [
72,
18
] | python | en | ['en', 'error', 'th'] | False |
qrot | (q, v) |
Rotate vector(s) v about the rotation described by quaternion(s) q.
Expects a tensor of shape (*, 4) for q and a tensor of shape (*, 3) for v,
where * denotes any number of dimensions.
Returns a tensor of shape (*, 3).
|
Rotate vector(s) v about the rotation described by quaternion(s) q.
Expects a tensor of shape (*, 4) for q and a tensor of shape (*, 3) for v,
where * denotes any number of dimensions.
Returns a tensor of shape (*, 3).
| def qrot(q, v):
"""
Rotate vector(s) v about the rotation described by quaternion(s) q.
Expects a tensor of shape (*, 4) for q and a tensor of shape (*, 3) for v,
where * denotes any number of dimensions.
Returns a tensor of shape (*, 3).
"""
assert q.shape[-1] == 4
assert v.shape[-1] ==... | [
"def",
"qrot",
"(",
"q",
",",
"v",
")",
":",
"assert",
"q",
".",
"shape",
"[",
"-",
"1",
"]",
"==",
"4",
"assert",
"v",
".",
"shape",
"[",
"-",
"1",
"]",
"==",
"3",
"assert",
"q",
".",
"shape",
"[",
":",
"-",
"1",
"]",
"==",
"v",
".",
"... | [
9,
0
] | [
23,
44
] | python | en | ['en', 'error', 'th'] | False |
MacTool.Dispatch | (self, args) | Dispatches a string command to a method. | Dispatches a string command to a method. | def Dispatch(self, args):
"""Dispatches a string command to a method."""
if len(args) < 1:
raise Exception("Not enough arguments")
method = "Exec%s" % self._CommandifyName(args[0])
return getattr(self, method)(*args[1:]) | [
"def",
"Dispatch",
"(",
"self",
",",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"<",
"1",
":",
"raise",
"Exception",
"(",
"\"Not enough arguments\"",
")",
"method",
"=",
"\"Exec%s\"",
"%",
"self",
".",
"_CommandifyName",
"(",
"args",
"[",
"0",
"]... | [
35,
2
] | [
41,
43
] | python | en | ['en', 'en', 'en'] | True |
MacTool._CommandifyName | (self, name_string) | Transforms a tool name like copy-info-plist to CopyInfoPlist | Transforms a tool name like copy-info-plist to CopyInfoPlist | def _CommandifyName(self, name_string):
"""Transforms a tool name like copy-info-plist to CopyInfoPlist"""
return name_string.title().replace('-', '') | [
"def",
"_CommandifyName",
"(",
"self",
",",
"name_string",
")",
":",
"return",
"name_string",
".",
"title",
"(",
")",
".",
"replace",
"(",
"'-'",
",",
"''",
")"
] | [
43,
2
] | [
45,
47
] | python | en | ['en', 'pl', 'en'] | True |
MacTool.ExecCopyBundleResource | (self, source, dest, convert_to_binary) | Copies a resource file to the bundle/Resources directory, performing any
necessary compilation on each resource. | Copies a resource file to the bundle/Resources directory, performing any
necessary compilation on each resource. | def ExecCopyBundleResource(self, source, dest, convert_to_binary):
"""Copies a resource file to the bundle/Resources directory, performing any
necessary compilation on each resource."""
extension = os.path.splitext(source)[1].lower()
if os.path.isdir(source):
# Copy tree.
# TODO(thakis): Thi... | [
"def",
"ExecCopyBundleResource",
"(",
"self",
",",
"source",
",",
"dest",
",",
"convert_to_binary",
")",
":",
"extension",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"source",
")",
"[",
"1",
"]",
".",
"lower",
"(",
")",
"if",
"os",
".",
"path",
".... | [
47,
2
] | [
66,
31
] | python | en | ['en', 'en', 'en'] | True |
MacTool._CopyXIBFile | (self, source, dest) | Compiles a XIB file with ibtool into a binary plist in the bundle. | Compiles a XIB file with ibtool into a binary plist in the bundle. | def _CopyXIBFile(self, source, dest):
"""Compiles a XIB file with ibtool into a binary plist in the bundle."""
# ibtool sometimes crashes with relative paths. See crbug.com/314728.
base = os.path.dirname(os.path.realpath(__file__))
if os.path.relpath(source):
source = os.path.join(base, source)
... | [
"def",
"_CopyXIBFile",
"(",
"self",
",",
"source",
",",
"dest",
")",
":",
"# ibtool sometimes crashes with relative paths. See crbug.com/314728.",
"base",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"__file__",
")",
")",... | [
68,
2
] | [
92,
31
] | python | en | ['en', 'en', 'en'] | True |
MacTool._CopyStringsFile | (self, source, dest, convert_to_binary) | Copies a .strings file using iconv to reconvert the input into UTF-16. | Copies a .strings file using iconv to reconvert the input into UTF-16. | def _CopyStringsFile(self, source, dest, convert_to_binary):
"""Copies a .strings file using iconv to reconvert the input into UTF-16."""
input_code = self._DetectInputEncoding(source) or "UTF-8"
# Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call
# CFPropertyListCreateFromXMLData() behind... | [
"def",
"_CopyStringsFile",
"(",
"self",
",",
"source",
",",
"dest",
",",
"convert_to_binary",
")",
":",
"input_code",
"=",
"self",
".",
"_DetectInputEncoding",
"(",
"source",
")",
"or",
"\"UTF-8\"",
"# Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call",
"# ... | [
98,
2
] | [
119,
33
] | python | en | ['en', 'en', 'en'] | True |
MacTool._DetectInputEncoding | (self, file_name) | Reads the first few bytes from file_name and tries to guess the text
encoding. Returns None as a guess if it can't detect it. | Reads the first few bytes from file_name and tries to guess the text
encoding. Returns None as a guess if it can't detect it. | def _DetectInputEncoding(self, file_name):
"""Reads the first few bytes from file_name and tries to guess the text
encoding. Returns None as a guess if it can't detect it."""
fp = open(file_name, 'rb')
try:
header = fp.read(3)
except e:
fp.close()
return None
fp.close()
if ... | [
"def",
"_DetectInputEncoding",
"(",
"self",
",",
"file_name",
")",
":",
"fp",
"=",
"open",
"(",
"file_name",
",",
"'rb'",
")",
"try",
":",
"header",
"=",
"fp",
".",
"read",
"(",
"3",
")",
"except",
"e",
":",
"fp",
".",
"close",
"(",
")",
"return",
... | [
121,
2
] | [
138,
17
] | python | en | ['en', 'en', 'en'] | True |
MacTool.ExecCopyInfoPlist | (self, source, dest, convert_to_binary, *keys) | Copies the |source| Info.plist to the destination directory |dest|. | Copies the |source| Info.plist to the destination directory |dest|. | def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys):
"""Copies the |source| Info.plist to the destination directory |dest|."""
# Read the source Info.plist into memory.
fd = open(source, 'r')
lines = fd.read()
fd.close()
# Insert synthesized key/value pairs (e.g. BuildMachineOSB... | [
"def",
"ExecCopyInfoPlist",
"(",
"self",
",",
"source",
",",
"dest",
",",
"convert_to_binary",
",",
"*",
"keys",
")",
":",
"# Read the source Info.plist into memory.",
"fd",
"=",
"open",
"(",
"source",
",",
"'r'",
")",
"lines",
"=",
"fd",
".",
"read",
"(",
... | [
140,
2
] | [
195,
33
] | python | en | ['en', 'fr', 'en'] | True |
MacTool._WritePkgInfo | (self, info_plist) | This writes the PkgInfo file from the data stored in Info.plist. | This writes the PkgInfo file from the data stored in Info.plist. | def _WritePkgInfo(self, info_plist):
"""This writes the PkgInfo file from the data stored in Info.plist."""
plist = plistlib.readPlist(info_plist)
if not plist:
return
# Only create PkgInfo for executable types.
package_type = plist['CFBundlePackageType']
if package_type != 'APPL':
... | [
"def",
"_WritePkgInfo",
"(",
"self",
",",
"info_plist",
")",
":",
"plist",
"=",
"plistlib",
".",
"readPlist",
"(",
"info_plist",
")",
"if",
"not",
"plist",
":",
"return",
"# Only create PkgInfo for executable types.",
"package_type",
"=",
"plist",
"[",
"'CFBundleP... | [
197,
2
] | [
218,
14
] | python | en | ['en', 'en', 'en'] | True |
MacTool.ExecFlock | (self, lockfile, *cmd_list) | Emulates the most basic behavior of Linux's flock(1). | Emulates the most basic behavior of Linux's flock(1). | def ExecFlock(self, lockfile, *cmd_list):
"""Emulates the most basic behavior of Linux's flock(1)."""
# Rely on exception handling to report errors.
fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666)
fcntl.flock(fd, fcntl.LOCK_EX)
return subprocess.call(cmd_list) | [
"def",
"ExecFlock",
"(",
"self",
",",
"lockfile",
",",
"*",
"cmd_list",
")",
":",
"# Rely on exception handling to report errors.",
"fd",
"=",
"os",
".",
"open",
"(",
"lockfile",
",",
"os",
".",
"O_RDONLY",
"|",
"os",
".",
"O_NOCTTY",
"|",
"os",
".",
"O_CR... | [
220,
2
] | [
225,
36
] | python | en | ['en', 'da', 'en'] | True |
MacTool.ExecFilterLibtool | (self, *cmd_list) | Calls libtool and filters out '/path/to/libtool: file: foo.o has no
symbols'. | Calls libtool and filters out '/path/to/libtool: file: foo.o has no
symbols'. | def ExecFilterLibtool(self, *cmd_list):
"""Calls libtool and filters out '/path/to/libtool: file: foo.o has no
symbols'."""
libtool_re = re.compile(r'^.*libtool: file: .* has no symbols$')
libtool_re5 = re.compile(
r'^.*libtool: warning for library: ' +
r'.* the table of contents is empt... | [
"def",
"ExecFilterLibtool",
"(",
"self",
",",
"*",
"cmd_list",
")",
":",
"libtool_re",
"=",
"re",
".",
"compile",
"(",
"r'^.*libtool: file: .* has no symbols$'",
")",
"libtool_re5",
"=",
"re",
".",
"compile",
"(",
"r'^.*libtool: warning for library: '",
"+",
"r'.* t... | [
227,
2
] | [
253,
32
] | python | en | ['en', 'en', 'en'] | True |
MacTool.ExecPackageFramework | (self, framework, version) | Takes a path to Something.framework and the Current version of that and
sets up all the symlinks. | Takes a path to Something.framework and the Current version of that and
sets up all the symlinks. | def ExecPackageFramework(self, framework, version):
"""Takes a path to Something.framework and the Current version of that and
sets up all the symlinks."""
# Find the name of the binary based on the part before the ".framework".
binary = os.path.basename(framework).split('.')[0]
CURRENT = 'Current'... | [
"def",
"ExecPackageFramework",
"(",
"self",
",",
"framework",
",",
"version",
")",
":",
"# Find the name of the binary based on the part before the \".framework\".",
"binary",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"framework",
")",
".",
"split",
"(",
"'.'",
... | [
255,
2
] | [
282,
17
] | python | en | ['en', 'en', 'en'] | True |
MacTool._Relink | (self, dest, link) | Creates a symlink to |dest| named |link|. If |link| already exists,
it is overwritten. | Creates a symlink to |dest| named |link|. If |link| already exists,
it is overwritten. | def _Relink(self, dest, link):
"""Creates a symlink to |dest| named |link|. If |link| already exists,
it is overwritten."""
if os.path.lexists(link):
os.remove(link)
os.symlink(dest, link) | [
"def",
"_Relink",
"(",
"self",
",",
"dest",
",",
"link",
")",
":",
"if",
"os",
".",
"path",
".",
"lexists",
"(",
"link",
")",
":",
"os",
".",
"remove",
"(",
"link",
")",
"os",
".",
"symlink",
"(",
"dest",
",",
"link",
")"
] | [
284,
2
] | [
289,
26
] | python | en | ['en', 'en', 'en'] | True |
MacTool.ExecCompileXcassets | (self, keys, *inputs) | Compiles multiple .xcassets files into a single .car file.
This invokes 'actool' to compile all the inputs .xcassets files. The
|keys| arguments is a json-encoded dictionary of extra arguments to
pass to 'actool' when the asset catalogs contains an application icon
or a launch image.
Note that 'ac... | Compiles multiple .xcassets files into a single .car file. | def ExecCompileXcassets(self, keys, *inputs):
"""Compiles multiple .xcassets files into a single .car file.
This invokes 'actool' to compile all the inputs .xcassets files. The
|keys| arguments is a json-encoded dictionary of extra arguments to
pass to 'actool' when the asset catalogs contains an appli... | [
"def",
"ExecCompileXcassets",
"(",
"self",
",",
"keys",
",",
"*",
"inputs",
")",
":",
"command_line",
"=",
"[",
"'xcrun'",
",",
"'actool'",
",",
"'--output-format'",
",",
"'human-readable-text'",
",",
"'--compress-pngs'",
",",
"'--notices'",
",",
"'--warnings'",
... | [
291,
2
] | [
341,
39
] | python | en | ['en', 'en', 'en'] | True |
MacTool.ExecMergeInfoPlist | (self, output, *inputs) | Merge multiple .plist files into a single .plist file. | Merge multiple .plist files into a single .plist file. | def ExecMergeInfoPlist(self, output, *inputs):
"""Merge multiple .plist files into a single .plist file."""
merged_plist = {}
for path in inputs:
plist = self._LoadPlistMaybeBinary(path)
self._MergePlist(merged_plist, plist)
plistlib.writePlist(merged_plist, output) | [
"def",
"ExecMergeInfoPlist",
"(",
"self",
",",
"output",
",",
"*",
"inputs",
")",
":",
"merged_plist",
"=",
"{",
"}",
"for",
"path",
"in",
"inputs",
":",
"plist",
"=",
"self",
".",
"_LoadPlistMaybeBinary",
"(",
"path",
")",
"self",
".",
"_MergePlist",
"(... | [
343,
2
] | [
349,
45
] | python | en | ['en', 'et', 'en'] | True |
MacTool.ExecCodeSignBundle | (self, key, resource_rules, entitlements, provisioning) | Code sign a bundle.
This function tries to code sign an iOS bundle, following the same
algorithm as Xcode:
1. copy ResourceRules.plist from the user or the SDK into the bundle,
2. pick the provisioning profile that best match the bundle identifier,
and copy it into the bundle as embedded.m... | Code sign a bundle. | def ExecCodeSignBundle(self, key, resource_rules, entitlements, provisioning):
"""Code sign a bundle.
This function tries to code sign an iOS bundle, following the same
algorithm as Xcode:
1. copy ResourceRules.plist from the user or the SDK into the bundle,
2. pick the provisioning profile tha... | [
"def",
"ExecCodeSignBundle",
"(",
"self",
",",
"key",
",",
"resource_rules",
",",
"entitlements",
",",
"provisioning",
")",
":",
"resource_rules_path",
"=",
"self",
".",
"_InstallResourceRules",
"(",
"resource_rules",
")",
"substitutions",
",",
"overrides",
"=",
"... | [
351,
2
] | [
372,
46
] | python | en | ['en', 'su', 'en'] | True |
MacTool._InstallResourceRules | (self, resource_rules) | Installs ResourceRules.plist from user or SDK into the bundle.
Args:
resource_rules: string, optional, path to the ResourceRules.plist file
to use, default to "${SDKROOT}/ResourceRules.plist"
Returns:
Path to the copy of ResourceRules.plist into the bundle.
| Installs ResourceRules.plist from user or SDK into the bundle. | def _InstallResourceRules(self, resource_rules):
"""Installs ResourceRules.plist from user or SDK into the bundle.
Args:
resource_rules: string, optional, path to the ResourceRules.plist file
to use, default to "${SDKROOT}/ResourceRules.plist"
Returns:
Path to the copy of ResourceRules... | [
"def",
"_InstallResourceRules",
"(",
"self",
",",
"resource_rules",
")",
":",
"source_path",
"=",
"resource_rules",
"target_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
"[",
"'BUILT_PRODUCTS_DIR'",
"]",
",",
"os",
".",
"environ",
"[... | [
374,
2
] | [
393,
22
] | python | en | ['en', 'en', 'en'] | True |
MacTool._InstallProvisioningProfile | (self, profile, bundle_identifier) | Installs embedded.mobileprovision into the bundle.
Args:
profile: string, optional, short name of the .mobileprovision file
to use, if empty or the file is missing, the best file installed
will be used
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
Returns:
... | Installs embedded.mobileprovision into the bundle. | def _InstallProvisioningProfile(self, profile, bundle_identifier):
"""Installs embedded.mobileprovision into the bundle.
Args:
profile: string, optional, short name of the .mobileprovision file
to use, if empty or the file is missing, the best file installed
will be used
bundle_iden... | [
"def",
"_InstallProvisioningProfile",
"(",
"self",
",",
"profile",
",",
"bundle_identifier",
")",
":",
"source_path",
",",
"provisioning_data",
",",
"team_id",
"=",
"self",
".",
"_FindProvisioningProfile",
"(",
"profile",
",",
"bundle_identifier",
")",
"target_path",
... | [
395,
2
] | [
416,
59
] | python | en | ['en', 'en', 'en'] | True |
MacTool._FindProvisioningProfile | (self, profile, bundle_identifier) | Finds the .mobileprovision file to use for signing the bundle.
Checks all the installed provisioning profiles (or if the user specified
the PROVISIONING_PROFILE variable, only consult it) and select the most
specific that correspond to the bundle identifier.
Args:
profile: string, optional, shor... | Finds the .mobileprovision file to use for signing the bundle. | def _FindProvisioningProfile(self, profile, bundle_identifier):
"""Finds the .mobileprovision file to use for signing the bundle.
Checks all the installed provisioning profiles (or if the user specified
the PROVISIONING_PROFILE variable, only consult it) and select the most
specific that correspond to ... | [
"def",
"_FindProvisioningProfile",
"(",
"self",
",",
"profile",
",",
"bundle_identifier",
")",
":",
"profiles_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
"[",
"'HOME'",
"]",
",",
"'Library'",
",",
"'MobileDevice'",
",",
"'Provisioni... | [
418,
2
] | [
471,
52
] | python | en | ['en', 'en', 'en'] | True |
MacTool._LoadProvisioningProfile | (self, profile_path) | Extracts the plist embedded in a provisioning profile.
Args:
profile_path: string, path to the .mobileprovision file
Returns:
Content of the plist embedded in the provisioning profile as a dictionary.
| Extracts the plist embedded in a provisioning profile. | def _LoadProvisioningProfile(self, profile_path):
"""Extracts the plist embedded in a provisioning profile.
Args:
profile_path: string, path to the .mobileprovision file
Returns:
Content of the plist embedded in the provisioning profile as a dictionary.
"""
with tempfile.NamedTemporary... | [
"def",
"_LoadProvisioningProfile",
"(",
"self",
",",
"profile_path",
")",
":",
"with",
"tempfile",
".",
"NamedTemporaryFile",
"(",
")",
"as",
"temp",
":",
"subprocess",
".",
"check_call",
"(",
"[",
"'security'",
",",
"'cms'",
",",
"'-D'",
",",
"'-i'",
",",
... | [
473,
2
] | [
485,
50
] | python | en | ['en', 'en', 'en'] | True |
MacTool._MergePlist | (self, merged_plist, plist) | Merge |plist| into |merged_plist|. | Merge |plist| into |merged_plist|. | def _MergePlist(self, merged_plist, plist):
"""Merge |plist| into |merged_plist|."""
for key, value in plist.iteritems():
if isinstance(value, dict):
merged_value = merged_plist.get(key, {})
if isinstance(merged_value, dict):
self._MergePlist(merged_value, value)
merged... | [
"def",
"_MergePlist",
"(",
"self",
",",
"merged_plist",
",",
"plist",
")",
":",
"for",
"key",
",",
"value",
"in",
"plist",
".",
"iteritems",
"(",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"merged_value",
"=",
"merged_plist",
".... | [
487,
2
] | [
498,
33
] | python | en | ['it', 'et', 'en'] | False |
MacTool._LoadPlistMaybeBinary | (self, plist_path) | Loads into a memory a plist possibly encoded in binary format.
This is a wrapper around plistlib.readPlist that tries to convert the
plist to the XML format if it can't be parsed (assuming that it is in
the binary format).
Args:
plist_path: string, path to a plist file, in XML or binary format
... | Loads into a memory a plist possibly encoded in binary format. | def _LoadPlistMaybeBinary(self, plist_path):
"""Loads into a memory a plist possibly encoded in binary format.
This is a wrapper around plistlib.readPlist that tries to convert the
plist to the XML format if it can't be parsed (assuming that it is in
the binary format).
Args:
plist_path: str... | [
"def",
"_LoadPlistMaybeBinary",
"(",
"self",
",",
"plist_path",
")",
":",
"try",
":",
"# First, try to read the file using plistlib that only supports XML,",
"# and if an exception is raised, convert a temporary copy to XML and",
"# load that copy.",
"return",
"plistlib",
".",
"readP... | [
500,
2
] | [
523,
42
] | python | en | ['en', 'en', 'en'] | True |
MacTool._GetSubstitutions | (self, bundle_identifier, app_identifier_prefix) | Constructs a dictionary of variable substitutions for Entitlements.plist.
Args:
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
app_identifier_prefix: string, value for AppIdentifierPrefix
Returns:
Dictionary of substitutions to apply when generating Entitlements.plist... | Constructs a dictionary of variable substitutions for Entitlements.plist. | def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix):
"""Constructs a dictionary of variable substitutions for Entitlements.plist.
Args:
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
app_identifier_prefix: string, value for AppIdentifierPrefix
Returns:... | [
"def",
"_GetSubstitutions",
"(",
"self",
",",
"bundle_identifier",
",",
"app_identifier_prefix",
")",
":",
"return",
"{",
"'CFBundleIdentifier'",
":",
"bundle_identifier",
",",
"'AppIdentifierPrefix'",
":",
"app_identifier_prefix",
",",
"}"
] | [
525,
2
] | [
538,
5
] | python | en | ['en', 'en', 'en'] | True |
MacTool._GetCFBundleIdentifier | (self) | Extracts CFBundleIdentifier value from Info.plist in the bundle.
Returns:
Value of CFBundleIdentifier in the Info.plist located in the bundle.
| Extracts CFBundleIdentifier value from Info.plist in the bundle. | def _GetCFBundleIdentifier(self):
"""Extracts CFBundleIdentifier value from Info.plist in the bundle.
Returns:
Value of CFBundleIdentifier in the Info.plist located in the bundle.
"""
info_plist_path = os.path.join(
os.environ['TARGET_BUILD_DIR'],
os.environ['INFOPLIST_PATH'])
... | [
"def",
"_GetCFBundleIdentifier",
"(",
"self",
")",
":",
"info_plist_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
"[",
"'TARGET_BUILD_DIR'",
"]",
",",
"os",
".",
"environ",
"[",
"'INFOPLIST_PATH'",
"]",
")",
"info_plist_data",
"=",
... | [
540,
2
] | [
550,
48
] | python | en | ['en', 'en', 'en'] | True |
MacTool._InstallEntitlements | (self, entitlements, substitutions, overrides) | Generates and install the ${BundleName}.xcent entitlements file.
Expands variables "$(variable)" pattern in the source entitlements file,
add extra entitlements defined in the .mobileprovision file and the copy
the generated plist to "${BundlePath}.xcent".
Args:
entitlements: string, optional, p... | Generates and install the ${BundleName}.xcent entitlements file. | def _InstallEntitlements(self, entitlements, substitutions, overrides):
"""Generates and install the ${BundleName}.xcent entitlements file.
Expands variables "$(variable)" pattern in the source entitlements file,
add extra entitlements defined in the .mobileprovision file and the copy
the generated pli... | [
"def",
"_InstallEntitlements",
"(",
"self",
",",
"entitlements",
",",
"substitutions",
",",
"overrides",
")",
":",
"source_path",
"=",
"entitlements",
"target_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
"[",
"'BUILT_PRODUCTS_DIR'",
"... | [
552,
2
] | [
584,
22
] | python | en | ['en', 'en', 'en'] | True |
MacTool._ExpandVariables | (self, data, substitutions) | Expands variables "$(variable)" in data.
Args:
data: object, can be either string, list or dictionary
substitutions: dictionary, variable substitutions to perform
Returns:
Copy of data where each references to "$(variable)" has been replaced
by the corresponding value found in substitu... | Expands variables "$(variable)" in data. | def _ExpandVariables(self, data, substitutions):
"""Expands variables "$(variable)" in data.
Args:
data: object, can be either string, list or dictionary
substitutions: dictionary, variable substitutions to perform
Returns:
Copy of data where each references to "$(variable)" has been rep... | [
"def",
"_ExpandVariables",
"(",
"self",
",",
"data",
",",
"substitutions",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"str",
")",
":",
"for",
"key",
",",
"value",
"in",
"substitutions",
".",
"iteritems",
"(",
")",
":",
"data",
"=",
"data",
".",
... | [
586,
2
] | [
606,
15
] | python | en | ['nl', 'en', 'en'] | True |
ValidationResultsPageRenderer_render_with_run_info_at_end | () |
Rendered validation results with run info at the end
Returns:
json string of rendered validation results
|
Rendered validation results with run info at the end
Returns:
json string of rendered validation results
| def ValidationResultsPageRenderer_render_with_run_info_at_end():
"""
Rendered validation results with run info at the end
Returns:
json string of rendered validation results
"""
fixture_filename = file_relative_path(
__file__,
"./fixtures/ValidationResultsPageRenderer_render_... | [
"def",
"ValidationResultsPageRenderer_render_with_run_info_at_end",
"(",
")",
":",
"fixture_filename",
"=",
"file_relative_path",
"(",
"__file__",
",",
"\"./fixtures/ValidationResultsPageRenderer_render_with_run_info_at_end.json\"",
",",
")",
"with",
"open",
"(",
"fixture_filename"... | [
478,
0
] | [
490,
42
] | python | en | ['en', 'error', 'th'] | False |
ValidationResultsPageRenderer_render_with_run_info_at_start | () |
Rendered validation results with run info at the start
Returns:
json string of rendered validation results
|
Rendered validation results with run info at the start
Returns:
json string of rendered validation results
| def ValidationResultsPageRenderer_render_with_run_info_at_start():
"""
Rendered validation results with run info at the start
Returns:
json string of rendered validation results
"""
fixture_filename = file_relative_path(
__file__,
"./fixtures/ValidationResultsPageRenderer_ren... | [
"def",
"ValidationResultsPageRenderer_render_with_run_info_at_start",
"(",
")",
":",
"fixture_filename",
"=",
"file_relative_path",
"(",
"__file__",
",",
"\"./fixtures/ValidationResultsPageRenderer_render_with_run_info_at_start.json\"",
",",
")",
"with",
"open",
"(",
"fixture_filen... | [
494,
0
] | [
506,
42
] | python | en | ['en', 'error', 'th'] | False |
construct_data_context_config | () |
Construct a DataContextConfig fixture given the modifications in the input parameters
Returns:
Dictionary representation of a DataContextConfig to compare in tests
|
Construct a DataContextConfig fixture given the modifications in the input parameters
Returns:
Dictionary representation of a DataContextConfig to compare in tests
| def construct_data_context_config():
"""
Construct a DataContextConfig fixture given the modifications in the input parameters
Returns:
Dictionary representation of a DataContextConfig to compare in tests
"""
def _construct_data_context_config(
data_context_id: str,
datasour... | [
"def",
"construct_data_context_config",
"(",
")",
":",
"def",
"_construct_data_context_config",
"(",
"data_context_id",
":",
"str",
",",
"datasources",
":",
"Dict",
",",
"config_version",
":",
"float",
"=",
"float",
"(",
"DataContextConfigDefaults",
".",
"DEFAULT_CONF... | [
30,
0
] | [
78,
41
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_BaseStoreBackendDefaults_and_simple_defaults | (
construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Ensure that a very simple DataContextConfig setup with many defaults is created accurately
and produces a valid DataContextConfig
|
What does this test and why?
Ensure that a very simple DataContextConfig setup with many defaults is created accurately
and produces a valid DataContextConfig
| def test_DataContextConfig_with_BaseStoreBackendDefaults_and_simple_defaults(
construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Ensure that a very simple DataContextConfig setup with many defaults is created accurately
and produces a valid DataContex... | [
"def",
"test_DataContextConfig_with_BaseStoreBackendDefaults_and_simple_defaults",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"store_backend_defaults",
"=",
"BaseStoreBackendDefaults",
"(",
")",
"data_context_config",
"=",
"DataContextConfi... | [
116,
0
] | [
155,
74
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_S3StoreBackendDefaults | (
construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Make sure that using S3StoreBackendDefaults as the store_backend_defaults applies appropriate
defaults, including default_bucket_name getting propagated to all stores.
|
What does this test and why?
Make sure that using S3StoreBackendDefaults as the store_backend_defaults applies appropriate
defaults, including default_bucket_name getting propagated to all stores.
| def test_DataContextConfig_with_S3StoreBackendDefaults(
construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Make sure that using S3StoreBackendDefaults as the store_backend_defaults applies appropriate
defaults, including default_bucket_name getting pr... | [
"def",
"test_DataContextConfig_with_S3StoreBackendDefaults",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"store_backend_defaults",
"=",
"S3StoreBackendDefaults",
"(",
"default_bucket_name",
"=",
"\"my_default_bucket\"",
")",
"data_context_... | [
158,
0
] | [
247,
74
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_S3StoreBackendDefaults_using_all_parameters | (
construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Make sure that S3StoreBackendDefaults parameters are handled appropriately
E.g. Make sure that default_bucket_name is ignored if individual bucket names are passed
|
What does this test and why?
Make sure that S3StoreBackendDefaults parameters are handled appropriately
E.g. Make sure that default_bucket_name is ignored if individual bucket names are passed
| def test_DataContextConfig_with_S3StoreBackendDefaults_using_all_parameters(
construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Make sure that S3StoreBackendDefaults parameters are handled appropriately
E.g. Make sure that default_bucket_name is ignor... | [
"def",
"test_DataContextConfig_with_S3StoreBackendDefaults_using_all_parameters",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"store_backend_defaults",
"=",
"S3StoreBackendDefaults",
"(",
"default_bucket_name",
"=",
"\"custom_default_bucket_na... | [
250,
0
] | [
358,
74
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_FilesystemStoreBackendDefaults_and_simple_defaults | (
construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Ensure that a very simple DataContextConfig setup using FilesystemStoreBackendDefaults is created accurately
This test sets the root_dir parameter
|
What does this test and why?
Ensure that a very simple DataContextConfig setup using FilesystemStoreBackendDefaults is created accurately
This test sets the root_dir parameter
| def test_DataContextConfig_with_FilesystemStoreBackendDefaults_and_simple_defaults(
construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Ensure that a very simple DataContextConfig setup using FilesystemStoreBackendDefaults is created accurately
This te... | [
"def",
"test_DataContextConfig_with_FilesystemStoreBackendDefaults_and_simple_defaults",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"test_root_directory",
"=",
"\"test_root_dir\"",
"store_backend_defaults",
"=",
"FilesystemStoreBackendDefaults"... | [
361,
0
] | [
417,
74
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_FilesystemStoreBackendDefaults_and_simple_defaults_no_root_directory | (
construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Ensure that a very simple DataContextConfig setup using FilesystemStoreBackendDefaults is created accurately
This test does not set the optional root_directory parameter
|
What does this test and why?
Ensure that a very simple DataContextConfig setup using FilesystemStoreBackendDefaults is created accurately
This test does not set the optional root_directory parameter
| def test_DataContextConfig_with_FilesystemStoreBackendDefaults_and_simple_defaults_no_root_directory(
construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Ensure that a very simple DataContextConfig setup using FilesystemStoreBackendDefaults is created accu... | [
"def",
"test_DataContextConfig_with_FilesystemStoreBackendDefaults_and_simple_defaults_no_root_directory",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"store_backend_defaults",
"=",
"FilesystemStoreBackendDefaults",
"(",
")",
"data_context_confi... | [
420,
0
] | [
460,
74
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_GCSStoreBackendDefaults | (
construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Make sure that using GCSStoreBackendDefaults as the store_backend_defaults applies appropriate
defaults, including default_bucket_name & default_project_name getting propagated
to all stores.
|
What does this test and why?
Make sure that using GCSStoreBackendDefaults as the store_backend_defaults applies appropriate
defaults, including default_bucket_name & default_project_name getting propagated
to all stores.
| def test_DataContextConfig_with_GCSStoreBackendDefaults(
construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Make sure that using GCSStoreBackendDefaults as the store_backend_defaults applies appropriate
defaults, including default_bucket_name & defaul... | [
"def",
"test_DataContextConfig_with_GCSStoreBackendDefaults",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"store_backend_defaults",
"=",
"GCSStoreBackendDefaults",
"(",
"default_bucket_name",
"=",
"\"my_default_bucket\"",
",",
"default_pro... | [
463,
0
] | [
564,
74
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_GCSStoreBackendDefaults_using_all_parameters | (
construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Make sure that GCSStoreBackendDefaults parameters are handled appropriately
E.g. Make sure that default_bucket_name is ignored if individual bucket names are passed
|
What does this test and why?
Make sure that GCSStoreBackendDefaults parameters are handled appropriately
E.g. Make sure that default_bucket_name is ignored if individual bucket names are passed
| def test_DataContextConfig_with_GCSStoreBackendDefaults_using_all_parameters(
construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Make sure that GCSStoreBackendDefaults parameters are handled appropriately
E.g. Make sure that default_bucket_name is ign... | [
"def",
"test_DataContextConfig_with_GCSStoreBackendDefaults_using_all_parameters",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"store_backend_defaults",
"=",
"GCSStoreBackendDefaults",
"(",
"default_bucket_name",
"=",
"\"custom_default_bucket_... | [
567,
0
] | [
683,
74
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_DatabaseStoreBackendDefaults | (
construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Make sure that using DatabaseStoreBackendDefaults as the store_backend_defaults applies appropriate
defaults, including default_credentials getting propagated to stores and not data_docs
|
What does this test and why?
Make sure that using DatabaseStoreBackendDefaults as the store_backend_defaults applies appropriate
defaults, including default_credentials getting propagated to stores and not data_docs
| def test_DataContextConfig_with_DatabaseStoreBackendDefaults(
construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Make sure that using DatabaseStoreBackendDefaults as the store_backend_defaults applies appropriate
defaults, including default_credential... | [
"def",
"test_DataContextConfig_with_DatabaseStoreBackendDefaults",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"store_backend_defaults",
"=",
"DatabaseStoreBackendDefaults",
"(",
"default_credentials",
"=",
"{",
"\"drivername\"",
":",
"\... | [
686,
0
] | [
804,
74
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_DatabaseStoreBackendDefaults_using_all_parameters | (
construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Make sure that DatabaseStoreBackendDefaults parameters are handled appropriately
E.g. Make sure that default_credentials is ignored if individual store credentials are passed
|
What does this test and why?
Make sure that DatabaseStoreBackendDefaults parameters are handled appropriately
E.g. Make sure that default_credentials is ignored if individual store credentials are passed
| def test_DataContextConfig_with_DatabaseStoreBackendDefaults_using_all_parameters(
construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Make sure that DatabaseStoreBackendDefaults parameters are handled appropriately
E.g. Make sure that default_credenti... | [
"def",
"test_DataContextConfig_with_DatabaseStoreBackendDefaults_using_all_parameters",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"store_backend_defaults",
"=",
"DatabaseStoreBackendDefaults",
"(",
"default_credentials",
"=",
"{",
"\"drive... | [
807,
0
] | [
955,
74
] | python | en | ['en', 'error', 'th'] | False |
test_override_general_defaults | (
construct_data_context_config,
default_pandas_datasource_config,
default_spark_datasource_config,
) |
What does this test and why?
A DataContextConfig should be able to be created by passing items into the constructor that override any defaults.
It should also be able to handle multiple datasources, even if they are configured with a dictionary or a DatasourceConfig.
|
What does this test and why?
A DataContextConfig should be able to be created by passing items into the constructor that override any defaults.
It should also be able to handle multiple datasources, even if they are configured with a dictionary or a DatasourceConfig.
| def test_override_general_defaults(
construct_data_context_config,
default_pandas_datasource_config,
default_spark_datasource_config,
):
"""
What does this test and why?
A DataContextConfig should be able to be created by passing items into the constructor that override any defaults.
It shou... | [
"def",
"test_override_general_defaults",
"(",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
",",
"default_spark_datasource_config",
",",
")",
":",
"data_context_config",
"=",
"DataContextConfig",
"(",
"config_version",
"=",
"999",
",",
"plugins_direc... | [
958,
0
] | [
1200,
74
] | python | en | ['en', 'error', 'th'] | False |
test_DataContextConfig_with_S3StoreBackendDefaults_and_simple_defaults_with_variable_sub | (
monkeypatch, construct_data_context_config, default_pandas_datasource_config
) |
What does this test and why?
Ensure that a very simple DataContextConfig setup with many defaults is created accurately
and produces a valid DataContextConfig
|
What does this test and why?
Ensure that a very simple DataContextConfig setup with many defaults is created accurately
and produces a valid DataContextConfig
| def test_DataContextConfig_with_S3StoreBackendDefaults_and_simple_defaults_with_variable_sub(
monkeypatch, construct_data_context_config, default_pandas_datasource_config
):
"""
What does this test and why?
Ensure that a very simple DataContextConfig setup with many defaults is created accurately
an... | [
"def",
"test_DataContextConfig_with_S3StoreBackendDefaults_and_simple_defaults_with_variable_sub",
"(",
"monkeypatch",
",",
"construct_data_context_config",
",",
"default_pandas_datasource_config",
")",
":",
"monkeypatch",
".",
"setenv",
"(",
"\"SUBSTITUTED_BASE_DIRECTORY\"",
",",
"\... | [
1203,
0
] | [
1306,
5
] | python | en | ['en', 'error', 'th'] | False |
dt_to_str | (date, fmt='%Y-%m-%d') |
Converts a datetime object to a string.
|
Converts a datetime object to a string.
| def dt_to_str(date, fmt='%Y-%m-%d'):
"""
Converts a datetime object to a string.
"""
return date.strftime(fmt) | [
"def",
"dt_to_str",
"(",
"date",
",",
"fmt",
"=",
"'%Y-%m-%d'",
")",
":",
"return",
"date",
".",
"strftime",
"(",
"fmt",
")"
] | [
3,
0
] | [
7,
29
] | python | en | ['en', 'ja', 'th'] | False |
_n64_to_datetime | (n64) |
Converts Numpy 64 bit timestamps to datetime objects. Units in seconds
|
Converts Numpy 64 bit timestamps to datetime objects. Units in seconds
| def _n64_to_datetime(n64):
"""
Converts Numpy 64 bit timestamps to datetime objects. Units in seconds
"""
return datetime.utcfromtimestamp(n64.tolist() / 1e9) | [
"def",
"_n64_to_datetime",
"(",
"n64",
")",
":",
"return",
"datetime",
".",
"utcfromtimestamp",
"(",
"n64",
".",
"tolist",
"(",
")",
"/",
"1e9",
")"
] | [
9,
0
] | [
13,
56
] | python | en | ['en', 'ja', 'th'] | False |
_n64_datetime_to_scalar | (dt64) |
Converts a NumPy datetime64 object to the number of seconds since
midnight, January 1, 1970, as a NumPy float64.
Returns
-------
scalar: numpy.float64
The number of seconds since midnight, January 1, 1970, as a NumPy float64.
|
Converts a NumPy datetime64 object to the number of seconds since
midnight, January 1, 1970, as a NumPy float64.
Returns
-------
scalar: numpy.float64
The number of seconds since midnight, January 1, 1970, as a NumPy float64.
| def _n64_datetime_to_scalar(dt64):
"""
Converts a NumPy datetime64 object to the number of seconds since
midnight, January 1, 1970, as a NumPy float64.
Returns
-------
scalar: numpy.float64
The number of seconds since midnight, January 1, 1970, as a NumPy float64.
"""
... | [
"def",
"_n64_datetime_to_scalar",
"(",
"dt64",
")",
":",
"return",
"(",
"dt64",
"-",
"np",
".",
"datetime64",
"(",
"'1970-01-01T00:00:00Z'",
")",
")",
"/",
"np",
".",
"timedelta64",
"(",
"1",
",",
"'s'",
")"
] | [
15,
0
] | [
25,
82
] | python | en | ['en', 'ja', 'th'] | False |
_scalar_to_n64_datetime | (scalar) |
Converts a floating point number to a NumPy datetime64 object.
Returns
-------
dt64: numpy.datetime64
The NumPy datetime64 object representing the datetime of the scalar argument.
|
Converts a floating point number to a NumPy datetime64 object.
Returns
-------
dt64: numpy.datetime64
The NumPy datetime64 object representing the datetime of the scalar argument.
| def _scalar_to_n64_datetime(scalar):
"""
Converts a floating point number to a NumPy datetime64 object.
Returns
-------
dt64: numpy.datetime64
The NumPy datetime64 object representing the datetime of the scalar argument.
"""
return (scalar * np.timedelta64(1, 's')) + np... | [
"def",
"_scalar_to_n64_datetime",
"(",
"scalar",
")",
":",
"return",
"(",
"scalar",
"*",
"np",
".",
"timedelta64",
"(",
"1",
",",
"'s'",
")",
")",
"+",
"np",
".",
"datetime64",
"(",
"'1970-01-01T00:00:00Z'",
")"
] | [
27,
0
] | [
36,
84
] | python | en | ['en', 'ja', 'th'] | False |
TransformersReader.__init__ | (
self,
model_name_or_path: str = "distilbert-base-uncased-distilled-squad",
model_version: Optional[str] = None,
tokenizer: Optional[str] = None,
context_window_size: int = 70,
use_gpu: int = 0,
top_k_per_candidate: int = 4,
return_no_answers: bool = True... |
Load a QA model from Transformers.
Available models include:
- ``'distilbert-base-uncased-distilled-squad`'``
- ``'bert-large-cased-whole-word-masking-finetuned-squad``'
- ``'bert-large-uncased-whole-word-masking-finetuned-squad``'
See https://huggingface.co/models for... |
Load a QA model from Transformers.
Available models include: | def __init__(
self,
model_name_or_path: str = "distilbert-base-uncased-distilled-squad",
model_version: Optional[str] = None,
tokenizer: Optional[str] = None,
context_window_size: int = 70,
use_gpu: int = 0,
top_k_per_candidate: int = 4,
return_no_answers:... | [
"def",
"__init__",
"(",
"self",
",",
"model_name_or_path",
":",
"str",
"=",
"\"distilbert-base-uncased-distilled-squad\"",
",",
"model_version",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"tokenizer",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
","... | [
16,
4
] | [
62,
36
] | python | en | ['en', 'error', 'th'] | False |
TransformersReader.predict | (self, query: str, documents: List[Document], top_k: Optional[int] = None) |
Use loaded QA model to find answers for a query in the supplied list of Document.
Returns dictionaries containing answers sorted by (desc.) probability.
Example:
```python
|{
| 'query': 'Who is the father of Arya Stark?',
| 'answers':[
... |
Use loaded QA model to find answers for a query in the supplied list of Document. | def predict(self, query: str, documents: List[Document], top_k: Optional[int] = None):
"""
Use loaded QA model to find answers for a query in the supplied list of Document.
Returns dictionaries containing answers sorted by (desc.) probability.
Example:
```python
|{... | [
"def",
"predict",
"(",
"self",
",",
"query",
":",
"str",
",",
"documents",
":",
"List",
"[",
"Document",
"]",
",",
"top_k",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
")",
":",
"# get top-answers for each candidate passage",
"answers",
"=",
"[",
"]",
... | [
66,
4
] | [
153,
22
] | python | en | ['en', 'error', 'th'] | False |
IRAmbassadorTLS.__init__ | (self, ir: 'IR', aconf: Config,
rkey: str="ir.tlsmodule",
kind: str="IRTLSModule",
name: str="ir.tlsmodule",
enabled: bool=True,
**kwargs) |
Initialize an IRAmbassadorTLS from the raw fields of its Resource.
|
Initialize an IRAmbassadorTLS from the raw fields of its Resource.
| def __init__(self, ir: 'IR', aconf: Config,
rkey: str="ir.tlsmodule",
kind: str="IRTLSModule",
name: str="ir.tlsmodule",
enabled: bool=True,
**kwargs) -> None:
"""
Initialize an IRAmbassadorTLS from the raw fields of i... | [
"def",
"__init__",
"(",
"self",
",",
"ir",
":",
"'IR'",
",",
"aconf",
":",
"Config",
",",
"rkey",
":",
"str",
"=",
"\"ir.tlsmodule\"",
",",
"kind",
":",
"str",
"=",
"\"IRTLSModule\"",
",",
"name",
":",
"str",
"=",
"\"ir.tlsmodule\"",
",",
"enabled",
":... | [
40,
4
] | [
57,
9
] | python | en | ['en', 'error', 'th'] | False |
critical_suite_with_citations | () |
This hand made fixture has a wide range of expectations, and has a mix of
metadata including an BasicSuiteBuilderProfiler entry, and citations.
|
This hand made fixture has a wide range of expectations, and has a mix of
metadata including an BasicSuiteBuilderProfiler entry, and citations.
| def critical_suite_with_citations() -> ExpectationSuite:
"""
This hand made fixture has a wide range of expectations, and has a mix of
metadata including an BasicSuiteBuilderProfiler entry, and citations.
"""
schema: ExpectationSuiteSchema = ExpectationSuiteSchema()
critical_suite: dict = {
... | [
"def",
"critical_suite_with_citations",
"(",
")",
"->",
"ExpectationSuite",
":",
"schema",
":",
"ExpectationSuiteSchema",
"=",
"ExpectationSuiteSchema",
"(",
")",
"critical_suite",
":",
"dict",
"=",
"{",
"\"expectation_suite_name\"",
":",
"\"critical\"",
",",
"\"meta\""... | [
27,
0
] | [
98,
51
] | python | en | ['en', 'error', 'th'] | False |
suite_with_multiple_citations | () |
A handmade suite with multiple citations each with different batch_request.
The most recent citation does not have batch_request
|
A handmade suite with multiple citations each with different batch_request. | def suite_with_multiple_citations() -> ExpectationSuite:
"""
A handmade suite with multiple citations each with different batch_request.
The most recent citation does not have batch_request
"""
schema: ExpectationSuiteSchema = ExpectationSuiteSchema()
critical_suite: dict = {
"expectati... | [
"def",
"suite_with_multiple_citations",
"(",
")",
"->",
"ExpectationSuite",
":",
"schema",
":",
"ExpectationSuiteSchema",
"=",
"ExpectationSuiteSchema",
"(",
")",
"critical_suite",
":",
"dict",
"=",
"{",
"\"expectation_suite_name\"",
":",
"\"critical\"",
",",
"\"meta\""... | [
102,
0
] | [
148,
51
] | python | en | ['en', 'error', 'th'] | False |
warning_suite | () |
This hand made fixture has a wide range of expectations, and has a mix of
metadata including BasicSuiteBuilderProfiler entries.
|
This hand made fixture has a wide range of expectations, and has a mix of
metadata including BasicSuiteBuilderProfiler entries.
| def warning_suite() -> ExpectationSuite:
"""
This hand made fixture has a wide range of expectations, and has a mix of
metadata including BasicSuiteBuilderProfiler entries.
"""
schema: ExpectationSuiteSchema = ExpectationSuiteSchema()
warning_suite: dict = {
"expectation_suite_name": "wa... | [
"def",
"warning_suite",
"(",
")",
"->",
"ExpectationSuite",
":",
"schema",
":",
"ExpectationSuiteSchema",
"=",
"ExpectationSuiteSchema",
"(",
")",
"warning_suite",
":",
"dict",
"=",
"{",
"\"expectation_suite_name\"",
":",
"\"warning\"",
",",
"\"meta\"",
":",
"{",
... | [
152,
0
] | [
391,
50
] | python | en | ['en', 'error', 'th'] | False |
test_notebook_execution_with_pandas_backend | (
titanic_v013_multi_datasource_pandas_data_context_with_checkpoints_v1_with_empty_store_stats_enabled,
) |
To set this test up we:
- create a suite
- add a few expectations (both table and column level)
- verify that no validations have happened
- create the suite edit notebook by hijacking the private cli method
We then:
- execute that notebook (Note this will raise various errors like
Ce... |
To set this test up we: | def test_notebook_execution_with_pandas_backend(
titanic_v013_multi_datasource_pandas_data_context_with_checkpoints_v1_with_empty_store_stats_enabled,
):
"""
To set this test up we:
- create a suite
- add a few expectations (both table and column level)
- verify that no validations have happene... | [
"def",
"test_notebook_execution_with_pandas_backend",
"(",
"titanic_v013_multi_datasource_pandas_data_context_with_checkpoints_v1_with_empty_store_stats_enabled",
",",
")",
":",
"# Since we'll run the notebook, we use a context with no data docs to avoid the renderer's default",
"# behavior of build... | [
818,
0
] | [
982,
34
] | python | en | ['en', 'error', 'th'] | False |
test_notebook_execution_with_custom_notebooks_wrong_module | (
suite_with_multiple_citations, data_context_v3_custom_bad_notebooks
) |
Test the error message in case of "bad" custom module is clear
|
Test the error message in case of "bad" custom module is clear
| def test_notebook_execution_with_custom_notebooks_wrong_module(
suite_with_multiple_citations, data_context_v3_custom_bad_notebooks
):
"""
Test the error message in case of "bad" custom module is clear
"""
with pytest.raises(
SuiteEditNotebookCustomTemplateModuleNotFoundError, match=r"invali... | [
"def",
"test_notebook_execution_with_custom_notebooks_wrong_module",
"(",
"suite_with_multiple_citations",
",",
"data_context_v3_custom_bad_notebooks",
")",
":",
"with",
"pytest",
".",
"raises",
"(",
"SuiteEditNotebookCustomTemplateModuleNotFoundError",
",",
"match",
"=",
"r\"inval... | [
985,
0
] | [
996,
53
] | python | en | ['en', 'error', 'th'] | False |
test_notebook_execution_with_custom_notebooks | (
suite_with_multiple_citations, data_context_v3_custom_notebooks
) |
Test the different parts of the notebooks can be modified
|
Test the different parts of the notebooks can be modified
| def test_notebook_execution_with_custom_notebooks(
suite_with_multiple_citations, data_context_v3_custom_notebooks
):
"""
Test the different parts of the notebooks can be modified
"""
batch_request: dict = {
"datasource_name": "files_datasource",
"data_connector_name": "files_data_co... | [
"def",
"test_notebook_execution_with_custom_notebooks",
"(",
"suite_with_multiple_citations",
",",
"data_context_v3_custom_notebooks",
")",
":",
"batch_request",
":",
"dict",
"=",
"{",
"\"datasource_name\"",
":",
"\"files_datasource\"",
",",
"\"data_connector_name\"",
":",
"\"f... | [
999,
0
] | [
1107,
26
] | python | en | ['en', 'error', 'th'] | False |
ProfilingColumnPropertiesTableContentBlockRenderer.render | (cls, ge_object, header_row=None) | Each expectation method should return a list of rows | Each expectation method should return a list of rows | def render(cls, ge_object, header_row=None):
"""Each expectation method should return a list of rows"""
if header_row is None:
header_row = []
table_rows = []
if isinstance(ge_object, list):
for sub_object in ge_object:
expectation_type = cls._ge... | [
"def",
"render",
"(",
"cls",
",",
"ge_object",
",",
"header_row",
"=",
"None",
")",
":",
"if",
"header_row",
"is",
"None",
":",
"header_row",
"=",
"[",
"]",
"table_rows",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"ge_object",
",",
"list",
")",
":",
"fo... | [
27,
4
] | [
64,
9
] | python | en | ['en', 'ga', 'en'] | True |
member_calldef_t._get__cmp__call_items | (self) | implementation details | implementation details | def _get__cmp__call_items(self):
"""implementation details"""
return [self.virtuality, self.has_static, self.has_const] | [
"def",
"_get__cmp__call_items",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"virtuality",
",",
"self",
".",
"has_static",
",",
"self",
".",
"has_const",
"]"
] | [
53,
4
] | [
55,
65
] | python | da | ['eo', 'da', 'en'] | False |
member_calldef_t.virtuality | (self) | Describes the "virtuality" of the member (as defined by the
string constants in the class :class:VIRTUALITY_TYPES).
@type: str | Describes the "virtuality" of the member (as defined by the
string constants in the class :class:VIRTUALITY_TYPES).
| def virtuality(self):
"""Describes the "virtuality" of the member (as defined by the
string constants in the class :class:VIRTUALITY_TYPES).
@type: str"""
return self._virtuality | [
"def",
"virtuality",
"(",
"self",
")",
":",
"return",
"self",
".",
"_virtuality"
] | [
68,
4
] | [
72,
31
] | python | en | ['en', 'en', 'en'] | True |
member_calldef_t.access_type | (self) | Return the access type of the member (as defined by the
string constants in the class :class:ACCESS_TYPES.
@type: str | Return the access type of the member (as defined by the
string constants in the class :class:ACCESS_TYPES.
| def access_type(self):
"""Return the access type of the member (as defined by the
string constants in the class :class:ACCESS_TYPES.
@type: str"""
return self.parent.find_out_member_access_type(self) | [
"def",
"access_type",
"(",
"self",
")",
":",
"return",
"self",
".",
"parent",
".",
"find_out_member_access_type",
"(",
"self",
")"
] | [
80,
4
] | [
84,
60
] | python | en | ['en', 'en', 'en'] | True |
member_calldef_t.has_const | (self) | describes, whether "callable" has const modifier or not | describes, whether "callable" has const modifier or not | def has_const(self):
"""describes, whether "callable" has const modifier or not"""
return self._has_const | [
"def",
"has_const",
"(",
"self",
")",
":",
"return",
"self",
".",
"_has_const"
] | [
87,
4
] | [
89,
30
] | python | en | ['en', 'gl', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.