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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_linalg.py | test_linspace | assert | variable | 13 | import pytest
from geomdl import linalg
GEOMDL_DELTA = 10e-6
def test_linspace():
start = 5
stop = 11
num = 4
result = [5.0, 7.0, 9.0, 11.0]
to_check = linalg.linspace(start, stop, num)
assert to_check == | result | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_linalg.py | test_vector_multiply | assert | variable | 10 | import pytest
from geomdl import linalg
GEOMDL_DELTA = 10e-6
def test_vector_multiply():
result = [2, 4, 6]
computed = linalg.vector_multiply((1, 2, 3), 2)
assert result == | computed | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_linalg.py | test_vector_dot3 | pytest.raises | variable | 8 | import pytest
from geomdl import linalg
GEOMDL_DELTA = 10e-6
def test_vector_dot3():
with pytest.raises( | TypeError) | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_linalg.py | test_vector_dot1 | pytest.raises | variable | 8 | import pytest
from geomdl import linalg
GEOMDL_DELTA = 10e-6
def test_vector_dot1():
with pytest.raises( | ValueError) | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_read_write.py | test_export_obj_single | assert | numeric_literal | 74 | import os
import pytest
from geomdl import BSpline, NURBS
from geomdl import multi
from geomdl import exchange
from geomdl import exchange_vtk
from geomdl import compatibility
from geomdl import operations
FILE_NAME = 'testing'
SAMPLE_SIZE = 25
def bspline_curve3d():
""" Creates a B-Spline 3-dimensional curve in... | 0 | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_surfgen.py | test_grid_reset1 | assert | numeric_literal | 30 | import os
import pytest
from geomdl import CPGen
GRID_TOL = 10e-8
def grid():
""" Generates a 3x4 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.generate(3, 4)
return surfgrid
def grid2():
""" Generates a 6x6 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.gen... | 0 | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_surfgen.py | test_grid_generate5 | assert | numeric_literal | 30 | import os
import pytest
from geomdl import CPGen
GRID_TOL = 10e-8
def grid():
""" Generates a 3x4 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.generate(3, 4)
return surfgrid
def grid2():
""" Generates a 6x6 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.gen... | 13 | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_surfgen.py | test_grid_generate5 | assert | numeric_literal | 31 | import os
import pytest
from geomdl import CPGen
GRID_TOL = 10e-8
def grid():
""" Generates a 3x4 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.generate(3, 4)
return surfgrid
def grid2():
""" Generates a 6x6 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.gen... | 17 | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_surfgen.py | test_grid_generate5 | assert | numeric_literal | 32 | import os
import pytest
from geomdl import CPGen
GRID_TOL = 10e-8
def grid():
""" Generates a 3x4 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.generate(3, 4)
return surfgrid
def grid2():
""" Generates a 6x6 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.gen... | 14 | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_surfgen.py | test_grid_generate5 | assert | numeric_literal | 33 | import os
import pytest
from geomdl import CPGen
GRID_TOL = 10e-8
def grid():
""" Generates a 3x4 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.generate(3, 4)
return surfgrid
def grid2():
""" Generates a 6x6 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.gen... | 18 | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_surfgen.py | test_grid_reset1 | assert | collection | 29 | import os
import pytest
from geomdl import CPGen
GRID_TOL = 10e-8
def grid():
""" Generates a 3x4 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.generate(3, 4)
return surfgrid
def grid2():
""" Generates a 6x6 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.gen... | [] | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_surfgen.py | test_grid | assert | variable | 34 | import os
import pytest
from geomdl import CPGen
GRID_TOL = 10e-8
def grid():
""" Generates a 3x4 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.generate(3, 4)
return surfgrid
def grid2():
""" Generates a 6x6 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.gen... | result | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_surfgen.py | test_grid_weight2 | pytest.raises | variable | 27 | import os
import pytest
from geomdl import CPGen
GRID_TOL = 10e-8
def grid():
""" Generates a 3x4 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.generate(3, 4)
return surfgrid
def grid2():
""" Generates a 6x6 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.gen... | TypeError) | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_surfgen.py | test_grid_generate1 | pytest.raises | variable | 28 | import os
import pytest
from geomdl import CPGen
GRID_TOL = 10e-8
def grid():
""" Generates a 3x4 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.generate(3, 4)
return surfgrid
def grid2():
""" Generates a 6x6 control points grid """
surfgrid = CPGen.Grid(7, 13)
surfgrid.gen... | ValueError) | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_utils.py | test_generate_knot_vector4 | assert | variable | 12 | import pytest
from geomdl import utilities
GEOMDL_DELTA = 10e-6
def test_generate_knot_vector4():
degree = 4
num_ctrlpts = 12
autogen_kv = utilities.generate_knot_vector(degree, num_ctrlpts)
result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0, 1.0, 1.0, 1.0, 1.0]
a... | result | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_utils.py | test_normalize_knot_vector2 | assert | variable | 11 | import pytest
from geomdl import utilities
GEOMDL_DELTA = 10e-6
def test_normalize_knot_vector2():
input_kv = (-5, -5, -3, -2, 2, 3, 5, 5)
output_kv = [0.0, 0.0, 0.2, 0.3, 0.7, 0.8, 1.0, 1.0]
to_check = utilities.normalize_knot_vector(input_kv)
assert to_check == | output_kv | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_utils.py | test_check_knot_vector5 | pytest.raises | variable | 10 | import pytest
from geomdl import utilities
GEOMDL_DELTA = 10e-6
def test_check_knot_vector5():
degree = 4
num_ctrlpts = 12
with pytest.raises( | TypeError) | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_utils.py | test_generate_knot_vector1 | pytest.raises | variable | 8 | import pytest
from geomdl import utilities
GEOMDL_DELTA = 10e-6
def test_generate_knot_vector1():
with pytest.raises( | ValueError) | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
orbingol/NURBS-Python | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | train | train | tests/test_visualization.py | test_curve2d_fig_nowindow | assert | numeric_literal | 97 | import os
import pytest
from geomdl import BSpline
from geomdl import multi
from geomdl import operations
import matplotlib
matplotlib.use('agg')
from geomdl.visualization import VisMPL
SAMPLE_SIZE = 5
def bspline_curve2d():
""" Creates a 2-dimensional B-Spline curve instance """
# Create a curve instance
... | 0 | a3589a79c6e54f52417b1b03272baaf2fddd167a | 110 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | ice/recipes/evaluate_result.py | run | assert | none_literal | 149 | from pydantic import BaseModel
from structlog.stdlib import get_logger
from ice.recipe import Recipe
from ice.utils import max_by_value
log = get_logger()
def make_compare_results_prompt(
*, question: str, model_result: str, gold_result: str
) -> str:
return f"""Compare the following results from a machine l... | None | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_warn_stop_early | assert | variable | 27 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | events | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_apply_transforms | pytest.raises | variable | 19 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | KeyError) | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_apply_transforms | assert | string_literal | 27 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | f"{special} three" | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_parse_and_unparse_are_inverses | assert | variable | 21 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | complex_format_string | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_shared | assert | string_literal | 25 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | "pizza and ice cream" | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_apply_transforms | assert | string_literal | 38 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | "1. 1...2. 2...3. 3 three" | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_apply_transforms | assert | collection | 43 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | ("first this", "second that") | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_shared | assert | collection | 21 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | ("pizza and fries", "hotdogs and fries") | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_stop_partial | assert | collection | 22 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | ( "We can start in Egypt and keep going to France.", "We can start partying.", ) | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_multi.py | test_warn_stop_early | assert | collection | 28 | import pytest
from structlog.testing import capture_logs
from ice.formatter.multi import _parse
from ice.formatter.multi import _STOP_EARLY_WARNING
from ice.formatter.multi import _unparse
from ice.formatter.multi import format_multi
from ice.formatter.multi import stop
from ice.formatter.transform.dependent import C... | ( "We can start partying.", "We can start in Egypt and keep going to France.", ) | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_transform/test_dependent.py | test_plural_transform | assert | string_literal | 12 | import pytest
from ice.formatter.transform.dependent import CountWord
from ice.formatter.transform.dependent import DependentTransform
from ice.formatter.transform.dependent import plural_transform
@pytest.mark.parametrize(("case", "expected"), (((1, 2, 3), "are"), (1, "is")))
def test_plural_transform(case, expected... | "key" | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_transform/test_dependent.py | test_plural_transform | assert | variable | 13 | import pytest
from ice.formatter.transform.dependent import CountWord
from ice.formatter.transform.dependent import DependentTransform
from ice.formatter.transform.dependent import plural_transform
@pytest.mark.parametrize(("case", "expected"), (((1, 2, 3), "are"), (1, "is")))
def test_plural_transform(case, expected... | expected | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_formatter/test_transform/test_value.py | test_numbered_list | assert | string_literal | 9 | from ice.formatter.transform.value import numbered_list
from ice.formatter.transform.value import ValueTransform
def test_numbered_list():
value = ["Paragraph Uno.", "Paragraph Dos "]
xform = numbered_list(value, separator="\n\n")
assert isinstance(xform, ValueTransform)
assert xform.transform() == | "1. Paragraph Uno.\n\n2. Paragraph Dos" | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_iterables | assert | collection | 13 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_iterables():
assert to_json_value([1, 2, 3]) == [1, 2, 3]
assert to_json_value((1, 2, 3)) == [1, 2, 3]
# Sets are unordered, so use a singleton for testing
assert ... | [1] | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_primitives | assert | variable | 13 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_primitives():
things = [1, 2.3, None, "4", True, False]
assert to_json_value(things) == things
for thing in things:
assert to_json_value(thing) is | thing | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_repr | assert | string_literal | 19 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_repr():
class Foo:
def dict(self, x):
# This doesn't get used because it has a parameter,
# which leads to raising a TypeError when .dict() is c... | "Foo" | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_primitives | assert | variable | 11 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_primitives():
things = [1, 2.3, None, "4", True, False]
assert to_json_value(things) == | things | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_iterables | assert | collection | 10 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_iterables():
assert to_json_value([1, 2, 3]) == | [1, 2, 3] | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_non_str_keys | assert | collection | 10 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_non_str_keys():
assert to_json_value({"a": 1, 2: 3}) == | {"a": 1, "2": 3} | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_objects | assert | collection | 11 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_objects():
assert to_json_value(MyDataClass([1, 2, 3])) == {"things": [1, 2, 3]}
assert to_json_value(MyModel(stuff={"a": 1})) == | {"stuff": {"a": 1}} | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_objects | assert | collection | 10 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_objects():
assert to_json_value(MyDataClass([1, 2, 3])) == | {"things": [1, 2, 3]} | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_function | assert | collection | 13 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_function():
def foo():
pass
assert to_json_value(foo) == | { "class_name": "function", "name": "foo", } | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_objects | assert | collection | 12 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_objects():
assert to_json_value(MyDataClass([1, 2, 3])) == {"things": [1, 2, 3]}
assert to_json_value(MyModel(stuff={"a": 1})) == {"stuff": {"a": 1}}
asser | { "things": [ { "stuff": { "foo": { "things": [ "a", "b", ] }, "bar": 9, } }, "c", ] } | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_json.py | test_f | assert | collection | 11 | from dataclasses import dataclass
from fvalues import F
from pydantic import BaseModel
from ice.json_value import to_json_value
def test_f():
f = F(f"hello {1 + 2} world")
assert to_json_value(f) == | { "__fstring__": [ "hello ", {"formatted": "3", "source": "1 + 2", "value": 3}, " world", ] } | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_metrics.py | test_gold_paragraphs | assert | numeric_literal | 22 | import numpy as np
from pytest import mark
from ice.metrics.base import reduce_scores_dict
from ice.metrics.base import Sample
from ice.metrics.gold_paragraphs import get_gold_paragraph_df
from ice.metrics.nubia import Nubia
from ice.metrics.rouge import Rouge
@mark.skip(reason="Parses all PDFs - very slow")
@mark.s... | 20 | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_metrics.py | test_nubia | assert | numeric_literal | 23 | import numpy as np
from pytest import mark
from ice.metrics.base import reduce_scores_dict
from ice.metrics.base import Sample
from ice.metrics.gold_paragraphs import get_gold_paragraph_df
from ice.metrics.nubia import Nubia
from ice.metrics.rouge import Rouge
@mark.skip(reason="Requires OUGHT_INFERENCE_API_KEY")
@m... | 0.99 | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_metrics.py | test_rouge_basic_precision | assert | complex_expr | 23 | import numpy as np
from pytest import mark
from ice.metrics.base import reduce_scores_dict
from ice.metrics.base import Sample
from ice.metrics.gold_paragraphs import get_gold_paragraph_df
from ice.metrics.nubia import Nubia
from ice.metrics.rouge import Rouge
@mark.anyio
async def test_rouge_basic_precision():
... | 3 / 4 | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_metrics.py | test_rouge_basic_precision | assert | complex_expr | 24 | import numpy as np
from pytest import mark
from ice.metrics.base import reduce_scores_dict
from ice.metrics.base import Sample
from ice.metrics.gold_paragraphs import get_gold_paragraph_df
from ice.metrics.nubia import Nubia
from ice.metrics.rouge import Rouge
@mark.anyio
async def test_rouge_basic_precision():
... | 1 / 3 | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_metrics.py | test_rouge_recall | assert | variable | 27 | import numpy as np
from pytest import mark
from ice.metrics.base import reduce_scores_dict
from ice.metrics.base import Sample
from ice.metrics.gold_paragraphs import get_gold_paragraph_df
from ice.metrics.nubia import Nubia
from ice.metrics.rouge import Rouge
@mark.anyio
@mark.parametrize(
"left,right,expected_... | expected_result | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_metrics.py | test_rouge_multiple_hypotheses_and_references_matches_single_score_when_inputs_are_identical | assert | variable | 27 | import numpy as np
from pytest import mark
from ice.metrics.base import reduce_scores_dict
from ice.metrics.base import Sample
from ice.metrics.gold_paragraphs import get_gold_paragraph_df
from ice.metrics.nubia import Nubia
from ice.metrics.rouge import Rouge
@mark.anyio
async def test_rouge_multiple_hypotheses_and... | scores_repeated | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_metrics.py | test_reduce_scores_to_single_value | assert | variable | 17 | import numpy as np
from pytest import mark
from ice.metrics.base import reduce_scores_dict
from ice.metrics.base import Sample
from ice.metrics.gold_paragraphs import get_gold_paragraph_df
from ice.metrics.nubia import Nubia
from ice.metrics.rouge import Rouge
def test_reduce_scores_to_single_value():
scores = [... | calculated_reduced_scores | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_metrics.py | test_gold_paragraphs | assert | complex_expr | 18 | import numpy as np
from pytest import mark
from ice.metrics.base import reduce_scores_dict
from ice.metrics.base import Sample
from ice.metrics.gold_paragraphs import get_gold_paragraph_df
from ice.metrics.nubia import Nubia
from ice.metrics.rouge import Rouge
@mark.skip(reason="Parses all PDFs - very slow")
@mark.s... | gold_paragraphs_df.columns | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_paper.py | test_pdf | assert | string_literal | 14 | from pathlib import Path
from ice.paper import Paper
def test_pdf():
script_path = Path(__file__).parent
paper = Paper.load(script_path / "../papers/keenan-2018.pdf")
sentences = list(paper.sentences())
assert (
sentences[0]
== "We hypothesized that mass distribution of a broad-spectru... | "Disclosure forms provided by the authors are available with the full text of this article at NEJM.org." | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_paper.py | test_txt | assert | string_literal | 14 | from pathlib import Path
from ice.paper import Paper
def test_txt():
script_path = Path(__file__).parent
paper = Paper.load(script_path / "../papers/keenan-2018-tiny.txt")
sentences = list(paper.sentences())
assert (
sentences[0]
== "In this cluster-randomized trial, we assigned commun... | "The proportion of children whose census status was recorded as moved or unknown did not differ significantly between the groups (P=0.71 and P=0.36, respectively)." | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_paper.py | test_txt | assert | string_literal | 10 | from pathlib import Path
from ice.paper import Paper
def test_txt():
script_path = Path(__file__).parent
paper = Paper.load(script_path / "../papers/keenan-2018-tiny.txt")
sentences = list(paper.sentences())
assert | "In this cluster-randomized trial, we assigned communities in Malawi, Niger, and Tanzania to four twice-yearly mass distributions of either oral azithromycin (approxi- mately 20 mg per kilogram of body weight) or placebo." | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_paper.py | test_pdf | assert | string_literal | 10 | from pathlib import Path
from ice.paper import Paper
def test_pdf():
script_path = Path(__file__).parent
paper = Paper.load(script_path / "../papers/keenan-2018.pdf")
sentences = list(paper.sentences())
assert | "We hypothesized that mass distribution of a broad-spectrum antibiotic agent to preschool children would reduce mortality in areas of sub-Saharan Africa that are currently far from meeting the Sustainable Development Goals of the United Nations." | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_trace.py | test_get_strings | assert | collection | 25 | import pandas as pd
import pytest
from ice import trace
def test_get_strings():
assert trace.get_strings("foo") == ["foo"]
assert trace.get_strings(["foo", "bar"]) == ["foo", "bar"]
assert trace.get_strings({"foo": "bar"}) == ["bar"]
# First descendant list of strings
assert trace.get_strings({"f... | ["0"] | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_trace.py | test_get_strings | assert | collection | 30 | import pandas as pd
import pytest
from ice import trace
def test_get_strings():
assert trace.get_strings("foo") == ["foo"]
assert trace.get_strings(["foo", "bar"]) == ["foo", "bar"]
assert trace.get_strings({"foo": "bar"}) == ["bar"]
# First descendant list of strings
assert trace.get_strings({"f... | ["1"] | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_trace.py | test_get_strings | assert | collection | 39 | import pandas as pd
import pytest
from ice import trace
def test_get_strings():
assert trace.get_strings("foo") == ["foo"]
assert trace.get_strings(["foo", "bar"]) == ["foo", "bar"]
assert trace.get_strings({"foo": "bar"}) == ["bar"]
# First descendant list of strings
assert trace.get_strings({"f... | ["b"] | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_trace.py | test_get_strings | assert | collection | 41 | import pandas as pd
import pytest
from ice import trace
def test_get_strings():
assert trace.get_strings("foo") == ["foo"]
assert trace.get_strings(["foo", "bar"]) == ["foo", "bar"]
assert trace.get_strings({"foo": "bar"}) == ["bar"]
# First descendant list of strings
assert trace.get_strings({"f... | ["d"] | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_trace.py | test_trace_blocks | assert | collection | 15 | import pandas as pd
import pytest
from ice import trace
@pytest.mark.anyio
async def test_trace_blocks():
trace.enable_trace()
current_trace = trace.trace_var.get()
assert trace.trace_enabled()
assert current_trace
long = "a" * trace.Trace.BLOCK_LENGTH
assert trace.emit_block("foo") == | (0, 0) | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_trace.py | test_trace_blocks | assert | collection | 16 | import pandas as pd
import pytest
from ice import trace
@pytest.mark.anyio
async def test_trace_blocks():
trace.enable_trace()
current_trace = trace.trace_var.get()
assert trace.trace_enabled()
assert current_trace
long = "a" * trace.Trace.BLOCK_LENGTH
assert trace.emit_block("foo") == (0, 0)... | (0, 1) | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_trace.py | test_trace_blocks | assert | collection | 17 | import pandas as pd
import pytest
from ice import trace
@pytest.mark.anyio
async def test_trace_blocks():
trace.enable_trace()
current_trace = trace.trace_var.get()
assert trace.trace_enabled()
assert current_trace
long = "a" * trace.Trace.BLOCK_LENGTH
assert trace.emit_block("foo") == (0, 0)... | (0, 2) | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_trace.py | test_trace_blocks | assert | collection | 18 | import pandas as pd
import pytest
from ice import trace
@pytest.mark.anyio
async def test_trace_blocks():
trace.enable_trace()
current_trace = trace.trace_var.get()
assert trace.trace_enabled()
assert current_trace
long = "a" * trace.Trace.BLOCK_LENGTH
assert trace.emit_block("foo") == (0, 0)... | (1, 0) | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_trace.py | test_trace_blocks | assert | collection | 19 | import pandas as pd
import pytest
from ice import trace
@pytest.mark.anyio
async def test_trace_blocks():
trace.enable_trace()
current_trace = trace.trace_var.get()
assert trace.trace_enabled()
assert current_trace
long = "a" * trace.Trace.BLOCK_LENGTH
assert trace.emit_block("foo") == (0, 0)... | (1, 1) | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_utils.py | test_nsmallest_async | assert | collection | 15 | import pytest
from ice.utils import nsmallest_async
async def cmp(x: int, y: int) -> int:
return x - y
@pytest.mark.anyio
async def test_nsmallest_async():
xs = [7, 8, 4, 3, 1, 6, 2, 0, 9, 5]
assert await nsmallest_async(3, xs, cmp) == [0, 1, 2]
assert xs == [7, 8, 4, 3, 1, 6, 2, 0, 9, 5]
asser... | [] | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
oughtinc/ice | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | train | train | tests/test_utils.py | test_nsmallest_async | assert | collection | 17 | import pytest
from ice.utils import nsmallest_async
async def cmp(x: int, y: int) -> int:
return x - y
@pytest.mark.anyio
async def test_nsmallest_async():
xs = [7, 8, 4, 3, 1, 6, 2, 0, 9, 5]
assert await nsmallest_async(3, xs, cmp) == [0, 1, 2]
assert xs == [7, 8, 4, 3, 1, 6, 2, 0, 9, 5]
assert... | [1] | 4c99ce4d98ed28df51c8b08690aa06fc3a6ea555 | 7 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/apiwrappers/test_fill_in_url_scheme.py | test_respects_passed_scheme | assert | string_literal | 5 | from pajbot.apiwrappers.base import BaseAPI
def test_respects_passed_scheme():
assert BaseAPI.fill_in_url_scheme("//example.com", "wss") == | "wss://example.com" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/apiwrappers/test_fill_in_url_scheme.py | test_does_not_change_non_relative_urls | assert | string_literal | 5 | from pajbot.apiwrappers.base import BaseAPI
def test_does_not_change_non_relative_urls():
assert BaseAPI.fill_in_url_scheme("http://example.com") == | "http://example.com" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/apiwrappers/test_fill_in_url_scheme.py | test_fills_in_relative_url | assert | string_literal | 5 | from pajbot.apiwrappers.base import BaseAPI
def test_fills_in_relative_url():
assert BaseAPI.fill_in_url_scheme("//example.com") == | "https://example.com" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/apiwrappers/test_join_base_and_endpoint.py | test_string_endpoint_no_leading_slash | assert | string_literal | 5 | from pajbot.apiwrappers.base import BaseAPI
def test_string_endpoint_no_leading_slash():
assert BaseAPI.join_base_and_endpoint("https://example.com/v1/", "test/def") == | "https://example.com/v1/test/def" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/apiwrappers/test_join_base_and_endpoint.py | test_list_endpoint_with_int_path_segment | assert | string_literal | 5 | from pajbot.apiwrappers.base import BaseAPI
def test_list_endpoint_with_int_path_segment():
assert ( | "https://example.com/v1/test/1234" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/apiwrappers/test_join_base_and_endpoint.py | test_list_endpoint_escaping | assert | string_literal | 5 | from pajbot.apiwrappers.base import BaseAPI
def test_list_endpoint_escaping():
assert | "https://example.com/v1/test/%2Fsome%20Data%2F" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/apiwrappers/test_join_base_and_endpoint.py | test_safebrowsing | assert | string_literal | 5 | from pajbot.apiwrappers.base import BaseAPI
def test_safebrowsing():
assert | "https://safebrowsing.googleapis.com/v4/threatMatches:find" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/modules/test_join_to_sentence.py | test_length_zero | assert | string_literal | 5 | from pajbot.modules.bingo import join_to_sentence
def test_length_zero():
assert join_to_sentence([]) == | "" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/modules/test_join_to_sentence.py | test_length_one | assert | string_literal | 5 | from pajbot.modules.bingo import join_to_sentence
def test_length_one():
assert join_to_sentence(["asd"]) == | "asd" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/modules/test_join_to_sentence.py | test_length_two | assert | string_literal | 5 | from pajbot.modules.bingo import join_to_sentence
def test_length_two():
assert join_to_sentence(["asd", "def"]) == | "asd and def" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/modules/test_join_to_sentence.py | test_length_three | assert | string_literal | 5 | from pajbot.modules.bingo import join_to_sentence
def test_length_three():
assert join_to_sentence(["asd", "def", "KKona"]) == | "asd, def and KKona" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/modules/test_join_to_sentence.py | test_custom_separators | assert | string_literal | 5 | from pajbot.modules.bingo import join_to_sentence
def test_custom_separators():
assert join_to_sentence(["asd", "def", "KKona", "xD"], ";", " et ") == | "asd;def;KKona et xD" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/modules/test_join_to_sentence.py | test_length_four | assert | string_literal | 5 | from pajbot.modules.bingo import join_to_sentence
def test_length_four():
assert join_to_sentence(["asd", "def", "KKona", "xD"]) == | "asd, def, KKona and xD" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/modules/test_remove_emotes_suffix.py | test_remove_emotes_suffix | assert | string_literal | 15 | from pajbot.modules.bingo import remove_emotes_suffix
def test_remove_emotes_suffix():
assert remove_emotes_suffix("kkona") == "kkona"
assert remove_emotes_suffix("kkona-emotes") == "kkona"
assert remove_emotes_suffix("kkona-emote") == "kkona"
assert remove_emotes_suffix("kkona_emotes") == "kkona"
... | "" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/modules/test_remove_emotes_suffix.py | test_remove_emotes_suffix | assert | string_literal | 5 | from pajbot.modules.bingo import remove_emotes_suffix
def test_remove_emotes_suffix():
assert remove_emotes_suffix("kkona") == | "kkona" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/modules/test_two_word_variations.py | test_two_word_variations | assert | collection | 5 | from pajbot.modules.bingo import two_word_variations
def test_two_word_variations() -> None:
assert two_word_variations("abc", "def", "KKona") == | { "abc-def": "KKona", "abc_def": "KKona", "abcdef": "KKona", "def-abc": "KKona", "def_abc": "KKona", "defabc": "KKona", } | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_clean_up_message.py | test_clean_up | assert | string_literal | 5 | def test_clean_up() -> None:
from pajbot.utils import clean_up_message
assert "" == "\U | "\U000e0000" | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_clean_up_message.py | test_clean_up | assert | func_call | 7 | def test_clean_up() -> None:
from pajbot.utils import clean_up_message
assert "" == "\U000e0000"
assert "" == | clean_up_message("") | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_clean_up_message.py | test_clean_up | assert | func_call | 9 | def test_clean_up() -> None:
from pajbot.utils import clean_up_message
assert "" == "\U000e0000"
assert "" == clean_up_message("")
assert "" == clean_up_message(" ")
assert "" == | clean_up_message(" ") | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_clean_up_message.py | test_clean_up | assert | func_call | 8 | def test_clean_up() -> None:
from pajbot.utils import clean_up_message
assert "" == "\U000e0000"
assert "" == clean_up_message("")
assert "" == | clean_up_message(" ") | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_clean_up_message.py | test_clean_up | assert | func_call | 15 | def test_clean_up() -> None:
from pajbot.utils import clean_up_message
assert "" == "\U000e0000"
assert "" == clean_up_message("")
assert "" == clean_up_message(" ")
assert "" == clean_up_message(" ")
assert ". .timeout pajlada 5" == clean_up_message(".timeout pajlada 5")
assert ". /ti... | clean_up_message(".me") | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_commands.py | test_command_permission_mod_only | assert | variable | 89 | def test_command_permission_mod_only():
from pajbot.models.command import Command
tests = [
[
"User with level 100 can execute command with level 100",
Command(mod_only=False, level=100), # Command to test agains
User(False, 100), # User to test with
Tr... | expected_result | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_find.py | test_find_iterate | assert | variable | 16 | def test_find_iterate():
from pajbot.utils import find
d = {
"foo": True,
"bar": True,
"xD": False,
}
haystack = ["foo", "baz", "bar"]
for k, v in d.items():
needle = find(lambda t: t == k, haystack)
if v:
assert needle == | k | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_find.py | test_find_iterate | assert | none_literal | 18 | def test_find_iterate():
from pajbot.utils import find
d = {
"foo": True,
"bar": True,
"xD": False,
}
haystack = ["foo", "baz", "bar"]
for k, v in d.items():
needle = find(lambda t: t == k, haystack)
if v:
assert needle == k
else:
... | None | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_iterate_split_with_index.py | test_empty_item | assert | collection | 10 | from pajbot.utils import iterate_split_with_index
import pytest
def test_empty_item() -> None:
# a bcd ef
generator = iterate_split_with_index(["a", "", "ef"])
assert next(generator) == (0, "a")
assert next(generator) == | (2, "") | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_iterate_split_with_index.py | test_iterates_correctly | assert | collection | 9 | from pajbot.utils import iterate_split_with_index
import pytest
def test_iterates_correctly() -> None:
# a bcd ef
generator = iterate_split_with_index(["a", "bcd", "ef"])
assert next(generator) == | (0, "a") | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_iterate_split_with_index.py | test_iterates_correctly | assert | collection | 11 | from pajbot.utils import iterate_split_with_index
import pytest
def test_iterates_correctly() -> None:
# a bcd ef
generator = iterate_split_with_index(["a", "bcd", "ef"])
assert next(generator) == (0, "a")
assert next(generator) == (2, "bcd")
assert next(generator) == | (6, "ef") | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_iterate_split_with_index.py | test_empty_item | assert | collection | 11 | from pajbot.utils import iterate_split_with_index
import pytest
def test_empty_item() -> None:
# a bcd ef
generator = iterate_split_with_index(["a", "", "ef"])
assert next(generator) == (0, "a")
assert next(generator) == (2, "")
assert next(generator) == | (3, "ef") | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_iterate_split_with_index.py | test_iterates_correctly | assert | collection | 10 | from pajbot.utils import iterate_split_with_index
import pytest
def test_iterates_correctly() -> None:
# a bcd ef
generator = iterate_split_with_index(["a", "bcd", "ef"])
assert next(generator) == (0, "a")
assert next(generator) == | (2, "bcd") | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_iterate_split_with_index.py | test_iterates_correctly | pytest.raises | variable | 12 | from pajbot.utils import iterate_split_with_index
import pytest
def test_iterates_correctly() -> None:
# a bcd ef
generator = iterate_split_with_index(["a", "bcd", "ef"])
assert next(generator) == (0, "a")
assert next(generator) == (2, "bcd")
assert next(generator) == (6, "ef")
with pytest.ra... | StopIteration) | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_parse_number_from_string.py | test_bad_conversions_full_string | pytest.raises | variable | 9 | from pajbot.utils import parse_number_from_string
import pytest
def test_bad_conversions_full_string() -> None:
input_value = "xd"
with pytest.raises( | ValueError) | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_parse_number_from_string.py | test_valid_int_conversions | assert | variable | 24 | from pajbot.utils import parse_number_from_string
import pytest
def test_valid_int_conversions() -> None:
# key = input
# value = expected value
tests = {
"1": 1,
"2": 2,
"3": 3,
"503": 503,
"-503": -503,
"503 ": 503, # Spaces are valid in int() and float()... | expected_value | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
pajbot/pajbot | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | train | train | pajbot/tests/test_parse_number_from_string.py | test_valid_int_conversions | assert | func_call | 23 | from pajbot.utils import parse_number_from_string
import pytest
def test_valid_int_conversions() -> None:
# key = input
# value = expected value
tests = {
"1": 1,
"2": 2,
"3": 3,
"503": 503,
"-503": -503,
"503 ": 503, # Spaces are valid in int() and float()... | type(expected_value) | aa8dc95e5ac2f14ad90109ea7880d6c4ce6f431d | 34 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.