repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_parser/test_responses.py
test_response_from_data_property
assert
func_call
30
from unittest.mock import MagicMock import openapi_python_client.schema as oai from openapi_python_client.parser.errors import ParseError, PropertyError from openapi_python_client.parser.properties import Schemas from openapi_python_client.parser.responses import JSON_SOURCE, NONE_SOURCE MODULE_NAME = "openapi_python...
responses.Response( status_code=400, prop=prop, source=JSON_SOURCE, )
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_parser/test_responses.py
test_response_from_data_reference
assert
func_call
22
from unittest.mock import MagicMock import openapi_python_client.schema as oai from openapi_python_client.parser.errors import ParseError, PropertyError from openapi_python_client.parser.properties import Schemas from openapi_python_client.parser.responses import JSON_SOURCE, NONE_SOURCE MODULE_NAME = "openapi_python...
Response( status_code=200, prop=any_property_factory( name="response_200", default=None, required=True, ), source=NONE_SOURCE, )
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_parser/test_responses.py
test_response_from_data_no_content
assert
func_call
22
from unittest.mock import MagicMock import openapi_python_client.schema as oai from openapi_python_client.parser.errors import ParseError, PropertyError from openapi_python_client.parser.properties import Schemas from openapi_python_client.parser.responses import JSON_SOURCE, NONE_SOURCE MODULE_NAME = "openapi_python...
Response( status_code=200, prop=any_property_factory( name="response_200", default=None, required=True, description="", ), source=NONE_SOURCE, )
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_parser/test_responses.py
test_response_from_data_no_content_schema
assert
func_call
26
from unittest.mock import MagicMock import openapi_python_client.schema as oai from openapi_python_client.parser.errors import ParseError, PropertyError from openapi_python_client.parser.properties import Schemas from openapi_python_client.parser.responses import JSON_SOURCE, NONE_SOURCE MODULE_NAME = "openapi_python...
Response( status_code=200, prop=any_property_factory( name="response_200", default=None, required=True, description=data.description, ), source=NONE_SOURCE, )
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_data_type.py
test_schema_happy
assert
variable
20
import pytest import openapi_python_client.schema as oai class TestDataType: @pytest.mark.parametrize( "type_", ( "string", "number", "integer", "boolean", "array", "object", ), ) def test_schema_happy(self, t...
type_
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_data_type.py
test_schema_bad_types
pytest.raises
complex_expr
10
import pytest import openapi_python_client.schema as oai class TestDataType: def test_schema_bad_types(self): import pydantic with pytest.raises(
pydantic.ValidationError)
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_open_api.py
test_validate_version
pytest.raises
variable
24
import pytest from pydantic import ValidationError from openapi_python_client.schema import OpenAPI @pytest.mark.parametrize( "version, valid", [ ("abc", False), ("1", False), ("2.0", False), ("3.0.0", True), ("3.1.1", True), ("3.2.0", False), ("4.0.0", ...
ValidationError)
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_open_api.py
test_parse_with_callback
assert
complex_expr
23
import pytest from pydantic import ValidationError from openapi_python_client.schema import OpenAPI def test_parse_with_callback(): data = { "openapi": "3.0.1", "info": {"title": "API with Callback", "version": ""}, "paths": { "/create": { "post": { ...
create_endpoint.post.responses
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_open_api.py
test_parse_with_callback
assert
complex_expr
24
import pytest from pydantic import ValidationError from openapi_python_client.schema import OpenAPI def test_parse_with_callback(): data = { "openapi": "3.0.1", "info": {"title": "API with Callback", "version": ""}, "paths": { "/create": { "post": { ...
create_endpoint.post.callbacks["event"]["callback"].post.responses
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_schema.py
test_nullable_with_allof
assert
collection
7
from openapi_python_client.schema import DataType, Schema def test_nullable_with_allof(): schema = Schema.model_validate_json('{"allOf": [{"type": "string"}], "nullable": true}') assert schema.oneOf == [Schema(type=DataType.NULL), Schema(allOf=[Schema(type=DataType.STRING)])] assert schema.allOf ==
[]
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_schema.py
test_nullable_with_simple_type
assert
collection
6
from openapi_python_client.schema import DataType, Schema def test_nullable_with_simple_type(): schema = Schema.model_validate_json('{"type": "string", "nullable": true}') assert schema.type ==
[DataType.STRING, DataType.NULL]
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_schema.py
test_nullable_with_type_list
assert
collection
6
from openapi_python_client.schema import DataType, Schema def test_nullable_with_type_list(): schema = Schema.model_validate_json('{"type": ["string", "number"], "nullable": true}') assert schema.type ==
[DataType.STRING, DataType.NUMBER, DataType.NULL]
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_schema.py
test_nullable_with_any_of
assert
collection
6
from openapi_python_client.schema import DataType, Schema def test_nullable_with_any_of(): schema = Schema.model_validate_json('{"anyOf": [{"type": "string"}], "nullable": true}') assert schema.anyOf ==
[Schema(type=DataType.STRING), Schema(type=DataType.NULL)]
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_schema/test_schema.py
test_nullable_with_allof
assert
collection
6
from openapi_python_client.schema import DataType, Schema def test_nullable_with_allof(): schema = Schema.model_validate_json('{"allOf": [{"type": "string"}], "nullable": true}') assert schema.oneOf ==
[Schema(type=DataType.NULL), Schema(allOf=[Schema(type=DataType.STRING)])]
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_templates/test_property_templates/test_date_property/test_date_property.py
test_required
assert
func_call
32
from pathlib import Path import jinja2 from openapi_python_client.parser.properties import DateProperty def date_property(required=True, default=None) -> DateProperty: return DateProperty( name="a_prop", required=required, default=default, python_name="a_prop", description...
expected.read_text()
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_templates/test_property_templates/test_datetime_property/test_datetime_property.py
test_required
assert
func_call
32
from pathlib import Path import jinja2 from openapi_python_client.parser.properties import DateTimeProperty def datetime_property(required=True, default=None) -> DateTimeProperty: return DateTimeProperty( name="a_prop", required=required, default=default, python_name="a_prop", ...
expected.read_text()
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_split_words
assert
variable
20
import pytest from openapi_python_client import utils @pytest.mark.parametrize( "before, after", [ ("connectionID", ["connection", "ID"]), ("connection_id", ["connection", "id"]), ("connection-id", ["connection", "id"]), ("Response200", ["Response", "200"]), ("Response2...
after
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_invalid_symbols_are_stripped
assert
string_literal
9
import pytest from openapi_python_client import utils class TestPythonIdentifier: def test_invalid_symbols_are_stripped(self): assert utils.PythonIdentifier(value="$abc", prefix="prefix") ==
"abc"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_invalid_symbols_are_stripped
assert
string_literal
9
import pytest from openapi_python_client import utils class TestClassName: def test_invalid_symbols_are_stripped(self): assert utils.ClassName(value="$abc", prefix="prefix") ==
"Abc"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_snake_case_uppercase_str
assert
string_literal
7
import pytest from openapi_python_client import utils def test_snake_case_uppercase_str(): assert utils.snake_case("HTTP") ==
"http"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_keywords_are_postfixed
assert
string_literal
9
import pytest from openapi_python_client import utils class TestPythonIdentifier: def test_keywords_are_postfixed(self): assert utils.PythonIdentifier(value="for", prefix="prefix") ==
"for_"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_keywords_are_postfixed
assert
string_literal
9
import pytest from openapi_python_client import utils class TestClassName: def test_keywords_are_postfixed(self): assert utils.ClassName(value="none", prefix="prefix") ==
"None_"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test__fix_reserved_words
assert
variable
19
import pytest from openapi_python_client import utils @pytest.mark.parametrize( "reserved_word, expected", [ ("self", "self_"), ("int", "int_"), ("dict", "dict_"), ("not_reserved", "not_reserved"), ("type", "type"), ("id", "id"), ("None", "None_"), ]...
expected
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_numbers_are_prefixed
assert
string_literal
9
import pytest from openapi_python_client import utils class TestPythonIdentifier: def test_numbers_are_prefixed(self): assert utils.PythonIdentifier(value="1", prefix="field") ==
"field1"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_numbers_are_prefixed
assert
string_literal
9
import pytest from openapi_python_client import utils class TestClassName: def test_numbers_are_prefixed(self): assert utils.ClassName(value="1", prefix="field") ==
"Field1"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_snake_case_from_pascal_with_acronyms
assert
string_literal
10
import pytest from openapi_python_client import utils def test_snake_case_from_pascal_with_acronyms(): assert utils.snake_case("HTTPResponse") == "http_response" assert utils.snake_case("APIClientHTTPResponse") == "api_client_http_response" assert utils.snake_case("OAuthClientHTTPResponse") == "o_auth_cli...
"s3_config"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_empty_is_prefixed
assert
string_literal
9
import pytest from openapi_python_client import utils class TestPythonIdentifier: def test_empty_is_prefixed(self): assert utils.PythonIdentifier(value="", prefix="something") ==
"something"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_empty_is_prefixed
assert
string_literal
9
import pytest from openapi_python_client import utils class TestClassName: def test_empty_is_prefixed(self): assert utils.ClassName(value="", prefix="something") ==
"Something"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_kebab_case
assert
string_literal
7
import pytest from openapi_python_client import utils def test_kebab_case(): assert utils.kebab_case("keep_alive") ==
"keep-alive"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_valid_is_not_changed
assert
string_literal
8
import pytest from openapi_python_client import utils class TestClassName: def test_valid_is_not_changed(self): assert utils.ClassName(value="ValidClass", prefix="field") ==
"ValidClass"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_valid_identifier_is_not_changed
assert
string_literal
8
import pytest from openapi_python_client import utils class TestPythonIdentifier: def test_valid_identifier_is_not_changed(self): assert utils.PythonIdentifier(value="valid_field", prefix="field") ==
"valid_field"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_snake_case_from_pascal_with_numbers
assert
string_literal
7
import pytest from openapi_python_client import utils def test_snake_case_from_pascal_with_numbers(): assert utils.snake_case("Response200") ==
"response_200"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openapi-generators/openapi-python-client
2247d2f70beec30d55fa82065c6005a387272de4
164
train
train
tests/test_utils.py
test_snake_case_uppercase_str
assert
string_literal
8
import pytest from openapi_python_client import utils def test_snake_case_uppercase_str(): assert utils.snake_case("HTTP") == "http" assert utils.snake_case("HTTP RESPONSE") ==
"http_response"
2247d2f70beec30d55fa82065c6005a387272de4
164
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
examples/com.netease.cloudmusic/xpath_test.py
runTest
self.assertTrue
func_call
44
import unittest from logzero import logger import uiautomator2 as u2 d = u2.connect_usb() class MusicTestCase(unittest.TestCase): def setUp(self): self.package_name = "com.netease.cloudmusic" d.ext_xpath.global_set({"timeout": 10}) logger.info("setUp unlock-screen") # unlock scre...
xp("布拉格广场").wait())
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/skip_test_image.py
test_image_match
assert
numeric_literal
45
import os import cv2 import numpy as np import pytest from PIL import Image import uiautomator2.image as u2image TESTDIR = os.path.dirname(os.path.abspath(__file__)) + "/testdata" # if set to DIR__, pytest will fail with TypeError: 'str' object is not callable def path_ae86(): filepath = os.path.join(TESTDIR, "...
409
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/skip_test_image.py
test_image_match
assert
numeric_literal
46
import os import cv2 import numpy as np import pytest from PIL import Image import uiautomator2.image as u2image TESTDIR = os.path.dirname(os.path.abspath(__file__)) + "/testdata" # if set to DIR__, pytest will fail with TypeError: 'str' object is not callable def path_ae86(): filepath = os.path.join(TESTDIR, "...
659
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/skip_test_image.py
test_imread
assert
collection
39
import os import cv2 import numpy as np import pytest from PIL import Image import uiautomator2.image as u2image TESTDIR = os.path.dirname(os.path.abspath(__file__)) + "/testdata" # if set to DIR__, pytest will fail with TypeError: 'str' object is not callable def path_ae86(): filepath = os.path.join(TESTDIR, "...
(321, 193)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/skip_test_image.py
test_image_match
assert
collection
42
import os import cv2 import numpy as np import pytest from PIL import Image import uiautomator2.image as u2image TESTDIR = os.path.dirname(os.path.abspath(__file__)) + "/testdata" # if set to DIR__, pytest will fail with TypeError: 'str' object is not callable def path_ae86(): filepath = os.path.join(TESTDIR, "...
(409, 659)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/skip_test_image.py
test_imread
assert
collection
26
import os import cv2 import numpy as np import pytest from PIL import Image import uiautomator2.image as u2image TESTDIR = os.path.dirname(os.path.abspath(__file__)) + "/testdata" # if set to DIR__, pytest will fail with TypeError: 'str' object is not callable def path_ae86(): filepath = os.path.join(TESTDIR, "...
(193, 321, 3)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/skip_test_image.py
test_imread
assert
collection
30
import os import cv2 import numpy as np import pytest from PIL import Image import uiautomator2.image as u2image TESTDIR = os.path.dirname(os.path.abspath(__file__)) + "/testdata" # if set to DIR__, pytest will fail with TypeError: 'str' object is not callable def path_ae86(): filepath = os.path.join(TESTDIR, "...
(258, 540, 3)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_push_pull.py
test_push_and_pull
assert
variable
14
import io import os import uiautomator2 as u2 def test_push_and_pull(d: u2.Device): device_target = "/data/local/tmp/hello.txt" content = b"hello world" d.push(io.BytesIO(content), device_target) d.pull(device_target, "tmpfile-hello.txt") with open("tmpfile-hello.txt", "rb") as f: assert...
content
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_screenrecord.py
test_screenrecord
pytest.raises
variable
11
import time import pytest import uiautomator2 as u2 @pytest.mark.skip("deprecated") def test_screenrecord(d: u2.Device): import imageio with pytest.raises(
RuntimeError)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_session.py
test_session_app
assert
variable
4
def test_session_app(sess, package_name): sess.app_start(package_name) assert sess.app_current()['package'] ==
package_name
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_session.py
test_session_app
assert
func_call
7
def test_session_app(sess, package_name): sess.app_start(package_name) assert sess.app_current()['package'] == package_name sess.app_wait(package_name) assert package_name in
sess.app_list()
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_session.py
test_session_app
assert
func_call
8
def test_session_app(sess, package_name): sess.app_start(package_name) assert sess.app_current()['package'] == package_name sess.app_wait(package_name) assert package_name in sess.app_list() assert package_name in
sess.app_list_running()
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_operation_delay
assert
numeric_literal
25
import logging import time import pytest import uiautomator2 as u2 def test_operation_delay(d: u2.Device): x, y = d(text="App").center() # 测试前延迟 start = time.time() d.settings['operation_delay'] = (1, 0) d.click(x, y) time_used = time.time() - start assert 1 < time_used < 1.5 # ...
2
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_wait_timeout
assert
numeric_literal
14
import logging import time import pytest import uiautomator2 as u2 def test_wait_timeout(d): d.settings['wait_timeout'] = 19.0 assert d.wait_timeout == 19.0 d.settings['wait_timeout'] = 10 assert d.wait_timeout ==
10
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_wait_timeout
assert
numeric_literal
17
import logging import time import pytest import uiautomator2 as u2 def test_wait_timeout(d): d.settings['wait_timeout'] = 19.0 assert d.wait_timeout == 19.0 d.settings['wait_timeout'] = 10 assert d.wait_timeout == 10 d.implicitly_wait(15) assert d.settings['wait_timeout'] ==
15
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_set_xpath_debug
assert
bool_literal
14
import logging import time import pytest import uiautomator2 as u2 def test_set_xpath_debug(sess): with pytest.raises(TypeError): sess.settings['xpath_debug'] = 1 sess.settings['xpath_debug'] = True assert sess.settings['xpath_debug'] ==
True
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_wait_timeout
assert
numeric_literal
11
import logging import time import pytest import uiautomator2 as u2 def test_wait_timeout(d): d.settings['wait_timeout'] = 19.0 assert d.wait_timeout ==
19.0
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_set_xpath_debug
assert
bool_literal
18
import logging import time import pytest import uiautomator2 as u2 def test_set_xpath_debug(sess): with pytest.raises(TypeError): sess.settings['xpath_debug'] = 1 sess.settings['xpath_debug'] = True assert sess.settings['xpath_debug'] == True assert sess.xpath.logger.level == logging.DEB...
False
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_operation_delay
assert
variable
17
import logging import time import pytest import uiautomator2 as u2 def test_operation_delay(d: u2.Device): x, y = d(text="App").center() # 测试前延迟 start = time.time() d.settings['operation_delay'] = (1, 0) d.click(x, y) time_used = time.time() - start assert 1 <
time_used
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_set_xpath_debug
pytest.raises
variable
10
import logging import time import pytest import uiautomator2 as u2 def test_set_xpath_debug(sess): with pytest.raises(
TypeError)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_set_xpath_debug
assert
complex_expr
19
import logging import time import pytest import uiautomator2 as u2 def test_set_xpath_debug(sess): with pytest.raises(TypeError): sess.settings['xpath_debug'] = 1 sess.settings['xpath_debug'] = True assert sess.settings['xpath_debug'] == True assert sess.xpath.logger.level == logging.DEB...
logging.INFO
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_settings.py
test_set_xpath_debug
assert
complex_expr
15
import logging import time import pytest import uiautomator2 as u2 def test_set_xpath_debug(sess): with pytest.raises(TypeError): sess.settings['xpath_debug'] = 1 sess.settings['xpath_debug'] = True assert sess.settings['xpath_debug'] == True assert sess.xpath.logger.level ==
logging.DEBUG
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_xpath
assert
numeric_literal
12
import time import unittest import pytest import uiautomator2 as u2 def test_xpath(sess): d = sess d.xpath("//*[@text='Media']").wait() assert len(d.xpath("//*[@text='Media']").all()) ==
1
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_xpath
assert
numeric_literal
13
import time import unittest import pytest import uiautomator2 as u2 def test_xpath(sess): d = sess d.xpath("//*[@text='Media']").wait() assert len(d.xpath("//*[@text='Media']").all()) == 1 assert len(d.xpath("//*[@text='MediaNotExists']").all()) ==
0
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_implicitly_wait
assert
numeric_literal
12
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("Need fix") def test_implicitly_wait(d): d.implicitly_wait(2) assert d.implicitly_wait() ==
2
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_select_iter
assert
numeric_literal
14
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("TODO:: not fixed") def test_select_iter(d): d(text='OS').click() texts = d(resourceId='android:id/list').child( className='android.widget.TextView') assert texts.count ==
4
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_count
self.assertEqual
numeric_literal
19
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("TODO:: not fixed") def test_count(self): d = self.sess count = d(resourceId="android:id/list").child( className="android.widget.TextView").count self.assertEqual(count, 11) self.assertEqual( d(resou...
1)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_toast_get_message
assert
string_literal
13
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("not working") def test_toast_get_message(sess: u2.Device): d = sess assert d.toast.get_message(0) is None assert d.toast.get_message(0, default="d") ==
"d"
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_count
self.assertEqual
numeric_literal
14
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("TODO:: not fixed") def test_count(self): d = self.sess count = d(resourceId="android:id/list").child( className="android.widget.TextView").count self.assertEqual(count,
11)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_toast_get_message
assert
none_literal
12
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("not working") def test_toast_get_message(sess: u2.Device): d = sess assert d.toast.get_message(0) is
None
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_implicitly_wait
assert
complex_expr
20
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("Need fix") def test_implicitly_wait(d): d.implicitly_wait(2) assert d.implicitly_wait() == 2 start = time.time() with self.assertRaises(u2.UiObjectNotFoundError): d(text="Sensors").get_text() time_used ...
2 + 3
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_plugin
self.assertEqual
string_literal
19
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("Deprecated") def test_plugin(self): def _my_plugin(d, k): def _inner(): return k return _inner u2.plugin_clear() u2.plugin_register('my', _my_plugin, 'pp') self.assertEqual(self.d.ext...
'pp')
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_send_keys
assert
string_literal
16
import time import unittest import pytest import uiautomator2 as u2 def test_send_keys(sess): d = sess d.xpath("App").click() d.xpath("Search").click() d.xpath('//*[@text="Invoke Search"]').click() d.xpath('@io.appium.android.apis:id/txt_query_prefill').click() d.send_keys("hello", clear=True...
'hello'
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_get_text
assert
string_literal
13
import time import unittest import pytest import uiautomator2 as u2 def test_get_text(sess): d = sess text = d(resourceId="android:id/list").child( className="android.widget.TextView", instance=2).get_text() assert text ==
"Animation"
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_watchers
self.assertFalse
func_call
28
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("Need upgrade") def test_watchers(self): """ App -> Notification -> Status Bar """ d = self.sess d.watcher.remove() d.watcher.stop() d(text="App").click() d.xpath("Notification").wait() d.w...
d.watcher.running())
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_implicitly_wait
self.assertRaises
complex_expr
14
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("Need fix") def test_implicitly_wait(d): d.implicitly_wait(2) assert d.implicitly_wait() == 2 start = time.time() with self.assertRaises(
u2.UiObjectNotFoundError)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_toast_get_message
assert
func_call
22
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("not working") def test_toast_get_message(sess: u2.Device): d = sess assert d.toast.get_message(0) is None assert d.toast.get_message(0, default="d") == "d" d(text="App").click() d(text="Notification").click() ...
d.toast.get_message(2, 5, "")
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_watchers
self.assertTrue
func_call
24
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("Need upgrade") def test_watchers(self): """ App -> Notification -> Status Bar """ d = self.sess d.watcher.remove() d.watcher.stop() d(text="App").click() d.xpath("Notification").wait() d.w...
d(text="Status Bar").wait(timeout=3))
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_simple.py
test_watchers
self.assertFalse
func_call
40
import time import unittest import pytest import uiautomator2 as u2 @pytest.mark.skip("Need upgrade") def test_watchers(self): """ App -> Notification -> Status Bar """ d = self.sess d.watcher.remove() d.watcher.stop() d(text="App").click() d.xpath("Notification").wait() d.w...
d(text="Status Bar").wait(timeout=5))
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_swipe.py
test_swipe_duration
assert
numeric_literal
11
import time import uiautomator2 as u2 def test_swipe_duration(d: u2.Device): w, h = d.window_size() start = time.time() d.swipe(w//2, h//2, w-1, h//2, 2.0) duration = time.time() - start assert duration >=
1.5
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_utils.py
test_inject_call
assert
numeric_literal
14
import threading import time import pytest from uiautomator2 import utils def test_inject_call(): def foo(a, b, c=2): return a*100+b*10+c ret = utils.inject_call(foo, a=2, b=4) assert ret ==
242
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_utils.py
test_threadsafe_wrapper
assert
complex_expr
27
import threading import time import pytest from uiautomator2 import utils def test_threadsafe_wrapper(): class A: n = 0 @utils.thread_safe_wrapper def call(self): v = self.n time.sleep(.5) self.n = v + 1 a = A() th1 = threading.Thread(name...
a.n
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_utils.py
test_list2cmdline
assert
variable
17
import threading import time import pytest from uiautomator2 import utils def test_list2cmdline(): testdata = [ [("echo", "hello"), "echo hello"], [("echo", "hello&world"), "echo 'hello&world'"], [("What's", "your", "name?"), """'What'"'"'s' your 'name?'"""] ] for args, expect in ...
expect
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_utils.py
test_inject_call
pytest.raises
variable
16
import threading import time import pytest from uiautomator2 import utils def test_inject_call(): def foo(a, b, c=2): return a*100+b*10+c ret = utils.inject_call(foo, a=2, b=4) assert ret == 242 with pytest.raises(
TypeError)
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_xpath.py
test_element_all
assert
numeric_literal
13
import threading from functools import partial from pprint import pprint import pytest import uiautomator2 as u2 def test_element_all(sess: u2.Session): app = sess.xpath('//*[@text="App"]') assert app.wait() assert len(app.all()) ==
1
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_xpath.py
test_get_text
assert
string_literal
11
import threading from functools import partial from pprint import pprint import pytest import uiautomator2 as u2 def test_get_text(sess: u2.Session): assert sess.xpath("App").get_text() ==
"App"
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
openatx/uiautomator2
021c391182765a9ae8371c1862d8646b66af518e
43
train
train
tests/real_device/test_xpath.py
test_xpath_parent
assert
string_literal
13
import threading from functools import partial from pprint import pprint import pytest import uiautomator2 as u2 def test_xpath_parent(sess: u2.Session): d = sess info = d.xpath("App").parent("@android:id/list").info assert info['resourceId'] ==
'android:id/list'
021c391182765a9ae8371c1862d8646b66af518e
43
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_Curve.py
test_bspline_curve_degree
assert
numeric_literal
20
from pytest import fixture, mark from geomdl import BSpline from geomdl import evaluators from geomdl import helpers from geomdl import convert from geomdl import operations GEOMDL_DELTA = 0.001 def spline_curve(): """ Creates a spline Curve """ curve = BSpline.Curve() curve.degree = 3 curve.ctrlpts =...
3
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_Curve.py
test_bspline_curve_ctrlpts
assert
numeric_literal
21
from pytest import fixture, mark from geomdl import BSpline from geomdl import evaluators from geomdl import helpers from geomdl import convert from geomdl import operations GEOMDL_DELTA = 0.001 def spline_curve(): """ Creates a spline Curve """ curve = BSpline.Curve() curve.degree = 3 curve.ctrlpts =...
2
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_Curve.py
test_bspline_curve2d_insert_knot_kv
assert
numeric_literal
23
from pytest import fixture, mark from geomdl import BSpline from geomdl import evaluators from geomdl import helpers from geomdl import convert from geomdl import operations GEOMDL_DELTA = 0.001 def spline_curve(): """ Creates a spline Curve """ curve = BSpline.Curve() curve.degree = 3 curve.ctrlpts =...
0.66
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_Curve.py
test_bspline_curve2d_insert_knot
assert
variable
32
from pytest import fixture, mark from geomdl import BSpline from geomdl import evaluators from geomdl import helpers from geomdl import convert from geomdl import operations GEOMDL_DELTA = 0.001 def spline_curve(): """ Creates a spline Curve """ curve = BSpline.Curve() curve.degree = 3 curve.ctrlpts =...
s_post
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_Curve.py
test_bspline_curve2d_eval
assert
variable
29
from pytest import fixture, mark from geomdl import BSpline from geomdl import evaluators from geomdl import helpers from geomdl import convert from geomdl import operations GEOMDL_DELTA = 0.001 def spline_curve(): """ Creates a spline Curve """ curve = BSpline.Curve() curve.degree = 3 curve.ctrlpts =...
GEOMDL_DELTA
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_Surface.py
test_bspline_surface_degree_u
assert
numeric_literal
38
from pytest import fixture, mark from geomdl import BSpline from geomdl import evaluators from geomdl import convert GEOMDL_DELTA = 0.001 def spline_surf(): """ Creates a B-spline surface instance """ # Create a surface instance surf = BSpline.Surface() # Set degrees surf.degree_u = 3 surf.de...
3
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_Surface.py
test_bspline_surface_insert_knot_kv_v
assert
variable
45
from pytest import fixture, mark from geomdl import BSpline from geomdl import evaluators from geomdl import convert GEOMDL_DELTA = 0.001 def spline_surf(): """ Creates a B-spline surface instance """ # Create a surface instance surf = BSpline.Surface() # Set degrees surf.degree_u = 3 surf.de...
val
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_Surface.py
test_nurbs_weights
assert
numeric_literal
43
from pytest import fixture, mark from geomdl import BSpline from geomdl import evaluators from geomdl import convert GEOMDL_DELTA = 0.001 def spline_surf(): """ Creates a B-spline surface instance """ # Create a surface instance surf = BSpline.Surface() # Set degrees surf.degree_u = 3 surf.de...
1.0
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_Surface.py
test_bspline_surface_eval
assert
variable
53
from pytest import fixture, mark from geomdl import BSpline from geomdl import evaluators from geomdl import convert GEOMDL_DELTA = 0.001 def spline_surf(): """ Creates a B-spline surface instance """ # Create a surface instance surf = BSpline.Surface() # Set degrees surf.degree_u = 3 surf.de...
GEOMDL_DELTA
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_compatibility.py
test_combine_ctrlpts_weights1
assert
variable
13
from geomdl import compatibility P = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] W = [0.5, 2, 1] PW = [[0.5, 1, 1.5, 0.5], [8, 10, 12, 2], [7, 8, 9, 1]] PW_ONES = [[1, 2, 3, 1], [4, 5, 6, 1], [7, 8, 9, 1]] PW_SEP = [[1, 2, 3, 0.5], [4, 5, 6, 2], [7, 8, 9, 1]] def test_combine_ctrlpts_weights1(): check = compatibility.combi...
check
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_compatibility.py
test_change_ctrlpts_row_order
assert
variable
25
from geomdl import compatibility P = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] W = [0.5, 2, 1] PW = [[0.5, 1, 1.5, 0.5], [8, 10, 12, 2], [7, 8, 9, 1]] PW_ONES = [[1, 2, 3, 1], [4, 5, 6, 1], [7, 8, 9, 1]] PW_SEP = [[1, 2, 3, 0.5], [4, 5, 6, 2], [7, 8, 9, 1]] def test_change_ctrlpts_row_order(): size_u = 3 size_v = 4 ...
result
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_compatibility.py
test_separate_ctrlpts_weights
assert
variable
13
from geomdl import compatibility P = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] W = [0.5, 2, 1] PW = [[0.5, 1, 1.5, 0.5], [8, 10, 12, 2], [7, 8, 9, 1]] PW_ONES = [[1, 2, 3, 1], [4, 5, 6, 1], [7, 8, 9, 1]] PW_SEP = [[1, 2, 3, 0.5], [4, 5, 6, 2], [7, 8, 9, 1]] def test_separate_ctrlpts_weights(): c_ctrlpts, c_weights = comp...
c_ctrlpts
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_compatibility.py
test_separate_ctrlpts_weights
assert
variable
14
from geomdl import compatibility P = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] W = [0.5, 2, 1] PW = [[0.5, 1, 1.5, 0.5], [8, 10, 12, 2], [7, 8, 9, 1]] PW_ONES = [[1, 2, 3, 1], [4, 5, 6, 1], [7, 8, 9, 1]] PW_SEP = [[1, 2, 3, 0.5], [4, 5, 6, 2], [7, 8, 9, 1]] def test_separate_ctrlpts_weights(): c_ctrlpts, c_weights = comp...
c_weights
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_compatibility.py
test_generate_ctrlptsw2d_ops
assert
variable
18
from geomdl import compatibility P = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] W = [0.5, 2, 1] PW = [[0.5, 1, 1.5, 0.5], [8, 10, 12, 2], [7, 8, 9, 1]] PW_ONES = [[1, 2, 3, 1], [4, 5, 6, 1], [7, 8, 9, 1]] PW_SEP = [[1, 2, 3, 0.5], [4, 5, 6, 2], [7, 8, 9, 1]] def test_generate_ctrlptsw2d_ops(): ctrlpts_weights_2d = [[[0, 0...
ctrlpts_weights_2d
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_convert.py
test_convert_curve
assert
variable
36
from geomdl import BSpline from geomdl import convert SAMPLE_SIZE = 5 C_DEGREE = 2 C_CTRLPTS = [[1, 1, 0], [2, 1, -1], [2, 2, 0]] C_KV = [0, 0, 0, 1, 1, 1] S_DEGREE_U = 2 S_DEGREE_V = 2 S_CTRLPTS = [[0, 0, 0], [0, 1, 0], [0, 2, -3], [1, 0, 6], [1, 1, 0], [1, 2, 0], [2, 0, 0], [2, 1, 0], [2, ...
res
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_convert.py
test_convert_curve
assert
variable
37
from geomdl import BSpline from geomdl import convert SAMPLE_SIZE = 5 C_DEGREE = 2 C_CTRLPTS = [[1, 1, 0], [2, 1, -1], [2, 2, 0]] C_KV = [0, 0, 0, 1, 1, 1] S_DEGREE_U = 2 S_DEGREE_V = 2 S_CTRLPTS = [[0, 0, 0], [0, 1, 0], [0, 2, -3], [1, 0, 6], [1, 1, 0], [1, 2, 0], [2, 0, 0], [2, 1, 0], [2, ...
res_weights
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_evaluate.py
test_bspline_curve2d_evaluate
assert
variable
28
from geomdl import BSpline SAMPLE_SIZE = 5 C_DEGREE = 2 C_CTRLPTS2D = [[1, 1], [2, 1], [2, 2]] C_CTRLPTS3D = [[1, 1, 0], [2, 1, -1], [2, 2, 0]] C_KV = [0, 0, 0, 1, 1, 1] S_DEGREE_U = 2 S_DEGREE_V = 2 S_CTRLPTS = [[0, 0, 0], [0, 1, 0], [0, 2, -3], [1, 0, 6], [1, 1, 0], [1, 2, 0], [2, 0, 0], [...
res
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_helpers.py
test_find_span_binsearch
assert
variable
15
from geomdl import helpers GEOMDL_DELTA = 10e-8 def test_find_span_binsearch(): degree = 2 knot_vector = [0, 0, 0, 1, 2, 3, 4, 4, 5, 5, 5] num_ctrlpts = len(knot_vector) - degree - 1 knot = 5.0 / 2.0 to_check = helpers.find_span_binsearch(degree, knot_vector, num_ctrlpts, knot) result = 4 # Value from The Nur...
result
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_helpers.py
test_basis_function
assert
variable
15
from geomdl import helpers GEOMDL_DELTA = 10e-8 def test_basis_function(): degree = 2 knot_vector = [0, 0, 0, 1, 2, 3, 4, 4, 5, 5, 5] span = 4 knot = 5.0 / 2.0 to_check = helpers.basis_function(degree, knot_vector, span, knot) result = [1.0 / 8.0, 6.0 / 8.0, 1.0 / 8.0] # Values from The Nurbs Book p.69 ass...
GEOMDL_DELTA
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor
orbingol/NURBS-Python
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
train
train
tests/test_helpers.py
test_basis_function_all
assert
complex_expr
20
from geomdl import helpers GEOMDL_DELTA = 10e-8 def test_basis_function_all(): degree = 2 knot_vector = [0, 0, 0, 1, 2, 3, 4, 4, 5, 5, 5] span = 4 knot = 5.0 / 2.0 to_check = helpers.basis_function_all(degree, knot_vector, span, knot) interm = [helpers.basis_function(_, knot_vector, span, knot) + [None] * (deg...
result[1][0]
a3589a79c6e54f52417b1b03272baaf2fddd167a
110
v2_extractor_at_anchor