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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
serve_tcp | (
handler,
port,
*,
host=None,
backlog=None,
handler_nursery=None,
task_status=trio.TASK_STATUS_IGNORED,
) | Listen for incoming TCP connections, and for each one start a task
running ``handler(stream)``.
This is a thin convenience wrapper around :func:`open_tcp_listeners` and
:func:`serve_listeners` – see them for full details.
.. warning::
If ``handler`` raises an exception, then this function does... | Listen for incoming TCP connections, and for each one start a task
running ``handler(stream)``. | async def serve_tcp(
handler,
port,
*,
host=None,
backlog=None,
handler_nursery=None,
task_status=trio.TASK_STATUS_IGNORED,
):
"""Listen for incoming TCP connections, and for each one start a task
running ``handler(stream)``.
This is a thin convenience wrapper around :func:`open... | [
"async",
"def",
"serve_tcp",
"(",
"handler",
",",
"port",
",",
"*",
",",
"host",
"=",
"None",
",",
"backlog",
"=",
"None",
",",
"handler_nursery",
"=",
"None",
",",
"task_status",
"=",
"trio",
".",
"TASK_STATUS_IGNORED",
",",
")",
":",
"listeners",
"=",
... | [
145,
0
] | [
220,
5
] | python | en | ['en', 'en', 'en'] | True |
fix_calldef_decls | (decls, enums, cxx_std) |
some times gccxml report typedefs defined in no namespace
it happens for example in next situation
template< typename X>
void ddd(){ typedef typename X::Y YY;}
if I will fail on this bug next time, the right way to fix it may be
different
|
some times gccxml report typedefs defined in no namespace
it happens for example in next situation
template< typename X>
void ddd(){ typedef typename X::Y YY;}
if I will fail on this bug next time, the right way to fix it may be
different
| def fix_calldef_decls(decls, enums, cxx_std):
"""
some times gccxml report typedefs defined in no namespace
it happens for example in next situation
template< typename X>
void ddd(){ typedef typename X::Y YY;}
if I will fail on this bug next time, the right way to fix it may be
different
... | [
"def",
"fix_calldef_decls",
"(",
"decls",
",",
"enums",
",",
"cxx_std",
")",
":",
"default_arg_patcher",
"=",
"default_argument_patcher_t",
"(",
"enums",
",",
"cxx_std",
")",
"# decls should be flat list of all declarations, you want to apply patch on",
"for",
"decl",
"in",... | [
248,
0
] | [
262,
40
] | python | en | ['en', 'error', 'th'] | False |
update_unnamed_class | (decls) |
Adds name to class_t declarations.
If CastXML is being used, the type definitions with an unnamed
class/struct are split across two nodes in the XML tree. For example,
typedef struct {} cls;
produces
<Struct id="_7" name="" context="_1" .../>
<Typedef id="_8" name="cls" type... |
Adds name to class_t declarations. | def update_unnamed_class(decls):
"""
Adds name to class_t declarations.
If CastXML is being used, the type definitions with an unnamed
class/struct are split across two nodes in the XML tree. For example,
typedef struct {} cls;
produces
<Struct id="_7" name="" context="_1" .../>
... | [
"def",
"update_unnamed_class",
"(",
"decls",
")",
":",
"for",
"decl",
"in",
"decls",
":",
"if",
"isinstance",
"(",
"decl",
",",
"declarations",
".",
"typedef_t",
")",
":",
"referent",
"=",
"decl",
".",
"decl_type",
"if",
"isinstance",
"(",
"referent",
",",... | [
265,
0
] | [
304,
37
] | python | en | ['en', 'error', 'th'] | False |
test_anonymize_datasource_info_v2_api_custom_subclass | () |
What does this test and why?
We should be able to discern the GE parent class for a custom type and construct
a useful usage stats event message.
Custom v2 API Datasources should continue to be supported.
|
What does this test and why?
We should be able to discern the GE parent class for a custom type and construct
a useful usage stats event message.
Custom v2 API Datasources should continue to be supported.
| def test_anonymize_datasource_info_v2_api_custom_subclass():
"""
What does this test and why?
We should be able to discern the GE parent class for a custom type and construct
a useful usage stats event message.
Custom v2 API Datasources should continue to be supported.
"""
name = "test_panda... | [
"def",
"test_anonymize_datasource_info_v2_api_custom_subclass",
"(",
")",
":",
"name",
"=",
"\"test_pandas_datasource\"",
"yaml_config",
"=",
"f\"\"\"\nmodule_name: tests.data_context.fixtures.plugins.my_custom_v2_api_datasource\nclass_name: MyCustomV2ApiDatasource\n\"\"\"",
"config",
":",
... | [
131,
0
] | [
152,
5
] | python | en | ['en', 'error', 'th'] | False |
ExpectTableRowCountToBeBetween.validate_configuration | (self, configuration: Optional[ExpectationConfiguration]) |
Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that
necessary configuration arguments have been provided for the validation of the expectation.
Args:
configuration (OPTIONAL[ExpectationConfiguration]): \
An opt... |
Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that
necessary configuration arguments have been provided for the validation of the expectation. | def validate_configuration(self, configuration: Optional[ExpectationConfiguration]):
"""
Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that
necessary configuration arguments have been provided for the validation of the expectation.
... | [
"def",
"validate_configuration",
"(",
"self",
",",
"configuration",
":",
"Optional",
"[",
"ExpectationConfiguration",
"]",
")",
":",
"# Setting up a configuration",
"super",
"(",
")",
".",
"validate_configuration",
"(",
"configuration",
")",
"self",
".",
"validate_met... | [
91,
4
] | [
105,
85
] | python | en | ['en', 'error', 'th'] | False |
check_store_backend_store_backend_id_functionality | (
store_backend: StoreBackend, store_backend_id: str = None
) |
Assertions to check if a store backend is handling reading and writing a store_backend_id appropriately.
Args:
store_backend: Instance of subclass of StoreBackend to test e.g. TupleFilesystemStoreBackend
store_backend_id: Manually input store_backend_id
Returns:
None
|
Assertions to check if a store backend is handling reading and writing a store_backend_id appropriately.
Args:
store_backend: Instance of subclass of StoreBackend to test e.g. TupleFilesystemStoreBackend
store_backend_id: Manually input store_backend_id
Returns:
None
| def check_store_backend_store_backend_id_functionality(
store_backend: StoreBackend, store_backend_id: str = None
) -> None:
"""
Assertions to check if a store backend is handling reading and writing a store_backend_id appropriately.
Args:
store_backend: Instance of subclass of StoreBackend to t... | [
"def",
"check_store_backend_store_backend_id_functionality",
"(",
"store_backend",
":",
"StoreBackend",
",",
"store_backend_id",
":",
"str",
"=",
"None",
")",
"->",
"None",
":",
"# Check that store_backend_id exists can be read",
"assert",
"store_backend",
".",
"store_backend... | [
49,
0
] | [
77,
64
] | python | en | ['en', 'error', 'th'] | False |
test_StoreBackend_id_initialization | (tmp_path_factory) |
What does this test and why?
A StoreBackend should have a store_backend_id property. That store_backend_id should be read and initialized
from an existing persistent store_backend_id during instantiation, or a new store_backend_id should be generated
and persisted. The store_backend_id should be a val... |
What does this test and why? | def test_StoreBackend_id_initialization(tmp_path_factory):
"""
What does this test and why?
A StoreBackend should have a store_backend_id property. That store_backend_id should be read and initialized
from an existing persistent store_backend_id during instantiation, or a new store_backend_id should be... | [
"def",
"test_StoreBackend_id_initialization",
"(",
"tmp_path_factory",
")",
":",
"# InMemoryStoreBackend",
"# Initialize without store_backend_id and check that it is generated correctly",
"in_memory_store_backend",
"=",
"InMemoryStoreBackend",
"(",
")",
"check_store_backend_store_backend_... | [
81,
0
] | [
237,
9
] | python | en | ['en', 'error', 'th'] | False |
test_TupleS3StoreBackend_with_prefix | () |
What does this test test and why?
We will exercise the store backend's set method twice and then verify
that the we calling get and list methods will return the expected keys.
We will also check that the objects are stored on S3 at the expected location,
and that the correct S3 URL for the object... |
What does this test test and why? | def test_TupleS3StoreBackend_with_prefix():
"""
What does this test test and why?
We will exercise the store backend's set method twice and then verify
that the we calling get and list methods will return the expected keys.
We will also check that the objects are stored on S3 at the expected locat... | [
"def",
"test_TupleS3StoreBackend_with_prefix",
"(",
")",
":",
"bucket",
"=",
"\"leakybucket\"",
"prefix",
"=",
"\"this_is_a_test_prefix\"",
"base_public_path",
"=",
"\"http://www.test.com/\"",
"# create a bucket in Moto's mock AWS environment",
"conn",
"=",
"boto3",
".",
"resou... | [
431,
0
] | [
506,
5
] | python | en | ['en', 'error', 'th'] | False |
test_TupleS3StoreBackend_with_empty_prefixes | () |
What does this test test and why?
We will exercise the store backend's set method twice and then verify
that the we calling get and list methods will return the expected keys.
We will also check that the objects are stored on S3 at the expected location,
and that the correct S3 URL for the object... |
What does this test test and why? | def test_TupleS3StoreBackend_with_empty_prefixes():
"""
What does this test test and why?
We will exercise the store backend's set method twice and then verify
that the we calling get and list methods will return the expected keys.
We will also check that the objects are stored on S3 at the expect... | [
"def",
"test_TupleS3StoreBackend_with_empty_prefixes",
"(",
")",
":",
"bucket",
"=",
"\"leakybucket\"",
"prefix",
"=",
"\"\"",
"# create a bucket in Moto's mock AWS environment",
"conn",
"=",
"boto3",
".",
"resource",
"(",
"\"s3\"",
",",
"region_name",
"=",
"\"us-east-1\"... | [
698,
0
] | [
751,
5
] | python | en | ['en', 'error', 'th'] | False |
test_TupleGCSStoreBackend_base_public_path | () |
What does this test and why?
the base_public_path parameter allows users to point to a custom DNS when hosting Data docs.
This test will exercise the get_url_for_key method twice to see that we are getting the expected url,
with or without base_public_path
|
What does this test and why? | def test_TupleGCSStoreBackend_base_public_path():
"""
What does this test and why?
the base_public_path parameter allows users to point to a custom DNS when hosting Data docs.
This test will exercise the get_url_for_key method twice to see that we are getting the expected url,
with or without base... | [
"def",
"test_TupleGCSStoreBackend_base_public_path",
"(",
")",
":",
"bucket",
"=",
"\"leakybucket\"",
"prefix",
"=",
"\"this_is_a_test_prefix\"",
"project",
"=",
"\"dummy-project\"",
"base_public_path",
"=",
"\"http://www.test.com/\"",
"with",
"patch",
"(",
"\"google.cloud.st... | [
754,
0
] | [
798,
5
] | python | en | ['en', 'error', 'th'] | False |
test_TupleGCSStoreBackend | () |
What does this test test and why?
Since no package like moto exists for GCP services, we mock the GCS client
and assert that the store backend makes the right calls for set, get, and list.
TODO : One option may be to have a GCS Store in Docker, which can be use to "actually" run these tests.
|
What does this test test and why? | def test_TupleGCSStoreBackend():
# pytest.importorskip("google-cloud-storage")
"""
What does this test test and why?
Since no package like moto exists for GCP services, we mock the GCS client
and assert that the store backend makes the right calls for set, get, and list.
TODO : One option may ... | [
"def",
"test_TupleGCSStoreBackend",
"(",
")",
":",
"# pytest.importorskip(\"google-cloud-storage\")",
"bucket",
"=",
"\"leakybucket\"",
"prefix",
"=",
"\"this_is_a_test_prefix\"",
"project",
"=",
"\"dummy-project\"",
"base_public_path",
"=",
"\"http://www.test.com/\"",
"with",
... | [
801,
0
] | [
915,
5
] | python | en | ['en', 'error', 'th'] | False |
test_TupleAzureBlobStoreBackend | () |
What does this test test and why?
Since no package like moto exists for Azure-Blob services, we mock the Azure-blob client
and assert that the store backend makes the right calls for set, get, and list.
|
What does this test test and why?
Since no package like moto exists for Azure-Blob services, we mock the Azure-blob client
and assert that the store backend makes the right calls for set, get, and list.
| def test_TupleAzureBlobStoreBackend():
pytest.importorskip("azure-storage-blob")
"""
What does this test test and why?
Since no package like moto exists for Azure-Blob services, we mock the Azure-blob client
and assert that the store backend makes the right calls for set, get, and list.
"""
... | [
"def",
"test_TupleAzureBlobStoreBackend",
"(",
")",
":",
"pytest",
".",
"importorskip",
"(",
"\"azure-storage-blob\"",
")",
"connection_string",
"=",
"\"this_is_a_test_conn_string\"",
"prefix",
"=",
"\"this_is_a_test_prefix\"",
"container",
"=",
"\"dummy-container\"",
"my_sto... | [
918,
0
] | [
983,
84
] | python | en | ['en', 'error', 'th'] | False |
test_TupleS3StoreBackend_list_over_1000_keys | () |
What does this test test and why?
TupleS3StoreBackend.list_keys() should be able to list over 1000 keys
which is the current limit for boto3.list_objects and boto3.list_objects_v2 methods.
See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/paginators.html
We will create a bucket wi... |
What does this test test and why? | def test_TupleS3StoreBackend_list_over_1000_keys():
"""
What does this test test and why?
TupleS3StoreBackend.list_keys() should be able to list over 1000 keys
which is the current limit for boto3.list_objects and boto3.list_objects_v2 methods.
See https://boto3.amazonaws.com/v1/documentation/api/l... | [
"def",
"test_TupleS3StoreBackend_list_over_1000_keys",
"(",
")",
":",
"bucket",
"=",
"\"leakybucket\"",
"prefix",
"=",
"\"my_prefix\"",
"# create a bucket in Moto's mock AWS environment",
"conn",
"=",
"boto3",
".",
"resource",
"(",
"\"s3\"",
",",
"region_name",
"=",
"\"us... | [
987,
0
] | [
1048,
43
] | python | en | ['en', 'error', 'th'] | False |
test_GeCloudStoreBackend | () |
What does this test test and why?
Since GeCloudStoreBackend relies on GE Cloud, we mock requests.post, requests.get, and
requests.patch and assert that the right calls are made for set, get, list, and remove_key.
|
What does this test test and why? | def test_GeCloudStoreBackend():
"""
What does this test test and why?
Since GeCloudStoreBackend relies on GE Cloud, we mock requests.post, requests.get, and
requests.patch and assert that the right calls are made for set, get, list, and remove_key.
"""
ge_cloud_base_url = "https://app.greatexpe... | [
"def",
"test_GeCloudStoreBackend",
"(",
")",
":",
"ge_cloud_base_url",
"=",
"\"https://app.greatexpectations.io/\"",
"ge_cloud_credentials",
"=",
"{",
"\"access_token\"",
":",
"\"1234\"",
",",
"\"account_id\"",
":",
"\"51379b8b-86d3-4fe7-84e9-e1a52f4a414c\"",
",",
"}",
"ge_cl... | [
1051,
0
] | [
1175,
13
] | python | en | ['en', 'error', 'th'] | False |
assertDeepAlmostEqual | (expected, actual, *args, **kwargs) |
Assert that two complex structures have almost equal contents.
Compares lists, dicts and tuples recursively. Checks numeric values
using pyteset.approx and checks all other values with an assertion equality statement
Accepts additional positional and keyword arguments and pass those
intact to pyte... |
Assert that two complex structures have almost equal contents. | def assertDeepAlmostEqual(expected, actual, *args, **kwargs):
"""
Assert that two complex structures have almost equal contents.
Compares lists, dicts and tuples recursively. Checks numeric values
using pyteset.approx and checks all other values with an assertion equality statement
Accepts addition... | [
"def",
"assertDeepAlmostEqual",
"(",
"expected",
",",
"actual",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"is_root",
"=",
"\"__trace\"",
"not",
"in",
"kwargs",
"trace",
"=",
"kwargs",
".",
"pop",
"(",
"\"__trace\"",
",",
"\"ROOT\"",
")",
"try"... | [
27,
0
] | [
62,
17
] | python | en | ['en', 'error', 'th'] | False |
validate_uuid4 | (uuid_string: str) |
Validate that a UUID string is in fact a valid uuid4.
Happily, the uuid module does the actual checking for us.
It is vital that the 'version' kwarg be passed
to the UUID() call, otherwise any 32-character
hex string is considered valid.
From https://gist.github.com/ShawnMilo/7777304
Args:... |
Validate that a UUID string is in fact a valid uuid4.
Happily, the uuid module does the actual checking for us.
It is vital that the 'version' kwarg be passed
to the UUID() call, otherwise any 32-character
hex string is considered valid.
From https://gist.github.com/ShawnMilo/7777304 | def validate_uuid4(uuid_string: str) -> bool:
"""
Validate that a UUID string is in fact a valid uuid4.
Happily, the uuid module does the actual checking for us.
It is vital that the 'version' kwarg be passed
to the UUID() call, otherwise any 32-character
hex string is considered valid.
From... | [
"def",
"validate_uuid4",
"(",
"uuid_string",
":",
"str",
")",
"->",
"bool",
":",
"try",
":",
"val",
"=",
"uuid",
".",
"UUID",
"(",
"uuid_string",
",",
"version",
"=",
"4",
")",
"except",
"ValueError",
":",
"# If it's a value error, then the string",
"# is not ... | [
137,
0
] | [
164,
50
] | python | en | ['en', 'error', 'th'] | False |
CEVAE.__init__ | (self, outcome_dist="studentt", latent_dim=20, hidden_dim=200, num_epochs=50, num_layers=3,
batch_size=100, learning_rate=1e-3, learning_rate_decay=0.1, num_samples=1000, weight_decay=1e-4) |
Initializes CEVAE.
Args:
outcome_dist (str): Outcome distribution as one of: "bernoulli" , "exponential", "laplace", "normal",
and "studentt"
latent_dim (int) : Dimension of the latent variable
hidden_dim (int) : D... |
Initializes CEVAE. | def __init__(self, outcome_dist="studentt", latent_dim=20, hidden_dim=200, num_epochs=50, num_layers=3,
batch_size=100, learning_rate=1e-3, learning_rate_decay=0.1, num_samples=1000, weight_decay=1e-4):
"""
Initializes CEVAE.
Args:
outcome_dist (str): Outcom... | [
"def",
"__init__",
"(",
"self",
",",
"outcome_dist",
"=",
"\"studentt\"",
",",
"latent_dim",
"=",
"20",
",",
"hidden_dim",
"=",
"200",
",",
"num_epochs",
"=",
"50",
",",
"num_layers",
"=",
"3",
",",
"batch_size",
"=",
"100",
",",
"learning_rate",
"=",
"1... | [
37,
4
] | [
67,
40
] | python | en | ['en', 'error', 'th'] | False |
CEVAE.fit | (self, X, treatment, y, p=None) |
Fits CEVAE.
Args:
X (np.matrix or np.array or pd.Dataframe): a feature matrix
treatment (np.array or pd.Series): a treatment vector
y (np.array or pd.Series): an outcome vector
|
Fits CEVAE. | def fit(self, X, treatment, y, p=None):
"""
Fits CEVAE.
Args:
X (np.matrix or np.array or pd.Dataframe): a feature matrix
treatment (np.array or pd.Series): a treatment vector
y (np.array or pd.Series): an outcome vector
"""
X, treatment, y = ... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"treatment",
",",
"y",
",",
"p",
"=",
"None",
")",
":",
"X",
",",
"treatment",
",",
"y",
"=",
"convert_pd_to_np",
"(",
"X",
",",
"treatment",
",",
"y",
")",
"self",
".",
"cevae",
"=",
"CEVAEModel",
"(",
... | [
69,
4
] | [
93,
54
] | python | en | ['en', 'error', 'th'] | False |
CEVAE.predict | (self, X, treatment=None, y=None, p=None) |
Calls predict on fitted DragonNet.
Args:
X (np.matrix or np.array or pd.Dataframe): a feature matrix
Returns:
(np.ndarray): Predictions of treatment effects.
|
Calls predict on fitted DragonNet. | def predict(self, X, treatment=None, y=None, p=None):
"""
Calls predict on fitted DragonNet.
Args:
X (np.matrix or np.array or pd.Dataframe): a feature matrix
Returns:
(np.ndarray): Predictions of treatment effects.
"""
return self.cevae.ite(torch... | [
"def",
"predict",
"(",
"self",
",",
"X",
",",
"treatment",
"=",
"None",
",",
"y",
"=",
"None",
",",
"p",
"=",
"None",
")",
":",
"return",
"self",
".",
"cevae",
".",
"ite",
"(",
"torch",
".",
"tensor",
"(",
"X",
",",
"dtype",
"=",
"torch",
".",
... | [
95,
4
] | [
106,
71
] | python | en | ['en', 'error', 'th'] | False |
CEVAE.fit_predict | (self, X, treatment, y, p=None) |
Fits the CEVAE model and then predicts.
Args:
X (np.matrix or np.array or pd.Dataframe): a feature matrix
treatment (np.array or pd.Series): a treatment vector
y (np.array or pd.Series): an outcome vector
Returns:
(np.ndarray): Predictions of tre... |
Fits the CEVAE model and then predicts. | def fit_predict(self, X, treatment, y, p=None):
"""
Fits the CEVAE model and then predicts.
Args:
X (np.matrix or np.array or pd.Dataframe): a feature matrix
treatment (np.array or pd.Series): a treatment vector
y (np.array or pd.Series): an outcome vector
... | [
"def",
"fit_predict",
"(",
"self",
",",
"X",
",",
"treatment",
",",
"y",
",",
"p",
"=",
"None",
")",
":",
"self",
".",
"fit",
"(",
"X",
",",
"treatment",
",",
"y",
")",
"return",
"self",
".",
"predict",
"(",
"X",
")"
] | [
108,
4
] | [
120,
30
] | python | en | ['en', 'error', 'th'] | False |
XmlToString | (content, encoding='utf-8', pretty=False) | Writes the XML content to disk, touching the file only if it has changed.
Visual Studio files have a lot of pre-defined structures. This function makes
it easy to represent these structures as Python data structures, instead of
having to create a lot of function calls.
Each XML element of the content is rep... | Writes the XML content to disk, touching the file only if it has changed. | def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
Visual Studio files have a lot of pre-defined structures. This function makes
it easy to represent these structures as Python data structures, instead of
having to create a l... | [
"def",
"XmlToString",
"(",
"content",
",",
"encoding",
"=",
"'utf-8'",
",",
"pretty",
"=",
"False",
")",
":",
"# We create a huge list of all the elements of the file.",
"xml_parts",
"=",
"[",
"'<?xml version=\"1.0\" encoding=\"%s\"?>'",
"%",
"encoding",
"]",
"if",
"pre... | [
9,
0
] | [
54,
27
] | python | en | ['en', 'en', 'en'] | True |
_ConstructContentList | (xml_parts, specification, pretty, level=0) | Appends the XML parts corresponding to the specification.
Args:
xml_parts: A list of XML parts to be appended to.
specification: The specification of the element. See EasyXml docs.
pretty: True if we want pretty printing with indents and new lines.
level: Indentation level.
| Appends the XML parts corresponding to the specification. | def _ConstructContentList(xml_parts, specification, pretty, level=0):
""" Appends the XML parts corresponding to the specification.
Args:
xml_parts: A list of XML parts to be appended to.
specification: The specification of the element. See EasyXml docs.
pretty: True if we want pretty printing with i... | [
"def",
"_ConstructContentList",
"(",
"xml_parts",
",",
"specification",
",",
"pretty",
",",
"level",
"=",
"0",
")",
":",
"# The first item in a specification is the name of the element.",
"if",
"pretty",
":",
"indentation",
"=",
"' '",
"*",
"level",
"new_line",
"=",
... | [
57,
0
] | [
102,
39
] | python | en | ['en', 'en', 'en'] | True |
WriteXmlIfChanged | (content, path, encoding='utf-8', pretty=False,
win32=False) | Writes the XML content to disk, touching the file only if it has changed.
Args:
content: The structured content to be written.
path: Location of the file.
encoding: The encoding to report on the first line of the XML file.
pretty: True if we want pretty printing with indents and new lines.
| Writes the XML content to disk, touching the file only if it has changed. | def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False,
win32=False):
""" Writes the XML content to disk, touching the file only if it has changed.
Args:
content: The structured content to be written.
path: Location of the file.
encoding: The encoding to report on th... | [
"def",
"WriteXmlIfChanged",
"(",
"content",
",",
"path",
",",
"encoding",
"=",
"'utf-8'",
",",
"pretty",
"=",
"False",
",",
"win32",
"=",
"False",
")",
":",
"xml_string",
"=",
"XmlToString",
"(",
"content",
",",
"encoding",
",",
"pretty",
")",
"if",
"win... | [
105,
0
] | [
135,
13
] | python | en | ['en', 'en', 'en'] | True |
_XmlEscape | (value, attr=False) | Escape a string for inclusion in XML. | Escape a string for inclusion in XML. | def _XmlEscape(value, attr=False):
""" Escape a string for inclusion in XML."""
def replace(match):
m = match.string[match.start() : match.end()]
# don't replace single quotes in attrs
if attr and m == "'":
return m
return _xml_escape_map[m]
return _xml_escape_re.sub(replace, value) | [
"def",
"_XmlEscape",
"(",
"value",
",",
"attr",
"=",
"False",
")",
":",
"def",
"replace",
"(",
"match",
")",
":",
"m",
"=",
"match",
".",
"string",
"[",
"match",
".",
"start",
"(",
")",
":",
"match",
".",
"end",
"(",
")",
"]",
"# don't replace sing... | [
153,
0
] | [
161,
43
] | python | en | ['en', 'it', 'en'] | True |
store | () | Store operations | Store operations | def store():
"""Store operations"""
pass | [
"def",
"store",
"(",
")",
":",
"pass"
] | [
7,
0
] | [
9,
8
] | python | en | ['en', 'en', 'en'] | False |
store_list | (directory) | List known Stores. | List known Stores. | def store_list(directory):
"""List known Stores."""
context = toolkit.load_data_context_with_error_handling(directory)
try:
stores = context.list_stores()
if len(stores) == 0:
cli_message("No Stores found")
toolkit.send_usage_message(
data_context=co... | [
"def",
"store_list",
"(",
"directory",
")",
":",
"context",
"=",
"toolkit",
".",
"load_data_context_with_error_handling",
"(",
"directory",
")",
"try",
":",
"stores",
"=",
"context",
".",
"list_stores",
"(",
")",
"if",
"len",
"(",
"stores",
")",
"==",
"0",
... | [
19,
0
] | [
50,
15
] | python | en | ['en', 'en', 'en'] | True |
Finder.__init__ | (self, reader: Optional[BaseReader], retriever: Optional[BaseRetriever]) |
Initialize a Finder instance.
:param reader: Reader instance
:param retriever: Retriever instance
|
Initialize a Finder instance. | def __init__(self, reader: Optional[BaseReader], retriever: Optional[BaseRetriever]):
"""
Initialize a Finder instance.
:param reader: Reader instance
:param retriever: Retriever instance
"""
logger.warning(
"""DEPRECATION WARNINGS:
1. The 'Finde... | [
"def",
"__init__",
"(",
"self",
",",
"reader",
":",
"Optional",
"[",
"BaseReader",
"]",
",",
"retriever",
":",
"Optional",
"[",
"BaseRetriever",
"]",
")",
":",
"logger",
".",
"warning",
"(",
"\"\"\"DEPRECATION WARNINGS: \n 1. The 'Finder' class will be depr... | [
23,
4
] | [
41,
95
] | python | en | ['en', 'error', 'th'] | False |
Finder.get_answers | (self, question: str, top_k_reader: int = 1, top_k_retriever: int = 10, filters: Optional[dict] = None, index: str = None) |
Get top k answers for a given question.
:param question: The question string
:param top_k_reader: Number of answers returned by the reader
:param top_k_retriever: Number of text units to be retrieved
:param filters: Limit scope to documents having the given meta data values.
... |
Get top k answers for a given question. | def get_answers(self, question: str, top_k_reader: int = 1, top_k_retriever: int = 10, filters: Optional[dict] = None, index: str = None):
"""
Get top k answers for a given question.
:param question: The question string
:param top_k_reader: Number of answers returned by the reader
... | [
"def",
"get_answers",
"(",
"self",
",",
"question",
":",
"str",
",",
"top_k_reader",
":",
"int",
"=",
"1",
",",
"top_k_retriever",
":",
"int",
"=",
"10",
",",
"filters",
":",
"Optional",
"[",
"dict",
"]",
"=",
"None",
",",
"index",
":",
"str",
"=",
... | [
43,
4
] | [
93,
22
] | python | en | ['en', 'error', 'th'] | False |
Finder.get_answers_via_similar_questions | (self, question: str, top_k_retriever: int = 10, filters: Optional[dict] = None, index: str = None) |
Get top k answers for a given question using only a retriever.
:param question: The question string
:param top_k_retriever: Number of text units to be retrieved
:param filters: Limit scope to documents having the given meta data values.
The format for the dict is ``{"key-1"... |
Get top k answers for a given question using only a retriever. | def get_answers_via_similar_questions(self, question: str, top_k_retriever: int = 10, filters: Optional[dict] = None, index: str = None):
"""
Get top k answers for a given question using only a retriever.
:param question: The question string
:param top_k_retriever: Number of text units ... | [
"def",
"get_answers_via_similar_questions",
"(",
"self",
",",
"question",
":",
"str",
",",
"top_k_retriever",
":",
"int",
"=",
"10",
",",
"filters",
":",
"Optional",
"[",
"dict",
"]",
"=",
"None",
",",
"index",
":",
"str",
"=",
"None",
")",
":",
"if",
... | [
95,
4
] | [
133,
22
] | python | en | ['en', 'error', 'th'] | False |
Finder.eval | (
self,
label_index: str,
doc_index: str,
label_origin: str = "gold_label",
top_k_retriever: int = 10,
top_k_reader: int = 10,
return_preds: bool = False,
) |
Evaluation of the whole pipeline by first evaluating the Retriever and then evaluating the Reader on the result
of the Retriever.
Returns a dict containing the following metrics:
- ``"retriever_recall"``: Proportion of questions for which correct document is among retrieved document... |
Evaluation of the whole pipeline by first evaluating the Retriever and then evaluating the Reader on the result
of the Retriever.
Returns a dict containing the following metrics:
- ``"retriever_recall"``: Proportion of questions for which correct document is among retrieved document... | def eval(
self,
label_index: str,
doc_index: str,
label_origin: str = "gold_label",
top_k_retriever: int = 10,
top_k_reader: int = 10,
return_preds: bool = False,
):
"""
Evaluation of the whole pipeline by first evaluating the Retriever and the... | [
"def",
"eval",
"(",
"self",
",",
"label_index",
":",
"str",
",",
"doc_index",
":",
"str",
",",
"label_origin",
":",
"str",
"=",
"\"gold_label\"",
",",
"top_k_retriever",
":",
"int",
"=",
"10",
",",
"top_k_reader",
":",
"int",
"=",
"10",
",",
"return_pred... | [
135,
4
] | [
289,
31
] | python | en | ['en', 'error', 'th'] | False |
Finder.eval_batch | (
self,
label_index: str,
doc_index : str,
label_origin: str = "gold_label",
top_k_retriever: int = 10,
top_k_reader: int = 10,
batch_size: int = 50,
return_preds: bool = False,
) |
Evaluation of the whole pipeline by first evaluating the Retriever and then evaluating the Reader on the result
of the Retriever. Passes all retrieved question-document pairs to the Reader at once.
Returns a dict containing the following metrics:
- ``"retriever_recall"``: Proportion... |
Evaluation of the whole pipeline by first evaluating the Retriever and then evaluating the Reader on the result
of the Retriever. Passes all retrieved question-document pairs to the Reader at once.
Returns a dict containing the following metrics:
- ``"retriever_recall"``: Proportion... | def eval_batch(
self,
label_index: str,
doc_index : str,
label_origin: str = "gold_label",
top_k_retriever: int = 10,
top_k_reader: int = 10,
batch_size: int = 50,
return_preds: bool = False,
):
"""
Evaluation of the whole pipeline by f... | [
"def",
"eval_batch",
"(",
"self",
",",
"label_index",
":",
"str",
",",
"doc_index",
":",
"str",
",",
"label_origin",
":",
"str",
"=",
"\"gold_label\"",
",",
"top_k_retriever",
":",
"int",
"=",
"10",
",",
"top_k_reader",
":",
"int",
"=",
"10",
",",
"batch... | [
291,
4
] | [
407,
26
] | python | en | ['en', 'error', 'th'] | False |
suite | (ctx) | Expectation Suite operations | Expectation Suite operations | def suite(ctx):
"""Expectation Suite operations"""
directory: str = toolkit.parse_cli_config_file_location(
config_file_location=ctx.obj.config_file_location
).get("directory")
context: DataContext = toolkit.load_data_context_with_error_handling(
directory=directory,
from_cli_upg... | [
"def",
"suite",
"(",
"ctx",
")",
":",
"directory",
":",
"str",
"=",
"toolkit",
".",
"parse_cli_config_file_location",
"(",
"config_file_location",
"=",
"ctx",
".",
"obj",
".",
"config_file_location",
")",
".",
"get",
"(",
"\"directory\"",
")",
"context",
":",
... | [
34,
0
] | [
52,
57
] | python | en | ['ca', 'en', 'en'] | True |
suite_new | (
ctx,
expectation_suite,
interactive_flag,
manual_flag,
profile,
batch_request,
no_jupyter,
) |
Create a new Expectation Suite.
Edit in jupyter notebooks, or skip with the --no-jupyter flag.
|
Create a new Expectation Suite.
Edit in jupyter notebooks, or skip with the --no-jupyter flag.
| def suite_new(
ctx,
expectation_suite,
interactive_flag,
manual_flag,
profile,
batch_request,
no_jupyter,
):
"""
Create a new Expectation Suite.
Edit in jupyter notebooks, or skip with the --no-jupyter flag.
"""
context: DataContext = ctx.obj.data_context
usage_event_... | [
"def",
"suite_new",
"(",
"ctx",
",",
"expectation_suite",
",",
"interactive_flag",
",",
"manual_flag",
",",
"profile",
",",
"batch_request",
",",
"no_jupyter",
",",
")",
":",
"context",
":",
"DataContext",
"=",
"ctx",
".",
"obj",
".",
"data_context",
"usage_ev... | [
105,
0
] | [
138,
5
] | python | en | ['en', 'error', 'th'] | False |
_process_suite_new_flags_and_prompt | (
context: DataContext,
usage_event_end: str,
interactive_flag: bool,
manual_flag: bool,
profile: bool,
batch_request: Optional[str] = None,
) |
Process various optional suite new flags and prompt if there is not enough information from the flags.
Args:
context: Data Context for use in sending error messages if any
usage_event_end: event name for ending usage stats message
interactive_flag: --interactive from the `suite new` CLI... |
Process various optional suite new flags and prompt if there is not enough information from the flags.
Args:
context: Data Context for use in sending error messages if any
usage_event_end: event name for ending usage stats message
interactive_flag: --interactive from the `suite new` CLI... | def _process_suite_new_flags_and_prompt(
context: DataContext,
usage_event_end: str,
interactive_flag: bool,
manual_flag: bool,
profile: bool,
batch_request: Optional[str] = None,
) -> Dict[str, Optional[bool]]:
"""
Process various optional suite new flags and prompt if there is not enou... | [
"def",
"_process_suite_new_flags_and_prompt",
"(",
"context",
":",
"DataContext",
",",
"usage_event_end",
":",
"str",
",",
"interactive_flag",
":",
"bool",
",",
"manual_flag",
":",
"bool",
",",
"profile",
":",
"bool",
",",
"batch_request",
":",
"Optional",
"[",
... | [
141,
0
] | [
240,
59
] | python | en | ['en', 'error', 'th'] | False |
suite_edit | (
ctx,
expectation_suite,
interactive_flag,
manual_flag,
datasource_name,
batch_request,
no_jupyter,
) |
Edit an existing Expectation Suite.
The SUITE argument is required. This is the name you gave to the suite
when you created it.
The edit command will help you specify a batch interactively. Or you can
specify them manually by providing --batch-request in valid JSON format.
Read more about sp... |
Edit an existing Expectation Suite. | def suite_edit(
ctx,
expectation_suite,
interactive_flag,
manual_flag,
datasource_name,
batch_request,
no_jupyter,
):
"""
Edit an existing Expectation Suite.
The SUITE argument is required. This is the name you gave to the suite
when you created it.
The edit command wil... | [
"def",
"suite_edit",
"(",
"ctx",
",",
"expectation_suite",
",",
"interactive_flag",
",",
"manual_flag",
",",
"datasource_name",
",",
"batch_request",
",",
"no_jupyter",
",",
")",
":",
"context",
":",
"DataContext",
"=",
"ctx",
".",
"obj",
".",
"data_context",
... | [
391,
0
] | [
440,
5
] | python | en | ['en', 'error', 'th'] | False |
_process_suite_edit_flags_and_prompt | (
context: DataContext,
usage_event_end: str,
interactive_flag: bool,
manual_flag: bool,
datasource_name: Optional[str] = None,
batch_request: Optional[str] = None,
) |
Process various optional suite edit flags and prompt if there is not enough information from the flags.
Args:
context: Data Context for use in sending error messages if any
usage_event_end: event name for ending usage stats message
interactive_flag: --interactive from the `suite new` CL... |
Process various optional suite edit flags and prompt if there is not enough information from the flags.
Args:
context: Data Context for use in sending error messages if any
usage_event_end: event name for ending usage stats message
interactive_flag: --interactive from the `suite new` CL... | def _process_suite_edit_flags_and_prompt(
context: DataContext,
usage_event_end: str,
interactive_flag: bool,
manual_flag: bool,
datasource_name: Optional[str] = None,
batch_request: Optional[str] = None,
) -> bool:
"""
Process various optional suite edit flags and prompt if there is not... | [
"def",
"_process_suite_edit_flags_and_prompt",
"(",
"context",
":",
"DataContext",
",",
"usage_event_end",
":",
"str",
",",
"interactive_flag",
":",
"bool",
",",
"manual_flag",
":",
"bool",
",",
"datasource_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
"... | [
443,
0
] | [
541,
22
] | python | en | ['en', 'error', 'th'] | False |
suite_demo | (ctx) | This command is not supported in the v3 (Batch Request) API. | This command is not supported in the v3 (Batch Request) API. | def suite_demo(ctx):
"""This command is not supported in the v3 (Batch Request) API."""
context: DataContext = ctx.obj.data_context
usage_event_end: str = ctx.obj.usage_event_end
toolkit.send_usage_message(
data_context=context, event=usage_event_end, success=True
)
cli_message(
... | [
"def",
"suite_demo",
"(",
"ctx",
")",
":",
"context",
":",
"DataContext",
"=",
"ctx",
".",
"obj",
".",
"data_context",
"usage_event_end",
":",
"str",
"=",
"ctx",
".",
"obj",
".",
"usage_event_end",
"toolkit",
".",
"send_usage_message",
"(",
"data_context",
"... | [
695,
0
] | [
704,
5
] | python | en | ['en', 'en', 'en'] | True |
suite_delete | (ctx, suite) |
Delete an Expectation Suite from the Expectation Store.
|
Delete an Expectation Suite from the Expectation Store.
| def suite_delete(ctx, suite):
"""
Delete an Expectation Suite from the Expectation Store.
"""
context: DataContext = ctx.obj.data_context
usage_event_end: str = ctx.obj.usage_event_end
try:
suite_names: List[str] = context.list_expectation_suite_names()
except Exception as e:
... | [
"def",
"suite_delete",
"(",
"ctx",
",",
"suite",
")",
":",
"context",
":",
"DataContext",
"=",
"ctx",
".",
"obj",
".",
"data_context",
"usage_event_end",
":",
"str",
"=",
"ctx",
".",
"obj",
".",
"usage_event_end",
"try",
":",
"suite_names",
":",
"List",
... | [
710,
0
] | [
752,
5
] | python | en | ['en', 'error', 'th'] | False |
suite_list | (ctx) | List existing Expectation Suites. | List existing Expectation Suites. | def suite_list(ctx):
"""List existing Expectation Suites."""
context: DataContext = ctx.obj.data_context
usage_event_end: str = ctx.obj.usage_event_end
try:
suite_names: List[str] = context.list_expectation_suite_names()
except Exception as e:
toolkit.send_usage_message(
... | [
"def",
"suite_list",
"(",
"ctx",
")",
":",
"context",
":",
"DataContext",
"=",
"ctx",
".",
"obj",
".",
"data_context",
"usage_event_end",
":",
"str",
"=",
"ctx",
".",
"obj",
".",
"usage_event_end",
"try",
":",
"suite_names",
":",
"List",
"[",
"str",
"]",... | [
757,
0
] | [
789,
5
] | python | en | ['ca', 'en', 'en'] | True |
ColumnsExistProfiler._profile | (cls, dataset, configuration=None) |
This function will take a dataset and add expectations that each column present exists.
Args:
dataset (great_expectations.dataset): The dataset to profile and to which to add expectations.
configuration: Configuration for select profilers.
|
This function will take a dataset and add expectations that each column present exists. | def _profile(cls, dataset, configuration=None):
"""
This function will take a dataset and add expectations that each column present exists.
Args:
dataset (great_expectations.dataset): The dataset to profile and to which to add expectations.
configuration: Configuration f... | [
"def",
"_profile",
"(",
"cls",
",",
"dataset",
",",
"configuration",
"=",
"None",
")",
":",
"if",
"not",
"hasattr",
"(",
"dataset",
",",
"\"get_table_columns\"",
")",
":",
"warnings",
".",
"warn",
"(",
"\"No columns list found in dataset; no profiling performed.\"",... | [
9,
4
] | [
34,
68
] | python | en | ['en', 'error', 'th'] | False |
ExpectColumnMostCommonValueToBeInSet.validate_configuration | (self, configuration: Optional[ExpectationConfiguration]) | Validating that user has inputted a value set and that configuration has been initialized | Validating that user has inputted a value set and that configuration has been initialized | def validate_configuration(self, configuration: Optional[ExpectationConfiguration]):
"""Validating that user has inputted a value set and that configuration has been initialized"""
super().validate_configuration(configuration)
if configuration is None:
configuration = self.configurat... | [
"def",
"validate_configuration",
"(",
"self",
",",
"configuration",
":",
"Optional",
"[",
"ExpectationConfiguration",
"]",
")",
":",
"super",
"(",
")",
".",
"validate_configuration",
"(",
"configuration",
")",
"if",
"configuration",
"is",
"None",
":",
"configurati... | [
96,
4
] | [
112,
19
] | python | en | ['en', 'en', 'en'] | True |
open_process | (
command, *, stdin=None, stdout=None, stderr=None, **options
) | r"""Execute a child program in a new process.
After construction, you can interact with the child process by writing
data to its `~Process.stdin` stream (a `~trio.abc.SendStream`), reading
data from its `~Process.stdout` and/or `~Process.stderr` streams (both
`~trio.abc.ReceiveStream`\s), sending it si... | r"""Execute a child program in a new process. | async def open_process(
command, *, stdin=None, stdout=None, stderr=None, **options
) -> Process:
r"""Execute a child program in a new process.
After construction, you can interact with the child process by writing
data to its `~Process.stdin` stream (a `~trio.abc.SendStream`), reading
data from it... | [
"async",
"def",
"open_process",
"(",
"command",
",",
"*",
",",
"stdin",
"=",
"None",
",",
"stdout",
"=",
"None",
",",
"stderr",
"=",
"None",
",",
"*",
"*",
"options",
")",
"->",
"Process",
":",
"for",
"key",
"in",
"(",
"\"universal_newlines\"",
",",
... | [
278,
0
] | [
390,
71
] | python | en | ['en', 'en', 'en'] | True |
run_process | (
command,
*,
stdin=b"",
capture_stdout=False,
capture_stderr=False,
check=True,
deliver_cancel=None,
**options,
) | Run ``command`` in a subprocess, wait for it to complete, and
return a :class:`subprocess.CompletedProcess` instance describing
the results.
If cancelled, :func:`run_process` terminates the subprocess and
waits for it to exit before propagating the cancellation, like
:meth:`Process.aclose`.
**... | Run ``command`` in a subprocess, wait for it to complete, and
return a :class:`subprocess.CompletedProcess` instance describing
the results. | async def run_process(
command,
*,
stdin=b"",
capture_stdout=False,
capture_stderr=False,
check=True,
deliver_cancel=None,
**options,
):
"""Run ``command`` in a subprocess, wait for it to complete, and
return a :class:`subprocess.CompletedProcess` instance describing
the resu... | [
"async",
"def",
"run_process",
"(",
"command",
",",
"*",
",",
"stdin",
"=",
"b\"\"",
",",
"capture_stdout",
"=",
"False",
",",
"capture_stderr",
"=",
"False",
",",
"check",
"=",
"True",
",",
"deliver_cancel",
"=",
"None",
",",
"*",
"*",
"options",
",",
... | [
418,
0
] | [
649,
86
] | python | en | ['en', 'en', 'en'] | True |
Process.returncode | (self) | The exit status of the process (an integer), or ``None`` if it's
still running.
By convention, a return code of zero indicates success. On
UNIX, negative values indicate termination due to a signal,
e.g., -11 if terminated by signal 11 (``SIGSEGV``). On
Windows, a process that... | The exit status of the process (an integer), or ``None`` if it's
still running. | def returncode(self):
"""The exit status of the process (an integer), or ``None`` if it's
still running.
By convention, a return code of zero indicates success. On
UNIX, negative values indicate termination due to a signal,
e.g., -11 if terminated by signal 11 (``SIGSEGV``). O... | [
"def",
"returncode",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_proc",
".",
"poll",
"(",
")",
"if",
"result",
"is",
"not",
"None",
":",
"self",
".",
"_close_pidfd",
"(",
")",
"return",
"result"
] | [
161,
4
] | [
180,
21
] | python | en | ['en', 'en', 'en'] | True |
Process.aclose | (self) | Close any pipes we have to the process (both input and output)
and wait for it to exit.
If cancelled, kills the process and waits for it to finish
exiting before propagating the cancellation.
| Close any pipes we have to the process (both input and output)
and wait for it to exit. | async def aclose(self):
"""Close any pipes we have to the process (both input and output)
and wait for it to exit.
If cancelled, kills the process and waits for it to finish
exiting before propagating the cancellation.
"""
with trio.CancelScope(shield=True):
... | [
"async",
"def",
"aclose",
"(",
"self",
")",
":",
"with",
"trio",
".",
"CancelScope",
"(",
"shield",
"=",
"True",
")",
":",
"if",
"self",
".",
"stdin",
"is",
"not",
"None",
":",
"await",
"self",
".",
"stdin",
".",
"aclose",
"(",
")",
"if",
"self",
... | [
182,
4
] | [
202,
37
] | python | en | ['en', 'en', 'en'] | True |
Process.wait | (self) | Block until the process exits.
Returns:
The exit status of the process; see :attr:`returncode`.
| Block until the process exits. | async def wait(self):
"""Block until the process exits.
Returns:
The exit status of the process; see :attr:`returncode`.
"""
async with self._wait_lock:
if self.poll() is None:
if self._pidfd is not None:
await trio.lowlevel.wait... | [
"async",
"def",
"wait",
"(",
"self",
")",
":",
"async",
"with",
"self",
".",
"_wait_lock",
":",
"if",
"self",
".",
"poll",
"(",
")",
"is",
"None",
":",
"if",
"self",
".",
"_pidfd",
"is",
"not",
"None",
":",
"await",
"trio",
".",
"lowlevel",
".",
... | [
209,
4
] | [
230,
36
] | python | en | ['en', 'ca', 'en'] | True |
Process.poll | (self) | Returns the exit status of the process (an integer), or ``None`` if
it's still running.
Note that on Trio (unlike the standard library `subprocess.Popen`),
``process.poll()`` and ``process.returncode`` always give the same
result. See `returncode` for more details. This method is only
... | Returns the exit status of the process (an integer), or ``None`` if
it's still running. | def poll(self):
"""Returns the exit status of the process (an integer), or ``None`` if
it's still running.
Note that on Trio (unlike the standard library `subprocess.Popen`),
``process.poll()`` and ``process.returncode`` always give the same
result. See `returncode` for more det... | [
"def",
"poll",
"(",
"self",
")",
":",
"return",
"self",
".",
"returncode"
] | [
232,
4
] | [
242,
30
] | python | en | ['en', 'en', 'en'] | True |
Process.send_signal | (self, sig) | Send signal ``sig`` to the process.
On UNIX, ``sig`` may be any signal defined in the
:mod:`signal` module, such as ``signal.SIGINT`` or
``signal.SIGTERM``. On Windows, it may be anything accepted by
the standard library :meth:`subprocess.Popen.send_signal`.
| Send signal ``sig`` to the process. | def send_signal(self, sig):
"""Send signal ``sig`` to the process.
On UNIX, ``sig`` may be any signal defined in the
:mod:`signal` module, such as ``signal.SIGINT`` or
``signal.SIGTERM``. On Windows, it may be anything accepted by
the standard library :meth:`subprocess.Popen.sen... | [
"def",
"send_signal",
"(",
"self",
",",
"sig",
")",
":",
"self",
".",
"_proc",
".",
"send_signal",
"(",
"sig",
")"
] | [
244,
4
] | [
252,
35
] | python | en | ['en', 'en', 'en'] | True |
Process.terminate | (self) | Terminate the process, politely if possible.
On UNIX, this is equivalent to
``send_signal(signal.SIGTERM)``; by convention this requests
graceful termination, but a misbehaving or buggy process might
ignore it. On Windows, :meth:`terminate` forcibly terminates the
process in the... | Terminate the process, politely if possible. | def terminate(self):
"""Terminate the process, politely if possible.
On UNIX, this is equivalent to
``send_signal(signal.SIGTERM)``; by convention this requests
graceful termination, but a misbehaving or buggy process might
ignore it. On Windows, :meth:`terminate` forcibly termi... | [
"def",
"terminate",
"(",
"self",
")",
":",
"self",
".",
"_proc",
".",
"terminate",
"(",
")"
] | [
254,
4
] | [
263,
30
] | python | en | ['en', 'en', 'en'] | True |
Process.kill | (self) | Immediately terminate the process.
On UNIX, this is equivalent to
``send_signal(signal.SIGKILL)``. On Windows, it calls
``TerminateProcess``. In both cases, the process cannot
prevent itself from being killed, but the termination will be
delivered asynchronously; use :meth:`wai... | Immediately terminate the process. | def kill(self):
"""Immediately terminate the process.
On UNIX, this is equivalent to
``send_signal(signal.SIGKILL)``. On Windows, it calls
``TerminateProcess``. In both cases, the process cannot
prevent itself from being killed, but the termination will be
delivered asy... | [
"def",
"kill",
"(",
"self",
")",
":",
"self",
".",
"_proc",
".",
"kill",
"(",
")"
] | [
265,
4
] | [
275,
25
] | python | en | ['en', 'en', 'en'] | True |
BaseLearner.bootstrap | (self, X, treatment, y, p=None, size=10000) | Runs a single bootstrap. Fits on bootstrapped sample, then predicts on whole population. | Runs a single bootstrap. Fits on bootstrapped sample, then predicts on whole population. | def bootstrap(self, X, treatment, y, p=None, size=10000):
"""Runs a single bootstrap. Fits on bootstrapped sample, then predicts on whole population."""
idxs = np.random.choice(np.arange(0, X.shape[0]), size=size)
X_b = X[idxs]
if p is not None:
p_b = {group: _p[idxs] for gr... | [
"def",
"bootstrap",
"(",
"self",
",",
"X",
",",
"treatment",
",",
"y",
",",
"p",
"=",
"None",
",",
"size",
"=",
"10000",
")",
":",
"idxs",
"=",
"np",
".",
"random",
".",
"choice",
"(",
"np",
".",
"arange",
"(",
"0",
",",
"X",
".",
"shape",
"[... | [
32,
4
] | [
45,
37
] | python | en | ['en', 'en', 'en'] | True |
BaseLearner._format_p | (p, t_groups) | Format propensity scores into a dictionary of {treatment group: propensity scores}.
Args:
p (np.ndarray, pd.Series, or dict): propensity scores
t_groups (list): treatment group names.
Returns:
dict of {treatment group: propensity scores}
| Format propensity scores into a dictionary of {treatment group: propensity scores}. | def _format_p(p, t_groups):
"""Format propensity scores into a dictionary of {treatment group: propensity scores}.
Args:
p (np.ndarray, pd.Series, or dict): propensity scores
t_groups (list): treatment group names.
Returns:
dict of {treatment group: propensi... | [
"def",
"_format_p",
"(",
"p",
",",
"t_groups",
")",
":",
"check_p_conditions",
"(",
"p",
",",
"t_groups",
")",
"if",
"isinstance",
"(",
"p",
",",
"(",
"np",
".",
"ndarray",
",",
"pd",
".",
"Series",
")",
")",
":",
"treatment_name",
"=",
"t_groups",
"... | [
48,
4
] | [
66,
16
] | python | en | ['en', 'en', 'en'] | True |
BaseLearner._set_propensity_models | (self, X, treatment, y) | Set self.propensity and self.propensity_models.
It trains propensity models for all treatment groups, save them in self.propensity_models, and
save propensity scores in self.propensity in dictionaries with treatment groups as keys.
It will use self.model_p if available to train propensity mode... | Set self.propensity and self.propensity_models. | def _set_propensity_models(self, X, treatment, y):
"""Set self.propensity and self.propensity_models.
It trains propensity models for all treatment groups, save them in self.propensity_models, and
save propensity scores in self.propensity in dictionaries with treatment groups as keys.
... | [
"def",
"_set_propensity_models",
"(",
"self",
",",
"X",
",",
"treatment",
",",
"y",
")",
":",
"logger",
".",
"info",
"(",
"'Generating propensity score'",
")",
"p",
"=",
"dict",
"(",
")",
"p_model",
"=",
"dict",
"(",
")",
"for",
"group",
"in",
"self",
... | [
68,
4
] | [
96,
27
] | python | en | ['en', 'en', 'en'] | True |
BaseLearner.get_importance | (self, X=None, tau=None, model_tau_feature=None, features=None, method='auto', normalize=True,
test_size=0.3, random_state=None) |
Builds a model (using X to predict estimated/actual tau), and then calculates feature importances
based on a specified method.
Currently supported methods are:
- auto (calculates importance based on estimator's default implementation of feature importance;
estim... |
Builds a model (using X to predict estimated/actual tau), and then calculates feature importances
based on a specified method. | def get_importance(self, X=None, tau=None, model_tau_feature=None, features=None, method='auto', normalize=True,
test_size=0.3, random_state=None):
"""
Builds a model (using X to predict estimated/actual tau), and then calculates feature importances
based on a specified me... | [
"def",
"get_importance",
"(",
"self",
",",
"X",
"=",
"None",
",",
"tau",
"=",
"None",
",",
"model_tau_feature",
"=",
"None",
",",
"features",
"=",
"None",
",",
"method",
"=",
"'auto'",
",",
"normalize",
"=",
"True",
",",
"test_size",
"=",
"0.3",
",",
... | [
98,
4
] | [
129,
41
] | python | en | ['en', 'error', 'th'] | False |
BaseLearner.get_shap_values | (self, X=None, model_tau_feature=None, tau=None, features=None) |
Builds a model (using X to predict estimated/actual tau), and then calculates shapley values.
Args:
X (np.matrix or np.array or pd.Dataframe): a feature matrix
tau (np.array): a treatment effect vector (estimated/actual)
model_tau_feature (sklearn/lightgbm/xgboost mo... |
Builds a model (using X to predict estimated/actual tau), and then calculates shapley values.
Args:
X (np.matrix or np.array or pd.Dataframe): a feature matrix
tau (np.array): a treatment effect vector (estimated/actual)
model_tau_feature (sklearn/lightgbm/xgboost mo... | def get_shap_values(self, X=None, model_tau_feature=None, tau=None, features=None):
"""
Builds a model (using X to predict estimated/actual tau), and then calculates shapley values.
Args:
X (np.matrix or np.array or pd.Dataframe): a feature matrix
tau (np.array): a treatm... | [
"def",
"get_shap_values",
"(",
"self",
",",
"X",
"=",
"None",
",",
"model_tau_feature",
"=",
"None",
",",
"tau",
"=",
"None",
",",
"features",
"=",
"None",
")",
":",
"explainer",
"=",
"Explainer",
"(",
"method",
"=",
"'shapley'",
",",
"control_name",
"="... | [
131,
4
] | [
143,
42
] | python | en | ['en', 'error', 'th'] | False |
BaseLearner.plot_importance | (self, X=None, tau=None, model_tau_feature=None, features=None, method='auto', normalize=True,
test_size=0.3, random_state=None) |
Builds a model (using X to predict estimated/actual tau), and then plots feature importances
based on a specified method.
Currently supported methods are:
- auto (calculates importance based on estimator's default implementation of feature importance;
estimator ... |
Builds a model (using X to predict estimated/actual tau), and then plots feature importances
based on a specified method. | def plot_importance(self, X=None, tau=None, model_tau_feature=None, features=None, method='auto', normalize=True,
test_size=0.3, random_state=None):
"""
Builds a model (using X to predict estimated/actual tau), and then plots feature importances
based on a specified metho... | [
"def",
"plot_importance",
"(",
"self",
",",
"X",
"=",
"None",
",",
"tau",
"=",
"None",
",",
"model_tau_feature",
"=",
"None",
",",
"features",
"=",
"None",
",",
"method",
"=",
"'auto'",
",",
"normalize",
"=",
"True",
",",
"test_size",
"=",
"0.3",
",",
... | [
145,
4
] | [
176,
35
] | python | en | ['en', 'error', 'th'] | False |
BaseLearner.plot_shap_values | (self, X=None, tau=None, model_tau_feature=None, features=None, shap_dict=None, **kwargs) |
Plots distribution of shapley values.
If shapley values have been pre-computed, pass it through the shap_dict parameter.
If shap_dict is not provided, this builds a new model (using X to predict estimated/actual tau),
and then calculates shapley values.
Args:
X (np... |
Plots distribution of shapley values. | def plot_shap_values(self, X=None, tau=None, model_tau_feature=None, features=None, shap_dict=None, **kwargs):
"""
Plots distribution of shapley values.
If shapley values have been pre-computed, pass it through the shap_dict parameter.
If shap_dict is not provided, this builds a new mod... | [
"def",
"plot_shap_values",
"(",
"self",
",",
"X",
"=",
"None",
",",
"tau",
"=",
"None",
",",
"model_tau_feature",
"=",
"None",
",",
"features",
"=",
"None",
",",
"shap_dict",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"override_checks",
"=",
"Fals... | [
178,
4
] | [
197,
55
] | python | en | ['en', 'error', 'th'] | False |
BaseLearner.plot_shap_dependence | (self, treatment_group, feature_idx, X, tau, model_tau_feature=None, features=None,
shap_dict=None, interaction_idx='auto', **kwargs) |
Plots dependency of shapley values for a specified feature, colored by an interaction feature.
If shapley values have been pre-computed, pass it through the shap_dict parameter.
If shap_dict is not provided, this builds a new model (using X to predict estimated/actual tau),
and then ca... |
Plots dependency of shapley values for a specified feature, colored by an interaction feature. | def plot_shap_dependence(self, treatment_group, feature_idx, X, tau, model_tau_feature=None, features=None,
shap_dict=None, interaction_idx='auto', **kwargs):
"""
Plots dependency of shapley values for a specified feature, colored by an interaction feature.
If shapl... | [
"def",
"plot_shap_dependence",
"(",
"self",
",",
"treatment_group",
",",
"feature_idx",
",",
"X",
",",
"tau",
",",
"model_tau_feature",
"=",
"None",
",",
"features",
"=",
"None",
",",
"shap_dict",
"=",
"None",
",",
"interaction_idx",
"=",
"'auto'",
",",
"*",... | [
199,
4
] | [
235,
48
] | python | en | ['en', 'error', 'th'] | False |
VimLexer.is_in | (self, w, mapping) | r"""
It's kind of difficult to decide if something might be a keyword
in VimL because it allows you to abbreviate them. In fact,
'ab[breviate]' is a good example. :ab, :abbre, or :abbreviate are
valid ways to call it so rather than making really awful regexps
like::
... | r"""
It's kind of difficult to decide if something might be a keyword
in VimL because it allows you to abbreviate them. In fact,
'ab[breviate]' is a good example. :ab, :abbre, or :abbreviate are
valid ways to call it so rather than making really awful regexps
like:: | def is_in(self, w, mapping):
r"""
It's kind of difficult to decide if something might be a keyword
in VimL because it allows you to abbreviate them. In fact,
'ab[breviate]' is a good example. :ab, :abbre, or :abbreviate are
valid ways to call it so rather than making really awf... | [
"def",
"is_in",
"(",
"self",
",",
"w",
",",
"mapping",
")",
":",
"p",
"=",
"bisect",
"(",
"mapping",
",",
"(",
"w",
",",
")",
")",
"if",
"p",
">",
"0",
":",
"if",
"mapping",
"[",
"p",
"-",
"1",
"]",
"[",
"0",
"]",
"==",
"w",
"[",
":",
"... | [
130,
4
] | [
151,
20
] | python | cy | ['en', 'cy', 'hi'] | False |
_sql_session_rollback | (self, attr) |
Inject SQLDocumentStore at runtime to do a session rollback each time it is called. This allows to catch
errors where an intended operation is still in a transaction, but not committed to the database.
|
Inject SQLDocumentStore at runtime to do a session rollback each time it is called. This allows to catch
errors where an intended operation is still in a transaction, but not committed to the database.
| def _sql_session_rollback(self, attr):
"""
Inject SQLDocumentStore at runtime to do a session rollback each time it is called. This allows to catch
errors where an intended operation is still in a transaction, but not committed to the database.
"""
method = object.__getattribute__(self, attr)
if... | [
"def",
"_sql_session_rollback",
"(",
"self",
",",
"attr",
")",
":",
"method",
"=",
"object",
".",
"__getattribute__",
"(",
"self",
",",
"attr",
")",
"if",
"callable",
"(",
"method",
")",
":",
"try",
":",
"self",
".",
"session",
".",
"rollback",
"(",
")... | [
28,
0
] | [
40,
17
] | python | en | ['en', 'error', 'th'] | False |
project | () | Project operations | Project operations | def project():
"""Project operations"""
pass | [
"def",
"project",
"(",
")",
":",
"pass"
] | [
14,
0
] | [
16,
8
] | python | en | ['en', 'en', 'en'] | False |
project_check_config | (ctx) | Check a config for validity and help with migrations. | Check a config for validity and help with migrations. | def project_check_config(ctx):
"""Check a config for validity and help with migrations."""
cli_message("Checking your config files for validity...\n")
directory = toolkit.parse_cli_config_file_location(
config_file_location=ctx.obj.config_file_location
).get("directory")
is_config_ok, error_... | [
"def",
"project_check_config",
"(",
"ctx",
")",
":",
"cli_message",
"(",
"\"Checking your config files for validity...\\n\"",
")",
"directory",
"=",
"toolkit",
".",
"parse_cli_config_file_location",
"(",
"config_file_location",
"=",
"ctx",
".",
"obj",
".",
"config_file_lo... | [
21,
0
] | [
37,
65
] | python | en | ['en', 'en', 'en'] | True |
project_upgrade | (ctx) | Upgrade a project after installing the next Great Expectations major version. | Upgrade a project after installing the next Great Expectations major version. | def project_upgrade(ctx):
"""Upgrade a project after installing the next Great Expectations major version."""
cli_message("\nChecking project...")
cli_message(SECTION_SEPARATOR)
directory = toolkit.parse_cli_config_file_location(
config_file_location=ctx.obj.config_file_location
).get("direc... | [
"def",
"project_upgrade",
"(",
"ctx",
")",
":",
"cli_message",
"(",
"\"\\nChecking project...\"",
")",
"cli_message",
"(",
"SECTION_SEPARATOR",
")",
"directory",
"=",
"toolkit",
".",
"parse_cli_config_file_location",
"(",
"config_file_location",
"=",
"ctx",
".",
"obj"... | [
42,
0
] | [
56,
19
] | python | en | ['en', 'en', 'en'] | True |
binary_classification_loss | (concat_true, concat_pred) |
Implements a classification (binary cross-entropy) loss function for DragonNet architecture.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is comprised of (y, treatment)
- concat_pred (tf.tensor): t... |
Implements a classification (binary cross-entropy) loss function for DragonNet architecture. | def binary_classification_loss(concat_true, concat_pred):
"""
Implements a classification (binary cross-entropy) loss function for DragonNet architecture.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is... | [
"def",
"binary_classification_loss",
"(",
"concat_true",
",",
"concat_pred",
")",
":",
"t_true",
"=",
"concat_true",
"[",
":",
",",
"1",
"]",
"t_pred",
"=",
"concat_pred",
"[",
":",
",",
"2",
"]",
"t_pred",
"=",
"(",
"t_pred",
"+",
"0.001",
")",
"/",
"... | [
6,
0
] | [
23,
16
] | python | en | ['en', 'error', 'th'] | False |
regression_loss | (concat_true, concat_pred) |
Implements a regression (squared error) loss function for DragonNet architecture.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is comprised of (y, treatment)
- concat_pred (tf.tensor): tensor of pr... |
Implements a regression (squared error) loss function for DragonNet architecture. | def regression_loss(concat_true, concat_pred):
"""
Implements a regression (squared error) loss function for DragonNet architecture.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is comprised of (y, trea... | [
"def",
"regression_loss",
"(",
"concat_true",
",",
"concat_pred",
")",
":",
"y_true",
"=",
"concat_true",
"[",
":",
",",
"0",
"]",
"t_true",
"=",
"concat_true",
"[",
":",
",",
"1",
"]",
"y0_pred",
"=",
"concat_pred",
"[",
":",
",",
"0",
"]",
"y1_pred",... | [
26,
0
] | [
47,
24
] | python | en | ['en', 'error', 'th'] | False |
dragonnet_loss_binarycross | (concat_true, concat_pred) |
Implements regression + classification loss in one wrapper function.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is comprised of (y, treatment)
- concat_pred (tf.tensor): tensor of predictions, wi... |
Implements regression + classification loss in one wrapper function. | def dragonnet_loss_binarycross(concat_true, concat_pred):
"""
Implements regression + classification loss in one wrapper function.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is comprised of (y, treatm... | [
"def",
"dragonnet_loss_binarycross",
"(",
"concat_true",
",",
"concat_pred",
")",
":",
"return",
"regression_loss",
"(",
"concat_true",
",",
"concat_pred",
")",
"+",
"binary_classification_loss",
"(",
"concat_true",
",",
"concat_pred",
")"
] | [
50,
0
] | [
62,
107
] | python | en | ['en', 'error', 'th'] | False |
treatment_accuracy | (concat_true, concat_pred) |
Returns keras' binary_accuracy between treatment and prediction of propensity.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is comprised of (y, treatment)
- concat_pred (tf.tensor): tensor of predi... |
Returns keras' binary_accuracy between treatment and prediction of propensity. | def treatment_accuracy(concat_true, concat_pred):
"""
Returns keras' binary_accuracy between treatment and prediction of propensity.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is comprised of (y, trea... | [
"def",
"treatment_accuracy",
"(",
"concat_true",
",",
"concat_pred",
")",
":",
"t_true",
"=",
"concat_true",
"[",
":",
",",
"1",
"]",
"t_pred",
"=",
"concat_pred",
"[",
":",
",",
"2",
"]",
"return",
"binary_accuracy",
"(",
"t_true",
",",
"t_pred",
")"
] | [
65,
0
] | [
79,
42
] | python | en | ['en', 'error', 'th'] | False |
track_epsilon | (concat_true, concat_pred) |
Tracks the mean absolute value of epsilon.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is comprised of (y, treatment)
- concat_pred (tf.tensor): tensor of predictions, with shape (n_samples, 4)
... |
Tracks the mean absolute value of epsilon. | def track_epsilon(concat_true, concat_pred):
"""
Tracks the mean absolute value of epsilon.
Args:
- concat_true (tf.tensor): tensor of true samples, with shape (n_samples, 2)
Each row in concat_true is comprised of (y, treatment)
- concat_pred (tf.tensor):... | [
"def",
"track_epsilon",
"(",
"concat_true",
",",
"concat_pred",
")",
":",
"epsilons",
"=",
"concat_pred",
"[",
":",
",",
"3",
"]",
"return",
"tf",
".",
"abs",
"(",
"tf",
".",
"reduce_mean",
"(",
"epsilons",
")",
")"
] | [
82,
0
] | [
95,
43
] | python | en | ['en', 'error', 'th'] | False |
make_tarreg_loss | (ratio=1., dragonnet_loss=dragonnet_loss_binarycross) |
Given a specified loss function, returns the same loss function with targeted regularization.
Args:
ratio (float): weight assigned to the targeted regularization loss component
dragonnet_loss (function): a loss function
Returns:
(function): loss function with targeted regularizatio... |
Given a specified loss function, returns the same loss function with targeted regularization. | def make_tarreg_loss(ratio=1., dragonnet_loss=dragonnet_loss_binarycross):
"""
Given a specified loss function, returns the same loss function with targeted regularization.
Args:
ratio (float): weight assigned to the targeted regularization loss component
dragonnet_loss (function): a loss f... | [
"def",
"make_tarreg_loss",
"(",
"ratio",
"=",
"1.",
",",
"dragonnet_loss",
"=",
"dragonnet_loss_binarycross",
")",
":",
"def",
"tarreg_ATE_unbounded_domain_loss",
"(",
"concat_true",
",",
"concat_pred",
")",
":",
"\"\"\"\n Returns the loss function (specified in outer ... | [
98,
0
] | [
136,
43
] | python | en | ['en', 'error', 'th'] | False |
EpsilonLayer.__init__ | (self) |
Inherits keras' Layer object.
|
Inherits keras' Layer object.
| def __init__(self):
"""
Inherits keras' Layer object.
"""
super(EpsilonLayer, self).__init__() | [
"def",
"__init__",
"(",
"self",
")",
":",
"super",
"(",
"EpsilonLayer",
",",
"self",
")",
".",
"__init__",
"(",
")"
] | [
143,
4
] | [
147,
44
] | python | en | ['en', 'error', 'th'] | False |
EpsilonLayer.build | (self, input_shape) |
Creates a trainable weight variable for this layer.
|
Creates a trainable weight variable for this layer.
| def build(self, input_shape):
"""
Creates a trainable weight variable for this layer.
"""
self.epsilon = self.add_weight(name='epsilon',
shape=[1, 1],
initializer='RandomNormal',
... | [
"def",
"build",
"(",
"self",
",",
"input_shape",
")",
":",
"self",
".",
"epsilon",
"=",
"self",
".",
"add_weight",
"(",
"name",
"=",
"'epsilon'",
",",
"shape",
"=",
"[",
"1",
",",
"1",
"]",
",",
"initializer",
"=",
"'RandomNormal'",
",",
"trainable",
... | [
149,
4
] | [
157,
52
] | python | en | ['en', 'error', 'th'] | False |
test_glob_reader_generator | (basic_pandas_datasource, tmp_path_factory) | Provides an example of how glob generator works: we specify our own
names for data_assets, and an associated glob; the generator
will take care of providing batches consisting of one file per
batch corresponding to the glob. | Provides an example of how glob generator works: we specify our own
names for data_assets, and an associated glob; the generator
will take care of providing batches consisting of one file per
batch corresponding to the glob. | def test_glob_reader_generator(basic_pandas_datasource, tmp_path_factory):
"""Provides an example of how glob generator works: we specify our own
names for data_assets, and an associated glob; the generator
will take care of providing batches consisting of one file per
batch corresponding to the glob.""... | [
"def",
"test_glob_reader_generator",
"(",
"basic_pandas_datasource",
",",
"tmp_path_factory",
")",
":",
"basedir",
"=",
"str",
"(",
"tmp_path_factory",
".",
"mktemp",
"(",
"\"test_glob_reader_generator\"",
")",
")",
"with",
"open",
"(",
"os",
".",
"path",
".",
"jo... | [
63,
0
] | [
113,
49
] | python | en | ['en', 'en', 'en'] | True |
test_file_kwargs_generator_extensions | (tmp_path_factory) | csv, xls, parquet, json should be recognized file extensions | csv, xls, parquet, json should be recognized file extensions | def test_file_kwargs_generator_extensions(tmp_path_factory):
"""csv, xls, parquet, json should be recognized file extensions"""
basedir = str(tmp_path_factory.mktemp("test_file_kwargs_generator_extensions"))
# Do not include: invalid extension
with open(os.path.join(basedir, "f1.blarg"), "w") as outfil... | [
"def",
"test_file_kwargs_generator_extensions",
"(",
"tmp_path_factory",
")",
":",
"basedir",
"=",
"str",
"(",
"tmp_path_factory",
".",
"mktemp",
"(",
"\"test_file_kwargs_generator_extensions\"",
")",
")",
"# Do not include: invalid extension",
"with",
"open",
"(",
"os",
... | [
116,
0
] | [
166,
5
] | python | en | ['en', 'fr', 'en'] | True |
__init__ | (self, project_config, context_root_dir=None, runtime_environment=None) | DataContext constructor
Args:
context_root_dir: location to look for the ``great_expectations.yml`` file. If None, searches for the file \
based on conventions for project subdirectories.
runtime_environment: a dictionary of config variables that
override both th... | DataContext constructor | def __init__(self, project_config, context_root_dir=None, runtime_environment=None):
"""DataContext constructor
Args:
context_root_dir: location to look for the ``great_expectations.yml`` file. If None, searches for the file \
based on conventions for project subdirectories.
... | [
"def",
"__init__",
"(",
"self",
",",
"project_config",
",",
"context_root_dir",
"=",
"None",
",",
"runtime_environment",
"=",
"None",
")",
":",
"if",
"not",
"BaseDataContext",
".",
"validate_config",
"(",
"project_config",
")",
":",
"raise",
"ge_exceptions",
"."... | [
298,
4
] | [
375,
52
] | python | en | ['en', 'lb', 'en'] | False |
_init_stores | (self, store_configs) | Initialize all Stores for this DataContext.
Stores are a good fit for reading/writing objects that:
1. follow a clear key-value pattern, and
2. are usually edited programmatically, using the Context
Note that stores do NOT manage plugins.
| Initialize all Stores for this DataContext. | def _init_stores(self, store_configs):
"""Initialize all Stores for this DataContext.
Stores are a good fit for reading/writing objects that:
1. follow a clear key-value pattern, and
2. are usually edited programmatically, using the Context
Note that stores do NOT manag... | [
"def",
"_init_stores",
"(",
"self",
",",
"store_configs",
")",
":",
"for",
"store_name",
",",
"store_config",
"in",
"store_configs",
".",
"items",
"(",
")",
":",
"self",
".",
"_build_store_from_config",
"(",
"store_name",
",",
"store_config",
")"
] | [
410,
4
] | [
420,
67
] | python | en | ['en', 'en', 'en'] | True |
_construct_data_context_id | (self) |
Choose the id of the currently-configured expectations store, if available and a persistent store.
If not, it should choose the id stored in DataContextConfig.
Returns:
UUID to use as the data_context_id
|
Choose the id of the currently-configured expectations store, if available and a persistent store.
If not, it should choose the id stored in DataContextConfig.
Returns:
UUID to use as the data_context_id
| def _construct_data_context_id(self) -> str:
"""
Choose the id of the currently-configured expectations store, if available and a persistent store.
If not, it should choose the id stored in DataContextConfig.
Returns:
UUID to use as the data_context_id
"""
# ... | [
"def",
"_construct_data_context_id",
"(",
"self",
")",
"->",
"str",
":",
"# Choose the id of the currently-configured expectations store, if it is a persistent store",
"expectations_store",
"=",
"self",
".",
"_stores",
"[",
"self",
".",
"project_config_with_variables_substituted",
... | [
539,
4
] | [
559,
13
] | python | en | ['en', 'error', 'th'] | False |
_initialize_usage_statistics | (
self, usage_statistics_config: AnonymizedUsageStatisticsConfig
) | Initialize the usage statistics system. | Initialize the usage statistics system. | def _initialize_usage_statistics(
self, usage_statistics_config: AnonymizedUsageStatisticsConfig
):
"""Initialize the usage statistics system."""
if not usage_statistics_config.enabled:
logger.info("Usage statistics is disabled; skipping initialization.")
self._usage_... | [
"def",
"_initialize_usage_statistics",
"(",
"self",
",",
"usage_statistics_config",
":",
"AnonymizedUsageStatisticsConfig",
")",
":",
"if",
"not",
"usage_statistics_config",
".",
"enabled",
":",
"logger",
".",
"info",
"(",
"\"Usage statistics is disabled; skipping initializat... | [
561,
4
] | [
574,
9
] | python | en | ['en', 'en', 'en'] | True |
add_store | (self, store_name, store_config) | Add a new Store to the DataContext and (for convenience) return the instantiated Store object.
Args:
store_name (str): a key for the new Store in in self._stores
store_config (dict): a config for the Store to add
Returns:
store (Store)
| Add a new Store to the DataContext and (for convenience) return the instantiated Store object. | def add_store(self, store_name, store_config):
"""Add a new Store to the DataContext and (for convenience) return the instantiated Store object.
Args:
store_name (str): a key for the new Store in in self._stores
store_config (dict): a config for the Store to add
Returns... | [
"def",
"add_store",
"(",
"self",
",",
"store_name",
",",
"store_config",
")",
":",
"self",
".",
"_project_config",
"[",
"\"stores\"",
"]",
"[",
"store_name",
"]",
"=",
"store_config",
"return",
"self",
".",
"_build_store_from_config",
"(",
"store_name",
",",
"... | [
576,
4
] | [
588,
70
] | python | en | ['en', 'en', 'en'] | True |
add_validation_operator | (
self, validation_operator_name, validation_operator_config
) | Add a new ValidationOperator to the DataContext and (for convenience) return the instantiated object.
Args:
validation_operator_name (str): a key for the new ValidationOperator in in self._validation_operators
validation_operator_config (dict): a config for the ValidationOperator to add... | Add a new ValidationOperator to the DataContext and (for convenience) return the instantiated object. | def add_validation_operator(
self, validation_operator_name, validation_operator_config
):
"""Add a new ValidationOperator to the DataContext and (for convenience) return the instantiated object.
Args:
validation_operator_name (str): a key for the new ValidationOperator in in se... | [
"def",
"add_validation_operator",
"(",
"self",
",",
"validation_operator_name",
",",
"validation_operator_config",
")",
":",
"self",
".",
"_project_config",
"[",
"\"validation_operators\"",
"]",
"[",
"validation_operator_name",
"]",
"=",
"validation_operator_config",
"confi... | [
590,
4
] | [
625,
38
] | python | en | ['en', 'en', 'en'] | True |
get_site_names | (self) | Get a list of configured site names. | Get a list of configured site names. | def get_site_names(self) -> List[str]:
"""Get a list of configured site names."""
return list(
self.project_config_with_variables_substituted.data_docs_sites.keys()
) | [
"def",
"get_site_names",
"(",
"self",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"list",
"(",
"self",
".",
"project_config_with_variables_substituted",
".",
"data_docs_sites",
".",
"keys",
"(",
")",
")"
] | [
643,
4
] | [
647,
9
] | python | en | ['en', 'en', 'en'] | True |
get_docs_sites_urls | (
self,
resource_identifier=None,
site_name: Optional[str] = None,
only_if_exists=True,
site_names: Optional[List[str]] = None,
) |
Get URLs for a resource for all data docs sites.
This function will return URLs for any configured site even if the sites
have not been built yet.
Args:
resource_identifier (object): optional. It can be an identifier of
ExpectationSuite's, ValidationResults... |
Get URLs for a resource for all data docs sites. | def get_docs_sites_urls(
self,
resource_identifier=None,
site_name: Optional[str] = None,
only_if_exists=True,
site_names: Optional[List[str]] = None,
) -> List[Dict[str, str]]:
"""
Get URLs for a resource for all data docs sites.
This function will r... | [
"def",
"get_docs_sites_urls",
"(",
"self",
",",
"resource_identifier",
"=",
"None",
",",
"site_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"only_if_exists",
"=",
"True",
",",
"site_names",
":",
"Optional",
"[",
"List",
"[",
"str",
"]",
"]",
... | [
649,
4
] | [
712,
24
] | python | en | ['en', 'error', 'th'] | False |
open_data_docs | (
self,
resource_identifier: Optional[str] = None,
site_name: Optional[str] = None,
only_if_exists: Optional[bool] = True,
) |
A stdlib cross-platform way to open a file in a browser.
Args:
resource_identifier: ExpectationSuiteIdentifier,
ValidationResultIdentifier or any other type's identifier. The
argument is optional - when not supplied, the method returns the
UR... |
A stdlib cross-platform way to open a file in a browser. | def open_data_docs(
self,
resource_identifier: Optional[str] = None,
site_name: Optional[str] = None,
only_if_exists: Optional[bool] = True,
) -> None:
"""
A stdlib cross-platform way to open a file in a browser.
Args:
resource_identifier: Expecta... | [
"def",
"open_data_docs",
"(",
"self",
",",
"resource_identifier",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"site_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"only_if_exists",
":",
"Optional",
"[",
"bool",
"]",
"=",
"True",
",",
... | [
735,
4
] | [
763,
36
] | python | en | ['en', 'error', 'th'] | False |
root_directory | (self) | The root directory for configuration objects in the data context; the location in which
``great_expectations.yml`` is located. | The root directory for configuration objects in the data context; the location in which
``great_expectations.yml`` is located. | def root_directory(self):
"""The root directory for configuration objects in the data context; the location in which
``great_expectations.yml`` is located."""
return self._context_root_directory | [
"def",
"root_directory",
"(",
"self",
")",
":",
"return",
"self",
".",
"_context_root_directory"
] | [
766,
4
] | [
769,
43
] | python | en | ['en', 'en', 'en'] | True |
plugins_directory | (self) | The directory in which custom plugin modules should be placed. | The directory in which custom plugin modules should be placed. | def plugins_directory(self):
"""The directory in which custom plugin modules should be placed."""
return self._normalize_absolute_or_relative_path(
self.project_config_with_variables_substituted.plugins_directory
) | [
"def",
"plugins_directory",
"(",
"self",
")",
":",
"return",
"self",
".",
"_normalize_absolute_or_relative_path",
"(",
"self",
".",
"project_config_with_variables_substituted",
".",
"plugins_directory",
")"
] | [
772,
4
] | [
776,
9
] | python | en | ['en', 'en', 'en'] | True |
stores | (self) | A single holder for all Stores in this context | A single holder for all Stores in this context | def stores(self):
"""A single holder for all Stores in this context"""
return self._stores | [
"def",
"stores",
"(",
"self",
")",
":",
"return",
"self",
".",
"_stores"
] | [
791,
4
] | [
793,
27
] | python | en | ['en', 'en', 'en'] | True |
datasources | (self) | A single holder for all Datasources in this context | A single holder for all Datasources in this context | def datasources(self) -> Dict[str, Union[LegacyDatasource, BaseDatasource]]:
"""A single holder for all Datasources in this context"""
return self._cached_datasources | [
"def",
"datasources",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"Union",
"[",
"LegacyDatasource",
",",
"BaseDatasource",
"]",
"]",
":",
"return",
"self",
".",
"_cached_datasources"
] | [
796,
4
] | [
798,
39
] | python | en | ['en', 'en', 'en'] | True |
_load_config_variables_file | (self) | Get all config variables from the default location. | Get all config variables from the default location. | def _load_config_variables_file(self):
"""Get all config variables from the default location."""
config_variables_file_path = self.get_config().config_variables_file_path
if config_variables_file_path:
try:
# If the user specifies the config variable path with an envi... | [
"def",
"_load_config_variables_file",
"(",
"self",
")",
":",
"config_variables_file_path",
"=",
"self",
".",
"get_config",
"(",
")",
".",
"config_variables_file_path",
"if",
"config_variables_file_path",
":",
"try",
":",
"# If the user specifies the config variable path with ... | [
878,
4
] | [
902,
21
] | python | en | ['en', 'en', 'en'] | True |
escape_all_config_variables | (
self,
value: Union[str, dict, list],
dollar_sign_escape_string: str = DOLLAR_SIGN_ESCAPE_STRING,
skip_if_substitution_variable: bool = True,
) |
Replace all `$` characters with the DOLLAR_SIGN_ESCAPE_STRING
Args:
value: config variable value
dollar_sign_escape_string: replaces instances of `$`
skip_if_substitution_variable: skip if the value is of the form ${MYVAR} or $MYVAR
Returns:
inp... |
Replace all `$` characters with the DOLLAR_SIGN_ESCAPE_STRING | def escape_all_config_variables(
self,
value: Union[str, dict, list],
dollar_sign_escape_string: str = DOLLAR_SIGN_ESCAPE_STRING,
skip_if_substitution_variable: bool = True,
) -> Union[str, dict, list]:
"""
Replace all `$` characters with the DOLLAR_SIGN_ESCAPE_STRING... | [
"def",
"escape_all_config_variables",
"(",
"self",
",",
"value",
":",
"Union",
"[",
"str",
",",
"dict",
",",
"list",
"]",
",",
"dollar_sign_escape_string",
":",
"str",
"=",
"DOLLAR_SIGN_ESCAPE_STRING",
",",
"skip_if_substitution_variable",
":",
"bool",
"=",
"True"... | [
927,
4
] | [
966,
64
] | python | en | ['en', 'error', 'th'] | False |
save_config_variable | (
self, config_variable_name, value, skip_if_substitution_variable: bool = True
) | r"""Save config variable value
Escapes $ unless they are used in substitution variables e.g. the $ characters in ${SOME_VAR} or $SOME_VAR are not escaped
Args:
config_variable_name: name of the property
value: the value to save for the property
skip_if_substitution_v... | r"""Save config variable value
Escapes $ unless they are used in substitution variables e.g. the $ characters in ${SOME_VAR} or $SOME_VAR are not escaped | def save_config_variable(
self, config_variable_name, value, skip_if_substitution_variable: bool = True
):
r"""Save config variable value
Escapes $ unless they are used in substitution variables e.g. the $ characters in ${SOME_VAR} or $SOME_VAR are not escaped
Args:
conf... | [
"def",
"save_config_variable",
"(",
"self",
",",
"config_variable_name",
",",
"value",
",",
"skip_if_substitution_variable",
":",
"bool",
"=",
"True",
")",
":",
"config_variables",
"=",
"self",
".",
"_load_config_variables_file",
"(",
")",
"value",
"=",
"self",
".... | [
968,
4
] | [
1010,
62
] | python | en | ['nl', 'en', 'en'] | True |
delete_datasource | (self, datasource_name: str) | Delete a data source
Args:
datasource_name: The name of the datasource to delete.
Raises:
ValueError: If the datasource name isn't provided or cannot be found.
| Delete a data source
Args:
datasource_name: The name of the datasource to delete. | def delete_datasource(self, datasource_name: str):
"""Delete a data source
Args:
datasource_name: The name of the datasource to delete.
Raises:
ValueError: If the datasource name isn't provided or cannot be found.
"""
if datasource_name is None:
... | [
"def",
"delete_datasource",
"(",
"self",
",",
"datasource_name",
":",
"str",
")",
":",
"if",
"datasource_name",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Datasource names must be a datasource name\"",
")",
"else",
":",
"datasource",
"=",
"self",
".",
"get_... | [
1012,
4
] | [
1031,
75
] | python | en | ['en', 'it', 'en'] | True |
get_available_data_asset_names | (
self, datasource_names=None, batch_kwargs_generator_names=None
) | Inspect datasource and batch kwargs generators to provide available data_asset objects.
Args:
datasource_names: list of datasources for which to provide available data_asset_name objects. If None, \
return available data assets for all datasources.
batch_kwargs_generator_nam... | Inspect datasource and batch kwargs generators to provide available data_asset objects. | def get_available_data_asset_names(
self, datasource_names=None, batch_kwargs_generator_names=None
):
"""Inspect datasource and batch kwargs generators to provide available data_asset objects.
Args:
datasource_names: list of datasources for which to provide available data_asset_... | [
"def",
"get_available_data_asset_names",
"(",
"self",
",",
"datasource_names",
"=",
"None",
",",
"batch_kwargs_generator_names",
"=",
"None",
")",
":",
"data_asset_names",
"=",
"{",
"}",
"if",
"datasource_names",
"is",
"None",
":",
"datasource_names",
"=",
"[",
"d... | [
1033,
4
] | [
1107,
31
] | python | en | ['en', 'en', 'en'] | True |
build_batch_kwargs | (
self,
datasource,
batch_kwargs_generator,
data_asset_name=None,
partition_id=None,
**kwargs,
) | Builds batch kwargs using the provided datasource, batch kwargs generator, and batch_parameters.
Args:
datasource (str): the name of the datasource for which to build batch_kwargs
batch_kwargs_generator (str): the name of the batch kwargs generator to use to build batch_kwargs
... | Builds batch kwargs using the provided datasource, batch kwargs generator, and batch_parameters. | def build_batch_kwargs(
self,
datasource,
batch_kwargs_generator,
data_asset_name=None,
partition_id=None,
**kwargs,
):
"""Builds batch kwargs using the provided datasource, batch kwargs generator, and batch_parameters.
Args:
datasource (s... | [
"def",
"build_batch_kwargs",
"(",
"self",
",",
"datasource",
",",
"batch_kwargs_generator",
",",
"data_asset_name",
"=",
"None",
",",
"partition_id",
"=",
"None",
",",
"*",
"*",
"kwargs",
",",
")",
":",
"if",
"kwargs",
".",
"get",
"(",
"\"name\"",
")",
":"... | [
1109,
4
] | [
1146,
27
] | python | en | ['en', 'en', 'en'] | True |
_get_batch_v2 | (
self,
batch_kwargs: Union[dict, BatchKwargs],
expectation_suite_name: Union[str, ExpectationSuite],
data_asset_type=None,
batch_parameters=None,
) | Build a batch of data using batch_kwargs, and return a DataAsset with expectation_suite_name attached. If
batch_parameters are included, they will be available as attributes of the batch.
Args:
batch_kwargs: the batch_kwargs to use; must include a datasource key
expectation_suite... | Build a batch of data using batch_kwargs, and return a DataAsset with expectation_suite_name attached. If
batch_parameters are included, they will be available as attributes of the batch.
Args:
batch_kwargs: the batch_kwargs to use; must include a datasource key
expectation_suite... | def _get_batch_v2(
self,
batch_kwargs: Union[dict, BatchKwargs],
expectation_suite_name: Union[str, ExpectationSuite],
data_asset_type=None,
batch_parameters=None,
) -> DataAsset:
"""Build a batch of data using batch_kwargs, and return a DataAsset with expectation_sui... | [
"def",
"_get_batch_v2",
"(",
"self",
",",
"batch_kwargs",
":",
"Union",
"[",
"dict",
",",
"BatchKwargs",
"]",
",",
"expectation_suite_name",
":",
"Union",
"[",
"str",
",",
"ExpectationSuite",
"]",
",",
"data_asset_type",
"=",
"None",
",",
"batch_parameters",
"... | [
1148,
4
] | [
1203,
38
] | python | en | ['en', 'en', 'en'] | True |
_get_batch_v3 | (
self,
datasource_name: Optional[str] = None,
data_connector_name: Optional[str] = None,
data_asset_name: Optional[str] = None,
*,
batch_request: Optional[Union[BatchRequest, RuntimeBatchRequest]] = None,
batch_data: Optional[Any] = None,
data_connector_q... | Get exactly one batch, based on a variety of flexible input types.
Args:
datasource_name
data_connector_name
data_asset_name
batch_request
batch_data
data_connector_query
batch_identifiers
batch_filter_parameters
... | Get exactly one batch, based on a variety of flexible input types. | def _get_batch_v3(
self,
datasource_name: Optional[str] = None,
data_connector_name: Optional[str] = None,
data_asset_name: Optional[str] = None,
*,
batch_request: Optional[Union[BatchRequest, RuntimeBatchRequest]] = None,
batch_data: Optional[Any] = None,
... | [
"def",
"_get_batch_v3",
"(",
"self",
",",
"datasource_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"data_connector_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"data_asset_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
... | [
1205,
4
] | [
1298,
28
] | python | en | ['en', 'en', 'en'] | True |
run_validation_operator | (
self,
validation_operator_name: str,
assets_to_validate: List,
run_id: Optional[Union[str, RunIdentifier]] = None,
evaluation_parameters: Optional[dict] = None,
run_name: Optional[str] = None,
run_time: Optional[Union[str, datetime.datetime]] = None,
res... |
Run a validation operator to validate data assets and to perform the business logic around
validation that the operator implements.
Args:
validation_operator_name: name of the operator, as appears in the context's config file
assets_to_validate: a list that specifies th... |
Run a validation operator to validate data assets and to perform the business logic around
validation that the operator implements. | def run_validation_operator(
self,
validation_operator_name: str,
assets_to_validate: List,
run_id: Optional[Union[str, RunIdentifier]] = None,
evaluation_parameters: Optional[dict] = None,
run_name: Optional[str] = None,
run_time: Optional[Union[str, datetime.dat... | [
"def",
"run_validation_operator",
"(",
"self",
",",
"validation_operator_name",
":",
"str",
",",
"assets_to_validate",
":",
"List",
",",
"run_id",
":",
"Optional",
"[",
"Union",
"[",
"str",
",",
"RunIdentifier",
"]",
"]",
"=",
"None",
",",
"evaluation_parameters... | [
1304,
4
] | [
1372,
13
] | python | en | ['en', 'error', 'th'] | False |
_get_data_context_version | (self, arg1: Any, **kwargs) |
arg1: the first positional argument (can take on various types)
**kwargs: variable arguments
First check:
Returns "v3" if the "0.13" entities are specified in the **kwargs.
Otherwise:
Returns None if no datasources have been configured (or if there is an exception whi... |
arg1: the first positional argument (can take on various types) | def _get_data_context_version(self, arg1: Any, **kwargs) -> Optional[str]:
"""
arg1: the first positional argument (can take on various types)
**kwargs: variable arguments
First check:
Returns "v3" if the "0.13" entities are specified in the **kwargs.
Otherwise:
... | [
"def",
"_get_data_context_version",
"(",
"self",
",",
"arg1",
":",
"Any",
",",
"*",
"*",
"kwargs",
")",
"->",
"Optional",
"[",
"str",
"]",
":",
"if",
"{",
"\"datasource_name\"",
",",
"\"data_connector_name\"",
",",
"\"data_asset_name\"",
",",
"\"batch_request\""... | [
1374,
4
] | [
1429,
26
] | python | en | ['en', 'error', 'th'] | False |
get_batch | (
self, arg1: Any = None, arg2: Any = None, arg3: Any = None, **kwargs
) | Get exactly one batch, based on a variety of flexible input types.
The method `get_batch` is the main user-facing method for getting batches; it supports both the new (V3) and the
Legacy (V2) Datasource schemas. The version-specific implementations are contained in "_get_batch_v2()" and
"_get_b... | Get exactly one batch, based on a variety of flexible input types.
The method `get_batch` is the main user-facing method for getting batches; it supports both the new (V3) and the
Legacy (V2) Datasource schemas. The version-specific implementations are contained in "_get_batch_v2()" and
"_get_b... | def get_batch(
self, arg1: Any = None, arg2: Any = None, arg3: Any = None, **kwargs
) -> Union[Batch, DataAsset]:
"""Get exactly one batch, based on a variety of flexible input types.
The method `get_batch` is the main user-facing method for getting batches; it supports both the new (V3) and... | [
"def",
"get_batch",
"(",
"self",
",",
"arg1",
":",
"Any",
"=",
"None",
",",
"arg2",
":",
"Any",
"=",
"None",
",",
"arg3",
":",
"Any",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
"->",
"Union",
"[",
"Batch",
",",
"DataAsset",
"]",
":",
"api_version... | [
1431,
4
] | [
1497,
9
] | python | en | ['en', 'en', 'en'] | True |
get_batch_list | (
self,
datasource_name: Optional[str] = None,
data_connector_name: Optional[str] = None,
data_asset_name: Optional[str] = None,
*,
batch_request: Optional[Union[BatchRequest, RuntimeBatchRequest]] = None,
batch_data: Optional[Any] = None,
data_connector_q... | Get the list of zero or more batches, based on a variety of flexible input types.
This method applies only to the new (V3) Datasource schema.
Args:
batch_request
datasource_name
data_connector_name
data_asset_name
batch_request
b... | Get the list of zero or more batches, based on a variety of flexible input types.
This method applies only to the new (V3) Datasource schema. | def get_batch_list(
self,
datasource_name: Optional[str] = None,
data_connector_name: Optional[str] = None,
data_asset_name: Optional[str] = None,
*,
batch_request: Optional[Union[BatchRequest, RuntimeBatchRequest]] = None,
batch_data: Optional[Any] = None,
... | [
"def",
"get_batch_list",
"(",
"self",
",",
"datasource_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"data_connector_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"data_asset_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
... | [
1499,
4
] | [
1678,
88
] | python | en | ['en', 'en', 'en'] | True |
get_validator | (
self,
datasource_name: Optional[str] = None,
data_connector_name: Optional[str] = None,
data_asset_name: Optional[str] = None,
*,
batch_request: Optional[Union[BatchRequest, RuntimeBatchRequest]] = None,
batch_request_list: List[
Optional[Union[Batch... |
This method applies only to the new (V3) Datasource schema.
|
This method applies only to the new (V3) Datasource schema.
| def get_validator(
self,
datasource_name: Optional[str] = None,
data_connector_name: Optional[str] = None,
data_asset_name: Optional[str] = None,
*,
batch_request: Optional[Union[BatchRequest, RuntimeBatchRequest]] = None,
batch_request_list: List[
Opt... | [
"def",
"get_validator",
"(",
"self",
",",
"datasource_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"data_connector_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"data_asset_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
... | [
1680,
4
] | [
1792,
24
] | python | en | ['en', 'error', 'th'] | False |
add_datasource | (
self, name, initialize=True, **kwargs
) | Add a new datasource to the data context, with configuration provided as kwargs.
Args:
name: the name for the new datasource to add
initialize: if False, add the datasource to the config, but do not
initialize it, for example if a user needs to debug database connectivity... | Add a new datasource to the data context, with configuration provided as kwargs.
Args:
name: the name for the new datasource to add
initialize: if False, add the datasource to the config, but do not
initialize it, for example if a user needs to debug database connectivity... | def add_datasource(
self, name, initialize=True, **kwargs
) -> Optional[Dict[str, Union[LegacyDatasource, BaseDatasource]]]:
"""Add a new datasource to the data context, with configuration provided as kwargs.
Args:
name: the name for the new datasource to add
initiali... | [
"def",
"add_datasource",
"(",
"self",
",",
"name",
",",
"initialize",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
"->",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"Union",
"[",
"LegacyDatasource",
",",
"BaseDatasource",
"]",
"]",
"]",
":",
"logger",
".",... | [
1803,
4
] | [
1835,
9
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.