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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
TestConnect.test_connect_with_multiprocess | (self, args) |
target: test uri connect with multiprocess
method: set correct uri, test with multiprocessing connecting
expected: all connection is connected
|
target: test uri connect with multiprocess
method: set correct uri, test with multiprocessing connecting
expected: all connection is connected
| def test_connect_with_multiprocess(self, args):
'''
target: test uri connect with multiprocess
method: set correct uri, test with multiprocessing connecting
expected: all connection is connected
'''
processes = []
def connect():
milvus = get_mi... | [
"def",
"test_connect_with_multiprocess",
"(",
"self",
",",
"args",
")",
":",
"processes",
"=",
"[",
"]",
"def",
"connect",
"(",
")",
":",
"milvus",
"=",
"get_milvus",
"(",
"args",
"[",
"\"ip\"",
"]",
",",
"args",
"[",
"\"port\"",
"]",
",",
"handler",
"... | [
108,
4
] | [
122,
31
] | python | en | ['en', 'error', 'th'] | False |
TestConnect.test_connect_repeatedly | (self, args) |
target: test connect repeatedly
method: connect again
expected: status.code is 0, and status.message shows have connected already
|
target: test connect repeatedly
method: connect again
expected: status.code is 0, and status.message shows have connected already
| def test_connect_repeatedly(self, args):
'''
target: test connect repeatedly
method: connect again
expected: status.code is 0, and status.message shows have connected already
'''
uri_value = "tcp://%s:%s" % (args["ip"], args["port"])
milvus = Milvus(uri=uri_value,... | [
"def",
"test_connect_repeatedly",
"(",
"self",
",",
"args",
")",
":",
"uri_value",
"=",
"\"tcp://%s:%s\"",
"%",
"(",
"args",
"[",
"\"ip\"",
"]",
",",
"args",
"[",
"\"port\"",
"]",
")",
"milvus",
"=",
"Milvus",
"(",
"uri",
"=",
"uri_value",
",",
"handler"... | [
124,
4
] | [
134,
63
] | python | en | ['en', 'error', 'th'] | False |
TestConnect._test_add_vector_and_disconnect_concurrently | (self) |
Target: test disconnect in the middle of add vectors
Method:
a. use coroutine or multi-processing, to simulate network crashing
b. data_set not too large incase disconnection happens when data is underd-preparing
c. data_set not too small incase disconnection happens... |
Target: test disconnect in the middle of add vectors
Method:
a. use coroutine or multi-processing, to simulate network crashing
b. data_set not too large incase disconnection happens when data is underd-preparing
c. data_set not too small incase disconnection happens... | def _test_add_vector_and_disconnect_concurrently(self):
'''
Target: test disconnect in the middle of add vectors
Method:
a. use coroutine or multi-processing, to simulate network crashing
b. data_set not too large incase disconnection happens when data is underd-preparing... | [
"def",
"_test_add_vector_and_disconnect_concurrently",
"(",
"self",
")",
":",
"pass"
] | [
137,
4
] | [
148,
12
] | python | en | ['en', 'error', 'th'] | False |
TestConnect._test_search_vector_and_disconnect_concurrently | (self) |
Target: Test disconnect in the middle of search vectors(with large nq and topk)multiple times, and search/add vectors still work
Method:
a. coroutine or multi-processing, to simulate network crashing
b. connect, search and disconnect, repeating many times
c. connect... |
Target: Test disconnect in the middle of search vectors(with large nq and topk)multiple times, and search/add vectors still work
Method:
a. coroutine or multi-processing, to simulate network crashing
b. connect, search and disconnect, repeating many times
c. connect... | def _test_search_vector_and_disconnect_concurrently(self):
'''
Target: Test disconnect in the middle of search vectors(with large nq and topk)multiple times, and search/add vectors still work
Method:
a. coroutine or multi-processing, to simulate network crashing
b. connec... | [
"def",
"_test_search_vector_and_disconnect_concurrently",
"(",
"self",
")",
":",
"pass"
] | [
150,
4
] | [
160,
12
] | python | en | ['en', 'error', 'th'] | False |
TestConnect._test_thread_safe_with_one_connection_shared_in_multi_threads | (self) |
Target: test 1 connection thread safe
Method: 1 connection shared in multi-threads, all adding vectors, or other things
Expected: Functional as one thread
|
Target: test 1 connection thread safe
Method: 1 connection shared in multi-threads, all adding vectors, or other things
Expected: Functional as one thread | def _test_thread_safe_with_one_connection_shared_in_multi_threads(self):
'''
Target: test 1 connection thread safe
Method: 1 connection shared in multi-threads, all adding vectors, or other things
Expected: Functional as one thread
'''
pass | [
"def",
"_test_thread_safe_with_one_connection_shared_in_multi_threads",
"(",
"self",
")",
":",
"pass"
] | [
162,
4
] | [
169,
11
] | python | en | ['en', 'error', 'th'] | False |
TestConnectPortInvalid.test_connect_with_invalid_port | (self, args, get_invalid_port) |
target: test ip:port connect with invalid port value
method: set port in gen_invalid_ports
expected: connected is False
|
target: test ip:port connect with invalid port value
method: set port in gen_invalid_ports
expected: connected is False
| def test_connect_with_invalid_port(self, args, get_invalid_port):
'''
target: test ip:port connect with invalid port value
method: set port in gen_invalid_ports
expected: connected is False
'''
port = get_invalid_port
with pytest.raises(Exception) as e:
... | [
"def",
"test_connect_with_invalid_port",
"(",
"self",
",",
"args",
",",
"get_invalid_port",
")",
":",
"port",
"=",
"get_invalid_port",
"with",
"pytest",
".",
"raises",
"(",
"Exception",
")",
"as",
"e",
":",
"milvus",
"=",
"get_milvus",
"(",
"args",
"[",
"\"i... | [
206,
4
] | [
214,
66
] | python | en | ['en', 'error', 'th'] | False |
TestConnectURIInvalid.test_connect_with_invalid_uri | (self, get_invalid_uri, args) |
target: test uri connect with invalid uri value
method: set port in gen_invalid_uris
expected: connected is False
|
target: test uri connect with invalid uri value
method: set port in gen_invalid_uris
expected: connected is False
| def test_connect_with_invalid_uri(self, get_invalid_uri, args):
'''
target: test uri connect with invalid uri value
method: set port in gen_invalid_uris
expected: connected is False
'''
uri_value = get_invalid_uri
with pytest.raises(Exception) as e:
... | [
"def",
"test_connect_with_invalid_uri",
"(",
"self",
",",
"get_invalid_uri",
",",
"args",
")",
":",
"uri_value",
"=",
"get_invalid_uri",
"with",
"pytest",
".",
"raises",
"(",
"Exception",
")",
"as",
"e",
":",
"milvus",
"=",
"get_milvus",
"(",
"uri",
"=",
"ur... | [
231,
4
] | [
239,
71
] | python | en | ['en', 'error', 'th'] | False |
test_jdbc_query | (started_cluster) | Test simple query with inline schema and query parameters | Test simple query with inline schema and query parameters | def test_jdbc_query(started_cluster):
"""Test simple query with inline schema and query parameters"""
expected = "{}\t{}".format(datasource, records)
actual = instance.query('''
SELECT * FROM jdbc(
'{}?datasource_column&fetch_size=1',
'rows UInt32',
'SELECT count(... | [
"def",
"test_jdbc_query",
"(",
"started_cluster",
")",
":",
"expected",
"=",
"\"{}\\t{}\"",
".",
"format",
"(",
"datasource",
",",
"records",
")",
"actual",
"=",
"instance",
".",
"query",
"(",
"'''\n SELECT * FROM jdbc(\n '{}?datasource_column&fetch_size... | [
29,
0
] | [
39,
91
] | python | en | ['en', 'en', 'en'] | True |
test_jdbc_distributed_query | (started_cluster) | Test distributed query involving both JDBC table function and ClickHouse table | Test distributed query involving both JDBC table function and ClickHouse table | def test_jdbc_distributed_query(started_cluster):
"""Test distributed query involving both JDBC table function and ClickHouse table"""
actual = instance.query('''
SELECT a.Num + 1
FROM jdbc('{0}', 'SELECT * FROM test.ClickHouseTable') a
INNER JOIN jdbc('{0}', 'num UInt32', 'SELECT {1} - ... | [
"def",
"test_jdbc_distributed_query",
"(",
"started_cluster",
")",
":",
"actual",
"=",
"instance",
".",
"query",
"(",
"'''\n SELECT a.Num + 1\n FROM jdbc('{0}', 'SELECT * FROM test.ClickHouseTable') a\n INNER JOIN jdbc('{0}', 'num UInt32', 'SELECT {1} - 1 AS num') b\n ... | [
41,
0
] | [
50,
84
] | python | en | ['en', 'en', 'en'] | True |
test_jdbc_insert | (started_cluster) | Test insert query using JDBC table function | Test insert query using JDBC table function | def test_jdbc_insert(started_cluster):
"""Test insert query using JDBC table function"""
instance.query('''
CREATE TABLE test.test_insert engine = Memory AS
SELECT * FROM test.ClickHouseTable;
SELECT *
FROM jdbc('{0}?mutation', 'INSERT INTO test.test_insert VALUES({1}, ''{1}'', ... | [
"def",
"test_jdbc_insert",
"(",
"started_cluster",
")",
":",
"instance",
".",
"query",
"(",
"'''\n CREATE TABLE test.test_insert engine = Memory AS\n SELECT * FROM test.ClickHouseTable;\n SELECT * \n FROM jdbc('{0}?mutation', 'INSERT INTO test.test_insert VALUES({1}, ... | [
52,
0
] | [
64,
85
] | python | en | ['fr', 'en', 'en'] | True |
test_jdbc_update | (started_cluster) | Test update query using JDBC table function | Test update query using JDBC table function | def test_jdbc_update(started_cluster):
"""Test update query using JDBC table function"""
secrets = str(uuid.uuid1())
instance.query('''
CREATE TABLE test.test_update engine = Memory AS
SELECT * FROM test.ClickHouseTable;
SELECT *
FROM jdbc(
'{}?mutation',
... | [
"def",
"test_jdbc_update",
"(",
"started_cluster",
")",
":",
"secrets",
"=",
"str",
"(",
"uuid",
".",
"uuid1",
"(",
")",
")",
"instance",
".",
"query",
"(",
"'''\n CREATE TABLE test.test_update engine = Memory AS\n SELECT * FROM test.ClickHouseTable;\n SE... | [
66,
0
] | [
83,
89
] | python | en | ['fr', 'en', 'en'] | True |
test_jdbc_delete | (started_cluster) | Test delete query using JDBC table function | Test delete query using JDBC table function | def test_jdbc_delete(started_cluster):
"""Test delete query using JDBC table function"""
instance.query('''
CREATE TABLE test.test_delete engine = Memory AS
SELECT * FROM test.ClickHouseTable;
SELECT *
FROM jdbc(
'{}?mutation',
'SET mutations_sync = 1; AL... | [
"def",
"test_jdbc_delete",
"(",
"started_cluster",
")",
":",
"instance",
".",
"query",
"(",
"'''\n CREATE TABLE test.test_delete engine = Memory AS\n SELECT * FROM test.ClickHouseTable;\n SELECT * \n FROM jdbc(\n '{}?mutation',\n 'SET mutations_s... | [
85,
0
] | [
100,
86
] | python | en | ['fr', 'en', 'en'] | True |
test_jdbc_table_engine | (started_cluster) | Test query against a JDBC table | Test query against a JDBC table | def test_jdbc_table_engine(started_cluster):
"""Test query against a JDBC table"""
actual = instance.query('''
CREATE TABLE test.jdbc_table(Str String)
ENGINE = JDBC('{}', 'test', 'ClickHouseTable');
SELECT count(1) FROM test.jdbc_table;
'''.format(datasource))
assert int(actual... | [
"def",
"test_jdbc_table_engine",
"(",
"started_cluster",
")",
":",
"actual",
"=",
"instance",
".",
"query",
"(",
"'''\n CREATE TABLE test.jdbc_table(Str String)\n ENGINE = JDBC('{}', 'test', 'ClickHouseTable');\n SELECT count(1) FROM test.jdbc_table;\n '''",
".",
... | [
102,
0
] | [
110,
84
] | python | en | ['fr', 'en', 'en'] | True |
DukeEnergyGatewayEntity.unique_id | (self) | Return a unique ID to use for this entity. | Return a unique ID to use for this entity. | def unique_id(self):
"""Return a unique ID to use for this entity."""
return f"duke_energy_{self._entity_id}" | [
"def",
"unique_id",
"(",
"self",
")",
":",
"return",
"f\"duke_energy_{self._entity_id}\""
] | [
29,
4
] | [
31,
47
] | python | en | ['en', 'en', 'en'] | True |
DukeEnergyGatewayEntity.extra_state_attributes | (self) | Return the state attributes. | Return the state attributes. | def extra_state_attributes(self):
"""Return the state attributes."""
return {
"attribution": ATTRIBUTION,
"integration": DOMAIN,
"meter": self._meter.serial_num,
"gateway": self._gateway.id,
} | [
"def",
"extra_state_attributes",
"(",
"self",
")",
":",
"return",
"{",
"\"attribution\"",
":",
"ATTRIBUTION",
",",
"\"integration\"",
":",
"DOMAIN",
",",
"\"meter\"",
":",
"self",
".",
"_meter",
".",
"serial_num",
",",
"\"gateway\"",
":",
"self",
".",
"_gatewa... | [
43,
4
] | [
50,
9
] | python | en | ['en', 'en', 'en'] | True |
DockerTools._get_docker_command | (self, args:list) | return docker command
| return docker command
| def _get_docker_command(self, args:list) -> list:
''' return docker command
'''
return ['docker', ] + args | [
"def",
"_get_docker_command",
"(",
"self",
",",
"args",
":",
"list",
")",
"->",
"list",
":",
"return",
"[",
"'docker'",
",",
"]",
"+",
"args"
] | [
21,
4
] | [
24,
34
] | python | de | ['de', 'no', 'en'] | False |
DockerTools.list_containers | (self) | rerurns the list of docker containers
| rerurns the list of docker containers
| def list_containers(self):
''' rerurns the list of docker containers
'''
containers = list()
try:
docker_command = ['container', 'ls', '-a', '--format', '{{json .}}']
containers = [json.loads(cnt)
for cnt in self._check_output(docker_c... | [
"def",
"list_containers",
"(",
"self",
")",
":",
"containers",
"=",
"list",
"(",
")",
"try",
":",
"docker_command",
"=",
"[",
"'container'",
",",
"'ls'",
",",
"'-a'",
",",
"'--format'",
",",
"'{{json .}}'",
"]",
"containers",
"=",
"[",
"json",
".",
"load... | [
43,
4
] | [
53,
25
] | python | en | ['en', 'en', 'en'] | True |
DockerTools.list_images | (self) | rerurns the list of docker images
| rerurns the list of docker images
| def list_images(self):
''' rerurns the list of docker images
'''
images = list()
try:
docker_command = ['image', 'ls', "--format", '{{json .}}']
images = [json.loads(img)
for img in self._check_output(docker_command).split('\n') if... | [
"def",
"list_images",
"(",
"self",
")",
":",
"images",
"=",
"list",
"(",
")",
"try",
":",
"docker_command",
"=",
"[",
"'image'",
",",
"'ls'",
",",
"\"--format\"",
",",
"'{{json .}}'",
"]",
"images",
"=",
"[",
"json",
".",
"loads",
"(",
"img",
")",
"f... | [
55,
4
] | [
65,
21
] | python | en | ['en', 'en', 'en'] | True |
DockerTools.stop_all_containers | (self) | stop all containers
| stop all containers
| def stop_all_containers(self) -> None:
''' stop all containers
'''
containers = self.list_containers()
logger.info(f"Stopping of containers: {containers}")
try:
for container in containers:
if container.get('State') in ('running'):
... | [
"def",
"stop_all_containers",
"(",
"self",
")",
"->",
"None",
":",
"containers",
"=",
"self",
".",
"list_containers",
"(",
")",
"logger",
".",
"info",
"(",
"f\"Stopping of containers: {containers}\"",
")",
"try",
":",
"for",
"container",
"in",
"containers",
":",... | [
67,
4
] | [
79,
59
] | python | en | ['en', 'en', 'en'] | True |
DockerTools.remove_exited_containers | (self) | remove exited containers
| remove exited containers
| def remove_exited_containers(self) -> None:
''' remove exited containers
'''
containers = self.list_containers()
logger.info(f"Removing of exited containers: {containers}")
try:
for container in containers:
if container.get('State') in ('exited', 'crea... | [
"def",
"remove_exited_containers",
"(",
"self",
")",
"->",
"None",
":",
"containers",
"=",
"self",
".",
"list_containers",
"(",
")",
"logger",
".",
"info",
"(",
"f\"Removing of exited containers: {containers}\"",
")",
"try",
":",
"for",
"container",
"in",
"contain... | [
81,
4
] | [
93,
66
] | python | en | ['es', 'en', 'en'] | True |
DockerTools.remove_none_images | (self) | remove None images
| remove None images
| def remove_none_images(self) -> None:
''' remove None images
'''
images = self.list_images()
logger.info("Removing of none images")
try:
for image in images:
if image.get('Repository') == '<none>' or image.get('Tag') == '<none>':
do... | [
"def",
"remove_none_images",
"(",
"self",
")",
"->",
"None",
":",
"images",
"=",
"self",
".",
"list_images",
"(",
")",
"logger",
".",
"info",
"(",
"\"Removing of none images\"",
")",
"try",
":",
"for",
"image",
"in",
"images",
":",
"if",
"image",
".",
"g... | [
95,
4
] | [
107,
60
] | python | en | ['en', 'it', 'en'] | True |
DockerTools.remove_all_images | (self) | remove all images
| remove all images
| def remove_all_images(self) -> None:
''' remove all images
'''
images = self.list_images()
logger.info("Removing of all images")
try:
for image in images:
docker_command = ['image', 'rm', image.get("ID")]
self._run_command(docker_comman... | [
"def",
"remove_all_images",
"(",
"self",
")",
"->",
"None",
":",
"images",
"=",
"self",
".",
"list_images",
"(",
")",
"logger",
".",
"info",
"(",
"\"Removing of all images\"",
")",
"try",
":",
"for",
"image",
"in",
"images",
":",
"docker_command",
"=",
"["... | [
109,
4
] | [
120,
59
] | python | en | ['en', 'en', 'en'] | True |
DockerTools.remove_all_containers | (self) | remove all containers
| remove all containers
| def remove_all_containers(self) -> None:
''' remove all containers
'''
self.stop_all_containers()
self.remove_exited_containers() | [
"def",
"remove_all_containers",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"stop_all_containers",
"(",
")",
"self",
".",
"remove_exited_containers",
"(",
")"
] | [
122,
4
] | [
126,
39
] | python | en | ['en', 'en', 'en'] | True |
dict_privileges_granted_directly | (self, node=None) | Check that a user is able to execute `SHOW CREATE` and `EXISTS`
commands on a dictionary and see the dictionary when they execute `SHOW DICTIONARIES` command
if and only if they have any privilege on that table granted directly.
| Check that a user is able to execute `SHOW CREATE` and `EXISTS`
commands on a dictionary and see the dictionary when they execute `SHOW DICTIONARIES` command
if and only if they have any privilege on that table granted directly.
| def dict_privileges_granted_directly(self, node=None):
"""Check that a user is able to execute `SHOW CREATE` and `EXISTS`
commands on a dictionary and see the dictionary when they execute `SHOW DICTIONARIES` command
if and only if they have any privilege on that table granted directly.
"""
user_nam... | [
"def",
"dict_privileges_granted_directly",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"user",
"(",
"node",
",",
"f\"{... | [
8,
0
] | [
25,
80
] | python | en | ['en', 'en', 'en'] | True |
dict_privileges_granted_via_role | (self, node=None) | Check that a user is able to execute `SHOW CREATE` and `EXISTS`
commands on a dictionary and see the dictionary when they execute `SHOW DICTIONARIES` command
if and only if they have any privilege on that table granted via role.
| Check that a user is able to execute `SHOW CREATE` and `EXISTS`
commands on a dictionary and see the dictionary when they execute `SHOW DICTIONARIES` command
if and only if they have any privilege on that table granted via role.
| def dict_privileges_granted_via_role(self, node=None):
"""Check that a user is able to execute `SHOW CREATE` and `EXISTS`
commands on a dictionary and see the dictionary when they execute `SHOW DICTIONARIES` command
if and only if they have any privilege on that table granted via role.
"""
user_nam... | [
"def",
"dict_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",
"... | [
28,
0
] | [
49,
80
] | python | en | ['en', 'en', 'en'] | True |
check_privilege | (self, privilege, on, grant_target_name, user_name, dict_name, node=None) | Run checks for commands that require SHOW DICTIONARY privilege.
| Run checks for commands that require SHOW DICTIONARY privilege.
| def check_privilege(self, privilege, on, grant_target_name, user_name, dict_name, node=None):
"""Run checks for commands that require SHOW DICTIONARY privilege.
"""
if node is None:
node = self.context.node
on = on.replace("dict", f"{dict_name}")
Suite(test=show_dict)(privilege=privilege,... | [
"def",
"check_privilege",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"dict_name",
",",
"node",
"=",
"None",
")",
":",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"on... | [
59,
0
] | [
70,
134
] | python | en | ['en', 'en', 'en'] | True |
show_dict | (self, privilege, on, grant_target_name, user_name, dict_name, node=None) | Check that user is only able to see a dictionary in SHOW DICTIONARIES
when they have a privilege on that dictionary.
| Check that user is only able to see a dictionary in SHOW DICTIONARIES
when they have a privilege on that dictionary.
| def show_dict(self, privilege, on, grant_target_name, user_name, dict_name, node=None):
"""Check that user is only able to see a dictionary in SHOW DICTIONARIES
when they have a privilege on that dictionary.
"""
exitcode, message = errors.not_enough_privileges(name=user_name)
if node is None:
... | [
"def",
"show_dict",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"dict_name",
",",
"node",
"=",
"None",
")",
":",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"name",
"=",
"user... | [
76,
0
] | [
121,
64
] | python | en | ['en', 'en', 'en'] | True |
exists | (self, privilege, on, grant_target_name, user_name, dict_name, node=None) | Check that user is able to execute EXISTS on a dictionary if and only if the user has SHOW DICTIONARY privilege
on that dictionary.
| Check that user is able to execute EXISTS on a dictionary if and only if the user has SHOW DICTIONARY privilege
on that dictionary.
| def exists(self, privilege, on, grant_target_name, user_name, dict_name, node=None):
"""Check that user is able to execute EXISTS on a dictionary if and only if the user has SHOW DICTIONARY privilege
on that dictionary.
"""
exitcode, message = errors.not_enough_privileges(name=user_name)
if node is... | [
"def",
"exists",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"dict_name",
",",
"node",
"=",
"None",
")",
":",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"name",
"=",
"user_na... | [
127,
0
] | [
172,
64
] | python | en | ['en', 'en', 'en'] | True |
show_create | (self, privilege, on, grant_target_name, user_name, dict_name, node=None) | Check that user is able to execute SHOW CREATE on a dictionary if and only if the user has SHOW DICTIONARY privilege
on that dictionary.
| Check that user is able to execute SHOW CREATE on a dictionary if and only if the user has SHOW DICTIONARY privilege
on that dictionary.
| def show_create(self, privilege, on, grant_target_name, user_name, dict_name, node=None):
"""Check that user is able to execute SHOW CREATE on a dictionary if and only if the user has SHOW DICTIONARY privilege
on that dictionary.
"""
exitcode, message = errors.not_enough_privileges(name=user_name)
... | [
"def",
"show_create",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"dict_name",
",",
"node",
"=",
"None",
")",
":",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"name",
"=",
"us... | [
178,
0
] | [
223,
64
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1") | Check the RBAC functionality of SHOW DICTIONARIES.
| Check the RBAC functionality of SHOW DICTIONARIES.
| def feature(self, node="clickhouse1"):
"""Check the RBAC functionality of SHOW DICTIONARIES.
"""
self.context.node = self.context.cluster.node(node)
Suite(run=dict_privileges_granted_directly, setup=instrument_clickhouse_server_log)
Suite(run=dict_privileges_granted_via_role, setup=instrument_click... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"Suite",
"(",
"run",
"=",
"dict_privileges_granted_directly",
"... | [
232,
0
] | [
238,
87
] | python | en | ['en', 'en', 'en'] | True |
Node.output_type | (self) |
This function must resolve the output type of the expression and return
the node wrapped in the appropriate ValueExpr type.
|
This function must resolve the output type of the expression and return
the node wrapped in the appropriate ValueExpr type.
| def output_type(self):
"""
This function must resolve the output type of the expression and return
the node wrapped in the appropriate ValueExpr type.
"""
raise NotImplementedError | [
"def",
"output_type",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | [
118,
4
] | [
123,
33
] | python | en | ['en', 'error', 'th'] | False |
DistinctColumn.count | (self) | Only valid if the distinct contains a single column | Only valid if the distinct contains a single column | def count(self):
"""Only valid if the distinct contains a single column"""
return CountDistinct(self.arg) | [
"def",
"count",
"(",
"self",
")",
":",
"return",
"CountDistinct",
"(",
"self",
".",
"arg",
")"
] | [
1188,
4
] | [
1190,
38
] | python | en | ['en', 'en', 'en'] | True |
SimpleCaseBuilder.when | (self, case_expr, result_expr) |
Add a new case-result pair.
Parameters
----------
case : Expr
Expression to equality-compare with base expression. Must be
comparable with the base.
result : Expr
Value when the case predicate evaluates to true.
Returns
-------
... |
Add a new case-result pair. | def when(self, case_expr, result_expr):
"""
Add a new case-result pair.
Parameters
----------
case : Expr
Expression to equality-compare with base expression. Must be
comparable with the base.
result : Expr
Value when the case predicate eval... | [
"def",
"when",
"(",
"self",
",",
"case_expr",
",",
"result_expr",
")",
":",
"case_expr",
"=",
"ir",
".",
"as_value_expr",
"(",
"case_expr",
")",
"result_expr",
"=",
"ir",
".",
"as_value_expr",
"(",
"result_expr",
")",
"if",
"not",
"rlz",
".",
"comparable",... | [
1267,
4
] | [
1298,
54
] | python | en | ['en', 'error', 'th'] | False |
SimpleCaseBuilder.else_ | (self, result_expr) |
Specify
Returns
-------
builder : CaseBuilder
|
Specify | def else_(self, result_expr):
"""
Specify
Returns
-------
builder : CaseBuilder
"""
result_expr = ir.as_value_expr(result_expr)
# Maintain immutability
return SimpleCaseBuilder(self.base, cases=list(self.cases),
r... | [
"def",
"else_",
"(",
"self",
",",
"result_expr",
")",
":",
"result_expr",
"=",
"ir",
".",
"as_value_expr",
"(",
"result_expr",
")",
"# Maintain immutability",
"return",
"SimpleCaseBuilder",
"(",
"self",
".",
"base",
",",
"cases",
"=",
"list",
"(",
"self",
".... | [
1300,
4
] | [
1313,
53
] | python | en | ['en', 'error', 'th'] | False |
SearchedCaseBuilder.when | (self, case_expr, result_expr) |
Add a new case-result pair.
Parameters
----------
case : Expr
Expression to equality-compare with base expression. Must be
comparable with the base.
result : Expr
Value when the case predicate evaluates to true.
Returns
-------
... |
Add a new case-result pair. | def when(self, case_expr, result_expr):
"""
Add a new case-result pair.
Parameters
----------
case : Expr
Expression to equality-compare with base expression. Must be
comparable with the base.
result : Expr
Value when the case predicate eval... | [
"def",
"when",
"(",
"self",
",",
"case_expr",
",",
"result_expr",
")",
":",
"case_expr",
"=",
"ir",
".",
"as_value_expr",
"(",
"case_expr",
")",
"result_expr",
"=",
"ir",
".",
"as_value_expr",
"(",
"result_expr",
")",
"if",
"not",
"isinstance",
"(",
"case_... | [
1332,
4
] | [
1362,
56
] | python | en | ['en', 'error', 'th'] | False |
SearchedCaseBuilder.else_ | (self, result_expr) |
Specify
Returns
-------
builder : CaseBuilder
|
Specify | def else_(self, result_expr):
"""
Specify
Returns
-------
builder : CaseBuilder
"""
result_expr = ir.as_value_expr(result_expr)
# Maintain immutability
return SearchedCaseBuilder(cases=list(self.cases),
results=... | [
"def",
"else_",
"(",
"self",
",",
"result_expr",
")",
":",
"result_expr",
"=",
"ir",
".",
"as_value_expr",
"(",
"result_expr",
")",
"# Maintain immutability",
"return",
"SearchedCaseBuilder",
"(",
"cases",
"=",
"list",
"(",
"self",
".",
"cases",
")",
",",
"r... | [
1364,
4
] | [
1377,
55
] | python | en | ['en', 'error', 'th'] | False |
Comparison.__init__ | (self, left, right) |
Casting rules for type promotions (for resolving the output type) may
depend in some cases on the target backend.
TODO: how will overflows be handled? Can we provide anything useful in
Ibis to help the user avoid them?
:param left:
:param right:
|
Casting rules for type promotions (for resolving the output type) may
depend in some cases on the target backend. | def __init__(self, left, right):
"""
Casting rules for type promotions (for resolving the output type) may
depend in some cases on the target backend.
TODO: how will overflows be handled? Can we provide anything useful in
Ibis to help the user avoid them?
:param left:
... | [
"def",
"__init__",
"(",
"self",
",",
"left",
",",
"right",
")",
":",
"super",
"(",
"BinaryOp",
",",
"self",
")",
".",
"__init__",
"(",
"*",
"self",
".",
"_maybe_cast_args",
"(",
"left",
",",
"right",
")",
")"
] | [
2147,
4
] | [
2158,
75
] | python | en | ['en', 'error', 'th'] | False |
generate_test_path | (repo_root, kustomize_rpath) | Generate the full path of the test.go file for a particular package
Args:
repo_root: Root of the repository
kustomize_rpath: The relative path (relative to repo root) of the
kustomize package to generate the test for.
| Generate the full path of the test.go file for a particular package | def generate_test_path(repo_root, kustomize_rpath):
"""Generate the full path of the test.go file for a particular package
Args:
repo_root: Root of the repository
kustomize_rpath: The relative path (relative to repo root) of the
kustomize package to generate the test for.
"""
test_path = os.pat... | [
"def",
"generate_test_path",
"(",
"repo_root",
",",
"kustomize_rpath",
")",
":",
"test_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"repo_root",
",",
"\"tests\"",
",",
"kustomize_rpath",
",",
"TEST_NAME",
")",
"return",
"test_path"
] | [
30,
0
] | [
41,
18
] | python | en | ['en', 'en', 'en'] | True |
run_kustomize_build | (repo_root, package_dir) | Run kustomize build and store the output in the test directory. | Run kustomize build and store the output in the test directory. | def run_kustomize_build(repo_root, package_dir):
"""Run kustomize build and store the output in the test directory."""
rpath = os.path.relpath(package_dir, repo_root)
output_dir = os.path.join(repo_root, "tests", rpath, KUSTOMIZE_OUTPUT_DIR)
if os.path.exists(output_dir):
# Remove any previous version of... | [
"def",
"run_kustomize_build",
"(",
"repo_root",
",",
"package_dir",
")",
":",
"rpath",
"=",
"os",
".",
"path",
".",
"relpath",
"(",
"package_dir",
",",
"repo_root",
")",
"output_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"repo_root",
",",
"\"tests\"",... | [
43,
0
] | [
62,
74
] | python | en | ['en', 'en', 'en'] | True |
find_kustomize_dirs | (search_dirs) | Find all kustomization directories in search_dirs.
Args:
search_dirs: A list of directories to recursively search for
kustomization.yaml files which will be used to
1. generate expected output
2. generate tests
| Find all kustomization directories in search_dirs. | def find_kustomize_dirs(search_dirs):
"""Find all kustomization directories in search_dirs.
Args:
search_dirs: A list of directories to recursively search for
kustomization.yaml files which will be used to
1. generate expected output
2. generate tests
"""
changed_dirs = set()
for s i... | [
"def",
"find_kustomize_dirs",
"(",
"search_dirs",
")",
":",
"changed_dirs",
"=",
"set",
"(",
")",
"for",
"s",
"in",
"search_dirs",
":",
"for",
"child",
",",
"_",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"s",
")",
":",
"for",
"f",
"in",
"files",
... | [
63,
0
] | [
81,
21
] | python | en | ['en', 'en', 'en'] | True |
write_go_test | (test_path, package_name, package_dir) | Write the go test file.
Args:
test_path: Path for the go file
package_name: The name for the go package the test should live in
package_dir: The path to the kustomize package being tested; this
should be the relative path to the kustomize directory.
| Write the go test file. | def write_go_test(test_path, package_name, package_dir):
"""Write the go test file.
Args:
test_path: Path for the go file
package_name: The name for the go package the test should live in
package_dir: The path to the kustomize package being tested; this
should be the relative path to the kustomiz... | [
"def",
"write_go_test",
"(",
"test_path",
",",
"package_name",
",",
"package_dir",
")",
":",
"test_contents",
"=",
"template",
".",
"render",
"(",
"{",
"\"package\"",
":",
"package_name",
",",
"\"package_dir\"",
":",
"package_dir",
"}",
")",
"logging",
".",
"i... | [
83,
0
] | [
98,
34
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1") | Check encryption functions usage compatibility.
| Check encryption functions usage compatibility.
| def feature(self, node="clickhouse1"):
"""Check encryption functions usage compatibility.
"""
self.context.node = self.context.cluster.node(node)
Feature(run=load("aes_encryption.tests.compatibility.insert", "feature"), flags=TE)
Feature(run=load("aes_encryption.tests.compatibility.select", "featur... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"Feature",
"(",
"run",
"=",
"load",
"(",
"\"aes_encryption.te... | [
9,
0
] | [
16,
94
] | python | en | ['en', 'en', 'en'] | True |
BoostConan._python_executable | (self) |
obtain full path to the python interpreter executable
:return: path to the python interpreter executable, either set by option, or system default
|
obtain full path to the python interpreter executable
:return: path to the python interpreter executable, either set by option, or system default
| def _python_executable(self):
"""
obtain full path to the python interpreter executable
:return: path to the python interpreter executable, either set by option, or system default
"""
exe = self.options.python_executable if self.options.python_executable else sys.executable
... | [
"def",
"_python_executable",
"(",
"self",
")",
":",
"exe",
"=",
"self",
".",
"options",
".",
"python_executable",
"if",
"self",
".",
"options",
".",
"python_executable",
"else",
"sys",
".",
"executable",
"return",
"str",
"(",
"exe",
")",
".",
"replace",
"(... | [
234,
4
] | [
240,
42
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._with_dependency | (self, dependency) |
Return true when dependency is required according to the dependencies-x.y.z.yml file
|
Return true when dependency is required according to the dependencies-x.y.z.yml file
| def _with_dependency(self, dependency):
"""
Return true when dependency is required according to the dependencies-x.y.z.yml file
"""
for name, reqs in self._dependencies["requirements"].items():
if dependency in reqs:
if not self.options.get_safe("without_{}".... | [
"def",
"_with_dependency",
"(",
"self",
",",
"dependency",
")",
":",
"for",
"name",
",",
"reqs",
"in",
"self",
".",
"_dependencies",
"[",
"\"requirements\"",
"]",
".",
"items",
"(",
")",
":",
"if",
"dependency",
"in",
"reqs",
":",
"if",
"not",
"self",
... | [
449,
4
] | [
457,
20
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._run_python_script | (self, script) |
execute python one-liner script and return its output
:param script: string containing python script to be executed
:return: output of the python script execution, or None, if script has failed
|
execute python one-liner script and return its output
:param script: string containing python script to be executed
:return: output of the python script execution, or None, if script has failed
| def _run_python_script(self, script):
"""
execute python one-liner script and return its output
:param script: string containing python script to be executed
:return: output of the python script execution, or None, if script has failed
"""
output = StringIO()
comm... | [
"def",
"_run_python_script",
"(",
"self",
",",
"script",
")",
":",
"output",
"=",
"StringIO",
"(",
")",
"command",
"=",
"'\"{}\" -c \"{}\"'",
".",
"format",
"(",
"self",
".",
"_python_executable",
",",
"script",
")",
"self",
".",
"output",
".",
"info",
"("... | [
527,
4
] | [
546,
51
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._get_python_path | (self, name) |
obtain path entry for the python installation
:param name: name of the python config entry for path to be queried (such as "include", "platinclude", etc.)
:return: path entry from the sysconfig
|
obtain path entry for the python installation
:param name: name of the python config entry for path to be queried (such as "include", "platinclude", etc.)
:return: path entry from the sysconfig
| def _get_python_path(self, name):
"""
obtain path entry for the python installation
:param name: name of the python config entry for path to be queried (such as "include", "platinclude", etc.)
:return: path entry from the sysconfig
"""
# https://docs.python.org/3/library/... | [
"def",
"_get_python_path",
"(",
"self",
",",
"name",
")",
":",
"# https://docs.python.org/3/library/sysconfig.html",
"# https://docs.python.org/2.7/library/sysconfig.html",
"return",
"self",
".",
"_run_python_script",
"(",
"\"from __future__ import print_function; \"",
"\"import sysc... | [
548,
4
] | [
558,
86
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._get_python_sc_var | (self, name) |
obtain value of python sysconfig variable
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of python sysconfig variable
|
obtain value of python sysconfig variable
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of python sysconfig variable
| def _get_python_sc_var(self, name):
"""
obtain value of python sysconfig variable
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of python sysconfig variable
"""
return self._run_python_script("from __future__ import print_functi... | [
"def",
"_get_python_sc_var",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"_run_python_script",
"(",
"\"from __future__ import print_function; \"",
"\"import sysconfig; \"",
"\"print(sysconfig.get_config_var('{}'))\"",
".",
"format",
"(",
"name",
")",
")"
] | [
560,
4
] | [
568,
92
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._get_python_du_var | (self, name) |
obtain value of python distutils sysconfig variable
(sometimes sysconfig returns empty values, while python.sysconfig provides correct values)
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of python sysconfig variable
|
obtain value of python distutils sysconfig variable
(sometimes sysconfig returns empty values, while python.sysconfig provides correct values)
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of python sysconfig variable
| def _get_python_du_var(self, name):
"""
obtain value of python distutils sysconfig variable
(sometimes sysconfig returns empty values, while python.sysconfig provides correct values)
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of pyth... | [
"def",
"_get_python_du_var",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"_run_python_script",
"(",
"\"from __future__ import print_function; \"",
"\"import distutils.sysconfig as du_sysconfig; \"",
"\"print(du_sysconfig.get_config_var('{}'))\"",
".",
"format",
"("... | [
570,
4
] | [
579,
95
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._get_python_var | (self, name) |
obtain value of python variable, either by sysconfig, or by distutils.sysconfig
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of python sysconfig variable
|
obtain value of python variable, either by sysconfig, or by distutils.sysconfig
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of python sysconfig variable
| def _get_python_var(self, name):
"""
obtain value of python variable, either by sysconfig, or by distutils.sysconfig
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of python sysconfig variable
"""
return self._get_python_sc_var(n... | [
"def",
"_get_python_var",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"_get_python_sc_var",
"(",
"name",
")",
"or",
"self",
".",
"_get_python_du_var",
"(",
"name",
")"
] | [
581,
4
] | [
587,
77
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._detect_python_version | (self) |
obtain version of python interpreter
:return: python interpreter version, in format major.minor
|
obtain version of python interpreter
:return: python interpreter version, in format major.minor
| def _detect_python_version(self):
"""
obtain version of python interpreter
:return: python interpreter version, in format major.minor
"""
return self._run_python_script("from __future__ import print_function; "
"import sys; "
... | [
"def",
"_detect_python_version",
"(",
"self",
")",
":",
"return",
"self",
".",
"_run_python_script",
"(",
"\"from __future__ import print_function; \"",
"\"import sys; \"",
"\"print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))\"",
")"
] | [
589,
4
] | [
596,
105
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._python_inc | (self) |
obtain the result of the "sysconfig.get_python_inc()" call
:return: result of the "sysconfig.get_python_inc()" execution
|
obtain the result of the "sysconfig.get_python_inc()" call
:return: result of the "sysconfig.get_python_inc()" execution
| def _python_inc(self):
"""
obtain the result of the "sysconfig.get_python_inc()" call
:return: result of the "sysconfig.get_python_inc()" execution
"""
return self._run_python_script("from __future__ import print_function; "
"import sysconfi... | [
"def",
"_python_inc",
"(",
"self",
")",
":",
"return",
"self",
".",
"_run_python_script",
"(",
"\"from __future__ import print_function; \"",
"\"import sysconfig; \"",
"\"print(sysconfig.get_python_inc())\"",
")"
] | [
608,
4
] | [
615,
75
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._python_abiflags | (self) |
obtain python ABI flags, see https://www.python.org/dev/peps/pep-3149/ for the details
:return: the value of python ABI flags
|
obtain python ABI flags, see https://www.python.org/dev/peps/pep-3149/ for the details
:return: the value of python ABI flags
| def _python_abiflags(self):
"""
obtain python ABI flags, see https://www.python.org/dev/peps/pep-3149/ for the details
:return: the value of python ABI flags
"""
return self._run_python_script("from __future__ import print_function; "
"impor... | [
"def",
"_python_abiflags",
"(",
"self",
")",
":",
"return",
"self",
".",
"_run_python_script",
"(",
"\"from __future__ import print_function; \"",
"\"import sys; \"",
"\"print(getattr(sys, 'abiflags', ''))\"",
")"
] | [
618,
4
] | [
625,
77
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._python_includes | (self) |
attempt to find directory containing Python.h header file
:return: the directory with python includes
|
attempt to find directory containing Python.h header file
:return: the directory with python includes
| def _python_includes(self):
"""
attempt to find directory containing Python.h header file
:return: the directory with python includes
"""
include = self._get_python_path("include")
plat_include = self._get_python_path("platinclude")
include_py = self._get_python_v... | [
"def",
"_python_includes",
"(",
"self",
")",
":",
"include",
"=",
"self",
".",
"_get_python_path",
"(",
"\"include\"",
")",
"plat_include",
"=",
"self",
".",
"_get_python_path",
"(",
"\"platinclude\"",
")",
"include_py",
"=",
"self",
".",
"_get_python_var",
"(",... | [
628,
4
] | [
651,
107
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._python_libraries | (self) |
attempt to find python development library
:return: the full path to the python library to be linked with
|
attempt to find python development library
:return: the full path to the python library to be linked with
| def _python_libraries(self):
"""
attempt to find python development library
:return: the full path to the python library to be linked with
"""
library = self._get_python_var("LIBRARY")
ldlibrary = self._get_python_var("LDLIBRARY")
libdir = self._get_python_var("LI... | [
"def",
"_python_libraries",
"(",
"self",
")",
":",
"library",
"=",
"self",
".",
"_get_python_var",
"(",
"\"LIBRARY\"",
")",
"ldlibrary",
"=",
"self",
".",
"_get_python_var",
"(",
"\"LDLIBRARY\"",
")",
"libdir",
"=",
"self",
".",
"_get_python_var",
"(",
"\"LIBD... | [
654,
4
] | [
697,
131
] | python | en | ['en', 'error', 'th'] | False |
BoostConan._gnu_cxx11_abi | (self) | Checks libcxx setting and returns value for the GNU C++11 ABI flag
_GLIBCXX_USE_CXX11_ABI= . Returns None if C++ library cannot be
determined.
| Checks libcxx setting and returns value for the GNU C++11 ABI flag
_GLIBCXX_USE_CXX11_ABI= . Returns None if C++ library cannot be
determined.
| def _gnu_cxx11_abi(self):
"""Checks libcxx setting and returns value for the GNU C++11 ABI flag
_GLIBCXX_USE_CXX11_ABI= . Returns None if C++ library cannot be
determined.
"""
try:
if str(self.settings.compiler.libcxx) == "libstdc++":
return "0"
... | [
"def",
"_gnu_cxx11_abi",
"(",
"self",
")",
":",
"try",
":",
"if",
"str",
"(",
"self",
".",
"settings",
".",
"compiler",
".",
"libcxx",
")",
"==",
"\"libstdc++\"",
":",
"return",
"\"0\"",
"elif",
"str",
"(",
"self",
".",
"settings",
".",
"compiler",
"."... | [
900,
4
] | [
912,
19
] | python | en | ['en', 'no', 'en'] | True |
BoostConan._create_user_config_jam | (self, folder) | To help locating the zlib and bzip2 deps | To help locating the zlib and bzip2 deps | def _create_user_config_jam(self, folder):
"""To help locating the zlib and bzip2 deps"""
self.output.warn("Patching user-config.jam")
contents = ""
if self._zip_bzip2_requires_needed:
def create_library_config(deps_name, name):
includedir = '"%s"' % self.dep... | [
"def",
"_create_user_config_jam",
"(",
"self",
",",
"folder",
")",
":",
"self",
".",
"output",
".",
"warn",
"(",
"\"Patching user-config.jam\"",
")",
"contents",
"=",
"\"\"",
"if",
"self",
".",
"_zip_bzip2_requires_needed",
":",
"def",
"create_library_config",
"("... | [
1149,
4
] | [
1235,
39
] | python | en | ['en', 'en', 'en'] | True |
retry_exception | (num, delay, func, exception=Exception, *args, **kwargs) |
Retry if `func()` throws, `num` times.
:param func: func to run
:param num: number of retries
:throws StopIteration
|
Retry if `func()` throws, `num` times. | def retry_exception(num, delay, func, exception=Exception, *args, **kwargs):
"""
Retry if `func()` throws, `num` times.
:param func: func to run
:param num: number of retries
:throws StopIteration
"""
i = 0
while i <= num:
try:
func(*args, **kwargs)
time... | [
"def",
"retry_exception",
"(",
"num",
",",
"delay",
",",
"func",
",",
"exception",
"=",
"Exception",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"i",
"=",
"0",
"while",
"i",
"<=",
"num",
":",
"try",
":",
"func",
"(",
"*",
"args",
",",
... | [
85,
0
] | [
103,
65
] | python | en | ['en', 'error', 'th'] | False |
ClickHouseCluster.add_instance | (self, name, base_config_dir=None, main_configs=None, user_configs=None, dictionaries=None,
macros=None, with_zookeeper=False, with_zookeeper_secure=False,
with_mysql_client=False, with_mysql=False, with_mysql8=False, with_mysql_cluster=False,
with_kafka=Fa... | Add an instance to the cluster.
name - the name of the instance directory and the value of the 'instance' macro in ClickHouse.
base_config_dir - a directory with config.xml and users.xml files which will be copied to /etc/clickhouse-server/ directory
main_configs - a list of config files that w... | Add an instance to the cluster. | def add_instance(self, name, base_config_dir=None, main_configs=None, user_configs=None, dictionaries=None,
macros=None, with_zookeeper=False, with_zookeeper_secure=False,
with_mysql_client=False, with_mysql=False, with_mysql8=False, with_mysql_cluster=False,
... | [
"def",
"add_instance",
"(",
"self",
",",
"name",
",",
"base_config_dir",
"=",
"None",
",",
"main_configs",
"=",
"None",
",",
"user_configs",
"=",
"None",
",",
"dictionaries",
"=",
"None",
",",
"macros",
"=",
"None",
",",
"with_zookeeper",
"=",
"False",
","... | [
701,
4
] | [
870,
23
] | python | en | ['en', 'en', 'en'] | True |
DukeEnergyGatewayFlowHandler.__init__ | (self) | Initialize. | Initialize. | def __init__(self):
"""Initialize."""
self._errors = {} | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_errors",
"=",
"{",
"}"
] | [
20,
4
] | [
22,
25
] | python | en | ['en', 'en', 'it'] | False |
DukeEnergyGatewayFlowHandler.async_step_user | (self, user_input=None) | Handle a flow initialized by the user. | Handle a flow initialized by the user. | async def async_step_user(self, user_input=None):
"""Handle a flow initialized by the user."""
self._errors = {}
# Uncomment the next 2 lines if only a single instance of the integration is allowed:
if self._async_current_entries():
return self.async_abort(reason="single_ins... | [
"async",
"def",
"async_step_user",
"(",
"self",
",",
"user_input",
"=",
"None",
")",
":",
"self",
".",
"_errors",
"=",
"{",
"}",
"# Uncomment the next 2 lines if only a single instance of the integration is allowed:",
"if",
"self",
".",
"_async_current_entries",
"(",
")... | [
24,
4
] | [
45,
55
] | python | en | ['en', 'en', 'en'] | True |
DukeEnergyGatewayFlowHandler._show_config_form | (self, user_input) | Show the configuration form to edit location data. | Show the configuration form to edit location data. | async def _show_config_form(self, user_input): # pylint: disable=unused-argument
"""Show the configuration form to edit location data."""
return self.async_show_form(
step_id="user",
data_schema=vol.Schema(
{vol.Required(CONF_EMAIL): str, vol.Required(CONF_PASSWO... | [
"async",
"def",
"_show_config_form",
"(",
"self",
",",
"user_input",
")",
":",
"# pylint: disable=unused-argument",
"return",
"self",
".",
"async_show_form",
"(",
"step_id",
"=",
"\"user\"",
",",
"data_schema",
"=",
"vol",
".",
"Schema",
"(",
"{",
"vol",
".",
... | [
52,
4
] | [
60,
9
] | python | en | ['en', 'en', 'en'] | True |
DukeEnergyGatewayFlowHandler._test_credentials | (self, email, password) | Return true if credentials is valid. | Return true if credentials is valid. | async def _test_credentials(self, email, password):
"""Return true if credentials is valid."""
try:
session = async_create_clientsession(self.hass)
client = DukeEnergyClient(email, password, session)
account_list = await client.get_account_list()
return ac... | [
"async",
"def",
"_test_credentials",
"(",
"self",
",",
"email",
",",
"password",
")",
":",
"try",
":",
"session",
"=",
"async_create_clientsession",
"(",
"self",
".",
"hass",
")",
"client",
"=",
"DukeEnergyClient",
"(",
"email",
",",
"password",
",",
"sessio... | [
62,
4
] | [
71,
20
] | python | en | ['en', 'en', 'en'] | True |
DukeEnergyGatewayOptionsFlowHandler.__init__ | (self, config_entry) | Initialize HACS options flow. | Initialize HACS options flow. | def __init__(self, config_entry):
"""Initialize HACS options flow."""
self.config_entry = config_entry
self.options = dict(config_entry.options) | [
"def",
"__init__",
"(",
"self",
",",
"config_entry",
")",
":",
"self",
".",
"config_entry",
"=",
"config_entry",
"self",
".",
"options",
"=",
"dict",
"(",
"config_entry",
".",
"options",
")"
] | [
77,
4
] | [
80,
49
] | python | en | ['en', 'fr', 'en'] | True |
DukeEnergyGatewayOptionsFlowHandler.async_step_init | (self, user_input=None) | Manage the options. | Manage the options. | async def async_step_init(self, user_input=None): # pylint: disable=unused-argument
"""Manage the options."""
return await self.async_step_user() | [
"async",
"def",
"async_step_init",
"(",
"self",
",",
"user_input",
"=",
"None",
")",
":",
"# pylint: disable=unused-argument",
"return",
"await",
"self",
".",
"async_step_user",
"(",
")"
] | [
82,
4
] | [
84,
43
] | python | en | ['en', 'en', 'en'] | True |
DukeEnergyGatewayOptionsFlowHandler.async_step_user | (self, user_input=None) | Handle a flow initialized by the user. | Handle a flow initialized by the user. | async def async_step_user(self, user_input=None):
"""Handle a flow initialized by the user."""
if user_input is not None:
self.options.update(user_input)
return await self._update_options()
realtime_interval = self.options.get(
CONF_REALTIME_INTERVAL, CONF_RE... | [
"async",
"def",
"async_step_user",
"(",
"self",
",",
"user_input",
"=",
"None",
")",
":",
"if",
"user_input",
"is",
"not",
"None",
":",
"self",
".",
"options",
".",
"update",
"(",
"user_input",
")",
"return",
"await",
"self",
".",
"_update_options",
"(",
... | [
86,
4
] | [
106,
9
] | python | en | ['en', 'en', 'en'] | True |
DukeEnergyGatewayOptionsFlowHandler._update_options | (self) | Update config entry options. | Update config entry options. | async def _update_options(self):
"""Update config entry options."""
update_interval = self.options.get(
CONF_REALTIME_INTERVAL, CONF_REALTIME_INTERVAL_DEFAULT_SEC
)
if update_interval < 0:
return self.async_abort(reason="invalid_update_interval_value")
ret... | [
"async",
"def",
"_update_options",
"(",
"self",
")",
":",
"update_interval",
"=",
"self",
".",
"options",
".",
"get",
"(",
"CONF_REALTIME_INTERVAL",
",",
"CONF_REALTIME_INTERVAL_DEFAULT_SEC",
")",
"if",
"update_interval",
"<",
"0",
":",
"return",
"self",
".",
"a... | [
108,
4
] | [
117,
9
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1") | Check show quotas query syntax.
```sql
SHOW QUOTAS
```
| Check show quotas query syntax. | def feature(self, node="clickhouse1"):
"""Check show quotas query syntax.
```sql
SHOW QUOTAS
```
"""
node = self.context.cluster.node(node)
@contextmanager
def cleanup(quota):
try:
with Given("I have a quota"):
node.query(f"CREATE QUOTA OR REPLACE {q... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"@",
"contextmanager",
"def",
"cleanup",
"(",
"quota",
")",
":",
"try",
":",
"with",
"Gi... | [
8,
0
] | [
49,
69
] | python | en | ['es', 'gl', 'en'] | False |
select_map | (self, map, output, exitcode=0, message=None) | Create a map using select statement.
| Create a map using select statement.
| def select_map(self, map, output, exitcode=0, message=None):
"""Create a map using select statement.
"""
node = self.context.node
with When("I create a map using select", description=map):
r = node.query(f"SELECT {map}", exitcode=exitcode, message=message)
with Then("I expect output to mat... | [
"def",
"select_map",
"(",
"self",
",",
"map",
",",
"output",
",",
"exitcode",
"=",
"0",
",",
"message",
"=",
"None",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"When",
"(",
"\"I create a map using select\"",
",",
"description",
"... | [
10,
0
] | [
19,
42
] | python | en | ['en', 'en', 'en'] | True |
table_map | (self, type, data, select, filter, exitcode, message, check_insert=False, order_by=None) | Check using a map column in a table.
| Check using a map column in a table.
| def table_map(self, type, data, select, filter, exitcode, message, check_insert=False, order_by=None):
"""Check using a map column in a table.
"""
uid = getuid()
node = self.context.node
if order_by is None:
order_by = "m"
with Given(f"table definition with {type}"):
sql = "CRE... | [
"def",
"table_map",
"(",
"self",
",",
"type",
",",
"data",
",",
"select",
",",
"filter",
",",
"exitcode",
",",
"message",
",",
"check_insert",
"=",
"False",
",",
"order_by",
"=",
"None",
")",
":",
"uid",
"=",
"getuid",
"(",
")",
"node",
"=",
"self",
... | [
22,
0
] | [
45,
125
] | python | en | ['en', 'en', 'en'] | True |
select_map_with_key_string | (self, map, output) | Create a map using select that has key string type.
| Create a map using select that has key string type.
| def select_map_with_key_string(self, map, output):
"""Create a map using select that has key string type.
"""
select_map(map=map, output=output) | [
"def",
"select_map_with_key_string",
"(",
"self",
",",
"map",
",",
"output",
")",
":",
"select_map",
"(",
"map",
"=",
"map",
",",
"output",
"=",
"output",
")"
] | [
64,
0
] | [
67,
38
] | python | en | ['en', 'en', 'en'] | True |
select_map_with_value_string | (self, map, output) | Create a map using select that has value string type.
| Create a map using select that has value string type.
| def select_map_with_value_string(self, map, output):
"""Create a map using select that has value string type.
"""
select_map(map=map, output=output) | [
"def",
"select_map_with_value_string",
"(",
"self",
",",
"map",
",",
"output",
")",
":",
"select_map",
"(",
"map",
"=",
"map",
",",
"output",
"=",
"output",
")"
] | [
86,
0
] | [
89,
38
] | python | en | ['en', 'en', 'en'] | True |
select_map_with_value_array | (self, map, output) | Create a map using select that has value array type.
| Create a map using select that has value array type.
| def select_map_with_value_array(self, map, output):
"""Create a map using select that has value array type.
"""
select_map(map=map, output=output) | [
"def",
"select_map_with_value_array",
"(",
"self",
",",
"map",
",",
"output",
")",
":",
"select_map",
"(",
"map",
"=",
"map",
",",
"output",
"=",
"output",
")"
] | [
102,
0
] | [
105,
38
] | python | en | ['en', 'en', 'en'] | True |
select_map_with_value_integer | (self, map, output) | Create a map using select that has value integer type.
| Create a map using select that has value integer type.
| def select_map_with_value_integer(self, map, output):
"""Create a map using select that has value integer type.
"""
select_map(map=map, output=output) | [
"def",
"select_map_with_value_integer",
"(",
"self",
",",
"map",
",",
"output",
")",
":",
"select_map",
"(",
"map",
"=",
"map",
",",
"output",
"=",
"output",
")"
] | [
126,
0
] | [
129,
38
] | python | en | ['en', 'en', 'en'] | True |
select_map_with_key_integer | (self, map, output) | Create a map using select that has key integer type.
| Create a map using select that has key integer type.
| def select_map_with_key_integer(self, map, output):
"""Create a map using select that has key integer type.
"""
select_map(map=map, output=output) | [
"def",
"select_map_with_key_integer",
"(",
"self",
",",
"map",
",",
"output",
")",
":",
"select_map",
"(",
"map",
"=",
"map",
",",
"output",
"=",
"output",
")"
] | [
150,
0
] | [
153,
38
] | python | en | ['en', 'en', 'en'] | True |
table_map_with_key_string | (self, type, data, output) | Check what values we can insert into map type column with key string.
| Check what values we can insert into map type column with key string.
| def table_map_with_key_string(self, type, data, output):
"""Check what values we can insert into map type column with key string.
"""
insert_into_table(type=type, data=data, output=output) | [
"def",
"table_map_with_key_string",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
")"
] | [
174,
0
] | [
177,
58
] | python | en | ['en', 'en', 'en'] | True |
table_map_select_key_with_key_string | (self, type, data, output, select) | Check what values we can insert into map type column with key string and if key can be selected.
| Check what values we can insert into map type column with key string and if key can be selected.
| def table_map_select_key_with_key_string(self, type, data, output, select):
"""Check what values we can insert into map type column with key string and if key can be selected.
"""
insert_into_table(type=type, data=data, output=output, select=select) | [
"def",
"table_map_select_key_with_key_string",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
",",
"select",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
",",
"select",
"=",
"select... | [
198,
0
] | [
201,
73
] | python | en | ['en', 'en', 'en'] | True |
table_map_with_value_string | (self, type, data, output) | Check what values we can insert into map type column with value string.
| Check what values we can insert into map type column with value string.
| def table_map_with_value_string(self, type, data, output):
"""Check what values we can insert into map type column with value string.
"""
insert_into_table(type=type, data=data, output=output) | [
"def",
"table_map_with_value_string",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
")"
] | [
222,
0
] | [
225,
58
] | python | en | ['en', 'en', 'en'] | True |
table_map_select_key_with_value_string | (self, type, data, output) | Check what values we can insert into map type column with value string and if it can be selected by key.
| Check what values we can insert into map type column with value string and if it can be selected by key.
| def table_map_select_key_with_value_string(self, type, data, output):
"""Check what values we can insert into map type column with value string and if it can be selected by key.
"""
insert_into_table(type=type, data=data, output=output, select="m['key'] AS m") | [
"def",
"table_map_select_key_with_value_string",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
",",
"select",
"=",
"\"m['key'] AS m\"",
"... | [
246,
0
] | [
249,
82
] | python | en | ['en', 'en', 'en'] | True |
table_map_with_value_integer | (self, type, data, output) | Check what values we can insert into map type column with value integer.
| Check what values we can insert into map type column with value integer.
| def table_map_with_value_integer(self, type, data, output):
"""Check what values we can insert into map type column with value integer.
"""
insert_into_table(type=type, data=data, output=output) | [
"def",
"table_map_with_value_integer",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
")"
] | [
270,
0
] | [
273,
58
] | python | en | ['en', 'en', 'en'] | True |
table_map_with_value_array | (self, type, data, output) | Check what values we can insert into map type column with value Array.
| Check what values we can insert into map type column with value Array.
| def table_map_with_value_array(self, type, data, output):
"""Check what values we can insert into map type column with value Array.
"""
insert_into_table(type=type, data=data, output=output) | [
"def",
"table_map_with_value_array",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
")"
] | [
286,
0
] | [
289,
58
] | python | en | ['en', 'en', 'en'] | True |
table_map_with_key_integer | (self, type, data, output) | Check what values we can insert into map type column with key integer.
| Check what values we can insert into map type column with key integer.
| def table_map_with_key_integer(self, type, data, output):
"""Check what values we can insert into map type column with key integer.
"""
insert_into_table(type=type, data=data, output=output) | [
"def",
"table_map_with_key_integer",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
")"
] | [
310,
0
] | [
313,
58
] | python | en | ['en', 'en', 'en'] | True |
table_map_select_key_with_key_integer | (self, type, data, output, select) | Check what values we can insert into map type column with key integer and if we can use the key to select the value.
| Check what values we can insert into map type column with key integer and if we can use the key to select the value.
| def table_map_select_key_with_key_integer(self, type, data, output, select):
"""Check what values we can insert into map type column with key integer and if we can use the key to select the value.
"""
insert_into_table(type=type, data=data, output=output, select=select) | [
"def",
"table_map_select_key_with_key_integer",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
",",
"select",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
",",
"select",
"=",
"selec... | [
334,
0
] | [
337,
73
] | python | en | ['en', 'en', 'en'] | True |
table_with_map_inside_another_type | (self, type, data, output, partition_by) | Check what values we can insert into a type that has map type.
| Check what values we can insert into a type that has map type.
| def table_with_map_inside_another_type(self, type, data, output, partition_by):
"""Check what values we can insert into a type that has map type.
"""
insert_into_table(type=type, data=data, output=output, partition_by=partition_by) | [
"def",
"table_with_map_inside_another_type",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
",",
"partition_by",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
",",
"partition_by",
"=",... | [
356,
0
] | [
359,
85
] | python | en | ['en', 'en', 'en'] | True |
insert_into_table | (self, type, data, output, partition_by="m", select="*") | Check we can insert data into a table.
| Check we can insert data into a table.
| def insert_into_table(self, type, data, output, partition_by="m", select="*"):
"""Check we can insert data into a table.
"""
uid = getuid()
node = self.context.node
with Given(f"table definition with {type}"):
sql = "CREATE TABLE {name} (d DATE, m " + type + ") ENGINE = MergeTree() PARTITIO... | [
"def",
"insert_into_table",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
",",
"partition_by",
"=",
"\"m\"",
",",
"select",
"=",
"\"*\"",
")",
":",
"uid",
"=",
"getuid",
"(",
")",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"Giv... | [
362,
0
] | [
382,
42
] | python | en | ['en', 'en', 'en'] | True |
select_map_with_invalid_mixed_key_and_value_types | (self) | Check that creating a map with mixed key types fails.
| Check that creating a map with mixed key types fails.
| def select_map_with_invalid_mixed_key_and_value_types(self):
"""Check that creating a map with mixed key types fails.
"""
node = self.context.node
exitcode = 130
message = "DB::Exception: There is no supertype for types String, UInt8 because some of them are String/FixedString and some of them are n... | [
"def",
"select_map_with_invalid_mixed_key_and_value_types",
"(",
"self",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"exitcode",
"=",
"130",
"message",
"=",
"\"DB::Exception: There is no supertype for types String, UInt8 because some of them are String/FixedString... | [
388,
0
] | [
399,
83
] | python | en | ['en', 'en', 'en'] | True |
select_map_with_invalid_number_of_arguments | (self) | Check that creating a map with invalid number of arguments fails.
| Check that creating a map with invalid number of arguments fails.
| def select_map_with_invalid_number_of_arguments(self):
"""Check that creating a map with invalid number of arguments fails.
"""
node = self.context.node
exitcode = 42
message = "DB::Exception: Function map requires even number of arguments"
with When("I create a map using SELECT with invalid nu... | [
"def",
"select_map_with_invalid_number_of_arguments",
"(",
"self",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"exitcode",
"=",
"42",
"message",
"=",
"\"DB::Exception: Function map requires even number of arguments\"",
"with",
"When",
"(",
"\"I create a ma... | [
405,
0
] | [
413,
75
] | python | en | ['en', 'en', 'en'] | True |
select_map_empty | (self) | Check that we can can create a empty map by not passing any arguments.
| Check that we can can create a empty map by not passing any arguments.
| def select_map_empty(self):
"""Check that we can can create a empty map by not passing any arguments.
"""
node = self.context.node
with When("I create a map using SELECT with no arguments"):
r = node.query("SELECT map()")
with Then("it should create an empty map"):
assert r.output ... | [
"def",
"select_map_empty",
"(",
"self",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"When",
"(",
"\"I create a map using SELECT with no arguments\"",
")",
":",
"r",
"=",
"node",
".",
"query",
"(",
"\"SELECT map()\"",
")",
"with",
"Then"... | [
416,
0
] | [
425,
40
] | python | en | ['en', 'en', 'en'] | True |
insert_invalid_mixed_key_and_value_types | (self) | Check that inserting a map with mixed key or value types fails.
| Check that inserting a map with mixed key or value types fails.
| def insert_invalid_mixed_key_and_value_types(self):
"""Check that inserting a map with mixed key or value types fails.
"""
uid = getuid()
node = self.context.node
exitcode = 130
message = "DB::Exception: There is no supertype for types String, UInt8 because some of them are String/FixedString an... | [
"def",
"insert_invalid_mixed_key_and_value_types",
"(",
"self",
")",
":",
"uid",
"=",
"getuid",
"(",
")",
"node",
"=",
"self",
".",
"context",
".",
"node",
"exitcode",
"=",
"130",
"message",
"=",
"\"DB::Exception: There is no supertype for types String, UInt8 because so... | [
428,
0
] | [
448,
59
] | python | en | ['en', 'en', 'en'] | True |
table_map_with_duplicated_keys | (self, type, data, output) | Check that map supports duplicated keys.
| Check that map supports duplicated keys.
| def table_map_with_duplicated_keys(self, type, data, output):
"""Check that map supports duplicated keys.
"""
insert_into_table(type=type, data=data, output=output) | [
"def",
"table_map_with_duplicated_keys",
"(",
"self",
",",
"type",
",",
"data",
",",
"output",
")",
":",
"insert_into_table",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"output",
"=",
"output",
")"
] | [
464,
0
] | [
467,
58
] | python | en | ['en', 'en', 'en'] | True |
select_map_with_duplicated_keys | (self, map, output) | Check creating a map with duplicated keys.
| Check creating a map with duplicated keys.
| def select_map_with_duplicated_keys(self, map, output):
"""Check creating a map with duplicated keys.
"""
select_map(map=map, output=output) | [
"def",
"select_map_with_duplicated_keys",
"(",
"self",
",",
"map",
",",
"output",
")",
":",
"select_map",
"(",
"map",
"=",
"map",
",",
"output",
"=",
"output",
")"
] | [
477,
0
] | [
480,
38
] | python | en | ['en', 'en', 'en'] | True |
table_map_key_not_found | (self, type, data, select, exitcode, message, order_by=None) | Check values returned from a map column when key is not found.
| Check values returned from a map column when key is not found.
| def table_map_key_not_found(self, type, data, select, exitcode, message, order_by=None):
"""Check values returned from a map column when key is not found.
"""
uid = getuid()
node = self.context.node
if order_by is None:
order_by = "m"
with Given(f"table definition with {type}"):
... | [
"def",
"table_map_key_not_found",
"(",
"self",
",",
"type",
",",
"data",
",",
"select",
",",
"exitcode",
",",
"message",
",",
"order_by",
"=",
"None",
")",
":",
"uid",
"=",
"getuid",
"(",
")",
"node",
"=",
"self",
".",
"context",
".",
"node",
"if",
"... | [
517,
0
] | [
536,
106
] | python | en | ['en', 'en', 'en'] | True |
invalid_key | (self) | Check when key is not valid.
| Check when key is not valid.
| def invalid_key(self):
"""Check when key is not valid.
"""
node = self.context.node
with When("I try to use an integer key that is too large"):
node.query("SELECT map(1,2) AS m, m[256]", exitcode=43, message="DB::Exception: Illegal types of arguments")
with When("I try to use an integer ke... | [
"def",
"invalid_key",
"(",
"self",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"When",
"(",
"\"I try to use an integer key that is too large\"",
")",
":",
"node",
".",
"query",
"(",
"\"SELECT map(1,2) AS m, m[256]\"",
",",
"exitcode",
"=",
... | [
542,
0
] | [
571,
50
] | python | en | ['en', 'en', 'en'] | True |
table_map_invalid_key | (self, type, data, select, exitcode, message, order_by="m") | Check selecting values from a map column using an invalid key.
| Check selecting values from a map column using an invalid key.
| def table_map_invalid_key(self, type, data, select, exitcode, message, order_by="m"):
"""Check selecting values from a map column using an invalid key.
"""
uid = getuid()
node = self.context.node
with Given(f"table definition with {type}"):
sql = "CREATE TABLE {name} (m " + type + ") ENGINE... | [
"def",
"table_map_invalid_key",
"(",
"self",
",",
"type",
",",
"data",
",",
"select",
",",
"exitcode",
",",
"message",
",",
"order_by",
"=",
"\"m\"",
")",
":",
"uid",
"=",
"getuid",
"(",
")",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
... | [
589,
0
] | [
605,
106
] | python | en | ['en', 'en', 'en'] | True |
table_map_queries | (self, type, data, select, filter, exitcode, message, order_by=None) | Check retrieving map values and using maps in queries.
| Check retrieving map values and using maps in queries.
| def table_map_queries(self, type, data, select, filter, exitcode, message, order_by=None):
"""Check retrieving map values and using maps in queries.
"""
uid = getuid()
node = self.context.node
if order_by is None:
order_by = "m"
with Given(f"table definition with {type}"):
sql ... | [
"def",
"table_map_queries",
"(",
"self",
",",
"type",
",",
"data",
",",
"select",
",",
"filter",
",",
"exitcode",
",",
"message",
",",
"order_by",
"=",
"None",
")",
":",
"uid",
"=",
"getuid",
"(",
")",
"node",
"=",
"self",
".",
"context",
".",
"node"... | [
631,
0
] | [
650,
121
] | python | en | ['en', 'en', 'en'] | True |
table_map_unsupported_types | (self, type, exitcode, message) | Check creating a table with unsupported map column types.
| Check creating a table with unsupported map column types.
| def table_map_unsupported_types(self, type, exitcode, message):
"""Check creating a table with unsupported map column types.
"""
uid = getuid()
node = self.context.node
try:
with When(f"I create a table definition with {type}"):
sql = f"CREATE TABLE {uid} (m " + type + ") ENGINE... | [
"def",
"table_map_unsupported_types",
"(",
"self",
",",
"type",
",",
"exitcode",
",",
"message",
")",
":",
"uid",
"=",
"getuid",
"(",
")",
"node",
"=",
"self",
".",
"context",
".",
"node",
"try",
":",
"with",
"When",
"(",
"f\"I create a table definition with... | [
665,
0
] | [
677,
53
] | python | en | ['en', 'en', 'en'] | True |
cast_tuple_of_two_arrays_to_map | (self, tuple, type, exitcode, message) | Check casting Tuple(Array, Array) to a map type.
| Check casting Tuple(Array, Array) to a map type.
| def cast_tuple_of_two_arrays_to_map(self, tuple, type, exitcode, message):
"""Check casting Tuple(Array, Array) to a map type.
"""
node = self.context.node
with When("I try to cast tuple", description=tuple):
node.query(f"SELECT CAST({tuple}, '{type}') AS map", exitcode=exitcode, message=messag... | [
"def",
"cast_tuple_of_two_arrays_to_map",
"(",
"self",
",",
"tuple",
",",
"type",
",",
"exitcode",
",",
"message",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"When",
"(",
"\"I try to cast tuple\"",
",",
"description",
"=",
"tuple",
"... | [
703,
0
] | [
709,
96
] | python | en | ['en', 'en', 'en'] | True |
table_map_cast_tuple_of_arrays_to_map | (self, tuple, type, exitcode, message, check_insert) | Check converting Tuple(Array, Array) into map on insert into a map type column.
| Check converting Tuple(Array, Array) into map on insert into a map type column.
| def table_map_cast_tuple_of_arrays_to_map(self, tuple, type, exitcode, message, check_insert):
"""Check converting Tuple(Array, Array) into map on insert into a map type column.
"""
table_map(type=type, data=tuple, select="*", filter="1=1", exitcode=exitcode, message=message, check_insert=check_insert) | [
"def",
"table_map_cast_tuple_of_arrays_to_map",
"(",
"self",
",",
"tuple",
",",
"type",
",",
"exitcode",
",",
"message",
",",
"check_insert",
")",
":",
"table_map",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"tuple",
",",
"select",
"=",
"\"*\"",
",",
"fil... | [
735,
0
] | [
738,
125
] | python | en | ['it', 'en', 'en'] | True |
cast_array_of_two_tuples_to_map | (self, tuple, type, exitcode, message) | Check casting Array(Tuple(K,V)) to a map type.
| Check casting Array(Tuple(K,V)) to a map type.
| def cast_array_of_two_tuples_to_map(self, tuple, type, exitcode, message):
"""Check casting Array(Tuple(K,V)) to a map type.
"""
node = self.context.node
with When("I try to cast tuple", description=tuple):
node.query(f"SELECT CAST({tuple}, '{type}') AS map", exitcode=exitcode, message=message) | [
"def",
"cast_array_of_two_tuples_to_map",
"(",
"self",
",",
"tuple",
",",
"type",
",",
"exitcode",
",",
"message",
")",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"When",
"(",
"\"I try to cast tuple\"",
",",
"description",
"=",
"tuple",
"... | [
755,
0
] | [
761,
96
] | python | en | ['en', 'en', 'en'] | True |
table_map_cast_array_of_two_tuples_to_map | (self, tuple, type, exitcode, message, check_insert) | Check converting Array(Tuple(K,V),...) into map on insert into a map type column.
| Check converting Array(Tuple(K,V),...) into map on insert into a map type column.
| def table_map_cast_array_of_two_tuples_to_map(self, tuple, type, exitcode, message, check_insert):
"""Check converting Array(Tuple(K,V),...) into map on insert into a map type column.
"""
table_map(type=type, data=tuple, select="*", filter="1=1", exitcode=exitcode, message=message, check_insert=check_insert... | [
"def",
"table_map_cast_array_of_two_tuples_to_map",
"(",
"self",
",",
"tuple",
",",
"type",
",",
"exitcode",
",",
"message",
",",
"check_insert",
")",
":",
"table_map",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"tuple",
",",
"select",
"=",
"\"*\"",
",",
... | [
778,
0
] | [
781,
125
] | python | en | ['en', 'en', 'en'] | True |
subcolumns | (self, type, data, select, filter, exitcode, message, order_by=None) | Check usage of sub-columns in queries.
| Check usage of sub-columns in queries.
| def subcolumns(self, type, data, select, filter, exitcode, message, order_by=None):
"""Check usage of sub-columns in queries.
"""
table_map(type=type, data=data, select=select, filter=filter, exitcode=exitcode, message=message, order_by=order_by) | [
"def",
"subcolumns",
"(",
"self",
",",
"type",
",",
"data",
",",
"select",
",",
"filter",
",",
"exitcode",
",",
"message",
",",
"order_by",
"=",
"None",
")",
":",
"table_map",
"(",
"type",
"=",
"type",
",",
"data",
"=",
"data",
",",
"select",
"=",
... | [
830,
0
] | [
833,
120
] | 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.