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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
by_column | (self) | Check order by using a single column.
| Check order by using a single column.
| def by_column(self):
"""Check order by using a single column.
"""
expected = convert_output("""
depname | empno | salary | rank
-----------+-------+--------+------
develop | 7 | 4200 | 1
develop | 8 | 6000 | 1
develop | 9 | 4500 | 1
develop | 10 | ... | [
"def",
"by_column",
"(",
"self",
")",
":",
"expected",
"=",
"convert_output",
"(",
"\"\"\"\n depname | empno | salary | rank\n -----------+-------+--------+------\n develop | 7 | 4200 | 1\n develop | 8 | 6000 | 1\n develop | 9 | 4500 | 1\n develop ... | [
123,
0
] | [
144,
5
] | python | en | ['en', 'en', 'en'] | True |
by_expr | (self) | Check order by with expression.
| Check order by with expression.
| def by_expr(self):
"""Check order by with expression.
"""
expected = convert_output("""
avg
------------------------
0
0
0
1
1
1
1
2
3
3
""")
execute_query(
"SELECT avg(four) OVER (PARTITION BY four ORDER BY thousand / 100)... | [
"def",
"by_expr",
"(",
"self",
")",
":",
"expected",
"=",
"convert_output",
"(",
"\"\"\"\n avg\n ------------------------\n 0\n 0\n 0\n 1\n 1\n 1\n 1\n 2\n 3\n 3\n \"\"\"",
")",
"execute_query",
"(",
"\"SELECT avg(four) OVER (PAR... | [
147,
0
] | [
168,
5
] | python | en | ['en', 'en', 'en'] | True |
by_a_non_integer_constant | (self) | Check if it is allowed to use a window with ordering by a non integer constant.
| Check if it is allowed to use a window with ordering by a non integer constant.
| def by_a_non_integer_constant(self):
"""Check if it is allowed to use a window with ordering by a non integer constant.
"""
expected = convert_output("""
rank
------
1
""")
execute_query(
"SELECT rank() OVER (ORDER BY length('abc')) AS rank",
expected=expected
) | [
"def",
"by_a_non_integer_constant",
"(",
"self",
")",
":",
"expected",
"=",
"convert_output",
"(",
"\"\"\"\n rank\n ------\n 1\n \"\"\"",
")",
"execute_query",
"(",
"\"SELECT rank() OVER (ORDER BY length('abc')) AS rank\"",
",",
"expected",
"=",
"expected",
")"... | [
194,
0
] | [
206,
5
] | python | en | ['en', 'en', 'en'] | True |
feature | (self) | Check defining order clause.
| Check defining order clause.
| def feature(self):
"""Check defining order clause.
"""
for scenario in loads(current_module(), Scenario):
Scenario(run=scenario, flags=TE) | [
"def",
"feature",
"(",
"self",
")",
":",
"for",
"scenario",
"in",
"loads",
"(",
"current_module",
"(",
")",
",",
"Scenario",
")",
":",
"Scenario",
"(",
"run",
"=",
"scenario",
",",
"flags",
"=",
"TE",
")"
] | [
213,
0
] | [
217,
40
] | python | en | ['de', 'en', 'en'] | True |
main | () | Run administrative tasks. | Run administrative tasks. | def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ubc_course_explorer.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it... | [
"def",
"main",
"(",
")",
":",
"os",
".",
"environ",
".",
"setdefault",
"(",
"'DJANGO_SETTINGS_MODULE'",
",",
"'ubc_course_explorer.settings'",
")",
"try",
":",
"from",
"django",
".",
"core",
".",
"management",
"import",
"execute_from_command_line",
"except",
"Impo... | [
6,
0
] | [
17,
39
] | python | en | ['lv', 'gd', 'en'] | False |
configure_file | (template_file_path, output_file_path, substitutions) |
Read a template file ``template_file_path``, perform substitutions
found in the ``substitutions`` dictionary and write the result to
the output file ``output_file_path``.
The template file should contain zero or more template strings of the
form ``@NAME@``.
The substit... |
Read a template file ``template_file_path``, perform substitutions
found in the ``substitutions`` dictionary and write the result to
the output file ``output_file_path``. | def configure_file(template_file_path, output_file_path, substitutions):
"""
Read a template file ``template_file_path``, perform substitutions
found in the ``substitutions`` dictionary and write the result to
the output file ``output_file_path``.
The template file should contain ze... | [
"def",
"configure_file",
"(",
"template_file_path",
",",
"output_file_path",
",",
"substitutions",
")",
":",
"assert",
"isinstance",
"(",
"template_file_path",
",",
"str",
")",
"assert",
"isinstance",
"(",
"output_file_path",
",",
"str",
")",
"assert",
"isinstance",... | [
141,
0
] | [
174,
32
] | python | en | ['en', 'error', 'th'] | False |
sync_server | (request) |
Starts the sync HTTP server for a given set of environment variables on a separate thread
Yields:
* the server (useful to interrogate for the server address)
* environment variables (useful to interrogate for correct responses)
|
Starts the sync HTTP server for a given set of environment variables on a separate thread | def sync_server(request):
"""
Starts the sync HTTP server for a given set of environment variables on a separate thread
Yields:
* the server (useful to interrogate for the server address)
* environment variables (useful to interrogate for correct responses)
"""
environ = request.param
w... | [
"def",
"sync_server",
"(",
"request",
")",
":",
"environ",
"=",
"request",
".",
"param",
"with",
"mock",
".",
"patch",
".",
"dict",
"(",
"os",
".",
"environ",
",",
"environ",
")",
":",
"# Create a server at an available port and serve it on a thread as a daemon",
... | [
109,
0
] | [
128,
29
] | python | en | ['en', 'error', 'th'] | False |
sync_server_from_arguments | (request) |
Starts the sync HTTP server for a given set of parameters passed as arguments, with server on a separate thread
Yields:
* the server (useful to interrogate for the server address)
* environment variables (useful to interrogate for correct responses)
|
Starts the sync HTTP server for a given set of parameters passed as arguments, with server on a separate thread | def sync_server_from_arguments(request):
"""
Starts the sync HTTP server for a given set of parameters passed as arguments, with server on a separate thread
Yields:
* the server (useful to interrogate for the server address)
* environment variables (useful to interrogate for correct responses)
... | [
"def",
"sync_server_from_arguments",
"(",
"request",
")",
":",
"environ",
"=",
"{",
"k",
".",
"lower",
"(",
")",
":",
"v",
"for",
"k",
",",
"v",
"in",
"request",
".",
"param",
".",
"items",
"(",
")",
"}",
"settings",
"=",
"environ",
"server",
"=",
... | [
134,
0
] | [
149,
25
] | python | en | ['en', 'error', 'th'] | False |
test_sync_server_with_pipeline_enabled | (sync_server, data, expected_status,
expected_visualization_server_image, expected_frontend_server_image) |
Nearly end-to-end test of how Controller serves .sync as a POST
Tests case where metadata.labels.pipelines.kubeflow.org/enabled exists, and thus
we should produce children
Only does spot checks on children to see if key properties are correct
|
Nearly end-to-end test of how Controller serves .sync as a POST | def test_sync_server_with_pipeline_enabled(sync_server, data, expected_status,
expected_visualization_server_image, expected_frontend_server_image):
"""
Nearly end-to-end test of how Controller serves .sync as a POST
Tests case where metadata.labels.pipelines.kube... | [
"def",
"test_sync_server_with_pipeline_enabled",
"(",
"sync_server",
",",
"data",
",",
"expected_status",
",",
"expected_visualization_server_image",
",",
"expected_frontend_server_image",
")",
":",
"server",
",",
"environ",
"=",
"sync_server",
"# server.server_address = (url, ... | [
188,
0
] | [
215,
57
] | python | en | ['en', 'error', 'th'] | False |
test_sync_server_with_direct_passing_of_settings | (
sync_server_from_arguments, data, expected_status, expected_visualization_server_image,
expected_frontend_server_image) |
Nearly end-to-end test of how Controller serves .sync as a POST, taking variables as arguments
Only does spot checks on children to see if key properties are correct
|
Nearly end-to-end test of how Controller serves .sync as a POST, taking variables as arguments | def test_sync_server_with_direct_passing_of_settings(
sync_server_from_arguments, data, expected_status, expected_visualization_server_image,
expected_frontend_server_image):
"""
Nearly end-to-end test of how Controller serves .sync as a POST, taking variables as arguments
Only does spot ch... | [
"def",
"test_sync_server_with_direct_passing_of_settings",
"(",
"sync_server_from_arguments",
",",
"data",
",",
"expected_status",
",",
"expected_visualization_server_image",
",",
"expected_frontend_server_image",
")",
":",
"server",
",",
"environ",
"=",
"sync_server_from_argumen... | [
233,
0
] | [
258,
57
] | python | en | ['en', 'error', 'th'] | False |
test_sync_server_without_pipeline_enabled | (sync_server, data, expected_status,
expected_children) |
Nearly end-to-end test of how Controller serves .sync as a POST
Tests case where metadata.labels.pipelines.kubeflow.org/enabled does not
exist and thus server returns an empty reply
|
Nearly end-to-end test of how Controller serves .sync as a POST | def test_sync_server_without_pipeline_enabled(sync_server, data, expected_status,
expected_children):
"""
Nearly end-to-end test of how Controller serves .sync as a POST
Tests case where metadata.labels.pipelines.kubeflow.org/enabled does not
exist and thu... | [
"def",
"test_sync_server_without_pipeline_enabled",
"(",
"sync_server",
",",
"data",
",",
"expected_status",
",",
"expected_children",
")",
":",
"server",
",",
"environ",
"=",
"sync_server",
"# server.server_address = (url, port_as_integer)",
"url",
"=",
"f\"http://{server.se... | [
268,
0
] | [
285,
51
] | python | en | ['en', 'error', 'th'] | False |
load_data | (messages_filepath, categories_filepath) |
Load data from csv files at given filepath
:param messages_filepath: Filepath for messages csv file
:param categories_filepath: Filepath for categories csv file
:return: Dataframe merging both the csv files
|
Load data from csv files at given filepath
:param messages_filepath: Filepath for messages csv file
:param categories_filepath: Filepath for categories csv file
:return: Dataframe merging both the csv files
| def load_data(messages_filepath, categories_filepath):
"""
Load data from csv files at given filepath
:param messages_filepath: Filepath for messages csv file
:param categories_filepath: Filepath for categories csv file
:return: Dataframe merging both the csv files
"""
df_categories = pd.rea... | [
"def",
"load_data",
"(",
"messages_filepath",
",",
"categories_filepath",
")",
":",
"df_categories",
"=",
"pd",
".",
"read_csv",
"(",
"categories_filepath",
")",
"df_messages",
"=",
"pd",
".",
"read_csv",
"(",
"messages_filepath",
")",
"df",
"=",
"pd",
".",
"m... | [
4,
0
] | [
14,
13
] | python | en | ['en', 'error', 'th'] | False |
clean_data | (df) |
Cleans Dataframe by converting Response categories into separate columns with binary values
:param df: Dataframe containing responses and categories
:return: Cleaned Dataframe
|
Cleans Dataframe by converting Response categories into separate columns with binary values
:param df: Dataframe containing responses and categories
:return: Cleaned Dataframe
| def clean_data(df):
"""
Cleans Dataframe by converting Response categories into separate columns with binary values
:param df: Dataframe containing responses and categories
:return: Cleaned Dataframe
"""
categories = df.categories.str.split(';', expand=True)
row = categories.iloc[0, :]
... | [
"def",
"clean_data",
"(",
"df",
")",
":",
"categories",
"=",
"df",
".",
"categories",
".",
"str",
".",
"split",
"(",
"';'",
",",
"expand",
"=",
"True",
")",
"row",
"=",
"categories",
".",
"iloc",
"[",
"0",
",",
":",
"]",
"category_columns",
"=",
"r... | [
17,
0
] | [
37,
13
] | python | en | ['en', 'error', 'th'] | False |
save_data | (df, database_filename) |
Save dataframe to sqlite database at specified path
:param df: Dataframe to be saved to sqlite database
:param database_filename: Path and name of database to save dataframe to
:return: None
|
Save dataframe to sqlite database at specified path
:param df: Dataframe to be saved to sqlite database
:param database_filename: Path and name of database to save dataframe to
:return: None
| def save_data(df, database_filename):
"""
Save dataframe to sqlite database at specified path
:param df: Dataframe to be saved to sqlite database
:param database_filename: Path and name of database to save dataframe to
:return: None
"""
engine = create_engine('sqlite:///'+database_filename)
... | [
"def",
"save_data",
"(",
"df",
",",
"database_filename",
")",
":",
"engine",
"=",
"create_engine",
"(",
"'sqlite:///'",
"+",
"database_filename",
")",
"df",
".",
"to_sql",
"(",
"'disaster_response_etl'",
",",
"engine",
",",
"index",
"=",
"False",
",",
"if_exis... | [
40,
0
] | [
48,
80
] | python | en | ['en', 'error', 'th'] | False |
MobileNet | (input_tensor=None, input_shape=(224,224,3), alpha=1, shallow=False, classes=1000) | Instantiates the MobileNet.Network has two hyper-parameters
which are the width of network (controlled by alpha)
and input size.
# Arguments
input_tensor: optional Keras tensor (i.e. output of `layers.Input()`)
to use as image input for the model.
... | Instantiates the MobileNet.Network has two hyper-parameters
which are the width of network (controlled by alpha)
and input size.
# Arguments
input_tensor: optional Keras tensor (i.e. output of `layers.Input()`)
to use as image input for the model.
... | def MobileNet(input_tensor=None, input_shape=(224,224,3), alpha=1, shallow=False, classes=1000):
"""Instantiates the MobileNet.Network has two hyper-parameters
which are the width of network (controlled by alpha)
and input size.
# Arguments
input_tensor: optional Keras t... | [
"def",
"MobileNet",
"(",
"input_tensor",
"=",
"None",
",",
"input_shape",
"=",
"(",
"224",
",",
"224",
",",
"3",
")",
",",
"alpha",
"=",
"1",
",",
"shallow",
"=",
"False",
",",
"classes",
"=",
"1000",
")",
":",
"input_shape",
"=",
"_obtain_input_shape"... | [
15,
0
] | [
133,
16
] | python | en | ['en', 'en', 'en'] | True |
main | () | Parses arguments and iterates over files.
Raises:
IOError: An I/O error occurred with an input or output file.
InputError: Input JSON could not be parsed.
| Parses arguments and iterates over files. | def main():
"""Parses arguments and iterates over files.
Raises:
IOError: An I/O error occurred with an input or output file.
InputError: Input JSON could not be parsed.
"""
# Set up argument parser.
parser = argparse.ArgumentParser(
description='Removes duplicate key-value pairs from JSON fil... | [
"def",
"main",
"(",
")",
":",
"# Set up argument parser.",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Removes duplicate key-value pairs from JSON files.'",
")",
"parser",
".",
"add_argument",
"(",
"'--suffix'",
",",
"default",
"=",
"'... | [
29,
0
] | [
68,
28
] | python | en | ['en', 'en', 'en'] | True |
test_valid_input | () | Return 200 Success when input is valid. | Return 200 Success when input is valid. | def test_valid_input():
"""Return 200 Success when input is valid."""
response = client.post(
'/predict',
json={
'x1': 3.14,
'x2': -42,
'x3': 'banjo'
}
)
body = response.json()
assert response.status_code == 200
assert body['prediction'... | [
"def",
"test_valid_input",
"(",
")",
":",
"response",
"=",
"client",
".",
"post",
"(",
"'/predict'",
",",
"json",
"=",
"{",
"'x1'",
":",
"3.14",
",",
"'x2'",
":",
"-",
"42",
",",
"'x3'",
":",
"'banjo'",
"}",
")",
"body",
"=",
"response",
".",
"json... | [
7,
0
] | [
20,
42
] | python | en | ['en', 'en', 'en'] | True |
test_invalid_input | () | Return 422 Validation Error when x1 is negative. | Return 422 Validation Error when x1 is negative. | def test_invalid_input():
"""Return 422 Validation Error when x1 is negative."""
response = client.post(
'/predict',
json={
'x1': -3.14,
'x2': -42,
'x3': 'banjo'
}
)
body = response.json()
assert response.status_code == 422
assert 'x1' ... | [
"def",
"test_invalid_input",
"(",
")",
":",
"response",
"=",
"client",
".",
"post",
"(",
"'/predict'",
",",
"json",
"=",
"{",
"'x1'",
":",
"-",
"3.14",
",",
"'x2'",
":",
"-",
"42",
",",
"'x3'",
":",
"'banjo'",
"}",
")",
"body",
"=",
"response",
"."... | [
23,
0
] | [
35,
43
] | python | en | ['en', 'de', 'en'] | True |
privileges_granted_directly | (self, node=None) | Check that a user is able to execute `SYSTEM MERGES` commands if and only if
the privilege has been granted directly.
| Check that a user is able to execute `SYSTEM MERGES` commands if and only if
the privilege has been granted directly.
| def privileges_granted_directly(self, node=None):
"""Check that a user is able to execute `SYSTEM MERGES` commands if and only if
the privilege has been granted directly.
"""
user_name = f"user_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"):
... | [
"def",
"privileges_granted_directly",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"user",
"(",
"node",
",",
"f\"{user_... | [
8,
0
] | [
23,
80
] | python | en | ['en', 'en', 'en'] | True |
privileges_granted_via_role | (self, node=None) | Check that a user is able to execute `SYSTEM MERGES` commands if and only if
the privilege has been granted via role.
| Check that a user is able to execute `SYSTEM MERGES` commands if and only if
the privilege has been granted via role.
| def privileges_granted_via_role(self, node=None):
"""Check that a user is able to execute `SYSTEM MERGES` commands if and only if
the privilege has been granted via role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node = self.context.node
wit... | [
"def",
"privileges_granted_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with"... | [
26,
0
] | [
45,
80
] | python | en | ['en', 'en', 'en'] | True |
check_privilege | (self, privilege, on, grant_target_name, user_name, table_name, node=None) | Run checks for commands that require SYSTEM MERGES privilege.
| Run checks for commands that require SYSTEM MERGES privilege.
| def check_privilege(self, privilege, on, grant_target_name, user_name, table_name, node=None):
"""Run checks for commands that require SYSTEM MERGES privilege.
"""
if node is None:
node = self.context.node
Suite(test=start_merges)(privilege=privilege, on=on, grant_target_name=grant_target_name... | [
"def",
"check_privilege",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"table_name",
",",
"node",
"=",
"None",
")",
":",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"S... | [
57,
0
] | [
65,
136
] | python | en | ['en', 'en', 'en'] | True |
start_merges | (self, privilege, on, grant_target_name, user_name, table_name, node=None) | Check that user is only able to execute `SYSTEM START MERGES` when they have privilege.
| Check that user is only able to execute `SYSTEM START MERGES` when they have privilege.
| def start_merges(self, privilege, on, grant_target_name, user_name, table_name, node=None):
"""Check that user is only able to execute `SYSTEM START MERGES` when they have privilege.
"""
exitcode, message = errors.not_enough_privileges(name=user_name)
if node is None:
node = self.context.node
... | [
"def",
"start_merges",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"table_name",
",",
"node",
"=",
"None",
")",
":",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"name",
"=",
"... | [
68,
0
] | [
110,
55
] | python | en | ['en', 'en', 'en'] | True |
stop_merges | (self, privilege, on, grant_target_name, user_name, table_name, node=None) | Check that user is only able to execute `SYSTEM STOP MERGES` when they have privilege.
| Check that user is only able to execute `SYSTEM STOP MERGES` when they have privilege.
| def stop_merges(self, privilege, on, grant_target_name, user_name, table_name, node=None):
"""Check that user is only able to execute `SYSTEM STOP MERGES` when they have privilege.
"""
exitcode, message = errors.not_enough_privileges(name=user_name)
if node is None:
node = self.context.node
... | [
"def",
"stop_merges",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"table_name",
",",
"node",
"=",
"None",
")",
":",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"name",
"=",
"u... | [
113,
0
] | [
155,
55
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1") | Check the RBAC functionality of SYSTEM MERGES.
| Check the RBAC functionality of SYSTEM MERGES.
| def feature(self, node="clickhouse1"):
"""Check the RBAC functionality of SYSTEM MERGES.
"""
self.context.node = self.context.cluster.node(node)
Suite(run=privileges_granted_directly, setup=instrument_clickhouse_server_log)
Suite(run=privileges_granted_via_role, setup=instrument_clickhouse_server_l... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"Suite",
"(",
"run",
"=",
"privileges_granted_directly",
",",
... | [
164,
0
] | [
170,
82
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1") | Check create user query syntax.
```sql
CREATE USER [IF NOT EXISTS | OR REPLACE] name [ON CLUSTER cluster_name]
[IDENTIFIED [WITH {NO_PASSWORD|PLAINTEXT_PASSWORD|SHA256_PASSWORD|SHA256_HASH|DOUBLE_SHA1_PASSWORD|DOUBLE_SHA1_HASH}] BY {'password'|'hash'}]
[HOST {LOCAL | NAME 'name' | NAME REGEXP 'name_reg... | Check create user query syntax. | def feature(self, node="clickhouse1"):
"""Check create user query syntax.
```sql
CREATE USER [IF NOT EXISTS | OR REPLACE] name [ON CLUSTER cluster_name]
[IDENTIFIED [WITH {NO_PASSWORD|PLAINTEXT_PASSWORD|SHA256_PASSWORD|SHA256_HASH|DOUBLE_SHA1_PASSWORD|DOUBLE_SHA1_HASH}] BY {'password'|'hash'}]
[HOS... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"@",
"contextmanager",
"def",
"cleanup",
"(",
"user",
")",
":",
"try",
":",
"with",
"Giv... | [
11,
0
] | [
270,
108
] | python | en | ['pt', 'gl', 'en'] | False |
xml_configured_user | (self) | ClickHouse SHALL accept Kerberos authentication for valid XML-configured user
| ClickHouse SHALL accept Kerberos authentication for valid XML-configured user
| def xml_configured_user(self):
"""ClickHouse SHALL accept Kerberos authentication for valid XML-configured user
"""
ch_nodes = self.context.ch_nodes
with Given("kinit for client"):
kinit_no_keytab(node=ch_nodes[2])
with And("kinit for server"):
create_server_principal(node=ch_nodes... | [
"def",
"xml_configured_user",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"with",
"Given",
"(",
"\"kinit for client\"",
")",
":",
"kinit_no_keytab",
"(",
"node",
"=",
"ch_nodes",
"[",
"2",
"]",
")",
"with",
"And",
"(",
... | [
13,
0
] | [
28,
51
] | python | en | ['la', 'en', 'en'] | True |
rbac_configured_user | (self) | ClickHouse SHALL accept Kerberos authentication for valid RBAC-configured user
| ClickHouse SHALL accept Kerberos authentication for valid RBAC-configured user
| def rbac_configured_user(self):
"""ClickHouse SHALL accept Kerberos authentication for valid RBAC-configured user
"""
ch_nodes = self.context.ch_nodes
with Given("kinit for client"):
kinit_no_keytab(node=ch_nodes[2], principal="krb_rbac")
with And("kinit for server"):
create_server... | [
"def",
"rbac_configured_user",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"with",
"Given",
"(",
"\"kinit for client\"",
")",
":",
"kinit_no_keytab",
"(",
"node",
"=",
"ch_nodes",
"[",
"2",
"]",
",",
"principal",
"=",
"... | [
35,
0
] | [
56,
46
] | python | en | ['la', 'en', 'en'] | True |
invalid_server_ticket | (self) | ClickHouse SHALL reject Kerberos authentication no Kerberos server is reachable
and CH-server has no valid ticket (or the existing ticket is outdated).
| ClickHouse SHALL reject Kerberos authentication no Kerberos server is reachable
and CH-server has no valid ticket (or the existing ticket is outdated).
| def invalid_server_ticket(self):
"""ClickHouse SHALL reject Kerberos authentication no Kerberos server is reachable
and CH-server has no valid ticket (or the existing ticket is outdated).
"""
ch_nodes = self.context.ch_nodes
with Given("kinit for client"):
kinit_no_keytab(node=ch_nodes[2])
... | [
"def",
"invalid_server_ticket",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"with",
"Given",
"(",
"\"kinit for client\"",
")",
":",
"kinit_no_keytab",
"(",
"node",
"=",
"ch_nodes",
"[",
"2",
"]",
")",
"with",
"And",
"("... | [
63,
0
] | [
91,
45
] | python | en | ['la', 'pt', 'en'] | False |
invalid_client_ticket | (self) | ClickHouse SHALL reject Kerberos authentication no Kerberos server is reachable
and client has no valid ticket (or the existing ticket is outdated).
| ClickHouse SHALL reject Kerberos authentication no Kerberos server is reachable
and client has no valid ticket (or the existing ticket is outdated).
| def invalid_client_ticket(self):
"""ClickHouse SHALL reject Kerberos authentication no Kerberos server is reachable
and client has no valid ticket (or the existing ticket is outdated).
"""
ch_nodes = self.context.ch_nodes
with Given("kinit for client"):
kinit_no_keytab(node=ch_nodes[2], lif... | [
"def",
"invalid_client_ticket",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"with",
"Given",
"(",
"\"kinit for client\"",
")",
":",
"kinit_no_keytab",
"(",
"node",
"=",
"ch_nodes",
"[",
"2",
"]",
",",
"lifetime_option",
"... | [
98,
0
] | [
129,
35
] | python | en | ['la', 'pt', 'en'] | False |
kerberos_unreachable_valid_tickets | (self) | ClickHouse SHALL accept Kerberos authentication if no Kerberos server is reachable
but both CH-server and client have valid tickets.
| ClickHouse SHALL accept Kerberos authentication if no Kerberos server is reachable
but both CH-server and client have valid tickets.
| def kerberos_unreachable_valid_tickets(self):
"""ClickHouse SHALL accept Kerberos authentication if no Kerberos server is reachable
but both CH-server and client have valid tickets.
"""
ch_nodes = self.context.ch_nodes
with Given("kinit for client"):
kinit_no_keytab(node=ch_nodes[2])
w... | [
"def",
"kerberos_unreachable_valid_tickets",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"with",
"Given",
"(",
"\"kinit for client\"",
")",
":",
"kinit_no_keytab",
"(",
"node",
"=",
"ch_nodes",
"[",
"2",
"]",
")",
"with",
... | [
136,
0
] | [
167,
35
] | python | en | ['la', 'en', 'en'] | True |
kerberos_not_configured | (self) | ClickHouse SHALL reject Kerberos authentication if user is not a kerberos-auth user.
| ClickHouse SHALL reject Kerberos authentication if user is not a kerberos-auth user.
| def kerberos_not_configured(self):
"""ClickHouse SHALL reject Kerberos authentication if user is not a kerberos-auth user.
"""
ch_nodes = self.context.ch_nodes
with Given("kinit for client"):
kinit_no_keytab(node=ch_nodes[2], principal="unkerberized")
with And('Kinit for server'):
... | [
"def",
"kerberos_not_configured",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"with",
"Given",
"(",
"\"kinit for client\"",
")",
":",
"kinit_no_keytab",
"(",
"node",
"=",
"ch_nodes",
"[",
"2",
"]",
",",
"principal",
"=",
... | [
174,
0
] | [
195,
51
] | python | en | ['en', 'en', 'en'] | True |
kerberos_server_restarted | (self) | ClickHouse SHALL accept Kerberos authentication if Kerberos server was restarted.
| ClickHouse SHALL accept Kerberos authentication if Kerberos server was restarted.
| def kerberos_server_restarted(self):
"""ClickHouse SHALL accept Kerberos authentication if Kerberos server was restarted.
"""
ch_nodes = self.context.ch_nodes
krb_server = self.context.krb_server
with Given("I obtain keytab for user"):
kinit_no_keytab(node=ch_nodes[2])
with And("I creat... | [
"def",
"kerberos_server_restarted",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"krb_server",
"=",
"self",
".",
"context",
".",
"krb_server",
"with",
"Given",
"(",
"\"I obtain keytab for user\"",
")",
":",
"kinit_no_keytab",
... | [
202,
0
] | [
230,
51
] | python | en | ['la', 'en', 'en'] | True |
invalid_user | (self) | ClickHouse SHALL reject Kerberos authentication for invalid principal
| ClickHouse SHALL reject Kerberos authentication for invalid principal
| def invalid_user(self):
"""ClickHouse SHALL reject Kerberos authentication for invalid principal
"""
ch_nodes = self.context.ch_nodes
with Given("I obtain keytab for invalid user"):
kinit_no_keytab(node=ch_nodes[2], principal="invalid")
with And("I create server principal"):
create... | [
"def",
"invalid_user",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"with",
"Given",
"(",
"\"I obtain keytab for invalid user\"",
")",
":",
"kinit_no_keytab",
"(",
"node",
"=",
"ch_nodes",
"[",
"2",
"]",
",",
"principal",
... | [
237,
0
] | [
252,
117
] | python | en | ['la', 'en', 'en'] | True |
user_deleted | (self) | ClickHouse SHALL reject Kerberos authentication if Kerberos user was deleted prior to query.
| ClickHouse SHALL reject Kerberos authentication if Kerberos user was deleted prior to query.
| def user_deleted(self):
"""ClickHouse SHALL reject Kerberos authentication if Kerberos user was deleted prior to query.
"""
ch_nodes = self.context.ch_nodes
with Given("I obtain keytab for a user"):
kinit_no_keytab(node=ch_nodes[2], principal="krb_rbac")
with And("I create server principal... | [
"def",
"user_deleted",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"with",
"Given",
"(",
"\"I obtain keytab for a user\"",
")",
":",
"kinit_no_keytab",
"(",
"node",
"=",
"ch_nodes",
"[",
"2",
"]",
",",
"principal",
"=",
... | [
259,
0
] | [
278,
117
] | python | en | ['es', 'en', 'en'] | True |
authentication_performance | (self) | ClickHouse's performance for Kerberos authentication SHALL shall be comparable to regular authentication.
| ClickHouse's performance for Kerberos authentication SHALL shall be comparable to regular authentication.
| def authentication_performance(self):
"""ClickHouse's performance for Kerberos authentication SHALL shall be comparable to regular authentication.
"""
ch_nodes = self.context.ch_nodes
with Given("I obtain keytab for a user"):
kinit_no_keytab(node=ch_nodes[2])
with And("I create server prin... | [
"def",
"authentication_performance",
"(",
"self",
")",
":",
"ch_nodes",
"=",
"self",
".",
"context",
".",
"ch_nodes",
"with",
"Given",
"(",
"\"I obtain keytab for a user\"",
")",
":",
"kinit_no_keytab",
"(",
"node",
"=",
"ch_nodes",
"[",
"2",
"]",
")",
"with",... | [
285,
0
] | [
315,
47
] | python | en | ['en', 'en', 'en'] | True |
generic | (self) | Perform ClickHouse Kerberos authentication testing
| Perform ClickHouse Kerberos authentication testing
| def generic(self):
"""Perform ClickHouse Kerberos authentication testing
"""
self.context.ch_nodes = [self.context.cluster.node(f"clickhouse{i}") for i in range(1, 4)]
self.context.krb_server = self.context.cluster.node("kerberos")
self.context.clients = [self.context.cluster.node(f"krb-client{i}")... | [
"def",
"generic",
"(",
"self",
")",
":",
"self",
".",
"context",
".",
"ch_nodes",
"=",
"[",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"f\"clickhouse{i}\"",
")",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"4",
")",
"]",
"self",
".",
... | [
322,
0
] | [
331,
40
] | python | en | ['la', 'fr', 'en'] | False |
refineFit | (distMat, sample_names, mean0, mean1, scale,
max_move, min_move, slope = 2, score_idx = 0,
unconstrained = False, no_local = False, num_processes = 1,
betweenness_sample = betweenness_sample_default, use_gpu = False) | Try to refine a fit by maximising a network score based on transitivity and density.
Iteratively move the decision boundary to do this, using starting point from existing model.
Args:
distMat (numpy.array)
n x 2 array of core and accessory distances for n samples
sample_names (list... | Try to refine a fit by maximising a network score based on transitivity and density. | def refineFit(distMat, sample_names, mean0, mean1, scale,
max_move, min_move, slope = 2, score_idx = 0,
unconstrained = False, no_local = False, num_processes = 1,
betweenness_sample = betweenness_sample_default, use_gpu = False):
"""Try to refine a fit by maximising a netw... | [
"def",
"refineFit",
"(",
"distMat",
",",
"sample_names",
",",
"mean0",
",",
"mean1",
",",
"scale",
",",
"max_move",
",",
"min_move",
",",
"slope",
"=",
"2",
",",
"score_idx",
"=",
"0",
",",
"unconstrained",
"=",
"False",
",",
"no_local",
"=",
"False",
... | [
50,
0
] | [
251,
31
] | python | en | ['en', 'en', 'en'] | True |
expand_cugraph_network | (G, G_extra_df) | Reconstruct a cugraph network with additional edges.
Args:
G (cugraph network)
Original cugraph network
extra_edges (cudf dataframe)
Data frame of edges to add
Returns:
G (cugraph network)
Expanded cugraph network
| Reconstruct a cugraph network with additional edges. | def expand_cugraph_network(G, G_extra_df):
"""Reconstruct a cugraph network with additional edges.
Args:
G (cugraph network)
Original cugraph network
extra_edges (cudf dataframe)
Data frame of edges to add
Returns:
G (cugraph network)
Expanded cu... | [
"def",
"expand_cugraph_network",
"(",
"G",
",",
"G_extra_df",
")",
":",
"# load CUDA libraries",
"if",
"not",
"gpu_lib",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"'Unable to load GPU libraries; exiting\\n'",
")",
"sys",
".",
"exit",
"(",
"1",
")",
"G_vertex... | [
253,
0
] | [
276,
12
] | python | en | ['en', 'en', 'en'] | True |
growNetwork | (sample_names, i_vec, j_vec, idx_vec, s_range, score_idx,
thread_idx = 0, betweenness_sample = betweenness_sample_default,
use_gpu = False) | Construct a network, then add edges to it iteratively.
Input is from ``pp_sketchlib.iterateBoundary1D`` or``pp_sketchlib.iterateBoundary2D``
Args:
sample_names (list)
Sample names corresponding to distMat (accessed by iterator)
i_vec (list)
Ordered ref vertex index to ad... | Construct a network, then add edges to it iteratively.
Input is from ``pp_sketchlib.iterateBoundary1D`` or``pp_sketchlib.iterateBoundary2D`` | def growNetwork(sample_names, i_vec, j_vec, idx_vec, s_range, score_idx,
thread_idx = 0, betweenness_sample = betweenness_sample_default,
use_gpu = False):
"""Construct a network, then add edges to it iteratively.
Input is from ``pp_sketchlib.iterateBoundary1D`` or``pp_sketchlib.... | [
"def",
"growNetwork",
"(",
"sample_names",
",",
"i_vec",
",",
"j_vec",
",",
"idx_vec",
",",
"s_range",
",",
"score_idx",
",",
"thread_idx",
"=",
"0",
",",
"betweenness_sample",
"=",
"betweenness_sample_default",
",",
"use_gpu",
"=",
"False",
")",
":",
"scores"... | [
278,
0
] | [
360,
18
] | python | en | ['en', 'en', 'en'] | True |
newNetwork | (s, sample_names, distMat, mean0, mean1, gradient,
slope=2, score_idx=0, cpus=1, betweenness_sample = betweenness_sample_default,
use_gpu = False) | Wrapper function for :func:`~PopPUNK.network.construct_network_from_edge_list` which is called
by optimisation functions moving a triangular decision boundary.
Given the boundary parameterisation, constructs the network and returns
its score, to be minimised.
Args:
s (float)
Distan... | Wrapper function for :func:`~PopPUNK.network.construct_network_from_edge_list` which is called
by optimisation functions moving a triangular decision boundary. | def newNetwork(s, sample_names, distMat, mean0, mean1, gradient,
slope=2, score_idx=0, cpus=1, betweenness_sample = betweenness_sample_default,
use_gpu = False):
"""Wrapper function for :func:`~PopPUNK.network.construct_network_from_edge_list` which is called
by optimisation functi... | [
"def",
"newNetwork",
"(",
"s",
",",
"sample_names",
",",
"distMat",
",",
"mean0",
",",
"mean1",
",",
"gradient",
",",
"slope",
"=",
"2",
",",
"score_idx",
"=",
"0",
",",
"cpus",
"=",
"1",
",",
"betweenness_sample",
"=",
"betweenness_sample_default",
",",
... | [
362,
0
] | [
431,
18
] | python | en | ['en', 'en', 'en'] | True |
newNetwork2D | (y_idx, sample_names, distMat, x_range, y_range, score_idx=0,
betweenness_sample = betweenness_sample_default, use_gpu = False) | Wrapper function for thresholdIterate2D and :func:`growNetwork`.
For a given y_max, constructs networks across x_range and returns a list
of scores
Args:
y_idx (float)
Maximum y-intercept of boundary, as index into y_range
sample_names (list)
Sample names correspond... | Wrapper function for thresholdIterate2D and :func:`growNetwork`. | def newNetwork2D(y_idx, sample_names, distMat, x_range, y_range, score_idx=0,
betweenness_sample = betweenness_sample_default, use_gpu = False):
"""Wrapper function for thresholdIterate2D and :func:`growNetwork`.
For a given y_max, constructs networks across x_range and returns a list
of s... | [
"def",
"newNetwork2D",
"(",
"y_idx",
",",
"sample_names",
",",
"distMat",
",",
"x_range",
",",
"y_range",
",",
"score_idx",
"=",
"0",
",",
"betweenness_sample",
"=",
"betweenness_sample_default",
",",
"use_gpu",
"=",
"False",
")",
":",
"if",
"gt",
".",
"open... | [
433,
0
] | [
489,
18
] | python | en | ['en', 'en', 'en'] | True |
readManualStart | (startFile) | Reads a file to define a manual start point, rather than using ``--fit-model``
Throws and exits if incorrectly formatted.
Args:
startFile (str)
Name of file with values to read
Returns:
mean0 (numpy.array)
Centre of within-strain distribution
mean1 (numpy.ar... | Reads a file to define a manual start point, rather than using ``--fit-model`` | def readManualStart(startFile):
"""Reads a file to define a manual start point, rather than using ``--fit-model``
Throws and exits if incorrectly formatted.
Args:
startFile (str)
Name of file with values to read
Returns:
mean0 (numpy.array)
Centre of within-stra... | [
"def",
"readManualStart",
"(",
"startFile",
")",
":",
"mean0",
"=",
"None",
"mean1",
"=",
"None",
"with",
"open",
"(",
"startFile",
",",
"'r'",
")",
"as",
"start",
":",
"for",
"line",
"in",
"start",
":",
"(",
"param",
",",
"value",
")",
"=",
"line",
... | [
491,
0
] | [
535,
23
] | python | en | ['en', 'en', 'en'] | True |
likelihoodBoundary | (s, model, start, end, within, between) | Wrapper function around :func:`~PopPUNK.bgmm.fit2dMultiGaussian` so that it can
go into a root-finding function for probabilities between components
Args:
s (float)
Distance along line from mean0
model (BGMMFit)
Fitted mixture model
start (numpy.array)
... | Wrapper function around :func:`~PopPUNK.bgmm.fit2dMultiGaussian` so that it can
go into a root-finding function for probabilities between components | def likelihoodBoundary(s, model, start, end, within, between):
"""Wrapper function around :func:`~PopPUNK.bgmm.fit2dMultiGaussian` so that it can
go into a root-finding function for probabilities between components
Args:
s (float)
Distance along line from mean0
model (BGMMFit)
... | [
"def",
"likelihoodBoundary",
"(",
"s",
",",
"model",
",",
"start",
",",
"end",
",",
"within",
",",
"between",
")",
":",
"X",
"=",
"transformLine",
"(",
"s",
",",
"start",
",",
"end",
")",
".",
"reshape",
"(",
"1",
",",
"-",
"1",
")",
"responsibilit... | [
537,
0
] | [
561,
70
] | python | en | ['en', 'en', 'en'] | True |
ClickhouseTable.metadata | (self) |
Return parsed results of DESCRIBE FORMATTED statement
Returns
-------
meta : TableMetadata
|
Return parsed results of DESCRIBE FORMATTED statement | def metadata(self):
"""
Return parsed results of DESCRIBE FORMATTED statement
Returns
-------
meta : TableMetadata
"""
return self._client.describe_formatted(self._qualified_name) | [
"def",
"metadata",
"(",
"self",
")",
":",
"return",
"self",
".",
"_client",
".",
"describe_formatted",
"(",
"self",
".",
"_qualified_name",
")"
] | [
165,
4
] | [
173,
68
] | python | en | ['en', 'error', 'th'] | False |
ClickhouseClient.close | (self) | Close Clickhouse connection and drop any temporary objects | Close Clickhouse connection and drop any temporary objects | def close(self):
"""Close Clickhouse connection and drop any temporary objects"""
self.con.disconnect() | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"con",
".",
"disconnect",
"(",
")"
] | [
233,
4
] | [
235,
29
] | python | en | ['en', 'en', 'en'] | True |
ClickhouseClient.list_tables | (self, like=None, database=None) |
List tables in the current (or indicated) database. Like the SHOW
TABLES command in the clickhouse-shell.
Parameters
----------
like : string, default None
e.g. 'foo*' to match all tables starting with 'foo'
database : string, default None
If not pas... |
List tables in the current (or indicated) database. Like the SHOW
TABLES command in the clickhouse-shell. | def list_tables(self, like=None, database=None):
"""
List tables in the current (or indicated) database. Like the SHOW
TABLES command in the clickhouse-shell.
Parameters
----------
like : string, default None
e.g. 'foo*' to match all tables starting with 'foo'
... | [
"def",
"list_tables",
"(",
"self",
",",
"like",
"=",
"None",
",",
"database",
"=",
"None",
")",
":",
"statement",
"=",
"'SHOW TABLES'",
"if",
"database",
":",
"statement",
"+=",
"\" FROM `{0}`\"",
".",
"format",
"(",
"database",
")",
"if",
"like",
":",
"... | [
262,
4
] | [
290,
22
] | python | en | ['en', 'error', 'th'] | False |
ClickhouseClient.set_database | (self, name) |
Set the default database scope for client
|
Set the default database scope for client
| def set_database(self, name):
"""
Set the default database scope for client
"""
self.con.database = name | [
"def",
"set_database",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"con",
".",
"database",
"=",
"name"
] | [
292,
4
] | [
296,
32
] | python | en | ['en', 'error', 'th'] | False |
ClickhouseClient.exists_database | (self, name) |
Checks if a given database exists
Parameters
----------
name : string
Database name
Returns
-------
if_exists : boolean
|
Checks if a given database exists | def exists_database(self, name):
"""
Checks if a given database exists
Parameters
----------
name : string
Database name
Returns
-------
if_exists : boolean
"""
return len(self.list_databases(like=name)) > 0 | [
"def",
"exists_database",
"(",
"self",
",",
"name",
")",
":",
"return",
"len",
"(",
"self",
".",
"list_databases",
"(",
"like",
"=",
"name",
")",
")",
">",
"0"
] | [
298,
4
] | [
311,
54
] | python | en | ['en', 'error', 'th'] | False |
ClickhouseClient.list_databases | (self, like=None) |
List databases in the Clickhouse cluster.
Like the SHOW DATABASES command in the clickhouse-shell.
Parameters
----------
like : string, default None
e.g. 'foo*' to match all tables starting with 'foo'
Returns
-------
databases : list of string... |
List databases in the Clickhouse cluster.
Like the SHOW DATABASES command in the clickhouse-shell. | def list_databases(self, like=None):
"""
List databases in the Clickhouse cluster.
Like the SHOW DATABASES command in the clickhouse-shell.
Parameters
----------
like : string, default None
e.g. 'foo*' to match all tables starting with 'foo'
Returns
... | [
"def",
"list_databases",
"(",
"self",
",",
"like",
"=",
"None",
")",
":",
"statement",
"=",
"'SELECT name FROM system.databases'",
"if",
"like",
":",
"statement",
"+=",
"\" WHERE name LIKE '{0}'\"",
".",
"format",
"(",
"like",
")",
"data",
",",
"_",
",",
"_",
... | [
313,
4
] | [
332,
22
] | python | en | ['en', 'error', 'th'] | False |
ClickhouseClient.get_schema | (self, table_name, database=None) |
Return a Schema object for the indicated table and database
Parameters
----------
table_name : string
May be fully qualified
database : string, default None
Returns
-------
schema : ibis Schema
|
Return a Schema object for the indicated table and database | def get_schema(self, table_name, database=None):
"""
Return a Schema object for the indicated table and database
Parameters
----------
table_name : string
May be fully qualified
database : string, default None
Returns
-------
schema : i... | [
"def",
"get_schema",
"(",
"self",
",",
"table_name",
",",
"database",
"=",
"None",
")",
":",
"qualified_name",
"=",
"self",
".",
"_fully_qualified_name",
"(",
"table_name",
",",
"database",
")",
"query",
"=",
"'DESC {0}'",
".",
"format",
"(",
"qualified_name",... | [
334,
4
] | [
355,
45
] | python | en | ['en', 'error', 'th'] | False |
ClickhouseClient.exists_table | (self, name, database=None) |
Determine if the indicated table or view exists
Parameters
----------
name : string
database : string, default None
Returns
-------
if_exists : boolean
|
Determine if the indicated table or view exists | def exists_table(self, name, database=None):
"""
Determine if the indicated table or view exists
Parameters
----------
name : string
database : string, default None
Returns
-------
if_exists : boolean
"""
return len(self.list_tabl... | [
"def",
"exists_table",
"(",
"self",
",",
"name",
",",
"database",
"=",
"None",
")",
":",
"return",
"len",
"(",
"self",
".",
"list_tables",
"(",
"like",
"=",
"name",
",",
"database",
"=",
"database",
")",
")",
">",
"0"
] | [
368,
4
] | [
381,
70
] | python | en | ['en', 'error', 'th'] | False |
get_model | (model_id, params={}) |
Get the epidemiological model.
Parameters
----------
model_id: str
Model identifier.
params: dict
Dictionary of experiment parameters.
|
Get the epidemiological model. | def get_model(model_id, params={}):
"""
Get the epidemiological model.
Parameters
----------
model_id: str
Model identifier.
params: dict
Dictionary of experiment parameters.
"""
assert model_id in list_models, "Model id should be in " + str(list_models)
if model_id... | [
"def",
"get_model",
"(",
"model_id",
",",
"params",
"=",
"{",
"}",
")",
":",
"assert",
"model_id",
"in",
"list_models",
",",
"\"Model id should be in \"",
"+",
"str",
"(",
"list_models",
")",
"if",
"model_id",
"==",
"'prague_seirah'",
":",
"return",
"PragueOde... | [
3,
0
] | [
19,
33
] | python | en | ['en', 'error', 'th'] | False |
feature | (self, node="clickhouse1") | Check create quota query syntax.
```sql
CREATE QUOTA [IF NOT EXISTS | OR REPLACE] name [ON CLUSTER cluster_name]
[KEYED BY {'none' | 'user name' | 'ip address' | 'client key' | 'client key or user name' | 'client key or ip address'}]
[FOR [RANDOMIZED] INTERVAL number {SECOND | MINUTE | HOUR | DAY}
... | Check create quota query syntax. | def feature(self, node="clickhouse1"):
"""Check create quota query syntax.
```sql
CREATE QUOTA [IF NOT EXISTS | OR REPLACE] name [ON CLUSTER cluster_name]
[KEYED BY {'none' | 'user name' | 'ip address' | 'client key' | 'client key or user name' | 'client key or ip address'}]
[FOR [RANDOMIZED] INTER... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"@",
"contextmanager",
"def",
"cleanup",
"(",
"quota",
")",
":",
"try",
":",
"with",
"Gi... | [
10,
0
] | [
226,
52
] | python | en | ['pt', 'en', 'en'] | True |
add_user_to_ldap_and_login | (self, server, user=None, ch_user=None, login=None, exitcode=None, message=None) | Add user to LDAP and ClickHouse and then try to login.
| Add user to LDAP and ClickHouse and then try to login.
| def add_user_to_ldap_and_login(self, server, user=None, ch_user=None, login=None, exitcode=None, message=None):
"""Add user to LDAP and ClickHouse and then try to login.
"""
self.context.ldap_node = self.context.cluster.node(server)
if ch_user is None:
ch_user = {}
if login is None:
... | [
"def",
"add_user_to_ldap_and_login",
"(",
"self",
",",
"server",
",",
"user",
"=",
"None",
",",
"ch_user",
"=",
"None",
",",
"login",
"=",
"None",
",",
"exitcode",
"=",
"None",
",",
"message",
"=",
"None",
")",
":",
"self",
".",
"context",
".",
"ldap_n... | [
29,
0
] | [
45,
105
] | python | en | ['en', 'en', 'en'] | True |
login_with_valid_username_and_password | (users, i, iterations=10) | Login with valid username and password.
| Login with valid username and password.
| def login_with_valid_username_and_password(users, i, iterations=10):
"""Login with valid username and password.
"""
with When(f"valid users try to login #{i}"):
for i in range(iterations):
random_user = users[random.randint(0, len(users)-1)]
login_and_execute_query(username=r... | [
"def",
"login_with_valid_username_and_password",
"(",
"users",
",",
"i",
",",
"iterations",
"=",
"10",
")",
":",
"with",
"When",
"(",
"f\"valid users try to login #{i}\"",
")",
":",
"for",
"i",
"in",
"range",
"(",
"iterations",
")",
":",
"random_user",
"=",
"u... | [
47,
0
] | [
53,
114
] | python | en | ['en', 'en', 'en'] | True |
login_with_valid_username_and_invalid_password | (users, i, iterations=10) | Login with valid username and invalid password.
| Login with valid username and invalid password.
| def login_with_valid_username_and_invalid_password(users, i, iterations=10):
"""Login with valid username and invalid password.
"""
with When(f"users try to login with valid username and invalid password #{i}"):
for i in range(iterations):
random_user = users[random.randint(0, len(users)... | [
"def",
"login_with_valid_username_and_invalid_password",
"(",
"users",
",",
"i",
",",
"iterations",
"=",
"10",
")",
":",
"with",
"When",
"(",
"f\"users try to login with valid username and invalid password #{i}\"",
")",
":",
"for",
"i",
"in",
"range",
"(",
"iterations",... | [
55,
0
] | [
65,
28
] | python | en | ['en', 'en', 'en'] | True |
login_with_invalid_username_and_valid_password | (users, i, iterations=10) | Login with invalid username and valid password.
| Login with invalid username and valid password.
| def login_with_invalid_username_and_valid_password(users, i, iterations=10):
"""Login with invalid username and valid password.
"""
with When(f"users try to login with invalid username and valid password #{i}"):
for i in range(iterations):
random_user = dict(users[random.randint(0, len(u... | [
"def",
"login_with_invalid_username_and_valid_password",
"(",
"users",
",",
"i",
",",
"iterations",
"=",
"10",
")",
":",
"with",
"When",
"(",
"f\"users try to login with invalid username and valid password #{i}\"",
")",
":",
"for",
"i",
"in",
"range",
"(",
"iterations",... | [
67,
0
] | [
78,
28
] | python | en | ['en', 'en', 'en'] | True |
parallel_login | (self, server, user_count=10, timeout=300) | Check that login of valid and invalid LDAP authenticated users works in parallel.
| Check that login of valid and invalid LDAP authenticated users works in parallel.
| def parallel_login(self, server, user_count=10, timeout=300):
"""Check that login of valid and invalid LDAP authenticated users works in parallel.
"""
self.context.ldap_node = self.context.cluster.node(server)
user = None
with Given("a group of LDAP users"):
users = [{"cn": f"parallel_user{... | [
"def",
"parallel_login",
"(",
"self",
",",
"server",
",",
"user_count",
"=",
"10",
",",
"timeout",
"=",
"300",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"server",
")",
"user",
"... | [
85,
0
] | [
110,
40
] | python | en | ['en', 'en', 'en'] | True |
parallel_login_with_the_same_user | (self, server, timeout=300) | Check that valid and invalid logins of the same
LDAP authenticated user works in parallel.
| Check that valid and invalid logins of the same
LDAP authenticated user works in parallel.
| def parallel_login_with_the_same_user(self, server, timeout=300):
"""Check that valid and invalid logins of the same
LDAP authenticated user works in parallel.
"""
self.context.ldap_node = self.context.cluster.node(server)
user = None
with Given("only one LDAP user"):
users = [{"cn": f"... | [
"def",
"parallel_login_with_the_same_user",
"(",
"self",
",",
"server",
",",
"timeout",
"=",
"300",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"server",
")",
"user",
"=",
"None",
"wi... | [
117,
0
] | [
142,
40
] | python | en | ['en', 'en', 'en'] | True |
login_after_ldap_external_user_directory_is_removed | (self, server) | Check that ClickHouse stops authenticating LDAP users
after LDAP external user directory is removed.
| Check that ClickHouse stops authenticating LDAP users
after LDAP external user directory is removed.
| def login_after_ldap_external_user_directory_is_removed(self, server):
"""Check that ClickHouse stops authenticating LDAP users
after LDAP external user directory is removed.
"""
with When("I login after LDAP external user directory is added"):
with ldap_external_user_directory(server="openldap2... | [
"def",
"login_after_ldap_external_user_directory_is_removed",
"(",
"self",
",",
"server",
")",
":",
"with",
"When",
"(",
"\"I login after LDAP external user directory is added\"",
")",
":",
"with",
"ldap_external_user_directory",
"(",
"server",
"=",
"\"openldap2\"",
",",
"r... | [
146,
0
] | [
157,
103
] | python | en | ['en', 'en', 'en'] | True |
parallel_login_with_the_same_user_multiple_servers | (self, server, timeout=300) | Check that valid and invalid logins of the same
user defined in multiple LDAP external user directories
works in parallel.
| Check that valid and invalid logins of the same
user defined in multiple LDAP external user directories
works in parallel.
| def parallel_login_with_the_same_user_multiple_servers(self, server, timeout=300):
"""Check that valid and invalid logins of the same
user defined in multiple LDAP external user directories
works in parallel.
"""
with Given("I have two LDAP servers"):
entries = [
(["openldap1"], ... | [
"def",
"parallel_login_with_the_same_user_multiple_servers",
"(",
"self",
",",
"server",
",",
"timeout",
"=",
"300",
")",
":",
"with",
"Given",
"(",
"\"I have two LDAP servers\"",
")",
":",
"entries",
"=",
"[",
"(",
"[",
"\"openldap1\"",
"]",
",",
"[",
"]",
")... | [
165,
0
] | [
199,
48
] | python | en | ['en', 'en', 'en'] | True |
parallel_login_with_multiple_servers | (self, server, user_count=10, timeout=300) | Check that login of valid and invalid LDAP authenticated users works in parallel
using multiple LDAP external user directories.
| Check that login of valid and invalid LDAP authenticated users works in parallel
using multiple LDAP external user directories.
| def parallel_login_with_multiple_servers(self, server, user_count=10, timeout=300):
"""Check that login of valid and invalid LDAP authenticated users works in parallel
using multiple LDAP external user directories.
"""
with Given("I have two LDAP servers"):
entries = [
(["openldap1"]... | [
"def",
"parallel_login_with_multiple_servers",
"(",
"self",
",",
"server",
",",
"user_count",
"=",
"10",
",",
"timeout",
"=",
"300",
")",
":",
"with",
"Given",
"(",
"\"I have two LDAP servers\"",
")",
":",
"entries",
"=",
"[",
"(",
"[",
"\"openldap1\"",
"]",
... | [
207,
0
] | [
250,
48
] | python | en | ['en', 'en', 'en'] | True |
parallel_login_with_rbac_and_multiple_servers | (self, server, user_count=10, timeout=300) | Check that login of valid and invalid users works in parallel
using local users defined using RBAC and LDAP users authenticated using
multiple LDAP external user directories.
| Check that login of valid and invalid users works in parallel
using local users defined using RBAC and LDAP users authenticated using
multiple LDAP external user directories.
| def parallel_login_with_rbac_and_multiple_servers(self, server, user_count=10, timeout=300):
"""Check that login of valid and invalid users works in parallel
using local users defined using RBAC and LDAP users authenticated using
multiple LDAP external user directories.
"""
with Given("I have two LD... | [
"def",
"parallel_login_with_rbac_and_multiple_servers",
"(",
"self",
",",
"server",
",",
"user_count",
"=",
"10",
",",
"timeout",
"=",
"300",
")",
":",
"with",
"Given",
"(",
"\"I have two LDAP servers\"",
")",
":",
"entries",
"=",
"[",
"(",
"[",
"\"openldap1\"",... | [
258,
0
] | [
304,
52
] | python | en | ['en', 'en', 'en'] | True |
parallel_login_with_rbac_users | (self, server, user_count=10, timeout=300) | Check that login of only valid and invalid local users created using RBAC
works in parallel when server configuration includes LDAP external user directory.
| Check that login of only valid and invalid local users created using RBAC
works in parallel when server configuration includes LDAP external user directory.
| def parallel_login_with_rbac_users(self, server, user_count=10, timeout=300):
"""Check that login of only valid and invalid local users created using RBAC
works in parallel when server configuration includes LDAP external user directory.
"""
self.context.ldap_node = self.context.cluster.node(server)
... | [
"def",
"parallel_login_with_rbac_users",
"(",
"self",
",",
"server",
",",
"user_count",
"=",
"10",
",",
"timeout",
"=",
"300",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"server",
")... | [
310,
0
] | [
330,
40
] | python | en | ['en', 'en', 'en'] | True |
login_after_user_is_added_to_ldap | (self, server) | Check that user can login as soon as it is added to LDAP.
| Check that user can login as soon as it is added to LDAP.
| def login_after_user_is_added_to_ldap(self, server):
"""Check that user can login as soon as it is added to LDAP.
"""
user = {"cn": "myuser", "userpassword": "myuser"}
with When(f"I add user to LDAP and try to login"):
add_user_to_ldap_and_login(user=user, server=server) | [
"def",
"login_after_user_is_added_to_ldap",
"(",
"self",
",",
"server",
")",
":",
"user",
"=",
"{",
"\"cn\"",
":",
"\"myuser\"",
",",
"\"userpassword\"",
":",
"\"myuser\"",
"}",
"with",
"When",
"(",
"f\"I add user to LDAP and try to login\"",
")",
":",
"add_user_to_... | [
336,
0
] | [
342,
60
] | python | en | ['en', 'en', 'en'] | True |
login_after_user_is_deleted_from_ldap | (self, server) | Check that login fails after user is deleted from LDAP.
| Check that login fails after user is deleted from LDAP.
| def login_after_user_is_deleted_from_ldap(self, server):
"""Check that login fails after user is deleted from LDAP.
"""
self.context.ldap_node = self.context.cluster.node(server)
user = None
try:
with Given(f"I add user to LDAP"):
user = {"cn": "myuser", "userpassword": "myuser"... | [
"def",
"login_after_user_is_deleted_from_ldap",
"(",
"self",
",",
"server",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"server",
")",
"user",
"=",
"None",
"try",
":",
"with",
"Given",
... | [
349,
0
] | [
373,
58
] | python | en | ['en', 'en', 'en'] | True |
login_after_user_password_changed_in_ldap | (self, server) | Check that login fails after user password is changed in LDAP.
| Check that login fails after user password is changed in LDAP.
| def login_after_user_password_changed_in_ldap(self, server):
"""Check that login fails after user password is changed in LDAP.
"""
self.context.ldap_node = self.context.cluster.node(server)
user = None
try:
with Given(f"I add user to LDAP"):
user = {"cn": "myuser", "userpassword... | [
"def",
"login_after_user_password_changed_in_ldap",
"(",
"self",
",",
"server",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"server",
")",
"user",
"=",
"None",
"try",
":",
"with",
"Give... | [
380,
0
] | [
408,
58
] | python | en | ['en', 'en', 'en'] | True |
login_after_user_cn_changed_in_ldap | (self, server) | Check that login fails after user cn is changed in LDAP.
| Check that login fails after user cn is changed in LDAP.
| def login_after_user_cn_changed_in_ldap(self, server):
"""Check that login fails after user cn is changed in LDAP.
"""
self.context.ldap_node = self.context.cluster.node(server)
user = None
new_user = None
try:
with Given(f"I add user to LDAP"):
user = {"cn": "myuser", "user... | [
"def",
"login_after_user_cn_changed_in_ldap",
"(",
"self",
",",
"server",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"server",
")",
"user",
"=",
"None",
"new_user",
"=",
"None",
"try",... | [
415,
0
] | [
440,
62
] | python | en | ['en', 'en', 'en'] | True |
login_after_ldap_server_is_restarted | (self, server, timeout=60) | Check that login succeeds after LDAP server is restarted.
| Check that login succeeds after LDAP server is restarted.
| def login_after_ldap_server_is_restarted(self, server, timeout=60):
"""Check that login succeeds after LDAP server is restarted.
"""
self.context.ldap_node = self.context.cluster.node(server)
user = None
try:
with Given(f"I add user to LDAP"):
user = {"cn": "myuser", "userpasswo... | [
"def",
"login_after_ldap_server_is_restarted",
"(",
"self",
",",
"server",
",",
"timeout",
"=",
"60",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"server",
")",
"user",
"=",
"None",
"... | [
447,
0
] | [
475,
58
] | python | en | ['en', 'da', 'en'] | True |
login_after_clickhouse_server_is_restarted | (self, server, timeout=60) | Check that login succeeds after ClickHouse server is restarted.
| Check that login succeeds after ClickHouse server is restarted.
| def login_after_clickhouse_server_is_restarted(self, server, timeout=60):
"""Check that login succeeds after ClickHouse server is restarted.
"""
self.context.ldap_node = self.context.cluster.node(server)
user = None
try:
with Given(f"I add user to LDAP"):
user = {"cn": "myuser",... | [
"def",
"login_after_clickhouse_server_is_restarted",
"(",
"self",
",",
"server",
",",
"timeout",
"=",
"60",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"server",
")",
"user",
"=",
"None... | [
482,
0
] | [
510,
58
] | python | en | ['en', 'da', 'en'] | True |
valid_username_with_valid_empty_password | (self, server) | Check that we can't login using valid username that has empty password.
| Check that we can't login using valid username that has empty password.
| def valid_username_with_valid_empty_password(self, server):
"""Check that we can't login using valid username that has empty password.
"""
user = {"cn": "empty_password", "userpassword": ""}
exitcode = 4
message = f"DB::Exception: {user['cn']}: Authentication failed: password is incorrect or there i... | [
"def",
"valid_username_with_valid_empty_password",
"(",
"self",
",",
"server",
")",
":",
"user",
"=",
"{",
"\"cn\"",
":",
"\"empty_password\"",
",",
"\"userpassword\"",
":",
"\"\"",
"}",
"exitcode",
"=",
"4",
"message",
"=",
"f\"DB::Exception: {user['cn']}: Authentica... | [
517,
0
] | [
524,
92
] | python | en | ['en', 'en', 'en'] | True |
valid_username_and_invalid_empty_password | (self, server) | Check that we can't login using valid username but invalid empty password.
| Check that we can't login using valid username but invalid empty password.
| def valid_username_and_invalid_empty_password(self, server):
"""Check that we can't login using valid username but invalid empty password.
"""
username = "user_non_empty_password"
user = {"cn": username, "userpassword": username}
login = {"password": ""}
exitcode = 4
message = f"DB::Excepti... | [
"def",
"valid_username_and_invalid_empty_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"user_non_empty_password\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\"",
":",
"username",
"}",
"login",
"=",
"{",
"\"password\"",
... | [
531,
0
] | [
541,
105
] | python | en | ['en', 'en', 'en'] | True |
valid_username_and_password | (self, server) | Check that we can login using valid username and password.
| Check that we can login using valid username and password.
| def valid_username_and_password(self, server):
"""Check that we can login using valid username and password.
"""
username = "valid_username_and_password"
user = {"cn": username, "userpassword": username}
with When(f"I add user {username} to LDAP and try to login"):
add_user_to_ldap_and_logi... | [
"def",
"valid_username_and_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"valid_username_and_password\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\"",
":",
"username",
"}",
"with",
"When",
"(",
"f\"I add user {username}... | [
547,
0
] | [
554,
60
] | python | en | ['en', 'en', 'en'] | True |
valid_username_and_password_invalid_server | (self, server=None) | Check that we can't login using valid username and valid
password but for a different server.
| Check that we can't login using valid username and valid
password but for a different server.
| def valid_username_and_password_invalid_server(self, server=None):
"""Check that we can't login using valid username and valid
password but for a different server.
"""
self.context.ldap_node = self.context.cluster.node("openldap1")
exitcode = 4
message = f"DB::Exception: user2: Authentication f... | [
"def",
"valid_username_and_password_invalid_server",
"(",
"self",
",",
"server",
"=",
"None",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"\"openldap1\"",
")",
"exitcode",
"=",
"4",
"mess... | [
560,
0
] | [
569,
99
] | python | en | ['en', 'en', 'en'] | True |
valid_long_username_and_short_password | (self, server) | Check that we can login using valid very long username and short password.
| Check that we can login using valid very long username and short password.
| def valid_long_username_and_short_password(self, server):
"""Check that we can login using valid very long username and short password.
"""
username = "long_username_12345678901234567890123456789012345678901234567890123456789012345678901234567890"
user = {"cn": username, "userpassword": "long_username"}... | [
"def",
"valid_long_username_and_short_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"long_username_12345678901234567890123456789012345678901234567890123456789012345678901234567890\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\"",
":... | [
576,
0
] | [
582,
56
] | python | en | ['en', 'en', 'en'] | True |
invalid_long_username_and_valid_short_password | (self, server) | Check that we can't login using slightly invalid long username but valid password.
| Check that we can't login using slightly invalid long username but valid password.
| def invalid_long_username_and_valid_short_password(self, server):
"""Check that we can't login using slightly invalid long username but valid password.
"""
username = "long_username_12345678901234567890123456789012345678901234567890123456789012345678901234567890"
user = {"cn": username, "userpassword": ... | [
"def",
"invalid_long_username_and_valid_short_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"long_username_12345678901234567890123456789012345678901234567890123456789012345678901234567890\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\... | [
588,
0
] | [
598,
105
] | python | en | ['en', 'en', 'en'] | True |
valid_short_username_and_long_password | (self, server) | Check that we can login using valid short username with very long password.
| Check that we can login using valid short username with very long password.
| def valid_short_username_and_long_password(self, server):
"""Check that we can login using valid short username with very long password.
"""
username = "long_password"
user = {"cn": username, "userpassword": "long_password_12345678901234567890123456789012345678901234567890123456789012345678901234567890"... | [
"def",
"valid_short_username_and_long_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"long_password\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\"",
":",
"\"long_password_12345678901234567890123456789012345678901234567890123456789... | [
605,
0
] | [
611,
56
] | python | en | ['en', 'en', 'en'] | True |
valid_short_username_and_invalid_long_password | (self, server) | Check that we can't login using valid short username and invalid long password.
| Check that we can't login using valid short username and invalid long password.
| def valid_short_username_and_invalid_long_password(self, server):
"""Check that we can't login using valid short username and invalid long password.
"""
username = "long_password"
user = {"cn": username, "userpassword": "long_password_123456789012345678901234567890123456789012345678901234567890123456789... | [
"def",
"valid_short_username_and_invalid_long_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"long_password\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\"",
":",
"\"long_password_123456789012345678901234567890123456789012345678901... | [
617,
0
] | [
627,
105
] | python | en | ['en', 'en', 'en'] | True |
valid_username_and_invalid_password | (self, server) | Check that we can't login using valid username and invalid password.
| Check that we can't login using valid username and invalid password.
| def valid_username_and_invalid_password(self, server):
"""Check that we can't login using valid username and invalid password.
"""
username = "valid_username_and_invalid_password"
user = {"cn": username, "userpassword": username}
login = {"password": user["userpassword"] + "1"}
exitcode = 4
... | [
"def",
"valid_username_and_invalid_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"valid_username_and_invalid_password\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\"",
":",
"username",
"}",
"login",
"=",
"{",
"\"password... | [
633,
0
] | [
643,
105
] | python | en | ['en', 'en', 'en'] | True |
invalid_username_and_valid_password | (self, server) | Check that we can't login using slightly invalid username but valid password.
| Check that we can't login using slightly invalid username but valid password.
| def invalid_username_and_valid_password(self, server):
"""Check that we can't login using slightly invalid username but valid password.
"""
username = "invalid_username_and_valid_password"
user = {"cn": username, "userpassword": username}
login = {"username": user["cn"] + "1"}
exitcode = 4
... | [
"def",
"invalid_username_and_valid_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"invalid_username_and_valid_password\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\"",
":",
"username",
"}",
"login",
"=",
"{",
"\"username... | [
649,
0
] | [
659,
105
] | python | en | ['en', 'en', 'en'] | True |
valid_utf8_username_and_ascii_password | (self, server) | Check that we can login using valid utf-8 username with ascii password.
| Check that we can login using valid utf-8 username with ascii password.
| def valid_utf8_username_and_ascii_password(self, server):
"""Check that we can login using valid utf-8 username with ascii password.
"""
username = "utf8_username_Gãńdåłf_Thê_Gręât"
user = {"cn": username, "userpassword": "utf8_username"}
add_user_to_ldap_and_login(user=user, server=server) | [
"def",
"valid_utf8_username_and_ascii_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"utf8_username_Gãńdåłf_Thê_Gręât\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\"",
":",
"\"utf8_username\"",
"}",
"add_user_to_ldap_and_login"... | [
666,
0
] | [
672,
56
] | python | en | ['en', 'en', 'en'] | True |
valid_ascii_username_and_utf8_password | (self, server) | Check that we can login using valid ascii username with utf-8 password.
| Check that we can login using valid ascii username with utf-8 password.
| def valid_ascii_username_and_utf8_password(self, server):
"""Check that we can login using valid ascii username with utf-8 password.
"""
username = "utf8_password"
user = {"cn": username, "userpassword": "utf8_password_Gãńdåłf_Thê_Gręât"}
add_user_to_ldap_and_login(user=user, server=server) | [
"def",
"valid_ascii_username_and_utf8_password",
"(",
"self",
",",
"server",
")",
":",
"username",
"=",
"\"utf8_password\"",
"user",
"=",
"{",
"\"cn\"",
":",
"username",
",",
"\"userpassword\"",
":",
"\"utf8_password_Gãńdåłf_Thê_Gręât\"}",
"",
"add_user_to_ldap_and_login"... | [
679,
0
] | [
685,
56
] | python | en | ['en', 'en', 'en'] | True |
empty_username_and_empty_password | (self, server=None) | Check that we can login using empty username and empty password as
it will use the default user and that has an empty password.
| Check that we can login using empty username and empty password as
it will use the default user and that has an empty password.
| def empty_username_and_empty_password(self, server=None):
"""Check that we can login using empty username and empty password as
it will use the default user and that has an empty password.
"""
login_and_execute_query(username="", password="") | [
"def",
"empty_username_and_empty_password",
"(",
"self",
",",
"server",
"=",
"None",
")",
":",
"login_and_execute_query",
"(",
"username",
"=",
"\"\"",
",",
"password",
"=",
"\"\"",
")"
] | [
688,
0
] | [
692,
53
] | python | en | ['en', 'en', 'en'] | True |
default_verification_cooldown_value | (self, server, rbac=False) | Check that the default value (0) for the verification cooldown parameter
disables caching and forces contacting the LDAP server for each
authentication request.
| Check that the default value (0) for the verification cooldown parameter
disables caching and forces contacting the LDAP server for each
authentication request.
| def default_verification_cooldown_value(self, server, rbac=False):
"""Check that the default value (0) for the verification cooldown parameter
disables caching and forces contacting the LDAP server for each
authentication request.
"""
error_message = "DB::Exception: testVCD: Authentication failed: ... | [
"def",
"default_verification_cooldown_value",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
")",
":",
"error_message",
"=",
"\"DB::Exception: testVCD: Authentication failed: password is incorrect or there is no user with such name\"",
"error_exitcode",
"=",
"4",
"user",
... | [
699,
0
] | [
737,
58
] | python | en | ['en', 'en', 'en'] | True |
valid_verification_cooldown_value_cn_change | (self, server, rbac=False) | Check that we can perform requests without contacting the LDAP server
after successful authentication when the verification_cooldown parameter
is set and the user cn is changed.
| Check that we can perform requests without contacting the LDAP server
after successful authentication when the verification_cooldown parameter
is set and the user cn is changed.
| def valid_verification_cooldown_value_cn_change(self, server, rbac=False):
"""Check that we can perform requests without contacting the LDAP server
after successful authentication when the verification_cooldown parameter
is set and the user cn is changed.
"""
error_message = "DB::Exception: testVCD... | [
"def",
"valid_verification_cooldown_value_cn_change",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
")",
":",
"error_message",
"=",
"\"DB::Exception: testVCD: Authentication failed: password is incorrect or there is no user with such name\"",
"error_exitcode",
"=",
"4",
... | [
744,
0
] | [
792,
62
] | python | en | ['en', 'en', 'en'] | True |
valid_verification_cooldown_value_password_change | (self, server, rbac=False) | Check that we can perform requests without contacting the LDAP server
after successful authentication when the verification_cooldown parameter
is set and the user password is changed.
| Check that we can perform requests without contacting the LDAP server
after successful authentication when the verification_cooldown parameter
is set and the user password is changed.
| def valid_verification_cooldown_value_password_change(self, server, rbac=False):
"""Check that we can perform requests without contacting the LDAP server
after successful authentication when the verification_cooldown parameter
is set and the user password is changed.
"""
error_message = "DB::Except... | [
"def",
"valid_verification_cooldown_value_password_change",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
")",
":",
"error_message",
"=",
"\"DB::Exception: testVCD: Authentication failed: password is incorrect or there is no user with such name\"",
"error_exitcode",
"=",
"... | [
799,
0
] | [
846,
58
] | python | en | ['en', 'en', 'en'] | True |
valid_verification_cooldown_value_ldap_unavailable | (self, server, rbac=False) | Check that we can perform requests without contacting the LDAP server
after successful authentication when the verification_cooldown parameter
is set, even when the LDAP server is offline.
| Check that we can perform requests without contacting the LDAP server
after successful authentication when the verification_cooldown parameter
is set, even when the LDAP server is offline.
| def valid_verification_cooldown_value_ldap_unavailable(self, server, rbac=False):
"""Check that we can perform requests without contacting the LDAP server
after successful authentication when the verification_cooldown parameter
is set, even when the LDAP server is offline.
"""
error_message = "DB::... | [
"def",
"valid_verification_cooldown_value_ldap_unavailable",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
")",
":",
"error_message",
"=",
"\"DB::Exception: testVCD: Authentication failed: password is incorrect or there is no user with such name\"",
"error_exitcode",
"=",
... | [
853,
0
] | [
901,
58
] | python | en | ['en', 'en', 'en'] | True |
repeat_requests | (self, server, iterations, vcd_value, rbac=False) | Run repeated requests from some user to the LDAP server.
| Run repeated requests from some user to the LDAP server.
| def repeat_requests(self, server, iterations, vcd_value, rbac=False):
"""Run repeated requests from some user to the LDAP server.
"""
user = None
with Given(f"I have an LDAP configuration that sets verification_cooldown parameter to {vcd_value} sec"):
servers = { "openldap1": {
"ho... | [
"def",
"repeat_requests",
"(",
"self",
",",
"server",
",",
"iterations",
",",
"vcd_value",
",",
"rbac",
"=",
"False",
")",
":",
"user",
"=",
"None",
"with",
"Given",
"(",
"f\"I have an LDAP configuration that sets verification_cooldown parameter to {vcd_value} sec\"",
"... | [
904,
0
] | [
940,
58
] | python | en | ['en', 'en', 'en'] | True |
verification_cooldown_performance | (self, server, rbac=False, iterations=5000) | Check login performance when the verification cooldown
parameter is set to a positive value when comparing to the case when
the verification cooldown parameter is turned off.
| Check login performance when the verification cooldown
parameter is set to a positive value when comparing to the case when
the verification cooldown parameter is turned off.
| def verification_cooldown_performance(self, server, rbac=False, iterations=5000):
"""Check login performance when the verification cooldown
parameter is set to a positive value when comparing to the case when
the verification cooldown parameter is turned off.
"""
vcd_time = 0
no_vcd_time = 0
... | [
"def",
"verification_cooldown_performance",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
",",
"iterations",
"=",
"5000",
")",
":",
"vcd_time",
"=",
"0",
"no_vcd_time",
"=",
"0",
"with",
"Example",
"(",
"f\"Repeated requests with verification cooldown param... | [
947,
0
] | [
965,
96
] | python | en | ['en', 'en', 'en'] | True |
check_verification_cooldown_reset_on_core_server_parameter_change | (self, server,
parameter_name, parameter_value, rbac=False) | Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after one of the core server
parameters is changed in the LDAP server configuration.
| Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after one of the core server
parameters is changed in the LDAP server configuration.
| def check_verification_cooldown_reset_on_core_server_parameter_change(self, server,
parameter_name, parameter_value, rbac=False):
"""Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after one of the core server
parameters is c... | [
"def",
"check_verification_cooldown_reset_on_core_server_parameter_change",
"(",
"self",
",",
"server",
",",
"parameter_name",
",",
"parameter_value",
",",
"rbac",
"=",
"False",
")",
":",
"config_d_dir",
"=",
"\"/etc/clickhouse-server/config.d\"",
"config_file",
"=",
"\"lda... | [
968,
0
] | [
1028,
111
] | python | en | ['en', 'en', 'en'] | True |
verification_cooldown_reset_on_server_host_parameter_change | (self, server, rbac=False) | Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server host name
is changed in the LDAP server configuration.
| Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server host name
is changed in the LDAP server configuration.
| def verification_cooldown_reset_on_server_host_parameter_change(self, server, rbac=False):
"""Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server host name
is changed in the LDAP server configuration.
"""
check_verif... | [
"def",
"verification_cooldown_reset_on_server_host_parameter_change",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
")",
":",
"check_verification_cooldown_reset_on_core_server_parameter_change",
"(",
"server",
"=",
"server",
",",
"parameter_name",
"=",
"\"host\"",
... | [
1035,
0
] | [
1041,
70
] | python | en | ['en', 'en', 'en'] | True |
verification_cooldown_reset_on_server_port_parameter_change | (self, server, rbac=False) | Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server port is changed in the
LDAP server configuration.
| Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server port is changed in the
LDAP server configuration.
| def verification_cooldown_reset_on_server_port_parameter_change(self, server, rbac=False):
"""Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server port is changed in the
LDAP server configuration.
"""
check_verificati... | [
"def",
"verification_cooldown_reset_on_server_port_parameter_change",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
")",
":",
"check_verification_cooldown_reset_on_core_server_parameter_change",
"(",
"server",
"=",
"server",
",",
"parameter_name",
"=",
"\"port\"",
... | [
1048,
0
] | [
1054,
65
] | python | en | ['en', 'en', 'en'] | True |
verification_cooldown_reset_on_server_auth_dn_prefix_parameter_change | (self, server, rbac=False) | Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server auth_dn_prefix
is changed in the LDAP server configuration.
| Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server auth_dn_prefix
is changed in the LDAP server configuration.
| def verification_cooldown_reset_on_server_auth_dn_prefix_parameter_change(self, server, rbac=False):
"""Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server auth_dn_prefix
is changed in the LDAP server configuration.
"""
... | [
"def",
"verification_cooldown_reset_on_server_auth_dn_prefix_parameter_change",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
")",
":",
"check_verification_cooldown_reset_on_core_server_parameter_change",
"(",
"server",
"=",
"server",
",",
"parameter_name",
"=",
"\"a... | [
1061,
0
] | [
1067,
75
] | python | en | ['en', 'en', 'en'] | True |
verification_cooldown_reset_on_server_auth_dn_suffix_parameter_change | (self, server, rbac=False) | Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server auth_dn_suffix
is changed in the LDAP server configuration.
| Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server auth_dn_suffix
is changed in the LDAP server configuration.
| def verification_cooldown_reset_on_server_auth_dn_suffix_parameter_change(self, server, rbac=False):
"""Check that the LDAP login cache is reset for all the LDAP authentication users
when verification_cooldown parameter is set after server auth_dn_suffix
is changed in the LDAP server configuration.
"""
... | [
"def",
"verification_cooldown_reset_on_server_auth_dn_suffix_parameter_change",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
")",
":",
"check_verification_cooldown_reset_on_core_server_parameter_change",
"(",
"server",
"=",
"server",
",",
"parameter_name",
"=",
"\"a... | [
1074,
0
] | [
1081,
65
] | python | en | ['en', 'en', 'en'] | True |
scenario | (self, server, rbac=False) | Check that cached bind requests for the user are discarded when
the user provides invalid login credentials.
| Check that cached bind requests for the user are discarded when
the user provides invalid login credentials.
| def scenario(self, server, rbac=False):
"""Check that cached bind requests for the user are discarded when
the user provides invalid login credentials.
"""
user = None
error_exitcode = 4
error_message = "DB::Exception: testVCD: Authentication failed: password is incorrect or there is no user wit... | [
"def",
"scenario",
"(",
"self",
",",
"server",
",",
"rbac",
"=",
"False",
")",
":",
"user",
"=",
"None",
"error_exitcode",
"=",
"4",
"error_message",
"=",
"\"DB::Exception: testVCD: Authentication failed: password is incorrect or there is no user with such name\"",
"with",
... | [
1089,
0
] | [
1138,
58
] | python | en | ['en', 'en', 'en'] | True |
user_lookup_priority | (self, server) | Check that users are looked up in the same priority
as they are defined in the `<user_dictionaries>` section
of the `config.xml`. For this test we have the following priority list
as defined by the configuration files:
* users.xml
* local directory
* LDAP external user directory
| Check that users are looked up in the same priority
as they are defined in the `<user_dictionaries>` section
of the `config.xml`. For this test we have the following priority list
as defined by the configuration files: | def user_lookup_priority(self, server):
"""Check that users are looked up in the same priority
as they are defined in the `<user_dictionaries>` section
of the `config.xml`. For this test we have the following priority list
as defined by the configuration files:
* users.xml
* local directory
... | [
"def",
"user_lookup_priority",
"(",
"self",
",",
"server",
")",
":",
"self",
".",
"context",
".",
"ldap_node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"server",
")",
"message",
"=",
"\"DB::Exception: {username}: Authentication failed: passwo... | [
1144,
0
] | [
1174,
56
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, servers=None, server=None, node="clickhouse1") | Check that users can be authenticated using an LDAP external user directory.
| Check that users can be authenticated using an LDAP external user directory.
| def feature(self, servers=None, server=None, node="clickhouse1"):
"""Check that users can be authenticated using an LDAP external user directory.
"""
self.context.node = self.context.cluster.node(node)
if servers is None:
servers = globals()["servers"]
if server is None:
server = "... | [
"def",
"feature",
"(",
"self",
",",
"servers",
"=",
"None",
",",
"server",
"=",
"None",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
... | [
1182,
0
] | [
1203,
46
] | python | en | ['en', 'en', 'en'] | True |
resnet20 | (pretrained: bool = False, num_classes: int = 10) | factory class of ResNet-20.
Parameters
----------
pretrained : bool
Rreturn pretrained model. Note: currently just raise error.
num_classes : int
Number of output class.
| factory class of ResNet-20.
Parameters
----------
pretrained : bool
Rreturn pretrained model. Note: currently just raise error.
num_classes : int
Number of output class.
| def resnet20(pretrained: bool = False, num_classes: int = 10) -> nn.Module:
"""factory class of ResNet-20.
Parameters
----------
pretrained : bool
Rreturn pretrained model. Note: currently just raise error.
num_classes : int
Number of output class.
"""
if pretrained:
... | [
"def",
"resnet20",
"(",
"pretrained",
":",
"bool",
"=",
"False",
",",
"num_classes",
":",
"int",
"=",
"10",
")",
"->",
"nn",
".",
"Module",
":",
"if",
"pretrained",
":",
"raise",
"NotImplementedError",
"(",
"\"resnet for cifar10 dose not have pretrained models.\""... | [
147,
0
] | [
158,
65
] | python | en | ['en', 'lb', 'en'] | True |
resnet32 | (pretrained: bool = False, num_classes: int = 10) | factory class of ResNet-32.
Parameters
----------
pretrained : bool
Rreturn pretrained model. Note: currently just raise error.
num_classes : int
Number of output class.
| factory class of ResNet-32.
Parameters
----------
pretrained : bool
Rreturn pretrained model. Note: currently just raise error.
num_classes : int
Number of output class.
| def resnet32(pretrained: bool = False, num_classes: int = 10) -> nn.Module:
"""factory class of ResNet-32.
Parameters
----------
pretrained : bool
Rreturn pretrained model. Note: currently just raise error.
num_classes : int
Number of output class.
"""
if pretrained:
... | [
"def",
"resnet32",
"(",
"pretrained",
":",
"bool",
"=",
"False",
",",
"num_classes",
":",
"int",
"=",
"10",
")",
"->",
"nn",
".",
"Module",
":",
"if",
"pretrained",
":",
"raise",
"NotImplementedError",
"(",
"\"resnet for cifar10 dose not have pretrained models.\""... | [
161,
0
] | [
172,
65
] | python | en | ['en', 'lb', 'en'] | True |
resnet44 | (pretrained: bool = False, num_classes: int = 10) | factory class of ResNet-44.
Parameters
----------
pretrained : bool
Rreturn pretrained model. Note: currently just raise error.
num_classes : int
Number of output class.
| factory class of ResNet-44.
Parameters
----------
pretrained : bool
Rreturn pretrained model. Note: currently just raise error.
num_classes : int
Number of output class.
| def resnet44(pretrained: bool = False, num_classes: int = 10) -> nn.Module:
"""factory class of ResNet-44.
Parameters
----------
pretrained : bool
Rreturn pretrained model. Note: currently just raise error.
num_classes : int
Number of output class.
"""
if pretrained:
... | [
"def",
"resnet44",
"(",
"pretrained",
":",
"bool",
"=",
"False",
",",
"num_classes",
":",
"int",
"=",
"10",
")",
"->",
"nn",
".",
"Module",
":",
"if",
"pretrained",
":",
"raise",
"NotImplementedError",
"(",
"\"resnet for cifar10 dose not have pretrained models.\""... | [
175,
0
] | [
186,
65
] | python | en | ['en', 'lb', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.