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
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/hashid/test_hashid_middleware.py
test_hashid_hashes_several_integers
assert
string_literal
9
from src.masonite.essentials.middleware import HashIDMiddleware from src.masonite.essentials.helpers.hashid import hashid from tests import TestCase class TestHashID(TestCase): def test_hashid_hashes_several_integers(self): assert hashid(10, 20, 30) ==
"dB1I1uo"
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/notification/test_slack_driver.py
test_convert_channel
self.assertEqual
string_literal
29
import pytest import responses from tests import TestCase from src.masonite.notification import Notification, Notifiable, SlackMessage from src.masonite.exceptions import NotificationException from masoniteorm.models import Model webhook_url = "https://hooks.slack.com/services/X/Y/Z" webhook_url_2 = "https://hooks.sl...
"123456")
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/notification/test_database_driver.py
test_database_notification_is_created_correctly
assert
complex_expr
24
import pendulum from masoniteorm.models import Model from tests import TestCase from src.masonite.tests import DatabaseTransactions from src.masonite.notification import Notification, Notifiable from src.masonite.notification import DatabaseNotification class TestDatabaseDriver(TestCase, DatabaseTransactions): c...
user.id
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/notification/test_database_driver.py
test_send_to_notifiable
assert
complex_expr
22
import pendulum from masoniteorm.models import Model from tests import TestCase from src.masonite.tests import DatabaseTransactions from src.masonite.notification import Notification, Notifiable from src.masonite.notification import DatabaseNotification class TestDatabaseDriver(TestCase, DatabaseTransactions): c...
count + 1
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/core/authorization/test_gate.py
test_can_use_gate_facade
self.assertEqual
complex_expr
32
from tests import TestCase from masoniteorm.models import Model from src.masonite.exceptions.exceptions import AuthorizationException, GateDoesNotExist from src.masonite.authorization import AuthorizationResponse from src.masonite.routes import Route class TestGate(TestCase): def setUp(self): super().setU...
Gate.define)
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/pipeline/test_pipeline.py
test_pipeline_sets_attributes
self.assertTrue
complex_expr
12
from tests import TestCase from src.masonite.pipeline import Pipeline from src.masonite.request import Request import os class TestPipeline(TestCase): def test_pipeline_sets_attributes(self): request = Request({}) request2 = Request({}) pipeline = Pipeline(request, request2).through([PipeTe...
request.one == 1)
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/pipeline/test_pipeline.py
test_pipeline_sets_attributes
self.assertTrue
complex_expr
13
from tests import TestCase from src.masonite.pipeline import Pipeline from src.masonite.request import Request import os class TestPipeline(TestCase): def test_pipeline_sets_attributes(self): request = Request({}) request2 = Request({}) pipeline = Pipeline(request, request2).through([PipeTe...
request.two == 2)
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
src/masonite/tests/TestCase.py
assertConsoleEmpty
self.assertEqual
complex_expr
88
import json import io import os import sys import pytest import unittest import pendulum from contextlib import contextmanager from typing import TYPE_CHECKING, Any from ..routes import Route from ..foundation.response_handler import testcase_handler from ..utils.http import generate_wsgi from ..request import Request...
self._console_out)
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
src/masonite/tests/TestCase.py
assertConsoleEmpty
self.assertEqual
complex_expr
89
import json import io import os import sys import pytest import unittest import pendulum from contextlib import contextmanager from typing import TYPE_CHECKING, Any from ..routes import Route from ..foundation.response_handler import testcase_handler from ..utils.http import generate_wsgi from ..request import Request...
self._console_err)
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/dumps/test_dumper.py
test_get_dumps
assert
collection
18
from tests import TestCase from src.masonite.facades import Dump from src.masonite.exceptions import DumpException class TestDumper(TestCase): def setUp(self): super().setUp() self.dumper = self.application.make("dumper") def tearDown(self): super().tearDown() self.dumper.clea...
[]
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/core/request/test_input.py
test_can_get_defaults
self.assertEqual
collection
44
import binascii import os import json import io from src.masonite.input import InputBag from src.masonite.tests import MockInput from tests import TestCase def encode_multipart_formdata(fields): boundary = binascii.hexlify(os.urandom(16)).decode("ascii") body = ( "".join( "--%s\r\n" ...
[])
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/event/test_event.py
test_fire_event_string
self.assertEqual
collection
23
import time import pytest from src.masonite.events import Event from tests import TestCase class TestEvent(TestCase): def setUp(self): super().setUp() self.event = self.application.make("event") self.event.listen(UserAddedEvent, [SendEmailListener]) def test_fire_event_string(self): ...
[])
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/validation/test_request_validation.py
test_can_validate_request
self.assertEqual
collection
15
from tests import TestCase class TestValidation(TestCase): def test_can_validate_request(self): request = self.make_request( data={"QUERY_STRING": "email=joe@masoniteproject.com"} ) validation = request.validate( { "email": "required", } ...
{})
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/routes/test_routes.py
test_can_exclude_middleware_from_route
self.assertEqual
collection
28
from unittest import TestCase from src.masonite.routes import Route, Router class TestRoutes(TestCase): def setUp(self): Route.set_controller_locations("tests.integrations.controllers") pass def test_can_exclude_middleware_from_route(self): router = Router( Route.group( ...
[])
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/validation/test_messagebag.py
test_get_errors
self.assertEqual
collection
13
import unittest from src.masonite.validation import MessageBag class TestMessageBag(unittest.TestCase): def setUp(self): self.bag = MessageBag() def test_get_errors(self): self.bag.reset() self.bag.add("email", "Your email is invalid") self.bag.add("email", "Your email too shor...
["email"])
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/event/test_event.py
test_fire_event_string
self.assertEqual
collection
29
import time import pytest from src.masonite.events import Event from tests import TestCase class TestEvent(TestCase): def setUp(self): super().setUp() self.event = self.application.make("event") self.event.listen(UserAddedEvent, [SendEmailListener]) def test_fire_event_string(self): ...
["view.*"])
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/hashid/test_hashid_middleware.py
test_hashid_decodes_several_integers
assert
collection
9
from src.masonite.essentials.middleware import HashIDMiddleware from src.masonite.essentials.helpers.hashid import hashid from tests import TestCase class TestHashID(TestCase): def test_hashid_decodes_several_integers(self): assert hashid("B1I1uo", decode=True) ==
(10, 20, 30)
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/core/request/test_request_input.py
test_request_can_get_list_value
self.assertEqual
collection
14
from tests import TestCase from src.masonite.utils.http import generate_wsgi from src.masonite.request import Request class TestRequest(TestCase): def setUp(self): super().setUp() self.request = Request(generate_wsgi(path="/test")) def test_request_can_get_list_value(self): self.reque...
["foo", "bar"])
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/event/test_event.py
test_fire_event_string
self.assertEqual
collection
30
import time import pytest from src.masonite.events import Event from tests import TestCase class TestEvent(TestCase): def setUp(self): super().setUp() self.event = self.application.make("event") self.event.listen(UserAddedEvent, [SendEmailListener]) def test_fire_event_string(self): ...
["user.added"])
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/core/request/test_input.py
test_all_with_values
self.assertEqual
collection
43
import binascii import os import json import io from src.masonite.input import InputBag from src.masonite.tests import MockInput from tests import TestCase def encode_multipart_formdata(fields): boundary = binascii.hexlify(os.urandom(16)).decode("ascii") body = ( "".join( "--%s\r\n" ...
{"hello": "you"})
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/core/cookies/test_cookies.py
test_cookies_can_put_to_dict
self.assertEqual
collection
12
import unittest from src.masonite.cookies import CookieJar from src.masonite.utils.time import cookie_expire_time class TestCookies(unittest.TestCase): def test_cookies_can_put_to_dict(self): cookiejar = CookieJar() cookiejar.add("cookie", "name") self.assertEqual(cookiejar.to_dict(),
{"cookie": "name"})
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/core/request/test_input.py
test_only_array_based_inputs
self.assertEqual
collection
40
import binascii import os import json import io from src.masonite.input import InputBag from src.masonite.tests import MockInput from tests import TestCase def encode_multipart_formdata(fields): boundary = binascii.hexlify(os.urandom(16)).decode("ascii") body = ( "".join( "--%s\r\n" ...
["user1", "user2"])
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/event/test_event.py
test_fire_event_string
self.assertEqual
collection
21
import time import pytest from src.masonite.events import Event from tests import TestCase class TestEvent(TestCase): def setUp(self): super().setUp() self.event = self.application.make("event") self.event.listen(UserAddedEvent, [SendEmailListener]) def test_fire_event_string(self): ...
["masonite.commands"])
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/core/views/test_view.py
test_composers_load_all_views_with_asterisks
self.assertEqual
collection
21
from src.masonite.configuration import config from src.masonite.helpers import url, optional from src.masonite.sessions import old from tests import TestCase from jinja2 import TemplateNotFound class TestView(TestCase): def setUp(self): super().setUp() # keep this to have a "fresh view instance" fo...
{"*": {"test": "test"}})
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MasoniteFramework/masonite
fc18248a079b014d1efc24541a27aedda8fb43ec
218
train
train
tests/features/hashid/test_hashid_middleware.py
test_hashid_can_decode_dictionary
assert
collection
9
from src.masonite.essentials.middleware import HashIDMiddleware from src.masonite.essentials.helpers.hashid import hashid from tests import TestCase class TestHashID(TestCase): def test_hashid_can_decode_dictionary(self): assert
{"id": 10, "name": "Joe"}
fc18248a079b014d1efc24541a27aedda8fb43ec
218
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_ca.py
test_row_cosine_similarities
assert_*
variable
63
from __future__ import annotations import math import tempfile import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R from scipy import sparse import prince from tests import load_df_...
P)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_ca.py
test_row_coords
assert_*
func_call
66
from __future__ import annotations import math import tempfile import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R from scipy import sparse import prince from tests import load_df_...
P.abs())
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_ca.py
test_row_contrib
assert_*
complex_expr
61
from __future__ import annotations import math import tempfile import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R from scipy import sparse import prince from tests import load_df_...
P * 100)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_ca.py
test_svd_U
assert_*
func_call
61
from __future__ import annotations import math import tempfile import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R from scipy import sparse import prince from tests import load_df_...
np.abs(P))
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_ca.py
test_eigenvalues
assert_*
complex_expr
61
from __future__ import annotations import math import tempfile import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R from scipy import sparse import prince from tests import load_df_...
P["eigenvalue"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_ca.py
test_eigenvalues
assert_*
complex_expr
62
from __future__ import annotations import math import tempfile import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R from scipy import sparse import prince from tests import load_df_...
P["% of variance"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_ca.py
test_eigenvalues
assert_*
func_call
63
from __future__ import annotations import math import tempfile import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R from scipy import sparse import prince from tests import load_df_...
P["% of variance (cumulative)"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_famd.py
test_row_coords
assert_*
func_call
44
from __future__ import annotations import tempfile import numpy as np import pytest import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestFAMD: _row_name = "row" _col_name = "col" def _prepare(self...
P.abs())
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_famd.py
test_row_contrib
assert_*
complex_expr
42
from __future__ import annotations import tempfile import numpy as np import pytest import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestFAMD: _row_name = "row" _col_name = "col" def _prepare(self...
P * 100)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_famd.py
test_eigenvalues
assert_*
complex_expr
42
from __future__ import annotations import tempfile import numpy as np import pytest import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestFAMD: _row_name = "row" _col_name = "col" def _prepare(self...
P["eigenvalue"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_famd.py
test_eigenvalues
assert_*
complex_expr
43
from __future__ import annotations import tempfile import numpy as np import pytest import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestFAMD: _row_name = "row" _col_name = "col" def _prepare(self...
P["% of variance"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_famd.py
test_cat_cols
assert
collection
40
from __future__ import annotations import tempfile import numpy as np import pytest import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestFAMD: _row_name = "row" _col_name = "col" def _prepare(self...
["is_organic", "style"]
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_famd.py
test_eigenvalues
assert_*
func_call
44
from __future__ import annotations import tempfile import numpy as np import pytest import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestFAMD: _row_name = "row" _col_name = "col" def _prepare(self...
P["% of variance (cumulative)"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_famd.py
test_num_cols
assert
collection
40
from __future__ import annotations import tempfile import numpy as np import pytest import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestFAMD: _row_name = "row" _col_name = "col" def _prepare(self...
[ "alcohol_by_volume", "final_gravity", "international_bitterness_units", "standard_reference_method", ]
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_gpa.py
test_fit
self.assertIsInstance
complex_expr
40
from __future__ import annotations import unittest import numpy as np import pandas as pd import prince class TestGPA(unittest.TestCase): def setUp(self): # Create a list of 2-D circles with different locations and rotations n_shapes = 4 n_points = 12 n_dims = 2 shape_si...
prince.GPA)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_gpa.py
test_transform
self.assertIsInstance
complex_expr
41
from __future__ import annotations import unittest import numpy as np import pandas as pd import prince class TestGPA(unittest.TestCase): def setUp(self): # Create a list of 2-D circles with different locations and rotations n_shapes = 4 n_points = 12 n_dims = 2 shape_si...
np.ndarray)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_gpa.py
test_fit_bad_init
self.assertRaises
variable
41
from __future__ import annotations import unittest import numpy as np import pandas as pd import prince class TestGPA(unittest.TestCase): def setUp(self): # Create a list of 2-D circles with different locations and rotations n_shapes = 4 n_points = 12 n_dims = 2 shape_si...
ValueError)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_gpa.py
test_copy
assert_*
variable
43
from __future__ import annotations import unittest import numpy as np import pandas as pd import prince class TestGPA(unittest.TestCase): def setUp(self): # Create a list of 2-D circles with different locations and rotations n_shapes = 4 n_points = 12 n_dims = 2 shape_si...
shapes_copy)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_gpa.py
test_fit_transform_single
assert_*
variable
43
from __future__ import annotations import unittest import numpy as np import pandas as pd import prince class TestGPA(unittest.TestCase): def setUp(self): # Create a list of 2-D circles with different locations and rotations n_shapes = 4 n_points = 12 n_dims = 2 shape_si...
aligned_shapes)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_gpa.py
test_copy
self.assertRaises
variable
47
from __future__ import annotations import unittest import numpy as np import pandas as pd import prince class TestGPA(unittest.TestCase): def setUp(self): # Create a list of 2-D circles with different locations and rotations n_shapes = 4 n_points = 12 n_dims = 2 shape_si...
AssertionError)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_gpa.py
test_fit_transform_equal
assert_*
complex_expr
44
from __future__ import annotations import unittest import numpy as np import pandas as pd import prince class TestGPA(unittest.TestCase): def setUp(self): # Create a list of 2-D circles with different locations and rotations n_shapes = 4 n_points = 12 n_dims = 2 shape_si...
aligned_shapes[1:])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_gpa.py
test_transform
self.assertEqual
complex_expr
42
from __future__ import annotations import unittest import numpy as np import pandas as pd import prince class TestGPA(unittest.TestCase): def setUp(self): # Create a list of 2-D circles with different locations and rotations n_shapes = 4 n_points = 12 n_dims = 2 shape_si...
aligned_shapes.shape)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_mca.py
test_col_cos2
assert_*
variable
63
from __future__ import annotations import tempfile import numpy as np import pandas as pd import pytest from rpy2.robjects import r as R import prince from tests import load_df_from_R from tests.test_ca import TestCA as _TestCA class TestMCA(_TestCA): _row_name = "ind" _col_name = "var" def _prepare(se...
P)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_mca.py
test_col_coords
assert_*
func_call
63
from __future__ import annotations import tempfile import numpy as np import pandas as pd import pytest from rpy2.robjects import r as R import prince from tests import load_df_from_R from tests.test_ca import TestCA as _TestCA class TestMCA(_TestCA): _row_name = "ind" _col_name = "var" def _prepare(se...
P.abs())
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_mfa.py
test_row_coords
assert_*
func_call
54
from __future__ import annotations import math import tempfile import numpy as np import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestMFA: _row_name = "row" ...
P.abs())
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_mfa.py
test_row_contrib
assert_*
complex_expr
52
from __future__ import annotations import math import tempfile import numpy as np import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestMFA: _row_name = "row" ...
P * 100)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_mfa.py
test_eigenvalues
assert_*
complex_expr
52
from __future__ import annotations import math import tempfile import numpy as np import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestMFA: _row_name = "row" ...
P["eigenvalue"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_mfa.py
test_eigenvalues
assert_*
complex_expr
53
from __future__ import annotations import math import tempfile import numpy as np import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestMFA: _row_name = "row" ...
P["% of variance"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_mfa.py
test_eigenvalues
assert_*
func_call
54
from __future__ import annotations import math import tempfile import numpy as np import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from rpy2.robjects import r as R import prince from tests import load_df_from_R class TestMFA: _row_name = "row" ...
P["% of variance (cumulative)"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_pca.py
test_svd_s
assert_*
variable
76
from __future__ import annotations import math import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from sklearn import decomposition, pipeline, preprocessing import prince from tests import load_df_from_R class T...
P)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_pca.py
test_eigenvalues
assert_*
variable
85
from __future__ import annotations import math import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from sklearn import decomposition, pipeline, preprocessing import prince from tests import load_df_from_R class T...
S)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_pca.py
test_row_coords
assert_*
func_call
81
from __future__ import annotations import math import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from sklearn import decomposition, pipeline, preprocessing import prince from tests import load_df_from_R class T...
P.abs())
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_pca.py
test_row_contrib
assert_*
complex_expr
76
from __future__ import annotations import math import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from sklearn import decomposition, pipeline, preprocessing import prince from tests import load_df_from_R class T...
P * 100)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_pca.py
test_eigenvalues
assert_*
complex_expr
77
from __future__ import annotations import math import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from sklearn import decomposition, pipeline, preprocessing import prince from tests import load_df_from_R class T...
P["eigenvalue"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_pca.py
test_eigenvalues
assert_*
complex_expr
78
from __future__ import annotations import math import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from sklearn import decomposition, pipeline, preprocessing import prince from tests import load_df_from_R class T...
P["% of variance"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_pca.py
test_eigenvalues
assert_*
func_call
79
from __future__ import annotations import math import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from sklearn import decomposition, pipeline, preprocessing import prince from tests import load_df_from_R class T...
P["% of variance (cumulative)"])
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MaxHalford/prince
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
train
train
tests/test_pca.py
test_eigenvalues
assert_*
complex_expr
86
from __future__ import annotations import math import numpy as np import pandas as pd import pytest import rpy2.robjects as robjects import sklearn.utils.estimator_checks import sklearn.utils.validation from sklearn import decomposition, pipeline, preprocessing import prince from tests import load_df_from_R class T...
self.sk_pca[-1].explained_variance_ratio_ * 100)
64200f6c3ea9e6ee6c52c28dbb8cecb0111d5484
38
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_all_zero_values
assert
numeric_literal
16
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartDataValidation: def test_all_zero_values(self): """Test handling when all values are zero...
1
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_update_data_basic
assert
numeric_literal
19
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartUpdateData: def test_update_data_basic(self): """Test basic data update.""" data ...
3
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_zero_tick_count
assert
numeric_literal
13
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartAxisAndTicks: def test_zero_tick_count(self): """Test zero tick count (no ticks).""" ...
0
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_multiple_updates
assert
numeric_literal
15
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartEdgeCases: def test_multiple_updates(self): """Test multiple sequential updates.""" ...
2
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_custom_tick_count
assert
numeric_literal
13
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartAxisAndTicks: def test_custom_tick_count(self): """Test custom tick count.""" cha...
10
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_calculate_chart_dimensions_single_bar
assert
numeric_literal
17
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartDimensions: def test_calculate_chart_dimensions_single_bar(self): """Test dimensions with...
50
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_custom_text_formats
assert
numeric_literal
22
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartTextFormatting: def test_custom_text_formats(self): """Test custom text formats are appli...
24
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_calculate_scale_basic
assert
numeric_literal
17
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartScaleCalculation: def test_calculate_scale_basic(self): """Test basic scale calculation."...
2.0
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_calculate_scale_equal_values
assert
numeric_literal
17
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartScaleCalculation: def test_calculate_scale_equal_values(self): """Test scale with all equ...
4.0
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_mixed_int_float_values
assert
variable
15
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartDataValidation: def test_mixed_int_float_values(self): """Test mixed integer and float va...
data
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/bar_chart_test.py
test_axis_enabled
assert
bool_literal
13
import pytest from unittest.mock import Mock from drawpyo.diagram_types.bar_chart import BarChart from drawpyo.diagram.text_format import TextFormat from drawpyo.diagram.objects import Object, Group class TestBarChartAxisAndTicks: def test_axis_enabled(self): """Test enabling axis.""" chart = BarC...
True
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_valid_width
assert
numeric_literal
15
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestWidthInputCheck: def test_valid_width(self) -> None: """Checks for valid width values""" assert width_input_check(1...
1
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_complex_style_dict
assert
numeric_literal
25
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestStyleStrFromDict: def test_complex_style_dict(self) -> None: """Checks a complex style dictionary""" style_dict = { ...
5
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_import_general_library
assert
numeric_literal
22
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestImportShapeDatabase: def test_import_general_library(self) -> None: """Checks the import of the shared shape library""" ...
0
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_valid_width
assert
numeric_literal
16
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestWidthInputCheck: def test_valid_width(self) -> None: """Checks for valid width values""" assert width_input_check(1)...
50
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_empty_dict
assert
string_literal
16
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestStyleStrFromDict: def test_empty_dict(self) -> None: """Checks for an empty dictionary""" result = style_str_from_di...
""
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_geometry_init_default
assert
numeric_literal
19
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestGeometry: def test_geometry_init_default(self) -> None: """Checks the default initialization of Geometry""" geom = d...
60
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_valid_width
assert
numeric_literal
17
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestWidthInputCheck: def test_valid_width(self) -> None: """Checks for valid width values""" assert width_input_check(1)...
999
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_geometry_init_default
assert
numeric_literal
18
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestGeometry: def test_geometry_init_default(self) -> None: """Checks the default initialization of Geometry""" geom = d...
120
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_geometry_init_custom
assert
numeric_literal
16
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestGeometry: def test_geometry_init_custom(self) -> None: """Checks whether a Geometry is initialized with user-defined values"...
100
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/base_diagram_test.py
test_geometry_init_custom
assert
numeric_literal
17
import pytest import drawpyo from drawpyo.diagram.base_diagram import ( color_input_check, width_input_check, style_str_from_dict, import_shape_database, ) class TestGeometry: def test_geometry_init_custom(self) -> None: """Checks whether a Geometry is initialized with user-defined values"...
200
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_set_same_child_idempotent
assert
numeric_literal
17
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryNodeBasic: def test_set_same_child_idempotent(self): """Setting the same child twice does not duplicate entries.""" parent = BinaryNodeObject(value="P") child = ...
1
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_add_left_and_add_right_assign_tree
assert
variable
25
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryTreeDiagramHelpers: def test_add_left_and_add_right_assign_tree(self): """Helpers should attach nodes to the diagram and set parent links.""" bt = BinaryTreeDiagram() ...
l
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_add_left_and_add_right_assign_tree
assert
variable
26
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryTreeDiagramHelpers: def test_add_left_and_add_right_assign_tree(self): """Helpers should attach nodes to the diagram and set parent links.""" bt = BinaryTreeDiagram() ...
r
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_replace_right_then_left_positions
assert
variable
18
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryTreeDiagramHelpers: def test_replace_right_then_left_positions(self): """Moving an existing child from right to left reorders tree_children.""" parent = BinaryNodeObject...
b
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_replace_right_then_left_positions
assert
variable
21
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryTreeDiagramHelpers: def test_replace_right_then_left_positions(self): """Moving an existing child from right to left reorders tree_children.""" parent = BinaryNodeObject...
a
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_from_dict_basic_structure
assert
numeric_literal
15
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryTreeDiagramFromDict: def test_from_dict_basic_structure(self): """Test a simple dictionary structure.""" data = {"Root": ["LeftChild", "RightChild"]} diagram = B...
3
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_from_dict_nested_structure
assert
numeric_literal
17
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryTreeDiagramFromDict: def test_from_dict_nested_structure(self): """Test a more complex nested dictionary structure.""" data = { "A": {"B": ["D", None], "C": ...
5
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_from_dict_nested_structure
assert
variable
25
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryTreeDiagramFromDict: def test_from_dict_nested_structure(self): """Test a more complex nested dictionary structure.""" data = { "A": {"B": ["D", None], "C": ...
c
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_from_dict_nested_structure
assert
variable
26
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryTreeDiagramFromDict: def test_from_dict_nested_structure(self): """Test a more complex nested dictionary structure.""" data = { "A": {"B": ["D", None], "C": ...
d
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_from_dict_nested_structure
assert
variable
29
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryTreeDiagramFromDict: def test_from_dict_nested_structure(self): """Test a more complex nested dictionary structure.""" data = { "A": {"B": ["D", None], "C": ...
e
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_move_child_between_parents_using_properties
assert
variable
17
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryNodeReparenting: def test_move_child_between_parents_using_properties(self): """Assigning a child to a new parent removes it from the old parent's children.""" p1 = Bina...
p1
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/binary_tree_diagram_test.py
test_move_child_between_parents_using_properties
assert
variable
21
import pytest import drawpyo from drawpyo.diagram_types.binary_tree import BinaryNodeObject, BinaryTreeDiagram class TestBinaryNodeReparenting: def test_move_child_between_parents_using_properties(self): """Assigning a child to a new parent removes it from the old parent's children.""" p1 = Bina...
p2
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/color_management_test.py
test_is_valid_hex_accepts_valid_hex
assert
bool_literal
16
import pytest from drawpyo import ColorScheme, StandardColor @pytest.mark.parametrize( "value", [ "#000000", "#FFFFFF", "#abcdef", "#A1B2C3", "#123abc", ], ) def test_is_valid_hex_accepts_valid_hex(value): assert ColorScheme.is_valid_hex(value) is
True
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/color_management_test.py
test_none_values_allowed
assert
none_literal
7
import pytest from drawpyo import ColorScheme, StandardColor def test_none_values_allowed(): scheme = ColorScheme(fill_color=None, stroke_color=None, font_color=None) assert scheme.fill_color is
None
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/color_management_test.py
test_is_valid_hex_rejects_invalid_hex_strings
assert
bool_literal
18
import pytest from drawpyo import ColorScheme, StandardColor @pytest.mark.parametrize( "value", [ "000000", # missing '#' "#FFFFF", # 5 chars "#FFFFFFF", # 7 chars "#ZZZZZZ", # non-hex "#12G45F", # invalid character "#12345", # short "#12345G", # w...
False
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/color_management_test.py
test_enum_resolves_to_hex_value
assert
string_literal
7
import pytest from drawpyo import ColorScheme, StandardColor def test_enum_resolves_to_hex_value(): scheme = ColorScheme(fill_color=StandardColor.BLACK) assert scheme.fill_color ==
"#000000"
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor
MerrimanInd/drawpyo
e2d29af2ecc419651df494f2735d1466335cd1c9
11
train
train
tests/diagram_tests/color_management_test.py
test_enum_allowed_in_setters
assert
string_literal
8
import pytest from drawpyo import ColorScheme, StandardColor def test_enum_allowed_in_setters(): scheme = ColorScheme() scheme.set_stroke_color(StandardColor.WHITE) assert scheme.stroke_color ==
"#FFFFFF"
e2d29af2ecc419651df494f2735d1466335cd1c9
11
v2_extractor_at_anchor