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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_paginate.py | test_empty_lines_handling | assert | collection | 63 | import pytest
from moffee.compositor import composite, Direction, Type
def sample_document():
return """
---
background-color: gray
layout: split
default_h1: true
default_h2: false
---
# Main Title
## Subtitle
Content of the first slide.
---
@(background-color=yellow)
## Second Slide
- Bullet point 1
- Bullet ... | {} | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_paginate.py | test_multiple_deco | assert | string_literal | 69 | import pytest
from moffee.compositor import composite, Direction, Type
def sample_document():
return """
---
background-color: gray
layout: split
default_h1: true
default_h2: false
---
# Main Title
## Subtitle
Content of the first slide.
---
@(background-color=yellow)
## Second Slide
- Bullet point 1
- Bullet ... | "" | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_paginate.py | test_frontmatter_parsing | assert | bool_literal | 58 | import pytest
from moffee.compositor import composite, Direction, Type
def sample_document():
return """
---
background-color: gray
layout: split
default_h1: true
default_h2: false
---
# Main Title
## Subtitle
Content of the first slide.
---
@(background-color=yellow)
## Second Slide
- Bullet point 1
- Bullet ... | True | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_deco_with_base_option | assert | bool_literal | 15 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_base_option():
line = "@(layout=split, default_h1=true, custom_key=value)"
base_option = PageOption(
layout="content", default_h1=False, default_h2=True, default_h3=True
)
updated_option = parse_deco(line, ba... | True | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_deco_with_type_conversion | assert | bool_literal | 13 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_type_conversion():
line = "@(default_h1=true, default_h2=false, layout=centered, custom_int=42, custom_float=3.14)"
base_option = PageOption()
updated_option = parse_deco(line, base_option)
assert updated_option.sty... | False | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_basic_deco | assert | string_literal | 9 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_basic_deco():
line = "@(layout=split, background=blue)"
option = parse_deco(line)
assert option.layout == | "split" | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_deco_with_type_conversion | assert | string_literal | 14 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_type_conversion():
line = "@(default_h1=true, default_h2=false, layout=centered, custom_int=42, custom_float=3.14)"
base_option = PageOption()
updated_option = parse_deco(line, base_option)
assert updated_option.sty... | "centered" | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_invalid_deco | pytest.raises | variable | 8 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_invalid_deco():
line = "This is not a deco"
with pytest.raises( | ValueError) | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_empty_deco | assert | func_call | 9 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_empty_deco():
line = "@()"
option = parse_deco(line)
assert option == | PageOption() | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_deco_with_quotes | assert | collection | 10 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_quotes():
line = "@(layout = \"split\",length='34px')"
option = parse_deco(line)
assert option.layout == "split"
assert option.styles == | {"length": "34px"} | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_basic_deco | assert | collection | 10 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_basic_deco():
line = "@(layout=split, background=blue)"
option = parse_deco(line)
assert option.layout == "split"
assert option.styles == | {"background": "blue"} | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_deco_with_base_option | assert | collection | 13 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_base_option():
line = "@(layout=split, default_h1=true, custom_key=value)"
base_option = PageOption(
layout="content", default_h1=False, default_h2=True, default_h3=True
)
updated_option = parse_deco(line, ba... | {"custom_key": "value"} | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_deco_with_hyphen | assert | collection | 9 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_hyphen():
line = "@(background-color='red')"
option = parse_deco(line)
assert option.styles == | {"background-color": "red"} | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_parse_deco.py | test_deco_with_type_conversion | assert | collection | 11 | import pytest
from moffee.compositor import parse_deco, PageOption
def test_deco_with_type_conversion():
line = "@(default_h1=true, default_h2=false, layout=centered, custom_int=42, custom_float=3.14)"
base_option = PageOption()
updated_option = parse_deco(line, base_option)
assert updated_option.st... | {"custom_int": 42, "custom_float": 3.14} | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_redirect_paths.py | test_redirect_paths_trivial | assert | variable | 36 | import pytest
import tempfile
import os
from moffee.utils.file_helper import redirect_paths
def setup_test_env():
with tempfile.TemporaryDirectory() as temp_dir:
# Setup test files and directories
doc_path = os.path.join(temp_dir, "test.md")
res_dir = os.path.join(temp_dir, "resources")
... | document | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
wbopan/moffee | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | train | train | tests/test_redirect_paths.py | test_redirect_paths | assert | variable | 42 | import pytest
import tempfile
import os
from moffee.utils.file_helper import redirect_paths
def setup_test_env():
with tempfile.TemporaryDirectory() as temp_dir:
# Setup test files and directories
doc_path = os.path.join(temp_dir, "test.md")
res_dir = os.path.join(temp_dir, "resources")
... | redirected_document | 7ff4add5da1a5aec9530b677d42fd0e6b0774168 | 26 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_datasets.py | test_get_features | self.assertIsNotNone | complex_expr | 38 | import unittest
import numpy as np
from copy import copy
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.base import LABEL_UNLABELED
from small_text.data.datasets import is_multi_label
from small_text.data.datasets import (
SklearnDataset,
DatasetView,
Te... | ds.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_datasets.py | test_get_features | assert_* | complex_expr | 54 | import unittest
import numpy as np
from copy import copy
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.base import LABEL_UNLABELED
from small_text.data.datasets import is_multi_label
from small_text.data.datasets import (
SklearnDataset,
DatasetView,
Te... | ds.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/test_datasets.py | test_get_labels | assert_* | complex_expr | 50 | import unittest
import pytest
import numpy as np
from abc import abstractmethod
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.data.exceptions import UnsupportedOperationExcept... | ds.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/test_datasets.py | test_get_labels | assert_* | complex_expr | 47 | import unittest
import pytest
import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.datasets import PytorchDatasetView
from small_text.integrat... | ds.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_factories.py | test_factory_new | self.assertEqual | complex_expr | 20 | import unittest
import pytest
from small_text.exceptions import MissingOptionalDependencyError
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
class TransformerBasedClassificationFactoryTest(unittest.TestCase):
def test_factory_new(self):
num_classes = 2
kwargs = {'lr'... | clf.lr) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/utils/testing.py | assert_csr_matrix_equal | assert_* | complex_expr | 15 | import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal, assert_raises
def assert_array_not_equal(x, y):
assert_raises(AssertionError, assert_array_equal, x, y)
def assert_csr_matrix_equal(x, y, check_shape=True):
if check_shape and x.shape != y.shape:
rai... | y.data) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/query_strategies/test_query_strategies.py | test_initialize_index_default_hnsw_kwargs | self.assertEqual | complex_expr | 53 | import unittest
import pytest
import numpy as np
from unittest.mock import Mock, patch
from numpy.testing import assert_array_equal
from sklearn.base import clone
from sklearn.preprocessing import normalize
from small_text.query_strategies.exceptions import EmptyPoolException
from small_text.classifiers import Conf... | index.M) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/pytorch/classifiers/test_kimcnn.py | test_fit_and_predict | self.assertEqual | complex_expr | 46 | import unittest
import pytest
import numpy as np
from packaging.version import parse, Version
from unittest.mock import patch
from unittest import mock
from unittest.mock import Mock
from scipy.sparse import issparse
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training... | np.int64) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/transformers/classifiers/test_classification.py | test_fit_and_predict | self.assertEqual | complex_expr | 48 | import unittest
import pytest
import warnings
import numpy as np
from packaging.version import parse, Version
from unittest import mock
from unittest.mock import patch, Mock
from scipy.sparse import issparse
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.early_s... | np.int64) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/transformers/classifiers/test_setfit.py | test_fit_and_predict | self.assertEqual | complex_expr | 46 | import unittest
import pytest
import numpy as np
from unittest.mock import create_autospec, patch
from scipy.sparse import issparse
from small_text.data.datasets import TextDataset
from small_text.exceptions import UnsupportedOperationException
from small_text.integrations.pytorch.exceptions import PytorchNotFoundErr... | np.int64) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/query_strategies/test_query_strategies.py | test_initialize_index_default_hnsw_kwargs | self.assertEqual | complex_expr | 54 | import unittest
import pytest
import numpy as np
from unittest.mock import Mock, patch
from numpy.testing import assert_array_equal
from sklearn.base import clone
from sklearn.preprocessing import normalize
from small_text.query_strategies.exceptions import EmptyPoolException
from small_text.classifiers import Conf... | index.ef) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_datasets.py | test_set_features | self.assertIsNotNone | complex_expr | 40 | import unittest
import numpy as np
from copy import copy
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.base import LABEL_UNLABELED
from small_text.data.datasets import is_multi_label
from small_text.data.datasets import (
SklearnDataset,
DatasetView,
Te... | ds_new.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_datasets.py | test_set_features | assert_* | complex_expr | 57 | import unittest
import numpy as np
from copy import copy
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.base import LABEL_UNLABELED
from small_text.data.datasets import is_multi_label
from small_text.data.datasets import (
SklearnDataset,
DatasetView,
Te... | ds_new.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_datasets.py | test_indexing_single_index | assert_* | complex_expr | 59 | import unittest
import numpy as np
from copy import copy
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.base import LABEL_UNLABELED
from small_text.data.datasets import is_multi_label
from small_text.data.datasets import (
SklearnDataset,
DatasetView,
Te... | result.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_datatset_views.py | test_indexing_single_index | assert_* | complex_expr | 99 | import unittest
import numpy as np
from copy import copy
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.data.datasets import (
DatasetView,
SklearnDataset,
SklearnDatasetView,
TextDataset,
TextDatasetView
)
from small_text.data.exceptions import U... | result.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/test_datasets.py | test_init | self.assertIsNotNone | complex_expr | 42 | import unittest
import pytest
import numpy as np
from abc import abstractmethod
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.data.exceptions import UnsupportedOperationExcept... | ds._data) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/test_datasets.py | test_indexing_list_index | assert_* | complex_expr | 49 | import unittest
import pytest
import numpy as np
from abc import abstractmethod
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.data.exceptions import UnsupportedOperationExcept... | result.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/test_datasets.py | test_set_labels | assert_* | complex_expr | 45 | import unittest
import pytest
import numpy as np
from abc import abstractmethod
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.data.exceptions import UnsupportedOperationExcept... | ds_new.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/test_datasets.py | test_init | self.assertIsNotNone | complex_expr | 39 | import unittest
import pytest
import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.datasets import PytorchDatasetView
from small_text.integrat... | ds._data) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/test_datasets.py | test_set_features | assert_* | complex_expr | 42 | import unittest
import pytest
import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.datasets import PytorchDatasetView
from small_text.integrat... | ds_new.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/test_datasets.py | test_indexing_list_index | assert_* | complex_expr | 46 | import unittest
import pytest
import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.datasets import PytorchDatasetView
from small_text.integrat... | result.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/test_datasets.py | test_set_labels | assert_* | complex_expr | 42 | import unittest
import pytest
import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.datasets import PytorchDatasetView
from small_text.integrat... | ds_new.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/utils/testing.py | assert_csr_matrix_equal | assert_* | complex_expr | 17 | import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal, assert_raises
def assert_array_not_equal(x, y):
assert_raises(AssertionError, assert_array_equal, x, y)
def assert_csr_matrix_equal(x, y, check_shape=True):
if check_shape and x.shape != y.shape:
rai... | y.indptr) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/pytorch/classifiers/test_kimcnn.py | test_fit_and_validate | self.assertTrue | complex_expr | 39 | import unittest
import pytest
import numpy as np
from packaging.version import parse, Version
from unittest.mock import patch
from unittest import mock
from unittest.mock import Mock
from scipy.sparse import issparse
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training... | loss >= 0) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/transformers/classifiers/test_classification.py | test_fit_with_class_weight | self.assertIsNotNone | complex_expr | 36 | import unittest
import pytest
import warnings
import numpy as np
from packaging.version import parse, Version
from unittest import mock
from unittest.mock import patch, Mock
from scipy.sparse import issparse
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.early_s... | clf.model) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_dataset_construction.py | test_from_arrays_with_lists | assert_* | complex_expr | 23 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.feature_extraction.text import TfidfVectorizer
from unittest.mock import patch
from small_text.data import SklearnDataset, TextDataset
from tests.utils.datasets import random_labeling, random_labels
from tests.utils.testing i... | dataset.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_dataset_construction.py | test_from_arrays_with_lists | assert_* | complex_expr | 24 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.feature_extraction.text import TfidfVectorizer
from unittest.mock import patch
from small_text.data import SklearnDataset, TextDataset
from tests.utils.datasets import random_labeling, random_labels
from tests.utils.testing i... | dataset.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_sampling.py | test_stratified_sampling | self.assertEqual | complex_expr | 24 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.data import balanced_sampling, stratified_sampling
from small_text.data.sampling import _get_class_histogram
from small_text.utils.labels import list_to_csr
class StratifiedSamplingTest... | counts[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_sampling.py | test_stratified_sampling | self.assertEqual | complex_expr | 25 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.data import balanced_sampling, stratified_sampling
from small_text.data.sampling import _get_class_histogram
from small_text.utils.labels import list_to_csr
class StratifiedSamplingTest... | counts[1]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_sampling.py | test_stratified_sampling | self.assertEqual | complex_expr | 26 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.data import balanced_sampling, stratified_sampling
from small_text.data.sampling import _get_class_histogram
from small_text.utils.labels import list_to_csr
class StratifiedSamplingTest... | counts[2]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_sampling.py | test_stratified_sampling | self.assertEqual | complex_expr | 27 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.data import balanced_sampling, stratified_sampling
from small_text.data.sampling import _get_class_histogram
from small_text.utils.labels import list_to_csr
class StratifiedSamplingTest... | counts[3]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_setfit.py | test_init | self.assertIsNone | complex_expr | 33 | import os
import unittest
import pytest
import small_text
from importlib import reload
from packaging.version import parse, Version
from unittest.mock import patch
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.utils.logging import VERBOSITY_QUIET, VERBOSITY_MORE_VERBOSE
... | clf.model) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/query_strategies/test_multi_label.py | test_label_cardinality_inconsistency_average_two_labels | self.assertEqual | complex_expr | 30 | import unittest
import numpy as np
from scipy.sparse import csr_matrix
from small_text.query_strategies.multi_label import (
CategoryVectorInconsistencyAndRanking,
_label_cardinality_inconsistency,
LabelCardinalityInconsistency,
_uncertainty_weighted_label_cardinality_inconsistency,
AdaptiveActive... | lci.shape) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/utils/testing.py | assert_csr_matrix_equal | assert_* | complex_expr | 16 | import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal, assert_raises
def assert_array_not_equal(x, y):
assert_raises(AssertionError, assert_array_equal, x, y)
def assert_csr_matrix_equal(x, y, check_shape=True):
if check_shape and x.shape != y.shape:
rai... | y.indices) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/classifiers/test_base.py | test_default_init | self.assertEqual | complex_expr | 19 | import pytest
import unittest
from unittest.mock import Mock, patch
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.model_selection import ModelSelection, NoopModelSelection
from tests.utils.datasets import random_text_classification_dataset
class SimplePytorchCla... | clf.device) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_setfit.py | test_init | self.assertIsNone | complex_expr | 32 | import os
import unittest
import pytest
import small_text
from importlib import reload
from packaging.version import parse, Version
from unittest.mock import patch
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.utils.logging import VERBOSITY_QUIET, VERBOSITY_MORE_VERBOSE
... | clf.device) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/query_strategies/test_strategies.py | _query | self.assertEqual | complex_expr | 102 | import unittest
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
from scipy.sparse import csr_matrix
from sklearn.preprocessing import normalize
from unittest.mock import patch, Mock
from small_text.classifiers import ConfidenceEnhancedLinearSVC, SklearnClassifier
from small... | y.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/query_strategies/test_query_strategies.py | test_initialize_index_default_hnsw_kwargs | self.assertEqual | complex_expr | 51 | import unittest
import pytest
import numpy as np
from unittest.mock import Mock, patch
from numpy.testing import assert_array_equal
from sklearn.base import clone
from sklearn.preprocessing import normalize
from small_text.query_strategies.exceptions import EmptyPoolException
from small_text.classifiers import Conf... | index.space) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_datatset_views.py | _clone_test | assert_* | complex_expr | 59 | import unittest
import numpy as np
from copy import copy
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.data.datasets import (
DatasetView,
SklearnDataset,
SklearnDatasetView,
TextDataset,
TextDatasetView
)
from small_text.data.exceptions import U... | ds_cloned.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/data/test_datatset_views.py | _clone_test | assert_* | complex_expr | 43 | import unittest
import numpy as np
from copy import copy
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.data.datasets import (
DatasetView,
SklearnDataset,
SklearnDatasetView,
TextDataset,
TextDatasetView
)
from small_text.data.exceptions import U... | ds_cloned.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/test_datasets.py | test_clone | assert_* | complex_expr | 69 | import unittest
import pytest
import numpy as np
from abc import abstractmethod
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.data.exceptions import UnsupportedOperationExcept... | ds_cloned.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/test_datasets.py | test_clone | assert_* | complex_expr | 49 | import unittest
import pytest
import numpy as np
from abc import abstractmethod
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.data.exceptions import UnsupportedOperationExcept... | ds_cloned.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/test_datasets.py | test_clone | assert_* | complex_expr | 41 | import unittest
import pytest
import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.datasets import PytorchDatasetView
from small_text.integrat... | ds_cloned.x) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/test_datasets.py | test_clone | assert_* | complex_expr | 43 | import unittest
import pytest
import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from parameterized import parameterized_class
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.datasets import PytorchDatasetView
from small_text.integrat... | ds_cloned.y) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/query_strategies/test_multi_label.py | test_label_cardinality_inconsistency_average_one_and_a_half_labels | self.assertEqual | complex_expr | 28 | import unittest
import numpy as np
from scipy.sparse import csr_matrix
from small_text.query_strategies.multi_label import (
CategoryVectorInconsistencyAndRanking,
_label_cardinality_inconsistency,
LabelCardinalityInconsistency,
_uncertainty_weighted_label_cardinality_inconsistency,
AdaptiveActive... | uwlci.shape) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/utils/test_classification.py | test_empty_result_single_label_proba | self.assertEqual | complex_expr | 20 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from sklearn.preprocessing import MultiLabelBinarizer
from small_text.utils.classification import empty_result, prediction_result
from tests.utils.testing import assert_csr_matrix_equal
class Classifi... | proba.dtype) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/utils/test_classification.py | test_empty_result_single_label_proba | self.assertEqual | complex_expr | 21 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from sklearn.preprocessing import MultiLabelBinarizer
from small_text.utils.classification import empty_result, prediction_result
from tests.utils.testing import assert_csr_matrix_equal
class Classifi... | proba.shape) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/pytorch/classifiers/test_kimcnn.py | test_fit_with_optimizer_and_scheduler | self.assertEqual | complex_expr | 47 | import unittest
import pytest
import numpy as np
from packaging.version import parse, Version
from unittest.mock import patch
from unittest import mock
from unittest.mock import Mock
from scipy.sparse import issparse
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training... | call_args[5]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/pytorch/classifiers/test_kimcnn.py | test_fit_with_optimizer_and_scheduler | self.assertEqual | complex_expr | 48 | import unittest
import pytest
import numpy as np
from packaging.version import parse, Version
from unittest.mock import patch
from unittest import mock
from unittest.mock import Mock
from scipy.sparse import issparse
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training... | call_args[6]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/transformers/classifiers/test_setfit.py | test_fit_and_predict | self.assertEqual | complex_expr | 44 | import unittest
import pytest
import numpy as np
from unittest.mock import create_autospec, patch
from scipy.sparse import issparse
from small_text.data.datasets import TextDataset
from small_text.exceptions import UnsupportedOperationException
from small_text.integrations.pytorch.exceptions import PytorchNotFoundErr... | y_pred.shape) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/utils/test_labels.py | test_get_flattened_unique_labels_no_labels | self.assertEqual | complex_expr | 16 | import unittest
import pytest
import numpy as np
from scipy.sparse import csr_matrix
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
class LabelsUtilsForPytorchTextClassificationDatasetTest(unittest.TestCase):
def test_get_flattened_unique_labels_no_labels(self):
dataset = ra... | labels.shape) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_classification.py | test_fit_with_optimizer_and_scheduler | self.assertEqual | complex_expr | 46 | import os
import unittest
import pytest
import small_text
import numpy as np
from importlib import reload
from unittest.mock import patch
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.early_stopping import EarlyStoppin... | call_args[5]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_classification.py | test_fit_with_optimizer_and_scheduler | self.assertEqual | complex_expr | 47 | import os
import unittest
import pytest
import small_text
import numpy as np
from importlib import reload
from unittest.mock import patch
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.early_stopping import EarlyStoppin... | call_args[6]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/query_strategies/test_base.py | test_argselect_n_equals_input_size | assert_* | complex_expr | 21 | import unittest
import scipy
import numpy as np
from small_text.classifiers.classification import SklearnClassifier, ConfidenceEnhancedLinearSVC
from small_text.query_strategies.base import ClassificationType, argselect, constraints
from small_text.query_strategies.strategies import RandomSampling
from numpy.testing... | arr[indices]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/utils/test_labels.py | test_list_to_csr | self.assertEqual | complex_expr | 29 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.base import LABEL_IGNORED, LABEL_UNLABELED
from small_text.utils.labels import (
concatenate,
csr_to_list,
get_flattened_unique_labels,
get_ignored_labels_mask,
get_n... | result.dtype) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/utils/test_labels.py | test_get_flattened_unique_labels_no_labels | self.assertEqual | complex_expr | 28 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix
from small_text.base import LABEL_IGNORED, LABEL_UNLABELED
from small_text.utils.labels import (
concatenate,
csr_to_list,
get_flattened_unique_labels,
get_ignored_labels_mask,
get_n... | labels.shape) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/pytorch/classifiers/test_kimcnn.py | test_fit_and_validate | self.assertTrue | complex_expr | 40 | import unittest
import pytest
import numpy as np
from packaging.version import parse, Version
from unittest.mock import patch
from unittest import mock
from unittest.mock import Mock
from scipy.sparse import issparse
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training... | 0 <= acc <= 1) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/classifiers/test_kimcnn.py | test_init_default_parameters | self.assertEqual | complex_expr | 33 | import unittest
import pytest
import numpy as np
from unittest.mock import patch
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.metrics import Metric
from small_text.training.early_stopping import EarlyStopping, EarlySto... | classifier.lr) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/utils/test_loss.py | test_loss_fct | self.assertEqual | complex_expr | 18 | import unittest
import pytest
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
class LossTest(unittest.TestCase):
def test_loss_fct(self):
loss_fct = _LossAdapter2DTo1D(BCEWithLogitsLoss(reduction='none'))
input = torch.randn(5, 3)
target = torch.empty(5, 3).ra... | loss.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_classification.py | test_init | self.assertEqual | complex_expr | 28 | import os
import unittest
import pytest
import small_text
import numpy as np
from importlib import reload
from unittest.mock import patch
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.early_stopping import EarlyStoppin... | classifier.lr) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_setfit.py | test_init | self.assertEqual | complex_expr | 34 | import os
import unittest
import pytest
import small_text
from importlib import reload
from packaging.version import parse, Version
from unittest.mock import patch
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.utils.logging import VERBOSITY_QUIET, VERBOSITY_MORE_VERBOSE
... | clf.verbosity) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/utils/test_clustering.py | test_init_kmeans_plusplus_safe | self.assertEqual | complex_expr | 25 | import unittest
import pytest
import numpy as np
from unittest.mock import patch
from small_text.utils.clustering import init_kmeans_plusplus_safe
class ClusteringUtilsTest(unittest.TestCase):
@patch('small_text.utils.clustering.warnings.warn')
@patch('small_text.utils.clustering.choice')
@patch('small_... | centers.shape) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/classifiers/test_svm.py | test_predict_binary_with_probas | self.assertEqual | complex_expr | 32 | import unittest
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer
from small_text.classifiers import ConfidenceEnhancedLinearSVC
class ConfidenceEnhancedLinearSVCIntegrationTest(unittest.TestCase):
def _get_20news_vectors(self, categories=None):
... | proba.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/classifiers/test_svm.py | test_predict_binary_with_probas | self.assertEqual | complex_expr | 33 | import unittest
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer
from small_text.classifiers import ConfidenceEnhancedLinearSVC
class ConfidenceEnhancedLinearSVCIntegrationTest(unittest.TestCase):
def _get_20news_vectors(self, categories=None):
... | proba.shape[1]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/transformers/classifiers/test_classification_embeddings.py | test_embed_with_proba | self.assertEqual | complex_expr | 33 | import unittest
import pytest
from unittest import mock
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from tests.utils.datasets import twenty_news_transformers
from tests.utils.testing import assert_array_not_equal
class _EmbeddingTest(object):
def test_embed_with_proba(self):
... | proba.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/classifiers/test_classifiers.py | test_predict_proba_on_empty_data | self.assertEqual | complex_expr | 31 | import unittest
import numpy as np
from scipy.sparse import csr_matrix
from small_text.base import LABEL_UNLABELED
from small_text.classifiers.classification import ConfidenceEnhancedLinearSVC, SklearnClassifier
from small_text.data.datasets import SklearnDataset
from tests.utils.datasets import random_sklearn_datas... | proba.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/classifiers/test_base.py | test_get_default_criterion_use_sample_weights_binary | self.assertEqual | complex_expr | 25 | import pytest
import unittest
from unittest.mock import Mock, patch
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.model_selection import ModelSelection, NoopModelSelection
from tests.utils.datasets import random_text_classification_dataset
class SimplePytorchCla... | loss.reduction) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/classifiers/test_kimcnn.py | test_predict_proba_on_empty_data | self.assertEqual | complex_expr | 28 | import unittest
import pytest
import numpy as np
from unittest.mock import patch
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.metrics import Metric
from small_text.training.early_stopping import EarlyStopping, EarlySto... | proba.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_classification.py | test_predict_proba_on_empty_data | self.assertEqual | complex_expr | 29 | import os
import unittest
import pytest
import small_text
import numpy as np
from importlib import reload
from unittest.mock import patch
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.early_stopping import EarlyStoppin... | proba.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/classifiers/test_svm.py | test_predict_binary | self.assertEqual | complex_expr | 28 | import unittest
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer
from small_text.classifiers import ConfidenceEnhancedLinearSVC
class ConfidenceEnhancedLinearSVCIntegrationTest(unittest.TestCase):
def _get_20news_vectors(self, categories=None):
... | y_pred.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/pytorch/classifiers/test_kimcnn.py | test_fit_and_predict | self.assertEqual | complex_expr | 39 | import unittest
import pytest
import numpy as np
from packaging.version import parse, Version
from unittest.mock import patch
from unittest import mock
from unittest.mock import Mock
from scipy.sparse import issparse
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training... | y_pred.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/transformers/classifiers/test_classification.py | test_fit_validate | self.assertTrue | complex_expr | 47 | import unittest
import pytest
import warnings
import numpy as np
from packaging.version import parse, Version
from unittest import mock
from unittest.mock import patch, Mock
from scipy.sparse import issparse
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.early_s... | valid_loss >= 0) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/classifiers/test_factories.py | test_new | self.assertEqual | complex_expr | 23 | import unittest
from sklearn.svm import LinearSVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.utils.validation import check_is_fitted, NotFittedError
from small_text.classifiers.classification import SklearnClassifier
from small_text.classifiers.factories import SklearnClassifierFactory
from tests... | clf.num_classes) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/classifiers/test_factories.py | test_new_with_multi_label_kwarg | self.assertTrue | complex_expr | 25 | import unittest
from sklearn.svm import LinearSVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.utils.validation import check_is_fitted, NotFittedError
from small_text.classifiers.classification import SklearnClassifier
from small_text.classifiers.factories import SklearnClassifierFactory
from tests... | clf.multi_label) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/classifiers/test_base.py | test_default_init | self.assertFalse | complex_expr | 18 | import pytest
import unittest
from unittest.mock import Mock, patch
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.model_selection import ModelSelection, NoopModelSelection
from tests.utils.datasets import random_text_classification_dataset
class SimplePytorchCla... | clf.multi_label) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/classifiers/test_factories.py | test_factory_new | self.assertEqual | complex_expr | 18 | import unittest
import pytest
import numpy as np
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
class KimCNNFactoryTest(unittest.TestCase):
def test_factory_new(self):
vocab_length = 10
embedding_matrix = torch.Tensor(np.random.rand(vocab_length, 100))
factor... | clf.num_classes) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/models/test_kimcnn.py | test_init_parameters_default | self.assertEqual | complex_expr | 45 | import unittest
import pytest
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
class KimCNNInitTest(unittest.TestCase):
DEFAULT_KERNEL_HEIGHTS = [3, 4, 5]
def test_init_parameters_default(self):
vocab_size = 1000
max_seq_length = 50
model = KimCNN(vocab_s... | model.dropout.p) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/test_strategies.py | test_init_default | self.assertEqual | complex_expr | 16 | import unittest
import pytest
import numpy as np
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
class ExpectedGradientLengthTest(unittest.TestCase):
def test_init_default(self):
strategy = ExpectedGradientLength(2)
self.assertEqual(2, strategy.num_classes)
s... | strategy.device) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_factories.py | test_factory_new | self.assertEqual | complex_expr | 19 | import unittest
import pytest
from small_text.exceptions import MissingOptionalDependencyError
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
class TransformerBasedClassificationFactoryTest(unittest.TestCase):
def test_factory_new(self):
num_classes = 2
kwargs = {'lr'... | clf.num_classes) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/classifiers/test_setfit.py | test_init | self.assertEqual | complex_expr | 26 | import os
import unittest
import pytest
import small_text
from importlib import reload
from packaging.version import parse, Version
from unittest.mock import patch
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.utils.logging import VERBOSITY_QUIET, VERBOSITY_MORE_VERBOSE
... | clf.num_classes) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/transformers/utils/test_classification.py | _assert_params | self.assertTrue | complex_expr | 17 | import unittest
import pytest
import numpy as np
from unittest.mock import patch, MagicMock
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
class BuildLayerSpecificParamsTest(unittest.TestCase):
def _assert_params(self, params, base_lr, num_different_lrs):
self.assertIsNotNon... | param['lr'] > 0) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/integration/small_text/integrations/transformers/query_strategies/test_dal.py | test_query_with_transformer_models | self.assertEqual | complex_expr | 29 | import unittest
import pytest
import numpy as np
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.query_strategies import DiscriminativeActiveLearning
class DiscriminativeActiveLearningTest(unittest.TestCase):
def test_query_with_transformer_models(self):
trans... | indices.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/initialization/test_strategies.py | test_random_initialization_stratified_multilabel | self.assertEqual | complex_expr | 26 | import unittest
import numpy as np
from unittest.mock import patch
from scipy.sparse import csr_matrix
from small_text.data import balanced_sampling, stratified_sampling
from small_text.initialization import random_initialization, \
random_initialization_stratified, random_initialization_balanced
from tests.util... | indices.shape[0]) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
webis-de/small-text | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | train | train | tests/unit/small_text/integrations/pytorch/classifiers/test_kimcnn.py | test_init_default_parameters | self.assertIsNone | complex_expr | 44 | import unittest
import pytest
import numpy as np
from unittest.mock import patch
from small_text.base import LABEL_UNLABELED
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_text.training.metrics import Metric
from small_text.training.early_stopping import EarlyStopping, EarlySto... | classifier.model) | 62e6f754f4a383f0bfba2f02ab272fe2ab5aac2e | 181 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.