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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
sqlalchemy_dataset | (test_backends) | Provide dataset fixtures that have special values and/or are otherwise useful outside
the standard json testing framework | Provide dataset fixtures that have special values and/or are otherwise useful outside
the standard json testing framework | def sqlalchemy_dataset(test_backends):
"""Provide dataset fixtures that have special values and/or are otherwise useful outside
the standard json testing framework"""
if "postgresql" in test_backends:
backend = "postgresql"
elif "sqlite" in test_backends:
backend = "sqlite"
else:
... | [
"def",
"sqlalchemy_dataset",
"(",
"test_backends",
")",
":",
"if",
"\"postgresql\"",
"in",
"test_backends",
":",
"backend",
"=",
"\"postgresql\"",
"elif",
"\"sqlite\"",
"in",
"test_backends",
":",
"backend",
"=",
"\"sqlite\"",
"else",
":",
"return",
"data",
"=",
... | [
2123,
0
] | [
2146,
69
] | python | en | ['en', 'en', 'en'] | True |
YamlLexer.something | (token_class) | Do not produce empty tokens. | Do not produce empty tokens. | def something(token_class):
"""Do not produce empty tokens."""
def callback(lexer, match, context):
text = match.group()
if not text:
return
yield match.start(), token_class, text
context.pos = match.end()
return callback | [
"def",
"something",
"(",
"token_class",
")",
":",
"def",
"callback",
"(",
"lexer",
",",
"match",
",",
"context",
")",
":",
"text",
"=",
"match",
".",
"group",
"(",
")",
"if",
"not",
"text",
":",
"return",
"yield",
"match",
".",
"start",
"(",
")",
"... | [
45,
4
] | [
53,
23
] | python | en | ['en', 'mg', 'en'] | True |
YamlLexer.reset_indent | (token_class) | Reset the indentation levels. | Reset the indentation levels. | def reset_indent(token_class):
"""Reset the indentation levels."""
def callback(lexer, match, context):
text = match.group()
context.indent_stack = []
context.indent = -1
context.next_indent = 0
context.block_scalar_indent = None
yi... | [
"def",
"reset_indent",
"(",
"token_class",
")",
":",
"def",
"callback",
"(",
"lexer",
",",
"match",
",",
"context",
")",
":",
"text",
"=",
"match",
".",
"group",
"(",
")",
"context",
".",
"indent_stack",
"=",
"[",
"]",
"context",
".",
"indent",
"=",
... | [
55,
4
] | [
65,
23
] | python | en | ['en', 'da', 'en'] | True |
YamlLexer.save_indent | (token_class, start=False) | Save a possible indentation level. | Save a possible indentation level. | def save_indent(token_class, start=False):
"""Save a possible indentation level."""
def callback(lexer, match, context):
text = match.group()
extra = ''
if start:
context.next_indent = len(text)
if context.next_indent < context.indent:
... | [
"def",
"save_indent",
"(",
"token_class",
",",
"start",
"=",
"False",
")",
":",
"def",
"callback",
"(",
"lexer",
",",
"match",
",",
"context",
")",
":",
"text",
"=",
"match",
".",
"group",
"(",
")",
"extra",
"=",
"''",
"if",
"start",
":",
"context",
... | [
67,
4
] | [
87,
23
] | python | en | ['en', 'en', 'en'] | True |
YamlLexer.set_indent | (token_class, implicit=False) | Set the previously saved indentation level. | Set the previously saved indentation level. | def set_indent(token_class, implicit=False):
"""Set the previously saved indentation level."""
def callback(lexer, match, context):
text = match.group()
if context.indent < context.next_indent:
context.indent_stack.append(context.indent)
context.in... | [
"def",
"set_indent",
"(",
"token_class",
",",
"implicit",
"=",
"False",
")",
":",
"def",
"callback",
"(",
"lexer",
",",
"match",
",",
"context",
")",
":",
"text",
"=",
"match",
".",
"group",
"(",
")",
"if",
"context",
".",
"indent",
"<",
"context",
"... | [
89,
4
] | [
100,
23
] | python | en | ['en', 'en', 'en'] | True |
YamlLexer.set_block_scalar_indent | (token_class) | Set an explicit indentation level for a block scalar. | Set an explicit indentation level for a block scalar. | def set_block_scalar_indent(token_class):
"""Set an explicit indentation level for a block scalar."""
def callback(lexer, match, context):
text = match.group()
context.block_scalar_indent = None
if not text:
return
increment = match.group(1... | [
"def",
"set_block_scalar_indent",
"(",
"token_class",
")",
":",
"def",
"callback",
"(",
"lexer",
",",
"match",
",",
"context",
")",
":",
"text",
"=",
"match",
".",
"group",
"(",
")",
"context",
".",
"block_scalar_indent",
"=",
"None",
"if",
"not",
"text",
... | [
102,
4
] | [
117,
23
] | python | en | ['en', 'su', 'en'] | True |
YamlLexer.parse_block_scalar_empty_line | (indent_token_class, content_token_class) | Process an empty line in a block scalar. | Process an empty line in a block scalar. | def parse_block_scalar_empty_line(indent_token_class, content_token_class):
"""Process an empty line in a block scalar."""
def callback(lexer, match, context):
text = match.group()
if (context.block_scalar_indent is None or
len(text) <= context.block_scalar_in... | [
"def",
"parse_block_scalar_empty_line",
"(",
"indent_token_class",
",",
"content_token_class",
")",
":",
"def",
"callback",
"(",
"lexer",
",",
"match",
",",
"context",
")",
":",
"text",
"=",
"match",
".",
"group",
"(",
")",
"if",
"(",
"context",
".",
"block_... | [
119,
4
] | [
134,
23
] | python | en | ['en', 'en', 'en'] | True |
YamlLexer.parse_block_scalar_indent | (token_class) | Process indentation spaces in a block scalar. | Process indentation spaces in a block scalar. | def parse_block_scalar_indent(token_class):
"""Process indentation spaces in a block scalar."""
def callback(lexer, match, context):
text = match.group()
if context.block_scalar_indent is None:
if len(text) <= max(context.indent, 0):
context.st... | [
"def",
"parse_block_scalar_indent",
"(",
"token_class",
")",
":",
"def",
"callback",
"(",
"lexer",
",",
"match",
",",
"context",
")",
":",
"text",
"=",
"match",
".",
"group",
"(",
")",
"if",
"context",
".",
"block_scalar_indent",
"is",
"None",
":",
"if",
... | [
136,
4
] | [
154,
23
] | python | en | ['en', 'en', 'en'] | True |
YamlLexer.parse_plain_scalar_indent | (token_class) | Process indentation spaces in a plain scalar. | Process indentation spaces in a plain scalar. | def parse_plain_scalar_indent(token_class):
"""Process indentation spaces in a plain scalar."""
def callback(lexer, match, context):
text = match.group()
if len(text) <= context.indent:
context.stack.pop()
context.stack.pop()
return... | [
"def",
"parse_plain_scalar_indent",
"(",
"token_class",
")",
":",
"def",
"callback",
"(",
"lexer",
",",
"match",
",",
"context",
")",
":",
"text",
"=",
"match",
".",
"group",
"(",
")",
"if",
"len",
"(",
"text",
")",
"<=",
"context",
".",
"indent",
":",... | [
156,
4
] | [
167,
23
] | python | en | ['en', 'en', 'en'] | True |
build_in_code_data_context_project_config | (
bucket: str = "leakybucket",
expectations_store_prefix: str = "expectations_store_prefix",
validations_store_prefix: str = "validations_store_prefix",
data_docs_store_prefix: str = "data_docs_store_prefix",
stores: Optional[Dict] = None,
) |
Create a project config for an in-code data context.
Not a fixture because we want to control when this is built (after the expectation store).
Args:
expectations_store_prefix: prefix for expectations store
validations_store_prefix: prefix for validations store
data_docs_store_prefi... |
Create a project config for an in-code data context.
Not a fixture because we want to control when this is built (after the expectation store).
Args:
expectations_store_prefix: prefix for expectations store
validations_store_prefix: prefix for validations store
data_docs_store_prefi... | def build_in_code_data_context_project_config(
bucket: str = "leakybucket",
expectations_store_prefix: str = "expectations_store_prefix",
validations_store_prefix: str = "validations_store_prefix",
data_docs_store_prefix: str = "data_docs_store_prefix",
stores: Optional[Dict] = None,
) -> DataContex... | [
"def",
"build_in_code_data_context_project_config",
"(",
"bucket",
":",
"str",
"=",
"\"leakybucket\"",
",",
"expectations_store_prefix",
":",
"str",
"=",
"\"expectations_store_prefix\"",
",",
"validations_store_prefix",
":",
"str",
"=",
"\"validations_store_prefix\"",
",",
... | [
13,
0
] | [
110,
25
] | python | en | ['en', 'error', 'th'] | False |
get_store_backend_id_from_s3 | (bucket: str, prefix: str, key: str) |
Return the UUID store_backend_id from a given s3 file
Args:
bucket: s3 bucket
prefix: prefix for s3 bucket
key: filename in s3 bucket
Returns:
|
Return the UUID store_backend_id from a given s3 file
Args:
bucket: s3 bucket
prefix: prefix for s3 bucket
key: filename in s3 bucket | def get_store_backend_id_from_s3(bucket: str, prefix: str, key: str) -> str:
"""
Return the UUID store_backend_id from a given s3 file
Args:
bucket: s3 bucket
prefix: prefix for s3 bucket
key: filename in s3 bucket
Returns:
"""
s3_response_object = boto3.client("s3").ge... | [
"def",
"get_store_backend_id_from_s3",
"(",
"bucket",
":",
"str",
",",
"prefix",
":",
"str",
",",
"key",
":",
"str",
")",
"->",
"str",
":",
"s3_response_object",
"=",
"boto3",
".",
"client",
"(",
"\"s3\"",
")",
".",
"get_object",
"(",
"Bucket",
"=",
"buc... | [
113,
0
] | [
135,
40
] | python | en | ['en', 'error', 'th'] | False |
list_s3_bucket_contents | (bucket: str, prefix: str) |
List the contents of an s3 bucket as a set of strings given bucket name and prefix
Args:
bucket: s3 bucket
prefix: prefix for s3 bucket
Returns:
set of filepath strings
|
List the contents of an s3 bucket as a set of strings given bucket name and prefix
Args:
bucket: s3 bucket
prefix: prefix for s3 bucket | def list_s3_bucket_contents(bucket: str, prefix: str) -> Set[str]:
"""
List the contents of an s3 bucket as a set of strings given bucket name and prefix
Args:
bucket: s3 bucket
prefix: prefix for s3 bucket
Returns:
set of filepath strings
"""
return {
s3_object_... | [
"def",
"list_s3_bucket_contents",
"(",
"bucket",
":",
"str",
",",
"prefix",
":",
"str",
")",
"->",
"Set",
"[",
"str",
"]",
":",
"return",
"{",
"s3_object_info",
"[",
"\"Key\"",
"]",
"for",
"s3_object_info",
"in",
"boto3",
".",
"client",
"(",
"\"s3\"",
")... | [
138,
0
] | [
153,
5
] | python | en | ['en', 'error', 'th'] | False |
test_DataContext_construct_data_context_id_uses_id_of_currently_configured_expectations_store | () |
What does this test and why?
A DataContext should have an id. This ID should come from either:
1. configured expectations store store_backend_id
2. great_expectations.yml
3. new generated id from DataContextConfig
This test verifies that DataContext._construct_data_context_id
uses the stor... |
What does this test and why? | def test_DataContext_construct_data_context_id_uses_id_of_currently_configured_expectations_store():
"""
What does this test and why?
A DataContext should have an id. This ID should come from either:
1. configured expectations store store_backend_id
2. great_expectations.yml
3. new generated id... | [
"def",
"test_DataContext_construct_data_context_id_uses_id_of_currently_configured_expectations_store",
"(",
")",
":",
"store_backend_id_filename",
"=",
"StoreBackend",
".",
"STORE_BACKEND_ID_KEY",
"[",
"0",
"]",
"bucket",
"=",
"\"leakybucket\"",
"expectations_store_prefix",
"=",
... | [
157,
0
] | [
241,
5
] | python | en | ['en', 'error', 'th'] | False |
test_DataContext_construct_data_context_id_uses_id_stored_in_DataContextConfig_if_no_configured_expectations_store | (
monkeypatch,
) |
What does this test and why?
A DataContext should have an id. This ID should come from either:
1. configured expectations store store_backend_id
2. great_expectations.yml
3. new generated id from DataContextConfig
This test verifies that DataContext._construct_data_context_id
uses the data... |
What does this test and why? | def test_DataContext_construct_data_context_id_uses_id_stored_in_DataContextConfig_if_no_configured_expectations_store(
monkeypatch,
):
"""
What does this test and why?
A DataContext should have an id. This ID should come from either:
1. configured expectations store store_backend_id
2. great_e... | [
"def",
"test_DataContext_construct_data_context_id_uses_id_stored_in_DataContextConfig_if_no_configured_expectations_store",
"(",
"monkeypatch",
",",
")",
":",
"monkeypatch",
".",
"delenv",
"(",
"\"GE_USAGE_STATS\"",
",",
"raising",
"=",
"False",
")",
"# Undo the project-wide test ... | [
245,
0
] | [
296,
5
] | python | en | ['en', 'error', 'th'] | False |
test_DataContext_construct_data_context_id_uses_id_stored_in_env_var_GE_DATA_CONTEXT_ID_if_no_configured_expectations_store | (
monkeypatch,
) |
What does this test and why?
A DataContext should have an id. This ID should come from either:
1. configured expectations store store_backend_id
2. great_expectations.yml
3. new generated id from DataContextConfig
This test verifies that DataContext._construct_data_context_id
uses the stor... |
What does this test and why? | def test_DataContext_construct_data_context_id_uses_id_stored_in_env_var_GE_DATA_CONTEXT_ID_if_no_configured_expectations_store(
monkeypatch,
):
"""
What does this test and why?
A DataContext should have an id. This ID should come from either:
1. configured expectations store store_backend_id
2... | [
"def",
"test_DataContext_construct_data_context_id_uses_id_stored_in_env_var_GE_DATA_CONTEXT_ID_if_no_configured_expectations_store",
"(",
"monkeypatch",
",",
")",
":",
"bucket",
"=",
"\"leakybucket\"",
"expectations_store_prefix",
"=",
"\"expectations_store_prefix\"",
"validations_store_p... | [
300,
0
] | [
344,
5
] | python | en | ['en', 'error', 'th'] | False |
test_suppress_store_backend_id_is_true_for_inactive_stores | () |
What does this test and why?
Trying to read / set the store_backend_id for inactive stores should not be attempted during DataContext initialization. This test ensures that the _suppress_store_backend_id parameter is set to True for inactive stores.
|
What does this test and why? | def test_suppress_store_backend_id_is_true_for_inactive_stores():
"""
What does this test and why?
Trying to read / set the store_backend_id for inactive stores should not be attempted during DataContext initialization. This test ensures that the _suppress_store_backend_id parameter is set to True for inac... | [
"def",
"test_suppress_store_backend_id_is_true_for_inactive_stores",
"(",
")",
":",
"bucket",
"=",
"\"leakybucket\"",
"expectations_store_prefix",
"=",
"\"expectations_store_prefix\"",
"validations_store_prefix",
"=",
"\"validations_store_prefix\"",
"data_docs_store_prefix",
"=",
"\"... | [
348,
0
] | [
455,
5
] | python | en | ['en', 'error', 'th'] | False |
test_inaccessible_active_bucket_warning_messages | (caplog) |
What does this test do and why?
Trying to create a data context with unreachable ACTIVE stores should show a warning message once per store
e.g. Invalid store configuration: Please check the configuration of your TupleS3StoreBackend named expectations_S3_store
Active stores are those named in:
"ex... |
What does this test do and why? | def test_inaccessible_active_bucket_warning_messages(caplog):
"""
What does this test do and why?
Trying to create a data context with unreachable ACTIVE stores should show a warning message once per store
e.g. Invalid store configuration: Please check the configuration of your TupleS3StoreBackend name... | [
"def",
"test_inaccessible_active_bucket_warning_messages",
"(",
"caplog",
")",
":",
"bucket",
"=",
"\"leakybucket\"",
"expectations_store_prefix",
"=",
"\"expectations_store_prefix\"",
"validations_store_prefix",
"=",
"\"validations_store_prefix\"",
"data_docs_store_prefix",
"=",
"... | [
459,
0
] | [
519,
5
] | python | en | ['en', 'error', 'th'] | False |
test_inaccessible_inactive_bucket_no_warning_messages | (caplog) |
What does this test do and why?
Trying to create a data context with unreachable INACTIVE stores should show no warning messages
Inactive stores are those NOT named in:
"expectations_store_name", "validations_store_name", "evaluation_parameter_store_name"
|
What does this test do and why? | def test_inaccessible_inactive_bucket_no_warning_messages(caplog):
"""
What does this test do and why?
Trying to create a data context with unreachable INACTIVE stores should show no warning messages
Inactive stores are those NOT named in:
"expectations_store_name", "validations_store_name", "evalu... | [
"def",
"test_inaccessible_inactive_bucket_no_warning_messages",
"(",
"caplog",
")",
":",
"bucket",
"=",
"\"leakybucket\"",
"expectations_store_prefix",
"=",
"\"expectations_store_prefix\"",
"validations_store_prefix",
"=",
"\"validations_store_prefix\"",
"data_docs_store_prefix",
"="... | [
523,
0
] | [
601,
5
] | python | en | ['en', 'error', 'th'] | False |
NeuralNetwork.makeModel | (self,inputShape,outputShape) |
overrides base function
Create and return a Keras Model
|
overrides base function
Create and return a Keras Model
| def makeModel(self,inputShape,outputShape):
"""
overrides base function
Create and return a Keras Model
"""
dropoutStrength = 0.1
_input = Input(shape=inputShape)
#1
x = Conv2D(128, (3, 3), activation='relu',padding='same', use_bias=False)(_input... | [
"def",
"makeModel",
"(",
"self",
",",
"inputShape",
",",
"outputShape",
")",
":",
"dropoutStrength",
"=",
"0.1",
"_input",
"=",
"Input",
"(",
"shape",
"=",
"inputShape",
")",
"#1",
"x",
"=",
"Conv2D",
"(",
"128",
",",
"(",
"3",
",",
"3",
")",
",",
... | [
11,
4
] | [
169,
20
] | python | en | ['en', 'error', 'th'] | False |
bind_aliases | (decls) |
This function binds between class and it's typedefs.
:param decls: list of all declarations
:rtype: None
|
This function binds between class and it's typedefs. | def bind_aliases(decls):
"""
This function binds between class and it's typedefs.
:param decls: list of all declarations
:rtype: None
"""
visited = set()
typedefs = [
decl for decl in decls if isinstance(decl, declarations.typedef_t)]
for decl in typedefs:
type_ = dec... | [
"def",
"bind_aliases",
"(",
"decls",
")",
":",
"visited",
"=",
"set",
"(",
")",
"typedefs",
"=",
"[",
"decl",
"for",
"decl",
"in",
"decls",
"if",
"isinstance",
"(",
"decl",
",",
"declarations",
".",
"typedef_t",
")",
"]",
"for",
"decl",
"in",
"typedefs... | [
8,
0
] | [
31,
37
] | python | en | ['en', 'error', 'th'] | False |
titanic_validator | (titanic_data_context_modular_api) |
What does this test do and why?
Ensures that all available expectation types work as expected
|
What does this test do and why?
Ensures that all available expectation types work as expected
| def titanic_validator(titanic_data_context_modular_api):
"""
What does this test do and why?
Ensures that all available expectation types work as expected
"""
df = ge.read_csv(file_relative_path(__file__, "../test_sets/Titanic.csv"))
return get_pandas_runtime_validator(titanic_data_context_modu... | [
"def",
"titanic_validator",
"(",
"titanic_data_context_modular_api",
")",
":",
"df",
"=",
"ge",
".",
"read_csv",
"(",
"file_relative_path",
"(",
"__file__",
",",
"\"../test_sets/Titanic.csv\"",
")",
")",
"return",
"get_pandas_runtime_validator",
"(",
"titanic_data_context... | [
177,
0
] | [
184,
77
] | python | en | ['en', 'error', 'th'] | False |
taxi_validator_pandas | (titanic_data_context_modular_api) |
What does this test do and why?
Ensures that all available expectation types work as expected
|
What does this test do and why?
Ensures that all available expectation types work as expected
| def taxi_validator_pandas(titanic_data_context_modular_api):
"""
What does this test do and why?
Ensures that all available expectation types work as expected
"""
df = ge.read_csv(
file_relative_path(
__file__,
"../test_sets/taxi_yellow_trip_data_samples/yellow_trip_... | [
"def",
"taxi_validator_pandas",
"(",
"titanic_data_context_modular_api",
")",
":",
"df",
"=",
"ge",
".",
"read_csv",
"(",
"file_relative_path",
"(",
"__file__",
",",
"\"../test_sets/taxi_yellow_trip_data_samples/yellow_trip_data_sample_2019-01.csv\"",
",",
")",
",",
"parse_da... | [
188,
0
] | [
202,
77
] | python | en | ['en', 'error', 'th'] | False |
taxi_validator_spark | (spark_session, titanic_data_context_modular_api) |
What does this test do and why?
Ensures that all available expectation types work as expected
|
What does this test do and why?
Ensures that all available expectation types work as expected
| def taxi_validator_spark(spark_session, titanic_data_context_modular_api):
"""
What does this test do and why?
Ensures that all available expectation types work as expected
"""
df = ge.read_csv(
file_relative_path(
__file__,
"../test_sets/taxi_yellow_trip_data_samples... | [
"def",
"taxi_validator_spark",
"(",
"spark_session",
",",
"titanic_data_context_modular_api",
")",
":",
"df",
"=",
"ge",
".",
"read_csv",
"(",
"file_relative_path",
"(",
"__file__",
",",
"\"../test_sets/taxi_yellow_trip_data_samples/yellow_trip_data_sample_2019-01.csv\"",
",",
... | [
206,
0
] | [
218,
76
] | python | en | ['en', 'error', 'th'] | False |
taxi_validator_sqlalchemy | (sa, titanic_data_context_modular_api) |
What does this test do and why?
Ensures that all available expectation types work as expected
|
What does this test do and why?
Ensures that all available expectation types work as expected
| def taxi_validator_sqlalchemy(sa, titanic_data_context_modular_api):
"""
What does this test do and why?
Ensures that all available expectation types work as expected
"""
df = ge.read_csv(
file_relative_path(
__file__,
"../test_sets/taxi_yellow_trip_data_samples/yello... | [
"def",
"taxi_validator_sqlalchemy",
"(",
"sa",
",",
"titanic_data_context_modular_api",
")",
":",
"df",
"=",
"ge",
".",
"read_csv",
"(",
"file_relative_path",
"(",
"__file__",
",",
"\"../test_sets/taxi_yellow_trip_data_samples/yellow_trip_data_sample_2019-01.csv\"",
",",
")",... | [
222,
0
] | [
234,
58
] | python | en | ['en', 'error', 'th'] | False |
cardinality_validator | (titanic_data_context_modular_api) |
What does this test do and why?
Ensures that all available expectation types work as expected
|
What does this test do and why?
Ensures that all available expectation types work as expected
| def cardinality_validator(titanic_data_context_modular_api):
"""
What does this test do and why?
Ensures that all available expectation types work as expected
"""
df = pd.DataFrame(
{
# TODO: Uncomment assertions that use col_none when proportion_of_unique_values bug is fixed for... | [
"def",
"cardinality_validator",
"(",
"titanic_data_context_modular_api",
")",
":",
"df",
"=",
"pd",
".",
"DataFrame",
"(",
"{",
"# TODO: Uncomment assertions that use col_none when proportion_of_unique_values bug is fixed for columns",
"# that are all NULL/None",
"# \"col_none\": [Non... | [
252,
0
] | [
271,
77
] | python | en | ['en', 'error', 'th'] | False |
test_profiler_init_no_config | (
cardinality_validator,
) |
What does this test do and why?
Confirms that profiler can initialize with no config.
|
What does this test do and why?
Confirms that profiler can initialize with no config.
| def test_profiler_init_no_config(
cardinality_validator,
):
"""
What does this test do and why?
Confirms that profiler can initialize with no config.
"""
profiler = UserConfigurableProfiler(cardinality_validator)
assert profiler.primary_or_compound_key == []
assert profiler.ignored_colum... | [
"def",
"test_profiler_init_no_config",
"(",
"cardinality_validator",
",",
")",
":",
"profiler",
"=",
"UserConfigurableProfiler",
"(",
"cardinality_validator",
")",
"assert",
"profiler",
".",
"primary_or_compound_key",
"==",
"[",
"]",
"assert",
"profiler",
".",
"ignored_... | [
304,
0
] | [
316,
47
] | python | en | ['en', 'error', 'th'] | False |
test_profiler_init_full_config_no_semantic_types | (cardinality_validator) |
What does this test do and why?
Confirms that profiler initializes properly with a full config, without a semantic_types dict
|
What does this test do and why?
Confirms that profiler initializes properly with a full config, without a semantic_types dict
| def test_profiler_init_full_config_no_semantic_types(cardinality_validator):
"""
What does this test do and why?
Confirms that profiler initializes properly with a full config, without a semantic_types dict
"""
profiler = UserConfigurableProfiler(
cardinality_validator,
primary_or_c... | [
"def",
"test_profiler_init_full_config_no_semantic_types",
"(",
"cardinality_validator",
")",
":",
"profiler",
"=",
"UserConfigurableProfiler",
"(",
"cardinality_validator",
",",
"primary_or_compound_key",
"=",
"[",
"\"col_unique\"",
"]",
",",
"ignored_columns",
"=",
"[",
"... | [
319,
0
] | [
341,
48
] | python | en | ['en', 'error', 'th'] | False |
test_init_with_semantic_types | (cardinality_validator) |
What does this test do and why?
Confirms that profiler initializes properly with a full config and a semantic_types dict
|
What does this test do and why?
Confirms that profiler initializes properly with a full config and a semantic_types dict
| def test_init_with_semantic_types(cardinality_validator):
"""
What does this test do and why?
Confirms that profiler initializes properly with a full config and a semantic_types dict
"""
semantic_types = {
"numeric": ["col_few", "col_many", "col_very_many"],
"value_set": ["col_two",... | [
"def",
"test_init_with_semantic_types",
"(",
"cardinality_validator",
")",
":",
"semantic_types",
"=",
"{",
"\"numeric\"",
":",
"[",
"\"col_few\"",
",",
"\"col_many\"",
",",
"\"col_very_many\"",
"]",
",",
"\"value_set\"",
":",
"[",
"\"col_two\"",
",",
"\"col_very_few\... | [
344,
0
] | [
400,
5
] | python | en | ['en', 'error', 'th'] | False |
test__validate_config | (cardinality_validator) |
What does this test do and why?
Tests the validate config function on the profiler
|
What does this test do and why?
Tests the validate config function on the profiler
| def test__validate_config(cardinality_validator):
"""
What does this test do and why?
Tests the validate config function on the profiler
"""
with pytest.raises(AssertionError) as e:
UserConfigurableProfiler(cardinality_validator, ignored_columns="col_name")
assert e.typename == "Asserti... | [
"def",
"test__validate_config",
"(",
"cardinality_validator",
")",
":",
"with",
"pytest",
".",
"raises",
"(",
"AssertionError",
")",
"as",
"e",
":",
"UserConfigurableProfiler",
"(",
"cardinality_validator",
",",
"ignored_columns",
"=",
"\"col_name\"",
")",
"assert",
... | [
403,
0
] | [
415,
41
] | python | en | ['en', 'error', 'th'] | False |
test__validate_semantic_types_dict | (cardinality_validator) |
What does this test do and why?
Tests that _validate_semantic_types_dict function errors when not formatted correctly
|
What does this test do and why?
Tests that _validate_semantic_types_dict function errors when not formatted correctly
| def test__validate_semantic_types_dict(cardinality_validator):
"""
What does this test do and why?
Tests that _validate_semantic_types_dict function errors when not formatted correctly
"""
bad_semantic_types_dict_type = {"value_set": "col_few"}
with pytest.raises(AssertionError) as e:
U... | [
"def",
"test__validate_semantic_types_dict",
"(",
"cardinality_validator",
")",
":",
"bad_semantic_types_dict_type",
"=",
"{",
"\"value_set\"",
":",
"\"col_few\"",
"}",
"with",
"pytest",
".",
"raises",
"(",
"AssertionError",
")",
"as",
"e",
":",
"UserConfigurableProfile... | [
418,
0
] | [
455,
5
] | python | en | ['en', 'error', 'th'] | False |
test_build_suite_no_config | (titanic_validator, possible_expectations_set) |
What does this test do and why?
Tests that the build_suite function works as expected with no config
|
What does this test do and why?
Tests that the build_suite function works as expected with no config
| def test_build_suite_no_config(titanic_validator, possible_expectations_set):
"""
What does this test do and why?
Tests that the build_suite function works as expected with no config
"""
profiler = UserConfigurableProfiler(titanic_validator)
suite = profiler.build_suite()
expectations_from_s... | [
"def",
"test_build_suite_no_config",
"(",
"titanic_validator",
",",
"possible_expectations_set",
")",
":",
"profiler",
"=",
"UserConfigurableProfiler",
"(",
"titanic_validator",
")",
"suite",
"=",
"profiler",
".",
"build_suite",
"(",
")",
"expectations_from_suite",
"=",
... | [
458,
0
] | [
468,
40
] | python | en | ['en', 'error', 'th'] | False |
test_build_suite_with_config_and_no_semantic_types_dict | (
titanic_validator, possible_expectations_set
) |
What does this test do and why?
Tests that the build_suite function works as expected with a config and without a semantic_types dict
|
What does this test do and why?
Tests that the build_suite function works as expected with a config and without a semantic_types dict
| def test_build_suite_with_config_and_no_semantic_types_dict(
titanic_validator, possible_expectations_set
):
"""
What does this test do and why?
Tests that the build_suite function works as expected with a config and without a semantic_types dict
"""
profiler = UserConfigurableProfiler(
... | [
"def",
"test_build_suite_with_config_and_no_semantic_types_dict",
"(",
"titanic_validator",
",",
"possible_expectations_set",
")",
":",
"profiler",
"=",
"UserConfigurableProfiler",
"(",
"titanic_validator",
",",
"ignored_columns",
"=",
"[",
"\"Survived\"",
",",
"\"Unnamed: 0\""... | [
515,
0
] | [
540,
40
] | python | en | ['en', 'error', 'th'] | False |
test_build_suite_with_semantic_types_dict | (
cardinality_validator,
possible_expectations_set,
) |
What does this test do and why?
Tests that the build_suite function works as expected with a semantic_types dict
|
What does this test do and why?
Tests that the build_suite function works as expected with a semantic_types dict
| def test_build_suite_with_semantic_types_dict(
cardinality_validator,
possible_expectations_set,
):
"""
What does this test do and why?
Tests that the build_suite function works as expected with a semantic_types dict
"""
semantic_types = {
"numeric": ["col_few", "col_many", "col_ver... | [
"def",
"test_build_suite_with_semantic_types_dict",
"(",
"cardinality_validator",
",",
"possible_expectations_set",
",",
")",
":",
"semantic_types",
"=",
"{",
"\"numeric\"",
":",
"[",
"\"col_few\"",
",",
"\"col_many\"",
",",
"\"col_very_many\"",
"]",
",",
"\"value_set\"",... | [
543,
0
] | [
585,
59
] | python | en | ['en', 'error', 'th'] | False |
test_build_suite_when_suite_already_exists | (cardinality_validator) |
What does this test do and why?
Confirms that creating a new suite on an existing profiler wipes the previous suite
|
What does this test do and why?
Confirms that creating a new suite on an existing profiler wipes the previous suite
| def test_build_suite_when_suite_already_exists(cardinality_validator):
"""
What does this test do and why?
Confirms that creating a new suite on an existing profiler wipes the previous suite
"""
profiler = UserConfigurableProfiler(
cardinality_validator,
table_expectations_only=True,... | [
"def",
"test_build_suite_when_suite_already_exists",
"(",
"cardinality_validator",
")",
":",
"profiler",
"=",
"UserConfigurableProfiler",
"(",
"cardinality_validator",
",",
"table_expectations_only",
"=",
"True",
",",
"excluded_expectations",
"=",
"[",
"\"expect_table_row_count... | [
588,
0
] | [
608,
65
] | python | en | ['en', 'error', 'th'] | False |
test_primary_or_compound_key_not_found_in_columns | (cardinality_validator) |
What does this test do and why?
Confirms that an error is raised if a primary_or_compound key is specified with a column not found in the validator
|
What does this test do and why?
Confirms that an error is raised if a primary_or_compound key is specified with a column not found in the validator
| def test_primary_or_compound_key_not_found_in_columns(cardinality_validator):
"""
What does this test do and why?
Confirms that an error is raised if a primary_or_compound key is specified with a column not found in the validator
"""
# regular case, should pass
working_profiler = UserConfigurabl... | [
"def",
"test_primary_or_compound_key_not_found_in_columns",
"(",
"cardinality_validator",
")",
":",
"# regular case, should pass",
"working_profiler",
"=",
"UserConfigurableProfiler",
"(",
"cardinality_validator",
",",
"primary_or_compound_key",
"=",
"[",
"\"col_unique\"",
"]",
"... | [
611,
0
] | [
639,
87
] | python | en | ['en', 'error', 'th'] | False |
test_config_with_not_null_only | (
titanic_data_context_modular_api, nulls_validator, possible_expectations_set
) |
What does this test do and why?
Confirms that the not_null_only key in config works as expected.
|
What does this test do and why?
Confirms that the not_null_only key in config works as expected.
| def test_config_with_not_null_only(
titanic_data_context_modular_api, nulls_validator, possible_expectations_set
):
"""
What does this test do and why?
Confirms that the not_null_only key in config works as expected.
"""
excluded_expectations = [i for i in possible_expectations_set if "null" no... | [
"def",
"test_config_with_not_null_only",
"(",
"titanic_data_context_modular_api",
",",
"nulls_validator",
",",
"possible_expectations_set",
")",
":",
"excluded_expectations",
"=",
"[",
"i",
"for",
"i",
"in",
"possible_expectations_set",
"if",
"\"null\"",
"not",
"in",
"i",... | [
642,
0
] | [
678,
60
] | python | en | ['en', 'error', 'th'] | False |
test_profiled_dataset_passes_own_validation | (
cardinality_validator, titanic_data_context
) |
What does this test do and why?
Confirms that a suite created on a validator with no config will pass when validated against itself
|
What does this test do and why?
Confirms that a suite created on a validator with no config will pass when validated against itself
| def test_profiled_dataset_passes_own_validation(
cardinality_validator, titanic_data_context
):
"""
What does this test do and why?
Confirms that a suite created on a validator with no config will pass when validated against itself
"""
context = titanic_data_context
profiler = UserConfigurab... | [
"def",
"test_profiled_dataset_passes_own_validation",
"(",
"cardinality_validator",
",",
"titanic_data_context",
")",
":",
"context",
"=",
"titanic_data_context",
"profiler",
"=",
"UserConfigurableProfiler",
"(",
"cardinality_validator",
",",
"ignored_columns",
"=",
"[",
"\"c... | [
697,
0
] | [
715,
29
] | python | en | ['en', 'error', 'th'] | False |
test_profiler_all_expectation_types_pandas | (
titanic_data_context_modular_api,
taxi_validator_pandas,
possible_expectations_set,
taxi_data_semantic_types,
taxi_data_ignored_columns,
) |
What does this test do and why?
Ensures that all available expectation types work as expected for pandas
|
What does this test do and why?
Ensures that all available expectation types work as expected for pandas
| def test_profiler_all_expectation_types_pandas(
titanic_data_context_modular_api,
taxi_validator_pandas,
possible_expectations_set,
taxi_data_semantic_types,
taxi_data_ignored_columns,
):
"""
What does this test do and why?
Ensures that all available expectation types work as expected fo... | [
"def",
"test_profiler_all_expectation_types_pandas",
"(",
"titanic_data_context_modular_api",
",",
"taxi_validator_pandas",
",",
"possible_expectations_set",
",",
"taxi_data_semantic_types",
",",
"taxi_data_ignored_columns",
",",
")",
":",
"context",
"=",
"titanic_data_context_modu... | [
749,
0
] | [
803,
29
] | python | en | ['en', 'error', 'th'] | False |
test_profiler_all_expectation_types_spark | (
titanic_data_context_modular_api,
taxi_validator_spark,
possible_expectations_set,
taxi_data_semantic_types,
taxi_data_ignored_columns,
) |
What does this test do and why?
Ensures that all available expectation types work as expected for spark
|
What does this test do and why?
Ensures that all available expectation types work as expected for spark
| def test_profiler_all_expectation_types_spark(
titanic_data_context_modular_api,
taxi_validator_spark,
possible_expectations_set,
taxi_data_semantic_types,
taxi_data_ignored_columns,
):
"""
What does this test do and why?
Ensures that all available expectation types work as expected for ... | [
"def",
"test_profiler_all_expectation_types_spark",
"(",
"titanic_data_context_modular_api",
",",
"taxi_validator_spark",
",",
"possible_expectations_set",
",",
"taxi_data_semantic_types",
",",
"taxi_data_ignored_columns",
",",
")",
":",
"context",
"=",
"titanic_data_context_modula... | [
810,
0
] | [
864,
29
] | python | en | ['en', 'error', 'th'] | False |
test_profiler_all_expectation_types_sqlalchemy | (
titanic_data_context_modular_api,
taxi_validator_sqlalchemy,
possible_expectations_set,
taxi_data_semantic_types,
taxi_data_ignored_columns,
) |
What does this test do and why?
Ensures that all available expectation types work as expected for sqlalchemy
|
What does this test do and why?
Ensures that all available expectation types work as expected for sqlalchemy
| def test_profiler_all_expectation_types_sqlalchemy(
titanic_data_context_modular_api,
taxi_validator_sqlalchemy,
possible_expectations_set,
taxi_data_semantic_types,
taxi_data_ignored_columns,
):
"""
What does this test do and why?
Ensures that all available expectation types work as exp... | [
"def",
"test_profiler_all_expectation_types_sqlalchemy",
"(",
"titanic_data_context_modular_api",
",",
"taxi_validator_sqlalchemy",
",",
"possible_expectations_set",
",",
"taxi_data_semantic_types",
",",
"taxi_data_ignored_columns",
",",
")",
":",
"if",
"taxi_validator_sqlalchemy",
... | [
871,
0
] | [
928,
29
] | python | en | ['en', 'error', 'th'] | False |
_get_dialect_type_module | (dialect) | Given a dialect, returns the dialect type, which is defines the engine/system that is used to communicates
with the database/database implementation. Currently checks for RedShift/BigQuery dialects | Given a dialect, returns the dialect type, which is defines the engine/system that is used to communicates
with the database/database implementation. Currently checks for RedShift/BigQuery dialects | def _get_dialect_type_module(dialect):
"""Given a dialect, returns the dialect type, which is defines the engine/system that is used to communicates
with the database/database implementation. Currently checks for RedShift/BigQuery dialects"""
if dialect is None:
logger.warning(
"No sqlal... | [
"def",
"_get_dialect_type_module",
"(",
"dialect",
")",
":",
"if",
"dialect",
"is",
"None",
":",
"logger",
".",
"warning",
"(",
"\"No sqlalchemy dialect found; relying in top-level sqlalchemy types.\"",
")",
"return",
"sa",
"try",
":",
"# Redshift does not (yet) export type... | [
111,
0
] | [
139,
18
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine.__init__ | (
self,
name=None,
credentials=None,
data_context=None,
engine=None,
connection_string=None,
url=None,
batch_data_dict=None,
create_temp_table=True,
**kwargs, # These will be passed as optional parameters to the SQLAlchemy engine, **not** ... | Builds a SqlAlchemyExecutionEngine, using a provided connection string/url/engine/credentials to access the
desired database. Also initializes the dialect to be used and configures usage statistics.
Args:
name (str): \
The name of the SqlAlchemyExecutionEngine
... | Builds a SqlAlchemyExecutionEngine, using a provided connection string/url/engine/credentials to access the
desired database. Also initializes the dialect to be used and configures usage statistics. | def __init__(
self,
name=None,
credentials=None,
data_context=None,
engine=None,
connection_string=None,
url=None,
batch_data_dict=None,
create_temp_table=True,
**kwargs, # These will be passed as optional parameters to the SQLAlchemy engi... | [
"def",
"__init__",
"(",
"self",
",",
"name",
"=",
"None",
",",
"credentials",
"=",
"None",
",",
"data_context",
"=",
"None",
",",
"engine",
"=",
"None",
",",
"connection_string",
"=",
"None",
",",
"url",
"=",
"None",
",",
"batch_data_dict",
"=",
"None",
... | [
143,
4
] | [
274,
87
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._build_engine | (self, credentials, **kwargs) |
Using a set of given credentials, constructs an Execution Engine , connecting to a database using a URL or a
private key path.
|
Using a set of given credentials, constructs an Execution Engine , connecting to a database using a URL or a
private key path.
| def _build_engine(self, credentials, **kwargs) -> "sa.engine.Engine":
"""
Using a set of given credentials, constructs an Execution Engine , connecting to a database using a URL or a
private key path.
"""
# Update credentials with anything passed during connection time
dr... | [
"def",
"_build_engine",
"(",
"self",
",",
"credentials",
",",
"*",
"*",
"kwargs",
")",
"->",
"\"sa.engine.Engine\"",
":",
"# Update credentials with anything passed during connection time",
"drivername",
"=",
"credentials",
".",
"pop",
"(",
"\"drivername\"",
")",
"schem... | [
288,
4
] | [
316,
21
] | python | en | ['en', 'error', 'th'] | False |
SqlAlchemyExecutionEngine._get_sqlalchemy_key_pair_auth_url | (
self, drivername: str, credentials: dict
) |
Utilizing a private key path and a passphrase in a given credentials dictionary, attempts to encode the provided
values into a private key. If passphrase is incorrect, this will fail and an exception is raised.
Args:
drivername(str) - The name of the driver class
creden... |
Utilizing a private key path and a passphrase in a given credentials dictionary, attempts to encode the provided
values into a private key. If passphrase is incorrect, this will fail and an exception is raised. | def _get_sqlalchemy_key_pair_auth_url(
self, drivername: str, credentials: dict
) -> Tuple["sa.engine.url.URL", Dict]:
"""
Utilizing a private key path and a passphrase in a given credentials dictionary, attempts to encode the provided
values into a private key. If passphrase is inco... | [
"def",
"_get_sqlalchemy_key_pair_auth_url",
"(",
"self",
",",
"drivername",
":",
"str",
",",
"credentials",
":",
"dict",
")",
"->",
"Tuple",
"[",
"\"sa.engine.url.URL\"",
",",
"Dict",
"]",
":",
"from",
"cryptography",
".",
"hazmat",
".",
"backends",
"import",
... | [
318,
4
] | [
366,
9
] | python | en | ['en', 'error', 'th'] | False |
SqlAlchemyExecutionEngine.get_compute_domain | (
self,
domain_kwargs: Dict,
domain_type: Union[str, MetricDomainTypes],
accessor_keys: Optional[Iterable[str]] = None,
) | Uses a given batch dictionary and domain kwargs to obtain a SqlAlchemy column object.
Args:
domain_kwargs (dict) - A dictionary consisting of the domain kwargs specifying which data to obtain
domain_type (str or MetricDomainTypes) - an Enum value indicating which metric domain the user ... | Uses a given batch dictionary and domain kwargs to obtain a SqlAlchemy column object. | def get_compute_domain(
self,
domain_kwargs: Dict,
domain_type: Union[str, MetricDomainTypes],
accessor_keys: Optional[Iterable[str]] = None,
) -> Tuple[Select, dict, dict]:
"""Uses a given batch dictionary and domain kwargs to obtain a SqlAlchemy column object.
Args... | [
"def",
"get_compute_domain",
"(",
"self",
",",
"domain_kwargs",
":",
"Dict",
",",
"domain_type",
":",
"Union",
"[",
"str",
",",
"MetricDomainTypes",
"]",
",",
"accessor_keys",
":",
"Optional",
"[",
"Iterable",
"[",
"str",
"]",
"]",
"=",
"None",
",",
")",
... | [
368,
4
] | [
580,
72
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine.resolve_metric_bundle | (
self,
metric_fn_bundle: Iterable[Tuple[MetricConfiguration, Any, dict, dict]],
) | For every metric in a set of Metrics to resolve, obtains necessary metric keyword arguments and builds
bundles of the metrics into one large query dictionary so that they are all executed simultaneously. Will fail
if bundling the metrics together is not possible.
Args:
metri... | For every metric in a set of Metrics to resolve, obtains necessary metric keyword arguments and builds
bundles of the metrics into one large query dictionary so that they are all executed simultaneously. Will fail
if bundling the metrics together is not possible. | def resolve_metric_bundle(
self,
metric_fn_bundle: Iterable[Tuple[MetricConfiguration, Any, dict, dict]],
) -> dict:
"""For every metric in a set of Metrics to resolve, obtains necessary metric keyword arguments and builds
bundles of the metrics into one large query dictionary so tha... | [
"def",
"resolve_metric_bundle",
"(",
"self",
",",
"metric_fn_bundle",
":",
"Iterable",
"[",
"Tuple",
"[",
"MetricConfiguration",
",",
"Any",
",",
"dict",
",",
"dict",
"]",
"]",
",",
")",
"->",
"dict",
":",
"resolved_metrics",
"=",
"dict",
"(",
")",
"# We n... | [
582,
4
] | [
651,
31
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._split_on_whole_table | (self, table_name: str, batch_identifiers: dict) | Split' by returning the whole table | Split' by returning the whole table | def _split_on_whole_table(self, table_name: str, batch_identifiers: dict):
"""'Split' by returning the whole table"""
# return sa.column(column_name) == batch_identifiers[column_name]
return 1 == 1 | [
"def",
"_split_on_whole_table",
"(",
"self",
",",
"table_name",
":",
"str",
",",
"batch_identifiers",
":",
"dict",
")",
":",
"# return sa.column(column_name) == batch_identifiers[column_name]",
"return",
"1",
"==",
"1"
] | [
655,
4
] | [
659,
21
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._split_on_column_value | (
self, table_name: str, column_name: str, batch_identifiers: dict
) | Split using the values in the named column | Split using the values in the named column | def _split_on_column_value(
self, table_name: str, column_name: str, batch_identifiers: dict
):
"""Split using the values in the named column"""
return sa.column(column_name) == batch_identifiers[column_name] | [
"def",
"_split_on_column_value",
"(",
"self",
",",
"table_name",
":",
"str",
",",
"column_name",
":",
"str",
",",
"batch_identifiers",
":",
"dict",
")",
":",
"return",
"sa",
".",
"column",
"(",
"column_name",
")",
"==",
"batch_identifiers",
"[",
"column_name",... | [
661,
4
] | [
666,
71
] | python | en | ['en', 'no', 'en'] | True |
SqlAlchemyExecutionEngine._split_on_converted_datetime | (
self,
table_name: str,
column_name: str,
batch_identifiers: dict,
date_format_string: str = "%Y-%m-%d",
) | Convert the values in the named column to the given date_format, and split on that | Convert the values in the named column to the given date_format, and split on that | def _split_on_converted_datetime(
self,
table_name: str,
column_name: str,
batch_identifiers: dict,
date_format_string: str = "%Y-%m-%d",
):
"""Convert the values in the named column to the given date_format, and split on that"""
return (
sa.func.... | [
"def",
"_split_on_converted_datetime",
"(",
"self",
",",
"table_name",
":",
"str",
",",
"column_name",
":",
"str",
",",
"batch_identifiers",
":",
"dict",
",",
"date_format_string",
":",
"str",
"=",
"\"%Y-%m-%d\"",
",",
")",
":",
"return",
"(",
"sa",
".",
"fu... | [
668,
4
] | [
683,
9
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._split_on_divided_integer | (
self, table_name: str, column_name: str, divisor: int, batch_identifiers: dict
) | Divide the values in the named column by `divisor`, and split on that | Divide the values in the named column by `divisor`, and split on that | def _split_on_divided_integer(
self, table_name: str, column_name: str, divisor: int, batch_identifiers: dict
):
"""Divide the values in the named column by `divisor`, and split on that"""
return (
sa.cast(sa.column(column_name) / divisor, sa.Integer)
== batch_identi... | [
"def",
"_split_on_divided_integer",
"(",
"self",
",",
"table_name",
":",
"str",
",",
"column_name",
":",
"str",
",",
"divisor",
":",
"int",
",",
"batch_identifiers",
":",
"dict",
")",
":",
"return",
"(",
"sa",
".",
"cast",
"(",
"sa",
".",
"column",
"(",
... | [
685,
4
] | [
693,
9
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._split_on_mod_integer | (
self, table_name: str, column_name: str, mod: int, batch_identifiers: dict
) | Divide the values in the named column by `divisor`, and split on that | Divide the values in the named column by `divisor`, and split on that | def _split_on_mod_integer(
self, table_name: str, column_name: str, mod: int, batch_identifiers: dict
):
"""Divide the values in the named column by `divisor`, and split on that"""
return sa.column(column_name) % mod == batch_identifiers[column_name] | [
"def",
"_split_on_mod_integer",
"(",
"self",
",",
"table_name",
":",
"str",
",",
"column_name",
":",
"str",
",",
"mod",
":",
"int",
",",
"batch_identifiers",
":",
"dict",
")",
":",
"return",
"sa",
".",
"column",
"(",
"column_name",
")",
"%",
"mod",
"==",... | [
695,
4
] | [
700,
77
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._split_on_multi_column_values | (
self, table_name: str, column_names: List[str], batch_identifiers: dict
) | Split on the joint values in the named columns | Split on the joint values in the named columns | def _split_on_multi_column_values(
self, table_name: str, column_names: List[str], batch_identifiers: dict
):
"""Split on the joint values in the named columns"""
return sa.and_(
*[
sa.column(column_name) == column_value
for column_name, column_va... | [
"def",
"_split_on_multi_column_values",
"(",
"self",
",",
"table_name",
":",
"str",
",",
"column_names",
":",
"List",
"[",
"str",
"]",
",",
"batch_identifiers",
":",
"dict",
")",
":",
"return",
"sa",
".",
"and_",
"(",
"*",
"[",
"sa",
".",
"column",
"(",
... | [
702,
4
] | [
712,
9
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._split_on_hashed_column | (
self,
table_name: str,
column_name: str,
hash_digits: int,
batch_identifiers: dict,
) | Split on the hashed value of the named column | Split on the hashed value of the named column | def _split_on_hashed_column(
self,
table_name: str,
column_name: str,
hash_digits: int,
batch_identifiers: dict,
):
"""Split on the hashed value of the named column"""
return (
sa.func.right(sa.func.md5(sa.column(column_name)), hash_digits)
... | [
"def",
"_split_on_hashed_column",
"(",
"self",
",",
"table_name",
":",
"str",
",",
"column_name",
":",
"str",
",",
"hash_digits",
":",
"int",
",",
"batch_identifiers",
":",
"dict",
",",
")",
":",
"return",
"(",
"sa",
".",
"func",
".",
"right",
"(",
"sa",... | [
714,
4
] | [
726,
9
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._sample_using_random | (
self,
p: float = 0.1,
) | Take a random sample of rows, retaining proportion p
Note: the Random function behaves differently on different dialects of SQL
| Take a random sample of rows, retaining proportion p | def _sample_using_random(
self,
p: float = 0.1,
):
"""Take a random sample of rows, retaining proportion p
Note: the Random function behaves differently on different dialects of SQL
"""
return sa.func.random() < p | [
"def",
"_sample_using_random",
"(",
"self",
",",
"p",
":",
"float",
"=",
"0.1",
",",
")",
":",
"return",
"sa",
".",
"func",
".",
"random",
"(",
")",
"<",
"p"
] | [
736,
4
] | [
744,
35
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._sample_using_mod | (
self,
column_name,
mod: int,
value: int,
) | Take the mod of named column, and only keep rows that match the given value | Take the mod of named column, and only keep rows that match the given value | def _sample_using_mod(
self,
column_name,
mod: int,
value: int,
):
"""Take the mod of named column, and only keep rows that match the given value"""
return sa.column(column_name) % mod == value | [
"def",
"_sample_using_mod",
"(",
"self",
",",
"column_name",
",",
"mod",
":",
"int",
",",
"value",
":",
"int",
",",
")",
":",
"return",
"sa",
".",
"column",
"(",
"column_name",
")",
"%",
"mod",
"==",
"value"
] | [
746,
4
] | [
753,
52
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._sample_using_a_list | (
self,
column_name: str,
value_list: list,
) | Match the values in the named column against value_list, and only keep the matches | Match the values in the named column against value_list, and only keep the matches | def _sample_using_a_list(
self,
column_name: str,
value_list: list,
):
"""Match the values in the named column against value_list, and only keep the matches"""
return sa.column(column_name).in_(value_list) | [
"def",
"_sample_using_a_list",
"(",
"self",
",",
"column_name",
":",
"str",
",",
"value_list",
":",
"list",
",",
")",
":",
"return",
"sa",
".",
"column",
"(",
"column_name",
")",
".",
"in_",
"(",
"value_list",
")"
] | [
755,
4
] | [
761,
53
] | python | en | ['en', 'en', 'en'] | True |
SqlAlchemyExecutionEngine._sample_using_md5 | (
self,
column_name: str,
hash_digits: int = 1,
hash_value: str = "f",
) | Hash the values in the named column, and split on that | Hash the values in the named column, and split on that | def _sample_using_md5(
self,
column_name: str,
hash_digits: int = 1,
hash_value: str = "f",
):
"""Hash the values in the named column, and split on that"""
return (
sa.func.right(
sa.func.md5(sa.cast(sa.column(column_name), sa.Text)), hash_... | [
"def",
"_sample_using_md5",
"(",
"self",
",",
"column_name",
":",
"str",
",",
"hash_digits",
":",
"int",
"=",
"1",
",",
"hash_value",
":",
"str",
"=",
"\"f\"",
",",
")",
":",
"return",
"(",
"sa",
".",
"func",
".",
"right",
"(",
"sa",
".",
"func",
"... | [
763,
4
] | [
775,
9
] | python | en | ['en', 'en', 'en'] | True |
QuoteForRspFile | (arg) | Quote a command line argument so that it appears as one argument when
processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for
Windows programs). | Quote a command line argument so that it appears as one argument when
processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for
Windows programs). | def QuoteForRspFile(arg):
"""Quote a command line argument so that it appears as one argument when
processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for
Windows programs)."""
# See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment
# threads. This is actually the quoting rul... | [
"def",
"QuoteForRspFile",
"(",
"arg",
")",
":",
"# See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment",
"# threads. This is actually the quoting rules for CommandLineToArgvW, not",
"# for the shell, because the shell doesn't do anything in Windows. This",
"# works more or less b... | [
22,
0
] | [
49,
24
] | python | en | ['en', 'en', 'en'] | True |
EncodeRspFileList | (args) | Process a list of arguments using QuoteCmdExeArgument. | Process a list of arguments using QuoteCmdExeArgument. | def EncodeRspFileList(args):
"""Process a list of arguments using QuoteCmdExeArgument."""
# Note that the first argument is assumed to be the command. Don't add
# quotes around it because then built-ins like 'echo', etc. won't work.
# Take care to normpath only the path in the case of 'call ../x.bat' because
... | [
"def",
"EncodeRspFileList",
"(",
"args",
")",
":",
"# Note that the first argument is assumed to be the command. Don't add",
"# quotes around it because then built-ins like 'echo', etc. won't work.",
"# Take care to normpath only the path in the case of 'call ../x.bat' because",
"# otherwise the w... | [
52,
0
] | [
65,
75
] | python | en | ['en', 'en', 'en'] | True |
_GenericRetrieve | (root, default, path) | Given a list of dictionary keys |path| and a tree of dicts |root|, find
value at path, or return |default| if any of the path doesn't exist. | Given a list of dictionary keys |path| and a tree of dicts |root|, find
value at path, or return |default| if any of the path doesn't exist. | def _GenericRetrieve(root, default, path):
"""Given a list of dictionary keys |path| and a tree of dicts |root|, find
value at path, or return |default| if any of the path doesn't exist."""
if not root:
return default
if not path:
return root
return _GenericRetrieve(root.get(path[0]), default, path[1:... | [
"def",
"_GenericRetrieve",
"(",
"root",
",",
"default",
",",
"path",
")",
":",
"if",
"not",
"root",
":",
"return",
"default",
"if",
"not",
"path",
":",
"return",
"root",
"return",
"_GenericRetrieve",
"(",
"root",
".",
"get",
"(",
"path",
"[",
"0",
"]",... | [
68,
0
] | [
75,
63
] | python | en | ['en', 'en', 'en'] | True |
_AddPrefix | (element, prefix) | Add |prefix| to |element| or each subelement if element is iterable. | Add |prefix| to |element| or each subelement if element is iterable. | def _AddPrefix(element, prefix):
"""Add |prefix| to |element| or each subelement if element is iterable."""
if element is None:
return element
# Note, not Iterable because we don't want to handle strings like that.
if isinstance(element, list) or isinstance(element, tuple):
return [prefix + e for e in e... | [
"def",
"_AddPrefix",
"(",
"element",
",",
"prefix",
")",
":",
"if",
"element",
"is",
"None",
":",
"return",
"element",
"# Note, not Iterable because we don't want to handle strings like that.",
"if",
"isinstance",
"(",
"element",
",",
"list",
")",
"or",
"isinstance",
... | [
78,
0
] | [
86,
27
] | python | en | ['en', 'en', 'en'] | True |
_DoRemapping | (element, map) | If |element| then remap it through |map|. If |element| is iterable then
each item will be remapped. Any elements not found will be removed. | If |element| then remap it through |map|. If |element| is iterable then
each item will be remapped. Any elements not found will be removed. | def _DoRemapping(element, map):
"""If |element| then remap it through |map|. If |element| is iterable then
each item will be remapped. Any elements not found will be removed."""
if map is not None and element is not None:
if not callable(map):
map = map.get # Assume it's a dict, otherwise a callable to ... | [
"def",
"_DoRemapping",
"(",
"element",
",",
"map",
")",
":",
"if",
"map",
"is",
"not",
"None",
"and",
"element",
"is",
"not",
"None",
":",
"if",
"not",
"callable",
"(",
"map",
")",
":",
"map",
"=",
"map",
".",
"get",
"# Assume it's a dict, otherwise a ca... | [
89,
0
] | [
99,
16
] | python | en | ['en', 'en', 'en'] | True |
_AppendOrReturn | (append, element) | If |append| is None, simply return |element|. If |append| is not None,
then add |element| to it, adding each item in |element| if it's a list or
tuple. | If |append| is None, simply return |element|. If |append| is not None,
then add |element| to it, adding each item in |element| if it's a list or
tuple. | def _AppendOrReturn(append, element):
"""If |append| is None, simply return |element|. If |append| is not None,
then add |element| to it, adding each item in |element| if it's a list or
tuple."""
if append is not None and element is not None:
if isinstance(element, list) or isinstance(element, tuple):
... | [
"def",
"_AppendOrReturn",
"(",
"append",
",",
"element",
")",
":",
"if",
"append",
"is",
"not",
"None",
"and",
"element",
"is",
"not",
"None",
":",
"if",
"isinstance",
"(",
"element",
",",
"list",
")",
"or",
"isinstance",
"(",
"element",
",",
"tuple",
... | [
102,
0
] | [
112,
18
] | python | en | ['en', 'en', 'en'] | True |
_FindDirectXInstallation | () | Try to find an installation location for the DirectX SDK. Check for the
standard environment variable, and if that doesn't exist, try to find
via the registry. May return None if not found in either location. | Try to find an installation location for the DirectX SDK. Check for the
standard environment variable, and if that doesn't exist, try to find
via the registry. May return None if not found in either location. | def _FindDirectXInstallation():
"""Try to find an installation location for the DirectX SDK. Check for the
standard environment variable, and if that doesn't exist, try to find
via the registry. May return None if not found in either location."""
# Return previously calculated value, if there is one
if hasatt... | [
"def",
"_FindDirectXInstallation",
"(",
")",
":",
"# Return previously calculated value, if there is one",
"if",
"hasattr",
"(",
"_FindDirectXInstallation",
",",
"'dxsdk_dir'",
")",
":",
"return",
"_FindDirectXInstallation",
".",
"dxsdk_dir",
"dxsdk_dir",
"=",
"os",
".",
... | [
115,
0
] | [
134,
18
] | python | en | ['en', 'en', 'en'] | True |
GetGlobalVSMacroEnv | (vs_version) | Get a dict of variables mapping internal VS macro names to their gyp
equivalents. Returns all variables that are independent of the target. | Get a dict of variables mapping internal VS macro names to their gyp
equivalents. Returns all variables that are independent of the target. | def GetGlobalVSMacroEnv(vs_version):
"""Get a dict of variables mapping internal VS macro names to their gyp
equivalents. Returns all variables that are independent of the target."""
env = {}
# '$(VSInstallDir)' and '$(VCInstallDir)' are available when and only when
# Visual Studio is actually installed.
if... | [
"def",
"GetGlobalVSMacroEnv",
"(",
"vs_version",
")",
":",
"env",
"=",
"{",
"}",
"# '$(VSInstallDir)' and '$(VCInstallDir)' are available when and only when",
"# Visual Studio is actually installed.",
"if",
"vs_version",
".",
"Path",
"(",
")",
":",
"env",
"[",
"'$(VSInstall... | [
137,
0
] | [
155,
12
] | python | en | ['en', 'en', 'en'] | True |
ExtractSharedMSVSSystemIncludes | (configs, generator_flags) | Finds msvs_system_include_dirs that are common to all targets, removes
them from all targets, and returns an OrderedSet containing them. | Finds msvs_system_include_dirs that are common to all targets, removes
them from all targets, and returns an OrderedSet containing them. | def ExtractSharedMSVSSystemIncludes(configs, generator_flags):
"""Finds msvs_system_include_dirs that are common to all targets, removes
them from all targets, and returns an OrderedSet containing them."""
all_system_includes = OrderedSet(
configs[0].get('msvs_system_include_dirs', []))
for config in conf... | [
"def",
"ExtractSharedMSVSSystemIncludes",
"(",
"configs",
",",
"generator_flags",
")",
":",
"all_system_includes",
"=",
"OrderedSet",
"(",
"configs",
"[",
"0",
"]",
".",
"get",
"(",
"'msvs_system_include_dirs'",
",",
"[",
"]",
")",
")",
"for",
"config",
"in",
... | [
157,
0
] | [
182,
33
] | python | en | ['en', 'en', 'en'] | True |
ExpandMacros | (string, expansions) | Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv
for the canonical way to retrieve a suitable dict. | Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv
for the canonical way to retrieve a suitable dict. | def ExpandMacros(string, expansions):
"""Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv
for the canonical way to retrieve a suitable dict."""
if '$' in string:
for old, new in expansions.iteritems():
assert '$(' not in new, new
string = string.replace(old, new)
return str... | [
"def",
"ExpandMacros",
"(",
"string",
",",
"expansions",
")",
":",
"if",
"'$'",
"in",
"string",
":",
"for",
"old",
",",
"new",
"in",
"expansions",
".",
"iteritems",
"(",
")",
":",
"assert",
"'$('",
"not",
"in",
"new",
",",
"new",
"string",
"=",
"stri... | [
939,
0
] | [
946,
15
] | python | en | ['en', 'en', 'it'] | True |
_ExtractImportantEnvironment | (output_of_set) | Extracts environment variables required for the toolchain to run from
a textual dump output by the cmd.exe 'set' command. | Extracts environment variables required for the toolchain to run from
a textual dump output by the cmd.exe 'set' command. | def _ExtractImportantEnvironment(output_of_set):
"""Extracts environment variables required for the toolchain to run from
a textual dump output by the cmd.exe 'set' command."""
envvars_to_save = (
'goma_.*', # TODO(scottmg): This is ugly, but needed for goma.
'include',
'lib',
'libpath',
... | [
"def",
"_ExtractImportantEnvironment",
"(",
"output_of_set",
")",
":",
"envvars_to_save",
"=",
"(",
"'goma_.*'",
",",
"# TODO(scottmg): This is ugly, but needed for goma.",
"'include'",
",",
"'lib'",
",",
"'libpath'",
",",
"'path'",
",",
"'pathext'",
",",
"'systemroot'",
... | [
948,
0
] | [
979,
12
] | python | en | ['en', 'en', 'en'] | True |
_FormatAsEnvironmentBlock | (envvar_dict) | Format as an 'environment block' directly suitable for CreateProcess.
Briefly this is a list of key=value\0, terminated by an additional \0. See
CreateProcess documentation for more details. | Format as an 'environment block' directly suitable for CreateProcess.
Briefly this is a list of key=value\0, terminated by an additional \0. See
CreateProcess documentation for more details. | def _FormatAsEnvironmentBlock(envvar_dict):
"""Format as an 'environment block' directly suitable for CreateProcess.
Briefly this is a list of key=value\0, terminated by an additional \0. See
CreateProcess documentation for more details."""
block = ''
nul = '\0'
for key, value in envvar_dict.iteritems():
... | [
"def",
"_FormatAsEnvironmentBlock",
"(",
"envvar_dict",
")",
":",
"block",
"=",
"''",
"nul",
"=",
"'\\0'",
"for",
"key",
",",
"value",
"in",
"envvar_dict",
".",
"iteritems",
"(",
")",
":",
"block",
"+=",
"key",
"+",
"'='",
"+",
"value",
"+",
"nul",
"bl... | [
981,
0
] | [
990,
14
] | python | en | ['en', 'en', 'en'] | True |
_ExtractCLPath | (output_of_where) | Gets the path to cl.exe based on the output of calling the environment
setup batch file, followed by the equivalent of `where`. | Gets the path to cl.exe based on the output of calling the environment
setup batch file, followed by the equivalent of `where`. | def _ExtractCLPath(output_of_where):
"""Gets the path to cl.exe based on the output of calling the environment
setup batch file, followed by the equivalent of `where`."""
# Take the first line, as that's the first found in the PATH.
for line in output_of_where.strip().splitlines():
if line.startswith('LOC:'... | [
"def",
"_ExtractCLPath",
"(",
"output_of_where",
")",
":",
"# Take the first line, as that's the first found in the PATH.",
"for",
"line",
"in",
"output_of_where",
".",
"strip",
"(",
")",
".",
"splitlines",
"(",
")",
":",
"if",
"line",
".",
"startswith",
"(",
"'LOC:... | [
992,
0
] | [
998,
39
] | python | en | ['en', 'en', 'en'] | True |
GenerateEnvironmentFiles | (toplevel_build_dir, generator_flags,
system_includes, open_out) | It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers within the same build (to support
msvs_target_platform hackery). Different architectures require a different
compiler binary,... | It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers within the same build (to support
msvs_target_platform hackery). Different architectures require a different
compiler binary,... | def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags,
system_includes, open_out):
"""It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers w... | [
"def",
"GenerateEnvironmentFiles",
"(",
"toplevel_build_dir",
",",
"generator_flags",
",",
"system_includes",
",",
"open_out",
")",
":",
"archs",
"=",
"(",
"'x86'",
",",
"'x64'",
")",
"if",
"generator_flags",
".",
"get",
"(",
"'ninja_use_custom_environment_files'",
... | [
1000,
0
] | [
1051,
17
] | python | en | ['en', 'en', 'en'] | True |
VerifyMissingSources | (sources, build_dir, generator_flags, gyp_to_ninja) | Emulate behavior of msvs_error_on_missing_sources present in the msvs
generator: Check that all regular source files, i.e. not created at run time,
exist on disk. Missing files cause needless recompilation when building via
VS, and we want this check to match for people/bots that build using ninja,
so they're n... | Emulate behavior of msvs_error_on_missing_sources present in the msvs
generator: Check that all regular source files, i.e. not created at run time,
exist on disk. Missing files cause needless recompilation when building via
VS, and we want this check to match for people/bots that build using ninja,
so they're n... | def VerifyMissingSources(sources, build_dir, generator_flags, gyp_to_ninja):
"""Emulate behavior of msvs_error_on_missing_sources present in the msvs
generator: Check that all regular source files, i.e. not created at run time,
exist on disk. Missing files cause needless recompilation when building via
VS, and ... | [
"def",
"VerifyMissingSources",
"(",
"sources",
",",
"build_dir",
",",
"generator_flags",
",",
"gyp_to_ninja",
")",
":",
"if",
"int",
"(",
"generator_flags",
".",
"get",
"(",
"'msvs_error_on_missing_sources'",
",",
"0",
")",
")",
":",
"no_specials",
"=",
"filter"... | [
1053,
0
] | [
1067,
73
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetExtension | (self) | Returns the extension for the target, with no leading dot.
Uses 'product_extension' if specified, otherwise uses MSVS defaults based on
the target type.
| Returns the extension for the target, with no leading dot. | def GetExtension(self):
"""Returns the extension for the target, with no leading dot.
Uses 'product_extension' if specified, otherwise uses MSVS defaults based on
the target type.
"""
ext = self.spec.get('product_extension', None)
if ext:
return ext
return gyp.MSVSUtil.TARGET_TYPE_EXT... | [
"def",
"GetExtension",
"(",
"self",
")",
":",
"ext",
"=",
"self",
".",
"spec",
".",
"get",
"(",
"'product_extension'",
",",
"None",
")",
"if",
"ext",
":",
"return",
"ext",
"return",
"gyp",
".",
"MSVSUtil",
".",
"TARGET_TYPE_EXT",
".",
"get",
"(",
"self... | [
225,
2
] | [
234,
66
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetVSMacroEnv | (self, base_to_build=None, config=None) | Get a dict of variables mapping internal VS macro names to their gyp
equivalents. | Get a dict of variables mapping internal VS macro names to their gyp
equivalents. | def GetVSMacroEnv(self, base_to_build=None, config=None):
"""Get a dict of variables mapping internal VS macro names to their gyp
equivalents."""
target_platform = 'Win32' if self.GetArch(config) == 'x86' else 'x64'
target_name = self.spec.get('product_prefix', '') + \
self.spec.get('product_nam... | [
"def",
"GetVSMacroEnv",
"(",
"self",
",",
"base_to_build",
"=",
"None",
",",
"config",
"=",
"None",
")",
":",
"target_platform",
"=",
"'Win32'",
"if",
"self",
".",
"GetArch",
"(",
"config",
")",
"==",
"'x86'",
"else",
"'x64'",
"target_name",
"=",
"self",
... | [
236,
2
] | [
261,
23
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.ConvertVSMacros | (self, s, base_to_build=None, config=None) | Convert from VS macro names to something equivalent. | Convert from VS macro names to something equivalent. | def ConvertVSMacros(self, s, base_to_build=None, config=None):
"""Convert from VS macro names to something equivalent."""
env = self.GetVSMacroEnv(base_to_build, config=config)
return ExpandMacros(s, env) | [
"def",
"ConvertVSMacros",
"(",
"self",
",",
"s",
",",
"base_to_build",
"=",
"None",
",",
"config",
"=",
"None",
")",
":",
"env",
"=",
"self",
".",
"GetVSMacroEnv",
"(",
"base_to_build",
",",
"config",
"=",
"config",
")",
"return",
"ExpandMacros",
"(",
"s... | [
263,
2
] | [
266,
31
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.AdjustLibraries | (self, libraries) | Strip -l from library if it's specified with that. | Strip -l from library if it's specified with that. | def AdjustLibraries(self, libraries):
"""Strip -l from library if it's specified with that."""
libs = [lib[2:] if lib.startswith('-l') else lib for lib in libraries]
return [lib + '.lib' if not lib.endswith('.lib') else lib for lib in libs] | [
"def",
"AdjustLibraries",
"(",
"self",
",",
"libraries",
")",
":",
"libs",
"=",
"[",
"lib",
"[",
"2",
":",
"]",
"if",
"lib",
".",
"startswith",
"(",
"'-l'",
")",
"else",
"lib",
"for",
"lib",
"in",
"libraries",
"]",
"return",
"[",
"lib",
"+",
"'.lib... | [
268,
2
] | [
271,
78
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings._GetAndMunge | (self, field, path, default, prefix, append, map) | Retrieve a value from |field| at |path| or return |default|. If
|append| is specified, and the item is found, it will be appended to that
object instead of returned. If |map| is specified, results will be
remapped through |map| before being returned or appended. | Retrieve a value from |field| at |path| or return |default|. If
|append| is specified, and the item is found, it will be appended to that
object instead of returned. If |map| is specified, results will be
remapped through |map| before being returned or appended. | def _GetAndMunge(self, field, path, default, prefix, append, map):
"""Retrieve a value from |field| at |path| or return |default|. If
|append| is specified, and the item is found, it will be appended to that
object instead of returned. If |map| is specified, results will be
remapped through |map| before... | [
"def",
"_GetAndMunge",
"(",
"self",
",",
"field",
",",
"path",
",",
"default",
",",
"prefix",
",",
"append",
",",
"map",
")",
":",
"result",
"=",
"_GenericRetrieve",
"(",
"field",
",",
"default",
",",
"path",
")",
"result",
"=",
"_DoRemapping",
"(",
"r... | [
273,
2
] | [
281,
42
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetArch | (self, config) | Get architecture based on msvs_configuration_platform and
msvs_target_platform. Returns either 'x86' or 'x64'. | Get architecture based on msvs_configuration_platform and
msvs_target_platform. Returns either 'x86' or 'x64'. | def GetArch(self, config):
"""Get architecture based on msvs_configuration_platform and
msvs_target_platform. Returns either 'x86' or 'x64'."""
configuration_platform = self.msvs_configuration_platform.get(config, '')
platform = self.msvs_target_platform.get(config, '')
if not platform: # If no spec... | [
"def",
"GetArch",
"(",
"self",
",",
"config",
")",
":",
"configuration_platform",
"=",
"self",
".",
"msvs_configuration_platform",
".",
"get",
"(",
"config",
",",
"''",
")",
"platform",
"=",
"self",
".",
"msvs_target_platform",
".",
"get",
"(",
"config",
","... | [
293,
2
] | [
301,
62
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings._TargetConfig | (self, config) | Returns the target-specific configuration. | Returns the target-specific configuration. | def _TargetConfig(self, config):
"""Returns the target-specific configuration."""
# There's two levels of architecture/platform specification in VS. The
# first level is globally for the configuration (this is what we consider
# "the" config at the gyp level, which will be something like 'Debug' or
... | [
"def",
"_TargetConfig",
"(",
"self",
",",
"config",
")",
":",
"# There's two levels of architecture/platform specification in VS. The",
"# first level is globally for the configuration (this is what we consider",
"# \"the\" config at the gyp level, which will be something like 'Debug' or",
"# ... | [
303,
2
] | [
316,
17
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings._Setting | (self, path, config,
default=None, prefix='', append=None, map=None) | _GetAndMunge for msvs_settings. | _GetAndMunge for msvs_settings. | def _Setting(self, path, config,
default=None, prefix='', append=None, map=None):
"""_GetAndMunge for msvs_settings."""
return self._GetAndMunge(
self.msvs_settings[config], path, default, prefix, append, map) | [
"def",
"_Setting",
"(",
"self",
",",
"path",
",",
"config",
",",
"default",
"=",
"None",
",",
"prefix",
"=",
"''",
",",
"append",
"=",
"None",
",",
"map",
"=",
"None",
")",
":",
"return",
"self",
".",
"_GetAndMunge",
"(",
"self",
".",
"msvs_settings"... | [
318,
2
] | [
322,
71
] | python | de | ['de', 'no', 'en'] | False |
MsvsSettings._ConfigAttrib | (self, path, config,
default=None, prefix='', append=None, map=None) | _GetAndMunge for msvs_configuration_attributes. | _GetAndMunge for msvs_configuration_attributes. | def _ConfigAttrib(self, path, config,
default=None, prefix='', append=None, map=None):
"""_GetAndMunge for msvs_configuration_attributes."""
return self._GetAndMunge(
self.msvs_configuration_attributes[config],
path, default, prefix, append, map) | [
"def",
"_ConfigAttrib",
"(",
"self",
",",
"path",
",",
"config",
",",
"default",
"=",
"None",
",",
"prefix",
"=",
"''",
",",
"append",
"=",
"None",
",",
"map",
"=",
"None",
")",
":",
"return",
"self",
".",
"_GetAndMunge",
"(",
"self",
".",
"msvs_conf... | [
324,
2
] | [
329,
43
] | python | da | ['de', 'da', 'en'] | False |
MsvsSettings.AdjustIncludeDirs | (self, include_dirs, config) | Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar. | Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar. | def AdjustIncludeDirs(self, include_dirs, config):
"""Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar."""
config = self._TargetConfig(config)
includes = include_dirs + self.msvs_system_include_dirs[config]
includes.extend(self._Set... | [
"def",
"AdjustIncludeDirs",
"(",
"self",
",",
"include_dirs",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"includes",
"=",
"include_dirs",
"+",
"self",
".",
"msvs_system_include_dirs",
"[",
"config",
"]",
"includes... | [
331,
2
] | [
338,
69
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.AdjustMidlIncludeDirs | (self, midl_include_dirs, config) | Updates midl_include_dirs to expand VS specific paths, and adds the
system include dirs used for platform SDK and similar. | Updates midl_include_dirs to expand VS specific paths, and adds the
system include dirs used for platform SDK and similar. | def AdjustMidlIncludeDirs(self, midl_include_dirs, config):
"""Updates midl_include_dirs to expand VS specific paths, and adds the
system include dirs used for platform SDK and similar."""
config = self._TargetConfig(config)
includes = midl_include_dirs + self.msvs_system_include_dirs[config]
includ... | [
"def",
"AdjustMidlIncludeDirs",
"(",
"self",
",",
"midl_include_dirs",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"includes",
"=",
"midl_include_dirs",
"+",
"self",
".",
"msvs_system_include_dirs",
"[",
"config",
"]... | [
340,
2
] | [
347,
69
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetComputedDefines | (self, config) | Returns the set of defines that are injected to the defines list based
on other VS settings. | Returns the set of defines that are injected to the defines list based
on other VS settings. | def GetComputedDefines(self, config):
"""Returns the set of defines that are injected to the defines list based
on other VS settings."""
config = self._TargetConfig(config)
defines = []
if self._ConfigAttrib(['CharacterSet'], config) == '1':
defines.extend(('_UNICODE', 'UNICODE'))
if self.... | [
"def",
"GetComputedDefines",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"defines",
"=",
"[",
"]",
"if",
"self",
".",
"_ConfigAttrib",
"(",
"[",
"'CharacterSet'",
"]",
",",
"config",
")",
"==",
... | [
349,
2
] | [
360,
18
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetCompilerPdbName | (self, config, expand_special) | Get the pdb file name that should be used for compiler invocations, or
None if there's no explicit name specified. | Get the pdb file name that should be used for compiler invocations, or
None if there's no explicit name specified. | def GetCompilerPdbName(self, config, expand_special):
"""Get the pdb file name that should be used for compiler invocations, or
None if there's no explicit name specified."""
config = self._TargetConfig(config)
pdbname = self._Setting(
('VCCLCompilerTool', 'ProgramDataBaseFileName'), config)
... | [
"def",
"GetCompilerPdbName",
"(",
"self",
",",
"config",
",",
"expand_special",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"pdbname",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'VCCLCompilerTool'",
",",
"'ProgramDataBaseFileName'",
... | [
362,
2
] | [
370,
18
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetMapFileName | (self, config, expand_special) | Gets the explicitly overriden map file name for a target or returns None
if it's not set. | Gets the explicitly overriden map file name for a target or returns None
if it's not set. | def GetMapFileName(self, config, expand_special):
"""Gets the explicitly overriden map file name for a target or returns None
if it's not set."""
config = self._TargetConfig(config)
map_file = self._Setting(('VCLinkerTool', 'MapFileName'), config)
if map_file:
map_file = expand_special(self.Co... | [
"def",
"GetMapFileName",
"(",
"self",
",",
"config",
",",
"expand_special",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"map_file",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'VCLinkerTool'",
",",
"'MapFileName'",
")",
",",
"co... | [
372,
2
] | [
379,
19
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetOutputName | (self, config, expand_special) | Gets the explicitly overridden output name for a target or returns None
if it's not overridden. | Gets the explicitly overridden output name for a target or returns None
if it's not overridden. | def GetOutputName(self, config, expand_special):
"""Gets the explicitly overridden output name for a target or returns None
if it's not overridden."""
config = self._TargetConfig(config)
type = self.spec['type']
root = 'VCLibrarianTool' if type == 'static_library' else 'VCLinkerTool'
# TODO(scot... | [
"def",
"GetOutputName",
"(",
"self",
",",
"config",
",",
"expand_special",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"type",
"=",
"self",
".",
"spec",
"[",
"'type'",
"]",
"root",
"=",
"'VCLibrarianTool'",
"if",
"type",
"=... | [
381,
2
] | [
392,
22
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetPDBName | (self, config, expand_special, default) | Gets the explicitly overridden pdb name for a target or returns
default if it's not overridden, or if no pdb will be generated. | Gets the explicitly overridden pdb name for a target or returns
default if it's not overridden, or if no pdb will be generated. | def GetPDBName(self, config, expand_special, default):
"""Gets the explicitly overridden pdb name for a target or returns
default if it's not overridden, or if no pdb will be generated."""
config = self._TargetConfig(config)
output_file = self._Setting(('VCLinkerTool', 'ProgramDatabaseFile'), config)
... | [
"def",
"GetPDBName",
"(",
"self",
",",
"config",
",",
"expand_special",
",",
"default",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"output_file",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'VCLinkerTool'",
",",
"'ProgramDatabase... | [
394,
2
] | [
407,
17
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetNoImportLibrary | (self, config) | If NoImportLibrary: true, ninja will not expect the output to include
an import library. | If NoImportLibrary: true, ninja will not expect the output to include
an import library. | def GetNoImportLibrary(self, config):
"""If NoImportLibrary: true, ninja will not expect the output to include
an import library."""
config = self._TargetConfig(config)
noimplib = self._Setting(('NoImportLibrary',), config)
return noimplib == 'true' | [
"def",
"GetNoImportLibrary",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"noimplib",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'NoImportLibrary'",
",",
")",
",",
"config",
")",
"return",
"noimplib",... | [
409,
2
] | [
414,
29
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetAsmflags | (self, config) | Returns the flags that need to be added to ml invocations. | Returns the flags that need to be added to ml invocations. | def GetAsmflags(self, config):
"""Returns the flags that need to be added to ml invocations."""
config = self._TargetConfig(config)
asmflags = []
safeseh = self._Setting(('MASM', 'UseSafeExceptionHandlers'), config)
if safeseh == 'true':
asmflags.append('/safeseh')
return asmflags | [
"def",
"GetAsmflags",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"asmflags",
"=",
"[",
"]",
"safeseh",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'MASM'",
",",
"'UseSafeExceptionHandlers'",
")",
"... | [
416,
2
] | [
423,
19
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetCflags | (self, config) | Returns the flags that need to be added to .c and .cc compilations. | Returns the flags that need to be added to .c and .cc compilations. | def GetCflags(self, config):
"""Returns the flags that need to be added to .c and .cc compilations."""
config = self._TargetConfig(config)
cflags = []
cflags.extend(['/wd' + w for w in self.msvs_disabled_warnings[config]])
cl = self._GetWrapper(self, self.msvs_settings[config],
... | [
"def",
"GetCflags",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"cflags",
"=",
"[",
"]",
"cflags",
".",
"extend",
"(",
"[",
"'/wd'",
"+",
"w",
"for",
"w",
"in",
"self",
".",
"msvs_disabled_wa... | [
425,
2
] | [
475,
17
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings._GetPchFlags | (self, config, extension) | Get the flags to be added to the cflags for precompiled header support.
| Get the flags to be added to the cflags for precompiled header support.
| def _GetPchFlags(self, config, extension):
"""Get the flags to be added to the cflags for precompiled header support.
"""
config = self._TargetConfig(config)
# The PCH is only built once by a particular source file. Usage of PCH must
# only be for the same language (i.e. C vs. C++), so only include ... | [
"def",
"_GetPchFlags",
"(",
"self",
",",
"config",
",",
"extension",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"# The PCH is only built once by a particular source file. Usage of PCH must",
"# only be for the same language (i.e. C vs. C++), so o... | [
477,
2
] | [
489,
14
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetCflagsC | (self, config) | Returns the flags that need to be added to .c compilations. | Returns the flags that need to be added to .c compilations. | def GetCflagsC(self, config):
"""Returns the flags that need to be added to .c compilations."""
config = self._TargetConfig(config)
return self._GetPchFlags(config, '.c') | [
"def",
"GetCflagsC",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"return",
"self",
".",
"_GetPchFlags",
"(",
"config",
",",
"'.c'",
")"
] | [
491,
2
] | [
494,
42
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetCflagsCC | (self, config) | Returns the flags that need to be added to .cc compilations. | Returns the flags that need to be added to .cc compilations. | def GetCflagsCC(self, config):
"""Returns the flags that need to be added to .cc compilations."""
config = self._TargetConfig(config)
return ['/TP'] + self._GetPchFlags(config, '.cc') | [
"def",
"GetCflagsCC",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"return",
"[",
"'/TP'",
"]",
"+",
"self",
".",
"_GetPchFlags",
"(",
"config",
",",
"'.cc'",
")"
] | [
496,
2
] | [
499,
53
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings._GetAdditionalLibraryDirectories | (self, root, config, gyp_to_build_path) | Get and normalize the list of paths in AdditionalLibraryDirectories
setting. | Get and normalize the list of paths in AdditionalLibraryDirectories
setting. | def _GetAdditionalLibraryDirectories(self, root, config, gyp_to_build_path):
"""Get and normalize the list of paths in AdditionalLibraryDirectories
setting."""
config = self._TargetConfig(config)
libpaths = self._Setting((root, 'AdditionalLibraryDirectories'),
config, defaul... | [
"def",
"_GetAdditionalLibraryDirectories",
"(",
"self",
",",
"root",
",",
"config",
",",
"gyp_to_build_path",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"libpaths",
"=",
"self",
".",
"_Setting",
"(",
"(",
"root",
",",
"'Additi... | [
501,
2
] | [
510,
53
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetLibFlags | (self, config, gyp_to_build_path) | Returns the flags that need to be added to lib commands. | Returns the flags that need to be added to lib commands. | def GetLibFlags(self, config, gyp_to_build_path):
"""Returns the flags that need to be added to lib commands."""
config = self._TargetConfig(config)
libflags = []
lib = self._GetWrapper(self, self.msvs_settings[config],
'VCLibrarianTool', append=libflags)
libflags.extend(se... | [
"def",
"GetLibFlags",
"(",
"self",
",",
"config",
",",
"gyp_to_build_path",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"libflags",
"=",
"[",
"]",
"lib",
"=",
"self",
".",
"_GetWrapper",
"(",
"self",
",",
"self",
".",
"ms... | [
512,
2
] | [
524,
19
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetDefFile | (self, gyp_to_build_path) | Returns the .def file from sources, if any. Otherwise returns None. | Returns the .def file from sources, if any. Otherwise returns None. | def GetDefFile(self, gyp_to_build_path):
"""Returns the .def file from sources, if any. Otherwise returns None."""
spec = self.spec
if spec['type'] in ('shared_library', 'loadable_module', 'executable'):
def_files = [s for s in spec.get('sources', []) if s.endswith('.def')]
if len(def_files) ==... | [
"def",
"GetDefFile",
"(",
"self",
",",
"gyp_to_build_path",
")",
":",
"spec",
"=",
"self",
".",
"spec",
"if",
"spec",
"[",
"'type'",
"]",
"in",
"(",
"'shared_library'",
",",
"'loadable_module'",
",",
"'executable'",
")",
":",
"def_files",
"=",
"[",
"s",
... | [
526,
2
] | [
535,
15
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings._GetDefFileAsLdflags | (self, ldflags, gyp_to_build_path) | .def files get implicitly converted to a ModuleDefinitionFile for the
linker in the VS generator. Emulate that behaviour here. | .def files get implicitly converted to a ModuleDefinitionFile for the
linker in the VS generator. Emulate that behaviour here. | def _GetDefFileAsLdflags(self, ldflags, gyp_to_build_path):
""".def files get implicitly converted to a ModuleDefinitionFile for the
linker in the VS generator. Emulate that behaviour here."""
def_file = self.GetDefFile(gyp_to_build_path)
if def_file:
ldflags.append('/DEF:"%s"' % def_file) | [
"def",
"_GetDefFileAsLdflags",
"(",
"self",
",",
"ldflags",
",",
"gyp_to_build_path",
")",
":",
"def_file",
"=",
"self",
".",
"GetDefFile",
"(",
"gyp_to_build_path",
")",
"if",
"def_file",
":",
"ldflags",
".",
"append",
"(",
"'/DEF:\"%s\"'",
"%",
"def_file",
"... | [
537,
2
] | [
542,
44
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetPGDName | (self, config, expand_special) | Gets the explicitly overridden pgd name for a target or returns None
if it's not overridden. | Gets the explicitly overridden pgd name for a target or returns None
if it's not overridden. | def GetPGDName(self, config, expand_special):
"""Gets the explicitly overridden pgd name for a target or returns None
if it's not overridden."""
config = self._TargetConfig(config)
output_file = self._Setting(
('VCLinkerTool', 'ProfileGuidedDatabase'), config)
if output_file:
output_fi... | [
"def",
"GetPGDName",
"(",
"self",
",",
"config",
",",
"expand_special",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"output_file",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'VCLinkerTool'",
",",
"'ProfileGuidedDatabase'",
")",
"... | [
544,
2
] | [
553,
22
] | python | en | ['en', 'en', 'en'] | True |
MsvsSettings.GetLdflags | (self, config, gyp_to_build_path, expand_special,
manifest_base_name, output_name, is_executable, build_dir) | Returns the flags that need to be added to link commands, and the
manifest files. | Returns the flags that need to be added to link commands, and the
manifest files. | def GetLdflags(self, config, gyp_to_build_path, expand_special,
manifest_base_name, output_name, is_executable, build_dir):
"""Returns the flags that need to be added to link commands, and the
manifest files."""
config = self._TargetConfig(config)
ldflags = []
ld = self._GetWrapper(... | [
"def",
"GetLdflags",
"(",
"self",
",",
"config",
",",
"gyp_to_build_path",
",",
"expand_special",
",",
"manifest_base_name",
",",
"output_name",
",",
"is_executable",
",",
"build_dir",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
... | [
555,
2
] | [
656,
57
] | 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.